浏览代码

台账系统添加

chuwu 6 年之前
父节点
当前提交
7d1b0d4377

+ 3 - 3
src/api/scan/request.js

@@ -443,20 +443,20 @@ export function getSpaceFloor(param) {
 //创建业务空间
 export function createBusiness(param) {
     let data = param.data
-    return fetch({ method: "POST", url: `${physics}/space/create?projectId=${param.ProjId}&secret=${param.secret}`, data })
+    return fetch({ method: "POST", url: `${business}/space/create?projectId=${param.ProjId}&secret=${param.secret}`, data })
         // return fetch({ method: "POST", url: `/test/space/create?projectId=${param.ProjId}&secret=${param.secret}`, data })
 }
 
 //批量创建业务空间
 export function createBusinessList(param) {
     let data = param.data
-    return fetch({ method: "POST", url: `${physics}/space/batch/create?projectId=${param.ProjId}&secret=${param.secret}`, data })
+    return fetch({ method: "POST", url: `${business}/space/batch/create?projectId=${param.ProjId}&secret=${param.secret}`, data })
 }
 
 //更新业务空间
 export function updateBusiness(param) {
     let data = param.data
-    return fetch({ method: "POST", url: `${physics}/object/batch_update?projectId=${param.ProjId}&secret=${param.secret}`, data })
+    return fetch({ method: "POST", url: `${business}/object/batch_update?projectId=${param.ProjId}&secret=${param.secret}`, data })
 }
 
 //模糊搜索设备类型

文件差异内容过多而无法显示
+ 1216 - 0
src/components/ledger/handsontables/assets.vue


文件差异内容过多而无法显示
+ 1289 - 0
src/components/ledger/handsontables/device.vue


文件差异内容过多而无法显示
+ 1026 - 0
src/components/ledger/handsontables/system.vue


+ 114 - 0
src/components/ledger/lib/assets.vue

@@ -0,0 +1,114 @@
+<template>
+  <div id="cascaderMap">
+    <span class="buildFloor">设备族:</span>
+    <el-cascader
+      placeholder="请选择"
+      :options="options"
+      v-model="value"
+      :props="props"
+      filterable
+      :style="isWidth ? '' : 'width:160px;'"
+      size="small"
+      @change="changeVal"
+      change-on-select
+    ></el-cascader>
+  </div>
+</template>
+<script>
+import { getEquipmentFamily } from "@/api/scan/request";
+export default {
+  name: "getCode",
+  props: {
+    isWidth: {
+      type: Boolean,
+      default: true
+    }
+  },
+  data() {
+    return {
+      value: [],
+      options: [],
+      props: {
+        value: "code",
+        label: "facility"
+      },
+      falg: true,
+      content: []
+    };
+  },
+  created() {
+    this.getData();
+  },
+  mounted() { },
+  methods: {
+    setValue(val) {
+      this.value = val
+    },
+    //修改val
+    changeVal(val) {
+      let value = {}
+      this.options.map(item => {
+        if (item.code == val) {
+          value = item
+        }
+      })
+      this.value = val
+      this.$emit("change", value)
+    },
+    async getData() {
+      let _this = this
+      await getEquipmentFamily(res => {
+        _this.options = _this.changeArr(res.Content)
+        if (!!this.value && this.value.length) {
+          let value = {}
+          this.options.map(item => {
+            if (item.code == this.value[0]) {
+              value = item
+            }
+          })
+          this.$emit("change", value)
+        }
+        if (!_this.falg) {
+          _this.changeList()
+        }
+      })
+    },
+    changeArr(arr) {
+      let data = [];
+      arr.map(item => {
+        data.push({ code: item.code, facility: item.name, disabled: false })
+      });
+      return data;
+    },
+    pushData(content) {
+      this.content = content
+      if (this.options.length) {
+        this.falg = true
+        this.changeList()
+      } else {
+        this.falg = false
+      }
+    },
+    changeList() {
+      this.options.map(item => {
+        item.disabled = true
+        this.content.map(child => {
+          if (item.code == child) {
+            item.disabled = false
+          }
+        })
+      })
+    }
+  }
+};
+</script>
+<style lang="less" scoped>
+#cascaderMap {
+  float: left;
+  margin-left: 10px;
+  .buildFloor {
+    color: #999999;
+    font-size: 14px;
+  }
+}
+</style>

+ 138 - 0
src/components/ledger/lib/cascader.vue

