反馈修改
This commit is contained in:
@@ -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