问题反馈修改
This commit is contained in:
@@ -144,10 +144,10 @@ export default {
|
||||
iconPath: '/static/report.png',
|
||||
text: '告警',
|
||||
},
|
||||
{
|
||||
iconPath: '/static/record.png',
|
||||
text: '记录',
|
||||
},
|
||||
// {
|
||||
// iconPath: '/static/record.png',
|
||||
// text: '记录',
|
||||
// },
|
||||
{
|
||||
iconPath: '/static/about.png',
|
||||
text: '关于',
|
||||
@@ -208,7 +208,7 @@ export default {
|
||||
trigger(e) {
|
||||
console.log(e)
|
||||
if (e.item.text === '分享') {
|
||||
this.$refs.share.open()
|
||||
uni.navigateTo({url: '/pages/device/share?id=' + this.devId})
|
||||
} else if (e.item.text === '删除') {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
|
||||
@@ -111,8 +111,8 @@
|
||||
<view class="content-des">请拖动图中的蓝色定位图标选择监测点位置(左上角)</view>
|
||||
<uni-forms>
|
||||
<uni-data-select
|
||||
v-model="point.position"
|
||||
:localdata="positionListRange"
|
||||
v-model="point.linePostion"
|
||||
:localdata="positionList"
|
||||
@change="positionChange"
|
||||
></uni-data-select>
|
||||
<uni-easyinput
|
||||
@@ -159,16 +159,6 @@ export default {
|
||||
deviceInfo: {},
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
positionListRange(){
|
||||
return this.positionList.map(item => {
|
||||
return {
|
||||
...item,
|
||||
disable: this.point.linePostion !== item.id && this.pointList.some(item2 => item2.linePostion === item.id)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.deviceInfo = JSON.parse(decodeURIComponent(options.deviceInfo))
|
||||
console.log(this.deviceInfo)
|
||||
@@ -178,7 +168,6 @@ export default {
|
||||
return {
|
||||
...item,
|
||||
name: item.label,
|
||||
position: item.linePostion,
|
||||
}
|
||||
})
|
||||
console.log(this.pointList, 'this.poinitList')
|
||||
@@ -224,10 +213,9 @@ export default {
|
||||
this.formData.topologyDiagramUrl = this.imageList[this.activeGplot].filePath
|
||||
this.formData.topologyDiagram = this.imageList[this.activeGplot].id
|
||||
this.pointList.forEach((item) => {
|
||||
console.log(item.position)
|
||||
this.imageList[this.activeGplot].csLineTopologyTemplateVOList.forEach((item3) => {
|
||||
console.log(item3.linePostion)
|
||||
if (item3.linePostion === item.position) {
|
||||
if (item3.linePostion === item.linePostion) {
|
||||
item.lat = item3.lat
|
||||
item.lng = item3.lng
|
||||
}
|
||||
@@ -311,7 +299,7 @@ export default {
|
||||
this.$refs.point.open()
|
||||
},
|
||||
addPoint() {
|
||||
if (!this.point.position) {
|
||||
if (!this.point.linePostion) {
|
||||
this.$util.toast('请选择监测点')
|
||||
return
|
||||
}
|
||||
@@ -319,13 +307,15 @@ export default {
|
||||
this.point.name = this.point.alias
|
||||
} else {
|
||||
this.positionList.forEach((item) => {
|
||||
if (item.id == this.point.position) {
|
||||
if (item.id === this.point.linePostion) {
|
||||
this.point.name = item.name
|
||||
}
|
||||
})
|
||||
}
|
||||
this.point.lat = this.point.coordinate.x
|
||||
this.point.lng = this.point.coordinate.y
|
||||
if (this.point.coordinate) {
|
||||
this.point.lat = this.point.coordinate.x
|
||||
this.point.lng = this.point.coordinate.y
|
||||
}
|
||||
this.pointList[this.editIndex] = this.point
|
||||
console.log(this.pointList)
|
||||
this.closeDrawer()
|
||||
@@ -360,6 +350,16 @@ export default {
|
||||
// this.point.lng = e.detail.y
|
||||
},
|
||||
submit() {
|
||||
// 检查pointLlist监测点是否重复,并给出提示
|
||||
let arr = []
|
||||
this.pointList.forEach((item) => {
|
||||
arr.push(item.linePostion)
|
||||
})
|
||||
let set = new Set(arr)
|
||||
if (set.size !== arr.length) {
|
||||
this.$util.toast('监测点不能重复')
|
||||
return
|
||||
}
|
||||
updateDevice({
|
||||
pointList: this.pointList,
|
||||
id: this.imageList[this.activeGplot].id
|
||||
|
||||
@@ -45,24 +45,24 @@
|
||||
<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;">-->
|
||||
<!-- <uni-easyinput-->
|
||||
<!-- :clearable="false"-->
|
||||
<!-- type="textarea"-->
|
||||
<!-- autoHeight-->
|
||||
<!-- v-model="formData.area"-->
|
||||
<!-- placeholder="请输入位置信息"-->
|
||||
<!-- />-->
|
||||
<!-- <uni-icons-->
|
||||
<!-- type="location"-->
|
||||
<!-- color="#007aff"-->
|
||||
<!-- size="26"-->
|
||||
<!-- class="ml20"-->
|
||||
<!-- @click="chooseLocation"-->
|
||||
<!-- ></uni-icons>-->
|
||||
<!-- </view>-->
|
||||
<!-- </uni-forms-item>-->
|
||||
<!-- <uni-forms-item label="位置">-->
|
||||
<!-- <view style="display: flex;">-->
|
||||
<!-- <uni-easyinput-->
|
||||
<!-- :clearable="false"-->
|
||||
<!-- type="textarea"-->
|
||||
<!-- autoHeight-->
|
||||
<!-- v-model="formData.area"-->
|
||||
<!-- placeholder="请输入位置信息"-->
|
||||
<!-- />-->
|
||||
<!-- <uni-icons-->
|
||||
<!-- type="location"-->
|
||||
<!-- color="#007aff"-->
|
||||
<!-- size="26"-->
|
||||
<!-- class="ml20"-->
|
||||
<!-- @click="chooseLocation"-->
|
||||
<!-- ></uni-icons>-->
|
||||
<!-- </view>-->
|
||||
<!-- </uni-forms-item>-->
|
||||
<uni-forms-item label="拓扑图" v-if="formData.projectId">
|
||||
<view style="display: flex">
|
||||
<view style="flex: 1">
|
||||
@@ -111,7 +111,8 @@
|
||||
v-for="(item, key) in imageList"
|
||||
:key="key"
|
||||
/>
|
||||
<view v-if="imageList.length === 0" style="text-align: center" class="mt50 mb50">暂无拓扑图</view>
|
||||
<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>
|
||||
@@ -139,7 +140,7 @@
|
||||
<uni-forms>
|
||||
<uni-data-select
|
||||
v-model="point.position"
|
||||
:localdata="positionListRange"
|
||||
:localdata="positionList"
|
||||
@change="positionChange"
|
||||
></uni-data-select>
|
||||
<uni-easyinput
|
||||
@@ -183,16 +184,20 @@ export default {
|
||||
positionList: [],
|
||||
imageList: [],
|
||||
isAdaptive: false, // 是否适应当前项目
|
||||
dialogOpen: false
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
positionListRange(){
|
||||
return this.positionList.map(item => {
|
||||
return {
|
||||
...item,
|
||||
disable: this.point.linePostion !== item.id && this.pointList.some(item2 => item2.linePostion === item.id)
|
||||
}
|
||||
})
|
||||
onBackPress() {
|
||||
if (this.dialogOpen) {
|
||||
this.closeDrawer()
|
||||
return true
|
||||
} else if (this.type === 3) {
|
||||
return false
|
||||
} else if (this.type === 2) {
|
||||
this.type = 1
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
@@ -287,7 +292,7 @@ export default {
|
||||
},
|
||||
scanCode() {
|
||||
uni.scanCode({
|
||||
success (res) {
|
||||
success(res) {
|
||||
console.log('条码类型:' + res.scanType)
|
||||
console.log('条码内容:' + res.result)
|
||||
let content = JSON.parse(res.result)
|
||||
@@ -329,10 +334,12 @@ export default {
|
||||
},
|
||||
chooseGplot() {
|
||||
this.$refs.gplot.open()
|
||||
this.dialogOpen = true
|
||||
},
|
||||
closeDrawer() {
|
||||
this.$refs.gplot.close()
|
||||
this.$refs.point.close()
|
||||
this.dialogOpen = false
|
||||
},
|
||||
add() {
|
||||
this.$refs.point.open()
|
||||
@@ -351,8 +358,10 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
this.point.lat = this.point.coordinate.x
|
||||
this.point.lng = this.point.coordinate.y
|
||||
if (this.point.coordinate) {
|
||||
this.point.lat = this.point.coordinate.x
|
||||
this.point.lng = this.point.coordinate.y
|
||||
}
|
||||
this.pointList[this.editIndex] = this.point
|
||||
console.log(this.pointList)
|
||||
this.closeDrawer()
|
||||
@@ -373,6 +382,7 @@ export default {
|
||||
this.point.alias = ''
|
||||
}
|
||||
}
|
||||
this.dialogOpen = true
|
||||
this.$refs.point.open()
|
||||
this.$forceUpdate()
|
||||
},
|
||||
@@ -392,6 +402,16 @@ export default {
|
||||
if (!this.formData.topologyDiagram) {
|
||||
return this.$util.toast('请选择拓扑图')
|
||||
}
|
||||
// 检查pointLlist监测点是否重复,并给出提示
|
||||
let arr = []
|
||||
this.pointList.forEach((item) => {
|
||||
arr.push(item.position)
|
||||
})
|
||||
let set = new Set(arr)
|
||||
if (set.size !== arr.length) {
|
||||
this.$util.toast('监测点不能重复')
|
||||
return
|
||||
}
|
||||
addDevice({
|
||||
...this.formData,
|
||||
list: this.pointList,
|
||||
@@ -400,6 +420,7 @@ export default {
|
||||
console.log(res)
|
||||
this.$util.toast('提交成功')
|
||||
setTimeout(() => {
|
||||
this.type = 3
|
||||
uni.navigateBack({delta: 1})
|
||||
}, 1500)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user