From 7eb190f13437b2e67788e9f4bdea725fdb165f01 Mon Sep 17 00:00:00 2001 From: zhuo <2089219845@qq.com> Date: 星期二, 20 五月 2025 10:41:01 +0800 Subject: [PATCH] 代码合并 --- src/views/CNAS/resourceDemand/device/index.vue | 43 ++++++++++++++++++++++++++++++++++++------- 1 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/views/CNAS/resourceDemand/device/index.vue b/src/views/CNAS/resourceDemand/device/index.vue index 6dd1e28..e01dc60 100644 --- a/src/views/CNAS/resourceDemand/device/index.vue +++ b/src/views/CNAS/resourceDemand/device/index.vue @@ -12,7 +12,9 @@ <div slot-scope="{ node, data }" class="custom-tree-node"> <el-row style="width: 100%;"> <el-col :span="24"> - <p class="single-line-ellipsis" style="width: 100%"> + <p class="single-line-ellipsis" style="width: 100%" :style="{ + color: isLeafNode(data) && shouldHighlight(data) ? 'red' : '' + }"> <i :class="`node_i ${data.children != undefined ? data.code === '[1]' ? 'el-icon-folder-opened' @@ -22,7 +24,9 @@ "></i> {{ data.label }} </p> - <p> + <p :style="{ + color: isLeafNode(data) && shouldHighlight(data) ? 'red' : '' + }"> {{ data.managementNumber === undefined ? '' : data.managementNumber }} </p> </el-col> @@ -55,6 +59,10 @@ <quantity-value-traceability-plan v-if="menuListActiveName == '閲忓�兼函婧愯鍒�'" :clickNodeVal="clickNodeVal"></quantity-value-traceability-plan> </el-tab-pane> + <el-tab-pane label="璁惧浣跨敤鎺堟潈" name="璁惧浣跨敤鎺堟潈"> + <usage-authorization v-if="menuListActiveName == '璁惧浣跨敤鎺堟潈'" + :clickNodeVal="clickNodeVal"></usage-authorization> + </el-tab-pane> <el-tab-pane label="鍒╃敤澶栭儴浠櫒璁惧" name="鍒╃敤澶栭儴浠櫒璁惧"> <using-external-instruments v-if="menuListActiveName == '鍒╃敤澶栭儴浠櫒璁惧'" :clickNodeVal="clickNodeVal"></using-external-instruments> </el-tab-pane> @@ -74,8 +82,8 @@ <el-tab-pane label="璁惧鏍″噯" name="璁惧鏍″噯"> <calibration v-if="tabListActiveName == '璁惧鏍″噯'" :clickNodeVal="clickNodeVal" /> </el-tab-pane> - <el-tab-pane label="璁惧缁存姢" name="璁惧缁存姢"> - <maintenance v-if="tabListActiveName == '璁惧缁存姢'" :clickNodeVal="clickNodeVal" /> + <el-tab-pane label="璁惧缁存姢淇濆吇" name="璁惧缁存姢淇濆吇"> + <equipmentMaintenance v-if="tabListActiveName == '璁惧缁存姢淇濆吇'" :clickNodeVal="clickNodeVal" /> </el-tab-pane> <el-tab-pane label="璁惧鍊熺敤" name="璁惧鍊熺敤"> <borrow v-if="tabListActiveName == '璁惧鍊熺敤'" :clickNodeVal="clickNodeVal" /> @@ -112,7 +120,6 @@ import files from "./component/files.vue"; import calibration from "./component/calibration.vue"; import check from "./component/check.vue"; -import maintenance from "./component/maintenance.vue"; import borrow from "./component/borrow.vue"; import fault from "./component/fault.vue"; import record from "./component/record.vue"; @@ -131,10 +138,13 @@ import EquipmentMaintenancePlan from "./component/equipmentMaintenancePlan.vue"; import EquipmentAcceptance from "./component/equipmentAcceptance.vue"; import QuantityValueTraceabilityPlan from "./component/quantityValueTraceabilityPlan.vue"; +import equipmentMaintenance from "./component/equipmentMaintenance.vue"; +import usageAuthorization from "./component/usageAuthorization.vue"; import { treeDevice, } from '@/api/cnas/resourceDemand/device.js' export default { + name: 'Device', components: { QuantityValueTraceabilityPlan, EquipmentAcceptance, @@ -150,7 +160,6 @@ files, calibration, check, - maintenance, borrow, fault, record, @@ -158,7 +167,9 @@ management, overview, resourceReservation, - operationInstruction + operationInstruction, + equipmentMaintenance, + usageAuthorization, }, data() { return { @@ -191,8 +202,24 @@ treeDevice().then(res => { let data = res.data; this.list = data; + console.log('this.list--', this.list) this.loading = false }); + }, + // 鍒ゆ柇鏄惁鏄彾瀛愯妭鐐� + isLeafNode(data) { + return !data.children || data.children.length === 0; + }, + // 鍒ゆ柇鏄惁闇�瑕佹爣绾� + shouldHighlight(data) { + if (!data.activationDate) return false; + const today = new Date(); + const targetDate = new Date(data.activationDate); + const fiveDaysBeforeTarget = new Date(targetDate); + // 璁$畻鍓嶄簲澶╃殑鏃ユ湡 + fiveDaysBeforeTarget.setDate(targetDate.getDate() - 5); + + return today > fiveDaysBeforeTarget; }, handleNodeClick(val, node, el) { // 鐐瑰嚮涓存椂缂撳瓨 @@ -277,6 +304,8 @@ >>>.el-tabs__content { padding-top: 0; + max-height: 95%; /* 鏍规嵁闇�姹傝皟鏁撮珮搴� */ + overflow-y: auto; /* 鍨傜洿鏂瑰悜瓒呭嚭鏃舵樉绀烘粴鍔ㄦ潯 */ } >>>.single-line-ellipsis { -- Gitblit v1.9.3