提交 7f815e98 authored 作者: caodi\cd's avatar caodi\cd

fix:优化

上级 f9931b89
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<view class="header"> <view class="header">
<view class="title">杭州内网监管在线-运维在线</view> <view class="title">杭州内网监管在线-运维在线</view>
<view class="header-buttons"> <view class="header-buttons">
<button class="log-button" @click="lookLog">操作日志</button> <view class="log-button" @click="lookLog">操作日志</view>
<div class="exit-button" @click="logOut"> <div class="exit-button" @click="logOut">
<image <image
class="logout" class="logout"
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
src="@/static/img/add-img/home1.png" src="@/static/img/add-img/home1.png"
mode="aspectFit" mode="aspectFit"
></image> ></image>
<view class="change-password" @click="updatePassword" <!-- <view class="change-password" @click="updatePassword"
>修改密码</view >修改密码</view
> > -->
</view> </view>
<view class="username">{{ userName }}</view> <view class="username">{{ userName }}</view>
</view> </view>
...@@ -206,6 +206,7 @@ export default { ...@@ -206,6 +206,7 @@ export default {
color: #000000; color: #000000;
line-height: 36px; line-height: 36px;
font-weight: 400; font-weight: 400;
text-align: center;
} }
.exit-button { .exit-button {
...@@ -322,7 +323,6 @@ export default { ...@@ -322,7 +323,6 @@ export default {
.card { .card {
width: 224px; width: 224px;
height: 194px; height: 194px;
background-color: #f0f0f0;
border-radius: 10px; border-radius: 10px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<view> <view>
<view v-for="(item, index) in itemData.detail" :key="index"> <view v-for="(item, index) in itemData.detail" :key="index">
<template <template
v-if="!(index > 2 && itemData.detail[2].inspectionResult === 1)" v-if="!(index > 2 && itemData.detail[2].inspectionResult !== 0)"
> >
<view class="form-item"> <view class="form-item">
<text class="form-label" <text class="form-label"
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</view> </view>
</view> </view>
</view> </view>
<template v-if="item.inspectionResult === 1">
<view v-if="'conclusion' in item" class="form-item"> <view v-if="'conclusion' in item" class="form-item">
<text class="form-label" <text class="form-label"
><text class="required">*</text>情况摘要</text ><text class="required">*</text>情况摘要</text
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
> >
</view> </view>
</view></template </view></template
></template
> </view > </view
><custom-popup ><custom-popup
ref="customPopup" ref="customPopup"
...@@ -104,7 +105,7 @@ export default { ...@@ -104,7 +105,7 @@ export default {
detail: [ detail: [
{ {
label: "门禁功能", label: "门禁功能",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "异常"], lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
...@@ -112,7 +113,7 @@ export default { ...@@ -112,7 +113,7 @@ export default {
}, },
{ {
label: "门禁外观破损", label: "门禁外观破损",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "无", inspectionResultLable: "无",
lableArr: ["无", "有"], lableArr: ["无", "有"],
conclusion: "", conclusion: "",
...@@ -120,13 +121,13 @@ export default { ...@@ -120,13 +121,13 @@ export default {
}, },
{ {
label: "是否有监控", label: "是否有监控",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "有监控", inspectionResultLable: "有监控",
lableArr: ["有监控", "无监控"], lableArr: ["有监控", "无监控"],
}, },
{ {
label: "监控外观破损", label: "监控外观破损",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "无", inspectionResultLable: "无",
lableArr: ["无", "有"], lableArr: ["无", "有"],
conclusion: "", conclusion: "",
...@@ -134,7 +135,7 @@ export default { ...@@ -134,7 +135,7 @@ export default {
}, },
{ {
label: "监控画面清晰", label: "监控画面清晰",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "清晰", inspectionResultLable: "清晰",
lableArr: ["清晰", "模糊"], lableArr: ["清晰", "模糊"],
conclusion: "", conclusion: "",
...@@ -142,7 +143,7 @@ export default { ...@@ -142,7 +143,7 @@ export default {
}, },
{ {
label: "监控存储连续", label: "监控存储连续",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "异常"], lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
...@@ -237,46 +238,71 @@ export default { ...@@ -237,46 +238,71 @@ export default {
this.itemData.isValid = isValid; this.itemData.isValid = isValid;
this.itemData.inspectionItem = this.inspectionItem; this.itemData.inspectionItem = this.inspectionItem;
console.log(222, this.itemData); console.log(222, this.itemData);
if (isAllOne) { this.itemData.status = isAllOne.status; //1表示已经巡检过没有异常
// 全都是正常 this.itemData.statusLabel = isAllOne.statusLabel;
this.itemData.status = 1; //1表示已经巡检过没有异常
this.itemData.statusLabel = "已巡检";
} else {
this.itemData.status = 2; //1表示已经巡检过有异常
this.itemData.statusLabel = "巡检异常";
}
// console.log(this.itemData); // console.log(this.itemData);
return this.itemData; return this.itemData;
}, },
// 数据校验方法 true说明有未填项 // 数据校验方法 true说明有未填项
areAllObjectsValid(arr, skipIndex) { areAllObjectsValid(details) {
// 遍历数组中的每个对象 const thirdItem = details[2]; // 第三个对象
for (let i = 0; i < arr.length; i++) { console.log("thirdItem.inspectionResult", thirdItem.inspectionResult);
const obj = arr[i]; // 情况1:第三个对象的 inspectionResult 是 "0",校验所有 inspectionResult 是否不为空
// 如果当前索引大于等于 skipIndex,并且 inspectionResult 为 1,则跳过后续校验 if (thirdItem.inspectionResult === 0) {
if (i >= skipIndex && obj.inspectionResult === 1) { const hasEmptyInspectionResult = details.some(
break; (item) => item.inspectionResult === ""
} );
// 检查对象中的每个属性是否有值 if (hasEmptyInspectionResult) {
for (const key in obj) {
if (obj.hasOwnProperty(key)) {
// 如果属性值为空(null, undefined, 空字符串等),则校验不通过
if (
obj[key] === null ||
obj[key] === undefined ||
obj[key] === ""
) {
return false; return false;
} }
} }
// 确定需要校验的范围
const itemsToCheck =
thirdItem.inspectionResult === 1 ? details.slice(0, 2) : details;
console.log("确定需要校验的范围 ", itemsToCheck);
// 检查 conclusion 和 photos(如果存在)
for (const item of itemsToCheck) {
if (item.inspectionResult === 0) {
continue; // 跳过检查
}
if ("conclusion" in item && !item.conclusion) {
return false;
}
if ("photos" in item && item.photos.length === 0) {
return false;
} }
} }
// 如果所有对象都通过校验,返回 true
return true; return true;
}, },
// 校验是否有异常 areAllInspectionResultsOne(details) {
areAllInspectionResultsOne(arr) { const thirdItemResult = details[2].inspectionResult;
return arr.every((obj) => obj.inspectionResult === 0); const shouldCheckAll = !(thirdItemResult === 1 || thirdItemResult === "");
const checkItems = shouldCheckAll ? details : details.slice(0, 3);
let hasEmpty = false;
let hasZero = false;
let hasOne = false;
for (let i = 0; i < checkItems.length; i++) {
if (i === 2) continue;
const result = checkItems[i].inspectionResult;
if (result === 1) {
hasOne = true;
} else if (result === 0) {
hasZero = true;
} else if (result === "") {
console.log("i", i);
hasEmpty = true;
}
}
if (hasOne) {
return { status: 2, statusLabel: "巡检异常" };
} else if (hasZero && !hasEmpty) {
return { status: 1, statusLabel: "已巡检" };
} else {
return { status: 0, statusLabel: "未巡检" };
}
}, },
}, },
}; };
......
...@@ -25,22 +25,27 @@ ...@@ -25,22 +25,27 @@
{{ item.lableArr[1] }} {{ item.lableArr[1] }}
</view> </view </view> </view
><input ><input
v-if="'value' in item" v-if="'value' in item && item.inspectionResult === 1"
class="input" class="input"
v-model="item.value" v-model="item.value"
type="text" type="text"
placeholder="请输入" placeholder="请输入"
maxlength="3" maxlength="3"
/>{{ item.unit }} />{{ item.inspectionResult === 1?item.unit:"" }}
</view> </view>
<template v-if="item.inspectionResult === 1">
<view v-if="'conclusion' in item" class="form-item"> <view v-if="'conclusion' in item" class="form-item">
<text class="form-label"><text class="required">*</text>情况摘要</text> <text class="form-label"
><text class="required">*</text>情况摘要</text
>
<text class="conclusion" @click="showPopup(index)">{{ <text class="conclusion" @click="showPopup(index)">{{
item.conclusion || "请输入情况摘要" item.conclusion || "请输入情况摘要"
}}</text> }}</text>
</view> </view>
<view class="form-item" v-if="'photos' in item"> <view class="form-item" v-if="'photos' in item">
<text class="form-label"><text class="required">*</text>现场照片</text> <text class="form-label"
><text class="required">*</text>现场照片</text
>
<view class="photo-box"> <view class="photo-box">
<view class="photo-container"> <view class="photo-container">
<view @click="takePhoto(index)" class="photo-btn"> + </view> <view @click="takePhoto(index)" class="photo-btn"> + </view>
...@@ -50,7 +55,9 @@ ...@@ -50,7 +55,9 @@
class="photo-item" class="photo-item"
> >
<image :src="photo" class="photo"></image> <image :src="photo" class="photo"></image>
<text class="delete-photo" @click="deletePhoto(index, itemIndex)" <text
class="delete-photo"
@click="deletePhoto(index, itemIndex)"
>×</text >×</text
> >
</view> </view>
...@@ -59,7 +66,8 @@ ...@@ -59,7 +66,8 @@
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view >请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
> >
</view> </view>
</view> </view </view>
</template></view
><custom-popup ><custom-popup
ref="customPopup" ref="customPopup"
:inspectionItem="inspectionItem" :inspectionItem="inspectionItem"
...@@ -112,9 +120,9 @@ export default { ...@@ -112,9 +120,9 @@ export default {
label: "电池电压", label: "电池电压",
sjLabel: "实际电池电压", sjLabel: "实际电池电压",
sjLabelShow: "实际电压", sjLabelShow: "实际电压",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "常"], lableArr: ["正常", "常"],
conclusion: "", conclusion: "",
settingLabel: "设定电池电压", settingLabel: "设定电池电压",
settingLabelShow: "设定电压", settingLabelShow: "设定电压",
...@@ -127,9 +135,9 @@ export default { ...@@ -127,9 +135,9 @@ export default {
label: "电池温度", label: "电池温度",
sjLabel: "实际电池温度", sjLabel: "实际电池温度",
sjLabelShow: "实际温度", sjLabelShow: "实际温度",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "常"], lableArr: ["正常", "常"],
conclusion: "", conclusion: "",
settingLabel: "设定电池温度", settingLabel: "设定电池温度",
settingLabelShow: "设定温度", settingLabelShow: "设定温度",
...@@ -142,9 +150,9 @@ export default { ...@@ -142,9 +150,9 @@ export default {
label: "电池内阻", label: "电池内阻",
sjLabel: "实际电池内阻", sjLabel: "实际电池内阻",
sjLabelShow: "实际内阻", sjLabelShow: "实际内阻",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "常"], lableArr: ["正常", "常"],
conclusion: "", conclusion: "",
settingLabel: "设定电池内阻", settingLabel: "设定电池内阻",
settingLabelShow: "设定内阻", settingLabelShow: "设定内阻",
...@@ -155,7 +163,6 @@ export default { ...@@ -155,7 +163,6 @@ export default {
}, },
], ],
}, },
}; };
}, },
computed: { computed: {
...@@ -169,7 +176,7 @@ export default { ...@@ -169,7 +176,7 @@ export default {
if (Object.keys(this.defaultData).length !== 0) { if (Object.keys(this.defaultData).length !== 0) {
this.itemData = this.defaultData; this.itemData = this.defaultData;
} }
} },
}, },
methods: { methods: {
// 拍照 // 拍照
...@@ -243,46 +250,71 @@ export default { ...@@ -243,46 +250,71 @@ export default {
this.itemData.isValid = isValid; this.itemData.isValid = isValid;
this.itemData.inspectionItem = this.inspectionItem; this.itemData.inspectionItem = this.inspectionItem;
console.log(222, this.itemData); console.log(222, this.itemData);
if (isAllOne) { this.itemData.status = isAllOne.status; //1表示已经巡检过没有异常
// 全都是正常 this.itemData.statusLabel = isAllOne.statusLabel;
this.itemData.status = 1; //1表示已经巡检过没有异常
this.itemData.statusLabel = "已巡检";
} else {
this.itemData.status = 2; //1表示已经巡检过有异常
this.itemData.statusLabel = "巡检异常";
}
// console.log(this.itemData); // console.log(this.itemData);
return this.itemData; return this.itemData;
}, },
// 数据校验方法 true说明有未填项 // 数据校验方法 true说明有未填项
areAllObjectsValid(arr, skipIndex) {
// 遍历数组中的每个对象 areAllObjectsValid(details) {
for (let i = 0; i < arr.length; i++) { // 检查是否有任何项的 inspectionResult 为空字符串
const obj = arr[i]; const hasEmptyResult = details.some(
// 如果当前索引大于等于 skipIndex,并且 inspectionResult 为 1,则跳过后续校验 (item) => item.inspectionResult === ""
if (i >= skipIndex && obj.inspectionResult === 1) { );
break; if (hasEmptyResult) {
}
// 检查对象中的每个属性是否有值
for (const key in obj) {
if (obj.hasOwnProperty(key)) {
// 如果属性值为空(null, undefined, 空字符串等),则校验不通过
if (
obj[key] === null ||
obj[key] === undefined ||
obj[key] === ""
) {
return false; return false;
} }
// 遍历每一项进行检查
for (const item of details) {
if (item.inspectionResult === 0) {
// 如果 inspectionResult 为 0,跳过此项的其他检查
continue;
} else if (item.inspectionResult === 1) {
// 如果 inspectionResult 为 1,检查 conclusion 和 photos
if (!item.conclusion || item.photos.length === 0 || !item.value) {
return false;
} }
} else {
// 其他情况(理论上不应该存在,根据当前规则)
return false;
} }
} }
// 如果所有对象都通过校验,返回 true // 所有检查都通过
return true; return true;
}, },
// 校验是否有异常 // 校验是否有异常
areAllInspectionResultsOne(arr) { areAllInspectionResultsOne(details) {
return arr.every((obj) => obj.inspectionResult === 0); let hasEmpty = false;
let allZero = true;
let hasOne = false;
for (const item of details) {
if (item.inspectionResult === "") {
hasEmpty = true;
break;
} else if (item.inspectionResult === 1) {
hasOne = true;
allZero = false;
} else if (item.inspectionResult === 0) {
// 继续检查
} else {
// 如果有其他值,可以在这里处理
allZero = false;
}
}
if (hasEmpty) {
return { statusLabel: "未巡检", status: 0 };
} else if (allZero) {
return { statusLabel: "已巡检", status: 1 };
} else if (hasOne) {
return { statusLabel: "巡检异常", status: 2 };
} else {
// 默认情况,可以根据需求调整
return { statusLabel: "未巡检", status: 0 };
}
}, },
}, },
}; };
......
...@@ -22,14 +22,19 @@ ...@@ -22,14 +22,19 @@
</view> </view>
</view> </view>
<template v-if="item.inspectionResult === 1">
<view class="form-item"> <view class="form-item">
<text class="form-label"><text class="required">*</text>情况摘要</text> <text class="form-label"
><text class="required">*</text>情况摘要</text
>
<text class="conclusion" @click="showPopup(index)">{{ <text class="conclusion" @click="showPopup(index)">{{
item.conclusion || "请输入情况摘要" item.conclusion || "请输入情况摘要"
}}</text> }}</text>
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="form-label"><text class="required">*</text>现场照片</text> <text class="form-label"
><text class="required">*</text>现场照片</text
>
<view class="photo-box"> <view class="photo-box">
<view class="photo-container"> <view class="photo-container">
<view @click="takePhoto(index)" class="photo-btn"> + </view> <view @click="takePhoto(index)" class="photo-btn"> + </view>
...@@ -39,7 +44,9 @@ ...@@ -39,7 +44,9 @@
class="photo-item" class="photo-item"
> >
<image :src="photo" class="photo"></image> <image :src="photo" class="photo"></image>
<text class="delete-photo" @click="deletePhoto(index, itemIndex)" <text
class="delete-photo"
@click="deletePhoto(index, itemIndex)"
>×</text >×</text
> >
</view> </view>
...@@ -48,7 +55,8 @@ ...@@ -48,7 +55,8 @@
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view >请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
> >
</view> </view>
</view> </view </view>
</template></view
><custom-popup ><custom-popup
ref="customPopup" ref="customPopup"
:inspectionItem="inspectionItem" :inspectionItem="inspectionItem"
...@@ -94,7 +102,7 @@ export default { ...@@ -94,7 +102,7 @@ export default {
detail: [ detail: [
{ {
label: "市电输入状态", label: "市电输入状态",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "异常"], lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
...@@ -102,7 +110,7 @@ export default { ...@@ -102,7 +110,7 @@ export default {
}, },
{ {
label: "UPS状态", label: "UPS状态",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "异常"], lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
...@@ -110,7 +118,7 @@ export default { ...@@ -110,7 +118,7 @@ export default {
}, },
{ {
label: "电池状态", label: "电池状态",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "异常"], lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
...@@ -202,51 +210,72 @@ export default { ...@@ -202,51 +210,72 @@ export default {
const isAllOne = this.areAllInspectionResultsOne(this.itemData.detail); const isAllOne = this.areAllInspectionResultsOne(this.itemData.detail);
this.itemData.isValid = isValid; this.itemData.isValid = isValid;
this.itemData.inspectionItem = this.inspectionItem; this.itemData.inspectionItem = this.inspectionItem;
if (isAllOne) {
// 全都是正常 this.itemData.status = isAllOne.status; //1表示已经巡检过没有异常
this.itemData.status = 1; //1表示已经巡检过没有异常 this.itemData.statusLabel = isAllOne.statusLabel;
this.itemData.statusLabel = "已巡检";
} else {
this.itemData.status = 2; //1表示已经巡检过有异常
this.itemData.statusLabel = "巡检异常";
}
// console.log(this.itemData); // console.log(this.itemData);
return this.itemData; return this.itemData;
}, },
// 数据校验方法 true说明有未填项 // 数据校验方法 true说明有未填项
areAllObjectsValid(arr) {
for (let i = 0; i < arr.length; i++) { areAllObjectsValid(details) {
const obj = arr[i]; // 检查是否有任何项的 inspectionResult 为空字符串
const keys = Object.keys(obj); const hasEmptyResult = details.some(
for (let j = 0; j < keys.length; j++) { (item) => item.inspectionResult === ""
const key = keys[j]; );
const value = obj[key]; if (hasEmptyResult) {
if (value === null || value === undefined || value === "") {
return false;
}
if (Array.isArray(value)) {
if (value.length === 0) {
return false; return false;
} }
for (let k = 0; k < value.length; k++) {
if (typeof value[k] === "object" && value[k] !== null) { // 遍历每一项进行检查
if (!validateArrayObjects([value[k]])) { for (const item of details) {
if (item.inspectionResult === 0) {
// 如果 inspectionResult 为 0,跳过此项的其他检查
continue;
} else if (item.inspectionResult === 1) {
// 如果 inspectionResult 为 1,检查 conclusion 和 photos
if (!item.conclusion || item.photos.length === 0) {
return false; return false;
} }
} } else {
} // 其他情况(理论上不应该存在,根据当前规则)
} else if (typeof value === "object" && value !== null) {
if (!validateArrayObjects([value])) {
return false; return false;
} }
} }
} // 所有检查都通过
}
return true; return true;
}, },
// 校验是否有异常 // 校验是否有异常
areAllInspectionResultsOne(arr) { areAllInspectionResultsOne(details) {
return arr.every((obj) => obj.inspectionResult === 0); let hasEmpty = false;
let allZero = true;
let hasOne = false;
for (const item of details) {
if (item.inspectionResult === "") {
hasEmpty = true;
break;
} else if (item.inspectionResult === 1) {
hasOne = true;
allZero = false;
} else if (item.inspectionResult === 0) {
// 继续检查
} else {
// 如果有其他值,可以在这里处理
allZero = false;
}
}
if (hasEmpty) {
return { statusLabel: "未巡检", status: 0 };
} else if (allZero) {
return { statusLabel: "已巡检", status: 1 };
} else if (hasOne) {
return { statusLabel: "巡检异常", status: 2 };
} else {
// 默认情况,可以根据需求调整
return { statusLabel: "未巡检", status: 0 };
}
}, },
}, },
}; };
......
...@@ -25,21 +25,27 @@ ...@@ -25,21 +25,27 @@
{{ item.lableArr[1] }} {{ item.lableArr[1] }}
</view> </view </view> </view
><input ><input
v-if="'value' in item && item.inspectionResult === 1"
class="input" class="input"
v-model="item.value" v-model="item.value"
type="text" type="text"
placeholder="请输入" placeholder="请输入"
maxlength="3" maxlength="3"
/>{{ item.unit }} />{{ item.inspectionResult === 1 ? item.unit : "" }}
</view> </view>
<template v-if="item.inspectionResult === 1">
<view v-if="'conclusion' in item" class="form-item"> <view v-if="'conclusion' in item" class="form-item">
<text class="form-label"><text class="required">*</text>情况摘要</text> <text class="form-label"
><text class="required">*</text>情况摘要</text
>
<text class="conclusion" @click="showPopup(index)">{{ <text class="conclusion" @click="showPopup(index)">{{
item.conclusion || "请输入情况摘要" item.conclusion || "请输入情况摘要"
}}</text> }}</text>
</view> </view>
<view class="form-item" v-if="'photos' in item"> <view class="form-item" v-if="'photos' in item">
<text class="form-label"><text class="required">*</text>现场照片</text> <text class="form-label"
><text class="required">*</text>现场照片</text
>
<view class="photo-box"> <view class="photo-box">
<view class="photo-container"> <view class="photo-container">
<view @click="takePhoto(index)" class="photo-btn"> + </view> <view @click="takePhoto(index)" class="photo-btn"> + </view>
...@@ -49,7 +55,9 @@ ...@@ -49,7 +55,9 @@
class="photo-item" class="photo-item"
> >
<image :src="photo" class="photo"></image> <image :src="photo" class="photo"></image>
<text class="delete-photo" @click="deletePhoto(index, itemIndex)" <text
class="delete-photo"
@click="deletePhoto(index, itemIndex)"
>×</text >×</text
> >
</view> </view>
...@@ -58,7 +66,8 @@ ...@@ -58,7 +66,8 @@
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view >请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
> >
</view> </view>
</view></view </view></template
></view
><custom-popup ><custom-popup
ref="customPopup" ref="customPopup"
:inspectionItem="inspectionItem" :inspectionItem="inspectionItem"
...@@ -105,9 +114,9 @@ export default { ...@@ -105,9 +114,9 @@ export default {
{ {
label: "机房温度", label: "机房温度",
sjLabel: "实际温度", sjLabel: "实际温度",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "常"], lableArr: ["正常", "常"],
conclusion: "", conclusion: "",
settingLabel: "设定温度", settingLabel: "设定温度",
setting: "25", //设定温度值 setting: "25", //设定温度值
...@@ -118,9 +127,9 @@ export default { ...@@ -118,9 +127,9 @@ export default {
{ {
label: "机房湿度", label: "机房湿度",
sjLabel: "实际湿度", sjLabel: "实际湿度",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "常"], lableArr: ["正常", "常"],
conclusion: "", conclusion: "",
settingLabel: "设定湿度", settingLabel: "设定湿度",
setting: "25", //设定湿度值 setting: "25", //设定湿度值
...@@ -143,7 +152,7 @@ export default { ...@@ -143,7 +152,7 @@ export default {
if (Object.keys(this.defaultData).length !== 0) { if (Object.keys(this.defaultData).length !== 0) {
this.itemData = this.defaultData; this.itemData = this.defaultData;
} }
} },
}, },
methods: { methods: {
// 拍照 // 拍照
...@@ -217,51 +226,72 @@ export default { ...@@ -217,51 +226,72 @@ export default {
this.itemData.isValid = isValid; this.itemData.isValid = isValid;
this.itemData.inspectionItem = this.inspectionItem; this.itemData.inspectionItem = this.inspectionItem;
console.log(222, this.itemData); console.log(222, this.itemData);
if (isAllOne) {
// 全都是正常 this.itemData.status = isAllOne.status; //1表示已经巡检过没有异常
this.itemData.status = 1; //1表示已经巡检过没有异常 this.itemData.statusLabel = isAllOne.statusLabel;
this.itemData.statusLabel = "已巡检";
} else {
this.itemData.status = 2; //1表示已经巡检过有异常
this.itemData.statusLabel = "巡检异常";
}
// console.log(this.itemData); // console.log(this.itemData);
return this.itemData; return this.itemData;
}, },
// / 数据校验方法 true说明有未填项 // 数据校验方法 true说明有未填项
areAllObjectsValid(arr) {
for (let i = 0; i < arr.length; i++) { areAllObjectsValid(details) {
const obj = arr[i]; // 检查是否有任何项的 inspectionResult 为空字符串
const keys = Object.keys(obj); const hasEmptyResult = details.some(
for (let j = 0; j < keys.length; j++) { (item) => item.inspectionResult === ""
const key = keys[j]; );
const value = obj[key]; if (hasEmptyResult) {
if (value === null || value === undefined || value === "") {
return false;
}
if (Array.isArray(value)) {
if (value.length === 0) {
return false; return false;
} }
for (let k = 0; k < value.length; k++) {
if (typeof value[k] === "object" && value[k] !== null) { // 遍历每一项进行检查
if (!validateArrayObjects([value[k]])) { for (const item of details) {
if (item.inspectionResult === 0) {
// 如果 inspectionResult 为 0,跳过此项的其他检查
continue;
} else if (item.inspectionResult === 1) {
// 如果 inspectionResult 为 1,检查 conclusion 和 photos
if (!item.conclusion || item.photos.length === 0 || !item.value) {
return false; return false;
} }
} } else {
} // 其他情况(理论上不应该存在,根据当前规则)
} else if (typeof value === "object" && value !== null) {
if (!validateArrayObjects([value])) {
return false; return false;
} }
} }
} // 所有检查都通过
}
return true; return true;
}, },
// 校验是否有异常 // 校验是否有异常
areAllInspectionResultsOne(arr) { areAllInspectionResultsOne(details) {
return arr.every((obj) => obj.inspectionResult === 0); let hasEmpty = false;
let allZero = true;
let hasOne = false;
for (const item of details) {
if (item.inspectionResult === "") {
hasEmpty = true;
break;
} else if (item.inspectionResult === 1) {
hasOne = true;
allZero = false;
} else if (item.inspectionResult === 0) {
// 继续检查
} else {
// 如果有其他值,可以在这里处理
allZero = false;
}
}
if (hasEmpty) {
return { statusLabel: "未巡检", status: 0 };
} else if (allZero) {
return { statusLabel: "已巡检", status: 1 };
} else if (hasOne) {
return { statusLabel: "巡检异常", status: 2 };
} else {
// 默认情况,可以根据需求调整
return { statusLabel: "未巡检", status: 0 };
}
}, },
}, },
}; };
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
</view> </view>
</view> </view>
</view> </view>
<template v-if="item.inspectionResult === 1">
<view class="form-item"> <view class="form-item">
<text class="form-label" <text class="form-label"
><text class="required">*</text>{{ item.deviceLabel }}</text ><text class="required">*</text>{{ item.deviceLabel }}</text
...@@ -86,7 +87,8 @@ ...@@ -86,7 +87,8 @@
> >
</view> </view>
</view></template </view></template
> </view >
</template> </view
><custom-popup ><custom-popup
ref="customPopup" ref="customPopup"
:inspectionItem="inspectionItem" :inspectionItem="inspectionItem"
...@@ -132,7 +134,7 @@ export default { ...@@ -132,7 +134,7 @@ export default {
detail: [ detail: [
{ {
label: "是否有告警", label: "是否有告警",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "无", inspectionResultLable: "无",
lableArr: ["无", "有"], lableArr: ["无", "有"],
conclusion: "", conclusion: "",
...@@ -232,46 +234,75 @@ export default { ...@@ -232,46 +234,75 @@ export default {
this.itemData.isValid = isValid; this.itemData.isValid = isValid;
this.itemData.inspectionItem = this.inspectionItem; this.itemData.inspectionItem = this.inspectionItem;
console.log(222, this.itemData); console.log(222, this.itemData);
if (isAllOne) { this.itemData.status = isAllOne.status; //1表示已经巡检过没有异常
// 全都是正常 this.itemData.statusLabel = isAllOne.statusLabel;
this.itemData.status = 1; //1表示已经巡检过没有异常
this.itemData.statusLabel = "已巡检";
} else {
this.itemData.status = 2; //1表示已经巡检过有异常
this.itemData.statusLabel = "巡检异常";
}
// console.log(this.itemData); // console.log(this.itemData);
return this.itemData; return this.itemData;
}, },
// 数据校验方法 true说明有未填项 // 数据校验方法 true说明有未填项
areAllObjectsValid(arr, skipIndex) { areAllObjectsValid(details) {
// 遍历数组中的每个对象 // 检查是否有任何项的 inspectionResult 为空字符串
for (let i = 0; i < arr.length; i++) { const hasEmptyResult = details.some(
const obj = arr[i]; (item) => item.inspectionResult === ""
// 如果当前索引大于等于 skipIndex,并且 inspectionResult 为 1,则跳过后续校验 );
if (i >= skipIndex && obj.inspectionResult === 1) { if (hasEmptyResult) {
break; return false;
} }
// 检查对象中的每个属性是否有值
for (const key in obj) { // 遍历每一项进行检查
if (obj.hasOwnProperty(key)) { for (const item of details) {
// 如果属性值为空(null, undefined, 空字符串等),则校验不通过 if (item.inspectionResult === 0) {
// 如果 inspectionResult 为 0,跳过此项的其他检查
continue;
} else if (item.inspectionResult === 1) {
// 如果 inspectionResult 为 1,检查 conclusion 和 photos
if ( if (
obj[key] === null || !item.conclusion ||
obj[key] === undefined || item.photos.length === 0 ||
obj[key] === "" !item.deviceId ||
!item.UpositonS ||
!item.UpositonE
) { ) {
return false; return false;
} }
} else {
// 其他情况(理论上不应该存在,根据当前规则)
return false;
} }
} }
} // 所有检查都通过
// 如果所有对象都通过校验,返回 true
return true; return true;
}, },
// 校验是否有异常 areAllInspectionResultsOne(details) {
areAllInspectionResultsOne(arr) { let hasEmpty = false;
return arr.every((obj) => obj.inspectionResult === 0); let allZero = true;
let hasOne = false;
for (const item of details) {
if (item.inspectionResult === "") {
hasEmpty = true;
break;
} else if (item.inspectionResult === 1) {
hasOne = true;
allZero = false;
} else if (item.inspectionResult === 0) {
// 继续检查
} else {
// 如果有其他值,可以在这里处理
allZero = false;
}
}
if (hasEmpty) {
return { statusLabel: "未巡检", status: 0 };
} else if (allZero) {
return { statusLabel: "已巡检", status: 1 };
} else if (hasOne) {
return { statusLabel: "巡检异常", status: 2 };
} else {
// 默认情况,可以根据需求调整
return { statusLabel: "未巡检", status: 0 };
}
}, },
}, },
}; };
......
...@@ -21,15 +21,19 @@ ...@@ -21,15 +21,19 @@
</view> </view>
</view> </view>
</view> </view>
<template v-if="item.inspectionResult === 1">
<view class="form-item"> <view class="form-item">
<text class="form-label"><text class="required">*</text>情况摘要</text> <text class="form-label"
><text class="required">*</text>情况摘要</text
>
<text class="conclusion" @click="showPopup(index)">{{ <text class="conclusion" @click="showPopup(index)">{{
item.conclusion || "请输入情况摘要" item.conclusion || "请输入情况摘要"
}}</text> }}</text>
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="form-label"><text class="required">*</text>现场照片</text> <text class="form-label"
><text class="required">*</text>现场照片</text
>
<view class="photo-box"> <view class="photo-box">
<view class="photo-container"> <view class="photo-container">
<view @click="takePhoto(index)" class="photo-btn"> + </view> <view @click="takePhoto(index)" class="photo-btn"> + </view>
...@@ -39,7 +43,9 @@ ...@@ -39,7 +43,9 @@
class="photo-item" class="photo-item"
> >
<image :src="photo" class="photo"></image> <image :src="photo" class="photo"></image>
<text class="delete-photo" @click="deletePhoto(index, itemIndex)" <text
class="delete-photo"
@click="deletePhoto(index, itemIndex)"
>×</text >×</text
> >
</view> </view>
...@@ -48,7 +54,8 @@ ...@@ -48,7 +54,8 @@
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view >请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
> >
</view> </view>
</view> </view </view></template
> </view
><custom-popup ><custom-popup
ref="customPopup" ref="customPopup"
:inspectionItem="inspectionItem" :inspectionItem="inspectionItem"
...@@ -94,7 +101,7 @@ export default { ...@@ -94,7 +101,7 @@ export default {
detail: [ detail: [
{ {
label: "地板、墙壁破损", label: "地板、墙壁破损",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "异常"], lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
...@@ -102,7 +109,7 @@ export default { ...@@ -102,7 +109,7 @@ export default {
}, },
{ {
label: "机房清洁", label: "机房清洁",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "异常"], lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
...@@ -110,7 +117,7 @@ export default { ...@@ -110,7 +117,7 @@ export default {
}, },
{ {
label: "机房通风", label: "机房通风",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "异常"], lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
...@@ -118,7 +125,7 @@ export default { ...@@ -118,7 +125,7 @@ export default {
}, },
{ {
label: "机房照明", label: "机房照明",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "异常"], lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
...@@ -126,7 +133,7 @@ export default { ...@@ -126,7 +133,7 @@ export default {
}, },
{ {
label: "漏水检测", label: "漏水检测",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "异常"], lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
...@@ -226,54 +233,74 @@ export default { ...@@ -226,54 +233,74 @@ export default {
// 处理】数据 // 处理】数据
getFromData() { getFromData() {
const isValid = this.areAllObjectsValid(this.itemData.detail); //false不通过 true通过 const isValid = this.areAllObjectsValid(this.itemData.detail); //false不通过 true通过
console.log("wlhj", isValid);
const isAllOne = this.areAllInspectionResultsOne(this.itemData.detail); const isAllOne = this.areAllInspectionResultsOne(this.itemData.detail);
console.log("isAllOne", isAllOne);
this.itemData.isValid = isValid; this.itemData.isValid = isValid;
this.itemData.inspectionItem = this.inspectionItem; this.itemData.inspectionItem = this.inspectionItem;
if (isAllOne) { this.itemData.status = isAllOne.status; //1表示已经巡检过没有异常
// 全都是正常 this.itemData.statusLabel = isAllOne.statusLabel;
this.itemData.status = 1; //1表示已经巡检过没有异常
this.itemData.statusLabel = "已巡检";
} else {
this.itemData.status = 2; //1表示已经巡检过有异常
this.itemData.statusLabel = "巡检异常";
}
console.log("查看数据", this.itemData); console.log("查看数据", this.itemData);
return this.itemData; return this.itemData;
}, },
// 数据校验方法 true说明有未填项 // 数据校验方法 true说明有未填项
areAllObjectsValid(arr) { areAllObjectsValid(details) {
for (let i = 0; i < arr.length; i++) { // 检查是否有任何项的 inspectionResult 为空字符串
const obj = arr[i]; const hasEmptyResult = details.some(
const keys = Object.keys(obj); (item) => item.inspectionResult === ""
for (let j = 0; j < keys.length; j++) { );
const key = keys[j]; if (hasEmptyResult) {
const value = obj[key];
if (value === null || value === undefined || value === "") {
return false; return false;
} }
if (Array.isArray(value)) {
if (value.length === 0) { // 遍历每一项进行检查
for (const item of details) {
if (item.inspectionResult === 0) {
// 如果 inspectionResult 为 0,跳过此项的其他检查
continue;
} else if (item.inspectionResult === 1) {
// 如果 inspectionResult 为 1,检查 conclusion 和 photos
if (!item.conclusion || item.photos.length === 0) {
return false; return false;
} }
for (let k = 0; k < value.length; k++) { } else {
if (typeof value[k] === "object" && value[k] !== null) { // 其他情况(理论上不应该存在,根据当前规则)
if (!validateArrayObjects([value[k]])) {
return false; return false;
} }
} }
} // 所有检查都通过
} else if (typeof value === "object" && value !== null) { return true;
if (!validateArrayObjects([value])) { },
return false; areAllInspectionResultsOne(details) {
} let hasEmpty = false;
let allZero = true;
let hasOne = false;
for (const item of details) {
if (item.inspectionResult === "") {
hasEmpty = true;
break;
} else if (item.inspectionResult === 1) {
hasOne = true;
allZero = false;
} else if (item.inspectionResult === 0) {
// 继续检查
} else {
// 如果有其他值,可以在这里处理
allZero = false;
} }
} }
if (hasEmpty) {
return { statusLabel: "未巡检", status: 0 };
} else if (allZero) {
return { statusLabel: "已巡检", status: 1 };
} else if (hasOne) {
return { statusLabel: "巡检异常", status: 2 };
} else {
// 默认情况,可以根据需求调整
return { statusLabel: "未巡检", status: 0 };
} }
return true;
},
// 校验是否有异常
areAllInspectionResultsOne(arr) {
return arr.every((obj) => obj.inspectionResult === 0);
}, },
}, },
}; };
......
...@@ -24,14 +24,16 @@ ...@@ -24,14 +24,16 @@
> >
{{ item.lableArr[1] }} {{ item.lableArr[1] }}
</view> </view </view> </view
><input v-if="'value' in item" ><input
v-if="'value' in item && item.inspectionResult === 1"
class="input" class="input"
v-model="item.value" v-model="item.value"
type="text" type="text"
placeholder="请输入" placeholder="请输入"
maxlength="3" maxlength="3"
/>{{ item.unit }} />{{ item.inspectionResult === 1?item.unit:"" }}
</view> </view>
<template v-if="item.inspectionResult === 1">
<view v-if="'conclusion' in item" class="form-item"> <view v-if="'conclusion' in item" class="form-item">
<text class="form-label"><text class="required">*</text>情况摘要</text> <text class="form-label"><text class="required">*</text>情况摘要</text>
<text class="conclusion" @click="showPopup(index)">{{ <text class="conclusion" @click="showPopup(index)">{{
...@@ -58,7 +60,7 @@ ...@@ -58,7 +60,7 @@
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view >请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
> >
</view> </view>
</view></view </view></template></view
><custom-popup ><custom-popup
ref="customPopup" ref="customPopup"
:inspectionItem="inspectionItem" :inspectionItem="inspectionItem"
...@@ -104,9 +106,9 @@ export default { ...@@ -104,9 +106,9 @@ export default {
detail: [ detail: [
{ {
label: "七氟丙烷灭火气压", label: "七氟丙烷灭火气压",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "常"], lableArr: ["正常", "常"],
conclusion: "", conclusion: "",
settingLabel: "气压设定值", settingLabel: "气压设定值",
setting: "2MPA-4.2MPA", //设定气压 setting: "2MPA-4.2MPA", //设定气压
...@@ -116,17 +118,17 @@ export default { ...@@ -116,17 +118,17 @@ export default {
}, },
{ {
label: "消防报警器", label: "消防报警器",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "常"], lableArr: ["正常", "常"],
conclusion: "", conclusion: "",
photos: [], photos: [],
}, },
{ {
label: "防毒面具", label: "防毒面具",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "常"], lableArr: ["正常", "常"],
conclusion: "", conclusion: "",
photos: [], photos: [],
}, },
...@@ -145,7 +147,7 @@ export default { ...@@ -145,7 +147,7 @@ export default {
if (Object.keys(this.defaultData).length !== 0) { if (Object.keys(this.defaultData).length !== 0) {
this.itemData = this.defaultData; this.itemData = this.defaultData;
} }
} },
}, },
methods: { methods: {
// 拍照 // 拍照
...@@ -219,51 +221,77 @@ export default { ...@@ -219,51 +221,77 @@ export default {
this.itemData.isValid = isValid; this.itemData.isValid = isValid;
this.itemData.inspectionItem = this.inspectionItem; this.itemData.inspectionItem = this.inspectionItem;
console.log(222, this.itemData); console.log(222, this.itemData);
if (isAllOne) {
// 全都是正常 this.itemData.status = isAllOne.status; //1表示已经巡检过没有异常
this.itemData.status = 1; //1表示已经巡检过没有异常 this.itemData.statusLabel = isAllOne.statusLabel;
this.itemData.statusLabel = "已巡检";
} else {
this.itemData.status = 2; //1表示已经巡检过有异常
this.itemData.statusLabel = "巡检异常";
}
// console.log(this.itemData); // console.log(this.itemData);
return this.itemData; return this.itemData;
}, },
// / 数据校验方法 true说明有未填项
areAllObjectsValid(arr) { // 数据校验方法 true说明有未填项
for (let i = 0; i < arr.length; i++) {
const obj = arr[i]; areAllObjectsValid(details) {
const keys = Object.keys(obj); // 检查是否有任何项的 inspectionResult 为空字符串
for (let j = 0; j < keys.length; j++) { const hasEmptyResult = details.some(
const key = keys[j]; (item) => item.inspectionResult === ""
const value = obj[key]; );
if (value === null || value === undefined || value === "") { if (hasEmptyResult) {
return false;
}
if (Array.isArray(value)) {
if (value.length === 0) {
return false; return false;
} }
for (let k = 0; k < value.length; k++) {
if (typeof value[k] === "object" && value[k] !== null) { // 遍历每一项进行检查
if (!validateArrayObjects([value[k]])) { for (const item of details) {
if (item.inspectionResult === 0) {
// 如果 inspectionResult 为 0,跳过此项的其他检查
continue;
} else if (item.inspectionResult === 1) {
// 如果 inspectionResult 为 1,检查 conclusion 和 photos
if (
!item.conclusion ||
item.photos.length === 0 ||
(item.hasOwnProperty("value") && !item.value)
) {
return false; return false;
} }
} } else {
} // 其他情况(理论上不应该存在,根据当前规则)
} else if (typeof value === "object" && value !== null) {
if (!validateArrayObjects([value])) {
return false; return false;
} }
} }
} // 所有检查都通过
}
return true; return true;
}, },
// 校验是否有异常 // 校验是否有异常
areAllInspectionResultsOne(arr) { areAllInspectionResultsOne(details) {
return arr.every((obj) => obj.inspectionResult === 0); let hasEmpty = false;
let allZero = true;
let hasOne = false;
for (const item of details) {
if (item.inspectionResult === "") {
hasEmpty = true;
break;
} else if (item.inspectionResult === 1) {
hasOne = true;
allZero = false;
} else if (item.inspectionResult === 0) {
// 继续检查
} else {
// 如果有其他值,可以在这里处理
allZero = false;
}
}
if (hasEmpty) {
return { statusLabel: "未巡检", status: 0 };
} else if (allZero) {
return { statusLabel: "已巡检", status: 1 };
} else if (hasOne) {
return { statusLabel: "巡检异常", status: 2 };
} else {
// 默认情况,可以根据需求调整
return { statusLabel: "未巡检", status: 0 };
}
}, },
}, },
}; };
...@@ -279,7 +307,7 @@ export default { ...@@ -279,7 +307,7 @@ export default {
.form-label { .form-label {
font-size: 11.2px; font-size: 11.2px;
margin-right: 25.6px; margin-right: 25.6px;
width: 88px; width: 100px;
text-align: right; text-align: right;
color: #7c7c7c; color: #7c7c7c;
......
...@@ -22,14 +22,19 @@ ...@@ -22,14 +22,19 @@
</view> </view>
</view> </view>
<template v-if="item.inspectionResult === 1">
<view class="form-item"> <view class="form-item">
<text class="form-label"><text class="required">*</text>情况摘要</text> <text class="form-label"
><text class="required">*</text>情况摘要</text
>
<text class="conclusion" @click="showPopup(index)">{{ <text class="conclusion" @click="showPopup(index)">{{
item.conclusion || "请输入情况摘要" item.conclusion || "请输入情况摘要"
}}</text> }}</text>
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="form-label"><text class="required">*</text>现场照片</text> <text class="form-label"
><text class="required">*</text>现场照片</text
>
<view class="photo-box"> <view class="photo-box">
<view class="photo-container"> <view class="photo-container">
<view @click="takePhoto(index)" class="photo-btn"> + </view> <view @click="takePhoto(index)" class="photo-btn"> + </view>
...@@ -39,7 +44,9 @@ ...@@ -39,7 +44,9 @@
class="photo-item" class="photo-item"
> >
<image :src="photo" class="photo"></image> <image :src="photo" class="photo"></image>
<text class="delete-photo" @click="deletePhoto(index, itemIndex)" <text
class="delete-photo"
@click="deletePhoto(index, itemIndex)"
>×</text >×</text
> >
</view> </view>
...@@ -48,7 +55,8 @@ ...@@ -48,7 +55,8 @@
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view >请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
> >
</view> </view>
</view> </view </view></template
> </view
><custom-popup ><custom-popup
ref="customPopup" ref="customPopup"
:inspectionItem="inspectionItem" :inspectionItem="inspectionItem"
...@@ -94,7 +102,7 @@ export default { ...@@ -94,7 +102,7 @@ export default {
detail: [ detail: [
{ {
label: "机柜", label: "机柜",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "异常"], lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
...@@ -102,7 +110,7 @@ export default { ...@@ -102,7 +110,7 @@ export default {
}, },
{ {
label: "配线架", label: "配线架",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "异常"], lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
...@@ -110,7 +118,7 @@ export default { ...@@ -110,7 +118,7 @@ export default {
}, },
{ {
label: "电力线路", label: "电力线路",
inspectionResult: 0, inspectionResult: "",
inspectionResultLable: "正常", inspectionResultLable: "正常",
lableArr: ["正常", "异常"], lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
...@@ -131,7 +139,7 @@ export default { ...@@ -131,7 +139,7 @@ export default {
if (Object.keys(this.defaultData).length !== 0) { if (Object.keys(this.defaultData).length !== 0) {
this.itemData = this.defaultData; this.itemData = this.defaultData;
} }
} },
}, },
mounted() {}, mounted() {},
methods: { methods: {
...@@ -203,51 +211,72 @@ export default { ...@@ -203,51 +211,72 @@ export default {
const isAllOne = this.areAllInspectionResultsOne(this.itemData.detail); const isAllOne = this.areAllInspectionResultsOne(this.itemData.detail);
this.itemData.isValid = isValid; this.itemData.isValid = isValid;
this.itemData.inspectionItem = this.inspectionItem; this.itemData.inspectionItem = this.inspectionItem;
if (isAllOne) {
// 全都是正常 this.itemData.status = isAllOne.status; //1表示已经巡检过没有异常
this.itemData.status = 1; //1表示已经巡检过没有异常 this.itemData.statusLabel = isAllOne.statusLabel;
this.itemData.statusLabel = "已巡检";
} else {
this.itemData.status = 2; //1表示已经巡检过有异常
this.itemData.statusLabel = "巡检异常";
}
console.log(this.itemData); console.log(this.itemData);
return this.itemData; return this.itemData;
}, },
// 数据校验方法 true说明有未填项 // 数据校验方法 true说明有未填项
areAllObjectsValid(arr) {
for (let i = 0; i < arr.length; i++) { areAllObjectsValid(details) {
const obj = arr[i]; // 检查是否有任何项的 inspectionResult 为空字符串
const keys = Object.keys(obj); const hasEmptyResult = details.some(
for (let j = 0; j < keys.length; j++) { (item) => item.inspectionResult === ""
const key = keys[j]; );
const value = obj[key]; if (hasEmptyResult) {
if (value === null || value === undefined || value === "") {
return false;
}
if (Array.isArray(value)) {
if (value.length === 0) {
return false; return false;
} }
for (let k = 0; k < value.length; k++) {
if (typeof value[k] === "object" && value[k] !== null) { // 遍历每一项进行检查
if (!validateArrayObjects([value[k]])) { for (const item of details) {
if (item.inspectionResult === 0) {
// 如果 inspectionResult 为 0,跳过此项的其他检查
continue;
} else if (item.inspectionResult === 1) {
// 如果 inspectionResult 为 1,检查 conclusion 和 photos
if (!item.conclusion || item.photos.length === 0) {
return false; return false;
} }
} } else {
} // 其他情况(理论上不应该存在,根据当前规则)
} else if (typeof value === "object" && value !== null) {
if (!validateArrayObjects([value])) {
return false; return false;
} }
} }
} // 所有检查都通过
}
return true; return true;
}, },
// 校验是否有异常 // 校验是否有异常
areAllInspectionResultsOne(arr) { areAllInspectionResultsOne(details) {
return arr.every((obj) => obj.inspectionResult === 0); let hasEmpty = false;
let allZero = true;
let hasOne = false;
for (const item of details) {
if (item.inspectionResult === "") {
hasEmpty = true;
break;
} else if (item.inspectionResult === 1) {
hasOne = true;
allZero = false;
} else if (item.inspectionResult === 0) {
// 继续检查
} else {
// 如果有其他值,可以在这里处理
allZero = false;
}
}
if (hasEmpty) {
return { statusLabel: "未巡检", status: 0 };
} else if (allZero) {
return { statusLabel: "已巡检", status: 1 };
} else if (hasOne) {
return { statusLabel: "巡检异常", status: 2 };
} else {
// 默认情况,可以根据需求调整
return { statusLabel: "未巡检", status: 0 };
}
}, },
}, },
}; };
......
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
rightWidth="240" rightWidth="240"
> >
<block slot="left"> <block slot="left">
<view class="uni-nav-bar-text" @click="back"> <view class="" @click="back">
<text class="iconfont icon-fanhui"></text> <text class="iconfont icon-fanhui"></text>
</view> </view>
</block> </block>
<block slot="right" class="nav-right"> <block slot="right" class="nav-right">
<view class="header-buttons"> <view class="header-buttons">
<button class="button" @click="lookTable">查看样表</button> <view class="button" @click="lookTable">查看样表</view>
</view> </view>
</block> </block>
</uni-nav-bar> </uni-nav-bar>
...@@ -72,7 +72,6 @@ ...@@ -72,7 +72,6 @@
> >
<view class="card-content"> <view class="card-content">
<view class="first-row"> <view class="first-row">
<text <text
v-if="card.status == 0" v-if="card.status == 0"
class="iconfont icon-weixunjian" class="iconfont icon-weixunjian"
...@@ -142,7 +141,7 @@ ...@@ -142,7 +141,7 @@
:key="cardIndex" :key="cardIndex"
@click="getDetailsItem(card.name, card.jfType, card.value)" @click="getDetailsItem(card.name, card.jfType, card.value)"
> >
<view class="card"> <view class="card" :class="{ active: card.name == activeName }">
<view class="card-content"> <view class="card-content">
<view class="first-row"> <view class="first-row">
<image <image
...@@ -196,7 +195,8 @@ export default { ...@@ -196,7 +195,8 @@ export default {
backValue: "", backValue: "",
all_data: [], //所有数据 all_data: [], //所有数据
jfType: "0", //机房类型 jfType: "0", //机房类型
allIsSubmitOne:false, allIsSubmitOne: false,
activeName: "F座3楼-内环屏蔽机房",
}; };
}, },
computed: { computed: {
...@@ -277,10 +277,15 @@ export default { ...@@ -277,10 +277,15 @@ export default {
3 3
); );
} }
this.allIsSubmitOne = detailsInfo.originData.every(item => item.isSubmit === 1); this.allIsSubmitOne = detailsInfo.originData.every(
const group1 = this.cardsInfo.slice(0, 5); (item) => item.isSubmit === 1
const group2 = this.cardsInfo.slice(5, 10); );
const group3 = this.cardsInfo.slice(10); let group1 = this.cardsInfo.slice(0, 5);
let group2 = this.cardsInfo.slice(5, 10);
let group3 = this.cardsInfo.slice(10);
if(this.isSign) {
group2 = group2.reverse()
}
this.rows = [group1, group2, group3]; this.rows = [group1, group2, group3];
console.log("this.cardsInfo", this.cardsInfo); console.log("this.cardsInfo", this.cardsInfo);
...@@ -298,6 +303,7 @@ export default { ...@@ -298,6 +303,7 @@ export default {
}, },
// 获取机房详情 // 获取机房详情
getDetailsItem(location, jfType, value) { getDetailsItem(location, jfType, value) {
this.activeName = location;
this.detailsItem = this.detailsInfo.originData[value - 1].details; this.detailsItem = this.detailsInfo.originData[value - 1].details;
this.jfType = this.detailsInfo.originData[value - 1].jfType; this.jfType = this.detailsInfo.originData[value - 1].jfType;
if (this.detailsItem.afxt.detail[2].inspectionResult === 1) { if (this.detailsItem.afxt.detail[2].inspectionResult === 1) {
...@@ -405,6 +411,7 @@ export default { ...@@ -405,6 +411,7 @@ export default {
color: #000000; color: #000000;
line-height: 28.8px; line-height: 28.8px;
font-weight: 400; font-weight: 400;
text-align: center;
} }
} }
.container { .container {
...@@ -578,6 +585,11 @@ export default { ...@@ -578,6 +585,11 @@ export default {
background-color: rgba(242, 242, 242, 0.6); background-color: rgba(242, 242, 242, 0.6);
box-shadow: 0 1.6px 3.2px rgba(0, 0, 0, 0.1); box-shadow: 0 1.6px 3.2px rgba(0, 0, 0, 0.1);
position: relative; position: relative;
&.active {
background: #fafcff;
border: 1px solid rgba(55, 116, 246, 1);
box-shadow: 0px 0px 3px 0px rgba(55, 116, 246, 0.2);
}
&.status1 { &.status1 {
background: #f3f7ff; background: #f3f7ff;
.status { .status {
...@@ -609,7 +621,7 @@ export default { ...@@ -609,7 +621,7 @@ export default {
} }
} }
.status { .status {
font-size: 9.6px; font-size: 12px;
color: #333333; color: #333333;
} }
} }
...@@ -617,7 +629,7 @@ export default { ...@@ -617,7 +629,7 @@ export default {
margin-top: 3.2px; margin-top: 3.2px;
padding-left: 20px; padding-left: 20px;
.location { .location {
font-size: 9.6px; font-size: 12px;
color: #666666; color: #666666;
} }
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
rightWidth="300" rightWidth="300"
> >
<block slot="left"> <block slot="left">
<view class="uni-nav-bar-text" @click="back"> <view class="" @click="back">
<text class="iconfont icon-fanhui"></text> <text class="iconfont icon-fanhui"></text>
</view> </view>
</block> </block>
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<!-- Tab 操作区域 --> <!-- Tab 操作区域 -->
<view class="module"> <view class="module">
<view class="location">{{ location }}</view> <view class="location">{{ location }}</view>
<view class="action-btn complete-btn" @click="submit(1)"> 完成巡检 </view>
<view class="tab-buttons"> <view class="tab-buttons">
<view <view
v-for="(tab, index) in tabs" v-for="(tab, index) in tabs"
...@@ -29,12 +30,9 @@ ...@@ -29,12 +30,9 @@
<view v-if="activeTab === index" class="underline"></view> <view v-if="activeTab === index" class="underline"></view>
</view> </view>
</view> </view>
<view class="module-box">
<view class="tip"> <view class="tip">
<image <text class="iconfont icon-tixing"></text
class="tip-icon"
src="@/static/img/add-img/home1.png"
mode="aspectFit"
></image
><view class="text"> ><view class="text">
<view <view
class="itemText" class="itemText"
...@@ -49,7 +47,7 @@ ...@@ -49,7 +47,7 @@
<image <image
class="weitu" class="weitu"
src="@/static/img/add-img/weitu.png" src="@/static/img/add-img/weitu.png"
mode="aspectFit" mode=""
></image ></image
></view> ></view>
<view class="kong"></view> <view class="kong"></view>
...@@ -120,18 +118,17 @@ ...@@ -120,18 +118,17 @@
></qt> ></qt>
</view> </view>
</view> </view>
</view>
<view class="submit-module"> <view class="submit-module">
<button class="action-btn" @click="submit(0)">暂存</button> <view class="action-btn" @click="submit(0)">暂存</view>
<button <!-- <view
v-if="isSubmitEnabled" v-if="isSubmitEnabled"
class="action-btn complete-btn" class="action-btn complete-btn"
@click="submit(1)" @click="submit(1)"
> >
完成巡检 完成巡检
</button> </view> -->
<button v-else class="action-btn complete-btn" @click="nextTab"> <view class="action-btn complete-btn" @click="nextTab"> 下一项 </view>
下一项
</button>
</view> </view>
</view> </view>
</template> </template>
...@@ -343,6 +340,7 @@ export default { ...@@ -343,6 +340,7 @@ export default {
let tabList = this.deepClone(dataObj); let tabList = this.deepClone(dataObj);
let posItem = tabList[this.value - 1]; let posItem = tabList[this.value - 1];
posItem.details = paramsObj; posItem.details = paramsObj;
posItem.isSubmit = isSubmit;
if (!this.checkInspectionResult(paramsObj)) { if (!this.checkInspectionResult(paramsObj)) {
posItem.status = 1; //1表示已经巡检过没有异常 posItem.status = 1; //1表示已经巡检过没有异常
posItem.statusLable = "已巡检"; posItem.statusLable = "已巡检";
...@@ -422,22 +420,18 @@ export default { ...@@ -422,22 +420,18 @@ export default {
for (const category in data) { for (const category in data) {
const categoryData = data[category]; const categoryData = data[category];
// 检查该类别下的 detail 数组
if (categoryData.detail && Array.isArray(categoryData.detail)) {
for (const item of categoryData.detail) {
// 如果发现任意一个 inspectionResult 为 1,立即返回 true(异常) // 如果发现任意一个 inspectionResult 为 1,立即返回 true(异常)
if (item.inspectionResult === 1) { if (categoryData.status === 2) {
return true; return true;
} }
} }
}
}
// 所有 inspectionResult 都为 0,返回 false(正常) // 所有 inspectionResult 都为 0,返回 false(正常)
return false; return false;
}, },
// 提交 // 提交
submit(isSubmit = 1) { submit(isSubmit = 1) {
console.log("提交时查看一下数据", this.getAllChildFormData());
let allValid = this.allValid(this.getAllChildFormData()); let allValid = this.allValid(this.getAllChildFormData());
// 校验是否通过 // 校验是否通过
if (isSubmit && !allValid) { if (isSubmit && !allValid) {
...@@ -560,10 +554,11 @@ export default { ...@@ -560,10 +554,11 @@ export default {
// }); // });
// return false; // return false;
// } // }
let data = this.getAllChildFormData() let data = this.getAllChildFormData();
console.log("哒哒哒",data) console.log("哒哒哒", data);
console.log("哒哒哒",data,data[this.tabs[this.activeTab].value]) console.log("哒哒哒", data, data[this.tabs[this.activeTab].value]);
this.tabs[this.activeTab].status = data[this.tabs[this.activeTab].value].status this.tabs[this.activeTab].status =
data[this.tabs[this.activeTab].value].status;
if (this.activeTab === this.tabs.length - 1) { if (this.activeTab === this.tabs.length - 1) {
this.isSubmitEnabled = true; this.isSubmitEnabled = true;
} else { } else {
...@@ -572,6 +567,9 @@ export default { ...@@ -572,6 +567,9 @@ export default {
}, },
// 切换 Tab // 切换 Tab
switchTab(index) { switchTab(index) {
let data = this.getAllChildFormData();
this.tabs[this.activeTab].status =
data[this.tabs[this.activeTab].value].status || 0;
this.activeTab = index; this.activeTab = index;
if (this.activeTab !== this.tabs.length - 1) { if (this.activeTab !== this.tabs.length - 1) {
this.isSubmitEnabled = false; this.isSubmitEnabled = false;
...@@ -615,14 +613,14 @@ export default { ...@@ -615,14 +613,14 @@ export default {
.container { .container {
padding: 19.2px; padding: 19.2px;
height: 100vh; height: calc(100vh - 160px);
} }
.module { .module {
background: #ffffff; background: #ffffff;
border-radius: 9.6px; border-radius: 9.6px;
padding: 12.8px 20px; padding: 12.8px 20px;
min-height: calc(100vh - 80px);
overflow: hidden; overflow: hidden;
position: relative;
.location { .location {
font-size: 14.4px; font-size: 14.4px;
color: #000000; color: #000000;
...@@ -630,12 +628,35 @@ export default { ...@@ -630,12 +628,35 @@ export default {
font-weight: 500; font-weight: 500;
margin-bottom: 14.4px; margin-bottom: 14.4px;
} }
.action-btn {
width: 145.6px;
height: 38.4px;
line-height: 38.4px;
background: #ffffff;
border: 0.8px solid rgba(224, 224, 224, 1);
box-shadow: 0px 8px 19.2px 0px rgba(185, 185, 185, 0.24);
border-radius: 21.6px 19.2px 19.2px 21.6px;
font-size: 16px;
color: #000000;
text-align: center;
font-weight: 400;
position: absolute;
right: 20px;
top: 15px;
&.complete-btn {
background-image: linear-gradient(180deg, #3773f6 0%, #2c57f6 99%);
color: #ffffff;
}
}
} }
.tab-content { .module-box {
height: calc(100vh - 280px); /* 根据实际情况调整高度 */ height: calc(100vh - 212px); /* 根据实际情况调整高度 */
overflow-y: auto; /* 垂直方向滚动 */ overflow-y: auto; /* 垂直方向滚动 */
overflow-x: hidden; /* 防止水平方向滚动 */ overflow-x: hidden; /* 防止水平方向滚动 */
} }
.tab-content {
margin-top: 12.8px;
}
.title-bar { .title-bar {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -699,9 +720,9 @@ export default { ...@@ -699,9 +720,9 @@ export default {
padding: 4.8px 9.6px; padding: 4.8px 9.6px;
display: flex; display: flex;
.tip-icon { .icon-tixing {
width: 11.2px; color: #3774f6;
height: 11.2px; font-size: 9.6px;
margin-right: 6.4px; margin-right: 6.4px;
} }
.text { .text {
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<!-- 关闭按钮 --> <!-- 关闭按钮 -->
<div class="close-button"> <div class="close-button">
<text class="iconfont icon-a-bianzu16beifen" @click="close"></text> <text class="iconfont icon-shibai1" @click="close"></text>
</div> </div>
</view> </view>
</view> </view>
...@@ -317,6 +317,7 @@ export default { ...@@ -317,6 +317,7 @@ export default {
<style scoped lang="less"> <style scoped lang="less">
.synchronous-dialog { .synchronous-dialog {
position: fixed; position: fixed;
z-index: 999;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
...@@ -412,7 +413,6 @@ export default { ...@@ -412,7 +413,6 @@ export default {
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
.iconfont { .iconfont {
color: #fff;
font-size: 24px; font-size: 24px;
} }
} }
......
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
rightWidth="300" rightWidth="300"
> >
<block slot="left"> <block slot="left">
<view class="uni-nav-bar-text" @click="back"> <view class="" @click="back">
<text class="iconfont icon-fanhui"></text> <text class="iconfont icon-fanhui"></text>
</view> </view>
</block> </block>
<block slot="right" class="nav-right"> <block slot="right" class="nav-right">
<view class="header-buttons"> <view class="header-buttons">
<button class="button" @click="clickInspection(1)">机房巡检</button> <view class="button" @click="clickInspection(1)">机房巡检</view>
<button class="button" @click="clickInspection(2)">井道巡检</button> <view class="button" @click="clickInspection(2)">井道巡检</view>
</view> </view>
</block> </block>
</uni-nav-bar> </uni-nav-bar>
...@@ -272,6 +272,7 @@ export default { ...@@ -272,6 +272,7 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
text-align: center; text-align: center;
z-index: 999;
.iconfont { .iconfont {
font-size: 16px; font-size: 16px;
...@@ -296,7 +297,7 @@ export default { ...@@ -296,7 +297,7 @@ export default {
color: #000000; color: #000000;
line-height: 28.8px; line-height: 28.8px;
font-weight: 400; font-weight: 400;
border: 0; text-align: center;
} }
} }
.inspection-management { .inspection-management {
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<!-- 关闭按钮 --> <!-- 关闭按钮 -->
<div class="close-button"> <div class="close-button">
<text class="iconfont icon-a-bianzu16beifen" @click="close"></text> <text class="iconfont icon-shibai1" @click="close"></text>
</div> </div>
</view> </view>
</view> </view>
...@@ -118,7 +118,7 @@ export default { ...@@ -118,7 +118,7 @@ export default {
copyImagesToFolder(imagePaths, targetPath).then((res) => { copyImagesToFolder(imagePaths, targetPath).then((res) => {
uni.navigateTo({ uni.navigateTo({
url: "/pages/listingManagement/index?backValue=home", url: "/pages/listingManagement/index?backValue=home",
}) });
}); });
}); });
}, },
...@@ -258,6 +258,7 @@ export default { ...@@ -258,6 +258,7 @@ export default {
<style scoped lang="less"> <style scoped lang="less">
.synchronous-dialog { .synchronous-dialog {
position: fixed; position: fixed;
z-index: 999;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
...@@ -353,7 +354,6 @@ export default { ...@@ -353,7 +354,6 @@ export default {
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
.iconfont { .iconfont {
color: #fff;
font-size: 24px; font-size: 24px;
} }
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<view class="login_wrap"> <view class="login_wrap">
<view class="top-module"> <view class="top-module">
<image src="@/static/logo.png" alt="" /> <image src="@/static/logo.png" mode="aspectFit" alt="" />
<view class="title">杭州内网监管在线-运维在线</view> <view class="title">杭州内网监管在线-运维在线</view>
</view> </view>
...@@ -61,8 +61,8 @@ ...@@ -61,8 +61,8 @@
// user: "bjqxj", // user: "bjqxj",
// pd: "JF85250920", // pd: "JF85250920",
user: "admin", // 超管账号 user: "叶一凡", // 超管账号
pd: "JF123456", pd: "123456",
}, },
backButtonPress: 0, backButtonPress: 0,
personList: [], personList: [],
......
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
</view> </view>
</view> </view>
<view class="row-item bottom-row"> <view class="row-item bottom-row">
<button class="button btn" @click="handleClose">取消</button> <view class="button btn" @click="handleClose">取消</view>
<button class="button" @click="handleConfirm">确认</button> <view class="button" @click="handleConfirm">确认</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</block> </block>
<block slot="right" class="nav-right"> <block slot="right" class="nav-right">
<view class="header-buttons"> <view class="header-buttons">
<button class="button" @click="lookTable">查看样表</button> <view class="button" @click="lookTable">查看样表</view>
</view> </view>
</block> </block>
</uni-nav-bar> </uni-nav-bar>
...@@ -474,6 +474,7 @@ export default { ...@@ -474,6 +474,7 @@ export default {
color: #000000; color: #000000;
line-height: 28.8px; line-height: 28.8px;
font-weight: 400; font-weight: 400;
text-align: center;
} }
} }
...@@ -608,7 +609,7 @@ export default { ...@@ -608,7 +609,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 11.2px; font-size: 12px;
color: #333333; color: #333333;
cursor: pointer; cursor: pointer;
...@@ -727,7 +728,7 @@ export default { ...@@ -727,7 +728,7 @@ export default {
} }
.status-text { .status-text {
font-size: 10.5px; font-size: 12px;
color: #7c7c7c; color: #7c7c7c;
text-align: center; text-align: center;
line-height: 16.5px; line-height: 16.5px;
...@@ -737,7 +738,7 @@ export default { ...@@ -737,7 +738,7 @@ export default {
.info-line { .info-line {
margin-left: 20px; margin-left: 20px;
font-size: 10.5px; font-size: 12px;
color: #000000; color: #000000;
line-height: 16.5px; line-height: 16.5px;
font-weight: 400; font-weight: 400;
......
...@@ -48,12 +48,7 @@ ...@@ -48,12 +48,7 @@
</view> </view>
</view> </view>
<view class="tip"> <view class="tip">
<image <text class="iconfont icon-tixing"></text>{{ tabs[activeTab].text }}
class="tip-icon"
src="@/static/img/add-img/home1.png"
mode="aspectFit"
></image
>{{ tabs[activeTab].text }}
</view> </view>
<view class="tab-content"> <view class="tab-content">
<!-- 操作区域 --> <!-- 操作区域 -->
...@@ -122,17 +117,17 @@ ...@@ -122,17 +117,17 @@
</button> </button>
</view> --> </view> -->
<view class="submit-module"> <view class="submit-module">
<button class="action-btn" @click="submit(0)">暂存</button> <view class="action-btn" @click="submit(0)">暂存</view>
<button <view
v-if="isSubmitEnabled" v-if="isSubmitEnabled"
class="action-btn complete-btn" class="action-btn complete-btn"
@click="submit(1)" @click="submit(1)"
> >
完成巡检 完成巡检
</button> </view>
<button v-else class="action-btn complete-btn" @click="nextTab"> <view v-else class="action-btn complete-btn" @click="nextTab">
下一项 下一项
</button> </view </view> </view
><custom-popup ><custom-popup
ref="customPopup" ref="customPopup"
:inspectionItem="tabs[activeTab].label" :inspectionItem="tabs[activeTab].label"
...@@ -796,9 +791,9 @@ export default { ...@@ -796,9 +791,9 @@ export default {
font-weight: 400; font-weight: 400;
padding: 0 9.6px; padding: 0 9.6px;
.tip-icon { .icon-tixing {
width: 11.2px; color: #3774f6;
height: 11.2px; font-size: 11.2px;
margin-right: 6.4px; margin-right: 6.4px;
} }
} }
......
static/img/add-img/home1.png

49.6 KB | W: | H:

static/img/add-img/home1.png

33.1 KB | W: | H:

static/img/add-img/home1.png
static/img/add-img/home1.png
static/img/add-img/home1.png
static/img/add-img/home1.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -58,13 +58,22 @@ export const FILE_ENUM = { ...@@ -58,13 +58,22 @@ export const FILE_ENUM = {
// 内置的用户信息 // 内置的用户信息
export const USER_LiST = [ export const USER_LiST = [
// name-> roleName // name-> roleName
// {
// userId: 1, // 有用
// user: "admin", // 有用 谁创建,谁有权限编辑和删除
// passWord: "JF123456", // 有用
// roleName: "超管", // 有用 -- 职位名称
// unitName: "超管所属单位", // 所属单位
// isAdmin: true, // 标识超管权限
// LastSynchronizationTime: "", // 上次同步时间
// },
{ {
userId: 1, // 有用 userId: 0, // 有用
user: "admin", // 有用 谁创建,谁有权限编辑和删除 user: "叶一凡", // 有用 谁创建,谁有权限编辑和删除
passWord: "JF123456", // 有用 passWord: "123456", // 有用
roleName: "超管", // 有用 -- 职位名称 roleName: "运维", // 有用 -- 职位名称
unitName: "超管所属单位", // 所属单位 unitName: "运维", // 所属单位
isAdmin: true, // 标识超管权限 isAdmin: false, // 标识超管权限
LastSynchronizationTime: "", // 上次同步时间 LastSynchronizationTime: "", // 上次同步时间
}, },
{ {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论