Преглед на файлове

Merge branch 'fix_refresh' of shuzhihua/pms-app into master

yanghao преди 6 дни
родител
ревизия
cde998b0ed
променени са 6 файла, в които са добавени 83 реда и са изтрити 101 реда
  1. 0 38
      androidPrivacy.json
  2. 11 11
      config/env.prod.js
  3. 1 1
      manifest.json
  4. 45 29
      pages/recordFilling/detail.vue
  5. 22 22
      pages/user/login.vue
  6. 4 0
      readme.md

+ 0 - 38
androidPrivacy.json

@@ -1,38 +0,0 @@
-{
-	"version": "1",
-	"prompt": "template",
-	"title": "服务协议和隐私政策",
-	"message": "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"./static/privacy.html\">《隐私政策》</a>和<a href=\"./static/agreement.html\">《用户协议》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
-	"buttonAccept": "同意并接受",
-	"buttonRefuse": "暂不同意",
-	"hrefLoader": "default",
-	"backToExit": "false",
-	"second": {
-		"title": "确认提示",
-		"message": "  进入应用前,请您阅读<a href=\"./static/privacy.html\">《隐私政策》</a>和<a href=\"./static/agreement.html\">《用户协议》</a>,否则将退出应用。",
-		"buttonAccept": "同意并继续",
-		"buttonRefuse": "退出应用"
-	},
-	"disagreeMode": {
-		"support": false,
-		"loadNativePlugins": false,
-		"visitorEntry": false,
-		"showAlways": false
-	},
-	"styles": {
-		"backgroundColor": "#fff",
-		"borderRadius": "5px",
-		"title": {
-			"color": "#000"
-		},
-		"buttonAccept": {
-			"color": "#00adff"
-		},
-		"buttonRefuse": {
-			"color": "#e73f32"
-		},
-		"buttonVisitor": {
-			"color": "#000"
-		}
-	}
-}

+ 11 - 11
config/env.prod.js

@@ -1,14 +1,14 @@
 // 生产环境配置
 export default {
-  // apiUrl: 'http://192.168.1.63:8888',
-  // apiUrl: 'https://iot.deepoil.cc', //测试
-  apiUrl: 'https://aims.deepoil.cc', //正式
-  apiUrlSuffix: '/admin-api',
-  // 其他开发环境配置...
-  corpId: 'dingbe7f9a7e8cffa2bd35c2f4657eb6378f', //钉钉微应用 企业的CorpID - 正式环境
-  clientId: 'dingmr9ez0ecgbmscfeb', //钉钉微应用的Client ID - 正式环境(原企业内部应用的 AppKey。原第三方企业应用的 SuiteKey。)
-  AgentId: '3687646006', //钉钉微应用的AgentID - 正式环境
-  MiniAppId: '5000000006298501', //钉钉微应用的MiniAppID - 正式环境
-  AppKey: 'dingmr9ez0ecgbmscfeb', //钉钉微应用的AppKey - 正式环境
-  AppSecret: 'VhG_zMdTvIBwA_0Ef8FJ0foH3VYYo5T-kw0ukX_PBA8Ah1xl7AjDw5RVYCU0DTpe', //钉钉微应用的AppSecret - 正式环境
+	// apiUrl: 'http://192.168.1.63:8888',
+	apiUrl: 'https://iot.deepoil.cc', //测试
+	// apiUrl: 'https://aims.deepoil.cc', //正式
+	apiUrlSuffix: '/admin-api',
+	// 其他开发环境配置...
+	corpId: 'dingbe7f9a7e8cffa2bd35c2f4657eb6378f', //钉钉微应用 企业的CorpID - 正式环境
+	clientId: 'dingmr9ez0ecgbmscfeb', //钉钉微应用的Client ID - 正式环境(原企业内部应用的 AppKey。原第三方企业应用的 SuiteKey。)
+	AgentId: '3687646006', //钉钉微应用的AgentID - 正式环境
+	MiniAppId: '5000000006298501', //钉钉微应用的MiniAppID - 正式环境
+	AppKey: 'dingmr9ez0ecgbmscfeb', //钉钉微应用的AppKey - 正式环境
+	AppSecret: 'VhG_zMdTvIBwA_0Ef8FJ0foH3VYYo5T-kw0ukX_PBA8Ah1xl7AjDw5RVYCU0DTpe', //钉钉微应用的AppSecret - 正式环境
 };

