|
@@ -2,14 +2,25 @@
|
|
|
<div>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
+ <el-row>
|
|
|
+ <el-col class="btn-top" :span="24">
|
|
|
+ <el-button type="primary" @click="saveData">确定范围</el-button>
|
|
|
+ <el-button @click="clearData">清空</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
<el-collapse v-model="activeName" accordion>
|
|
|
<el-collapse-item
|
|
|
v-for="(item, key) in pipeList"
|
|
|
:key="key"
|
|
|
- :title="item.type"
|
|
|
+ :title="item.name"
|
|
|
:name="key + 1"
|
|
|
>
|
|
|
- <el-table :data="tableData" style="width: 100%">
|
|
|
+ <div style="float: right">
|
|
|
+ <el-button icon="el-icon-plus" @click="addPipe" size="mini"
|
|
|
+ >添加</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <el-table :data="tableData" stripe style="width: 100%">
|
|
|
<el-table-column
|
|
|
v-for="(headitem, key) in tableHead"
|
|
|
:key="key"
|
|
@@ -27,7 +38,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <div>
|
|
|
+ <div class="table-type">
|
|
|
<span>需要系统图:</span>
|
|
|
<el-switch
|
|
|
v-model="value"
|
|
@@ -36,40 +47,44 @@
|
|
|
>
|
|
|
</el-switch>
|
|
|
</div>
|
|
|
- <div>
|
|
|
+ <div class="table-type">
|
|
|
<span>精细化机房</span>
|
|
|
- <el-checkbox-group v-model="checkList">
|
|
|
- <el-checkbox
|
|
|
- v-for="(item, key) in mrList"
|
|
|
- :key="key"
|
|
|
- class="checkList"
|
|
|
- :label="item.name"
|
|
|
- ></el-checkbox>
|
|
|
- <el-checkbox class="checkList" label="复选框 A"></el-checkbox>
|
|
|
- </el-checkbox-group>
|
|
|
+ <el-checkbox v-model="checked"></el-checkbox>
|
|
|
</div>
|
|
|
</el-collapse-item>
|
|
|
</el-collapse>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-dialog
|
|
|
+ title="提示"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ width="40%"
|
|
|
+ :before-close="handleClose"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <el-cascader
|
|
|
+ @change="changePipe"
|
|
|
+ :options="pipeTypeList"
|
|
|
+ :props="{
|
|
|
+ value: 'code',
|
|
|
+ label: 'name',
|
|
|
+ children: 'children',
|
|
|
+ }"
|
|
|
+ clearable
|
|
|
+ ></el-cascader>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { major_mr, major_sys } from "@/api/workScope.js";
|
|
|
+import { major_mr, major_sys, dict_pipe } from "@/api/workScope.js";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
activeName: "1",
|
|
|
- pipeList: [
|
|
|
- {
|
|
|
- type: "中央供冷系统",
|
|
|
- teble: [],
|
|
|
- },
|
|
|
- {
|
|
|
- type: "应急照明系统",
|
|
|
- teble: [],
|
|
|
- },
|
|
|
- ],
|
|
|
+ pipeList: [],
|
|
|
+ pipeTypeList: [], // 所有设备类型
|
|
|
tableHead: [
|
|
|
{
|
|
|
label: "管道类型名",
|
|
@@ -93,40 +108,106 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
tableData: [
|
|
|
- {
|
|
|
- date: "2016-05-02",
|
|
|
- pipeName: "王小虎",
|
|
|
- label: "上海市普陀区金沙江路 1518 弄",
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // date: "2016-05-02",
|
|
|
+ // pipeName: "王小虎",
|
|
|
+ // label: "上海市普陀区金沙江路 1518 弄",
|
|
|
+ // },
|
|
|
],
|
|
|
+ defaultProps: {
|
|
|
+ children: "children",
|
|
|
+ label: "name",
|
|
|
+ },
|
|
|
// 机房list
|
|
|
- mrList: [],
|
|
|
- checkList: [],
|
|
|
+ checked: false,
|
|
|
value: "",
|
|
|
+ dialogVisible: false, // 弹窗显示
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 更改勾选内容
|
|
|
+ changePipe(node, choiceKey, v) {},
|
|
|
+ // 添加管道
|
|
|
+ addPipe() {
|
|
|
+ const data = {};
|
|
|
+ dict_pipe(data).then((res) => {
|
|
|
+ if (res.rtn && res.rtn.length) {
|
|
|
+ this.pipeTypeList = res.rtn;
|
|
|
+ }
|
|
|
+ this.dialogVisible = true;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 关闭弹窗
|
|
|
+ handleClose() {
|
|
|
+ this.dialogVisible = false;
|
|
|
+ },
|
|
|
+ // 保存数据
|
|
|
+ saveData() {
|
|
|
+ let data = {
|
|
|
+ type: "device",
|
|
|
+ target: "action",
|
|
|
+ codes: this.choiceCheckList,
|
|
|
+ };
|
|
|
+ set_scope(data).then(() => {
|
|
|
+ this.readData();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //清空
|
|
|
+ clearData() {
|
|
|
+ this.$confirm("是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.choiceCheckList = [];
|
|
|
+ this.$refs.tree.setCheckedKeys([]);
|
|
|
+ this.saveData();
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!",
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: "已取消删除",
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
majorSys() {
|
|
|
- major_sys({ scopeFilter: true, target: "rtn" }).then((res) => {
|
|
|
- console.log(res);
|
|
|
+ const data = { scopeFilter: true, target: "rtn" };
|
|
|
+ major_sys(data).then((res) => {
|
|
|
+ let arr = [];
|
|
|
+ res.rtn.forEach((item) => {
|
|
|
+ item.children && item.children.length > 0
|
|
|
+ ? (arr = [...arr, ...item.children])
|
|
|
+ : arr;
|
|
|
+ });
|
|
|
+ this.pipeList = arr;
|
|
|
});
|
|
|
},
|
|
|
},
|
|
|
created() {
|
|
|
this.majorSys();
|
|
|
},
|
|
|
- mounted() {
|
|
|
- major_mr({ target: "rtn" }).then((res) => {
|
|
|
- this.mrList = res.rtn.map((item) => {
|
|
|
- item.id = item.code;
|
|
|
- return item;
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
+ mounted() {},
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
.checkList {
|
|
|
display: block;
|
|
|
}
|
|
|
+.btn-top {
|
|
|
+ margin-bottom: 12px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+}
|
|
|
+.table-type {
|
|
|
+ margin-top: 12px;
|
|
|
+ display: flex;
|
|
|
+ span {
|
|
|
+ margin-right: 12px;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|