From 53cacb507c9e261c41a1a7e4934501adfb73353f Mon Sep 17 00:00:00 2001 From: wangwenhua <12345678> Date: Fri, 26 Sep 2025 19:44:54 +0800 Subject: [PATCH 1/2] a --- .env.development | 4 +- .env.production | 2 +- public/config.js | 6 +- src/views/subsystem/model/index.vue | 49 +++++++++- src/views/subsystem/scene/index.vue | 107 +++++++++++++++++++++- src/views/subsystem/scene/presetting.vue | 112 ++++++++++++++++++++++- vue.config.js | 2 +- 7 files changed, 270 insertions(+), 12 deletions(-) diff --git a/.env.development b/.env.development index 60617e5..041ec31 100644 --- a/.env.development +++ b/.env.development @@ -1,6 +1,6 @@ NODE_ENV=development VUE_APP_PREVIEW=true VUE_APP_API_BASE_URL=/api -VUE_APP_API_URL=http://192.168.0.53:8099 +VUE_APP_API_URL=http://192.168.0.225:8099 VUE_APP_MAP_BASE_URL=/map -VUE_APP_MAP_URL=http://192.168.0.53:8090 +VUE_APP_MAP_URL=http://192.168.0.225:8090 \ No newline at end of file diff --git a/.env.production b/.env.production index 7d88973..b3cfff7 100644 --- a/.env.production +++ b/.env.production @@ -1,4 +1,4 @@ NODE_ENV=production VUE_APP_PREVIEW=true VUE_APP_API_BASE_URL=/api -VUE_APP_API_URL=http://192.168.0.53:8099 +VUE_APP_API_URL=http://192.168.0.225:8099 diff --git a/public/config.js b/public/config.js index c8b0cba..82f5d57 100644 --- a/public/config.js +++ b/public/config.js @@ -5,7 +5,7 @@ window._CONFIG = { TerrainProviderUrl: '/map/mapTerrain/', thirdLoginUrl: 'http://127.0.0.1:8080/thirdLogin', clientId: '0123456789', - evaluationSrc: 'http://192.168.0.53:8088/thirdLogin/thirdLoginPage?username=admin', - VUE_APP_API_URL: 'http://192.168.0.53:8099', - VUE_APP_WEBSOCKET_URL: 'ws://192.168.0.53:8099', + evaluationSrc: 'http://192.168.0.189:8088/thirdLogin/thirdLoginPage?username=admin', + VUE_APP_API_URL: 'http://192.168.0.225:8099', + VUE_APP_WEBSOCKET_URL: 'ws://192.168.0.225:8099', } diff --git a/src/views/subsystem/model/index.vue b/src/views/subsystem/model/index.vue index b6fe91f..e0b4e01 100644 --- a/src/views/subsystem/model/index.vue +++ b/src/views/subsystem/model/index.vue @@ -58,12 +58,12 @@ - + –>
key === item.key); + if (target) { + target[column] = value; + this.data = newData; + } + }, + edit(key) { + const newData = [...this.data]; + const target = newData.find(item => key === item.key); + if (target) { + target.editable = true; + this.data = newData; + } + }, + save(key) { + const newData = [...this.data]; + const target = newData.find(item => key === item.key); + if (target) { + delete target.editable; + this.data = newData; + } + }, + cancel(key) { + const newData = [...this.data]; + const target = newData.find(item => key === item.key); + if (target) { + Object.assign(target, this.cacheData.find(item => key === item.key)); + delete target.editable; + this.data = newData; + } + }, + handleDelete(key) { + this.data = this.data.filter(item => item.key !== key); + }, + handleAdd() { + this.data.push({ + key: Date.now(), + name: '', + age: null, + address: '', + editable: true + }); + }, getTree(target, treeData, showKeys) { treeData.forEach((item) => { const newChildren = [] diff --git a/src/views/subsystem/scene/index.vue b/src/views/subsystem/scene/index.vue index 87ace9f..8637a8b 100644 --- a/src/views/subsystem/scene/index.vue +++ b/src/views/subsystem/scene/index.vue @@ -56,7 +56,45 @@
- + +
+ 新增 + + + + + +
+
+
{ this.childWindow && this.childWindow.close() return true // 必须设置 returnValue 才能显示确认框 @@ -276,6 +327,60 @@ export default { }) }, methods: { + getWeathers(){ + this.$http({ + url: `/baseData/weatherResource/list`, + method: 'get', + params: { scenarioId: this.scenarioId}, + }).then(res => { + this.data = res.data + }) + }, + handleChange(value, key, column) { + const newData = [...this.data]; + const target = newData.find(item => key === item.key); + if (target) { + target[column] = value; + this.data = newData; + } + }, + edit(key) { + const newData = [...this.data]; + const target = newData.find(item => key === item.key); + if (target) { + target.editable = true; + this.data = newData; + } + }, + save(key) { + const newData = [...this.data]; + const target = newData.find(item => key === item.key); + if (target) { + delete target.editable; + this.data = newData; + } + }, + cancel(key) { + const newData = [...this.data]; + const target = newData.find(item => key === item.key); + if (target) { + // Object.assign(target, this.newData.find(item => key === item.key)); + delete target.editable; + this.data = newData; + } + }, + handleDelete(key) { + this.data = this.data.filter(item => item.key !== key); + }, + handleAdd() { + this.data.push({ + key: Date.now(), + name: '', + age: null, + address: '', + editable: true + }); + }, getTree(target, treeData, showKeys) { treeData.forEach((item) => { const newChildren = [] diff --git a/src/views/subsystem/scene/presetting.vue b/src/views/subsystem/scene/presetting.vue index eb35543..229baf6 100644 --- a/src/views/subsystem/scene/presetting.vue +++ b/src/views/subsystem/scene/presetting.vue @@ -84,7 +84,45 @@
- + +
+ 新增 + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+