+ 1 - 1
manifest.json

@@ -95,7 +95,7 @@
 			/* SDK配置 */
 			"sdkConfigs__UNI__6E4BC49\t": {},
 			"splashscreen": {
-				"useOriginalMsgbox": true
+				"useOriginalMsgbox": false
 			}
 		}
 	},

+ 45 - 29
pages/recordFilling/detail.vue

@@ -317,9 +317,13 @@ const handleRealTimeUpdate = (nosum, deviceItem) => {
   // 当日用电量累加
   if (
     deviceItem.deviceName.includes("箱式变电站") &&
-    nosum.name === "当日用电量"
+    nosum.name === "当日用电量kWh"
   ) {
-    debouncedCalculateTotalRunTime("箱式变电站", "当日用电量", "当日用电量kWh");
+    debouncedCalculateTotalRunTime(
+      "箱式变电站",
+      "当日用电量kWh",
+      "当日用电量kWh"
+    );
   }
 };
 
@@ -470,28 +474,30 @@ const queryList = (pageNo, pageSize) => {
                 // 如果是enum类型,且description不为null,则根据description获取对应字典项数组,赋值给enumList
                 if (nonSumItem.type == "enum" && nonSumItem.description) {
                   console.log("🚀 ~ onSumItem.description:");
-                  nonSumItem.enumList =
+                  const dictOptions =
                     nonSumItem.name === "非生产原因"
-                      ? getIntDictOptions(nonSumItem.description).map(
-                          (dict) => {
-                            return {
-                              ...dict,
-                              text: dict.label,
-                            };
-                          }
-                        )
-                      : getStrDictOptions(nonSumItem.description).map(
-                          (dict) => {
-                            return {
-                              ...dict,
-                              text: dict.label,
-                            };
-                          }
-                        );
-                  console.log(
-                    "🚀 ~  nonSumItem.enumList:",
-                    nonSumItem.enumList
-                  );
+                      ? getIntDictOptions(nonSumItem.description)
+                      : getStrDictOptions(nonSumItem.description);
+
+                  nonSumItem.enumList = dictOptions.map((dict) => {
+                    return {
+                      ...dict,
+                      text: dict.label,
+                    };
+                  });
+
+                  // 确保 fillContent 的类型与 enumList 中的 value 类型匹配
+                  if (nonSumItem.name === "非生产原因") {
+                    // 如果是"非生产原因",将 fillContent 转换为数字类型以匹配 getIntDictOptions
+                    if (
+                      nonSumItem.fillContent !== null &&
+                      nonSumItem.fillContent !== ""
+                    ) {
+                      nonSumItem.fillContent = parseInt(nonSumItem.fillContent);
+                    }
+                  }
+
+                  console.log("🚀 ~ nonSumItem.enumList:", nonSumItem.enumList);
                 }
               });
             }
