From 3a05fd672f3cf6fcd847e28d93ad3e3b9c01fea2 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期三, 16 四月 2025 15:58:32 +0800
Subject: [PATCH] 网络分析仪

---
 src/views/CNAS/resourceDemand/device/component/management.vue |  127 +++++++++++++++++++++--------------------
 1 files changed, 65 insertions(+), 62 deletions(-)

diff --git a/src/views/CNAS/resourceDemand/device/component/management.vue b/src/views/CNAS/resourceDemand/device/component/management.vue
index 51a4a27..649138e 100644
--- a/src/views/CNAS/resourceDemand/device/component/management.vue
+++ b/src/views/CNAS/resourceDemand/device/component/management.vue
@@ -1,37 +1,42 @@
 <!-- 璁惧宸ュ叿鏄庣粏 -->
 <template>
 	<div class="role_manage">
-		<div class="search" v-show="!showData">
-			<div class="search_thing">
-				<div class="search_label">鐘舵�侊細</div>
-				<el-select v-model="queryParams.deviceStatus" placeholder="鍏ㄩ儴" size="small">
-					<el-option v-for="item in deviceStatusList" :key="item.value" :label="item.label" :value="item.value">
-					</el-option>
-				</el-select>
+		<div class="search">
+			<div>
+				<el-form :model="queryParams" ref="queryParams" size="small" :inline="true">
+					<el-form-item label="鐘舵��" prop="deviceStatus" class="form-item">
+						<el-select v-model="queryParams.deviceStatus" placeholder="鍏ㄩ儴" size="small">
+							<el-option v-for="item in deviceStatusList" :key="item.value" :label="item.label" :value="item.value">
+							</el-option>
+						</el-select>
+					</el-form-item>
+					<el-form-item label="璁惧鍚嶇О" prop="deviceName">
+						<el-input size="small" style="width: 160px;" placeholder="璇疯緭鍏�" clearable v-model="queryParams.deviceName"
+							@keyup.enter.native="refreshTable()">
+						</el-input>
+					</el-form-item>
+					<el-form-item label="瑙勬牸鍨嬪彿" prop="specificationModel">
+						<el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.specificationModel"
+							@keyup.enter.native="refreshTable()" style="width: 160px;"></el-input>
+					</el-form-item>
+					<el-form-item>
+						<el-button type="primary" size="mini" @click="refreshTable">鏌ヨ</el-button>
+						<el-button size="mini" @click="refresh">閲嶇疆</el-button>
+					</el-form-item>
+				</el-form>
 			</div>
-			<div class="search_thing">
-				<div class="search_label">璁惧鍚嶇О锛�</div>
-				<div class="search_input">
-					<el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.deviceName"
-						@keyup.enter.native="refreshTable()">
-					</el-input>
-				</div>
-			</div>
-			<div class="search_thing">
-				<div class="search_label">瑙勬牸鍨嬪彿锛�</div>
-				<div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
-						v-model="queryParams.specificationModel" @keyup.enter.native="refreshTable()"></el-input>
-				</div>
-			</div>
-			<div style="padding-left: 30px;">
-				<el-button size="mini" type="primary" @click="refreshTable()">鏌ヨ</el-button>
-				<el-button size="mini" @click="refresh()">閲嶇疆</el-button>
+			<div>
+				<el-upload ref='upload' style="display: inline;margin-right: 8px" :action="uploadAction"
+					:before-upload="beforeUpload" :headers="uploadHeader" :on-error="onError" :on-success="handleSuccessUp"
+					:show-file-list="false" accept='.xls,.xlsx'>
+					<el-button size="small" type="primary">瀵煎叆</el-button>
+				</el-upload>
 				<el-button size="small" type="primary" @click="dialogVisible2 = true">鏂板</el-button>
 				<el-button size="small" type="primary" @click="handleDownOne">瀵煎嚭</el-button>
 			</div>
 		</div>
 		<div class="table" v-show="!showData">
-			<lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 320px)'"
+			<lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 300px)'"
 				:page="page" @pagination="pagination"></lims-table>
 		</div>
 		<el-dialog :title="isUp ? '璁惧璇︽儏' : '妗f淇'" :visible.sync="dialogVisible" width="70%" top="5vh"
@@ -382,7 +387,7 @@
 				</el-row>
 			</span>
 		</el-dialog>
-		<dataAcquisitionConfig v-if="showData" :deviceId="deviceId" />
+		<dataAcquisitionConfig v-if="showData" :deviceId="deviceId" :deviceName="deviceName" />
 	</div>
 </template>
 
