| | |
| | | <span style="width: 48px;font-size: 14px;font-weight: 700;color: var(--lims-text-2);">状态</span> |
| | | <el-select v-model="entity.deviceStatus" placeholder="全部" |
| | | @change="currentPage = 1, keyMap = {}, list = [], finishLoding = false, refreshTable()" |
| | | size="small" clearable> |
| | | size="small" clearable style="width: 120px"> |
| | | <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | |
| | | v-if="list.length > 0 || loading"> |
| | | <ul class="card"> |
| | | <li v-for="(m, i) in list" :key="i"> |
| | | <el-image class="img" :src="javaApi + '/img/' + m.imageUpload"> |
| | | <el-image v-if="m.imageUpload" class="img" :src="javaApi + '/img/' + m.imageUpload"> |
| | | <template #error><div class="image-error" style="width: 88px; |
| | | height: 88px; |
| | | border-radius: 16px; |
| | |
| | | <lims-icon name="el-icon-picture-outline" style="font-size:20px;color:var(--lims-text-2);"></lims-icon> |
| | | </div></template> |
| | | </el-image> |
| | | <div v-else class="image-error" style="width: 88px; |
| | | height: 88px; |
| | | border-radius: 16px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | border: 1px solid var(--lims-divider);margin-right: 10px;"> |
| | | <lims-icon name="el-icon-picture-outline" style="font-size:20px;color:var(--lims-text-2);"></lims-icon> |
| | | </div> |
| | | <div class="list-left"> |
| | | <div class="list-left-info"> |
| | | <span class="label" style="white-space: nowrap;">设备名称:</span> |
| | |
| | | selectDeviceParameter, |
| | | downloadDeviceImportTemplate, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { saveBlobOrShowError } from '@/utils/saveBlob' |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | |
| | | entity: { |
| | | deviceStatus: null, |
| | | deviceName: null, |
| | | largeCategory: null, |
| | | }, |
| | | options: [], |
| | | list: [], |
| | |
| | | loading: true, // 组件loading的展示,默认为true |
| | | finishLoding: false, // 加载完成,显示已经没有更多了 |
| | | keyMap: {}, |
| | | laboratoryNameIsNull: false, |
| | | importVisible: false, |
| | | importing: false, |
| | | importFiles: [], |
| | |
| | | methods: { |
| | | downloadTemplate() { |
| | | downloadDeviceImportTemplate().then(res => { |
| | | this.$download.saveAs(new Blob([res]), '设备导入模板.xlsx') |
| | | }) |
| | | saveBlobOrShowError(res, '设备导入模板.xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') |
| | | }).catch(() => { }) |
| | | }, |
| | | submitImport() { |
| | | if (!this.$refs.deviceUpload.uploadFiles.length) { |
| | |
| | | this.finishLoding = false; |
| | | } |
| | | selectDeviceParameter({ |
| | | laboratoryNameIsNull: this.laboratoryNameIsNull, |
| | | current: this.currentPage, |
| | | size: this.pageSize, |
| | | ...this.entity |
| | |
| | | } |
| | | } |
| | | this.loading = false |
| | | }).catch(() => { |
| | | // 清掉本页占位,失败后可用查询/重置重新加载 |
| | | delete this.keyMap[key] |
| | | this.loading = false |
| | | this.finishLoding = true |
| | | }) |
| | | }, |
| | | refresh() { |
| | |
| | | this.entity = { |
| | | deviceStatus: null, |
| | | deviceName: null, |
| | | largeCategory: null, |
| | | }; |
| | | this.refreshTable() |
| | | }, |
| | |
| | | }, |
| | | // 点击侧边栏刷新 |
| | | clickSidebar(clickNodeVal) { |
| | | this.laboratoryNameIsNull = false |
| | | // 是否存在value,存在value代表为三级 |
| | | // 存在value代表选中了设备,由设备详情展示处理 |
| | | if (!clickNodeVal.value) { |
| | | this.finishLoding = false; |
| | | this.keyMap = {}; |
| | | this.currentPage = 1; |
| | | this.list = []; |
| | | this.entity.laboratoryName = null |
| | | this.entity.storagePoint = null |
| | | // 等于1代表为树的一级,label为部门 |
| | | if (clickNodeVal.label == '其他') { |
| | | this.laboratoryNameIsNull = true |
| | | this.refreshTable(); |
| | | return |
| | | } |
| | | if (clickNodeVal.level == 1) { |
| | | this.entity.laboratoryName = clickNodeVal.label |
| | | // 等于二级。label为存储地点 |
| | | } else if (clickNodeVal.level == 2) { |
| | | // 其他表示没有配置实验室,只配置了地点 |
| | | if (clickNodeVal.parent.label == '其他') { |
| | | this.laboratoryNameIsNull = true |
| | | } else { |
| | | this.entity.laboratoryName = clickNodeVal.parent.label |
| | | } |
| | | this.entity.storagePoint = clickNodeVal.label |
| | | } |
| | | // 树的一级为分类:全部/设备/计量器具 |
| | | this.entity.largeCategory = clickNodeVal.label === '全部' ? null : clickNodeVal.label; |
| | | this.refreshTable(); |
| | | } |
| | | } |