| | |
| | | <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> |
| | |
| | | <el-tab-pane label="量值溯源计划" name="量值溯源计划"> |
| | | <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> |
| | |
| | | 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' |
| | |
| | | resourceReservation, |
| | | 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) { |
| | | // 点击临时缓存 |
| | | this.clickNodeVal = val; |