From 5d61e3ea816a74f4491276e2d73cca2e42af3b10 Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期一, 17 二月 2025 10:55:18 +0800 Subject: [PATCH] 文件档案第二次添加附件报错 --- src/components/do/a6-device/device-overview.vue | 270 ++++++++++++++++++++++++++++++++--------------------- 1 files changed, 163 insertions(+), 107 deletions(-) diff --git a/src/components/do/a6-device/device-overview.vue b/src/components/do/a6-device/device-overview.vue index ed1ab0d..a3f83c7 100644 --- a/src/components/do/a6-device/device-overview.vue +++ b/src/components/do/a6-device/device-overview.vue @@ -49,7 +49,7 @@ width: 380px; height: 165px; border-radius: 8px 8px 8px 8px; - border: 1px solid #EEEEEE; + border: 1px solid #eeeeee; margin: 0 !important; display: flex; align-items: center; @@ -76,7 +76,7 @@ .text-truncate { overflow: hidden; text-overflow: ellipsis; - white-space: nowrap + white-space: nowrap; } .circles { @@ -128,15 +128,15 @@ } .success .circle { - background: #34BD66; + background: #34bd66; } .danger .circle { - background: #FF3838; + background: #ff3838; } .warning .circle { - background: #FBB247; + background: #fbb247; } .info .circle { background: #909399; @@ -148,20 +148,45 @@ <div> <el-form :model="entity" inline label-position="right" label-width="80px"> <el-form-item label="鐘舵��:"> - <el-select v-model="entity.deviceStatus" placeholder="鍏ㄩ儴" size="small" clearable> - <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> + <el-select + v-model="entity.deviceStatus" + placeholder="鍏ㄩ儴" + size="small" + clearable + > + <el-option + v-for="item in options" + :key="item.value" + :label="item.label" + :value="item.value" + > </el-option> </el-select> </el-form-item> <el-form-item label="璁惧鍚嶇О:"> - <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="entity.deviceName"></el-input> + <el-input + size="small" + placeholder="璇疯緭鍏�" + clearable + v-model="entity.deviceName" + ></el-input> </el-form-item> <el-form-item> <el-button size="small" @click="refresh()">閲� 缃�</el-button> </el-form-item> <el-form-item> - <el-button size="small" type="primary" - @click="currentPage = 1, keyMap = {}, list = [], finishLoding = false, refreshTable()">鏌� 璇�</el-button> + <el-button + size="small" + type="primary" + @click=" + (currentPage = 1), + (keyMap = {}), + (list = []), + (finishLoding = false), + refreshTable() + " + >鏌� 璇�</el-button + > </el-form-item> </el-form> <!-- <div class="search_thing"> @@ -179,43 +204,61 @@ </div> </div> --> - <!-- <div class="search_thing" style="padding-left: 30px;"> </div> --> </div> <div class="table" v-loading="loading"> - <scroll-pagination @load="refreshTable()" :finishLoding="finishLoding" :list="list" - v-if="list.length > 0 || loading"> + <scroll-pagination + @load="refreshTable()" + :finishLoding="finishLoding" + :list="list" + 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"> - <div slot="error" class="image-error" style="width: 112px; + <div + slot="error" + class="image-error" + style="width: 112px; height: 112px; border-radius: 16px; display: flex; align-items: center; justify-content: center; - border: 1px solid #EEEEEE;"> - <i class="el-icon-picture-outline" style="font-size:30px;color:#666666;"></i> + border: 1px solid #EEEEEE;" + > + <i + class="el-icon-picture-outline" + style="font-size:30px;color:#666666;" + ></i> </div> </el-image> <div class="list-left"> <div class="list-left-info"> <span class="label">璁惧鍚嶇О锛�</span> - <span style="color:#3A7BFA; + <span + style="color:#3A7BFA; font-size: 16px; display: inline-block; width: 129px; - word-break: break-all;" class="text-truncate" :title="m.deviceName">{{ m.deviceName ? m.deviceName : '鏃�' }}</span> + word-break: break-all;" + class="text-truncate" + :title="m.deviceName" + >{{ m.deviceName ? m.deviceName : "鏃�" }}</span + > </div> <div class="list-left-info"> <span class="label">瑙勬牸鍨嬪彿锛�</span> - <span style="color:#333333;font-size: 16px;">{{ m.specificationModel ? m.specificationModel : '鏃�' - }}</span> + <span style="color:#333333;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> + <el-tag :type="m.type" v-if="m.deviceStatusName">{{ + m.deviceStatusName + }}</el-tag> <span v-else style="color:#333333;font-size: 16px;">鏃�</span> </div> </div> @@ -228,7 +271,10 @@ </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:#909399;font-size:14px;text-align: center;margin-top:200px" + > 鏆傛棤鏁版嵁 </div> </div> @@ -236,7 +282,7 @@ </template> <script> -import ScrollPagination from '../../tool/scroll-paging.vue' +import ScrollPagination from "../../tool/scroll-paging.vue"; export default { props: { clickNodeVal: { @@ -260,90 +306,98 @@ list: [], currentPage: 1, // 褰撳墠椤� pageSize: 16, // 涓�椤�16鏉� - total: '', + total: "", loading: true, // 缁勪欢loading鐨勫睍绀�,榛樿涓簍rue finishLoding: false, // 鍔犺浇瀹屾垚锛屾樉绀哄凡缁忔病鏈夋洿澶氫簡 keyMap: {}, - laboratoryNameIsNull: false, - } + laboratoryNameIsNull: false + }; }, created() { - this.selectEnumByCategory() + this.selectEnumByCategory(); this.keyMap = {}; this.currentPage = 1; this.list = []; - this.clickSidebar(this.clickNodeVal) + this.clickSidebar(this.clickNodeVal); }, methods: { refreshTable() { - const key = `_${this.currentPage}` - const value = this.keyMap[key] + const key = `_${this.currentPage}`; + const value = this.keyMap[key]; // 濡傛灉value瀛樺湪锛岃〃绀虹紦瀛樻湁鍊硷紝閭d箞闃绘璇锋眰 if (value) { - return + return; } // value涓嶅瓨鍦紝琛ㄧず绗竴娆¤姹�,璁剧疆鍗犱綅 - this.keyMap[key] = 'temp' + this.keyMap[key] = "temp"; if (this.currentPage == 1) { - this.loading = true + this.loading = true; } - if(this.list.length==0){ - this.finishLoding = false; - } - this.$axios.post(this.$api.deviceScope.selectDeviceParameter + "?laboratoryNameIsNull=" + this.laboratoryNameIsNull, { - page: { - current: this.currentPage, - size: this.pageSize - }, - entity: this.entity - }, { - headers: { - 'Content-Type': 'application/json' - } - }).then(res => { - if (res.code == 200) { - this.total = res.data.body.total - let list = res.data.body.records.map(m => { - switch (m.deviceStatus) { - case 0: - // 姝e父 - m.type = 'success' - break; - case 1: - // 缁翠慨 - m.type = 'warning' - break; - case 2: - // 鍋滅敤 - m.type = 'danger' - break; - case 3: - // 鎶ュ簾 - m.type = 'info' - break; + if (this.list.length == 0) { + this.finishLoding = false; + } + this.$axios + .post( + this.$api.deviceScope.selectDeviceParameter + + "?laboratoryNameIsNull=" + + this.laboratoryNameIsNull, + { + page: { + current: this.currentPage, + size: this.pageSize + }, + entity: this.entity + }, + { + headers: { + "Content-Type": "application/json" } - this.options.forEach(j => { - if (m.deviceStatus == j.value) { - m.deviceStatusName = j.label - } - }) - return m; - }) - if (list.length == 0) { - this.finishLoding = true; - } else { - if (list.length < this.pageSize) { - this.finishLoding = true; - } - this.list = this.list.concat(list) - if (this.total == this.list.length) { - this.finishLoding = true; - } - this.currentPage++; } - } - this.loading = false - }) + ) + .then(res => { + if (res.code == 200) { + this.total = res.data.body.total; + let list = res.data.body.records.map(m => { + switch (m.deviceStatus) { + case 0: + // 姝e父 + m.type = "success"; + break; + case 1: + // 缁翠慨 + m.type = "warning"; + break; + case 2: + // 鍋滅敤 + m.type = "danger"; + break; + case 3: + // 鎶ュ簾 + m.type = "info"; + break; + } + this.options.forEach(j => { + if (m.deviceStatus == j.value) { + m.deviceStatusName = j.label; + } + }); + return m; + }); + if (list.length == 0) { + this.finishLoding = true; + } else { + if (list.length < this.pageSize) { + this.finishLoding = true; + } + this.list = this.list.concat(list); + if (this.total == this.list.length) { + this.finishLoding = true; + } + this.currentPage++; + } + } + this.loading = false; + }); }, refresh() { this.keyMap = {}; @@ -355,44 +409,46 @@ deviceName: null, orderBy: { field: "id", order: "asc" } }; - this.refreshTable() + this.refreshTable(); }, // 鑾峰彇瀛楀吀 selectEnumByCategory() { - this.$axios.post(this.$api.enums.selectEnumByCategory, { - category: "璁惧鐘舵��" - }).then(res => { - this.options = res.data - }) + this.$axios + .post(this.$api.enums.selectEnumByCategory, { + category: "璁惧鐘舵��" + }) + .then(res => { + this.options = res.data; + }); }, // 鐐瑰嚮渚ц竟鏍忓埛鏂� clickSidebar(clickNodeVal) { - this.laboratoryNameIsNull = false + this.laboratoryNameIsNull = false; // 鏄惁瀛樺湪value锛屽瓨鍦╲alue浠h〃涓轰笁绾� if (!clickNodeVal.value) { this.finishLoding = false; this.keyMap = {}; this.currentPage = 1; this.list = []; - this.entity.laboratoryName = null - this.entity.storagePoint = null + this.entity.laboratoryName = null; + this.entity.storagePoint = null; // 绛変簬1浠h〃涓烘爲鐨勪竴绾э紝label涓洪儴闂� - if (clickNodeVal.label == '鍏朵粬') { - this.laboratoryNameIsNull = true + if (clickNodeVal.label == "鍏朵粬") { + this.laboratoryNameIsNull = true; this.refreshTable(); - return + return; } if (clickNodeVal.level == 1) { - this.entity.laboratoryName = clickNodeVal.label + this.entity.laboratoryName = clickNodeVal.label; // 绛変簬浜岀骇銆俵abel涓哄瓨鍌ㄥ湴鐐� } else if (clickNodeVal.level == 2) { // 鍏朵粬琛ㄧず娌℃湁閰嶇疆瀹為獙瀹わ紝鍙厤缃簡鍦扮偣 - if (clickNodeVal.parent.label == '鍏朵粬') { - this.laboratoryNameIsNull = true + if (clickNodeVal.parent.label == "鍏朵粬") { + this.laboratoryNameIsNull = true; } else { - this.entity.laboratoryName = clickNodeVal.parent.label + this.entity.laboratoryName = clickNodeVal.parent.label; } - this.entity.storagePoint = clickNodeVal.label + this.entity.storagePoint = clickNodeVal.label; } this.refreshTable(); } @@ -401,8 +457,8 @@ watch: { // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊 clickNodeVal(newVal) { - this.clickSidebar(newVal) + this.clickSidebar(newVal); } } -} +}; </script> -- Gitblit v1.9.3