From af48e107ee7d9bd901860b79ac620943e555d58f Mon Sep 17 00:00:00 2001 From: 23688nl <329261568@qq.com> Date: Fri, 23 Sep 2022 14:12:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=EF=BC=9A=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E9=85=8D=E7=BD=AE=E7=AE=A1=E7=90=86=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E5=90=8E=20=E5=88=B7=E6=96=B0=E9=A1=B5=E9=9D=A2=E7=94=9F?= =?UTF-8?q?=E6=95=88=E6=94=B9=E4=B8=BA=E5=AE=9E=E6=97=B6=E7=94=9F=E6=95=88?= =?UTF-8?q?=E3=80=82=E4=BC=98=E5=8C=96=20=E5=9C=BA=E6=99=AF=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E4=B8=AD=E4=B8=80=E4=BA=9B=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=20=E6=B7=BB=E5=8A=A0=E5=BC=80=E5=90=AF/=E5=81=9C?= =?UTF-8?q?=E6=AD=A2=EF=BC=8C=E5=9C=BA=E6=99=AF=20=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot/project_new.js | 9 ++ src/components/SelectTable/index.vue | 21 ++- src/store/modules/permission.js | 14 +- .../iot/project/profileV2/ENavMenu/index.vue | 18 ++- .../ESceneManage/ESceneAction/config.js | 4 +- .../ESceneAction/src/EDeviceParam.vue | 15 +- .../ESceneAction/src/executeAction.js | 9 +- .../ESceneTriggers/src/ECronForm.vue | 48 +++++++ .../ESceneTriggers/src/ESelectDevice.vue | 9 +- .../ESceneManage/ESceneTriggers/src/index.js | 55 ++++++-- .../project/profileV2/ESceneManage/index.vue | 128 ++++++++++++++---- src/views/system/attribute/index.vue | 26 ++-- 12 files changed, 279 insertions(+), 77 deletions(-) create mode 100644 src/views/iot/project/profileV2/ESceneManage/ESceneTriggers/src/ECronForm.vue diff --git a/src/api/iot/project_new.js b/src/api/iot/project_new.js index 9f216760..bca64cff 100644 --- a/src/api/iot/project_new.js +++ b/src/api/iot/project_new.js @@ -206,3 +206,12 @@ export function projectSceneDelete(siteId) { method: 'delete' }) } + +// 查询 场景控制 修改状态 +export function projectSceneChangeStatus(data) { + return request({ + url: '/iot/scene/changeStatus', + method: 'put', + data: data + }) +} diff --git a/src/components/SelectTable/index.vue b/src/components/SelectTable/index.vue index 55bfae51..bc4f663e 100644 --- a/src/components/SelectTable/index.vue +++ b/src/components/SelectTable/index.vue @@ -114,7 +114,7 @@ :total="queryOption.page.total" :page.sync="queryOption.page.pageNum" :limit.sync="queryOption.page.pageSize" - @pagination="handleQuery2" + @pagination="handleQuery" /> @@ -219,7 +219,7 @@ export default { }, updated() { if (this.optionTrue && this.tableList.length <= 0) { - this.handleQuery2(); + this.handleQuery(); } }, methods: { @@ -239,13 +239,8 @@ export default { this.optionTrue = false this.getList(this.queryOption.page, this.queryOption.params); }, - handleQuery2() { - this.optionTrue = false - this.getList(this.queryOption.page, this.queryOption.params); - }, /** 重置按钮操作 */ resetQuery() { - this.dataList = []; this.resetForm("queryForm"); this.queryOption.page.pageNum = 1; this.handleQuery(); @@ -275,12 +270,16 @@ export default { }, created() { this.params = this.queryOption.params; - this.handleQuery2(); + this.handleQuery(); }, watch: { - tableList(value) { - this.dataList = value; - this.tableOption.loading = false; + tableList: { + handler(val) { + console.log('tableList--updata', val); + this.dataList = [...val]; + this.tableOption.loading = false; + }, + deep: true, } } }; diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 1da290cf..32869a53 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -19,9 +19,9 @@ const permission = { SET_SIDEBAR_ROUTERS: (state, routers) => { state.sidebarRouters = constantRoutes.concat(routers) }, - SET_ATTRIBUTE: (state, size) => { - state.attribute = size - } + SET_ATTRIBUTE: (state, atribute) => { + state.attribute = atribute + }, }, actions: { // 生成路由 @@ -34,6 +34,14 @@ const permission = { }) }) }, + // 根据对象 属性更新 + SetAttributeByKey({ commit, state }, params) { + return new Promise(resolve => { + // 向后端请求路由数据 + console.log('請求--GetAttribute') + commit('SET_ATTRIBUTE', Object.assign(state.attribute, params)) + }) + }, // 生成路由 GenerateRoutes({ commit }) { return new Promise(resolve => { diff --git a/src/views/iot/project/profileV2/ENavMenu/index.vue b/src/views/iot/project/profileV2/ENavMenu/index.vue index fc9f17bb..dceb020b 100644 --- a/src/views/iot/project/profileV2/ENavMenu/index.vue +++ b/src/views/iot/project/profileV2/ENavMenu/index.vue @@ -217,26 +217,30 @@ export default { width: 20px; height: 20px; display: flex; + -webkit-box-align: center; + -ms-flex-align: center; align-items: center; - justify-content: left; + -webkit-box-pack: left; + -ms-flex-pack: left; border: 1px solid #e9e9e9; - border-radius: 0 50% 50% 0; + border-radius: 50%; position: relative; - left: 40px; - font-size: 15px; + font-size: 14px; font-weight: 400; - border-left: 0; - top: -14px; + top: -10px; + justify-content: center; + background: #ffffff; } .e-shrink:hover { border-color: #4395ff; color: #4395ff; } .is-shrink-true { - left: 40px; + left: 30px; } .is-shrink-false { left: 100%; + left: calc(100% - 10px); } .nav-menu-item { width: 100%; diff --git a/src/views/iot/project/profileV2/ESceneManage/ESceneAction/config.js b/src/views/iot/project/profileV2/ESceneManage/ESceneAction/config.js index e41f4de1..c0e27d5e 100644 --- a/src/views/iot/project/profileV2/ESceneManage/ESceneAction/config.js +++ b/src/views/iot/project/profileV2/ESceneManage/ESceneAction/config.js @@ -11,5 +11,7 @@ export const defaultConfig = { export const notifierType = { SMS: '短信', - WEEXIN: '微信' + WECHAT: '微信', + EMAIL: '邮件', + VOICE: '语音' } diff --git a/src/views/iot/project/profileV2/ESceneManage/ESceneAction/src/EDeviceParam.vue b/src/views/iot/project/profileV2/ESceneManage/ESceneAction/src/EDeviceParam.vue index f64b8393..8eb302b4 100644 --- a/src/views/iot/project/profileV2/ESceneManage/ESceneAction/src/EDeviceParam.vue +++ b/src/views/iot/project/profileV2/ESceneManage/ESceneAction/src/EDeviceParam.vue @@ -70,7 +70,7 @@ > @@ -115,7 +115,7 @@ { this.tableSelectOption.tableList = res.rows; + this.tableList = res.rows; this.tableSelectOption.queryOpt.page.total = Number(res.total); this.$forceUpdate(); }); @@ -412,8 +415,8 @@ export default {