qukaidi 2 vuotta sitten
vanhempi
commit
f4f7d737d7

+ 180 - 122
src/views/basicdata/dept/index.vue

@@ -2,22 +2,13 @@
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
       <el-form-item label="仓库名称" prop="fName">
-        <el-input
-          v-model="queryParams.fName"
-          placeholder="请输入仓库名称"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
+        <el-input v-model="queryParams.fName" placeholder="请输入仓库名称" clearable size="small"
+          @keyup.enter.native="handleQuery" />
       </el-form-item>
       <el-form-item label="状态" prop="status">
         <el-select v-model="queryParams.status" placeholder="仓库状态" clearable size="small">
-          <el-option
-            v-for="dict in statusOptions"
-            :key="dict.dictValue"
-            :label="dict.dictLabel"
-            :value="dict.dictValue"
-          />
+          <el-option v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictLabel"
+            :value="dict.dictValue" />
         </el-select>
       </el-form-item>
       <el-form-item>
@@ -28,27 +19,14 @@
 
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['basicdata:warehouse:add']"
-        >新增</el-button>
+        <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd"
+          v-hasPermi="['basicdata:warehouse:add']">新增</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table
-      v-loading="loading"
-      :data="deptList"
-      row-key="fId"
-      :default-expand-all="false"
-      lazy
-      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
-      :load="getTreeLoad"
-      ref="table"
-    >
+    <el-table v-loading="loading" :data="deptList" row-key="fId" :default-expand-all="false" lazy
+      :tree-props="{children: 'children', hasChildren: 'hasChildren'}" :load="getTreeLoad" ref="table">
       <el-table-column prop="fName" label="仓库名称" width="310"></el-table-column>
       <el-table-column prop="fTotalgross" label="库容(吨)" width="100"></el-table-column>
       <el-table-column prop="fLocation" label="库位" width="100">
@@ -88,48 +66,65 @@
       </el-table-column>
       <el-table-column label="操作" align="center" width="200" fixed="right" class-name="small-padding fixed-width">
         <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['basicdata:warehouse:edit']"
-          >修改</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-plus"
-            @click="handleAdd(scope.row)"
-            v-hasPermi="['basicdata:warehouse:add']"
-          >新增</el-button>
-          <el-button
-            v-if="scope.row.parentId != 0"
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['basicdata:warehouse:remove']"
-          >删除</el-button>
+          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
+            v-hasPermi="['basicdata:warehouse:edit']">修改</el-button>
+          <el-button size="mini" type="text" icon="el-icon-plus" @click="handleAdd(scope.row)"
+            v-hasPermi="['basicdata:warehouse:add']">新增</el-button>
+          <el-button size="mini" type="text" icon="el-icon-plus" v-if="scope.row.fLocation === 1"
+            @click="handleView(scope.row)">查看监控</el-button>
+          <el-button v-if="scope.row.parentId != 0" size="mini" type="text" icon="el-icon-delete"
+            @click="handleDelete(scope.row)" v-hasPermi="['basicdata:warehouse:remove']">删除</el-button>
         </template>
       </el-table-column>
     </el-table>
+    <el-dialog title="监控列表" v-dialogDrag :visible.sync="dialogVideoList" :close-on-click-modal="false">
+      <el-table v-loading="loading" :data="list" style="width: 100%;">
+        <el-table-column label="序号" type="index" width="50" />
+        <el-table-column label="仓库" :width="200" prop="fWarehouseName" header-align="center" align="center"
+          :show-overflow-tooltip="true" />
+        <el-table-column label="库位" :width="200" prop="libraryPosition" header-align="center" align="center"
+          :show-overflow-tooltip="true" />
+        <el-table-column label="监控项目" :width="200" prop="projectId" header-align="center" align="center"
+          :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <span>
+              {{ scope.row.projectId | projectIdFormat(projectIdOptions) }}
+            </span>
+          </template>
 
+        </el-table-column>
+        <el-table-column label="设备序列号" :width="200" prop="deviceName" header-align="center" align="center"
+          :show-overflow-tooltip="true" />
+        <el-table-column label="仓库" :width="200" prop="deviceSerial" header-align="center" align="center"
+          :show-overflow-tooltip="true" />
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100" fixed="right">
+          <template slot-scope="scope">
+            <el-button size="mini" type="text" icon="el-icon-view" @click="rowView(scope.row)">
+              查看视频
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-dialog>
+    <el-dialog title="查看监控" v-dialogDrag :visible.sync="dialogVideo" :close-on-click-modal="false" @closed="videoClose">
+      <div style="width:100%; height:80vh;">
+        <iframe v-if="dialogVideo" :src="iframeSrc" width="100%" height="100%" frameborder="0" scrolling="no">
+        </iframe>
+      </div>
+    </el-dialog>
     <!-- 添加或修改仓库对话框 -->
