支持服务端抽稀和服务发布

This commit is contained in:
lin
2025-11-02 23:50:07 +08:00
parent 2a5435c810
commit 311b59870c
29 changed files with 1930 additions and 367 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div id="CommonChannelEdit" v-loading="loading" style="width: 100%">
<div id="CommonChannelEdit" v-loading="loading" style="width: 100%; overflow: auto; height: calc(-148px + 100vh);">
<el-form ref="channelForm" :model="form" :rules="rules" status-icon label-width="160px" class="channel-form" size="medium">
<div class="form-box">
<el-form-item label="名称" prop="gbName">
@@ -13,7 +13,7 @@
</el-input>
</el-form-item>
<el-form-item label="设备厂商">
<el-input v-model="gbManufacturer" placeholder="请输入设备厂商" />
<el-input v-model="form.gbManufacturer" placeholder="请输入设备厂商" />
</el-form-item>
<el-form-item label="设备型号">
<el-autocomplete
@@ -252,7 +252,7 @@
</el-form-item>
<div style="text-align: right">
<el-button type="primary" @click="onSubmit" >保存</el-button>
<el-button v-if="cancel" @click="cancelSubmit" >取消</el-button>
<el-button v-if="showCancel" @click="cancelSubmit" >取消</el-button>
<el-button v-if="form.dataType === 1" @click="reset">重置</el-button>
</div>
</div>
@@ -276,7 +276,7 @@ export default {
ChooseGroup,
channelCode
},
props: ['id', 'dataForm', 'saveSuccess', 'cancel'],
props: ['id', 'dataForm', 'showCancel'],
data() {
return {
rules: {
@@ -303,7 +303,7 @@ export default {
created() {
// 获取完整信息
if (this.id) {
this.getCommonChannel()
this.getCommonChannel(this.id)
} else {
if (!this.dataForm.gbDeviceId) {
this.dataForm.gbDeviceId = ''
@@ -335,9 +335,7 @@ export default {
showClose: true,
message: '保存成功'
})
if (this.saveSuccess) {
this.saveSuccess()
}
this.$emit('submitSuccess')
}).finally(() => {
this.loading = false
})
@@ -378,7 +376,7 @@ export default {
showClose: true,
message: '重置成功 已保存'
})
this.getCommonChannel()
this.getCommonChannel(this.form.gbId)
}
}).catch((error) => {
console.error(error)
@@ -389,9 +387,9 @@ export default {
})
},
getCommonChannel: function() {
getCommonChannel: function(id) {
this.loading = true
this.$store.dispatch('commonChanel/queryOne', this.id)
this.$store.dispatch('commonChanel/queryOne', id)
.then(data => {
if (data.gbDownloadSpeed) {
data.gbDownloadSpeedArray = data.gbDownloadSpeed.split('/')
@@ -422,9 +420,7 @@ export default {
})
},
cancelSubmit: function() {
if (this.cancel) {
this.cancel()
}
this.$emit('cancel')
},
getPaths: function() {
this.parentPath = []

View File

@@ -31,7 +31,7 @@ import { fromLonLat, toLonLat } from './map/TransformLonLat'
import { v4 } from 'uuid'
import { getUid } from 'ol'
import {Fill} from "ol/style";
import { Fill } from 'ol/style'
let olMap, tileLayer = null
export default {
@@ -158,6 +158,9 @@ export default {
source: source,
style: function(feature) {
let status = feature.properties_.gbStatus
if (layer.get('hideFeatures').includes(feature.properties_.gbId)) {
return new Style()
}
if (status === 'ON') {
return new Style({
image: new Icon({
@@ -203,6 +206,7 @@ export default {
// // ]
// }
})
layer.set('hideFeatures', [])
olMap.addLayer(layer)
if (clickEvent) {
layer.on('click', (event) => {
@@ -363,8 +367,6 @@ export default {
return vectorLayer
},
createPointLayer(data, clickEvent, option){
console.log(444)
console.log(data)
const features = []
let maxZoom = (option && option.maxZoom) ? option.maxZoom : olMap.getView().getMaxZoom()
let minZoom = (option && option.minZoom) ? option.minZoom : olMap.getView().getMinZoom()
@@ -498,7 +500,7 @@ export default {
updatePointLayer(layer, data, postponement) {
console.log(data)
layer.getSource().clear(true)
if (!data || data.length == 0) {
if (!data || data.length === 0) {
return
}
const features = []
@@ -567,12 +569,15 @@ export default {
feature.setStyle(style)
olMap.render()
},
hideFeature(layer, featureId) {
layer.get('hideFeatures').add(featureId)
},
cancelHideFeature(layer, featureId) {
let index = layer.get('hideFeatures').indexOf(featureId)
layer.get('hideFeatures').splice(index, 1)
},
setFeaturePositionById(layer, featureId, data) {
if (layer instanceof LayerGroup) {
}else {
}
let featureOld = layer.getSource().getFeatureById(featureId)
if (featureOld) {
layer.getSource().removeFeature(featureOld)
@@ -743,6 +748,11 @@ export default {
},
getCoordSys(){
return this.mapTileList[this.mapTileIndex].coordinateSystem
},
refreshLayer(layer){
if (layer && layer.getSource()) {
layer.getSource().refresh()
}
}
}
}