yanghao 1 неделя назад
Родитель
Сommit
8b3a442332
5 измененных файлов с 52 добавлено и 34 удалено
  1. 2 2
      config/env.dev.js
  2. 2 2
      config/env.prod.js
  3. 22 8
      pages/recordFilling/detail.vue
  4. 22 22
      pages/user/login.vue
  5. 4 0
      readme.md

+ 2 - 2
config/env.dev.js

@@ -1,7 +1,7 @@
 // 开发环境配置
 export default {
-	// apiUrl: 'http://192.168.188.16:48080',
-	apiUrl: 'https://iot.deepoil.cc',
+	apiUrl: 'http://192.168.188.16:48080',
+	// apiUrl: 'https://iot.deepoil.cc',
 	// apiUrl: 'https://aims.deepoil.cc', //正式
 	apiUrlSuffix: '/admin-api',
 	// 其他开发环境配置...  

+ 2 - 2
config/env.prod.js

@@ -1,8 +1,8 @@
 // 生产环境配置
 export default {
 	// apiUrl: 'http://192.168.1.63:8888',
-	// apiUrl: 'https://iot.deepoil.cc', //测试
-	apiUrl: 'https://aims.deepoil.cc', //正式
+	apiUrl: 'https://iot.deepoil.cc', //测试
+	// apiUrl: 'https://aims.deepoil.cc', //正式
 	apiUrlSuffix: '/admin-api',
 	// 其他开发环境配置...
 	corpId: 'dingbe7f9a7e8cffa2bd35c2f4657eb6378f', //钉钉微应用 企业的CorpID - 正式环境

+ 22 - 8
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"
+    );
   }
 };
 
@@ -506,12 +510,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 +583,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修复
+- 运行记录刷新问题
+- 运行记录填报