-    <el-dialog
-      v-dialogDrag
-      :fullscreen="dialogFull"
-      :title="title"
-      :visible.sync="open"
-      :close-on-click-modal="false"
+    <el-dialog v-dialogDrag :fullscreen="dialogFull" :title="title" :visible.sync="open" :close-on-click-modal="false"
       width="70%" append-to-body>
       <template slot="title">
         <div class="avue-crud__dialog__header">
-            <span class="el-dialog__title">
-            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>
+          <span class="el-dialog__title">
+            <span
+              style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>
             添加仓库
-            </span>
+          </span>
           <div class="avue-crud__dialog__menu enlarge" @click="full">
-            <i  style="cursor: pointer;display: block;width:12px;height:12px;border:1px solid #909399;border-top:3px solid #909399;margin-top: -3px;"></i>
+            <i
+              style="cursor: pointer;display: block;width:12px;height:12px;border:1px solid #909399;border-top:3px solid #909399;margin-top: -3px;"></i>
           </div>
         </div>
       </template>
@@ -138,7 +133,8 @@
         <el-row>
           <el-col :span="8" v-if="form.parentId !== 0">
             <el-form-item label="上级仓库" prop="parentId">
-              <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级仓库" />
+              <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer"
+                placeholder="选择上级仓库" />
             </el-form-item>
           </el-col>
         </el-row>
@@ -146,12 +142,12 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="仓库编号" prop="fNo">
-              <el-input v-model="form.fNo"  placeholder="请输入仓库编号" />
+              <el-input v-model="form.fNo" placeholder="请输入仓库编号" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="仓库名称" prop="fName">
-              <el-input v-model="form.fName" placeholder="请输入仓库名称" @change="nameChange"/>
+              <el-input v-model="form.fName" placeholder="请输入仓库名称" @change="nameChange" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -161,7 +157,7 @@
                 <el-option label="否" value="0" />
               </el-select>
             </el-form-item>
-           </el-col>
+          </el-col>
         </el-row>
         <el-row>
           <el-col :span="8">
@@ -175,8 +171,8 @@
               <el-input v-model="form.fAddr" placeholder="请输入地址" />
             </el-form-item>
           </el-col>
-<!--        </el-row>-->
-<!--        <el-row>-->
+          <!--        </el-row>-->
+          <!--        <el-row>-->
           <el-col :span="8">
             <el-form-item label="联系人" prop="fContacts">
               <el-input v-model="form.fContacts" placeholder="请输入联系人" />
@@ -184,36 +180,28 @@
           </el-col>
           <el-col :span="8">
             <el-form-item label="电话" prop="fTel">
-              <el-input v-model="form.fTel"
-                        placeholder="请输入电话"
-                        oninput='this.value=this.value.replace(/[^\-?\d]/g,"")'
-              />
+              <el-input v-model="form.fTel" placeholder="请输入电话"
+                oninput='this.value=this.value.replace(/[^\-?\d]/g,"")' />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="是否计费" prop="fCharg">
-              <el-select
-                v-model="form.fCharg"
-                style="width: 100%"
-              >
+              <el-select v-model="form.fCharg" style="width: 100%">
                 <el-option label="是" value="1" />
                 <el-option label="否" value="0" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item v-if="form.fLocation === '1'" label="库容(吨)" prop="fTotalgross" >
-              <el-input v-model="form.fTotalgross" placeholder="请输入库容(吨位)"/>
+            <el-form-item v-if="form.fLocation === '1'" label="库容(吨)" prop="fTotalgross">
+              <el-input v-model="form.fTotalgross" placeholder="请输入库容(吨位)" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="状态">
               <el-radio-group v-model="form.fStatus">
-                <el-radio
-                  v-for="dict in statusOptions"
-                  :key="dict.dictValue"
-                  :label="dict.dictValue"
-                >{{dict.dictLabel}}</el-radio>
+                <el-radio v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictValue">{{dict.dictLabel}}
+                </el-radio>
               </el-radio-group>
             </el-form-item>
           </el-col>
@@ -221,10 +209,7 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="是否保税">
-              <el-select
-                v-model="form.fIsBonded"
-                style="width: 100%"
-              >
+              <el-select v-model="form.fIsBonded" style="width: 100%">
                 <el-option label="是" value="1" />
                 <el-option label="否" value="0" />
               </el-select>
