|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
class="AddDialogBox"
|
|
|
|
|
:title="title"
|
|
|
|
|
:visible.sync="filedDialogshow"
|
|
|
|
|
width="520px"
|
|
|
|
|
width="820px"
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
>
|
|
|
|
|
<div class="filedInfo">
|
|
|
|
@ -37,7 +37,9 @@
|
|
|
|
|
<div class="coltitle">
|
|
|
|
|
<span>表字段</span>
|
|
|
|
|
<span>导出字段</span>
|
|
|
|
|
<span>拆分sensorCode附加值</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
class="selectCol"
|
|
|
|
|
v-for="(item, index) in colData"
|
|
|
|
@ -55,6 +57,12 @@
|
|
|
|
|
placeholder="请输入值"
|
|
|
|
|
type="text"
|
|
|
|
|
></el-input>
|
|
|
|
|
<el-input
|
|
|
|
|
:disabled="!item.selected"
|
|
|
|
|
v-model="item.attachVal"
|
|
|
|
|
placeholder="请输入值"
|
|
|
|
|
type="text"
|
|
|
|
|
></el-input>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|