From 6f54db5fe118a17c5eb75c7e67abfd27534e4227 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 29 三月 2025 15:13:40 +0800
Subject: [PATCH] 设备工具明细-数采配置显示bug
---
src/api/cnas/resourceDemand/device.js | 26 +++++
src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue | 229 +++++++--------------------------------------
2 files changed, 61 insertions(+), 194 deletions(-)
diff --git a/src/api/cnas/resourceDemand/device.js b/src/api/cnas/resourceDemand/device.js
index 400a1ec..adb7ee4 100644
--- a/src/api/cnas/resourceDemand/device.js
+++ b/src/api/cnas/resourceDemand/device.js
@@ -92,10 +92,18 @@
});
}
-//鏌ヨ鏁伴噰閰嶇疆
+// 鏌ヨ鏁伴噰閰嶇疆
export function queryDataAcquisitionConfiguration(query) {
return request({
url: "/deviceScope/queryDataAcquisitionConfiguration",
+ method: "get",
+ params: query,
+ });
+}
+// 鏌ヨ鏁伴噰閰嶇疆
+export function queryProductConfiguration(query) {
+ return request({
+ url: "/deviceScope/queryProductConfiguration",
method: "get",
params: query,
});
@@ -105,6 +113,14 @@
export function saveDataAcquisitionConfiguration(data) {
return request({
url: "/deviceScope/saveDataAcquisitionConfiguration",
+ method: "post",
+ data: data,
+ });
+}
+// 缁存姢鏂囦欢閰嶇疆
+export function saveDeviceFileConfiguration(data) {
+ return request({
+ url: "/deviceScope/saveDeviceFileConfiguration",
method: "post",
data: data,
});
@@ -1243,3 +1259,11 @@
params: query,
});
}
+//浣滀笟鎸囧涔� 鏌ヨ
+export function getDeviceById(query) {
+ return request({
+ url: "/deviceScope/getDeviceById",
+ method: "get",
+ params: query,
+ });
+}
diff --git a/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue b/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue
index 38a545c..37468d6 100644
--- a/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue
+++ b/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue
@@ -14,15 +14,9 @@
<div class="table">
<el-table :data="tableList.slice((page.current - 1) * page.size,page.current * page.size)"
:header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border
- tooltip-effect="dark" height="100%" :span-method="spanMethod">
+ tooltip-effect="dark" height="100%">
<el-table-column type="index" label="搴忓彿" align="center" width="65"></el-table-column>
<el-table-column prop="deviceName" align="center" min-width="100" label="璁惧鍚嶇О"></el-table-column>
- <el-table-column prop="fileType" align="center" label="鏂囦欢鍚庣紑"></el-table-column>
- <el-table-column prop="collectUrl" align="center" min-width="100" show-overflow-tooltip
- label="閲囬泦鍦板潃"></el-table-column>
- <el-table-column prop="storageUrl" align="center" min-width="100" show-overflow-tooltip
- label="瀛樺偍鍦板潃"></el-table-column>
- <el-table-column prop="ip" align="center" label="IP鍦板潃" min-width="100"></el-table-column>
<el-table-column prop="sample" align="center" label="妫�楠屽璞�" show-overflow-tooltip
min-width="150"></el-table-column>
<el-table-column prop="inspectionItemClass" align="center" label="妫�楠岄」鍒嗙被" min-width="120"></el-table-column>
@@ -117,7 +111,7 @@
</el-row>
</span>
</el-dialog>
- <el-dialog title="鏁伴噰閰嶇疆" :visible.sync="dialogVisible4" width="400px">
+ <el-dialog title="鏂囦欢閰嶇疆" :visible.sync="dialogVisible4" width="400px">
<div class="search_thing" style="margin-bottom: 14px;">
<div class="search_label">
<span style="color:red;margin-right: 4px;">*</span>IP锛�
@@ -169,7 +163,7 @@
import {
queryDataAcquisitionConfiguration,
saveDataAcquisitionConfiguration,
- deleteDataAcquisitionConfiguration,
+ deleteDataAcquisitionConfiguration, getDeviceById, saveDeviceFileConfiguration, queryProductConfiguration,
} from '@/api/cnas/resourceDemand/device.js'
export default {
name: "dataAcquisitionConfig",
@@ -180,9 +174,6 @@
type: Number,
default: () => []
}
- },
- mounted() {
- this.init();
},
data() {
// 杩欓噷瀛樻斁鏁版嵁
@@ -298,107 +289,14 @@
deleteList: []
};
},
+ mounted() {
+ this.init();
+ },
// 鏂规硶闆嗗悎
methods: {
- getIndexWithAlphabet(index) {
- const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
- const letterIndex = index % 26;
- return alphabet.charAt(letterIndex) + (index + 1);
- },
- rowspan(spanArr, position, spanName) {
- this.tableList.forEach((item, index) => {
- if (index === 0) {
- spanArr.push(1);
- position = 0;
- } else {
- if (
- this.tableList[index][spanName] ===
- this.tableList[index - 1][spanName]
- ) {
- spanArr[position] += 1;
- spanArr.push(0);
- } else {
- spanArr.push(1);
- position = index;
- }
- }
- });
- },
- spanMethod({ row, column, rowIndex, columnIndex }) {
- // 涓�鑸殑鍚堝苟琛�
- if (
- this.spanConfig != undefined &&
- this.spanConfig.rows &&
- this.spanConfig.rows.length > 0
- ) {
- let i = null;
- let obj = this.spanConfig.rows.find((item, index) => {
- i = index;
- return item.index == columnIndex;
- });
- if (obj) {
- const _row = this.spanList[i].arr[rowIndex];
- const _col = _row > 0 ? 1 : 0;
- return {
- rowspan: _row,
- colspan: _col
- };
- }
- }
- // 鐗规畩鐨勫悎骞惰
- if (
- this.spanConfig != undefined &&
- this.spanConfig.special &&
- this.spanConfig.special.main &&
- this.spanConfig.special.rows &&
- this.spanConfig.special.rows.length > 0
- ) {
- let i = null;
- let obj = this.spanConfig.special.rows.find((item, index) => {
- i = index;
- return item.index == columnIndex;
- });
- if (obj) {
- const _row = this.specialSpanList[i].arr[rowIndex];
- const _col = _row > 0 ? 1 : 0;
- return {
- rowspan: _row,
- colspan: _col
- };
- }
- }
- },
- fileConfiguration() {
- this.dialogVisible4 = true;
- if (this.tableList[0]) {
- this.$set(this.configForm, "fileType", this.tableList[0].fileType);
- this.$set(this.configForm, "collectUrl", this.tableList[0].collectUrl);
- this.$set(this.configForm, "storageUrl", this.tableList[0].storageUrl);
- this.$set(this.configForm, "ip", this.tableList[0].ip);
- this.$set(
- this.configForm,
- "entrustCode",
- this.tableList[0].entrustCode
- );
- this.$set(
- this.configForm,
- "sampleCode",
- this.tableList[0].sampleCode
- );
- this.$set(
- this.configForm,
- "dbFileName",
- this.tableList[0].dbFileName
- );
- this.$set(
- this.configForm,
- "fiberOpticRibbon",
- this.tableList[0].fiberOpticRibbon
- )
- }
- },
+ // 鏌ヨ鍒楄〃
init() {
- queryDataAcquisitionConfiguration({ deviceId: this.deviceId, isDevice: false }).then(res => {
+ queryDataAcquisitionConfiguration({ deviceId: this.deviceId }).then(res => {
this.tableList = res.data;
this.tableList.forEach(i => {
let isIncludes = false
@@ -412,88 +310,33 @@
if (!isIncludes && i.formula) {
i.formula = i.formula.slice(1, -1)
}
- i.sample = i.sample
- .replace(/"/g, "")
- .replace(/],/g, "锛�")
- .replace(/\[/g, "")
- .replace(/]/g, "");
});
- if (this.tableList[0]) {
- this.$set(this.configForm, "fileType", this.tableList[0].fileType);
- this.$set(
- this.configForm,
- "collectUrl",
- this.tableList[0].collectUrl
- );
- this.$set(
- this.configForm,
- "storageUrl",
- this.tableList[0].storageUrl
- );
- this.$set(this.configForm, "ip", this.tableList[0].ip);
- this.$set(
- this.configForm,
- "entrustCode",
- this.tableList[0].entrustCode
- );
- this.$set(
- this.configForm,
- "sampleCode",
- this.tableList[0].sampleCode
- );
- this.$set(
- this.configForm,
- "dbFileName",
- this.tableList[0].dbFileName
- );
- this.$set(
- this.configForm,
- "fiberOpticRibbon",
- this.tableList[0].fiberOpticRibbon
- )
- }
- // 涓�鑸殑鍚堝苟琛�
- if (
- this.spanConfig != undefined &&
- this.spanConfig.rows &&
- this.spanConfig.rows.length > 0
- ) {
- this.spanList = [];
- this.spanConfig.rows.forEach((item, index) => {
- this.spanList.push({
- arr: [],
- position: 0
- });
- this.rowspan(
- this.spanList[index].arr,
- this.spanList[index].position,
- item.name
- );
- });
- }
- // 鐗规畩鐨勫悎骞惰
- if (
- this.spanConfig != undefined &&
- this.spanConfig.special &&
- this.spanConfig.special.main &&
- this.spanConfig.special.rows &&
- this.spanConfig.special.rows.length > 0
- ) {
- this.specialSpanList = [];
- this.spanConfig.special.rows.forEach((item, index) => {
- this.specialSpanList.push({
- arr: [],
- position: 0
- });
- this.rowspan(
- this.specialSpanList[index].arr,
- this.specialSpanList[index].position,
- this.spanConfig.special.main
- );
- });
- }
+
});
},
+ getIndexWithAlphabet(index) {
+ const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+ const letterIndex = index % 26;
+ return alphabet.charAt(letterIndex) + (index + 1);
+ },
+ fileConfiguration() {
+ this.dialogVisible4 = true;
+ this.getInfo()
+ },
+ // 鏌ヨ鏂囦欢閰嶇疆淇℃伅
+ getInfo() {
+ getDeviceById({deviceId: this.deviceId}).then(res => {
+ this.$set(this.configForm, "fileType", res.data.fileType);
+ this.$set(this.configForm, "collectUrl", res.data.collectUrl);
+ this.$set(this.configForm, "storageUrl", res.data.storageUrl);
+ this.$set(this.configForm, "ip", res.data.ip);
+ this.$set(this.configForm, "entrustCode", res.data.entrustCode);
+ this.$set(this.configForm, "sampleCode", res.data.sampleCode);
+ this.$set(this.configForm, "dbFileName", res.data.dbFileName);
+ this.$set(this.configForm, "fiberOpticRibbon", res.data.fiberOpticRibbon)
+ })
+ },
+ // 鎻愪氦鏂囦欢閰嶇疆
submitForm4() {
const obj = Object.assign({
deviceId: this.deviceId,
@@ -501,16 +344,14 @@
collectUrl: this.configForm.collectUrl,
storageUrl: this.configForm.storageUrl,
ip: this.configForm.ip,
- isDevice: true,
entrustCode: this.configForm.entrustCode,
sampleCode: this.configForm.sampleCode,
dbFileName: this.configForm.dbFileName,
fiberOpticRibbon: this.configForm.fiberOpticRibbon
});
this.upLoad4 = true;
- saveDataAcquisitionConfiguration({ deviceId: this.deviceId, ...obj }).then(res => {
+ saveDeviceFileConfiguration({ deviceId: this.deviceId, ...obj }).then(res => {
if (res.code == 200) {
- // this.tableList = res.data;
this.dialogVisible4 = false;
this.init();
this.$message.success("鎿嶄綔鎴愬姛");
@@ -521,6 +362,7 @@
this.upLoad4 = false;
});
},
+ // 鎵撳紑鏁伴噰閰嶇疆寮规
dataConfig(row) {
this.configForm = {
deviceId: row.deviceId,
@@ -530,7 +372,7 @@
inspectionItemClass: row.inspectionItemClass,
};
this.dialogVisible3 = true;
- queryDataAcquisitionConfiguration({
+ queryProductConfiguration({
deviceId: this.deviceId,
inspectionItem: row.inspectionItem.trim(),
isDevice: true,
@@ -570,6 +412,7 @@
}
});
},
+ // 鎻愪氦鏁伴噰閰嶇疆
submitForm3() {
this.$refs.configForm.validate(valid => {
// 琛ㄥ崟鏍¢獙
--
Gitblit v1.9.3