t
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"
|
||||
@@ -25,7 +25,7 @@
|
||||
<view class="content">
|
||||
<uni-forms>
|
||||
<uni-forms-item label="项目">
|
||||
<view style="display: flex;align-items: center">
|
||||
<view style="display: flex; align-items: center">
|
||||
<uni-data-select
|
||||
v-model="formData.projectId"
|
||||
:localdata="projectRange"
|
||||
@@ -39,7 +39,6 @@
|
||||
@click="createProject"
|
||||
></uni-icons>
|
||||
</view>
|
||||
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="型号">
|
||||
<uni-data-select v-model="formData.type" :localdata="typeRange"
|
||||
@@ -67,7 +66,7 @@
|
||||
<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>
|
||||
@@ -94,7 +93,7 @@
|
||||
</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>
|
||||
@@ -111,7 +110,8 @@
|
||||
v-for="(item, key) in imageList"
|
||||
:key="key"
|
||||
/>
|
||||
<view v-if="imageList.length === 0" style="text-align: center" class="mt50 mb50">暂无拓扑图
|
||||
<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>
|
||||
@@ -124,7 +124,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">
|
||||
@@ -163,8 +163,8 @@
|
||||
</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() {
|
||||
@@ -184,7 +184,8 @@ export default {
|
||||
positionList: [],
|
||||
imageList: [],
|
||||
isAdaptive: false, // 是否适应当前项目
|
||||
dialogOpen: false
|
||||
dialogOpen: false,
|
||||
options: {},
|
||||
}
|
||||
},
|
||||
onBackPress() {
|
||||
@@ -200,7 +201,8 @@ export default {
|
||||
return false
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
onLoad(o) {
|
||||
this.options = o
|
||||
let dictData = uni.getStorageSync(this.$cacheKey.dictData)
|
||||
dictData.forEach((item) => {
|
||||
if (item.code == 'Line_Position') {
|
||||
@@ -241,7 +243,7 @@ export default {
|
||||
})
|
||||
},
|
||||
resize() {
|
||||
console.log(this.$refs['gplot-image']);
|
||||
console.log(this.$refs['gplot-image'])
|
||||
},
|
||||
confirmGplot() {
|
||||
this.formData.topologyDiagramUrl = this.imageList[this.activeGplot].filePath
|
||||
@@ -271,10 +273,10 @@ export default {
|
||||
queryTopologyDiagramPage({
|
||||
projectId: this.formData.projectId,
|
||||
}).then((res) => {
|
||||
this.imageList = res.data.records.map(item => {
|
||||
this.imageList = res.data.records.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
filePath: this.$config.static + item.filePath
|
||||
filePath: this.$config.static + item.filePath,
|
||||
}
|
||||
})
|
||||
this.activeGplot = 0
|
||||
@@ -293,8 +295,7 @@ export default {
|
||||
positionChange(e) {
|
||||
console.log(e)
|
||||
},
|
||||
projectChange(e) {
|
||||
},
|
||||
projectChange(e) {},
|
||||
scanCode() {
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
@@ -422,12 +423,13 @@ export default {
|
||||
...this.formData,
|
||||
list: this.pointList,
|
||||
ndid: this.formData.nDid,
|
||||
process: Number(this.options.type),
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
this.$util.toast('提交成功')
|
||||
setTimeout(() => {
|
||||
this.type = 3
|
||||
uni.navigateBack({delta: 1})
|
||||
uni.navigateBack({ delta: 1 })
|
||||
}, 1500)
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user