提交 5b600a22 authored 作者: JaxBBLL's avatar JaxBBLL

fix: bugs

上级 57222d0f
...@@ -26,7 +26,7 @@ export default { ...@@ -26,7 +26,7 @@ export default {
let { let {
account, account,
pwd pwd
} = data } = data
const sql = `select * from ${table.userName} where user = '${account}' AND passWord ='${pwd}'` const sql = `select * from ${table.userName} where user = '${account}' AND passWord ='${pwd}'`
let res = await sqllitedb.selectSQL(sql); let res = await sqllitedb.selectSQL(sql);
......
...@@ -223,10 +223,9 @@ export default { ...@@ -223,10 +223,9 @@ 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;
console.log(222, this.itemData);
this.itemData.status = isAllOne.status; //1表示已经巡检过没有异常 this.itemData.status = isAllOne.status; //1表示已经巡检过没有异常
this.itemData.statusLabel = isAllOne.statusLabel; this.itemData.statusLabel = isAllOne.statusLabel;
// console.log(this.itemData); console.log('afxt', this.itemData);
return this.itemData; return this.itemData;
}, },
// 数据校验方法 true说明有未填项 // 数据校验方法 true说明有未填项
...@@ -249,7 +248,7 @@ export default { ...@@ -249,7 +248,7 @@ export default {
console.log("确定需要校验的范围 ", itemsToCheck); console.log("确定需要校验的范围 ", itemsToCheck);
// 检查 conclusion 和 photos(如果存在) // 检查 conclusion 和 photos(如果存在)
for (const item of itemsToCheck) { for (const item of itemsToCheck) {
if (item.inspectionResult === 0) { if (item.inspectionResult === 0 || item.inspectionResult === 2) {
continue; // 跳过检查 continue; // 跳过检查
} }
if ("conclusion" in item && !item.conclusion) { if ("conclusion" in item && !item.conclusion) {
......
...@@ -127,7 +127,7 @@ export default { ...@@ -127,7 +127,7 @@ export default {
"需处理", "需处理",
"已处理" "已处理"
]; ];
}, }
}, },
}; };
</script> </script>
...@@ -142,8 +142,9 @@ export default { ...@@ -142,8 +142,9 @@ export default {
background: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.5);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
z-index: 999999; // pointer-events: none;
z-index: 999999;
.synchronous-content { .synchronous-content {
padding: 3% 20px 32px 24px; padding: 3% 20px 32px 24px;
width: 400px; width: 400px;
......
...@@ -287,13 +287,36 @@ ...@@ -287,13 +287,36 @@
class="cards-item" class="cards-item"
> >
<view class="name" <view class="name"
>{{ item.label }}{{ index === 0 ? `(${item.setting})` : "" >
}}<text <template v-if="index==0">
class="status" <view>
:class="{ warning: item.inspectionResult === 1 }" {{ item.label }}
>{{ item.inspectionResultLable }}</text <text
></view class="status"
> :class="{ warning: item.inspectionResult === 1 }"
>{{ item.inspectionResultLable }}
</text>
</view>
<!-- <text>
{{ item.settingLabel }} {{ `(${item.setting})` }}
</text> -->
</template>
<template v-else>
{{ item.label }}
<text
class="status"
:class="{ warning: item.inspectionResult === 1 }"
>{{ item.inspectionResultLable }}
</text>
</template>
</view
>
<view v-if="index==0" class="list">
<view class="label" style="width: 70px;">{{item.settingLabel}}</view>
<view class="content">
{{ item.setting }}
</view>
</view>
<view class="list"> <view class="list">
<view class="label">情况描述:</view> <view class="label">情况描述:</view>
<view class="content"> <view class="content">
......
...@@ -66,7 +66,8 @@ export default { ...@@ -66,7 +66,8 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
text-align: center; text-align: center;
z-index: 99999;
.synchronous-content { .synchronous-content {
padding: 25.6px 19.2px; padding: 25.6px 19.2px;
width: 420px; width: 420px;
......
<template> <template>
<view class="container"> <view class="container">
<uni-nav-bar :fixed="true" background-color="rgba(214, 240, 255, 0.0)" status-bar rightWidth="240"> <uni-nav-bar
<block slot="left"> :fixed="true"
<view class="" @click="back"> background-color="rgba(214, 240, 255, 0.0)"
<text class="iconfont icon-fanhui"></text> status-bar
</view> rightWidth="240"
</block> >
<block slot="right" class="nav-right"> <block slot="left">
<view class="header-buttons"> <view class="" @click="back">
<view class="button" @click="lookTable">查看样表</view> <text class="iconfont icon-fanhui"></text>
</view> </view>
</block> </block>
</uni-nav-bar> <block slot="right" class="nav-right">
<view class="profile-section"> <view class="header-buttons">
<view class="profile-box"> <view class="button" @click="lookTable">查看样表</view>
<view class="profile-left"> </view>
<view class="avatar"> </block>
<image src="@/static/img/add-img/defaultAvatar.png" mode="aspectFit"></image> </uni-nav-bar>
</view> <view class="profile-section">
<view class="info"> <view class="profile-box">
<view class="describe"> <view class="profile-left">
<view class="username">{{ userInfo.user }}</view> <view class="avatar">
<view v-if="abnormalLengths" class="abnormal">存在异常 {{ abnormalLengths }}</view> <image
</view> src="@/static/img/add-img/defaultAvatar.png"
<view class="describe"> mode="aspectFit"
<view class="number"> ></image>
巡检编号: </view>
<text class="value">{{ inspectionCode }}</text> <view class="info">
</view> <view class="describe">
<view v-if="!!isSign" class="number"> <view class="username">{{ userInfo.user }}</view>
巡检时间: <view v-if="abnormalLengths" class="abnormal"
<text class="value"> >存在异常 {{ abnormalLengths }}</view
{{ updateDate }} >
</text> </view>
</view> <view class="describe">
</view> <view class="number">
</view> 巡检编号:
</view> <text class="value">{{ inspectionCode }}</text>
<!-- v-if="allIsSubmitOne" --> </view>
<view class="profile-right"> <view v-if="!!isSign" class="number">
<button 巡检时间:
v-if="!isSign" <text class="value">
:disabled="!allIsSubmitOne" {{ updateDate }}
class="record-button" </text>
:class="{ </view>
'is-disabled': !allIsSubmitOne </view>
}" </view>
@click="toSign" </view>
> <!-- v-if="allIsSubmitOne" -->
巡检人签字 <view class="profile-right">
</button> <view
<div v-else style="display: flex"> v-if="!isSign"
<image class="sign-img" mode="aspectFit" :src="detailsInfo.signImg" @click="previewImage([detailsInfo.signImg], 0)"></image> :disabled="!allIsSubmitOne"
<button v-if="detailsInfo.synchronization != 1" class="record-button" @click="toSign">重签</button> :class="{
</div> 'record-button': true,
<template v-if="allIsSubmitOne"> 'disabled-btn': !allIsSubmitOne,
<button v-if="detailsInfo.synchronization != 1 && isSign" class="inspection-button ml-10" @click="onSyncData(true)">数据同步</button> }"
</template> @click="toSign"
</view> >
</view> 巡检人签字
</view> </view>
<view class="box" v-if="!isSign"> <div v-else style="display: flex">
<view class="bar"> <image
<view class="title">巡检进度</view> class="sign-img"
<view class="dai"> mode="aspectFit"
待巡检 :src="detailsInfo.signImg"
<text class="num">{{ listData.length - inspectionNumber }}</text> @click="previewImage([detailsInfo.signImg], 0)"
个机房 ></image>
</view> <button
<view class="yi"> v-if="detailsInfo.synchronization != 1"
已完成 class="record-button"
<text class="num">{{ inspectionNumber }}</text> @click="toSign"
个机房 >
</view> 重签
</view> </button>
</view> </div>
<view v-if="!isSign" class="card-box"> <template v-if="allIsSubmitOne">
<view class="card-row" :class="{ right: rowIndex % 2 !== 0 }" v-for="(row, rowIndex) in rows" :key="rowIndex"> <button
<view class="card-wrapper" v-for="(card, cardIndex) in row" :key="cardIndex" @click="startDialog(card.name, card.jfType, card.value, false)"> v-if="detailsInfo.synchronization != 1 && isSign"
<view class="inspection-button ml-10"
class="card" @click="onSyncData(true)"
:class="{ >
status1: card.status == 1, 数据同步
status2: card.status == 2, </button>
active: value === card.value </template>
}" </view>
> </view>
<view class="card-content"> </view>
<view class="first-row"> <view class="box" v-if="!isSign">
<template v-if="card.isSubmit == 0"> <view class="bar">
<text class="iconfont icon-weixunjian"></text> <view class="title">巡检进度</view>
</template> <view class="dai">
<template v-else> 待巡检
<text v-if="card.status == 0" class="iconfont icon-weixunjian"></text> <text class="num">{{ listData.length - inspectionNumber }}</text>
<text v-if="card.status == 1" class="iconfont icon-wancheng"></text> 个机房
<text v-if="card.status == 2" class="iconfont icon-shibai1"></text> </view>
</template> <view class="yi">
已完成
<text class="status" v-if="card.isSubmit == 0">草稿</text> <text class="num">{{ inspectionNumber }}</text>
<text class="status" v-else>{{ card.statusLable }}</text> 个机房
</view> </view>
<view class="second-row"> </view>
<text class="location">{{ card.name }}</text> </view>
</view> <view v-if="!isSign" class="card-box">
</view> <view
<view class="spacer-image right" v-if="cardIndex < row.length - 1"> class="card-row"
<image v-if="inspectionNumber == 11" class="img" src="@/static/img/arr2.svg" mode="aspectFit"></image> :class="{ right: rowIndex % 2 !== 0 }"
<image v-else class="img" src="@/static/img/arr1.svg" mode="aspectFit"></image> v-for="(row, rowIndex) in rows"
</view> :key="rowIndex"
<view class="spacer-image bottom" v-if="rowIndex < rows.length - 1"> >
<view v-if="(rowIndex == 1 && cardIndex == 0) || (rowIndex == 0 && cardIndex == 4)"> <view
<image v-if="inspectionNumber == 11" class="img" src="@/static/img/arr2.svg" mode="aspectFit"></image> class="card-wrapper"
<image v-else class="img" src="@/static/img/arr1.svg" mode="aspectFit"></image> v-for="(card, cardIndex) in row"
</view> :key="cardIndex"
</view> @click="startDialog(card.name, card.jfType, card.value, false)"
</view> >
</view> <view
</view> class="card"
</view> :class="{
<view v-else class="card-box detail"> status1: card.status == 1,
<view class="card-row" :class="{ right: rowIndex % 2 !== 0 }" v-for="(row, rowIndex) in rows" :key="rowIndex"> status2: card.status == 2,
<view class="card-wrapper" v-for="(card, cardIndex) in row" :key="cardIndex" @click="getDetailsItem(card.name, card.jfType, card.value)"> active: value === card.value,
<view }"
class="card" >
:class="{ <view class="card-content">
active: value === card.value, <view class="first-row">
warning: card.statusLable == '巡检异常' <template v-if="card.isSubmit == 0">
}" <text class="iconfont icon-weixunjian"></text>
> </template>
<view class="card-content"> <template v-else>
<view class="first-row"> <text
<image class="icon" src="@/static/img/add-img/home1.png"></image> v-if="card.status == 0"
<text class="status">{{ card.statusLable }}</text> class="iconfont icon-weixunjian"
</view> ></text>
<view class="second-row"> <text
<text class="location">{{ card.name }}</text> v-if="card.status == 1"
</view> class="iconfont icon-wancheng"
</view> ></text>
</view> <text
</view> v-if="card.status == 2"
</view> class="iconfont icon-shibai1"
<detail ref="detail" :jfType="jfType" :detailsItem="detailsItem"></detail> ></text>
</view> </template>
<view v-if="!isSign" class="submit-module">
<view class="action-btn" @click="startDialogBtn()">开始巡检</view> <text class="status" v-if="card.isSubmit == 0">草稿</text>
</view> <text class="status" v-else>{{ card.statusLable }}</text>
<signDialog ref="signDialog" @confirm="handlePopupConfirm"></signDialog> </view>
<!-- 巡检弹窗 --> <view class="second-row">
<startDialog ref="startDialog" :startDialogData="startDialogData" @confirm="handleStartDialog"></startDialog> <text class="location">{{ card.name }}</text>
<Dialog v-show="isDialog" :list="propList" @close="onSyncData(false)"></Dialog> </view>
</view> </view>
<view class="spacer-image right" v-if="cardIndex < row.length - 1">
<image
v-if="inspectionNumber == 11"
class="img"
src="@/static/img/arr2.svg"
mode="aspectFit"
></image>
<image
v-else
class="img"
src="@/static/img/arr1.svg"
mode="aspectFit"
></image>
</view>
<view class="spacer-image bottom" v-if="rowIndex < rows.length - 1">
<view
v-if="
(rowIndex == 1 && cardIndex == 0) ||
(rowIndex == 0 && cardIndex == 4)
"
>
<image
v-if="inspectionNumber == 11"
class="img"
src="@/static/img/arr2.svg"
mode="aspectFit"
></image>
<image
v-else
class="img"
src="@/static/img/arr1.svg"
mode="aspectFit"
></image>
</view>
</view>
</view>
</view>
</view>
</view>
<view v-else class="card-box detail">
<view
class="card-row"
:class="{ right: rowIndex % 2 !== 0 }"
v-for="(row, rowIndex) in rows"
:key="rowIndex"
>
<view
class="card-wrapper"
v-for="(card, cardIndex) in row"
:key="cardIndex"
@click="getDetailsItem(card.name, card.jfType, card.value)"
>
<view
class="card"
:class="{
active: value === card.value,
warning: card.statusLable == '巡检异常',
}"
>
<view class="card-content">
<view class="first-row">
<image
class="icon"
src="@/static/img/add-img/home1.png"
></image>
<text class="status">{{ card.statusLable }}</text>
</view>
<view class="second-row">
<text class="location">{{ card.name }}</text>
</view>
</view>
</view>
</view>
</view>
<detail ref="detail" :jfType="jfType" :detailsItem="detailsItem"></detail>
</view>
<view v-if="!isSign" class="submit-module">
<view class="action-btn" @click="startDialogBtn()">开始巡检</view>
</view>
<signDialog ref="signDialog" @confirm="handlePopupConfirm"></signDialog>
<!-- 巡检弹窗 -->
<startDialog
ref="startDialog"
:startDialogData="startDialogData"
@confirm="handleStartDialog"
></startDialog>
<Dialog
v-show="isDialog"
:list="propList"
@close="onSyncData(false)"
></Dialog>
</view>
</template> </template>
<script> <script>
import moment from 'moment'; import moment from "moment";
import { writeInspectionData, addLog, getLogContent, LOG_TYPE_ENUM } from '@/utils/IoReadingAndWriting.js'; import {
import signDialog from '@/components/signDialog.vue'; writeInspectionData,
import detail from './components/detail.vue'; addLog,
import startDialog from './components/dialog.vue'; getLogContent,
LOG_TYPE_ENUM,
} from "@/utils/IoReadingAndWriting.js";
import signDialog from "@/components/signDialog.vue";
import detail from "./components/detail.vue";
import startDialog from "./components/dialog.vue";
import assRoomApi from '@/api/assRoom.js'; import assRoomApi from "@/api/assRoom.js";
import inspectApi from '@/api/inspect'; import inspectApi from "@/api/inspect";
import { sqlToData, dataToSql, getHistoryData } from './shared'; import { sqlToData, dataToSql, getHistoryData } from "./shared";
import Dialog from '@/pages/inspectionManagement/dialog.vue'; import Dialog from "@/pages/inspectionManagement/dialog.vue";
export default { export default {
components: { components: {
signDialog, signDialog,
detail, detail,
startDialog, startDialog,
Dialog Dialog,
}, },
data() { data() {
return { return {
inspectionCode: '', inspectionCode: "",
rows: [], rows: [],
baseInfo: {}, // 基础信息 baseInfo: {}, // 基础信息
inspectionNumber: 0, // 已巡检的井道数量 inspectionNumber: 0, // 已巡检的井道数量
detailsInfo: {}, // 详情 detailsInfo: {}, // 详情
detailsItem: {}, detailsItem: {},
isDisable: false, // 禁用 isDisable: false, // 禁用
isSign: false, //签名状态 isSign: false, //签名状态
isSubmit: 0, //提交状态 isSubmit: 0, //提交状态
uid: '', uid: "",
options: {}, //存储数据 options: {}, //存储数据
backValue: '', backValue: "",
all_data: [], //所有数据 all_data: [], //所有数据
jfType: '0', //机房类型 jfType: "0", //机房类型
allIsSubmitOne: false, allIsSubmitOne: false,
startDialogData: { startDialogData: {
text: [], text: [],
isList: true, isList: true,
isLast: false isLast: false,
}, //弹窗文案 }, //弹窗文案
name: 'F座3楼-内环屏蔽机房', name: "F座3楼-内环屏蔽机房",
value: '1', value: "1",
listData: [], listData: [],
isDialog: false, isDialog: false,
propList: [], propList: [],
did: '' // 最近7天数据的id did: "", // 最近7天数据的id
}; };
}, },
computed: { computed: {
userInfo() { userInfo() {
return this.$store.state.now_user || {}; return this.$store.state.now_user || {};
}, },
updateDate() { updateDate() {
return moment(Number(this.detailsInfo.updateTime || this.detailsInfo.createTime)).format('YYYY-MM-DD'); return moment(
}, Number(this.detailsInfo.updateTime || this.detailsInfo.createTime)
abnormalLengths() { ).format("YYYY-MM-DD");
const originData = this.detailsInfo?.originData; },
let ret = 0; abnormalLengths() {
(originData || []).forEach(jf => { const originData = this.detailsInfo?.originData;
const details = jf.details || {} let ret = 0;
Object.keys(details).forEach(key => { (originData || []).forEach((jf) => {
const item = details[key] const details = jf.details || {};
console.log('x', key, item); Object.keys(details).forEach((key) => {
(item.detail || []).forEach(current =>{ const item = details[key];
if(current.inspectionResult === 1) { console.log("x", key, item);
ret++ (item.detail || []).forEach((current) => {
} if (current.inspectionResult === 1) {
}) ret++;
}) }
}) });
console.log('ret', ret); });
return ret });
} console.log("ret", ret);
}, return ret;
onLoad(options) { },
this.options = options; },
this.backValue = this.options.backValue || ''; onLoad(options) {
this.isDisable = options.isDisable == 1 ? true : false; this.options = options;
this.uid = this.options.uid || ''; this.backValue = this.options.backValue || "";
this.value = this.options.value || '1'; this.isDisable = options.isDisable == 1 ? true : false;
}, this.uid = this.options.uid || "";
onShow() { this.value = this.options.value || "1";
// 已经签名不触发更新,主要用于图片预览关闭后会触发onShow },
if (!this.isSign) { onShow() {
if (this.uid) { // 已经签名不触发更新,主要用于图片预览关闭后会触发onShow
this.getRoomList().then((res) => { if (!this.isSign) {
this.init(res).then(() => { if (this.uid) {
this.getDetails(this.uid); this.getRoomList().then((res) => {
}); this.init(res).then(() => {
}); this.getDetails(this.uid);
} else { });
this.getRoomList().then((res) => { });
// 获取7日(168小时)内最后一条巡检记录回显到页面(选项、文案、照片;异常项-不调出文案及照片) } else {
getHistoryData().then((detailsInfo) => { this.getRoomList().then((res) => {
if (detailsInfo) { // 获取7日(168小时)内最后一条巡检记录回显到页面(选项、文案、照片;异常项-不调出文案及照片)
// 处理历史数据(选项、文案、照片;异常项-不调出文案及照片) getHistoryData().then((detailsInfo) => {
console.log('detailsInfo', detailsInfo); if (detailsInfo) {
// 处理历史数据(选项、文案、照片;异常项-不调出文案及照片)
this.did = detailsInfo.id; console.log("detailsInfo", detailsInfo);
delete detailsInfo.id;
delete detailsInfo.inspectionCode;
this.listData = this.listFormat(detailsInfo.originData);
this.detailsInfo = detailsInfo;
this.inspectionNumber = detailsInfo.inspectionNumber;
this.inspectionCode = `JFXJ${moment().format('yyyyMMDDHHmmss')}${Math.floor(Math.random() * 900) + 100}`;
this.cardsInfo = detailsInfo.originData;
this.isSubmit = 0;
this.isSign = false;
// 默认选中第一个机房
this.detailsItem = detailsInfo.originData[0].details;
if (this.detailsItem.afxt && this.detailsItem.afxt.detail && this.detailsItem.afxt.detail[2].inspectionResult === 1) {
this.detailsItem.afxt.detail = this.detailsItem.afxt.detail.slice(0, 3);
}
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];
this.detailsInfo = detailsInfo;
} else {
this.init(res);
}
});
});
}
}
// this.startDialogData.text = [
// `请到“${this.name}”后;`,
// "点击“我已到达”开始巡检",
// ];
console.log('this.startDialogData', this.startDialogData);
this.all_data = this.$store.state.all_data;
},
methods: {
getRoomList() {
return assRoomApi.selectRoomList(1).then((res) => {
console.log('机房列表', res);
return res;
});
},
listFormat(baseList) {
const roomFeatureMap = {
1: '1',
2: '0',
3: '2'
};
let list = baseList.map((item, index) => {
const jfType = roomFeatureMap[item.roomFeature];
return {
id: item.id,
name: item.roomName,
value: item.dictValue,
/** 只是为了映射jfType,为了兼容之前的逻辑
* 前端用的:jfType 机房类型 0屏蔽  1汇聚  2电池间(1) 3电池间(2)
* roomFeature 机房类型枚举:1.汇聚机房,2.屏蔽机房,3.UPS机房,4.数据机房
*/
jfType: item.dictValue == '11' ? '3' : jfType,
isVaild: item.isVaild || false, // 校验通过
status: item.status || 0,
statusLable: item.statusLable || '未巡检'
};
});
return list;
},
init(baseList) {
this.value = baseList[0].dictValue;
return new Promise((resolve, reject) => {
let list = this.listFormat(baseList);
this.listData = this.deepClone(list);
console.log('this.listData', this.listData);
const group1 = list.slice(0, 5);
const group2 = list.slice(5, 10).reverse();
const group3 = list.slice(10);
this.rows = [group1, group2, group3];
if (this.uid) {
this.inspectionCode = this.detailsInfo.inspectionCode;
} else {
this.inspectionCode = `JFXJ${moment().format('yyyyMMDDHHmmss')}${Math.floor(Math.random() * 900) + 100}`;
}
resolve();
});
},
deepClone(target) {
if (typeof target !== 'object' || target === null) {
return target;
}
let clone; this.did = detailsInfo.id;
if (Array.isArray(target)) {
clone = [];
for (let i = 0; i < target.length; i++) {
clone[i] = this.deepClone(target[i]);
}
} else {
clone = {};
for (const key in target) {
if (target.hasOwnProperty(key)) {
clone[key] = this.deepClone(target[key]);
}
}
}
return clone; delete detailsInfo.id;
}, delete detailsInfo.inspectionCode;
// 回显数据
getDetails(uid) {
uni.showLoading();
return inspectApi
.info(uid)
.then((res) => {
console.log('before sqlToData', res);
const detailsInfo = sqlToData(res);
console.log('getDetails', detailsInfo);
this.listData = this.listFormat(detailsInfo.originData);
this.detailsInfo = detailsInfo;
this.inspectionNumber = detailsInfo.inspectionNumber;
this.inspectionCode = detailsInfo.inspectionCode;
this.cardsInfo = detailsInfo.originData;
this.isSubmit = this.detailsInfo.isSubmit;
this.isSign = this.detailsInfo.isSign;
// 默认选中第一个机房
this.detailsItem = detailsInfo.originData[0].details;
if (this.detailsItem.afxt && this.detailsItem.afxt.detail && this.detailsItem.afxt.detail[2].inspectionResult === 1) {
this.detailsItem.afxt.detail = this.detailsItem.afxt.detail.slice(0, 3);
}
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);
this.isDisable = this.isDisable || detailsInfo.synchronization == 1; // 是否禁用 1:已同步数据 0: 未同步数据
uni.hideLoading();
})
.catch((error) => {
uni.showToast({
title: error.msg,
icon: 'none',
duration: 1000
});
uni.hideLoading();
});
},
// 获取机房详情
getDetailsItem(location, jfType, value) {
this.activeName = location;
this.value = value;
this.detailsItem = this.detailsInfo.originData[value - 1].details;
this.jfType = this.detailsInfo.originData[value - 1].jfType;
if (this.detailsItem.afxt.detail[2].inspectionResult === 1) {
this.detailsItem.afxt.detail = this.detailsItem.afxt.detail.slice(0, 3);
}
console.log('this.detailsItem', this.detailsItem);
},
startDialogBtn(name = 'F座3楼-内环屏蔽机房', jfType = '0', value = '1') {
let item = this.findTargetObject(this.listData);
console.log('即将操作的机房', item);
this.name = this.uid ? item.name : name;
this.jfType = this.uid ? item.jfType : jfType;
this.value = this.uid ? item.value : value;
this.startDialogData.text = [`请到“${name}”后;`, '点击“我已到达”开始巡检'];
this.name = name;
this.jfType = jfType;
this.value = value;
this.$refs.startDialog.open();
},
startDialog(name = 'F座3楼-内环屏蔽机房', jfType = '0', value = '1') {
this.name = name;
this.jfType = jfType;
this.value = value;
if (!this.uid && value != '1') {
this.startDialogData.text = [`当前线路非常用巡检线路,`, `是否需要从“${this.name}”开始巡检`];
} else {
this.startDialogData.text = [`请到“${this.name}”后;`, '点击“我已到达”开始巡检'];
}
this.$refs.startDialog.open();
},
// 处理弹窗确认
handleStartDialog(summary) {
this.toShaftInspection(this.name, this.jfType, this.value);
},
// 跳转到具体的机房
toShaftInspection(name, jfType, value) {
console.log('name, 跳转到具体的机房, value', name, jfType, value);
uni.navigateTo({
url: `/pages/inspectionContent/inspectionContentNew?value=${value}&inspectionCode=${this.inspectionCode}&jfType=${jfType}&location=${name}&uid=${this.uid}&backValue=${this.backValue}&did=${this.did}`
});
},
lookTable() {
uni.navigateTo({
url: '/pages/report/sampleTable?isJF=1'
});
},
toSign() {
this.$refs.signDialog.open();
},
findTargetObject(rows) {
if (!rows || rows.length === 0) return null;
let lastNonZeroIndex = -1;
// 首先检查所有对象,记录最后一个 status 不为 0 的索引
for (let i = 0; i < rows.length; i++) {
if (rows[i].status !== 0) {
lastNonZeroIndex = i;
}
}
// 如果没有找到任何 status 不为 0 的对象,返回 null this.listData = this.listFormat(detailsInfo.originData);
if (lastNonZeroIndex === -1) return null; this.detailsInfo = detailsInfo;
// 计算目标对象的索引 this.inspectionNumber = detailsInfo.inspectionNumber;
let targetIndex = lastNonZeroIndex + 1; this.inspectionCode = `JFXJ${moment().format("yyyyMMDDHHmmss")}${
Math.floor(Math.random() * 900) + 100
}`;
this.cardsInfo = detailsInfo.originData;
this.isSubmit = 0;
this.isSign = false;
// 如果最后一个非零对象是数组的最后一个元素,则从第一个对象开始检查 // 默认选中第一个机房
if (lastNonZeroIndex === rows.length - 1) { this.detailsItem = detailsInfo.originData[0].details;
for (let i = 0; i < rows.length; i++) {
if (rows[i].status !== 0) {
targetIndex = i + 1;
break; // 找到第一个就停止
}
}
// 如果 targetIndex 超出数组范围,则返回 null if (
return targetIndex < rows.length ? rows[targetIndex] : null; this.detailsItem.afxt &&
} this.detailsItem.afxt.detail &&
this.detailsItem.afxt.detail[2].inspectionResult === 1
) {
this.detailsItem.afxt.detail =
this.detailsItem.afxt.detail.slice(0, 3);
}
this.allIsSubmitOne = detailsInfo.originData.every(
(item) => item.isSubmit == 1
);
// 正常情况:返回最后一个非零对象的下一个对象 let group1 = this.cardsInfo.slice(0, 5);
return rows[targetIndex]; let group2 = this.cardsInfo.slice(5, 10);
}, let group3 = this.cardsInfo.slice(10);
// 处理弹窗确认 if (!this.isSign) {
handlePopupConfirm(signImg) { group2 = group2.reverse();
this.detailsInfo.isSign = this.isSign = true; // 回显到文字显示区域 }
this.detailsInfo.signImg = signImg; // 回显到文字显示区域 this.rows = [group1, group2, group3];
this.detailsInfo.isSubmit = 1; // 提交状态
const isException = this.detailsInfo.originData.some((item) => item.status == 2);
this.detailsInfo.isException = isException ? 1 : 0; // 巡检异常
let allIsSubmitOne = this.detailsInfo.originData.every((item) => item.isSubmit === 1);
if (!allIsSubmitOne) {
// 如果有机房没有巡检完,记录是编辑状态
this.detailsInfo.synchronization = 2;
} else {
this.detailsInfo.synchronization = 0;
}
this.realSave(this.detailsInfo); this.detailsInfo = detailsInfo;
}, } else {
realSave(params, type = 'sign') { this.init(res);
const send = dataToSql(params); }
const api = this.uid ? inspectApi.update : inspectApi.save; });
});
}
}
const inspectionCode = this.inspectionCode || `JFXJ${moment().format('yyyyMMDDHHmmss')}${Math.floor(Math.random() * 900) + 100}`; // this.startDialogData.text = [
// `请到“${this.name}”后;`,
// "点击“我已到达”开始巡检",
// ];
console.log("this.startDialogData", this.startDialogData);
this.all_data = this.$store.state.all_data;
},
methods: {
getRoomList() {
return assRoomApi.selectRoomList(1).then((res) => {
console.log("机房列表", res);
return res;
});
},
listFormat(baseList) {
const roomFeatureMap = {
1: "1",
2: "0",
3: "2",
};
let list = baseList.map((item, index) => {
const jfType = roomFeatureMap[item.roomFeature];
return {
id: item.id,
name: item.roomName,
value: item.dictValue,
/** 只是为了映射jfType,为了兼容之前的逻辑
* 前端用的:jfType 机房类型 0屏蔽  1汇聚  2电池间(1) 3电池间(2)
* roomFeature 机房类型枚举:1.汇聚机房,2.屏蔽机房,3.UPS机房,4.数据机房
*/
jfType: item.dictValue == "11" ? "3" : jfType,
isVaild: item.isVaild || false, // 校验通过
status: item.status || 0,
statusLable: item.statusLable || "未巡检",
};
});
return list;
},
init(baseList) {
this.value = baseList[0].dictValue;
return new Promise((resolve, reject) => {
let list = this.listFormat(baseList);
this.listData = this.deepClone(list);
send.inspectionCode = inspectionCode; console.log("this.listData", this.listData);
console.log('send', send); const group1 = list.slice(0, 5);
api(this.uid ? { id: this.uid, ...send } : send).then((res) => { const group2 = list.slice(5, 10).reverse();
const logContent = getLogContent(LOG_TYPE_ENUM.sys, `巡检编号(${inspectionCode})`, '同步'); const group3 = list.slice(10);
this.$logApi.addlog(logContent); this.rows = [group1, group2, group3];
console.log('logContent', logContent);
uni.showToast({ if (this.uid) {
title: type == 'sign' ? '签字成功' : '同步成功', this.inspectionCode = this.detailsInfo.inspectionCode;
icon: 'success' } else {
}); this.inspectionCode = `JFXJ${moment().format("yyyyMMDDHHmmss")}${
Math.floor(Math.random() * 900) + 100
}`;
}
resolve();
});
},
deepClone(target) {
if (typeof target !== "object" || target === null) {
return target;
}
if (!this.uid) { let clone;
this.uid = res.lastInsertId; if (Array.isArray(target)) {
setTimeout(() => { clone = [];
this.getDetails(res.lastInsertId); for (let i = 0; i < target.length; i++) {
}, 300); clone[i] = this.deepClone(target[i]);
} }
}); } else {
}, clone = {};
back() { for (const key in target) {
if (this.backValue === 'home') { if (target.hasOwnProperty(key)) {
uni.navigateTo({ clone[key] = this.deepClone(target[key]);
url: '/pages/home/home' }
}); }
} else { }
uni.navigateTo({
url: `/pages/inspectionManagement/index` return clone;
}); },
} // 回显数据
}, getDetails(uid) {
previewImage(images, index) { uni.showLoading();
uni.previewImage({ return inspectApi
current: index, .info(uid)
urls: images, .then((res) => {
success: (res) =>{ console.log("before sqlToData", res);
} const detailsInfo = sqlToData(res);
}); console.log("getDetails", detailsInfo);
},
onSyncData(show) { this.listData = this.listFormat(detailsInfo.originData);
this.isDialog = show;
this.propList = [ this.detailsInfo = detailsInfo;
{ this.inspectionNumber = detailsInfo.inspectionNumber;
...dataToSql(this.detailsInfo), this.inspectionCode = detailsInfo.inspectionCode;
id: this.uid this.cardsInfo = detailsInfo.originData;
} this.isSubmit = this.detailsInfo.isSubmit;
]; this.isSign = this.detailsInfo.isSign;
console.log('propList', this.propList);
if (!show) { // 默认选中第一个机房
this.getDetails(this.uid); this.detailsItem = detailsInfo.originData[0].details;
if (
this.detailsItem.afxt &&
this.detailsItem.afxt.detail &&
this.detailsItem.afxt.detail[2].inspectionResult === 1
) {
this.detailsItem.afxt.detail = this.detailsItem.afxt.detail.slice(
0,
3
);
}
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);
this.isDisable = this.isDisable || detailsInfo.synchronization == 1; // 是否禁用 1:已同步数据 0: 未同步数据
uni.hideLoading();
})
.catch((error) => {
uni.showToast({
title: error.msg,
icon: "none",
duration: 1000,
});
uni.hideLoading();
});
},
// 获取机房详情
getDetailsItem(location, jfType, value) {
this.activeName = location;
this.value = value;
this.detailsItem = this.detailsInfo.originData[value - 1].details;
this.jfType = this.detailsInfo.originData[value - 1].jfType;
if (this.detailsItem.afxt.detail[2].inspectionResult === 1) {
this.detailsItem.afxt.detail = this.detailsItem.afxt.detail.slice(0, 3);
}
console.log("this.detailsItem", this.detailsItem);
},
startDialogBtn(name = "F座3楼-内环屏蔽机房", jfType = "0", value = "1") {
let item = this.findTargetObject(this.listData);
console.log("即将操作的机房", item);
this.name = this.uid ? item.name : name;
this.jfType = this.uid ? item.jfType : jfType;
this.value = this.uid ? item.value : value;
this.startDialogData.text = [
`请到“${name}”后;`,
"点击“我已到达”开始巡检",
];
this.name = name;
this.jfType = jfType;
this.value = value;
this.$refs.startDialog.open();
},
startDialog(name = "F座3楼-内环屏蔽机房", jfType = "0", value = "1") {
this.name = name;
this.jfType = jfType;
this.value = value;
if (!this.uid && value != "1") {
this.startDialogData.text = [
`当前线路非常用巡检线路,`,
`是否需要从“${this.name}”开始巡检`,
];
} else {
this.startDialogData.text = [
`请到“${this.name}”后;`,
"点击“我已到达”开始巡检",
];
}
this.$refs.startDialog.open();
},
// 处理弹窗确认
handleStartDialog(summary) {
this.toShaftInspection(this.name, this.jfType, this.value);
},
// 跳转到具体的机房
toShaftInspection(name, jfType, value) {
console.log("name, 跳转到具体的机房, value", name, jfType, value);
uni.navigateTo({
url: `/pages/inspectionContent/inspectionContentNew?value=${value}&inspectionCode=${this.inspectionCode}&jfType=${jfType}&location=${name}&uid=${this.uid}&backValue=${this.backValue}&did=${this.did}`,
});
},
lookTable() {
uni.navigateTo({
url: "/pages/report/sampleTable?isJF=1",
});
},
toSign() {
if(!this.allIsSubmitOne) {
return;
} }
} this.$refs.signDialog.open();
} },
findTargetObject(rows) {
if (!rows || rows.length === 0) return null;
let lastNonZeroIndex = -1;
// 首先检查所有对象,记录最后一个 status 不为 0 的索引
for (let i = 0; i < rows.length; i++) {
if (rows[i].status !== 0) {
lastNonZeroIndex = i;
}
}
// 如果没有找到任何 status 不为 0 的对象,返回 null
if (lastNonZeroIndex === -1) return null;
// 计算目标对象的索引
let targetIndex = lastNonZeroIndex + 1;
// 如果最后一个非零对象是数组的最后一个元素,则从第一个对象开始检查
if (lastNonZeroIndex === rows.length - 1) {
for (let i = 0; i < rows.length; i++) {
if (rows[i].status !== 0) {
targetIndex = i + 1;
break; // 找到第一个就停止
}
}
// 如果 targetIndex 超出数组范围,则返回 null
return targetIndex < rows.length ? rows[targetIndex] : null;
}
// 正常情况:返回最后一个非零对象的下一个对象
return rows[targetIndex];
},
// 处理弹窗确认
handlePopupConfirm(signImg) {
this.detailsInfo.isSign = this.isSign = true; // 回显到文字显示区域
this.detailsInfo.signImg = signImg; // 回显到文字显示区域
this.detailsInfo.isSubmit = 1; // 提交状态
const isException = this.detailsInfo.originData.some(
(item) => item.status == 2
);
this.detailsInfo.isException = isException ? 1 : 0; // 巡检异常
let allIsSubmitOne = this.detailsInfo.originData.every(
(item) => item.isSubmit === 1
);
if (!allIsSubmitOne) {
// 如果有机房没有巡检完,记录是编辑状态
this.detailsInfo.synchronization = 2;
} else {
this.detailsInfo.synchronization = 0;
}
this.realSave(this.detailsInfo);
},
realSave(params, type = "sign") {
const send = dataToSql(params);
const api = this.uid ? inspectApi.update : inspectApi.save;
const inspectionCode =
this.inspectionCode ||
`JFXJ${moment().format("yyyyMMDDHHmmss")}${
Math.floor(Math.random() * 900) + 100
}`;
send.inspectionCode = inspectionCode;
console.log("send", send);
api(this.uid ? { id: this.uid, ...send } : send).then((res) => {
const logContent = getLogContent(
LOG_TYPE_ENUM.sys,
`巡检编号(${inspectionCode})`,
"同步"
);
this.$logApi.addlog(logContent);
console.log("logContent", logContent);
uni.showToast({
title: type == "sign" ? "签字成功" : "同步成功",
icon: "success",
});
if (!this.uid) {
this.uid = res.lastInsertId;
setTimeout(() => {
this.getDetails(res.lastInsertId);
}, 300);
}
});
},
back() {
if (this.backValue === "home") {
uni.navigateTo({
url: "/pages/home/home",
});
} else {
uni.navigateTo({
url: `/pages/inspectionManagement/index`,
});
}
},
previewImage(images, index) {
uni.previewImage({
current: index,
urls: images,
success: (res) => {},
});
},
onSyncData(show) {
this.isDialog = show;
this.propList = [
{
...dataToSql(this.detailsInfo),
id: this.uid,
},
];
console.log("propList", this.propList);
if (!show) {
this.getDetails(this.uid);
}
},
},
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.uni-nav-bar-text { .uni-nav-bar-text {
height: 28.8px; height: 28.8px;
width: 28.8px; width: 28.8px;
background: #ffffff; background: #ffffff;
border: 0.32px solid rgba(224, 224, 224, 1); border: 0.32px solid rgba(224, 224, 224, 1);
border-radius: 14.4px; border-radius: 14.4px;
color: #333; color: #333;
text-align: center; text-align: center;
.iconfont { .iconfont {
font-size: 16px; font-size: 16px;
line-height: 28.8px; line-height: 28.8px;
} }
} }
.nav-right { .nav-right {
width: 192px; width: 192px;
z-index: 10; z-index: 10;
} }
.header-buttons { .header-buttons {
display: flex; display: flex;
align-items: center; align-items: center;
margin-left: auto; margin-left: auto;
.button { .button {
width: 89.6px; width: 89.6px;
height: 28.8px; height: 28.8px;
background: #ffffff; background: #ffffff;
border-radius: 14.4px; border-radius: 14.4px;
margin-left: 12.8px; margin-left: 12.8px;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 12.8px; font-size: 12.8px;
color: #000000; color: #000000;
line-height: 28.8px; line-height: 28.8px;
font-weight: 400; font-weight: 400;
text-align: center; text-align: center;
} }
} }
.container { .container {
background-image: linear-gradient(115deg, #e8f0fb 0%, #e1ebfa 100%); background-image: linear-gradient(115deg, #e8f0fb 0%, #e1ebfa 100%);
padding: 0 25.6px; padding: 0 25.6px;
height: 100vh; height: 100vh;
} }
.profile-section { .profile-section {
width: 100%; width: 100%;
margin-bottom: 12.8px; margin-bottom: 12.8px;
.profile-box { .profile-box {
background-color: #fff; background-color: #fff;
border-radius: 9.6px; border-radius: 9.6px;
padding: 12.8px 25.6px; padding: 12.8px 25.6px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.profile-left { .profile-left {
display: flex; display: flex;
align-items: center; align-items: center;
.avatar { .avatar {
position: relative; position: relative;
width: 68.8px; width: 68.8px;
height: 68.8px; height: 68.8px;
margin-right: 9.6px; margin-right: 9.6px;
border-radius: 50%; border-radius: 50%;
overflow: hidden; overflow: hidden;
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.change-password { .change-password {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
text-align: center; text-align: center;
height: 17.6px; height: 17.6px;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 9.6px; font-size: 9.6px;
color: #ffffff; color: #ffffff;
line-height: 16px; line-height: 16px;
font-weight: 400; font-weight: 400;
} }
} }
.info { .info {
.username { .username {
font-size: 16px; font-size: 16px;
color: #000000; color: #000000;
line-height: 22.4px; line-height: 22.4px;
font-weight: 500; font-weight: 500;
margin-bottom: 7.2px; margin-bottom: 7.2px;
margin-right: 10px; margin-right: 10px;
} }
.number { .number {
font-size: 12.8px; font-size: 12.8px;
color: #4a4a4a; color: #4a4a4a;
line-height: 22.4px; line-height: 22.4px;
font-weight: 400; font-weight: 400;
margin-right: 9.6px; margin-right: 9.6px;
.value { .value {
color: #000000; color: #000000;
} }
} }
.describe { .describe {
display: flex; display: flex;
.abnormal { .abnormal {
color: #fff; color: #fff;
line-height: 22.4px; line-height: 22.4px;
height: 22.4px; height: 22.4px;
padding: 0 8px; padding: 0 8px;
font-size: 12px; font-size: 12px;
background-color: #f55a42; background-color: #f55a42;
border-radius: 11px; border-radius: 11px;
} }
}
}
}
.profile-right {
display: flex;
.inspection-button {
width: 89.6px;
height: 28.8px;
background-image: linear-gradient(105deg, #68acfb 0%, #3774f6 100%);
border-radius: 14.4px;
font-family: PingFangSC-Regular;
font-size: 12.8px;
color: #ffffff;
line-height: 28.8px;
font-weight: 400;
margin-right: 12.8px;
}
.record-button {
display: block;
width: 115.2px;
height: 28.8px;
background: #ffffff;
border: 0.8px solid rgba(55, 116, 246, 1);
border-radius: 14.4px;
font-family: PingFangSC-Regular;
font-size: 12.8px;
color: #3774f6;
line-height: 28.8px;
font-weight: 400;
display: flex;
justify-content: center;
&.disabled-btn {
color: #c7c7c7;
background-color: #f9f9f9;
border-color: #f2f2f2;
} }
} }
} }
.profile-right { }
display: flex;
.inspection-button {
width: 89.6px;
height: 28.8px;
background-image: linear-gradient(105deg, #68acfb 0%, #3774f6 100%);
border-radius: 14.4px;
font-family: PingFangSC-Regular;
font-size: 12.8px;
color: #ffffff;
line-height: 28.8px;
font-weight: 400;
margin-right: 12.8px;
}
.record-button {
width: 115.2px;
height: 28.8px;
background: #ffffff;
border: 0.8px solid rgba(55, 116, 246, 1);
border-radius: 14.4px;
font-family: PingFangSC-Regular;
font-size: 12.8px;
color: #3774f6;
line-height: 28.8px;
font-weight: 400;
&.is-disabled {
color: #c7c7c7;
border-color: #c7c7c7;
}
}
}
}
} }
.box { .box {
background: #ffffff; background: #ffffff;
border-radius: 9.6px 9.6px 0 0; border-radius: 9.6px 9.6px 0 0;
padding: 12.8px 19.2px; padding: 12.8px 19.2px;
.bar { .bar {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
.title { .title {
font-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
font-size: 14.4px; font-size: 14.4px;
color: #000000; color: #000000;
line-height: 27.2px; line-height: 27.2px;
font-weight: 500; font-weight: 500;
} }
.dai { .dai {
background: rgba(243, 152, 0, 0.08); background: rgba(243, 152, 0, 0.08);
border-radius: 8px; border-radius: 8px;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 11.2px; font-size: 11.2px;
color: #4a4a4a; color: #4a4a4a;
letter-spacing: 0; letter-spacing: 0;
text-align: right; text-align: right;
line-height: 27.2px; line-height: 27.2px;
font-weight: 400; font-weight: 400;
margin: 0 9.6px; margin: 0 9.6px;
padding: 0 9.6px; padding: 0 9.6px;
.num { .num {
color: #f39800; color: #f39800;
} }
} }
.yi { .yi {
background: rgba(55, 116, 246, 0.08); background: rgba(55, 116, 246, 0.08);
border-radius: 8px; border-radius: 8px;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 11.2px; font-size: 11.2px;
color: #4a4a4a; color: #4a4a4a;
letter-spacing: 0; letter-spacing: 0;
text-align: right; text-align: right;
line-height: 27.2px; line-height: 27.2px;
font-weight: 400; font-weight: 400;
padding: 0 9.6px; padding: 0 9.6px;
.num { .num {
color: #000; color: #000;
} }
} }
} }
} }
.card-box { .card-box {
background: #ffffff; background: #ffffff;
border-radius: 0 0 9.6px 9.6px; border-radius: 0 0 9.6px 9.6px;
padding: 12.8px 19.2px; padding: 12.8px 19.2px;
height: calc(100vh - 232px - 19.2px); height: calc(100vh - 232px - 19.2px);
&.detail { &.detail {
height: calc(100vh - 200px); height: calc(100vh - 200px);
border-radius: 9.6px; border-radius: 9.6px;
overflow: auto; overflow: auto;
.card-wrapper { .card-wrapper {
width: calc((100% - 4 * 12.8px) / 5); /* 严格五等分宽度 */ width: calc((100% - 4 * 12.8px) / 5); /* 严格五等分宽度 */
.card { .card {
margin-bottom: 12.8px; margin-bottom: 12.8px;
} }
} }
} }
} }
.card-row { .card-row {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
position: relative; position: relative;
width: 100%; width: 100%;
.card-wrapper { .card-wrapper {
width: calc((100% - 4 * 43.2px) / 5); /* 严格五等分宽度 */ width: calc((100% - 4 * 43.2px) / 5); /* 严格五等分宽度 */
.card { .card {
height: 51.2px; height: 51.2px;
margin-bottom: 43.2px; margin-bottom: 43.2px;
border-radius: 8px; border-radius: 8px;
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 { &.active {
background: #fafcff; background: #fafcff;
border: 1px solid rgba(55, 116, 246, 1); border: 1px solid rgba(55, 116, 246, 1);
box-shadow: 0px 0px 3px 0px rgba(55, 116, 246, 0.2); box-shadow: 0px 0px 3px 0px rgba(55, 116, 246, 0.2);
} }
&.warning { &.warning {
background: #fff5f4; background: #fff5f4;
&.active { &.active {
border: 1px solid #ff4a34; border: 1px solid #ff4a34;
} }
.status { .status {
color: #ff4a34 !important; color: #ff4a34 !important;
} }
} }
&.status1 { &.status1 {
background: #f3f7ff; background: #f3f7ff;
.status { .status {
color: #3774f6; color: #3774f6;
} }
} }
&.status2 { &.status2 {
background: #fff5f4; background: #fff5f4;
.status { .status {
color: #f55a42; color: #f55a42;
} }
} }
.card-content { .card-content {
padding: 6.4px; padding: 6.4px;
.first-row { .first-row {
display: flex; display: flex;
align-items: center; align-items: center;
.iconfont { .iconfont {
font-size: 12px; font-size: 12px;
margin-right: 6.4px; margin-right: 6.4px;
&.icon-weixunjian { &.icon-weixunjian {
color: #959595; color: #959595;
} }
&.icon-shibai1 { &.icon-shibai1 {
color: #ff4a34; color: #ff4a34;
} }
&.icon-wancheng { &.icon-wancheng {
color: #3774f6; color: #3774f6;
} }
} }
.status { .status {
font-size: 12px; font-size: 12px;
color: #333333; color: #333333;
} }
} }
.second-row { .second-row {
margin-top: 3.2px; margin-top: 3.2px;
padding-left: 20px; padding-left: 20px;
.location { .location {
font-size: 12px; font-size: 12px;
color: #666666; color: #666666;
} }
} }
} }
} }
.spacer-image.right { .spacer-image.right {
position: absolute; position: absolute;
right: -43.2px; right: -43.2px;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
.img { .img {
width: 30.4px; width: 30.4px;
height: 6.4px; height: 6.4px;
margin: 0 6.4px; margin: 0 6.4px;
} }
} }
} }
.spacer-image.bottom { .spacer-image.bottom {
position: absolute; position: absolute;
bottom: -33.6px; bottom: -33.6px;
left: 50%; left: 50%;
transform: translateX(-50%) rotate(90deg); transform: translateX(-50%) rotate(90deg);
.img { .img {
width: 30.4px; width: 30.4px;
height: 6.4px; height: 6.4px;
margin: 6.4px 0; margin: 6.4px 0;
} }
} }
&.right { &.right {
.card-wrapper { .card-wrapper {
.spacer-image.right { .spacer-image.right {
position: absolute; position: absolute;
left: -43.2px; left: -43.2px;
top: 50%; top: 50%;
transform: translateY(-50%) rotate(180deg); transform: translateY(-50%) rotate(180deg);
.img { .img {
width: 30.4px; width: 30.4px;
height: 6.4px; height: 6.4px;
margin: 0 6.4px; margin: 0 6.4px;
} }
} }
} }
} }
} }
.submit-module { .submit-module {
display: flex; display: flex;
justify-content: center; justify-content: center;
position: fixed; position: fixed;
gap: 16px; gap: 16px;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
bottom: 25.6px; bottom: 25.6px;
.action-btn { .action-btn {
width: 145.6px; width: 145.6px;
height: 38.4px; height: 38.4px;
line-height: 38.4px; line-height: 38.4px;
background-image: linear-gradient(180deg, #3773f6 0%, #2c57f6 99%); background-image: linear-gradient(180deg, #3773f6 0%, #2c57f6 99%);
box-shadow: 0px 8px 19.2px 0px rgba(185, 185, 185, 0.24); box-shadow: 0px 8px 19.2px 0px rgba(185, 185, 185, 0.24);
border-radius: 21.6px 19.2px 19.2px 21.6px; border-radius: 21.6px 19.2px 19.2px 21.6px;
font-size: 16px; font-size: 16px;
color: #fff; color: #fff;
text-align: center; text-align: center;
font-weight: 400; font-weight: 400;
&.complete-btn { &.complete-btn {
background-image: linear-gradient(180deg, #3773f6 0%, #2c57f6 99%); background-image: linear-gradient(180deg, #3773f6 0%, #2c57f6 99%);
color: #ffffff; color: #ffffff;
} }
} }
} }
.sign-img { .sign-img {
width: 80px; width: 80px;
height: 28.8px; height: 28.8px;
margin-right: 10px; margin-right: 10px;
border: 1px solid #c5c5c5; border: 1px solid #c5c5c5;
&.no-border { &.no-border {
border: none; border: none;
} }
} }
</style> </style>
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
</view> </view>
<!-- v-if="value > 2" --> <!-- v-if="value > 2" -->
<view class="action-btn complete-btn" @click="submit(1)"> 完成巡检 </view> <view class="action-btn complete-btn" @click="submit(1)"> 完成巡检 </view>
<view class="action-btn" @click="normal"> 一键正常 </view> <!-- <view class="action-btn" @click="normal"> 一键正常 </view> -->
</view> </view>
<startDialog <startDialog
ref="startDialog" ref="startDialog"
...@@ -1154,10 +1154,10 @@ export default { ...@@ -1154,10 +1154,10 @@ export default {
gap: 16px; gap: 16px;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
bottom: 25.6px; bottom: 20px;
.action-btn { .action-btn {
width: 145.6px; width: 118px;
height: 38.4px; height: 38.4px;
line-height: 38.4px; line-height: 38.4px;
background: #ffffff; background: #ffffff;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<uni-easyinput v-if="passwordVisible" class="log-input" prefixIcon="locked" clearSize="0" <uni-easyinput v-if="passwordVisible" class="log-input" prefixIcon="locked" clearSize="0"
v-model="person.pwd" @iconClick="togglePasswordVisible" :placeholder="passwordPlaceholder" v-model="person.pwd" @iconClick="togglePasswordVisible" :placeholder="passwordPlaceholder"
:passwordIcon="false" :type="passwordVisible ? 'text' : 'password'"></uni-easyinput> :passwordIcon="false" :type="passwordVisible ? 'text' : 'password'"></uni-easyinput>
<uni-easyinput v-else class="log-input" prefixIcon="locked-filled" clearSize="0" v-model="person.pd" <uni-easyinput v-else class="log-input" prefixIcon="locked-filled" clearSize="0" v-model="person.pwd"
@iconClick="togglePasswordVisible" :placeholder="passwordPlaceholder" :passwordIcon="false" @iconClick="togglePasswordVisible" :placeholder="passwordPlaceholder" :passwordIcon="false"
:type="passwordVisible ? 'text' : 'password'"></uni-easyinput> :type="passwordVisible ? 'text' : 'password'"></uni-easyinput>
</view> </view>
...@@ -44,8 +44,8 @@ ...@@ -44,8 +44,8 @@
data() { data() {
return { return {
person: { person: {
account: "管理员", account: "", // "管理员",
pwd: "Gly@124", pwd: "" // Gly@124",
}, },
backButtonPress: 0, backButtonPress: 0,
personList: [], personList: [],
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
this.passwordVisible = !this.passwordVisible; this.passwordVisible = !this.passwordVisible;
}, },
// 点击登录 // 点击登录
async login() { async login() {
userApi.login(this.person).then((res) => { userApi.login(this.person).then((res) => {
if (res.data) { if (res.data) {
this.personList = res.data; this.personList = res.data;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论