提交 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,40 +24,41 @@ ...@@ -24,40 +24,41 @@
</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
> >
<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="form-label"
><text class="required">*</text>现场照片</text ><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>
<view <view
v-for="(photo, itemIndex) in item && item.photos" v-for="(photo, itemIndex) in item && item.photos"
:key="itemIndex" :key="itemIndex"
class="photo-item" class="photo-item"
>
<image :src="photo" class="photo"></image>
<text
class="delete-photo"
@click="deletePhoto(index, itemIndex)"
>×</text
> >
<image :src="photo" class="photo"></image>
<text
class="delete-photo"
@click="deletePhoto(index, itemIndex)"
>×</text
>
</view>
</view> </view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
>
</view> </view>
<view class="photo-limit" </view></template
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view ></template
>
</view>
</view></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) {
return false;
} }
// 检查对象中的每个属性是否有值 }
for (const key in obj) {
if (obj.hasOwnProperty(key)) { // 确定需要校验的范围
// 如果属性值为空(null, undefined, 空字符串等),则校验不通过 const itemsToCheck =
if ( thirdItem.inspectionResult === 1 ? details.slice(0, 2) : details;
obj[key] === null || console.log("确定需要校验的范围 ", itemsToCheck);
obj[key] === undefined || // 检查 conclusion 和 photos(如果存在)
obj[key] === "" for (const item of itemsToCheck) {
) { if (item.inspectionResult === 0) {
return false; 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,41 +25,49 @@ ...@@ -25,41 +25,49 @@
{{ 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>
<view v-if="'conclusion' in item" class="form-item"> <template v-if="item.inspectionResult === 1">
<text class="form-label"><text class="required">*</text>情况摘要</text> <view v-if="'conclusion' in item" class="form-item">
<text class="conclusion" @click="showPopup(index)">{{ <text class="form-label"
item.conclusion || "请输入情况摘要" ><text class="required">*</text>情况摘要</text
}}</text> >
</view> <text class="conclusion" @click="showPopup(index)">{{
<view class="form-item" v-if="'photos' in item"> item.conclusion || "请输入情况摘要"
<text class="form-label"><text class="required">*</text>现场照片</text> }}</text>
<view class="photo-box"> </view>
<view class="photo-container"> <view class="form-item" v-if="'photos' in item">
<view @click="takePhoto(index)" class="photo-btn"> + </view> <text class="form-label"
<view ><text class="required">*</text>现场照片</text
v-for="(photo, itemIndex) in item && item.photos" >
:key="itemIndex" <view class="photo-box">
class="photo-item" <view class="photo-container">
> <view @click="takePhoto(index)" class="photo-btn"> + </view>
<image :src="photo" class="photo"></image> <view
<text class="delete-photo" @click="deletePhoto(index, itemIndex)" v-for="(photo, itemIndex) in item && item.photos"
>×</text :key="itemIndex"
class="photo-item"
> >
<image :src="photo" class="photo"></image>
<text
class="delete-photo"
@click="deletePhoto(index, itemIndex)"
>×</text
>
</view>
</view> </view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
>
</view> </view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</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: {
...@@ -166,10 +173,10 @@ export default { ...@@ -166,10 +173,10 @@ export default {
watch: { watch: {
defaultData(newVal) { defaultData(newVal) {
// 在这里处理数据变化 // 在这里处理数据变化
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) {
} return false;
// 检查对象中的每个属性是否有值 }
for (const key in obj) {
if (obj.hasOwnProperty(key)) { // 遍历每一项进行检查
// 如果属性值为空(null, undefined, 空字符串等),则校验不通过 for (const item of details) {
if ( if (item.inspectionResult === 0) {
obj[key] === null || // 如果 inspectionResult 为 0,跳过此项的其他检查
obj[key] === undefined || continue;
obj[key] === "" } else if (item.inspectionResult === 1) {
) { // 如果 inspectionResult 为 1,检查 conclusion 和 photos
return false; 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,33 +22,41 @@ ...@@ -22,33 +22,41 @@
</view> </view>
</view> </view>
<view class="form-item"> <template v-if="item.inspectionResult === 1">
<text class="form-label"><text class="required">*</text>情况摘要</text> <view class="form-item">
<text class="conclusion" @click="showPopup(index)">{{ <text class="form-label"
item.conclusion || "请输入情况摘要" ><text class="required">*</text>情况摘要</text
}}</text> >
</view> <text class="conclusion" @click="showPopup(index)">{{
<view class="form-item"> item.conclusion || "请输入情况摘要"
<text class="form-label"><text class="required">*</text>现场照片</text> }}</text>
<view class="photo-box"> </view>
<view class="photo-container"> <view class="form-item">
<view @click="takePhoto(index)" class="photo-btn"> + </view> <text class="form-label"
<view ><text class="required">*</text>现场照片</text
v-for="(photo, itemIndex) in item && item.photos" >
:key="itemIndex" <view class="photo-box">
class="photo-item" <view class="photo-container">
> <view @click="takePhoto(index)" class="photo-btn"> + </view>
<image :src="photo" class="photo"></image> <view
<text class="delete-photo" @click="deletePhoto(index, itemIndex)" v-for="(photo, itemIndex) in item && item.photos"
>×</text :key="itemIndex"
class="photo-item"
> >
<image :src="photo" class="photo"></image>
<text
class="delete-photo"
@click="deletePhoto(index, itemIndex)"
>×</text
>
</view>
</view> </view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
>
</view> </view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</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;
}
// 遍历每一项进行检查
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;
} }
if (Array.isArray(value)) { } else {
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]])) {
return false;
}
}
}
} else if (typeof value === "object" && value !== null) {
if (!validateArrayObjects([value])) {
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,40 +25,49 @@ ...@@ -25,40 +25,49 @@
{{ 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>
<view v-if="'conclusion' in item" class="form-item"> <template v-if="item.inspectionResult === 1">
<text class="form-label"><text class="required">*</text>情况摘要</text> <view v-if="'conclusion' in item" class="form-item">
<text class="conclusion" @click="showPopup(index)">{{ <text class="form-label"
item.conclusion || "请输入情况摘要" ><text class="required">*</text>情况摘要</text
}}</text> >
</view> <text class="conclusion" @click="showPopup(index)">{{
<view class="form-item" v-if="'photos' in item"> item.conclusion || "请输入情况摘要"
<text class="form-label"><text class="required">*</text>现场照片</text> }}</text>
<view class="photo-box"> </view>
<view class="photo-container"> <view class="form-item" v-if="'photos' in item">
<view @click="takePhoto(index)" class="photo-btn"> + </view> <text class="form-label"
<view ><text class="required">*</text>现场照片</text
v-for="(photo, itemIndex) in item && item.photos" >
:key="itemIndex" <view class="photo-box">
class="photo-item" <view class="photo-container">
> <view @click="takePhoto(index)" class="photo-btn"> + </view>
<image :src="photo" class="photo"></image> <view
<text class="delete-photo" @click="deletePhoto(index, itemIndex)" v-for="(photo, itemIndex) in item && item.photos"
>×</text :key="itemIndex"
class="photo-item"
> >
<image :src="photo" class="photo"></image>
<text
class="delete-photo"
@click="deletePhoto(index, itemIndex)"
>×</text
>
</view>
</view> </view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
>
</view> </view>
<view class="photo-limit" </view></template
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view ></view
>
</view>
</view></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", //设定湿度值
...@@ -140,10 +149,10 @@ export default { ...@@ -140,10 +149,10 @@ export default {
watch: { watch: {
defaultData(newVal) { defaultData(newVal) {
// 在这里处理数据变化 // 在这里处理数据变化
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;
}
// 遍历每一项进行检查
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;
} }
if (Array.isArray(value)) { } else {
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]])) {
return false;
}
}
}
} else if (typeof value === "object" && value !== null) {
if (!validateArrayObjects([value])) {
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,69 +24,71 @@ ...@@ -24,69 +24,71 @@
</view> </view>
</view> </view>
</view> </view>
<view class="form-item"> <template v-if="item.inspectionResult === 1">
<text class="form-label" <view class="form-item">
><text class="required">*</text>{{ item.deviceLabel }}</text <text class="form-label"
><input ><text class="required">*</text>{{ item.deviceLabel }}</text
class="conclusion" ><input
v-model="item.deviceId" class="conclusion"
type="text" v-model="item.deviceId"
placeholder="请输入编号" type="text"
/> placeholder="请输入编号"
</view> />
<view class="form-item"> </view>
<text class="form-label" <view class="form-item">
><text class="required">*</text>{{ item.UpositonLabel }}</text <text class="form-label"
><input ><text class="required">*</text>{{ item.UpositonLabel }}</text
class="input" ><input
v-model="item.UpositonS" class="input"
type="number" v-model="item.UpositonS"
placeholder="请输入" type="number"
maxlength="2" placeholder="请输入"
/> maxlength="2"
<text class="fg"></text />
><input <text class="fg"></text
class="input" ><input
v-model="item.UpositonE" class="input"
type="number" v-model="item.UpositonE"
placeholder="请输入" type="number"
maxlength="2" placeholder="请输入"
/> maxlength="2"
</view> />
<view v-if="'conclusion' in item" class="form-item"> </view>
<text class="form-label" <view v-if="'conclusion' in item" class="form-item">
><text class="required">*</text>情况摘要</text <text class="form-label"
> ><text class="required">*</text>情况摘要</text
<text class="conclusion" @click="showPopup(index)">{{ >
item.conclusion || "请输入情况摘要" <text class="conclusion" @click="showPopup(index)">{{
}}</text> item.conclusion || "请输入情况摘要"
</view> }}</text>
<view class="form-item" v-if="'photos' in item"> </view>
<text class="form-label" <view class="form-item" v-if="'photos' in item">
><text class="required">*</text>现场照片</text <text class="form-label"
> ><text class="required">*</text>现场照片</text
<view class="photo-box"> >
<view class="photo-container"> <view class="photo-box">
<view @click="takePhoto(index)" class="photo-btn"> + </view> <view class="photo-container">
<view <view @click="takePhoto(index)" class="photo-btn"> + </view>
v-for="(photo, itemIndex) in item && item.photos" <view
:key="itemIndex" v-for="(photo, itemIndex) in item && item.photos"
class="photo-item" :key="itemIndex"
> class="photo-item"
<image :src="photo" class="photo"></image>
<text
class="delete-photo"
@click="deletePhoto(index, itemIndex)"
>×</text
> >
<image :src="photo" class="photo"></image>
<text
class="delete-photo"
@click="deletePhoto(index, itemIndex)"
>×</text
>
</view>
</view> </view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
>
</view> </view>
<view class="photo-limit" </view></template
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view >
> </template> </view
</view>
</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) {
if ( // 如果 inspectionResult 为 0,跳过此项的其他检查
obj[key] === null || continue;
obj[key] === undefined || } else if (item.inspectionResult === 1) {
obj[key] === "" // 如果 inspectionResult 为 1,检查 conclusion 和 photos
) { if (
return false; !item.conclusion ||
} item.photos.length === 0 ||
!item.deviceId ||
!item.UpositonS ||
!item.UpositonE
) {
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,34 +21,41 @@ ...@@ -21,34 +21,41 @@
</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="conclusion" @click="showPopup(index)">{{ ><text class="required">*</text>情况摘要</text
item.conclusion || "请输入情况摘要" >
}}</text> <text class="conclusion" @click="showPopup(index)">{{
</view> item.conclusion || "请输入情况摘要"
<view class="form-item"> }}</text>
<text class="form-label"><text class="required">*</text>现场照片</text> </view>
<view class="photo-box"> <view class="form-item">
<view class="photo-container"> <text class="form-label"
<view @click="takePhoto(index)" class="photo-btn"> + </view> ><text class="required">*</text>现场照片</text
<view >
v-for="(photo, itemIndex) in item && item.photos" <view class="photo-box">
:key="itemIndex" <view class="photo-container">
class="photo-item" <view @click="takePhoto(index)" class="photo-btn"> + </view>
> <view
<image :src="photo" class="photo"></image> v-for="(photo, itemIndex) in item && item.photos"
<text class="delete-photo" @click="deletePhoto(index, itemIndex)" :key="itemIndex"
>×</text class="photo-item"
> >
<image :src="photo" class="photo"></image>
<text
class="delete-photo"
@click="deletePhoto(index, itemIndex)"
>×</text
>
</view>
</view> </view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
>
</view> </view>
<view class="photo-limit" </view></template
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view > </view
>
</view>
</view> </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]; return false;
if (value === null || value === undefined || value === "") { }
// 遍历每一项进行检查
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;
} }
if (Array.isArray(value)) { } else {
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]])) {
return false;
}
}
}
} else if (typeof value === "object" && value !== null) {
if (!validateArrayObjects([value])) {
return false;
}
}
} }
} }
// 所有检查都通过
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 };
}
}, },
}, },
}; };
......
...@@ -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: [],
}, },
...@@ -142,10 +144,10 @@ export default { ...@@ -142,10 +144,10 @@ export default {
watch: { watch: {
defaultData(newVal) { defaultData(newVal) {
// 在这里处理数据变化 // 在这里处理数据变化
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;
}
// 遍历每一项进行检查
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;
} }
if (Array.isArray(value)) { } else {
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]])) {
return false;
}
}
}
} else if (typeof value === "object" && value !== null) {
if (!validateArrayObjects([value])) {
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,33 +22,41 @@ ...@@ -22,33 +22,41 @@
</view> </view>
</view> </view>
<view class="form-item"> <template v-if="item.inspectionResult === 1">
<text class="form-label"><text class="required">*</text>情况摘要</text> <view class="form-item">
<text class="conclusion" @click="showPopup(index)">{{ <text class="form-label"
item.conclusion || "请输入情况摘要" ><text class="required">*</text>情况摘要</text
}}</text> >
</view> <text class="conclusion" @click="showPopup(index)">{{
<view class="form-item"> item.conclusion || "请输入情况摘要"
<text class="form-label"><text class="required">*</text>现场照片</text> }}</text>
<view class="photo-box"> </view>
<view class="photo-container"> <view class="form-item">
<view @click="takePhoto(index)" class="photo-btn"> + </view> <text class="form-label"
<view ><text class="required">*</text>现场照片</text
v-for="(photo, itemIndex) in item && item.photos" >
:key="itemIndex" <view class="photo-box">
class="photo-item" <view class="photo-container">
> <view @click="takePhoto(index)" class="photo-btn"> + </view>
<image :src="photo" class="photo"></image> <view
<text class="delete-photo" @click="deletePhoto(index, itemIndex)" v-for="(photo, itemIndex) in item && item.photos"
>×</text :key="itemIndex"
class="photo-item"
> >
<image :src="photo" class="photo"></image>
<text
class="delete-photo"
@click="deletePhoto(index, itemIndex)"
>×</text
>
</view>
</view> </view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
>
</view> </view>
<view class="photo-limit" </view></template
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view > </view
>
</view>
</view> </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: "",
...@@ -128,10 +136,10 @@ export default { ...@@ -128,10 +136,10 @@ export default {
watch: { watch: {
defaultData(newVal) { defaultData(newVal) {
// 在这里处理数据变化 // 在这里处理数据变化
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;
}
// 遍历每一项进行检查
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;
} }
if (Array.isArray(value)) { } else {
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]])) {
return false;
}
}
}
} else if (typeof value === "object" && value !== null) {
if (!validateArrayObjects([value])) {
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,19 +72,18 @@ ...@@ -72,19 +72,18 @@
> >
<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"
></text> ></text>
<text <text
v-if="card.status == 1" v-if="card.status == 1"
class="iconfont icon-wancheng" class="iconfont icon-wancheng"
></text> ></text>
<text <text
v-if="card.status == 2" v-if="card.status == 2"
class="iconfont icon-shibai1" class="iconfont icon-shibai1"
></text> ></text>
<text class="status">{{ card.statusLable }}</text> <text class="status">{{ card.statusLable }}</text>
</view> </view>
<view class="second-row"> <view class="second-row">
...@@ -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;
} }
} }
......
...@@ -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>
...@@ -117,8 +117,8 @@ export default { ...@@ -117,8 +117,8 @@ 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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论