From 5b78381ef0a4923c250c154100c98621992e3f2a Mon Sep 17 00:00:00 2001
From: Iruka <1017819588@qq.com>
Date: Tue, 18 Feb 2025 15:41:31 +0800
Subject: [PATCH] .
---
pages.json | 6 ++
pages/dev-ops/device.vue | 102 +++++++++++++++----
pages/dev-ops/editMp.vue | 215 +++++++++++++++++++++++++++++++++++++++
pages/mine/index.vue | 5 +-
plugins/modal.js | 9 +-
utils/indexUtil/index.js | 20 +++-
6 files changed, 334 insertions(+), 23 deletions(-)
create mode 100644 pages/dev-ops/editMp.vue
diff --git a/pages.json b/pages.json
index d60952e..5b3dd09 100644
--- a/pages.json
+++ b/pages.json
@@ -315,6 +315,12 @@
"navigationBarTitleText": "阀门",
"navigationStyle": "custom"
}
+ }, {
+ "path": "pages/dev-ops/editMp",
+ "style": {
+ "navigationBarTitleText": "修改墒情",
+ "navigationStyle": "custom"
+ }
},
/******************************* 批量控制 ******************************/
{
diff --git a/pages/dev-ops/device.vue b/pages/dev-ops/device.vue
index d2bc09a..194c0a2 100644
--- a/pages/dev-ops/device.vue
+++ b/pages/dev-ops/device.vue
@@ -4,7 +4,7 @@
-
+
@@ -153,6 +153,48 @@
+
+
+
+
+ 墒情
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
+
+
+
+ 层数:{{ item.floors }}
+
+
+ 深度:{{ item.depth }}
+
+
+
+
+
+
+
+
+
+
+
@@ -173,6 +215,7 @@
+
+
\ No newline at end of file
diff --git a/pages/mine/index.vue b/pages/mine/index.vue
index 6b27874..052ca1e 100644
--- a/pages/mine/index.vue
+++ b/pages/mine/index.vue
@@ -207,8 +207,11 @@
});
break;
case "DevOps": //运维
+ // uni.navigateTo({
+ // url: '/pages/dev-ops/index'
+ // });
uni.navigateTo({
- url: '/pages/dev-ops/index'
+ url: '/pages/dev-ops/device'
});
break;
case "retrace": //追溯
diff --git a/plugins/modal.js b/plugins/modal.js
index 70c6def..2024b3e 100644
--- a/plugins/modal.js
+++ b/plugins/modal.js
@@ -28,11 +28,16 @@ export default {
uni.hideToast()
},
// 弹出提示
- alert(text) {
+ alert(text, callback = null) {
uni.showModal({
title: '提示',
content: text,
- showCancel: false
+ showCancel: false,
+ success: function(res) {
+ if (typeof callback === 'function') {
+ callback();
+ }
+ }
})
},
// 确认窗体
diff --git a/utils/indexUtil/index.js b/utils/indexUtil/index.js
index c57454f..04cc2f6 100644
--- a/utils/indexUtil/index.js
+++ b/utils/indexUtil/index.js
@@ -1,4 +1,6 @@
import store from "@/store"
+const user = store.state.user.user;
+import plugin from "@/plugins"
import constant from "@/utils/constant.js"
import * as commonUtils from "@/utils/common.js"
import {
@@ -45,6 +47,20 @@ class indexUtil {
}
}
+ get getLandData() {
+ console.error("land");
+ if (!user?.userId) {
+ plugin.modal.msg("请重新登录")
+ return null;
+ }
+ if (!this.land) {
+ this.initData(user.userId, function(_land, _wo) {});
+ }
+
+ return this.land;
+ }
+
+
/**
* 获取数据的规则
* 如果是第一次打开,则先获取缓存,如果有缓存,则先使用缓存,然后异步更新数据;如果没有缓存,则只能查询数据;
@@ -195,7 +211,7 @@ class indexUtil {
}
})
}
-
+
// 刷新控制中阀门
refreshControlling() {
const landId = this.land?.id;
@@ -211,7 +227,7 @@ class indexUtil {
}
})
}
-
+
// 缓存数据
setStorage(type, data) {
switch (type) {