diff --git a/config/index.js b/config/index.js index fbac51d..83d2e65 100644 --- a/config/index.js +++ b/config/index.js @@ -79,7 +79,7 @@ }, // Various Dev Server settings - host: "localhost", // can be overwritten by process.env.HOST + host: "192.168.20.97", // can be overwritten by process.env.HOST port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: true, errorOverlay: true, diff --git a/config/index.js b/config/index.js index fbac51d..83d2e65 100644 --- a/config/index.js +++ b/config/index.js @@ -79,7 +79,7 @@ }, // Various Dev Server settings - host: "localhost", // can be overwritten by process.env.HOST + host: "192.168.20.97", // can be overwritten by process.env.HOST port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: true, errorOverlay: true, diff --git a/src/components/ConfigManager/project.vue b/src/components/ConfigManager/project.vue index 31253a6..b4fb535 100644 --- a/src/components/ConfigManager/project.vue +++ b/src/components/ConfigManager/project.vue @@ -766,6 +766,10 @@ case "submit": let submitType = this.dialogInfo.type; let submitApi, submitParams; + console.log(333,this.getCurrentCityJwd(this.projectFormInfo.data.area,this.projectFormInfo.cascaderOptions)); + let {lat, lon} = this.getCurrentCityJwd(this.projectFormInfo.data.area,this.projectFormInfo.cascaderOptions); + this.projectFormInfo.data.lat = lat; + this.projectFormInfo.data.lon = lon; if(submitType === "update" || submitType === "create") { this.projectFormInfo.rules = this.$initRules(this.projectFormInfo.fieldList); this.projectFormInfo.ref.validate(valid => { @@ -958,21 +962,21 @@ //请求接口处理结果 handleAjax(url, params) { this.$http.post(url, params).then(res => { - if (res.data.code === 1 || res.data.code === 200) { - this.dialogInfo.visible = false; - this.projectTableInfo.refresh = Math.random(); - } - this.$message({ - message: res.data.msg, - type: res.data.code === 1 ? "success" : "error", - showClose: true - }); - this.btnLoading = false; - }) - .catch(e => { - console.log(e); - this.btnLoading = false; + if (res.data.code === 1 || res.data.code === 200) { + this.dialogInfo.visible = false; + this.projectTableInfo.refresh = Math.random(); + } + this.$message({ + message: res.data.msg, + type: res.data.code === 1 ? "success" : "error", + showClose: true }); + this.btnLoading = false; + }) + .catch(e => { + console.log(e); + this.btnLoading = false; + }); }, //将空的children置为undefined,避免在没有下一级数据的情况下显示暂无数据 removeEmptyChild(arr) { @@ -984,6 +988,26 @@ } }); return arr; + }, + //遍历城市数组取得选中城市的经纬度,arr城市数组,id当前所选城市id + getCurrentCityJwd(id, arr) { + let currentCity; + let flag = arr.some(item => { + if (item.id === id) { + currentCity = item; + console.log(1111,currentCity); + return true; + }else{ + if (item.children && item.children.length) { + this.getCurrentCityJwd(id, item.children); + } + } + }); + if(flag) { + console.log(currentCity); + return currentCity; + } + } } }; diff --git a/config/index.js b/config/index.js index fbac51d..83d2e65 100644 --- a/config/index.js +++ b/config/index.js @@ -79,7 +79,7 @@ }, // Various Dev Server settings - host: "localhost", // can be overwritten by process.env.HOST + host: "192.168.20.97", // can be overwritten by process.env.HOST port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: true, errorOverlay: true, diff --git a/src/components/ConfigManager/project.vue b/src/components/ConfigManager/project.vue index 31253a6..b4fb535 100644 --- a/src/components/ConfigManager/project.vue +++ b/src/components/ConfigManager/project.vue @@ -766,6 +766,10 @@ case "submit": let submitType = this.dialogInfo.type; let submitApi, submitParams; + console.log(333,this.getCurrentCityJwd(this.projectFormInfo.data.area,this.projectFormInfo.cascaderOptions)); + let {lat, lon} = this.getCurrentCityJwd(this.projectFormInfo.data.area,this.projectFormInfo.cascaderOptions); + this.projectFormInfo.data.lat = lat; + this.projectFormInfo.data.lon = lon; if(submitType === "update" || submitType === "create") { this.projectFormInfo.rules = this.$initRules(this.projectFormInfo.fieldList); this.projectFormInfo.ref.validate(valid => { @@ -958,21 +962,21 @@ //请求接口处理结果 handleAjax(url, params) { this.$http.post(url, params).then(res => { - if (res.data.code === 1 || res.data.code === 200) { - this.dialogInfo.visible = false; - this.projectTableInfo.refresh = Math.random(); - } - this.$message({ - message: res.data.msg, - type: res.data.code === 1 ? "success" : "error", - showClose: true - }); - this.btnLoading = false; - }) - .catch(e => { - console.log(e); - this.btnLoading = false; + if (res.data.code === 1 || res.data.code === 200) { + this.dialogInfo.visible = false; + this.projectTableInfo.refresh = Math.random(); + } + this.$message({ + message: res.data.msg, + type: res.data.code === 1 ? "success" : "error", + showClose: true }); + this.btnLoading = false; + }) + .catch(e => { + console.log(e); + this.btnLoading = false; + }); }, //将空的children置为undefined,避免在没有下一级数据的情况下显示暂无数据 removeEmptyChild(arr) { @@ -984,6 +988,26 @@ } }); return arr; + }, + //遍历城市数组取得选中城市的经纬度,arr城市数组,id当前所选城市id + getCurrentCityJwd(id, arr) { + let currentCity; + let flag = arr.some(item => { + if (item.id === id) { + currentCity = item; + console.log(1111,currentCity); + return true; + }else{ + if (item.children && item.children.length) { + this.getCurrentCityJwd(id, item.children); + } + } + }); + if(flag) { + console.log(currentCity); + return currentCity; + } + } } }; diff --git a/src/components/common/PageForm/index.vue b/src/components/common/PageForm/index.vue index 9a6a7a2..20aab82 100644 --- a/src/components/common/PageForm/index.vue +++ b/src/components/common/PageForm/index.vue @@ -59,7 +59,11 @@ @visible-change="handleVisibleChange" :show-all-levels="true" v-model="data[item.value]" - /> + > + + { @@ -958,21 +962,21 @@ //请求接口处理结果 handleAjax(url, params) { this.$http.post(url, params).then(res => { - if (res.data.code === 1 || res.data.code === 200) { - this.dialogInfo.visible = false; - this.projectTableInfo.refresh = Math.random(); - } - this.$message({ - message: res.data.msg, - type: res.data.code === 1 ? "success" : "error", - showClose: true - }); - this.btnLoading = false; - }) - .catch(e => { - console.log(e); - this.btnLoading = false; + if (res.data.code === 1 || res.data.code === 200) { + this.dialogInfo.visible = false; + this.projectTableInfo.refresh = Math.random(); + } + this.$message({ + message: res.data.msg, + type: res.data.code === 1 ? "success" : "error", + showClose: true }); + this.btnLoading = false; + }) + .catch(e => { + console.log(e); + this.btnLoading = false; + }); }, //将空的children置为undefined,避免在没有下一级数据的情况下显示暂无数据 removeEmptyChild(arr) { @@ -984,6 +988,26 @@ } }); return arr; + }, + //遍历城市数组取得选中城市的经纬度,arr城市数组,id当前所选城市id + getCurrentCityJwd(id, arr) { + let currentCity; + let flag = arr.some(item => { + if (item.id === id) { + currentCity = item; + console.log(1111,currentCity); + return true; + }else{ + if (item.children && item.children.length) { + this.getCurrentCityJwd(id, item.children); + } + } + }); + if(flag) { + console.log(currentCity); + return currentCity; + } + } } }; diff --git a/src/components/common/PageForm/index.vue b/src/components/common/PageForm/index.vue index 9a6a7a2..20aab82 100644 --- a/src/components/common/PageForm/index.vue +++ b/src/components/common/PageForm/index.vue @@ -59,7 +59,11 @@ @visible-change="handleVisibleChange" :show-all-levels="true" v-model="data[item.value]" - /> + > + + -
换色
{{ LoginName }} +
换色
@@ -225,6 +225,7 @@ // console.log(key, keyPath); }, ChangeBGC() { + console.log(9999); let root = document.querySelector(":root"); if (this.flag) { root.style.setProperty("--color", "rgb(253, 44, 79)"); @@ -299,7 +300,7 @@ } }; - - diff --git a/config/index.js b/config/index.js index fbac51d..83d2e65 100644 --- a/config/index.js +++ b/config/index.js @@ -79,7 +79,7 @@ }, // Various Dev Server settings - host: "localhost", // can be overwritten by process.env.HOST + host: "192.168.20.97", // can be overwritten by process.env.HOST port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: true, errorOverlay: true, diff --git a/src/components/ConfigManager/project.vue b/src/components/ConfigManager/project.vue index 31253a6..b4fb535 100644 --- a/src/components/ConfigManager/project.vue +++ b/src/components/ConfigManager/project.vue @@ -766,6 +766,10 @@ case "submit": let submitType = this.dialogInfo.type; let submitApi, submitParams; + console.log(333,this.getCurrentCityJwd(this.projectFormInfo.data.area,this.projectFormInfo.cascaderOptions)); + let {lat, lon} = this.getCurrentCityJwd(this.projectFormInfo.data.area,this.projectFormInfo.cascaderOptions); + this.projectFormInfo.data.lat = lat; + this.projectFormInfo.data.lon = lon; if(submitType === "update" || submitType === "create") { this.projectFormInfo.rules = this.$initRules(this.projectFormInfo.fieldList); this.projectFormInfo.ref.validate(valid => { @@ -958,21 +962,21 @@ //请求接口处理结果 handleAjax(url, params) { this.$http.post(url, params).then(res => { - if (res.data.code === 1 || res.data.code === 200) { - this.dialogInfo.visible = false; - this.projectTableInfo.refresh = Math.random(); - } - this.$message({ - message: res.data.msg, - type: res.data.code === 1 ? "success" : "error", - showClose: true - }); - this.btnLoading = false; - }) - .catch(e => { - console.log(e); - this.btnLoading = false; + if (res.data.code === 1 || res.data.code === 200) { + this.dialogInfo.visible = false; + this.projectTableInfo.refresh = Math.random(); + } + this.$message({ + message: res.data.msg, + type: res.data.code === 1 ? "success" : "error", + showClose: true }); + this.btnLoading = false; + }) + .catch(e => { + console.log(e); + this.btnLoading = false; + }); }, //将空的children置为undefined,避免在没有下一级数据的情况下显示暂无数据 removeEmptyChild(arr) { @@ -984,6 +988,26 @@ } }); return arr; + }, + //遍历城市数组取得选中城市的经纬度,arr城市数组,id当前所选城市id + getCurrentCityJwd(id, arr) { + let currentCity; + let flag = arr.some(item => { + if (item.id === id) { + currentCity = item; + console.log(1111,currentCity); + return true; + }else{ + if (item.children && item.children.length) { + this.getCurrentCityJwd(id, item.children); + } + } + }); + if(flag) { + console.log(currentCity); + return currentCity; + } + } } }; diff --git a/src/components/common/PageForm/index.vue b/src/components/common/PageForm/index.vue index 9a6a7a2..20aab82 100644 --- a/src/components/common/PageForm/index.vue +++ b/src/components/common/PageForm/index.vue @@ -59,7 +59,11 @@ @visible-change="handleVisibleChange" :show-all-levels="true" v-model="data[item.value]" - /> + > + + -
换色
{{ LoginName }} +
换色
@@ -225,6 +225,7 @@ // console.log(key, keyPath); }, ChangeBGC() { + console.log(9999); let root = document.querySelector(":root"); if (this.flag) { root.style.setProperty("--color", "rgb(253, 44, 79)"); @@ -299,7 +300,7 @@ } }; - - diff --git a/src/util/projectSet.js b/src/util/projectSet.js index f1ace6e..ef05450 100644 --- a/src/util/projectSet.js +++ b/src/util/projectSet.js @@ -20,7 +20,7 @@ sysStationBaseList: "/sys/stationbase/list", //项目配置管理----站点列表 sysStationBaseUpdate: "/sys/stationbase/updateBatch", //项目配置管理----绑定项目与站点 sysStationBaseRemove: "/sys/stationbase/removeBatch", //项目配置管理----移除项目与站点 - sysPlatformUpdate: "/sys/sysplatform/addOrupdate", //项目配置管理----更新/添加项目信息 + sysPlatformAddOrUpdate: "/sys/sysplatform/addOrupdate", //项目配置管理----更新/添加项目信息 sysPlatformDelete: "/sys/sysplatform/delete", //项目配置管理----删除项目 sysCityList: "/sys/syscity/list", //项目配置管理----获取所有城市信息 diff --git a/config/index.js b/config/index.js index fbac51d..83d2e65 100644 --- a/config/index.js +++ b/config/index.js @@ -79,7 +79,7 @@ }, // Various Dev Server settings - host: "localhost", // can be overwritten by process.env.HOST + host: "192.168.20.97", // can be overwritten by process.env.HOST port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: true, errorOverlay: true, diff --git a/src/components/ConfigManager/project.vue b/src/components/ConfigManager/project.vue index 31253a6..b4fb535 100644 --- a/src/components/ConfigManager/project.vue +++ b/src/components/ConfigManager/project.vue @@ -766,6 +766,10 @@ case "submit": let submitType = this.dialogInfo.type; let submitApi, submitParams; + console.log(333,this.getCurrentCityJwd(this.projectFormInfo.data.area,this.projectFormInfo.cascaderOptions)); + let {lat, lon} = this.getCurrentCityJwd(this.projectFormInfo.data.area,this.projectFormInfo.cascaderOptions); + this.projectFormInfo.data.lat = lat; + this.projectFormInfo.data.lon = lon; if(submitType === "update" || submitType === "create") { this.projectFormInfo.rules = this.$initRules(this.projectFormInfo.fieldList); this.projectFormInfo.ref.validate(valid => { @@ -958,21 +962,21 @@ //请求接口处理结果 handleAjax(url, params) { this.$http.post(url, params).then(res => { - if (res.data.code === 1 || res.data.code === 200) { - this.dialogInfo.visible = false; - this.projectTableInfo.refresh = Math.random(); - } - this.$message({ - message: res.data.msg, - type: res.data.code === 1 ? "success" : "error", - showClose: true - }); - this.btnLoading = false; - }) - .catch(e => { - console.log(e); - this.btnLoading = false; + if (res.data.code === 1 || res.data.code === 200) { + this.dialogInfo.visible = false; + this.projectTableInfo.refresh = Math.random(); + } + this.$message({ + message: res.data.msg, + type: res.data.code === 1 ? "success" : "error", + showClose: true }); + this.btnLoading = false; + }) + .catch(e => { + console.log(e); + this.btnLoading = false; + }); }, //将空的children置为undefined,避免在没有下一级数据的情况下显示暂无数据 removeEmptyChild(arr) { @@ -984,6 +988,26 @@ } }); return arr; + }, + //遍历城市数组取得选中城市的经纬度,arr城市数组,id当前所选城市id + getCurrentCityJwd(id, arr) { + let currentCity; + let flag = arr.some(item => { + if (item.id === id) { + currentCity = item; + console.log(1111,currentCity); + return true; + }else{ + if (item.children && item.children.length) { + this.getCurrentCityJwd(id, item.children); + } + } + }); + if(flag) { + console.log(currentCity); + return currentCity; + } + } } }; diff --git a/src/components/common/PageForm/index.vue b/src/components/common/PageForm/index.vue index 9a6a7a2..20aab82 100644 --- a/src/components/common/PageForm/index.vue +++ b/src/components/common/PageForm/index.vue @@ -59,7 +59,11 @@ @visible-change="handleVisibleChange" :show-all-levels="true" v-model="data[item.value]" - /> + > + + -
换色
{{ LoginName }} +
换色
@@ -225,6 +225,7 @@ // console.log(key, keyPath); }, ChangeBGC() { + console.log(9999); let root = document.querySelector(":root"); if (this.flag) { root.style.setProperty("--color", "rgb(253, 44, 79)"); @@ -299,7 +300,7 @@ } }; - - diff --git a/src/util/projectSet.js b/src/util/projectSet.js index f1ace6e..ef05450 100644 --- a/src/util/projectSet.js +++ b/src/util/projectSet.js @@ -20,7 +20,7 @@ sysStationBaseList: "/sys/stationbase/list", //项目配置管理----站点列表 sysStationBaseUpdate: "/sys/stationbase/updateBatch", //项目配置管理----绑定项目与站点 sysStationBaseRemove: "/sys/stationbase/removeBatch", //项目配置管理----移除项目与站点 - sysPlatformUpdate: "/sys/sysplatform/addOrupdate", //项目配置管理----更新/添加项目信息 + sysPlatformAddOrUpdate: "/sys/sysplatform/addOrupdate", //项目配置管理----更新/添加项目信息 sysPlatformDelete: "/sys/sysplatform/delete", //项目配置管理----删除项目 sysCityList: "/sys/syscity/list", //项目配置管理----获取所有城市信息 diff --git a/static/img/state.png b/static/img/state.png new file mode 100644 index 0000000..7f7dbb2 --- /dev/null +++ b/static/img/state.png Binary files differ