@@ -0,0 +1,138 @@
+<template>
+  <div id="cascaderMap">
+    <span class="buildFloor">设备类别:</span>
+    <el-cascader
+      placeholder="请选择"
+      :options="options"
+      v-model="value"
+      :props="props"
+      filterable
+      :style="isWidth ? '' : 'width:160px;'"
+      size="small"
+      @change="changeVal"
+      change-on-select
+    ></el-cascader>
+  </div>
+</template>
+<script>
+import { getEqCode } from "@/api/scan/request";
+export default {
+  name: "getCode",
+  props: {
+    isWidth: {
+      type: Boolean,
+      default: true
+    },
+    isAll: {
+      type: Boolean,
+      default: false,
+    }
+  },
+  data() {
+    return {
+      value: [""],
+      options: [],
+      props: {
+        value: "code",
+        label: "facility"
+      },
+      falg: true,
+      content: []
+    };
+  },
+  created() {
+    this.getData();
+  },
+  mounted() { },
+  methods: {
+    setValue(val) {
+      this.value = val
+    },
+    //修改val
+    changeVal(val) {
+      let value = {}
+      this.options.map(item => {
+        if (item.code == val) {
+          value = item
+        }
+      })
+      this.value = val
+      this.$emit("change", value)
+    },
+    async getData() {
+      await getEqCode().then(res => {
+        if (this.isAll) {
+          let data = this.changeArr(res.data.Content)
+          data.unshift({
+            code: "all",
+            facility: "全部"
+          });
+          this.options = data
+          console.log(this.options, "options")
+          this.value = ["all"]
+        } else {
+          this.options = this.changeArr(res.data.Content);
+        }
+        if (!!this.value && this.value.length) {
+          let value = {}
+          this.options.map(item => {
+            if (item.code == this.value[0]) {
+              value = item
+            }
+          })
+          this.$emit("change", value)
+        }
+        if (!this.falg) {
+          this.changeList()
+        }
+      });
+    },
+    changeArr(arr) {
+      let data = [];
+      arr.map(item => {
+        if (item.content && item.content.length) {
+          return item.content.map(children => {
+            if (children.content && children.content.length) {
+              return children.content.map(i => {
+                data.push(i);
+              });
+            }
+          });
+        }
+      });
+      return data;
+    },
+
+    pushData(content) {
+      this.content = content
+      if (this.options.length) {
+        this.falg = true
+        this.changeList()
+      } else {
+        this.falg = false
+      }
+    },
+
+    changeList() {
+      this.options.map(item => {
+        item.disabled = true
+        this.content.map(child => {
+          if (item.code == child) {
+            item.disabled = false
+          }
+        })
+      })
+    }
+  }
+};
+</script>
+<style lang="less" scoped>
+#cascaderMap {
+  float: left;
+  margin-left: 10px;
+  .buildFloor {
+    color: #999999;
+    font-size: 14px;
+  }
+}
+</style>

+ 123 - 0
src/components/ledger/lib/floorCascader.vue

@@ -0,0 +1,123 @@
+<template>
+    <div id="buildFloor">
+        <span class="buildFloor">所属建筑楼层:</span>
+        <el-cascader placeholder="请选择建筑楼层" :options="options" v-model="value" filterable size="small" :style="isWidth ? '' : 'width:160px;'" @change="changeCascader"></el-cascader>
+    </div>
+</template>
+<script>
+    import {
+        getSpaceFloor
+    } from '@/api/scan/request'
+    import {
+        mapGetters,
+        mapActions
+    } from "vuex";
+    export default {
+        props: {
+            isWidth: {
+                type: Boolean,
+                default: true
+            },
+            type: {
+                type: String,
+                default: "yes"
+            }
+        },
+        computed: {
+            ...mapGetters("peojMess", [
+                "projectId",
+                "secret",
+                "userId"
+            ])
+        },
+        data() {
+            return {
+                options: [],
+                param: {
+                    ProjId: '',
+                    secret: ''
+                },
+                value: ['all']
+            };
+        },
+        created() {
+            this.param.ProjId = this.projectId
+            this.param.secret = this.secret
+            this.getData()
+        },
+        mounted() {},
+        methods: {
+            //获取数据
+            getData() {
+                getSpaceFloor(this.param).then(res => {
+                    if (res.data.Result == 'success') {
+                        let data = this.changeArr(res.data.Content)
+                        console.log(data)
+                        data.unshift({
+                            value: "all",
+                            label: "全部"
+                        }, {
+                            value: "noKnow",
+                            label: "未明确建筑的设备"
+                        })
+                        data.map(item => {
+                            if (!!item.children) {
+                                item.children.unshift({
+                                    value: 'noKnow',
+                                    label: "未明确楼层的设备"
+                                })
+                                item.children.unshift({
+                                    value: "all",
+                                    label: "全部"
+                                })
+                            }
+                            return item
+                        })
+                        this.options = data
+                    } else {
+                        this.$message.error(res.data.ResultMsg)
+                    }
+                }).catch(() => {
+                    this.$message.error("请求出错")
+                })
+            },
+            //将数组转换成optiosn格式
+            changeArr(arr) {
+                return arr.map(item => {
+                    if (item.floors && item.floors.length && this.type == "yes") {
+                        return {
+                            value: item.id,
+                            label: item.infos.BuildLocalName,
+                            children: item.floors.map(i => {
+                                return {
+                                    value: i.id,
+                                    label: i.infos.FloorLocalName,
+                                }
+                            })
+                        }
+                    } else {
+                        return {
+                            value: item.id,
+                            label: item.infos.BuildLocalName,
+                            children: null,
+                            isChilren: 1,
+                        }
+                    }
+                })
+            },
+            //改变item
+            changeCascader(value) {
+                this.$emit("change", value)
+            }
+        }
+    };
+</script>
+<style lang="less" scoped>
+    #buildFloor {
+        float: left;
+        .buildFloor {
+            color: #999999;
+            font-size: 14px;
+        }
+    }
+</style>

