From 3c510ea35b428feed7f7a1743a595e7dba634518 Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期三, 16 四月 2025 15:50:45 +0800 Subject: [PATCH] 网络分析仪数采配置 --- src/views/CNAS/resourceDemand/device/component/management.vue | 123 +++++++++++++++++++++++----------------- 1 files changed, 71 insertions(+), 52 deletions(-) diff --git a/src/views/CNAS/resourceDemand/device/component/management.vue b/src/views/CNAS/resourceDemand/device/component/management.vue index b5b83c1..649138e 100644 --- a/src/views/CNAS/resourceDemand/device/component/management.vue +++ b/src/views/CNAS/resourceDemand/device/component/management.vue @@ -1,35 +1,40 @@ <!-- 璁惧宸ュ叿鏄庣粏 --> <template> <div class="role_manage"> - <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" 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()"></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> - <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="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> + <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 - 300px)'" :page="page" @pagination="pagination"></lims-table> @@ -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 }) @@ -991,10 +1008,10 @@ <style scoped> .search { - height: 46px; - display: flex; - justify-content: space-between; - margin-top: 10px; + height: 46px; + display: flex; + justify-content: space-between; + margin-top: 10px; } .search_thing { @@ -1013,6 +1030,7 @@ background-color: #fff; height: calc(100vh - 16em); } + .picName { overflow: hidden; text-overflow: ellipsis; @@ -1020,7 +1038,8 @@ word-break: break-all; width: 120px; } -.form-item >>>.el-form-item__content { - width: 120px; + +.form-item>>>.el-form-item__content { + width: 120px; } </style> -- Gitblit v1.9.3