绘制电脑治理信息页面
This commit is contained in:
@@ -6,13 +6,8 @@
|
||||
<uni-forms-item label="设备识别码">
|
||||
<view style="display: flex">
|
||||
<uni-easyinput type="text" v-model="formData.nDid" placeholder="请输入设备识别码" />
|
||||
<uni-icons
|
||||
type="camera"
|
||||
color="#007aff"
|
||||
size="26"
|
||||
class="ml20"
|
||||
@click="scanCode"
|
||||
></uni-icons>
|
||||
<uni-icons type="camera" color="#007aff" size="26" class="ml20"
|
||||
@click="scanCode"></uni-icons>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
@@ -28,36 +23,18 @@
|
||||
<uni-forms>
|
||||
<uni-forms-item label="工程">
|
||||
<view style="display: flex; align-items: center">
|
||||
<uni-data-select
|
||||
v-model="formData.engineeringId"
|
||||
:localdata="engineeringList"
|
||||
@change="engineeringChang($event, true)"
|
||||
:clear="false"
|
||||
></uni-data-select>
|
||||
<uni-icons
|
||||
type="plusempty"
|
||||
color="#007aff"
|
||||
size="26"
|
||||
class="ml20"
|
||||
@click="createEngineering"
|
||||
></uni-icons>
|
||||
<uni-data-select v-model="formData.engineeringId" :localdata="engineeringList"
|
||||
@change="engineeringChang($event, true)" :clear="false"></uni-data-select>
|
||||
<uni-icons type="plusempty" color="#007aff" size="26" class="ml20"
|
||||
@click="createEngineering"></uni-icons>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="项目">
|
||||
<view style="display: flex; align-items: center">
|
||||
<uni-data-select
|
||||
v-model="formData.projectId"
|
||||
:localdata="projectRange"
|
||||
@change="queryTopologyDiagramPage"
|
||||
:clear="false"
|
||||
></uni-data-select>
|
||||
<uni-icons
|
||||
type="plusempty"
|
||||
color="#007aff"
|
||||
size="26"
|
||||
class="ml20"
|
||||
@click="createProject"
|
||||
></uni-icons>
|
||||
<uni-data-select v-model="formData.projectId" :localdata="projectRange"
|
||||
@change="queryTopologyDiagramPage" :clear="false"></uni-data-select>
|
||||
<uni-icons type="plusempty" color="#007aff" size="26" class="ml20"
|
||||
@click="createProject"></uni-icons>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
|
||||
@@ -69,25 +46,14 @@
|
||||
</view>
|
||||
<view v-else class="gplot gplot-empty center" @click="chooseGplot"> 选择拓扑图</view>
|
||||
</view>
|
||||
<uni-icons
|
||||
type="image"
|
||||
color="#007aff"
|
||||
size="26"
|
||||
class="ml20"
|
||||
@click="chooseGplot"
|
||||
></uni-icons>
|
||||
<uni-icons type="image" color="#007aff" size="26" class="ml20"
|
||||
@click="chooseGplot"></uni-icons>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item
|
||||
label="监测点"
|
||||
v-if="pointList.length && formData.topologyDiagramUrl && formData.projectId"
|
||||
>
|
||||
<view
|
||||
class="point-item"
|
||||
v-for="(item2, index2) in pointList"
|
||||
:key="index2"
|
||||
@click="editPoint(item2, index2)"
|
||||
>
|
||||
<uni-forms-item label="监测点"
|
||||
v-if="pointList.length && formData.topologyDiagramUrl && formData.projectId">
|
||||
<view class="point-item" v-for="(item2, index2) in pointList" :key="index2"
|
||||
@click="editPoint(item2, index2)">
|
||||
<view style="flex: 1" v-if="item2.name">{{ item2.name }}</view>
|
||||
<view style="flex: 1; color: #999" v-else>请选择监测点</view>
|
||||
<uni-icons type="compose" color="#007aff" size="26" class="ml20"></uni-icons>
|
||||
@@ -106,17 +72,10 @@
|
||||
<uni-drawer ref="gplot" mode="right" :mask-click="false">
|
||||
<scroll-view style="height: 100%" scroll-y="true">
|
||||
<view class="content">
|
||||
<image
|
||||
class="gplot gplot-box"
|
||||
mode="aspectFill"
|
||||
:class="{ 'gplot-active': key == activeGplot }"
|
||||
:src="item.filePath"
|
||||
@click="activeGplot = key"
|
||||
v-for="(item, key) in imageList"
|
||||
:key="key"
|
||||
/>
|
||||
<view v-if="imageList.length === 0" style="text-align: center" class="mt50 mb50"
|
||||
>暂无拓扑图
|
||||
<image class="gplot gplot-box" mode="aspectFill" :class="{ 'gplot-active': key == activeGplot }"
|
||||
:src="item.filePath" @click="activeGplot = key" 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>
|
||||
@@ -142,22 +101,18 @@
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="content-des">请拖动图中的文字选择监测点位置</view>
|
||||
<uni-forms>
|
||||
<uni-data-select
|
||||
v-model="point.position"
|
||||
:localdata="positionList"
|
||||
@change="positionChange"
|
||||
disabled
|
||||
:clear="false"
|
||||
></uni-data-select>
|
||||
<uni-easyinput
|
||||
:clearable="false"
|
||||
class="mt20"
|
||||
type="text"
|
||||
v-model="point.alias"
|
||||
@change="aliasChange"
|
||||
placeholder="别名(非必填)"
|
||||
/>
|
||||
<uni-forms labelWidth="70px">
|
||||
<uni-forms-item label="位置">
|
||||
<uni-data-select v-model="point.position" :localdata="positionList"
|
||||
@change="positionChange" disabled :clear="false"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="别名">
|
||||
<uni-easyinput :clearable="false" type="text" v-model="point.alias"
|
||||
@change="aliasChange" placeholder="别名(非必填)" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="绑定指标">
|
||||
<uni-data-select v-model="point.target" :localdata="targetList"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item" @click="closeDrawer"> 取消</view>
|
||||
@@ -181,6 +136,7 @@ import {
|
||||
} from '@/common/api/device.js'
|
||||
import { getProjectList, queryTopologyDiagramPage } from '@/common/api/project.js'
|
||||
import ykAuthpup from '@/components/yk-authpup/yk-authpup'
|
||||
import { queryByCode, queryStatistical } from '@/common/api/dictionary'
|
||||
export default {
|
||||
components: {
|
||||
ykAuthpup,
|
||||
@@ -204,6 +160,8 @@ export default {
|
||||
activeGplot: 0,
|
||||
positionList: [],
|
||||
imageList: [],
|
||||
targetLists: [],//总数据
|
||||
targetList: [],//根据位置切换数据
|
||||
isAdaptive: false, // 是否适应当前项目
|
||||
dialogOpen: false,
|
||||
options: {},
|
||||
@@ -226,9 +184,20 @@ export default {
|
||||
onLoad(o) {
|
||||
this.options = o
|
||||
let dictData = uni.getStorageSync(this.$cacheKey.dictData)
|
||||
queryByCode('app_harmonic_code').then((res) => {
|
||||
queryStatistical({ id: res.data.id }).then((resp) => {
|
||||
this.targetLists = resp.data.selectedList.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
text: item.dataTypeName,
|
||||
value: item.dataType,
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
dictData.forEach((item) => {
|
||||
if (item.code == 'Line_Position') {
|
||||
this.positionList = item.children.map((item) => {
|
||||
this.positionList = item.children.filter((child) => child.name !== 'PCC公共点').map((item) => {
|
||||
return {
|
||||
...item,
|
||||
text: item.name,
|
||||
@@ -264,6 +233,19 @@ export default {
|
||||
// })
|
||||
},
|
||||
methods: {
|
||||
// 设置绑定指标
|
||||
settarget(e) {
|
||||
let pointName = this.positionList.find((item) => item.id == this.point.position).name
|
||||
|
||||
this.targetList = this.targetLists.filter(item => item.dataTypeName.includes(pointName)).map((item) => {
|
||||
return {
|
||||
...item,
|
||||
text: item.dataTypeName.split('-')[1],
|
||||
value: item.dataType,
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
getEngineering() {
|
||||
queryEngineeringPage({ pageNum: 1, pageSize: 9999 }).then((res) => {
|
||||
let arr = [
|
||||
@@ -377,7 +359,7 @@ export default {
|
||||
console.log(e)
|
||||
},
|
||||
|
||||
projectChange(e) {},
|
||||
projectChange(e) { },
|
||||
scanCode() {
|
||||
if (plus.os.name == 'Android') {
|
||||
this.$refs['authpup'].open()
|
||||
@@ -509,6 +491,7 @@ export default {
|
||||
this.point.alias = ''
|
||||
}
|
||||
}
|
||||
this.settarget()
|
||||
this.dialogOpen = true
|
||||
this.$refs.point.open()
|
||||
this.$forceUpdate()
|
||||
|
||||
Reference in New Issue
Block a user