Browse Source

modify device

haojianlong 5 years ago
parent
commit
1de817ecd8

+ 7 - 0
src/api/scan/request.js

@@ -908,6 +908,13 @@ export function deleteEquip(param, success) {
     http.postJson(url, data, success)
 }
 
+//设备清单 - 查询系统关联专业
+export function queryLinkSys(param, success) {
+    let url = `${baseUrl}/datacenter/general—system/query`;
+    let data = param;
+    http.postJson(url, data, success)
+}
+
 //设备清单 - 设备关联系统
 export function equipLinkSys(param, success) {
     let url = `${baseUrl}/datacenter/sy-in-eq/link-sy`;

+ 7 - 1
src/components/dialogs/list/systemType.vue

@@ -39,7 +39,13 @@
 </template>
 <script>
 import myPagination from "@/components/ledger/lib/myPagination";
-import { getLib, getAllbusiness, getEqCode, getRelation } from "@/api/scan/request"
+import {
+  getLib,
+  getAllbusiness,
+  getEqCode,
+  getRelation,
+  queryLinkSys
+} from "@/api/scan/request"
 import tools from "@/utils/scan/tools"
 import { mapGetters } from 'vuex'
 export default {

+ 8 - 37
src/views/ledger/facility/addfacility.vue

@@ -7,7 +7,7 @@
       <span style="float:left;">当前选择的设备类型:{{category.name}}</span>
       <div style="width:200px;display:inline-block;text-align:left;color:gray;">
         <span>隐藏自动填充的信息</span>
-        <el-checkbox v-model="isWatch" @change="getTableHeader"></el-checkbox>
+        <el-checkbox v-model="showTypeFlag" @change="getTableHeader"></el-checkbox>
       </div>
       <span>增加</span>
       <el-input v-model="addNum" style="width:40px;" size="small"></el-input>
@@ -100,7 +100,6 @@ export default {
           ? session.get("deviceAddData")
           : [{ Checked: 1 }]
         : [{ Checked: 1 }],
-      isWatch: true,
       copyTableData: [],
       category: "", //当前设备类
       myDialog: {
@@ -127,21 +126,7 @@ export default {
       systemId: null,
       graphyId: null,
       id: 0,
-      readArr: [
-        "A1",
-        "A2",
-        "B1",
-        "C5",
-        "D1",
-        "D2",
-        "E1",
-        "F1",
-        "F2",
-        "L",
-        "L1",
-        "L2",
-        "M"
-      ],
+      showTypeFlag: true,
       EquipmentList: [],
       firmId: "" //品牌型号所需字段--族id三位编码(传设备类id或部件类id)
     };
@@ -371,35 +356,20 @@ export default {
     //格式化表头显示的数据
     formatHeaderData(list) {
       let arr = tools.copyArr(list);
-      arr.map(item => {
-        item.Visible = true;
-      });
-      if (!this.onlyRead) {
-        this.readArr.push("Own");
-      }
-      let data = showTools.tableHeadFilter(
-        arr,
-        this.readArr,
-        this.onlyRead,
-        this.isWatch,
-        false
-      );
+      let showType = this.showTypeFlag?'partInfo':'all';
+      let data = showTools.headerTextFilter(arr, 'equipment', this.onlyRead, showType, true);
       data.unshift("同时创建资产", "所属系统实例");
       if (this.floorFlag) {
         data.splice(1, 0, "所属建筑楼层")
       }
+      console.log(this.showTypeFlag)
       return data;
     },
     formatHeaderType(list) {
       //格式化表头头映射的数据
       let arr = tools.copyArr(list);
-      let data = showTools.tableHeaderTypes(
-        arr,
-        this.readArr,
-        this.onlyRead,
-        this.isWatch,
-        false
-      );
+      let showType = this.showTypeFlag?'partInfo':'all';
+      let data = showTools.headerTypeFilter(arr, 'equipment', this.onlyRead, showType, true);
       data.unshift({
         type: "checkbox",
         checkedTemplate: 1,
@@ -600,6 +570,7 @@ export default {
     getInfors(infos, row) {
       //其他的开始判断
       let val = this.tableExample.colToProp(row.col);
+      console.log(val)
       //设备二维码图片
       if (val == "EquipQRCode") {
         this.myDialog.qrcode = true;