| | |
| | | <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' |
| | |
| | | "></i> |
| | | {{ data.label }} |
| | | </p> |
| | | <p> |
| | | <p :style="{ |
| | | color: isLeafNode(data) && shouldHighlight(data) ? 'red' : '' |
| | | }"> |
| | | {{ data.managementNumber === undefined ? '' : data.managementNumber }} |
| | | </p> |
| | | </el-col> |
| | |
| | | <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> |
| | |
| | | <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" /> |
| | |
| | | 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"; |
| | |
| | | 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, |
| | |
| | | files, |
| | | calibration, |
| | | check, |
| | | maintenance, |
| | | borrow, |
| | | fault, |
| | | record, |
| | |
| | | management, |
| | | overview, |
| | | resourceReservation, |
| | | operationInstruction |
| | | operationInstruction, |
| | | equipmentMaintenance, |
| | | usageAuthorization, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | 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) { |
| | | // 点击临时缓存 |
| | |
| | | |
| | | >>>.el-tabs__content { |
| | | padding-top: 0; |
| | | max-height: 95%; /* 根据需求调整高度 */ |
| | | overflow-y: auto; /* 垂直方向超出时显示滚动条 */ |
| | | } |
| | | |
| | | >>>.single-line-ellipsis { |