反馈修改
This commit is contained in:
@@ -118,6 +118,7 @@ export default {
|
||||
position: '26eae70fb5ff1c090d2dc7c3a0743948',
|
||||
},
|
||||
]
|
||||
console.log(this.deviceInfo)
|
||||
this.deviceInfo.appsLineTopologyDiagramPO.forEach((item1) => {
|
||||
if (item1.value.length === 0) {
|
||||
return
|
||||
|
||||
@@ -32,14 +32,14 @@
|
||||
<view class="item">模块一</view>
|
||||
<view class="item">
|
||||
<view class="status-point-success mr10"></view>
|
||||
<view style="width: 30rpx"> 15 </view>
|
||||
<view> °C </view>
|
||||
<view style="width: 30rpx"> 15</view>
|
||||
<view> °C</view>
|
||||
</view>
|
||||
<view class="item">模块二</view>
|
||||
<view class="item">
|
||||
<view class="status-point-error mr10"></view>
|
||||
<view style="width: 30rpx"> 0 </view>
|
||||
<view> °C </view>
|
||||
<view style="width: 30rpx"> 0</view>
|
||||
<view> °C</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -57,7 +57,7 @@
|
||||
v-for="(item, index) in navMenuList"
|
||||
:key="index"
|
||||
@click="navMenuClick(index)"
|
||||
>{{ item.text }}
|
||||
>{{ item.text }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -101,10 +101,11 @@ import xieBo from './comp/xieBo.vue'
|
||||
import power from './comp/power.vue'
|
||||
import oscillogram from './comp/oscillogram.vue'
|
||||
import IO from './comp/IO.vue'
|
||||
import { queryTopologyDiagram, deleteDevice } from '@/common/api/device'
|
||||
import { MQTT_IP, MQTT_OPTIONS } from '@/common/js/mqtt.js'
|
||||
import {queryTopologyDiagram, deleteDevice} from '@/common/api/device'
|
||||
import {MQTT_IP, MQTT_OPTIONS} from '@/common/js/mqtt.js'
|
||||
import mqtt from 'mqtt/dist/mqtt.js'
|
||||
import { base64ToPath, pathToBase64 } from 'image-tools'
|
||||
import {base64ToPath, pathToBase64} from 'image-tools'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
basic,
|
||||
@@ -203,17 +204,17 @@ export default {
|
||||
} else if (e.item.text === '下载') {
|
||||
this.$util.toast('下载成功')
|
||||
} else if (e.item.text === '记录') {
|
||||
uni.navigateTo({ url: '/pages/device/APF/record' })
|
||||
uni.navigateTo({url: '/pages/device/APF/record'})
|
||||
} else if (e.item.text === '告警') {
|
||||
uni.navigateTo({ url: '/pages/device/APF/report' })
|
||||
uni.navigateTo({url: '/pages/device/APF/report'})
|
||||
} else if (e.item.text === '关于') {
|
||||
uni.navigateTo({ url: '/pages/device/APF/about?id=' + this.devId })
|
||||
uni.navigateTo({url: '/pages/device/APF/about?id=' + this.devId})
|
||||
} else if (e.item.text === '移交') {
|
||||
uni.navigateTo({ url: '/pages/device/transfer?id=' + this.devId })
|
||||
uni.navigateTo({url: '/pages/device/transfer?id=' + this.devId})
|
||||
} else if (e.item.text === '反馈') {
|
||||
uni.navigateTo({ url: '/pages/device/feedback' })
|
||||
uni.navigateTo({url: '/pages/device/feedback'})
|
||||
} else if (e.item.text === '用户') {
|
||||
uni.navigateTo({ url: '/pages/device/user' })
|
||||
uni.navigateTo({url: '/pages/device/user'})
|
||||
} else if (e.item.text === '报表') {
|
||||
this.$util.toast('效果是直接打开报表')
|
||||
} else if (e.item.text === '版本') {
|
||||
@@ -221,15 +222,19 @@ export default {
|
||||
} else if (e.item.text === '模版') {
|
||||
this.$util.toast('效果是功能暂未开放直接打开报表')
|
||||
} else if (e.item.text === '编辑') {
|
||||
let data = JSON.parse(JSON.stringify(this.deviceInfo))
|
||||
data.appsLineTopologyDiagramPO.forEach((item) => {
|
||||
delete item.value
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/edit?deviceInfo=' + encodeURIComponent(JSON.stringify(this.deviceInfo)),
|
||||
url: '/pages/device/edit?deviceInfo=' + encodeURIComponent(JSON.stringify(data)),
|
||||
})
|
||||
}
|
||||
this.$refs.fab.close()
|
||||
},
|
||||
navMenuClick(idx) {
|
||||
this.navMenuActive = idx
|
||||
uni.pageScrollTo({ scrollTop: 0, duration: 0 })
|
||||
uni.pageScrollTo({scrollTop: 0, duration: 0})
|
||||
},
|
||||
init() {
|
||||
if (this.isPrimaryUser == 1) {
|
||||
@@ -358,7 +363,7 @@ export default {
|
||||
this.init()
|
||||
queryTopologyDiagram(options.id).then((res) => {
|
||||
this.deviceInfo = res.data
|
||||
uni.setNavigationBarTitle({ title: this.deviceInfo.devName || '设备详情' })
|
||||
uni.setNavigationBarTitle({title: this.deviceInfo.devName || '设备详情'})
|
||||
this.dictData.forEach((item) => {
|
||||
if (item.code == 'Line_Position') {
|
||||
item.children.forEach((item2) => {
|
||||
@@ -387,6 +392,7 @@ export default {
|
||||
height: 100%;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.header {
|
||||
position: relative;
|
||||
width: 375px;
|
||||
@@ -399,6 +405,7 @@ export default {
|
||||
image-rendering: crisp-edges;
|
||||
-ms-interpolation-mode: nearest-neighbor;
|
||||
}
|
||||
|
||||
.point {
|
||||
position: absolute;
|
||||
color: #111;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<uni-forms>
|
||||
<uni-forms-item label="设备识别码">
|
||||
<view style="display: flex">
|
||||
<uni-easyinput type="text" v-model="formData.nDid" placeholder="请输入设备识别码" />
|
||||
<uni-easyinput type="text" v-model="formData.nDid" placeholder="请输入设备识别码"/>
|
||||
<uni-icons
|
||||
type="camera"
|
||||
color="#007aff"
|
||||
@@ -18,25 +18,35 @@
|
||||
</uni-forms>
|
||||
</view>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item" @click="register"> 发起注册 </view>
|
||||
<view class="btn-wrap-item" @click="register"> 发起注册</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="content">
|
||||
<uni-forms>
|
||||
<uni-forms-item label="项目">
|
||||
<uni-data-select
|
||||
v-model="formData.projectId"
|
||||
:localdata="projectRange"
|
||||
@change="queryTopologyDiagramPage"
|
||||
></uni-data-select>
|
||||
<view style="display: flex;align-items: center">
|
||||
<uni-data-select
|
||||
v-model="formData.projectId"
|
||||
:localdata="projectRange"
|
||||
@change="queryTopologyDiagramPage"
|
||||
></uni-data-select>
|
||||
<uni-icons
|
||||
type="plusempty"
|
||||
color="#007aff"
|
||||
size="26"
|
||||
class="ml20"
|
||||
@click="createProject"
|
||||
></uni-icons>
|
||||
</view>
|
||||
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="型号">
|
||||
<uni-data-select v-model="formData.type" :localdata="typeRange"
|
||||
@change="typeChange(item)"></uni-data-select>
|
||||
</uni-forms-item> -->
|
||||
<uni-forms-item label="位置">
|
||||
<view style="display: flex">
|
||||
<view style="display: flex;">
|
||||
<uni-easyinput
|
||||
:clearable="false"
|
||||
type="textarea"
|
||||
@@ -44,22 +54,22 @@
|
||||
v-model="formData.area"
|
||||
placeholder="请输入位置信息"
|
||||
/>
|
||||
<!-- <uni-icons
|
||||
<uni-icons
|
||||
type="location"
|
||||
color="#007aff"
|
||||
size="26"
|
||||
class="ml20"
|
||||
@click="chooseLocation"
|
||||
></uni-icons> -->
|
||||
></uni-icons>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="拓扑图" v-if="formData.projectId">
|
||||
<view style="display: flex">
|
||||
<view style="flex: 1">
|
||||
<view v-if="formData.topologyDiagramUrl">
|
||||
<image :src="formData.topologyDiagramUrl" style="width: 100%" mode="widthFix" />
|
||||
<image :src="formData.topologyDiagramUrl" style="width: 100%" mode="widthFix"/>
|
||||
</view>
|
||||
<view v-else class="gplot gplot-empty center" @click="chooseGplot"> 选择拓扑图 </view>
|
||||
<view v-else class="gplot gplot-empty center" @click="chooseGplot"> 选择拓扑图</view>
|
||||
</view>
|
||||
<uni-icons
|
||||
type="image"
|
||||
@@ -84,10 +94,10 @@
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
<image class="gplot-image" ref="gplot-image" :src="formData.topologyDiagramUrl" mode="widthFix" />
|
||||
<image class="gplot-image" ref="gplot-image" :src="formData.topologyDiagramUrl" mode="widthFix"/>
|
||||
<view class="btn-wrap">
|
||||
<!-- <view class="btn-wrap-item" @click="add"> 添加监测点 </view> -->
|
||||
<view class="btn-wrap-item" @click="submit"> 提交 </view>
|
||||
<view class="btn-wrap-item" @click="submit"> 提交</view>
|
||||
</view>
|
||||
<uni-drawer ref="gplot" mode="right" :mask-click="false">
|
||||
<scroll-view style="height: 100%" scroll-y="true">
|
||||
@@ -101,9 +111,10 @@
|
||||
v-for="(item, key) in imageList"
|
||||
:key="key"
|
||||
/>
|
||||
<view v-if="imageList.length === 0" style="text-align: center" class="mt50 mb50">暂无拓扑图</view>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item" @click="closeDrawer"> 取消 </view>
|
||||
<view class="btn-wrap-item ml20" @click="confirmGplot"> 确定 </view>
|
||||
<view class="btn-wrap-item" @click="closeDrawer"> 取消</view>
|
||||
<view class="btn-wrap-item ml20" @click="confirmGplot"> 确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@@ -112,7 +123,7 @@
|
||||
<scroll-view style="height: 100%" scroll-y="true">
|
||||
<view style="background: #fff">
|
||||
<view class="map-pin-box">
|
||||
<image class="gplot" mode="widthFix" :src="formData.topologyDiagramUrl" />
|
||||
<image class="gplot" mode="widthFix" :src="formData.topologyDiagramUrl"/>
|
||||
|
||||
<movable-area class="map-pin-box-area">
|
||||
<movable-view :x="point.lat" :y="point.lng" direction="all" @change="dragPoint">
|
||||
@@ -141,8 +152,8 @@
|
||||
/>
|
||||
</uni-forms>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item" @click="closeDrawer"> 取消 </view>
|
||||
<view class="btn-wrap-item ml20" @click="addPoint"> 确定 </view>
|
||||
<view class="btn-wrap-item" @click="closeDrawer"> 取消</view>
|
||||
<view class="btn-wrap-item ml20" @click="addPoint"> 确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@@ -151,13 +162,14 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { registerDevice, getModel, addDevice, queryByTopoId } from '@/common/api/device.js'
|
||||
import { getProjectList, queryTopologyDiagramPage } from '@/common/api/project.js'
|
||||
import {registerDevice, getModel, addDevice, queryByTopoId} from '@/common/api/device.js'
|
||||
import {getProjectList, queryTopologyDiagramPage} from '@/common/api/project.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
type: 1,
|
||||
type: 2,
|
||||
formData: {
|
||||
nDid: '',
|
||||
area: '',
|
||||
@@ -174,7 +186,22 @@ export default {
|
||||
isAdaptive: false, // 是否适应当前项目
|
||||
}
|
||||
},
|
||||
created() {
|
||||
onLoad() {
|
||||
|
||||
let dictData = uni.getStorageSync(this.$cacheKey.dictData)
|
||||
dictData.forEach((item) => {
|
||||
if (item.code == 'Line_Position') {
|
||||
this.positionList = item.children.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
text: item.name,
|
||||
value: item.id,
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
let engineering = uni.getStorageSync(this.$cacheKey.engineering)
|
||||
getProjectList({
|
||||
pageNum: 1,
|
||||
@@ -193,21 +220,14 @@ export default {
|
||||
]
|
||||
this.projectRange = arr
|
||||
})
|
||||
let dictData = uni.getStorageSync(this.$cacheKey.dictData)
|
||||
dictData.forEach((item) => {
|
||||
if (item.code == 'Line_Position') {
|
||||
this.positionList = item.children.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
text: item.name,
|
||||
value: item.id,
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
resize(){
|
||||
createProject() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/project/new?from=newDevice',
|
||||
})
|
||||
},
|
||||
resize() {
|
||||
console.log(this.$refs['gplot-image']);
|
||||
},
|
||||
confirmGplot() {
|
||||
@@ -240,7 +260,12 @@ export default {
|
||||
}).then((res) => {
|
||||
this.imageList = res.data.records
|
||||
this.activeGplot = 0
|
||||
this.confirmGplot()
|
||||
if (this.imageList.length) {
|
||||
this.confirmGplot()
|
||||
} else {
|
||||
this.formData.topologyDiagramUrl = ''
|
||||
this.formData.topologyDiagram = ''
|
||||
}
|
||||
})
|
||||
}, 100)
|
||||
},
|
||||
@@ -250,7 +275,8 @@ export default {
|
||||
positionChange(e) {
|
||||
console.log(e)
|
||||
},
|
||||
projectChange(e) {},
|
||||
projectChange(e) {
|
||||
},
|
||||
scanCode() {
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
@@ -355,7 +381,7 @@ export default {
|
||||
console.log(res)
|
||||
this.$util.toast('提交成功')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({ delta: 1 })
|
||||
uni.navigateBack({delta: 1})
|
||||
}, 1500)
|
||||
})
|
||||
},
|
||||
@@ -396,6 +422,7 @@ export default {
|
||||
width: 100%;
|
||||
height: 188rpx;
|
||||
}
|
||||
|
||||
.gplot-empty {
|
||||
margin: 0 auto;
|
||||
border: 1px dashed #dcdfe6;
|
||||
@@ -473,6 +500,7 @@ export default {
|
||||
.point-item:first-of-type {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.gplot-image {
|
||||
position: absolute;
|
||||
left: -9999px;
|
||||
|
||||
Reference in New Issue
Block a user