优化低版本?.

newCac1.0
fanluyan 6 months ago
parent 23cbc8cc4e
commit 9c716e7a1b

@ -4,7 +4,7 @@
class="AddDialogBox" class="AddDialogBox"
:title="title" :title="title"
:visible.sync="filedDialogshow" :visible.sync="filedDialogshow"
width="520px" width="820px"
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<div class="filedInfo"> <div class="filedInfo">
@ -37,7 +37,9 @@
<div class="coltitle"> <div class="coltitle">
<span>表字段</span> <span>表字段</span>
<span>导出字段</span> <span>导出字段</span>
<span>拆分sensorCode附加值</span>
</div> </div>
<div <div
class="selectCol" class="selectCol"
v-for="(item, index) in colData" v-for="(item, index) in colData"
@ -55,6 +57,12 @@
placeholder="请输入值" placeholder="请输入值"
type="text" type="text"
></el-input> ></el-input>
<el-input
:disabled="!item.selected"
v-model="item.attachVal"
placeholder="请输入值"
type="text"
></el-input>
</div> </div>
</div> </div>
</div> </div>
@ -113,12 +121,14 @@ export default {
(item) => (item) =>
item.hasOwnProperty("value") && item.hasOwnProperty("value") &&
item.hasOwnProperty("name") && // name item.hasOwnProperty("name") && // name
item.value !== "" && // name item.value !== "" &&
// name
item.selected // valueundefinednull item.selected // valueundefinednull
) // valuename ) // valuename
.map((item) => ({ .map((item) => ({
destFieldName: item.value, destFieldName: item.value,
fieldName: item.name, fieldName: item.name,
attach: item.attachVal,
})); }));
let params = { let params = {
tablename: this.selectTableName, tablename: this.selectTableName,
@ -162,6 +172,7 @@ export default {
.map((item) => ({ .map((item) => ({
destFieldName: item.value, destFieldName: item.value,
fieldName: item.name, fieldName: item.name,
attach: item.attachVal,
})); }));
let params = { let params = {
tablename: this.selectTableName, tablename: this.selectTableName,
@ -242,8 +253,10 @@ export default {
// checkbox input // checkbox input
if (item.selected && !item.value) { if (item.selected && !item.value) {
item.value = item.name; // item.value = item.name; //
item.attachVal = item.attach;
} else { } else {
item.value = ""; item.value = "";
item.attachVal = "";
} }
console.log(this.colData); console.log(this.colData);
}, },
@ -270,6 +283,7 @@ export default {
...item, // 使 ...item, // 使
selected: false, // selectedfalse selected: false, // selectedfalse
value: "", // value value: "", // value
attachVal: "", // attachVal
})); }));
if (this.title == "新增字段导出映射") { if (this.title == "新增字段导出映射") {
this.colData = [...this.colAllData]; // 使 this.colData = [...this.colAllData]; // 使
@ -281,6 +295,7 @@ export default {
// selected true // selected true
colDataItem.selected = true; colDataItem.selected = true;
colDataItem.value = syncField.destFieldName; colDataItem.value = syncField.destFieldName;
colDataItem.attachVal = syncField.attach;
// value colDataItem this.colAllData // value colDataItem this.colAllData
// //
// colDataItem.value = this.curdata; // curdata // colDataItem.value = this.curdata; // curdata
@ -328,11 +343,15 @@ export default {
span { span {
font-weight: bold; font-weight: bold;
&:first-child { &:first-child {
width: 40%; width: 30%;
margin-right: 24px;
}
&:nth-child(2) {
width: 30%;
margin-right: 24px; margin-right: 24px;
} }
&:last-child { &:last-child {
width: 50%; width: 30%;
} }
} }
} }
@ -341,11 +360,12 @@ export default {
align-items: center; align-items: center;
margin-bottom: 10px; margin-bottom: 10px;
.el-checkbox { .el-checkbox {
width: 40%; width: 30%;
margin-right: 24px; margin-right: 24px;
} }
.el-input { .el-input {
width: 50%; width: 30%;
margin-right: 24px;
} }
} }
} }

@ -25,6 +25,8 @@
</el-table-column> </el-table-column>
<el-table-column prop="destFieldName" label="导出字段"> <el-table-column prop="destFieldName" label="导出字段">
</el-table-column> </el-table-column>
<el-table-column prop="attach" label="拆分sensorCode附加值">
</el-table-column>
</el-table> </el-table>
</template> </template>
</el-table-column> </el-table-column>

@ -292,9 +292,13 @@ export default {
this.ljOptions = res.data; this.ljOptions = res.data;
console.log("获取逻辑", this.icdid); console.log("获取逻辑", this.icdid);
if (this.icdid !== null) { if (this.icdid !== null) {
this.ljName = // this.ljName =
this.ljOptions.find((item) => item.id === this.icdid) // this.ljOptions.find((item) => item.id === this.icdid)
?.paramIndex || ""; // ?.paramIndex || "";
const foundItem = this.ljOptions.find(
(item) => item.id === this.icdid
);
this.ljName = foundItem ? foundItem.paramIndex : "";
if (this.ljName !== "") { if (this.ljName !== "") {
this.getlistRpt(this.ljName); this.getlistRpt(this.ljName);
} }

Loading…
Cancel
Save