|
@@ -1,36 +1,48 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-dialog v-model="dialogVisible" title="装置功能配置" width="70%" @close="handleClose" :close-on-click-modal="false">
|
|
|
- <el-button style="height: 30px;" type="primary" plain @click="addAbility(0)"><el-icon>
|
|
|
- <Plus />
|
|
|
- </el-icon>添加新功能</el-button>
|
|
|
- <el-upload style="display: inline-block;margin: 0 10px;" v-model:file-list="fileList" class="upload-demo"
|
|
|
- :show-file-list="false" :http-request="upTemplate" multiple :limit="1">
|
|
|
- <el-button style="height: 30px;" type="primary" plain>Excel上传</el-button>
|
|
|
- </el-upload>
|
|
|
- <el-button style="height: 30px;" type="success" plain @click="downloadFile">模板下载</el-button>
|
|
|
- <el-button style="height: 30px;" type="danger" plain @click="clearAll">清除所有端子</el-button>
|
|
|
- <el-table :data="tableData" style="width: 100%;height: calc(100vh - 600px);">
|
|
|
- <el-table-column label="序号" width="100">
|
|
|
- <template #default="scope">
|
|
|
- <span>{{ scope.$index + 1 }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="func_name" label="设计功能名称" width="220" />
|
|
|
- <el-table-column prop="fcda_name" label="端子设计名称" width="220" />
|
|
|
- <el-table-column prop="fcda_match_exp" label="端子匹配关键词" width="220" />
|
|
|
- <el-table-column fixed="right" label="操作" width="auto">
|
|
|
- <template #default="scope">
|
|
|
- <el-button link type="primary" size="small" @click="addAbility(1, scope.row)">编辑</el-button>
|
|
|
- <!-- <el-popconfirm title="确认删除吗?" @confirm="firmSure">
|
|
|
+ <el-dialog v-model="dialogVisible" title="装置功能配置" width="70%" @close="handleClose"
|
|
|
+ :close-on-click-modal="false">
|
|
|
+ <div>
|
|
|
+ <span>旧的装置编码:</span>
|
|
|
+ <el-input style="width:300px;margin: 10px 10px;" v-model="oldType" disabled></el-input>
|
|
|
+ <span>新的装置编码:</span>
|
|
|
+ <el-input style="width:300px;margin: 10px 10px;" v-model="newType" placeholder="请输入新的装置编码"></el-input>
|
|
|
+ <el-button type="primary" plain @click="saveIedType">保存</el-button>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-button style="height: 30px;" type="primary" plain @click="addAbility(0)"><el-icon>
|
|
|
+ <Plus />
|
|
|
+ </el-icon>添加新功能</el-button>
|
|
|
+ <el-upload style="display: inline-block;margin: 0 10px;" v-model:file-list="fileList"
|
|
|
+ class="upload-demo" :show-file-list="false" :http-request="upTemplate" multiple :limit="1">
|
|
|
+ <el-button style="height: 30px;" type="primary" plain>Excel上传</el-button>
|
|
|
+ </el-upload>
|
|
|
+ <el-button style="height: 30px;" type="success" plain @click="downloadFile">模板下载</el-button>
|
|
|
+ <el-button style="height: 30px;" type="danger" plain @click="clearAll">清除所有端子</el-button>
|
|
|
+ <el-table :data="tableData" style="width: 100%;height: calc(100vh - 600px);">
|
|
|
+ <el-table-column label="序号" width="100">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ scope.$index + 1 }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="func_name" label="设计功能名称" width="220" />
|
|
|
+ <el-table-column prop="fcda_name" label="端子设计名称" width="220" />
|
|
|
+ <el-table-column prop="fcda_match_exp" label="端子匹配关键词" width="220" />
|
|
|
+ <el-table-column fixed="right" label="操作" width="auto">
|
|
|
+
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button link type="primary" size="small" @click="addAbility(1, scope.row)">编辑</el-button>
|
|
|
+ <!-- <el-popconfirm title="确认删除吗?" @confirm="firmSure">
|
|
|
<template #reference> -->
|
|
|
- <el-button link type="primary" size="small" style="color: red;"
|
|
|
- @click="delAbility(scope.row)">删除</el-button>
|
|
|
- <!-- </template>
|
|
|
- </el-popconfirm> -->
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ <el-button link type="primary" size="small" style="color: red;"
|
|
|
+ @click="delAbility(scope.row)">删除</el-button>
|
|
|
+ <!-- </template>
|
|
|
+ </el-popconfirm> -->
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+
|
|
|
<template #footer>
|
|
|
<span class="dialog-footer">
|
|
|
<el-button @click="cancels">取消</el-button>
|
|
@@ -38,10 +50,11 @@
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
- <AddAbility v-if="addModal" :addModal="addModal" :modelIds="modelIds" :iedTypes="iedTypes" :copyReload="copyReload"
|
|
|
- :editOrAdd="editOrAdd" :editRow="editRow" @addAback="addAback" :tableData="tableData"></AddAbility>
|
|
|
- <DelAbility v-if="delModal" :delModal="delModal" :modelIds="modelIds" :delFcda="delFcda" :copyReload="copyReload"
|
|
|
- @delBack="delBack"></DelAbility>
|
|
|
+ <AddAbility v-if="addModal" :addModal="addModal" :modelIds="modelIds" :iedTypes="iedTypes"
|
|
|
+ :copyReload="copyReload" :editOrAdd="editOrAdd" :editRow="editRow" @addAback="addAback"
|
|
|
+ :tableData="tableData"></AddAbility>
|
|
|
+ <DelAbility v-if="delModal" :delModal="delModal" :modelIds="modelIds" :delFcda="delFcda"
|
|
|
+ :copyReload="copyReload" @delBack="delBack"></DelAbility>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -62,11 +75,27 @@ export default {
|
|
|
modelId: {
|
|
|
type: String,
|
|
|
required: true,
|
|
|
- },
|
|
|
+ },//模型id
|
|
|
iedType: {
|
|
|
type: String,
|
|
|
required: true,
|
|
|
- }
|
|
|
+ },//节点装置编码
|
|
|
+ nodeid: {
|
|
|
+ type: String,
|
|
|
+ required: true,
|
|
|
+ },//节点id
|
|
|
+ fun: {
|
|
|
+ type: Function,
|
|
|
+ required: true,
|
|
|
+ },//insideModule传过来的方法
|
|
|
+ listMap: {
|
|
|
+ type: Function,
|
|
|
+ required: true
|
|
|
+ },
|
|
|
+ funOne: {
|
|
|
+ type: Function,
|
|
|
+ required: true,
|
|
|
+ },//insideModule传过来的方法
|
|
|
},
|
|
|
setup(props, { emit }) {
|
|
|
let dialogVisible = ref(false)//模态框开关
|
|
@@ -78,6 +107,9 @@ export default {
|
|
|
let editOrAdd = ref(0)//0为新增,1为编辑
|
|
|
let editRow = ref({})//编辑的对象
|
|
|
let delFcda = ref("")//需要删除的fcda_id
|
|
|
+ let oldType = ref("")//旧的装置编码
|
|
|
+ let newType = ref("")//新的装置编码
|
|
|
+ let iedId = ref("")//节点的id
|
|
|
watch(() => props.modelId, (newVal) => {
|
|
|
modelIds.value = newVal
|
|
|
})
|
|
@@ -89,10 +121,13 @@ export default {
|
|
|
dialogVisible.value = props.abModal
|
|
|
modelIds.value = props.modelId
|
|
|
iedTypes.value = props.iedType
|
|
|
+ oldType.value = props.iedType
|
|
|
+ iedId.value = props.nodeid
|
|
|
flow.getModelAndIed({//获取所有功能
|
|
|
model_id: modelIds.value - 0,
|
|
|
ied_type: iedTypes.value
|
|
|
}).then(res => {
|
|
|
+ console.log(res, 'asdasdsa');
|
|
|
tableData.value = res.data
|
|
|
})
|
|
|
}
|
|
@@ -215,6 +250,27 @@ export default {
|
|
|
}, 5000);
|
|
|
})
|
|
|
}
|
|
|
+ function saveIedType() {
|
|
|
+ flow.updateIedType({
|
|
|
+ id: modelIds.value - 0,
|
|
|
+ old_iedtype: oldType.value,
|
|
|
+ new_iedtype: newType.value
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ sureClose()
|
|
|
+ props.funOne()
|
|
|
+ ElMessage({
|
|
|
+ message: "修改成功",
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
// 确认删除功能
|
|
|
function firmSure() {
|
|
|
|
|
@@ -253,6 +309,10 @@ export default {
|
|
|
downloadFile,
|
|
|
portExcel,//需要被下载的excel文件
|
|
|
clearAll,//清除所有端子
|
|
|
+ iedId,//节点的id
|
|
|
+ oldType,//旧的装置编码
|
|
|
+ newType,//新的装置编码
|
|
|
+ saveIedType,//保存装置编码函数
|
|
|
}
|
|
|
},
|
|
|
components: {
|