优化icd配置

master
fanluyan 1 year ago
parent 8735d7f7d1
commit 9565047050

@ -9,6 +9,15 @@
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<div class="colContain"> <div class="colContain">
<div class="bindBox" v-if="multipleSelection.length > 0">
<el-link
type="primary"
@click="handleBindClick()"
size="small"
icon="el-icon-connection"
>批量配置字段名</el-link
>
</div>
<el-table <el-table
v-loading="colLoading" v-loading="colLoading"
:data="attTableList" :data="attTableList"
@ -16,7 +25,9 @@
border border
style="width: 100%" style="width: 100%"
height="calc(100% - 0px)" height="calc(100% - 0px)"
@selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column prop="doName" label="属性(备注)"> <el-table-column prop="doName" label="属性(备注)">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.doName }} ({{ scope.row.description }})</span> <span>{{ scope.row.doName }} ({{ scope.row.description }})</span>
@ -58,6 +69,7 @@
@click="handlecolEditClick(scope)" @click="handlecolEditClick(scope)"
size="small" size="small"
icon="el-icon-document" icon="el-icon-document"
:disabled="multipleSelection.length > 0"
> >
配置字段名 配置字段名
</el-link> </el-link>
@ -75,12 +87,52 @@
@click="handleDeleteClick(scope.row)" @click="handleDeleteClick(scope.row)"
size="small" size="small"
icon="el-icon-delete" icon="el-icon-delete"
:disabled="multipleSelection.length > 0"
>删除</el-link >删除</el-link
> >
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<el-dialog
width="450px"
title="批量配置字段名"
:visible.sync="innerVisible"
append-to-body
class="colBlindDialog"
>
<el-form
label-position="left"
ref="formInfo"
label-width="108px"
:rules="rules"
:model="formInfo"
>
<el-form-item label="选择字段名:" prop="colName">
<el-select
filterable
v-model="formInfo.colName"
placeholder="请选择"
>
<el-option
v-for="item in colOptions"
:key="item.name"
:label="item.name"
:value="item.name"
>
{{ item.name
}}<span v-if="item.comment != '' && item.comment != null"
>({{ item.comment }})</span
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="innerVisible = false"> </el-button>
<el-button type="primary" @click="submitSetForm()"> </el-button>
</div>
</el-dialog>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="hide"> </el-button> <el-button type="primary" @click="hide"> </el-button>
</div> </div>
@ -94,15 +146,24 @@ export default {
data() { data() {
return { return {
colDialogshow: false, colDialogshow: false,
innerVisible: false,
colTableData: {}, colTableData: {},
colLoading: false, colLoading: false,
innerVisible: false,
colName: "", colName: "",
colOptions: [], colOptions: [],
multipleSelection: [],
colData: "", colData: "",
cellIndex: null, cellIndex: null,
attTableList: [], attTableList: [],
colIndex: 0, colIndex: 0,
formInfo: {
colName: "",
},
rules: {
colName: [
{ required: true, message: "请选择字段名", trigger: "change" },
],
},
}; };
}, },
watch: { watch: {
@ -125,6 +186,58 @@ export default {
this.cellIndex = $index; this.cellIndex = $index;
this.colData = row; this.colData = row;
}, },
//
handleSelectionChange(val) {
this.multipleSelection = val;
//console.log(this.multipleSelection);
},
handleBindClick() {
//
console.log(this.multipleSelection);
this.innerVisible = true;
//this.$refs.bindingRef.display(this.multipleSelection);
},
//
submitSetForm() {
this.$refs.formInfo.validate((valid) => {
console.log(valid);
if (valid) {
//
console.log(this.multipleSelection);
let plidlistArr = [];
this.multipleSelection.forEach((item) => {
// idpushplidlistArr
plidlistArr.push(item.id);
});
icdupdateAttApi({
colName: this.formInfo.colName,
idList: plidlistArr,
})
.then((res) => {
if (res.success) {
this.innerVisible = false;
this.cellIndex = null;
console.log(this.colTableData);
this.$parent.geticdList(
this.colTableData.iedName,
this.colIndex
);
} else {
this.$message({
duration: 1500,
showClose: true,
message: res.errorMsg,
type: "error",
});
}
})
.catch((err) => {});
} else {
console.log("error submit!!");
return false;
}
});
},
// //
handlecolSaveClick({ row }) { handlecolSaveClick({ row }) {
const idlistArr = []; const idlistArr = [];
@ -139,6 +252,13 @@ export default {
this.cellIndex = null; this.cellIndex = null;
console.log(this.colTableData); console.log(this.colTableData);
this.$parent.geticdList(this.colTableData.iedName, this.colIndex); this.$parent.geticdList(this.colTableData.iedName, this.colIndex);
} else {
this.$message({
duration: 1500,
showClose: true,
message: res.errorMsg,
type: "error",
});
} }
}) })
.catch((err) => {}); .catch((err) => {});
@ -215,6 +335,18 @@ export default {
.colDialogBox { .colDialogBox {
.colContain { .colContain {
height: 540px; height: 540px;
position: relative;
.bindBox {
position: absolute;
background: #fff;
height: 38px;
width: calc(100% - 62px);
z-index: 2;
left: 60px;
display: flex;
align-items: center;
top: 1px;
}
.el-table { .el-table {
.editClass { .editClass {
.el-link.el-link--primary { .el-link.el-link--primary {
@ -233,4 +365,9 @@ export default {
width: 268px; width: 268px;
} }
} }
.colBlindDialog {
.el-select {
width: 306px;
}
}
</style> </style>

Loading…
Cancel
Save