@@ -415,8 +420,10 @@
 	},
 	data() {
 		return {
+			uploadAction: process.env.VUE_APP_BASE_API + '/deviceScope/importDevice',
 			dateFormat: 'yyyy-MM-dd',
 			deviceId: '',
+			deviceName: '',
 			fileTypeOptions: [
 				{ label: 'csv', value: '.csv' },
 				{ label: 'db', value: '.db' },
@@ -484,25 +491,25 @@
 				{ label: "鎵�灞為儴闂�", prop: "laboratoryName" },
 				{ label: "妫�楠岄」鐩�", prop: "insProductItem" },
 				{ label: "鏍″噯鏈嶅姟鏈烘瀯", prop: "calibrationServices" },
-				{ label: "鏈�杩戞牎鍑嗘棩鏈�", prop: "lastCalibrationDateTwo" },
-				{ label: "鏈�杩戞牳鏌ユ棩鏈�", prop: "lastCalibrationDate" },
-				{ label: "涓嬫鏍″噯鏃ユ湡", prop: "nextCalibrationDateTwo" },
-				{ label: "涓嬫鏍告煡鏃ユ湡", prop: "nextCalibrationDate" },
+				{ label: "鏈�杩戞牎鍑嗘棩鏈�", prop: "lastCalibrationDate" },
+				{ label: "鏈�杩戞牳鏌ユ棩鏈�", prop: "lastCalibrationDateTwo" },
+				{ label: "涓嬫鏍″噯鏃ユ湡", prop: "nextCalibrationDate" },
+				{ label: "涓嬫鏍告煡鏃ユ湡", prop: "nextCalibrationDateTwo" },
 				{
 					label: "璁惧鍒嗙被", prop: "largeCategory", dataType: "tag",
 					formatData: (params) => {
-            if (this.equipmentList.find(m => m.value == params)) {
-						  return this.equipmentList.find(m => m.value == params).label
-            } else {
-              return null
-            }
+						if (this.equipmentList.find(m => m.value == params)) {
+							return this.equipmentList.find(m => m.value == params).label
+						} else {
+							return null
+						}
 					},
 					formatType: (params) => {
-            if (this.equipmentList.find(m => m.value == params)) {
-              return this.equipmentList.find(m => m.value == params).type
-            } else {
-              return null
-            }
+						if (this.equipmentList.find(m => m.value == params)) {
+							return this.equipmentList.find(m => m.value == params).type
+						} else {
+							return null
+						}
 					}
 				},
 				{ label: "鍗曚环", prop: "unitPrice" },
@@ -765,6 +772,15 @@
 				})
 			}
 		},
+		handleSuccessUp(response, file, fileList) {
+			this.$refs.upload.clearFiles()
+			if (response.code !== 200) {
+				this.$message.error(response.msg)
+				return
+			}
+			this.$message.success('涓婁紶鎴愬姛')
+			this.refreshTable()
+		},
 		submitForm() {
 			if (!this.formData.deviceName) {
 				this.$message.error('鏈緭鍏ヤ华鍣ㄥ悕绉�')
@@ -804,7 +820,7 @@
 			delete this.formData.updateUser
 			const formData = this.HaveJson(this.formData)
 			formData.insProductIds = formData.insProductIds ? formData.insProductIds.join() : ''
-			if (formData.authorizedPerson.length === 0) {
+			if (!formData.authorizedPerson || formData.authorizedPerson.length === 0) {
 				formData.authorizedPerson = ''
 			} else {
 				formData.authorizedPerson = JSON.stringify(formData.authorizedPerson)
@@ -853,7 +869,7 @@
 			}
 			const formData = this.HaveJson(this.formData2)
 			formData.insProductIds = formData.insProductIds ? formData.insProductIds.join() : ''
-			if (formData.authorizedPerson.length === 0) {
+			if (!formData.authorizedPerson || formData.authorizedPerson.length === 0) {
 				formData.authorizedPerson = ''
 			} else {
 				formData.authorizedPerson = JSON.stringify(formData.authorizedPerson)
@@ -890,6 +906,7 @@
 			})
 			this.tableList = list2
 			this.deviceId = row.id
+			this.deviceName = row.deviceName
 			this.$nextTick(() => {
 				this.showData = true
 			})
@@ -990,18 +1007,9 @@
 </script>
 
 <style scoped>
-.role_manage {
-	width: 100%;
-	height: 100%;
-}
-
-.title {
-	line-height: 15px;
-}
-
 .search {
+	height: 46px;
 	display: flex;
-	align-items: center;
 	justify-content: space-between;
 	margin-top: 10px;
 }
@@ -1018,18 +1026,9 @@
 	text-align: right;
 }
 
-.search_input {
-	width: calc(100% - 80px);
-}
-
 .table {
-	margin-top: 12px;
 	background-color: #fff;
-	height: calc(100vh - 17em);
-}
-
-.el-form-item {
-	margin-bottom: 16px;
+	height: calc(100vh - 16em);
 }
 
 .picName {
@@ -1039,4 +1038,8 @@
 	word-break: break-all;
 	width: 120px;
 }
+
+.form-item>>>.el-form-item__content {
+	width: 120px;
+}
 </style>

--
Gitblit v1.9.3