+ 120 - 0
src/components/ledger/lib/system.vue

@@ -0,0 +1,120 @@
+<template>
+  <div id="cascaderMap">
+    <span class="buildFloor">所属专业系统类型:</span>
+    <el-cascader
+      placeholder="请选择"
+      :options="options"
+      v-model="value"
+      :props="props"
+      filterable
+      :style="isWidth ? '' : 'width:160px;'"
+      size="small"
+      @change="changeVal"
+      change-on-select
+    ></el-cascader>
+  </div>
+</template>
+<script>
+import { getEqCode } from "@/api/scan/request";
+export default {
+  name: "getCode",
+  props: {
+    isWidth: {
+      type: Boolean,
+      default: true
+    }
+  },
+  data() {
+    return {
+      value: [],
+      options: [],
+      props: {
+        value: "code",
+        label: "facility"
+      },
+      falg: true,
+      content: []
+    };
+  },
+  created() {
+    this.getData();
+  },
+  mounted() { },
+  methods: {
+    setValue(val) {
+      this.value = val
+    },
+    //修改val
+    changeVal(val) {
+      let value = {}
+      this.options.map(item => {
+        if (item.code == val) {
+          value = item
+        }
+      })
+      this.$emit("change", value)
+    },
+    getData() {
+      getEqCode().then(res => {
+        console.log(res.data)
+        this.options = this.changeArr(res.data.Content);
+        if (!!this.value && this.value.length) {
+          let value = {}
+          this.options.map(item => {
+            if (item.code == this.value[0]) {
+              value = item
+            }
+          })
+          this.$emit("change", value)
+        }
+        if (!this.falg) {
+          this.changeList()
+        }
+      });
+    },
+    changeArr(arr) {
+      let data = [];
+      arr.map(item => {
+        if (item.content && item.content.length) {
+          return item.content.map(children => {
+            data.push({ code: children.code, facility: children.system });
+          });
+        }
+      });
+      return data;
+    },
+    //上级页面传入content
+    pushData(content) {
+      this.content = content
+      if (this.options.length) {
+        this.falg = true
+        this.changeList()
+      } else {
+        this.falg = false
+      }
+    },
+
+    //修改list
+    changeList() {
+      this.options.map(item => {
+        item.disabled = true
+        this.content.map(child => {
+          if (item.code == child) {
+            item.disabled = false
+          }
+        })
+      })
+    }
+  }
+};
+</script>
+<style lang="less" scoped>
+#cascaderMap {
+  float: left;
+  margin-left: 10px;
+  .buildFloor {
+    color: #999999;
+    font-size: 14px;
+  }
+}
+</style>

+ 122 - 0
src/components/ledger/lib/title.vue

