|
@@ -7,7 +7,8 @@
|
|
|
<el-tree :data="templates" :props="{children: 'children', label: nodeLabel, value: 'id'}"
|
|
|
@node-click="openTemplate"
|
|
|
default-expand-all
|
|
|
- :expand-on-click-node="false">
|
|
|
+ :expand-on-click-node="false"
|
|
|
+ style="width: 500px;">
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
<span>{{ node.label}}</span>
|
|
|
<span style="padding-left: 10px;">
|
|
@@ -17,6 +18,7 @@
|
|
|
<el-popconfirm title="确定删除模板?" v-if="data.diagramType" @onConfirm="() => delTemplate(node)">
|
|
|
<el-button slot="reference" type="text" size="mini" icon="el-icon-remove">删除</el-button>
|
|
|
</el-popconfirm>
|
|
|
+ <el-button slot="reference" type="text" @click="() => editTemplate(node)" v-if="data.diagramType" size="mini" icon="el-icon-edit">修改</el-button>
|
|
|
</span>
|
|
|
</span>
|
|
|
</el-tree>
|
|
@@ -74,6 +76,29 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
+ <!-- 模板信息对话框 -->
|
|
|
+ <el-dialog title="容器属性" :visible.sync="dlgTemplateVisible">
|
|
|
+ <div class="el-dialog-div">
|
|
|
+ <el-form :model="propsData" label-width="130px">
|
|
|
+ <el-form-item label="模板名称">
|
|
|
+ <el-input v-model="propsData.name"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ :rows="2"
|
|
|
+ v-model="propsData.remark">
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dlgTemplateVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click='modifyTemplate'>确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!-- 编辑容器对话框 -->
|
|
|
<el-dialog title="容器属性" :visible.sync="dlgConVisible">
|
|
|
<div class="el-dialog-div">
|
|
@@ -353,6 +378,7 @@
|
|
|
editor:TemplateEditor = null;
|
|
|
state = -1; //编辑状态(-1:关闭; 0:打开; 1:选中容器; 2:选中干管; 9:绘制干管)
|
|
|
|
|
|
+ dlgTemplateVisible = false;
|
|
|
dlgConVisible = false;
|
|
|
dlgLineVisible = false;
|
|
|
dlgFilterVisible = false;
|
|
@@ -465,6 +491,39 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ //编辑模板信息
|
|
|
+ editTemplate(node){
|
|
|
+ const props: any = {id: node.data.id, name: node.data.name, remark: node.data.remark};
|
|
|
+ this.propsData = props;
|
|
|
+ this.dlgTemplateVisible = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ //修改模板信息
|
|
|
+ modifyTemplate(){
|
|
|
+ if(!this.propsData.name) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '名称不合法'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this['$axios'].post(this['$common'].url + "template/editTemplateInfo", this.propsData)
|
|
|
+ .then(res => {
|
|
|
+ const root = res.data;
|
|
|
+ if(root.data == true) {
|
|
|
+ this.currentTemplate.name = this.propsData.name;
|
|
|
+ this.currentTemplate.remark = this.propsData.remark;
|
|
|
+ this.propsData = {};
|
|
|
+
|
|
|
+ this.dlgTemplateVisible = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
//在编辑器中打开模板文件
|
|
|
openTemplate(data){
|
|
|
if(data.type) //文件夹
|
|
@@ -516,7 +575,7 @@
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//添加容器
|
|
|
addCon(){
|
|
|
this.$prompt('请输入容器id', '提示', {
|