From 3c797428bd595aac4195cf45f4ea7304daa8f029 Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期一, 19 十月 2026 15:20:17 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/views/CNAS/resourceDemand/device/component/deviceOverview.vue | 52 ++++++++++++++++++++++++----------------------------
1 files changed, 24 insertions(+), 28 deletions(-)
diff --git a/src/views/CNAS/resourceDemand/device/component/deviceOverview.vue b/src/views/CNAS/resourceDemand/device/component/deviceOverview.vue
index 9a79f1d..88aa48d 100644
--- a/src/views/CNAS/resourceDemand/device/component/deviceOverview.vue
+++ b/src/views/CNAS/resourceDemand/device/component/deviceOverview.vue
@@ -7,7 +7,7 @@
<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>
@@ -29,7 +29,7 @@
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;
@@ -40,6 +40,15 @@
<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>
@@ -99,6 +108,7 @@
selectDeviceParameter,
downloadDeviceImportTemplate,
} from '@/api/cnas/resourceDemand/device.js'
+import { saveBlobOrShowError } from '@/utils/saveBlob'
export default {
props: {
clickNodeVal: {
@@ -116,6 +126,7 @@
entity: {
deviceStatus: null,
deviceName: null,
+ largeCategory: null,
},
options: [],
list: [],
@@ -125,7 +136,6 @@
loading: true, // 缁勪欢loading鐨勫睍绀�,榛樿涓簍rue
finishLoding: false, // 鍔犺浇瀹屾垚锛屾樉绀哄凡缁忔病鏈夋洿澶氫簡
keyMap: {},
- laboratoryNameIsNull: false,
importVisible: false,
importing: false,
importFiles: [],
@@ -146,8 +156,8 @@
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) {
@@ -206,7 +216,6 @@
this.finishLoding = false;
}
selectDeviceParameter({
- laboratoryNameIsNull: this.laboratoryNameIsNull,
current: this.currentPage,
size: this.pageSize,
...this.entity
@@ -253,6 +262,11 @@
}
}
this.loading = false
+ }).catch(() => {
+ // 娓呮帀鏈〉鍗犱綅锛屽け璐ュ悗鍙敤鏌ヨ/閲嶇疆閲嶆柊鍔犺浇
+ delete this.keyMap[key]
+ this.loading = false
+ this.finishLoding = true
})
},
refresh() {
@@ -263,6 +277,7 @@
this.entity = {
deviceStatus: null,
deviceName: null,
+ largeCategory: null,
};
this.refreshTable()
},
@@ -275,33 +290,14 @@
},
// 鐐瑰嚮渚ц竟鏍忓埛鏂�
clickSidebar(clickNodeVal) {
- this.laboratoryNameIsNull = false
- // 鏄惁瀛樺湪value锛屽瓨鍦╲alue浠h〃涓轰笁绾�
+ // 瀛樺湪value浠h〃閫変腑浜嗚澶囷紝鐢辫澶囪鎯呭睍绀哄鐞�
if (!clickNodeVal.value) {
this.finishLoding = false;
this.keyMap = {};
this.currentPage = 1;
this.list = [];
- this.entity.laboratoryName = null
- this.entity.storagePoint = null
- // 绛変簬1浠h〃涓烘爲鐨勪竴绾э紝label涓洪儴闂�
- if (clickNodeVal.label == '鍏朵粬') {
- this.laboratoryNameIsNull = true
- this.refreshTable();
- return
- }
- if (clickNodeVal.level == 1) {
- this.entity.laboratoryName = clickNodeVal.label
- // 绛変簬浜岀骇銆俵abel涓哄瓨鍌ㄥ湴鐐�
- } 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();
}
}
--
Gitblit v1.9.3