@@ -0,0 +1,122 @@
+<!--
+    清单页头部个数组件
+-->
+<template>
+    <div id="listHeader">
+        <div class="border-main">
+            <p class="list-name">项目名称: {{mess.perjectName}}</p>
+            <div class="card-view">
+                <div class="card" v-for="(i,index) in mess.name" :key="index">
+                    <p>{{index == 1 ? "已对应" : "全部"}}{{i.key}}</p>
+                    <p class="num">{{i.num |numFormat}}</p>
+                </div>
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+export default {
+  props: {
+    mess: {
+      type: Object,
+      default: function() {
+        return {
+          perjectName: "风雅苑",
+          name: [
+            {
+              key: "测试",
+              num: 1548514
+            },
+            {
+              key: "测试",
+              num: 154852145
+            }
+          ]
+        };
+      }
+    }
+  },
+  data() {
+    return {};
+  },
+  methods: {
+  },
+  filters: {
+    numFormat(num) {
+      if (num && num != null) {
+        num = String(num);
+        var left = num.split(".")[0],
+          right = num.split(".")[1];
+        right = right
+          ? right.length >= 2
+            ? "." + right.substr(0, 2)
+            : "." + right + "0"
+          : "";
+        var temp = left
+          .split("")
+          .reverse()
+          .join("")
+          .match(/(\d{1,3})/g);
+        return (
+          (Number(num) < 0 ? "-" : "") +
+          temp
+            .join(",")
+            .split("")
+            .reverse()
+            .join("") +
+          right
+        );
+      } else if (num === 0) {
+        // 注意===在这里的使用,如果传入的num为0,if中会将其判定为boolean类型,故而要另外做===判断
+        return "0";
+      } else {
+        return "--";
+      }
+    }
+  }
+};
+</script>
+<style lang="less" scoped>
+#listHeader {
+  background-color: #fff;
+  width: calc(100% - 20px);
+  height: 120px;
+  margin: 10px;
+  .border-main {
+    width: 100%;
+    height: 100%;
+    border: 1px solid #ccc;
+    border-radius: 5px;
+    padding-left: 10px;
+    .list-name {
+      line-height: 28px;
+      font-size: 16px;
+    }
+    .card-view {
+      height: 80px;
+      overflow: hidden;
+      .card {
+        float: left;
+        margin-top: 10px;
+        height: 70px;
+        width: 200px;
+        border: 1px solid #a1a1a1;
+        border-radius: 5px;
+        background-color: #e4e4e4;
+        padding: 10px;
+        margin-right: 15px;
+        p {
+          color: #797979;
+          font-size: 13px;
+        }
+        p.num {
+          color: #3d3d3d;
+          padding-left: 10px;
+          padding-top: 5px;
+          font-size: 17px;
+        }
+      }
+    }
+  }
+}
+</style>

+ 465 - 0
src/components/ledger/tableTransfers.vue

