|
@@ -16,11 +16,14 @@
|
|
:name="key + 1"
|
|
:name="key + 1"
|
|
>
|
|
>
|
|
<div style="float: right">
|
|
<div style="float: right">
|
|
- <el-button icon="el-icon-plus" @click="addPipe" size="mini"
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
+ @click="openaddPipe(item)"
|
|
|
|
+ size="mini"
|
|
>添加</el-button
|
|
>添加</el-button
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
- <el-table :data="tableData" stripe style="width: 100%">
|
|
|
|
|
|
+ <el-table :data="item.tableData" stripe style="width: 100%">
|
|
<el-table-column
|
|
<el-table-column
|
|
v-for="(headitem, key) in tableHead"
|
|
v-for="(headitem, key) in tableHead"
|
|
:key="key"
|
|
:key="key"
|
|
@@ -28,6 +31,14 @@
|
|
:label="headitem.label"
|
|
:label="headitem.label"
|
|
:width="headitem.width"
|
|
:width="headitem.width"
|
|
>
|
|
>
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div v-if="scope.row[headitem.name] == 'name'">
|
|
|
|
+ {{ scope.row[headitem.name] }}
|
|
|
|
+ </div>
|
|
|
|
+ <div v-else>
|
|
|
|
+ <el-checkbox :value="scope.row[headitem.name] == '1'?true:false"></el-checkbox>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="操作">
|
|
<el-table-column label="操作">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
@@ -38,67 +49,70 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
- <div class="table-type">
|
|
|
|
- <span>需要系统图:</span>
|
|
|
|
- <el-switch
|
|
|
|
- v-model="value"
|
|
|
|
- active-color="#13ce66"
|
|
|
|
- inactive-color="#ff4949"
|
|
|
|
- >
|
|
|
|
- </el-switch>
|
|
|
|
- </div>
|
|
|
|
- <div class="table-type">
|
|
|
|
|
|
+ <!-- <div class="table-type">
|
|
<span>精细化机房</span>
|
|
<span>精细化机房</span>
|
|
<el-checkbox v-model="checked"></el-checkbox>
|
|
<el-checkbox v-model="checked"></el-checkbox>
|
|
- </div>
|
|
|
|
|
|
+ </div> -->
|
|
</el-collapse-item>
|
|
</el-collapse-item>
|
|
</el-collapse>
|
|
</el-collapse>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
<el-dialog
|
|
<el-dialog
|
|
- title="提示"
|
|
|
|
|
|
+ title="新增管道"
|
|
:visible.sync="dialogVisible"
|
|
:visible.sync="dialogVisible"
|
|
width="40%"
|
|
width="40%"
|
|
:before-close="handleClose"
|
|
:before-close="handleClose"
|
|
>
|
|
>
|
|
<div>
|
|
<div>
|
|
- <el-cascader
|
|
|
|
- @change="changePipe"
|
|
|
|
- :options="pipeTypeList"
|
|
|
|
- :props="{
|
|
|
|
- value: 'code',
|
|
|
|
- label: 'name',
|
|
|
|
- children: 'children',
|
|
|
|
- }"
|
|
|
|
- clearable
|
|
|
|
- ></el-cascader>
|
|
|
|
-
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <el-cascader
|
|
|
|
+ :options="pipeTypeList"
|
|
|
|
+ v-model="addpipeValue"
|
|
|
|
+ :props="{
|
|
|
|
+ value: 'code',
|
|
|
|
+ label: 'name',
|
|
|
|
+ children: 'children',
|
|
|
|
+ }"
|
|
|
|
+ clearable
|
|
|
|
+ ></el-cascader>
|
|
|
|
+ </div>
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="handleClose">取 消</el-button>
|
|
|
|
+ <el-button type="primary" @click="addPipe">确 定</el-button>
|
|
|
|
+ </span>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
-import { major_mr, major_sys, dict_pipe } from "@/api/workScope.js";
|
|
|
|
|
|
+import {
|
|
|
|
+ major_mr,
|
|
|
|
+ major_sys,
|
|
|
|
+ dict_pipe,
|
|
|
|
+ set_sys_diagram,
|
|
|
|
+ get_sys_diagram,
|
|
|
|
+} from "@/api/workScope.js";
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
activeName: "1",
|
|
activeName: "1",
|
|
pipeList: [],
|
|
pipeList: [],
|
|
pipeTypeList: [], // 所有设备类型
|
|
pipeTypeList: [], // 所有设备类型
|
|
|
|
+ addpipeValue: [], // 新增管道类型
|
|
tableHead: [
|
|
tableHead: [
|
|
{
|
|
{
|
|
label: "管道类型名",
|
|
label: "管道类型名",
|
|
- name: "pipeName",
|
|
|
|
|
|
+ name: "name",
|
|
width: "180",
|
|
width: "180",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: "仅干管",
|
|
label: "仅干管",
|
|
- name: "onlyMain",
|
|
|
|
|
|
+ name: "main",
|
|
width: "180",
|
|
width: "180",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: "含支路管道",
|
|
label: "含支路管道",
|
|
- name: "andBranch",
|
|
|
|
|
|
+ name: "branch",
|
|
width: "180",
|
|
width: "180",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -107,13 +121,6 @@ export default {
|
|
width: "180",
|
|
width: "180",
|
|
},
|
|
},
|
|
],
|
|
],
|
|
- tableData: [
|
|
|
|
- // {
|
|
|
|
- // date: "2016-05-02",
|
|
|
|
- // pipeName: "王小虎",
|
|
|
|
- // label: "上海市普陀区金沙江路 1518 弄",
|
|
|
|
- // },
|
|
|
|
- ],
|
|
|
|
defaultProps: {
|
|
defaultProps: {
|
|
children: "children",
|
|
children: "children",
|
|
label: "name",
|
|
label: "name",
|
|
@@ -122,21 +129,37 @@ export default {
|
|
checked: false,
|
|
checked: false,
|
|
value: "",
|
|
value: "",
|
|
dialogVisible: false, // 弹窗显示
|
|
dialogVisible: false, // 弹窗显示
|
|
|
|
+ currentItem: null, // 当前选中的系统管道
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 更改勾选内容
|
|
// 更改勾选内容
|
|
changePipe(node, choiceKey, v) {},
|
|
changePipe(node, choiceKey, v) {},
|
|
|
|
+ // 删除管道
|
|
|
|
+ handleEdit() {},
|
|
// 添加管道
|
|
// 添加管道
|
|
- addPipe() {
|
|
|
|
|
|
+ openaddPipe(item) {
|
|
const data = {};
|
|
const data = {};
|
|
|
|
+ this.currentItem = null;
|
|
dict_pipe(data).then((res) => {
|
|
dict_pipe(data).then((res) => {
|
|
if (res.rtn && res.rtn.length) {
|
|
if (res.rtn && res.rtn.length) {
|
|
this.pipeTypeList = res.rtn;
|
|
this.pipeTypeList = res.rtn;
|
|
}
|
|
}
|
|
this.dialogVisible = true;
|
|
this.dialogVisible = true;
|
|
|
|
+ this.currentItem = item;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ addPipe() {
|
|
|
|
+ this.currentItem.tableData.push({
|
|
|
|
+ name: 123,
|
|
|
|
+ code: this.addpipeValue[1],
|
|
|
|
+ main: 0,
|
|
|
|
+ branch: 0,
|
|
|
|
+ anthor: 0,
|
|
|
|
+ });
|
|
|
|
+ this.addpipeValue = [];
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
+ },
|
|
// 关闭弹窗
|
|
// 关闭弹窗
|
|
handleClose() {
|
|
handleClose() {
|
|
this.dialogVisible = false;
|
|
this.dialogVisible = false;
|
|
@@ -184,6 +207,11 @@ export default {
|
|
? (arr = [...arr, ...item.children])
|
|
? (arr = [...arr, ...item.children])
|
|
: arr;
|
|
: arr;
|
|
});
|
|
});
|
|
|
|
+ arr.map((item) => {
|
|
|
|
+ return Object.assign(item, {
|
|
|
|
+ tableData: [],
|
|
|
|
+ });
|
|
|
|
+ });
|
|
this.pipeList = arr;
|
|
this.pipeList = arr;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -210,4 +238,9 @@ export default {
|
|
margin-right: 12px;
|
|
margin-right: 12px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+.dialog-footer {
|
|
|
|
+ margin-top: 12px;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: flex-end;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|