@@ -506,12 +512,11 @@ const queryList = (pageNo, pageSize) => {
 
       console.log("resList--", resList);
       // 将请求结果通过complete传给z-paging处理,同时也代表请求结束,这一行必须调用
-      paging.value.complete(resList);
 
-      if (pageNo * pageSize >= totalNum.value) {
-        paging.value.complete([]);
-        return;
-      }
+      paging.value.completeByNoMore(
+        resList,
+        pageNo * pageSize >= totalNum.value
+      );
     })
     .catch((res) => {
       // 如果请求失败写paging.value.complete(false);
@@ -580,10 +585,21 @@ const onSubmit = async () => {
   // 如果所有项全部填写,则调用填写记录接口
 
   for (const item of dataList.value) {
-    const nonSumList = item.nonSumList;
+    const nonSumList = Array.isArray(item.nonSumList) ? item.nonSumList : [];
+
+    // 查找当日运转时间H项目
+    const runtimeItem = nonSumList.find((i) => i.name === "当日运转时间H");
+    const isRuntime24 =
+      runtimeItem &&
+      (runtimeItem.fillContent == 24 || runtimeItem.fillContent == "24");
     for (const nonSumItem of nonSumList) {
+      // 增加判断条件:如果当日运转时间H等于24,则非生产原因和非生产时间H为非必填,否则为必填
+      const isExemptField =
+        isRuntime24 &&
+        (nonSumItem.name === "非生产原因" || nonSumItem.name === "非生产时间H");
       if (
         (!item.isReport || item.isReport != 1) &&
+        !isExemptField &&
         (nonSumItem.fillContent == null || nonSumItem.fillContent === "")
       ) {
         uni.showToast({

+ 22 - 22
pages/user/login.vue

@@ -34,7 +34,7 @@
 			</view>
 		</view>
 
-		<view class="uni-padding-wrap">
+		<!-- <view class="uni-padding-wrap">
 			<view>
 				<checkbox-group @change="handleChange">
 					<label>
@@ -43,7 +43,7 @@
 				</checkbox-group>
 			</view>
 
-			<view class="uni-title">
+						<view class="uni-title">
 				已阅读并同意
 				<text style="text-decoration: underline" @click="goPrivacy">《隐私政策》</text>
 
@@ -66,7 +66,7 @@
 					</view>
 				</scroll-view>
 			</uni-popup>
-		</view>
+		</view> -->
 
 		<!-- 引用语言选择组件 -->
 		<language-popup ref="languagePopupRef" />
@@ -113,16 +113,16 @@ const handleChange = (val) => {
 	my_value.value = val.detail.value[0];
 };
 
-let privacyRef = ref(null);
-let aggRef = ref(null);
+// let privacyRef = ref(null);
+// let aggRef = ref(null);
 
-const goPrivacy = () => {
-	privacyRef.value.open();
-};
+// const goPrivacy = () => {
+// 	privacyRef.value.open();
+// };
 
-const goAgreement = () => {
-	aggRef.value.open();
-};
+// const goAgreement = () => {
+// 	aggRef.value.open();
+// };
 
 // 判断当前环境是否在钉钉环境
 const isDingTalk = () => {
@@ -291,16 +291,16 @@ const loginRules = ref({
 
 const formRef = ref();
 const formSubmit = async (formEl) => {
-	if (!my_value.value) {
-		uni.showToast({
-			title: '请阅读并同意隐私政策和用户服务协议',
-			icon: 'none', // 可选 success/error/loading/none
-			duration: 2000, // 持续时间,单位ms
-			mask: true // 是否显示透明蒙层,防止触摸穿透
-		});
-
-		return;
-	}
+	// if (!my_value.value) {
+	// 	uni.showToast({
+	// 		title: '请阅读并同意隐私政策和用户服务协议',
+	// 		icon: 'none', // 可选 success/error/loading/none
+	// 		duration: 2000, // 持续时间,单位ms
+	// 		mask: true // 是否显示透明蒙层,防止触摸穿透
+	// 	});
+
+	// 	return;
+	// }
 	if (!formEl) return;
 	await formEl
 		.validate()
@@ -425,4 +425,4 @@ uni-button[type='primary'] {
 	font-size: 14px;
 	font-weight: 500;
 }
-</style>
+</style>

+ 4 - 0
readme.md

@@ -0,0 +1,4 @@
+## 更新内容
+### 1.2.10 Bug修复
+- 运行记录刷新问题
+- 运行记录填报