@@ -0,0 +1,465 @@
+<template>
+  <el-dialog title="关联设备" :before-close="close" :visible.sync="dialog.relevance" width="1000px">
+    <div id="tableTransfers">
+      <div class="main-left">
+        <h4>未关联该系统的设备</h4>
+        <div class="border-view">
+          <div class="search">
+            <div class="search-small">
+              <el-input
+                placeholder="输入设备名称进行查询"
+                v-model="search.filter"
+                style="width:280px;"
+                size="small"
+                clearable
+              ></el-input>
+              <el-button @click="getLeftData" size="small">查找</el-button>
+            </div>
+            <div class="search-small">
+              <floor-cascader :isWidth="false"></floor-cascader>
+              <cascader :isWidth="false" @change="changeCascader" :isAll="true"></cascader>
+            </div>
+          </div>
+          <el-table
+            ref="multipleTable"
+            :data="tableData"
+            height="350px"
+            tooltip-effect="dark"
+            style="width: 100%"
+            @selection-change="handleSelectionChange"
+            v-loading="isLoading1"
+          >
+            <el-table-column type="selection" width="55"></el-table-column>
+            <el-table-column label="设备名称" width="120">
+              <template
+                slot-scope="scope"
+              >{{ scope.row.infos.EquipLocalName || scope.row.infos.EquipName }}</template>
+            </el-table-column>
+            <el-table-column label="设备编号" width="120">
+              <template slot-scope="scope">{{ scope.row.infos.EquipLocalID || "--" }}</template>
+            </el-table-column>
+            <el-table-column label="设备类" show-overflow-tooltip>
+              <template slot-scope="scope">{{ getName(scope.row.category) }}</template>
+            </el-table-column>
+            <el-table-column prop="address" label="安装位置" show-overflow-tooltip>
+              <template slot-scope="scope">{{ scope.row.infos.InstallLocation || "--" }}</template>
+            </el-table-column>
+          </el-table>
+          <my-pagination @change="changePages1" :page="pages1"></my-pagination>
+        </div>
+      </div>
+      <div class="main-button">
+        <el-button
+          class="top"
+          @click="rightToLeft"
+          :disabled="SelectionList && SelectionList.length ? false : true"
+          :type="SelectionList && SelectionList.length ? 'primary' : ''"
+          icon="el-icon-arrow-left"
+          circle
+        ></el-button>
+        <el-button
+          class="bottom"
+          @click="leftToRight"
+          :disabled="multipleSelection && multipleSelection.length ? false : true"
+          :type="multipleSelection && multipleSelection.length ? 'primary' : ''"
+          icon="el-icon-arrow-right"
+          circle
+        ></el-button>
+      </div>
+      <div class="main-right">
+        <h4>已关联该系统的设备</h4>
+        <div class="border-view">
+          <div class="search">
+            <div class="search-big">
+              <el-input
+                placeholder="输入设备名称、设备类名称进行查询"
+                v-model="search2.filter"
+                style="width:220px;"
+                size="small"
+                clearable
+              ></el-input>
+              <el-button @click="getRightData" size="small">查找</el-button>
+            </div>
+          </div>
+          <el-table
+            ref="multipleTable"
+            :data="table2Data"
+            height="350px"
+            tooltip-effect="dark"
+            style="width: 100%"
+            @selection-change="tableChange"
+            v-loading="isLoading2"
+          >
+            <el-table-column type="selection" width="55"></el-table-column>
+            <el-table-column label="设备名称">
+              <template
+                slot-scope="scope"
+              >{{ scope.row.infos.EquipLocalName || scope.row.infos.EquipName }}</template>
+            </el-table-column>
+          </el-table>
+          <my-pagination :page="pages2" @change="changePages2" :isSmall="false"></my-pagination>
+        </div>
+      </div>
+    </div>
+  </el-dialog>
+</template>
+<script>
+import myPagination from "@/components/common/myPagination";
+import floorCascader from "@/components/ledger/lib/floorCascader";
+import cascader from "@/components/ledger/lib/cascader";
+
+import { getBillEquipList, getEqCode, getBussines, deleteRelation, getGraphyId, getSysToEq, createRelation } from "@/api/scan/request"
+import {
+        mapGetters,
+        mapActions
+    } from "vuex";
+export default {
+  props: {
+    dialog: {
+      type: Object,
+      default: function () {
+        return {
+          relevance: false
+        }
+      }
+    },
+    id: {
+      type: String
+    }
+  },
+  components: {
+    myPagination,
+    floorCascader,
+    cascader
+  },
+  computed: {
+            ...mapGetters("peojMess", [
+                "projectId",
+                "secret",
+                "userId"
+            ])
+        },
+  data() {
+    return {
+      dialogVisible: true,
+      pages1: {
+        size: 50,
+        sizes: [10, 20, 30, 50, 100, 200],
+        total: 0,
+        currentPage: 1
+      },
+      pages2: {
+        size: 50,
+        sizes: [10, 20, 30, 50, 100, 200],
+        total: 0,
+        currentPage: 1
+      },
+      search: {//第一个table的搜索条件
+        filter: "",//文本框条件
+        build: "all",//建筑
+        floor: "",//楼层
+        category: "all"//设备类别
+      },
+      search2: {//第二个搜索条件
+        filter: "",//搜索文案
+      },
+      tableData: [
+      ], //第一个表格的数据
+      table2Data: [
+      ], //第二个表格的数据
+      multipleSelection: [], //第一个表格的被选择数组
+      SelectionList: [], //第二个表格的被选择数组
+      list: [],
+      graphyId: "",
+      isLoading1: false,
+      isLoading2: false,
+    };
+  },
+  created() {
+    this.getData();
+    this.getgraphyId();
+  },
+  methods: {
+    //关闭
+    close(done) {
+      this.$emit("close")
+      done()
+    },
+    getgraphyId() {
+      getGraphyId({
+        type: "SystemEquip",
+        secret: this.secret,
+        ProjId: this.projectId
+      }).then(res => {
+        if (res.data.Result == "success") {
+          this.graphyId = res.data.graph_id
+        } else {
+          this.$message.error("请求失败:" + res.data.ResultMsg)
+        }
+      }).catch(_ => [
+        this.$message.error("请求失败")
+      ])
+    },
+    getName(code) {
+      code = code.substring(2, 6)
+      let str = ""
+      this.list.map(item => {
+        if (item.code == code) {
+          str = item.facility
+        }
+      })
+      return str
+    },
+    getData() {
+      getEqCode().then(res => {
+        this.list = this.changeArr(res.data.Content)
+      });
+    },
+    //修改
+    changeArr(arr) {
+      let data = [];
+      arr.map(item => {
+        if (item.content && item.content.length) {
+          return item.content.map(children => {
+            if (children.content && children.content.length) {
+              return children.content.map(i => {
+                data.push(i);
+              });
+            }
+          });
+        }
+      });
+      return data;
+    },
+    //pages1改变
+    changePages1() {
+      this.getLeftData()
+    },
+    changePages2() {
+      this.getRightData()
+    },
+    changeCascader(val) {
+      this.search.category = val.code
+      this.getLeftData()
+    },
+    getAllData() {
+      console.log(this.id)
+      this.getLeftData()
+      this.getRightData()
+    },
+
+    getLeftData() {
+      this.isLoading1 = true
+      let param = {
+        data: {
+          "limit": {        // 分页查询, 选填.
+            "skip": this.pages1.size * (this.pages1.currentPage - 1),  // 跳过多少数据
+            "count": this.pages1.size   // 查询跳过300条数据之后的50条 (默认按照创建时间从大-->小排序)
+          },
+          filter: {
+            EquipLocalName: this.search.filter
+          },
+          id: "",
+          excludeSystemId: this.id,
+          type: [this.search.category == "all" ? "Eq" : this.search.category]
+        },
+        secret: this.secret,
+        ProjId: this.projectId
+      }
+      if (this.search.build == "all") {
+        param.data.id = this.projectId
+      } else if (this.search.floor && this.search.floor != "all") {
+        param.data.id = this.search.floor
+      } else if (this.search.floor == 'all') {
+        param.data.id = this.search.build
+      } else {
+        param.data.id = this.search.ProjId
+      }
+      getBillEquipList(param, res => {
+        this.tableData = res.Content
+        this.pages1.total = res.TotalCount
+        this.isLoading1 = false
+      })
+    },
+
+    getRightData() {
+      this.isLoading2 = true
+      let param = {
+        data: {
+          "limit": {        // 分页查询, 选填.
+            "skip": this.pages2.size * (this.pages2.currentPage - 1),  // 跳过多少数据
+            "count": this.pages2.size   // 查询跳过300条数据之后的50条 (默认按照创建时间从大-->小排序)
+          },
+          filter: {
+            EquipLocalName: this.search2.filter
+          },
+          criteria: {
+            fromId: this.id,
+            graphType: "SystemEquip",
+            relType: "1",
+            side: "toId",
+            type: ["Eq"]
+          }
+        },
+        secret: this.secret,
+        ProjId: this.projectId
+      }
+      getSysToEq(param, res => {
+        this.table2Data = res.Content
+        this.pages2.total = res.TotalCount
+        this.isLoading2 = false
+      })
+    },
+
+    getList() {
+
+    },
+
+    //左侧多选框改变
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+
+    //多选框发生改变
+    tableChange(val) {
+      this.SelectionList = val;
+    },
+
+    //关联
+    leftToRight() {
+      let param = {
+        data: {
+          criterias: []
+        },
+        secret: this.secret,
+        ProjId: this.projectId
+      }
+      this.multipleSelection.map(item => {
+        param.data.criterias.push({
+          from_id: this.id,
+          to_id: item.id,
+          graph_id: this.graphyId,
+          rel_type: "1",
+          infos: null
+        })
+      })
+      createRelation(param).then(res => {
+        if (res.data.Result == "success") {
+          this.$message.success("关联成功")
+          this.getAllData()
+        } else {
+          this.$message.error("请求失败:" + res.data.ResultMsg)
+        }
+      }).catch(_ => {
+        this.$message.error("请求失败")
+      })
+    },
+
+    //取消关联
+    rightToLeft() {
+      let param = {
+        data: {
+          criterias: []
+        },
+        secret: this.secret,
+        ProjId: this.projectId
+      }
+      this.SelectionList.map(item => {
+        param.data.criterias.push({
+          from_id: this.id,
+          to_id: item.id,
+          graph_id: this.graphyId,
+          rel_type: "1"
+        })
+      })
+
+      if (!!this.id) {
+        deleteRelation(param).then(res => {
+          if (res.data.Result == "success") {
+            this.$message.success("取消关联成功")
+            this.getAllData()
+          } else {
+            this.$message.error("请求失败:" + res.data.ResultMsg)
+          }
+        }).catch(_ => {
+          this.$message.error("请求失败")
+        })
+      } else {
+        this.$message.error("id为空")
+      }
+    }
+  },
+  watch: {
+    dialog: {
+      deep: true,
+      handler: function () {
+        if (this.dialog.relevance) {
+          this.search = {//第一个table的搜索条件
+            filter: "",//文本框条件
+            build: "all",//建筑
+            floor: "",//楼层
+            category: "all"//设备类别
+          }
+          this.search2 = {//第二个搜索条件
+            filter: "",//搜索文案
+          }
+          this.getAllData()
+        }
+      }
+    }
+  }
+};
+</script>
+<style lang="less">
+#tableTransfers {
+  width: 100%;
+  overflow: hidden;
+  h4 {
+    font-size: 20px;
+    font-weight: 500;
+  }
+  .search {
+    height: 100px;
+    .search-small {
+      height: 45px;
+      padding: 5px;
+    }
+    border-bottom: #dcdfe6 1px solid;
+    .search-big {
+      padding: 25px 5px;
+    }
+  }
+  .main-left {
+    float: left;
+    width: 600px;
+    height: 500px;
+  }
+  .border-view {
+    border: 1px solid #ccc;
+  }
+  .main-button {
+    float: left;
+    width: 60px;
+    height: 500px;
+    position: relative;
+    .top {
+      position: absolute;
+      bottom: 300px;
+      left: 10px;
+    }
+    .bottom {
+      position: absolute;
+      bottom: 200px;
+      left: 10px;
+    }
+  }
+  .el-button + .el-button {
+    margin: 0;
+  }
+  .main-right {
+    height: 500px;
+    float: left;
+    width: 300px;
+  }
+}
+</style>

