From ff4f3288d7066ad6e12582ab501b2a200a3fcdaa Mon Sep 17 00:00:00 2001 From: sunmeng <1162067978@qq.com> Date: Fri, 30 Aug 2024 18:25:17 +0800 Subject: [PATCH] 1 --- src/api/index.js | 8 ++ src/components/setParamsSoil.vue | 58 ++++++--- src/views/manage/deviceInfoManage.vue | 130 +++++++++++++++++++-- src/views/manage/deviceManage.vue | 2 + src/views/manage/userInfoControl.vue | 4 + src/views/page/formula.vue | 2 +- src/views/page/intrinsicParameter-soil.vue | 26 +++-- src/views/page/irrigateSet-soil.vue | 7 +- src/views/page/status-soil.vue | 2 +- 9 files changed, 200 insertions(+), 39 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index e27df26..5eaef98 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -679,5 +679,13 @@ getIccid(data){ readFi_sensorchannelfi(data) { return sendGetRequest("/readFi/sensorchannelfi", data); }, + //智能灌溉的名称 + getFi_getName(data) { + return sendGetRequest("/getFi/getName", data); + }, + //修改智能灌溉名称 + getFi_updateName(data){ + return sendPutRequest(`/getFi/updateName`, data) + }, }; diff --git a/src/components/setParamsSoil.vue b/src/components/setParamsSoil.vue index 3a0ec0b..12e5c30 100644 --- a/src/components/setParamsSoil.vue +++ b/src/components/setParamsSoil.vue @@ -4,8 +4,8 @@ 设定值参数 -
-
+
+
{{ $store.state.equipmentList[$store.state.equipmentIndex - 1].deviceTypeName }}
@@ -18,18 +18,19 @@
  • {{ - item1.name }}
    {{ item1.status - == 0 - ? '离线' : '在线' }}
    + :class="routerNow == item1.router && routerIndex == index1 + 1 ? 'active' : ''" + class="table-li" v-for="item1, index1 in item.list" :key="index1">{{ + item1.name }}
    {{ + item1.status + == 0 + ? '离线' : '在线' }}
{{ - item.name - }}
+ item.name + }}
@@ -40,7 +41,7 @@ export default { return { routerList: [ // { name: '施肥机配方设置', list: [], router: 'formula' }, - { name: `${ this.$store.state.equipmentList[this.$store.state.equipmentIndex - 1].deviceTypeName }状态显示`, list: [], router: 'status-soil', isRouter: true, }, + { name: `${this.$store.state.equipmentList[this.$store.state.equipmentIndex - 1].deviceTypeName}状态显示`, list: [], router: 'status-soil', isRouter: true, }, { name: '灌溉组配置', router: 'irrigateSet-soil', list: [ { name: '1#灌溉组配置', status: -1, router: 'irrigateSet-soil', index: 1 }, @@ -60,7 +61,7 @@ export default { { name: '15#灌溉组配置', status: -1, router: 'irrigateSet-soil', index: 15 }, { name: '16#灌溉组配置', status: -1, router: 'irrigateSet-soil', index: 16 }] }, - + { name: '固有参数', list: [], router: 'intrinsicParameter-soil', isRouter: true, }, { name: '系统参数配置', list: [], router: 'systemSet-soil', isRouter: true, }, { name: '传感器通道配置', list: [], router: 'sensorSet-soil', isRouter: true, }, @@ -80,8 +81,8 @@ export default { this.dataInit() }, methods: { - //获取设备名称/配方名称 - getByid() { + //获取设备名称/配方名称 + getByid() { var store = this.$store.state var data = { deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId, @@ -103,10 +104,28 @@ export default { // }else{ // this.getList() // } - + var store = this.$store.state + var data = { + deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId, + }; + this.api.getFi_getName(data).then(res => { + if (res.data.code == 200) { + // 将name1到name16转换成数组 + const namesArray = []; + for (let i = 1; i <= 16; i++) { + namesArray.push(res.data.data[`name${i}`]); + } + // 替换routerList[1].list中的name + this.routerList[1].list.forEach((item, index) => { + if (index < namesArray.length) { + item.name = namesArray[index]; + } + }); + } + }) }, - getList(){ + getList() { var store = this.$store.state // store.nameList.forEach((el, index) => { // if (index < 8) { @@ -144,7 +163,9 @@ export default { if (item.http) { window.location.href = item.http; } else if (item.router == 'irrigateSet-soil' && this.$route.query.id != item.index) { - this.$router.push({ path: `/irrigateSet-soil?id=${item.index}` }) + this.$router.push({ path: `/irrigateSet-soil`,query:{ + id:item.index,name:item.name + } }) } // else if (item.router == 'formula' && this.$route.query.id != item.index) { // this.$router.push({ path: `/formula?id=${item.index}` }) @@ -221,5 +242,4 @@ export default { } } } - - \ No newline at end of file + \ No newline at end of file diff --git a/src/views/manage/deviceInfoManage.vue b/src/views/manage/deviceInfoManage.vue index a0a3ecf..5031754 100644 --- a/src/views/manage/deviceInfoManage.vue +++ b/src/views/manage/deviceInfoManage.vue @@ -17,7 +17,7 @@ 智能控制器 -
+
@@ -251,7 +254,7 @@
取消
- +
@@ -302,6 +305,73 @@
取消
+ + +
+ 修改更多名称 +
+
+
+
+
智能灌溉1-8
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
智能灌溉9-16
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
确定
+
取消
+
+