From 7f2c74181828336ba9320c5442808aeab67662cc Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 20 Aug 2019 17:54:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=A7=E6=9C=AC=E5=88=97=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=20=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/simulation.js | 5 +-- src/store/modules/scriptRecord.js | 11 +++++++ src/views/scriptManage/category/tree.vue | 1 + src/views/scriptManage/home.vue | 7 +++++ .../scriptManage/scriptRecord/addAction.vue | 31 +++++++++++++------ .../scriptManage/scriptRecord/getAction.vue | 3 +- 6 files changed, 45 insertions(+), 13 deletions(-) diff --git a/src/api/simulation.js b/src/api/simulation.js index 1ec95ce0a..5f334e718 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -420,10 +420,11 @@ export function getSimulationInfo(group) { } /** 获取可用的设备指令*/ -export function getAvailableDeviceCommand() { +export function getAvailableDeviceCommand(params) { return request({ url: `/api/simulation/deviceCommand/available`, - method: 'get' + method: 'get', + params }); } diff --git a/src/store/modules/scriptRecord.js b/src/store/modules/scriptRecord.js index 3f27a3f44..f15778b3e 100644 --- a/src/store/modules/scriptRecord.js +++ b/src/store/modules/scriptRecord.js @@ -6,6 +6,8 @@ const scriptRecord = { state: { mapLocation: {}, //地图定位, simulationPause: true , + scriptId:"", + }, getters: { mapLocation: (state)=>{ @@ -14,6 +16,9 @@ const scriptRecord = { simulationPause:(state)=>{ return state.simulationPause; }, + scriptId: (state)=>{ + return state.scriptId; + }, }, mutations: { setMapLocation: (state, mapLocation) => { @@ -22,6 +27,9 @@ const scriptRecord = { setSimulationPause: (state, simulationPause) => { state.simulationPause = simulationPause; }, + setscriptId: (state, scriptId) => { + state.scriptId = scriptId; + }, }, actions: { /** @@ -33,6 +41,9 @@ const scriptRecord = { updateSimulationPause: ({ commit }, simulationPause) => { commit('setSimulationPause', simulationPause); }, + updateScriptId: ({ commit }, scriptId) => { + commit('setscriptId', scriptId); + }, } }; export default scriptRecord; \ No newline at end of file diff --git a/src/views/scriptManage/category/tree.vue b/src/views/scriptManage/category/tree.vue index c61109954..5e1d51463 100644 --- a/src/views/scriptManage/category/tree.vue +++ b/src/views/scriptManage/category/tree.vue @@ -82,6 +82,7 @@ export default { // debugger; // this.$store localStore.set("script_mapId", id); + this.$store.dispatch('scriptRecord/updateScriptId',id); this.getQuestPageList(id); }, async getQuestPageList(id){ diff --git a/src/views/scriptManage/home.vue b/src/views/scriptManage/home.vue index fb8e431d8..c8f86e746 100644 --- a/src/views/scriptManage/home.vue +++ b/src/views/scriptManage/home.vue @@ -18,6 +18,7 @@