+ 9 - 4
src/router/sagacloud.js

@@ -21,6 +21,11 @@ import buildLog from "@/views/data_admin/buildLog"
 import buildUser from "@/views/data_admin/buildUser"
 import buildData from "@/views/data_admin/buildData"
 
+/**  台账管理 */
+import systemLedger from '@/views/ledger/system'
+import facilityLedger from '@/views/ledger/facility'
+import propertyLedger from '@/views/ledger/property'
+
 export default [
     { path: '/auth', name: 'Auth', component: Auth },
     // 系统相关
@@ -86,9 +91,9 @@ export default [
         component: LayoutMain,
         children: [
             { path: '', name: 'Dasboard', component: Dasboard },
-            { path: 'facility', name: 'Dasboard', component: Dasboard },
-            { path: 'system', name: 'Dasboard', component: Dasboard },
-            { path: 'property', name: 'Dasboard', component: Dasboard }
+            { path: 'facility', name: 'facilityLedger', component: facilityLedger },
+            { path: 'system', name: 'systemLedger', component: systemLedger },
+            { path: 'property', name: 'propertyLedger', component: propertyLedger }
         ]
     },
     //业务空间管理    
@@ -128,7 +133,7 @@ export default [
         component: LayoutMain,
         children: [
             { path: '', name: 'buildData', component: buildData },
-            { path: 'data', name: 'buildData', component: buildData},
+            { path: 'data', name: 'buildData', component: buildData },
             { path: 'plan', name: 'Dasboard', component: Dasboard },
             { path: 'abnormalprop', name: 'buildAssets', component: buildAssets },
             { path: 'log', name: 'buildLog', component: buildLog },

+ 15 - 0
src/views/ledger/facility/index.vue

@@ -0,0 +1,15 @@
+<template>
+    <div>
+        设备
+    </div>
+</template>
+<script>
+export default {
+    data(){ return {}},
+    created(){},
+    mounted(){},
+    methods:{}
+}
+</script>
+<style>
+</style>

+ 15 - 0
src/views/ledger/property/index.vue

@@ -0,0 +1,15 @@
+<template>
+    <div>
+        资产
+    </div>
+</template>
+<script>
+export default {
+    data(){ return {}},
+    created(){},
+    mounted(){},
+    methods:{}
+}
+</script>
+<style>
+</style>

+ 182 - 0
src/views/ledger/system/index.vue

@@ -0,0 +1,182 @@
+<!--
+    系统清单
+-->
+<template>
+  <div id="deviceList">
+    <saga-title :mess="mess"></saga-title>
+    <div class="table-main">
+      <div class="search-header">
+        <floor-cascader :type="'no'" @change="changeFloor"></floor-cascader>
+        <my-cascader ref="cascader" @change="changeDevice"></my-cascader>
+      </div>
+      <hanson-table @close="close" ref="tableMain"></hanson-table>
+    </div>
+    <table-transfers></table-transfers>
+  </div>
+</template>
+<script>
+import sagaTitle from "@/components/ledger/lib/title";
+import floorCascader from "@/components/ledger/lib/floorCascader";
+import myCascader from "@/components/ledger/lib/system";
+import hansonTable from "@/components/ledger/handsontables/system";
+import tableTransfers from "@/components/ledger/tableTransfers";
+import {
+    mapGetters,
+    mapActions
+} from "vuex";
+import { getAllbusiness, getFamilyList, getSpaceName } from "@/api/scan/request"
+
+export default {
+  components: {
+    sagaTitle,
+    floorCascader,
+    myCascader,
+    hansonTable,
+    tableTransfers
+  },
+  data() {
+    return {
+      mess: {
+        perjectName: "",
+        name: [
+          {
+            key: "系统",
+            num: 0
+          }
+        ]
+      },
+      param: {
+        buildId: "",
+        floorId: "",
+        deviceId: "",
+        ProjId: '',
+        secret: ''
+      }
+    };
+  },
+  computed: {
+        ...mapGetters("peojMess", [
+            "projectId",
+            "secret",
+            "userId"
+        ])
+    },
+  created() {
+      this.param.ProjId = this.projectId
+      this.param.secret = this.secret
+    this.getProjName()
+  },
+  mounted() { },
+  methods: {
+    getProjName() {
+      let param = {
+        list: [{ id: this.param.ProjId }],
+        perjectId: this.param.ProjId,
+        secret: this.param.secret,
+      }
+      getSpaceName(param).then(res => {
+        if (res.data.Result == "success") {
+          this.mess.perjectName = res.data.Content[0].infos.ProjLocalName
+          this.getAllbusiness()
+        } else {
+          this.$message.error("请求失败:" + res.data.ResultMsg)
+        }
+      }).catch(_ => {
+        this.$message.error("请求失败")
+      })
+    },
+    getFamilyList() {
+      let param = {
+        ProjId: this.param.ProjId,
+        secret: this.param.secret,
+        data: { type: "Sy" }
+      }
+      getFamilyList(param, res => {
+        this.$refs.cascader.pushData(res.Content)
+      })
+    },
+    close(val) {
+      this.getProjName()
+      console.log(val)
+      if (!!val && !!val.code) {
+        this.$refs.cascader.changeVal([val.code])
+      }
+    },
+
+    //获取header的list
+    getAllbusiness() {
+      let param = {
+        ProjId: this.param.ProjId,
+        secret: this.param.secret,
+        data: {
+          criteria: {
+            type: ["Sy"]
+          },
+          returnInfos: ["SystemID"]
+        }
+      }
+      getAllbusiness(param).then(res => {
+        if (res.data.Result == "success") {
+          this.mess.name[0].num = res.data.Count
+          this.getFamilyList()
+        } else {
+          this.$message.error("请求失败" + res.data.resultMsg)
+        }
+      }).catch(res => { this.$message.error("请求失败") })
+    },
+
+    //修改楼层
+    changeFloor(value) {
+      console.log(this.param);
+      if (value[0]) {
+        this.param.buildId = value[0]
+      }
+      if (value[1]) {
+        this.param.floorId = value[1]
+      } else {
+        this.param.floorId = null
+      }
+      if (!!this.param.deviceId) {
+        this.$refs.tableMain.getHeaderData(this.param);
+      } else {
+        return;
+      }
+    },
+
+    //修改设备族
+    changeDevice(value) {
+      console.log(value)
+      this.param.deviceId = value.code
+      if (!!value) {
+        this.$refs.tableMain.getHeaderData(this.param);
+      } else {
+        return;
+      }
+
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+#deviceList {
+  overflow: hidden;
+  height: 100%;
+  background-color: #f6f6f6;
+  .table-main {
+    position: absolute;
+    top: 140px;
+    bottom: 10px;
+    left: 10px;
+    right: 10px;
+    background-color: #fff;
+    border: 1px solid #ccc;
+    border-radius: 5px;
+    padding: 10px;
+  }
+  .search-header {
+    overflow: hidden;
+    padding-bottom: 10px;
+    border-bottom: 1px solid #bcbcbc;
+  }
+}
+</style>