From 9c716e7a1bbc573d849cd1af3ace3686419e4c60 Mon Sep 17 00:00:00 2001
From: fanluyan <754122931@qq.com>
Date: Mon, 9 Dec 2024 11:40:22 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BD=8E=E7=89=88=E6=9C=AC?=
=?UTF-8?q?=EF=BC=9F.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../filed/components/addfiledDialog.vue | 32 +++++++++++++++----
src/views/I2config/filed/index.vue | 2 ++
src/views/rptparam/index.vue | 10 ++++--
3 files changed, 35 insertions(+), 9 deletions(-)
diff --git a/src/views/I2config/filed/components/addfiledDialog.vue b/src/views/I2config/filed/components/addfiledDialog.vue
index 77c6c545..80ce0a78 100644
--- a/src/views/I2config/filed/components/addfiledDialog.vue
+++ b/src/views/I2config/filed/components/addfiledDialog.vue
@@ -4,7 +4,7 @@
class="AddDialogBox"
:title="title"
:visible.sync="filedDialogshow"
- width="520px"
+ width="820px"
:close-on-click-modal="false"
>
@@ -37,7 +37,9 @@
表字段
导出字段
+ 拆分sensorCode附加值
+
+
@@ -113,12 +121,14 @@ export default {
(item) =>
item.hasOwnProperty("value") &&
item.hasOwnProperty("name") && // 确保有name属性
- item.value !== "" && // 确保有name属性
+ item.value !== "" &&
+ // 确保有name属性
item.selected // 并且value为空字符串、undefined或null
) // 过滤出有value和name属性的项
.map((item) => ({
destFieldName: item.value,
fieldName: item.name,
+ attach: item.attachVal,
}));
let params = {
tablename: this.selectTableName,
@@ -162,6 +172,7 @@ export default {
.map((item) => ({
destFieldName: item.value,
fieldName: item.name,
+ attach: item.attachVal,
}));
let params = {
tablename: this.selectTableName,
@@ -242,8 +253,10 @@ export default {
// 如果 checkbox 被选中,并且 input 没有值,则设置初始值
if (item.selected && !item.value) {
item.value = item.name; // 或者其他默认值
+ item.attachVal = item.attach;
} else {
item.value = "";
+ item.attachVal = "";
}
console.log(this.colData);
},
@@ -270,6 +283,7 @@ export default {
...item, // 使用展开运算符保持原有属性
selected: false, // 添加selected属性并初始化为false
value: "", // 添加value属性并初始化为空字符串
+ attachVal: "", // 添加attachVal属性并初始化为空字符串
}));
if (this.title == "新增字段导出映射") {
this.colData = [...this.colAllData]; // 使用展开运算符创建数据的浅拷贝
@@ -281,6 +295,7 @@ export default {
// 添加 selected 属性并设置为 true
colDataItem.selected = true;
colDataItem.value = syncField.destFieldName;
+ colDataItem.attachVal = syncField.attach;
// 这里不需要设置 value,因为 colDataItem 已经是 this.colAllData 的一部分
// 但如果需要关联原始数据,可以设置一个属性来引用它
// colDataItem.value = this.curdata; // 注意:这样可能会引用整个 curdata 对象,可能不是您想要的
@@ -328,11 +343,15 @@ export default {
span {
font-weight: bold;
&:first-child {
- width: 40%;
+ width: 30%;
+ margin-right: 24px;
+ }
+ &:nth-child(2) {
+ width: 30%;
margin-right: 24px;
}
&:last-child {
- width: 50%;
+ width: 30%;
}
}
}
@@ -341,11 +360,12 @@ export default {
align-items: center;
margin-bottom: 10px;
.el-checkbox {
- width: 40%;
+ width: 30%;
margin-right: 24px;
}
.el-input {
- width: 50%;
+ width: 30%;
+ margin-right: 24px;
}
}
}
diff --git a/src/views/I2config/filed/index.vue b/src/views/I2config/filed/index.vue
index f37c793a..1c83d3b4 100644
--- a/src/views/I2config/filed/index.vue
+++ b/src/views/I2config/filed/index.vue
@@ -25,6 +25,8 @@
+
+
diff --git a/src/views/rptparam/index.vue b/src/views/rptparam/index.vue
index d73aa129..d9ffef32 100644
--- a/src/views/rptparam/index.vue
+++ b/src/views/rptparam/index.vue
@@ -292,9 +292,13 @@ export default {
this.ljOptions = res.data;
console.log("获取逻辑", this.icdid);
if (this.icdid !== null) {
- this.ljName =
- this.ljOptions.find((item) => item.id === this.icdid)
- ?.paramIndex || "";
+ // this.ljName =
+ // this.ljOptions.find((item) => item.id === this.icdid)
+ // ?.paramIndex || "";
+ const foundItem = this.ljOptions.find(
+ (item) => item.id === this.icdid
+ );
+ this.ljName = foundItem ? foundItem.paramIndex : "";
if (this.ljName !== "") {
this.getlistRpt(this.ljName);
}