diff --git a/src/views/deviceManage/deviceModel/components/editDeviceModel.vue b/src/views/deviceManage/deviceModel/components/editDeviceModel.vue index fb76377..4c6e553 100644 --- a/src/views/deviceManage/deviceModel/components/editDeviceModel.vue +++ b/src/views/deviceManage/deviceModel/components/editDeviceModel.vue @@ -8,7 +8,7 @@ ref="dataForm" :rules="rules" :model="deviceForm" - label-width="100px" + label-width="80px" label-well-code="right" > @@ -39,15 +39,15 @@ - + + + diff --git a/src/views/deviceManage/deviceModel/components/editDeviceModel.vue b/src/views/deviceManage/deviceModel/components/editDeviceModel.vue index fb76377..4c6e553 100644 --- a/src/views/deviceManage/deviceModel/components/editDeviceModel.vue +++ b/src/views/deviceManage/deviceModel/components/editDeviceModel.vue @@ -8,7 +8,7 @@ ref="dataForm" :rules="rules" :model="deviceForm" - label-width="100px" + label-width="80px" label-well-code="right" > @@ -39,15 +39,15 @@ - + + + diff --git a/src/views/deviceManage/deviceType/components/editDeviceType.vue b/src/views/deviceManage/deviceType/components/editDeviceType.vue index 7887a7c..7189dad 100644 --- a/src/views/deviceManage/deviceType/components/editDeviceType.vue +++ b/src/views/deviceManage/deviceType/components/editDeviceType.vue @@ -8,7 +8,7 @@ ref="dataForm" :rules="rules" :model="deviceForm" - label-width="200px" + label-width="140px" label-well-code="right" > @@ -31,12 +31,22 @@ + + + + + + + - - - - - - - + + diff --git a/src/views/deviceManage/deviceModel/components/editDeviceModel.vue b/src/views/deviceManage/deviceModel/components/editDeviceModel.vue index fb76377..4c6e553 100644 --- a/src/views/deviceManage/deviceModel/components/editDeviceModel.vue +++ b/src/views/deviceManage/deviceModel/components/editDeviceModel.vue @@ -8,7 +8,7 @@ ref="dataForm" :rules="rules" :model="deviceForm" - label-width="100px" + label-width="80px" label-well-code="right" > @@ -39,15 +39,15 @@ - + + + diff --git a/src/views/deviceManage/deviceType/components/editDeviceType.vue b/src/views/deviceManage/deviceType/components/editDeviceType.vue index 7887a7c..7189dad 100644 --- a/src/views/deviceManage/deviceType/components/editDeviceType.vue +++ b/src/views/deviceManage/deviceType/components/editDeviceType.vue @@ -8,7 +8,7 @@ ref="dataForm" :rules="rules" :model="deviceForm" - label-width="200px" + label-width="140px" label-well-code="right" > @@ -31,12 +31,22 @@ + + + + + + + - - - - - - - + + diff --git a/src/views/deviceManage/deviceType/deviceType.vue b/src/views/deviceManage/deviceType/deviceType.vue index 3782ba9..5838d52 100644 --- a/src/views/deviceManage/deviceType/deviceType.vue +++ b/src/views/deviceManage/deviceType/deviceType.vue @@ -198,6 +198,9 @@ } getDeviceTypeList(this.listQuery).then(response => { console.log(response, '======response') + response.data.rows.forEach(item => { + item.valid === '1' ? item.valid = '是' : item.valid = '否' + }) this.list = response.data.rows this.total = parseInt(response.data.total) this.listLoading = false diff --git a/src/views/deviceManage/deviceModel/components/editDeviceModel.vue b/src/views/deviceManage/deviceModel/components/editDeviceModel.vue index fb76377..4c6e553 100644 --- a/src/views/deviceManage/deviceModel/components/editDeviceModel.vue +++ b/src/views/deviceManage/deviceModel/components/editDeviceModel.vue @@ -8,7 +8,7 @@ ref="dataForm" :rules="rules" :model="deviceForm" - label-width="100px" + label-width="80px" label-well-code="right" > @@ -39,15 +39,15 @@ - + + + diff --git a/src/views/deviceManage/deviceType/components/editDeviceType.vue b/src/views/deviceManage/deviceType/components/editDeviceType.vue index 7887a7c..7189dad 100644 --- a/src/views/deviceManage/deviceType/components/editDeviceType.vue +++ b/src/views/deviceManage/deviceType/components/editDeviceType.vue @@ -8,7 +8,7 @@ ref="dataForm" :rules="rules" :model="deviceForm" - label-width="200px" + label-width="140px" label-well-code="right" > @@ -31,12 +31,22 @@ + + + + + + + - - - - - - - + + diff --git a/src/views/deviceManage/deviceType/deviceType.vue b/src/views/deviceManage/deviceType/deviceType.vue index 3782ba9..5838d52 100644 --- a/src/views/deviceManage/deviceType/deviceType.vue +++ b/src/views/deviceManage/deviceType/deviceType.vue @@ -198,6 +198,9 @@ } getDeviceTypeList(this.listQuery).then(response => { console.log(response, '======response') + response.data.rows.forEach(item => { + item.valid === '1' ? item.valid = '是' : item.valid = '否' + }) this.list = response.data.rows this.total = parseInt(response.data.total) this.listLoading = false diff --git a/src/views/wellManage/detailMapLonLat.vue b/src/views/wellManage/detailMapLonLat.vue index 89d14ac..e0d7081 100644 --- a/src/views/wellManage/detailMapLonLat.vue +++ b/src/views/wellManage/detailMapLonLat.vue @@ -70,6 +70,7 @@ return { searchResultIcon: require('@/assets/overview/pure-position-icon.png'), // 报警图标 searchResultSize: [24, 30], + marker: null, locationMarker: '', postionlatlon: '', postionForm: { @@ -116,26 +117,35 @@ // 初始化放这里 mapReady(map) { this.map = map - var _this = this - map.on('click', function(e) { - _this.postionForm.longitude = e.lnglat.lng - _this.postionForm.latitude = e.lnglat.lat - _this.postionlatlon = e.lnglat.lng + ',' + e.lnglat.lat - - const { searchResultIcon, searchResultSize } = this - const icon = new window.AMap.Icon({ - size: toSize(searchResultSize), // 图标尺寸 - image: searchResultIcon, // Icon的图像 - imageSize: toSize(searchResultSize) // 根据所设置的大小拉伸或压缩图片 - }) - this.locationMarker = new window.AMap.Marker({ - icon: icon, - position: [117.05887, 39.561801], - draggable: true, - cursor: 'move' - }) - this.locationMarker.setMap(this.map) + const { searchResultIcon, searchResultSize } = this + const icon = new window.AMap.Icon({ + size: toSize(searchResultSize), // 图标尺寸 + image: searchResultIcon, // Icon的图像 + imageSize: toSize(searchResultSize) // 根据所设置的大小拉伸或压缩图片 }) + this.locationMarker = new window.AMap.Marker({ + icon: icon, + position: [this.$store.getters.lng, this.$store.getters.lat], + draggable: true, + cursor: 'move' + }) + this.locationMarker.setMap(this.map) + this.locationMarker.on('dragend', e => { + this.postionForm.longitude = e.lnglat.lng + this.postionForm.latitude = e.lnglat.lat + this.postionlatlon = e.lnglat.lng + ',' + e.lnglat.lat + }) + + // map.on('click', function(e) { + // _this.postionForm.longitude = e.lnglat.lng + // _this.postionForm.latitude = e.lnglat.lat + // _this.postionlatlon = e.lnglat.lng + ',' + e.lnglat.lat + + // var addressArr = _this.postionlatlon.split(',') + // _this.marker = new window.AMap.Marker() + // map.add(_this.marker) + // _this.marker.setPosition(addressArr) + // }) }, initDialog(val) { this.dialogFormVisible = val diff --git a/src/views/deviceManage/deviceModel/components/editDeviceModel.vue b/src/views/deviceManage/deviceModel/components/editDeviceModel.vue index fb76377..4c6e553 100644 --- a/src/views/deviceManage/deviceModel/components/editDeviceModel.vue +++ b/src/views/deviceManage/deviceModel/components/editDeviceModel.vue @@ -8,7 +8,7 @@ ref="dataForm" :rules="rules" :model="deviceForm" - label-width="100px" + label-width="80px" label-well-code="right" > @@ -39,15 +39,15 @@ - + + + diff --git a/src/views/deviceManage/deviceType/components/editDeviceType.vue b/src/views/deviceManage/deviceType/components/editDeviceType.vue index 7887a7c..7189dad 100644 --- a/src/views/deviceManage/deviceType/components/editDeviceType.vue +++ b/src/views/deviceManage/deviceType/components/editDeviceType.vue @@ -8,7 +8,7 @@ ref="dataForm" :rules="rules" :model="deviceForm" - label-width="200px" + label-width="140px" label-well-code="right" > @@ -31,12 +31,22 @@ + + + + + + + - - - - - - - + + diff --git a/src/views/deviceManage/deviceType/deviceType.vue b/src/views/deviceManage/deviceType/deviceType.vue index 3782ba9..5838d52 100644 --- a/src/views/deviceManage/deviceType/deviceType.vue +++ b/src/views/deviceManage/deviceType/deviceType.vue @@ -198,6 +198,9 @@ } getDeviceTypeList(this.listQuery).then(response => { console.log(response, '======response') + response.data.rows.forEach(item => { + item.valid === '1' ? item.valid = '是' : item.valid = '否' + }) this.list = response.data.rows this.total = parseInt(response.data.total) this.listLoading = false diff --git a/src/views/wellManage/detailMapLonLat.vue b/src/views/wellManage/detailMapLonLat.vue index 89d14ac..e0d7081 100644 --- a/src/views/wellManage/detailMapLonLat.vue +++ b/src/views/wellManage/detailMapLonLat.vue @@ -70,6 +70,7 @@ return { searchResultIcon: require('@/assets/overview/pure-position-icon.png'), // 报警图标 searchResultSize: [24, 30], + marker: null, locationMarker: '', postionlatlon: '', postionForm: { @@ -116,26 +117,35 @@ // 初始化放这里 mapReady(map) { this.map = map - var _this = this - map.on('click', function(e) { - _this.postionForm.longitude = e.lnglat.lng - _this.postionForm.latitude = e.lnglat.lat - _this.postionlatlon = e.lnglat.lng + ',' + e.lnglat.lat - - const { searchResultIcon, searchResultSize } = this - const icon = new window.AMap.Icon({ - size: toSize(searchResultSize), // 图标尺寸 - image: searchResultIcon, // Icon的图像 - imageSize: toSize(searchResultSize) // 根据所设置的大小拉伸或压缩图片 - }) - this.locationMarker = new window.AMap.Marker({ - icon: icon, - position: [117.05887, 39.561801], - draggable: true, - cursor: 'move' - }) - this.locationMarker.setMap(this.map) + const { searchResultIcon, searchResultSize } = this + const icon = new window.AMap.Icon({ + size: toSize(searchResultSize), // 图标尺寸 + image: searchResultIcon, // Icon的图像 + imageSize: toSize(searchResultSize) // 根据所设置的大小拉伸或压缩图片 }) + this.locationMarker = new window.AMap.Marker({ + icon: icon, + position: [this.$store.getters.lng, this.$store.getters.lat], + draggable: true, + cursor: 'move' + }) + this.locationMarker.setMap(this.map) + this.locationMarker.on('dragend', e => { + this.postionForm.longitude = e.lnglat.lng + this.postionForm.latitude = e.lnglat.lat + this.postionlatlon = e.lnglat.lng + ',' + e.lnglat.lat + }) + + // map.on('click', function(e) { + // _this.postionForm.longitude = e.lnglat.lng + // _this.postionForm.latitude = e.lnglat.lat + // _this.postionlatlon = e.lnglat.lng + ',' + e.lnglat.lat + + // var addressArr = _this.postionlatlon.split(',') + // _this.marker = new window.AMap.Marker() + // map.add(_this.marker) + // _this.marker.setPosition(addressArr) + // }) }, initDialog(val) { this.dialogFormVisible = val diff --git a/src/views/wellManage/editWell.vue b/src/views/wellManage/editWell.vue index a5e4778..01d55d1 100644 --- a/src/views/wellManage/editWell.vue +++ b/src/views/wellManage/editWell.vue @@ -40,20 +40,17 @@ - - - - - +
+ +
@@ -176,6 +173,7 @@ import { mapGetters } from 'vuex' import AMapContainer from '@/components/Amap/AMapContainer' import AMapLoader from '@amap/amap-jsapi-loader' +import { toSize } from '@/components/Amap/utils/convert-helper' export default { name: 'EditWell', @@ -224,6 +222,10 @@ baseLayer: 'gaode_vec', // 底图图层 center: [this.$store.getters.lng, this.$store.getters.lat], // 地图中心 zoom: 12, + searchResultIcon: require('@/assets/overview/pure-position-icon.png'), // 报警图标 + searchResultSize: [24, 30], + marker: null, + locationMarker: '', postionlatlon: '', dialogFormVisible: false, // 对话框是否显示 wellForm: { @@ -359,12 +361,30 @@ // 初始化放这里 mapReady(map) { this.map = map - var _this = this - map.on('click', function(e) { - _this.wellForm.coordinateX = e.lnglat.lng - _this.wellForm.coordinateY = e.lnglat.lat - _this.postionlatlon = _this.wellForm.coordinateX + ',' + _this.wellForm.coordinateY + const { searchResultIcon, searchResultSize } = this + const icon = new window.AMap.Icon({ + size: toSize(searchResultSize), // 图标尺寸 + image: searchResultIcon, // Icon的图像 + imageSize: toSize(searchResultSize) // 根据所设置的大小拉伸或压缩图片 }) + this.locationMarker = new window.AMap.Marker({ + icon: icon, + position: [this.wellForm.coordinateX, this.wellForm.coordinateY], + draggable: true, + cursor: 'move' + }) + this.locationMarker.setMap(this.map) + this.locationMarker.on('dragend', e => { + this.wellForm.coordinateX = e.lnglat.lng + this.wellForm.coordinateY = e.lnglat.lat + this.postionlatlon = e.lnglat.lng + ',' + e.lnglat.lat + }) + // var _this = this + // map.on('click', function(e) { + // _this.wellForm.coordinateX = e.lnglat.lng + // _this.wellForm.coordinateY = e.lnglat.lat + // _this.postionlatlon = _this.wellForm.coordinateX + ',' + _this.wellForm.coordinateY + // }) }, // 初始化对话框 initDialog: function(dialogFormVisible, row = null) { @@ -570,6 +590,10 @@