| | |
| | | <div style="display: flex;justify-content: space-between;margin-top: 10px;"> |
| | | <div style="display: flex;"> |
| | | <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;"> |
| | | <span style="width: 48px;font-size: 14px;font-weight: 700;color: #606266;">状态</span> |
| | | <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> |
| | | </div> |
| | | <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;"> |
| | | <span style="width: 88px;font-size: 14px;font-weight: 700;color: #606266;">设备名称</span> |
| | | <span style="width: 88px;font-size: 14px;font-weight: 700;color: var(--lims-text-2);">设备名称</span> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="entity.deviceName" |
| | | @keyup.enter="currentPage = 1, keyMap = {}, list = [], finishLoding = false, refreshTable()"></el-input> |
| | | </div> |
| | |
| | | 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; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | border: 1px solid #EEEEEE;"> |
| | | <lims-icon name="el-icon-picture-outline" style="font-size:20px;color:#666666;"></lims-icon> |
| | | border: 1px solid var(--lims-divider);"> |
| | | <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> |
| | |
| | | </div> |
| | | <div class="list-left-info"> |
| | | <span class="label">规格型号:</span> |
| | | <span style="color:#333333;font-size: 16px;">{{ m.specificationModel ? m.specificationModel : '无' |
| | | <span style="color:var(--lims-text);font-size: 16px;">{{ m.specificationModel ? m.specificationModel : '无' |
| | | }}</span> |
| | | </div> |
| | | <div class="list-left-info"> |
| | | <span class="label">状态:</span> |
| | | <el-tag :type="m.type" v-if="m.deviceStatusName">{{ m.deviceStatusName }}</el-tag> |
| | | <span v-else style="color:#333333;font-size: 16px;">无</span> |
| | | <span v-else style="color:var(--lims-text);font-size: 16px;">无</span> |
| | | </div> |
| | | </div> |
| | | <div class="circles" :class="m.type"> |
| | |
| | | </li> |
| | | </ul> |
| | | </scroll-pagination> |
| | | <div v-if="list.length < 1 && !loading" style="color:#909399;font-size:14px;text-align: center;margin-top:200px"> |
| | | <div v-if="list.length < 1 && !loading" style="color:var(--lims-text-3);font-size:14px;text-align: center;margin-top:200px"> |
| | | 暂无数据 |
| | | </div> |
| | | </div> |
| | |
| | | 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(); |
| | | } |
| | | } |
| | |
| | | width: 330px; |
| | | height: 165px; |
| | | border-radius: 8px 8px 8px 8px; |
| | | border: 1px solid #EEEEEE; |
| | | border: 1px solid var(--lims-divider); |
| | | margin: 0 !important; |
| | | display: flex; |
| | | align-items: center; |
| | | box-sizing: border-box; |
| | | padding: 16px; |
| | | font-size: 14px; |
| | | color: #666666; |
| | | color: var(--lims-text-2); |
| | | position: relative; |
| | | overflow: hidden; |
| | | } |
| | |
| | | } |
| | | |
| | | .success .circle { |
| | | background: #34BD66; |
| | | background: var(--el-color-success); |
| | | } |
| | | |
| | | .danger .circle { |
| | |
| | | } |
| | | |
| | | .info .circle { |
| | | background: #909399; |
| | | background: var(--lims-text-3); |
| | | } |
| | | |
| | | .el-form-item { |