@@ -232,10 +217,7 @@
           </el-col>
           <el-col :span="8">
             <el-form-item label="简称" prop="fCname">
-              <el-input
-                v-model="form.fCname"
-                placeholder="请输入简称"
-              ></el-input>
+              <el-input v-model="form.fCname" placeholder="请输入简称"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -260,10 +242,7 @@
           <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
         </el-form-item>
       </el-form>
-      <up-load
-        :relevantAttachments="relevantAttachments"
-        :createBy="username"
-      ></up-load>
+      <up-load :relevantAttachments="relevantAttachments" :createBy="username"></up-load>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
@@ -274,12 +253,13 @@
 
 <script>
 import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild, lazyListDept } from "@/api/basicdata/dept";
+import { list } from "@/api/monitor/monitorList";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import Vue from 'vue'
 import upLoad from "@/views/Warehousing/components/upLoad";
 import Cookies from "js-cookie";
-
+import Axios from "axios";
 Vue.directive('dialogDrag', {
   bind(el, binding, vnode, oldVnode) {
     const dialogHeaderEl = el.querySelector('.el-dialog__header')
@@ -289,7 +269,7 @@ Vue.directive('dialogDrag', {
 
     // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
     const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)
-    if(enlarge){
+    if (enlarge) {
       enlarge.onclick = (e) => {
         dragDom.style.top = '0px'
         dragDom.style.left = '0px'
@@ -312,14 +292,14 @@ Vue.directive('dialogDrag', {
         styT = +sty.top.replace(/\px/g, '')
       }
 
-      document.onmousemove = function(e) {
+      document.onmousemove = function (e) {
         // 通过事件委托,计算移动的距离
         const l = e.clientX - disX
         const t = e.clientY - disY
 
         // 移动当前元素
 
-        if ((t + styT) >= 0){
+        if ((t + styT) >= 0) {
           dragDom.style.top = `${t + styT}px`
         }
         dragDom.style.left = `${l + styL}px`
@@ -327,7 +307,7 @@ Vue.directive('dialogDrag', {
         // binding.value({x:e.pageX,y:e.pageY})
       }
 
-      document.onmouseup = function(e) {
+      document.onmouseup = function (e) {
         document.onmousemove = null
         document.onmouseup = null
       }
@@ -342,15 +322,20 @@ export default {
   },
   data() {
     return {
+      total: 0,
+      // 表格数据
+      list: [],
+      dialogVideoList: false,
+      dialogVideo: false,
       //全屏放大
-      dialogFull:false,
+      dialogFull: false,
       // 遮罩层
       loading: true,
       // 显示搜索条件
       showSearch: true,
       // 表格树数据
       deptList: [],
-      maps:[],
+      maps: [],
       // 仓库树选项
       deptOptions: [],
       // 弹出层标题
@@ -400,7 +385,8 @@ export default {
         ]
       },
       relevantAttachments: [],
-      username:null,
+      username: null,
+      projectIdOptions:[],
     };
   },
   created() {
@@ -408,11 +394,75 @@ export default {
     this.getDicts("sys_normal_disable").then(response => {
       this.statusOptions = response.data;
     });
+    this.getDicts("monitor_project").then((response) => {
+      this.projectIdOptions = response.data;
+    });
     this.username = Cookies.get("userName");
   },
+  filters: {
+    projectIdFormat(row, list) {
+      let name = ""
+      list.map((e) => {
+        if (row == e.dictValue) {
+          name = e.dictLabel;
+        }
+      });
+      return name;
+    }
+  },
   methods: {
+    handleView(row) {
+      this.dialogVideoList = true;
+      this.loading = true;
+      let data = {
+        fWarehouseId: row.parentId,
+        libraryPositionId: row.fId
+      }
+      list(data).then(response => {
+        this.list = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    rowView(row) {
+      Axios.post("/prod-api/api/LiveBroadcast/getAccessToken").then(res => {
+        Axios.post(`/prod-api/api/LiveBroadcast/getToken?productCode=1640070936703286&token=${res.data.data.access_token}`).then(res2 => {
+          console.log(res2)
+          Axios({
+            method: 'POST',
+            url: '/prod-api/api/LiveBroadcast/videoWeb',
+            params: {
+              deviceSerial: row.deviceSerial,
+              projectId: row.projectId,
+              channelNo: row.code,
+              token: res.data.data.access_token,
+              Authorization: res2.data.data.data.Authorization
+            }
+          })
+            .then(response => {
+              this.dialogVideo = true
+              this.iframeSrc = response.data.data.data.previewUrl
+              this.start()
+            });
+        })
+      })
+    },
+    videoClose() {
+      this.iframeSrc = this.$options.data().iframeSrc;
+      this.end()
+    },
+    start() {
+      // 将定时器名字赋值到变量中
+      this.timer = setTimeout(() => {
+        this.dialogVideo = false;
+      }, 60000);
+    },
+    end() {
+      clearInterval(this.timer);
+      this.timer = null
+    },
     //全屏放大
-    full(){
+    full() {
       this.dialogFull = !this.dialogFull
     },
     /** 查询仓库列表 */
@@ -428,7 +478,7 @@ export default {
       // });
     },
     getTreeLoad(tree, treeNode, resolve) {
-      lazyListDept({parentId: tree.fId}).then(res => {
+      lazyListDept({ parentId: tree.fId }).then(res => {
         resolve(res.data)
       })
     },
@@ -463,7 +513,7 @@ export default {
         phone: undefined,
         email: undefined,
         status: "0",
-        fLocation:'0'
+        fLocation: '0'
       };
       this.relevantAttachments = []
       this.resetForm("form");
@@ -489,7 +539,7 @@ export default {
       this.open = true;
       this.title = "添加仓库";
       listDept().then(response => {
-	        this.deptOptions = this.handleTree(response.data, "fId");
+        this.deptOptions = this.handleTree(response.data, "fId");
       });
     },
     /** 修改按钮操作 */
@@ -499,16 +549,16 @@ export default {
         this.form = response.data;
         this.form.fLocation = this.form.fLocation + ''
         this.form.fCharg = this.form.fCharg + ''
-        this.relevantAttachments = this.form.annexList? this.form.annexList: [];
+        this.relevantAttachments = this.form.annexList ? this.form.annexList : [];
         this.open = true;
         this.title = "修改仓库";
       });
       listDeptExcludeChild(row.fId).then(response => {
-	        this.deptOptions = this.handleTree(response.data, "fId");
+        this.deptOptions = this.handleTree(response.data, "fId");
       });
     },
     /** 提交按钮 */
-    submitForm: function() {
+    submitForm: function () {
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.fId != undefined) {
@@ -533,16 +583,16 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       this.$confirm('是否确认删除名称为"' + row.fName + '"的数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delDept(row.fId);
-        }).then(() => {
-          // this.getList();
-          location.reload();
-          this.msgSuccess("删除成功");
-        })
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return delDept(row.fId);
+      }).then(() => {
+        // this.getList();
+        location.reload();
+        this.msgSuccess("删除成功");
+      })
     },
     nameChange() {
       this.$set(this.form, 'fCname', this.form.fName)
@@ -562,22 +612,27 @@ export default {
   -ms-flex-pack: justify;
   justify-content: space-between;
 }
+
 .el-dialog__title {
-  color: rgba(0,0,0,.85);
+  color: rgba(0, 0, 0, .85);
   font-weight: 500;
   word-wrap: break-word;
 }
+
 .avue-crud__dialog__menu {
   padding-right: 20px;
   float: left;
 }
+
 .avue-crud__dialog__menu i {
   color: #909399;
   font-size: 15px;
 }
-.el-icon-full-screen{
+
+.el-icon-full-screen {
   cursor: pointer;
 }
+
 .el-icon-full-screen:before {
   content: "\e719";
 }
@@ -587,15 +642,18 @@ export default {
   display: flex;
   justify-content: flex-end;
 }
+
 .listStyle {
   display: flex;
   border-top: 1px solid #dcdfe6;
   border-left: 1px solid #dcdfe6;
   border-right: 1px solid #dcdfe6;
 }
+
 .listStyle:last-child {
   border-bottom: 1px solid #dcdfe6;
 }
+
 .progress {
   display: flex;
   align-items: center;

+ 40 - 11
src/views/monitor/monitorList/index.vue

@@ -41,22 +41,16 @@
         :prop="item.label" header-align="center" :align="item.align" :fixed="item.fixed" :show-overflow-tooltip="true">
         <template slot-scope="scope">
           <span v-if="item.label == 'projectId'">
-            {{  scope.row.projectId | projectIdFormat(projectIdOptions)  }}
+            {{ scope.row.projectId | projectIdFormat(projectIdOptions) }}
           </span>
-          <span v-else>{{  scope.row[item.label]  }}</span>
+          <span v-else>{{ scope.row[item.label] }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" fixed="right">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100" fixed="right">
         <template slot-scope="scope">
           <el-button size="mini" type="text" icon="el-icon-view" @click="rowView(scope.row)">
             查看视频
           </el-button>
-          <el-button size="mini" type="text" icon="el-icon-edit" @click="rowDell(scope.row)">
-            修改
-          </el-button>
-          <!-- <el-button size="mini" type="text" icon="el-icon-delete" @click="rowDel(scope.row)" disabled>
-            删除
-          </el-button> -->
         </template>
       </el-table-column>
     </el-table>
@@ -73,6 +67,13 @@
                 :value="item.fId"></el-option>
             </el-select>
           </el-form-item>
+          <el-form-item label="库区" prop="libraryPositionId">
+            <el-select v-model="form.libraryPositionId" clearable filterable style="width: 100%" placeholder="请选择库区"
+              size="small" @change="libraryPositionChange">
+              <el-option v-for="(item, index) in positionList" :key="index.fId" :label="item.fName" :value="item.fId">
+              </el-option>
+            </el-select>
+          </el-form-item>
           <el-form-item label="监控项目" prop="projectId">
             <el-select v-model="form.projectId" clearable placeholder="请选择监控项目" style="width:100%">
               <el-option v-for="(item, index) in projectIdOptions" :key="index.dictValue" :label="item.dictLabel"
@@ -92,7 +93,7 @@
       </span>
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="submit(title)">{{  title == '添加' ? '保 存' : '修 改'  }}</el-button>
+        <el-button type="primary" @click="submit(title)">{{ title == '添加' ? '保 存' : '修 改' }}</el-button>
       </span>
     </el-dialog>
     <el-dialog title="查看监控" v-dialogDrag :visible.sync="dialogVideo" :close-on-click-modal="false" @closed="videoClose">
@@ -109,6 +110,7 @@
 import { tableOption } from "./js/index";
 import { list, addRow, editRow } from "@/api/monitor/monitorList";
 import { listWarehousesss } from '@/api/basicdata/warehouse'
+import { listDept } from "@/api/basicdata/dept";
 import columnSetting from "@/components/ColumnSetting/index";
 import Axios from "axios";
 
@@ -118,7 +120,10 @@ export default {
     return {
       title: '添加',
       iframeSrc: '',
-      form: {},
+      form: {
+        libraryPositionId:null,
+        libraryPosition:null
+      },
       tableOption: tableOption,
       dialogVideo: false,
       dialogVisible: false,
@@ -138,10 +143,14 @@ export default {
       showSearch: true,
       projectIdOptions: [],
       warehouseOptions: [],
+      positionList: [],
       rules: {
         fWarehouseId: [
           { required: true, message: ' ', trigger: 'blur' }
         ],
+        libraryPositionId: [
+          { required: true, message: ' ', trigger: 'blur' }
+        ],
         projectId: [
           { required: true, message: ' ', trigger: 'blur' }
         ],
@@ -225,8 +234,28 @@ export default {
             this.form.fWarehouseName = item.fName
           }
         })
+        this.positionList = []
+        listDept({ parentId: row }).then(res => {
+          this.positionList = res.data
+        })
+        this.form.libraryPositionId = null
+        this.form.libraryPosition = null
       } else {
         this.form.fWarehouseName = null
+        this.form.libraryPositionId = null
+        this.form.libraryPosition = null
+        this.positionList = []
+      }
+    },
+    libraryPositionChange(row) {
+      if (row) {
+        this.positionList.forEach(item => {
+          if (row == item.fId) {
+            this.form.libraryPosition = item.fName
+          }
+        })
+      } else {
+        this.form.libraryPosition = null
       }
     },
     submit(status) {

+ 11 - 3
src/views/monitor/monitorList/js/index.js

@@ -8,6 +8,14 @@ export const tableOption = [{
 },
 {
   surface: "2",
+  label: "libraryPosition",
+  name: "库位",
+  align: "center",
+  checked: 0,
+  width: 200,
+},
+{
+  surface: "3",
   label: "projectId",
   name: "监控项目",
   align: "center",
@@ -15,7 +23,7 @@ export const tableOption = [{
   width: 200,
 },
 {
-  surface: "2",
+  surface: "4",
   label: "deviceName",
   name: "设备名称",
   align: "center",
@@ -23,7 +31,7 @@ export const tableOption = [{
   width: 200,
 },
 {
-  surface: "3",
+  surface: "5",
   label: "deviceSerial",
   name: "设备序列号",
   align: "center",
@@ -31,7 +39,7 @@ export const tableOption = [{
   width: 200,
 },
 {
-  surface: "4",
+  surface: "6",
   label: "code",
   name: "通道号",
   align: "center",