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

fix:优化

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