浏览代码

新增设备所属产线查询功能

oyq28 3 年之前
父节点
当前提交
c0c97b6d20

+ 676 - 457
imcs-ui/src/views/zuihou/resourceProductMgr/deviceMgr/Index.vue

@@ -1,36 +1,73 @@
 <template>
   <div class="app-container">
-		<!-- 搜索模块 -->
+    <!-- 搜索模块 -->
     <div class="filter-container">
-    	<span>
-    		<span>{{$t("resource.searchForm.name")}}:</span>
-    		<el-input v-model="queryParams.model.name" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
-    	</span>
-    	<span style="margin-left: 15px;">
-    		<span>{{$t("resource.searchForm.no")}}:</span>
-    		<el-input v-model="queryParams.model.code" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
-    	</span>
-      <span style="margin-left: 15px;">
-	      <el-button plain type="primary" icon="el-icon-search" size="medium" @click="search">
-	        {{ $t("table.search") }}
-	      </el-button>
-	      <el-button plain type="warning" icon="el-icon-refresh" size="medium" @click="reset">
-	        {{ $t("table.reset") }}
-	      </el-button>
+      <span>
+        <span>{{ $t("resource.table.resours.zoneName") }}:</span>
+        <el-select
+          v-model="queryParams.model.zoneId"
+          placeholder="请选择"
+          style="width: 20%"
+        >
+          <el-option
+            v-for="(item, index) in zoneList"
+            :key="index"
+            :label="item.name"
+            :value="item.id"
+          />
+        </el-select>
+      </span>
+      <span>
+        <span>{{ $t("resource.searchForm.name") }}:</span>
+        <el-input
+          v-model="queryParams.model.name"
+          :placeholder="$t('common.pleaseEnter')"
+          style="width: 150px"
+          size="medium"
+        />
+      </span>
+      <span style="margin-left: 15px">
+        <span>{{ $t("resource.searchForm.no") }}:</span>
+        <el-input
+          v-model="queryParams.model.code"
+          :placeholder="$t('common.pleaseEnter')"
+          style="width: 150px"
+          size="medium"
+        />
+      </span>
+      <span style="margin-left: 15px">
+        <el-button
+          plain
+          type="primary"
+          icon="el-icon-search"
+          size="medium"
+          @click="search"
+        >
+          {{ $t("table.search") }}
+        </el-button>
+        <el-button
+          plain
+          type="warning"
+          icon="el-icon-refresh"
+          size="medium"
+          @click="reset"
+        >
+          {{ $t("table.reset") }}
+        </el-button>
       </span>
     </div>
 
     <!-- 功能按钮 -->
     <el-row class="filter-container">
-    	<el-col>
-    		<!--<el-button type="primary" icon="el-icon-s-tools" size="medium">{{ $t("resource.buttons.setBtn") }}</el-button>-->
-	      <!--<el-button type="danger" icon="el-icon-delete" size="medium" @click="batchDelete">
+      <el-col>
+        <!--<el-button type="primary" icon="el-icon-s-tools" size="medium">{{ $t("resource.buttons.setBtn") }}</el-button>-->
+        <!--<el-button type="danger" icon="el-icon-delete" size="medium" @click="batchDelete">
 	        {{ $t("table.delete") }}
 	      </el-button>-->
-    	</el-col>
+      </el-col>
     </el-row>
 
-		<!-- 列表数据 -->
+    <!-- 列表数据 -->
     <el-table
       :key="tableKey"
       ref="table"
@@ -39,68 +76,177 @@
       border
       fit
       row-key="id"
-      style="width: 100%;"
+      style="width: 100%"
       highlight-current-row
-    	@current-change="handleCurrentChange"
+      @current-change="handleCurrentChange"
     >
-    	<el-table-column :label='$t("common.serialNo")' width="55px" align="center">
-	      <template slot-scope="scope">
-	        <div>
-	          {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
-	        </div>
-	      </template>
+      <el-table-column
+        :label="$t('common.serialNo')"
+        width="55px"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <div>
+            {{
+              scope.$index + (queryParams.current - 1) * queryParams.size + 1
+            }}
+          </div>
+        </template>
       </el-table-column>
-      <el-table-column prop="pic" :label='$t("resource.table.resours.pic")' align="center" width="150px">
-      	<template slot-scope="{ row }">
-      		<div v-if="row.pic" class="demo-image__preview">
-					  <el-image
-					    style="width: 100px; height: 60px"
-					    :src="row.pic"
-					    :preview-src-list="row.srcList">
-					  </el-image>
-					</div>
-					<span v-else>{{$t("common.noData")}}</span>
-      	</template>
+      <el-table-column
+        prop="pic"
+        :label="$t('resource.table.resours.pic')"
+        align="center"
+        width="150px"
+      >
+        <template slot-scope="{ row }">
+          <div v-if="row.pic" class="demo-image__preview">
+            <el-image
+              style="width: 100px; height: 60px"
+              :src="row.pic"
+              :preview-src-list="row.srcList"
+            >
+            </el-image>
+          </div>
+          <span v-else>{{ $t("common.noData") }}</span>
+        </template>
       </el-table-column>
-      <el-table-column prop="name" :label='$t("resource.table.resours.name")' :show-overflow-tooltip="true" width="180px"></el-table-column>
-      <el-table-column prop="code" :label='$t("resource.table.resours.no")' :show-overflow-tooltip="true" width="100px"></el-table-column>
-      <el-table-column prop="brand" :label='$t("resource.table.resours.brand")' width="100px" v-if="this.$store.state.account.permissions.includes('resource:superview')"></el-table-column>
-      <el-table-column prop="specification" :label='$t("resource.table.resours.specification")'></el-table-column>
-      
-	  <el-table-column prop="capitalNo" :label='$t("resource.table.resours.capitalNo")'></el-table-column>
-	  <el-table-column prop="capitalName" :label='$t("resource.table.resours.capitalName")'></el-table-column>
-	  <el-table-column prop="capitalType" :label='$t("resource.table.resours.capitalType")'></el-table-column>
-	  <el-table-column prop="modeSpecification" :label='$t("resource.table.resours.modeSpecification")'></el-table-column>
-	  <el-table-column prop="capitalPrice" :label='$t("resource.table.resours.capitalPrice")'></el-table-column>
-	  <el-table-column prop="productionDate" :label='$t("resource.table.resours.productionDate")'></el-table-column>
-      <el-table-column prop="productionNo" :label='$t("resource.table.resours.productionNo")'></el-table-column>
-	  <el-table-column prop="manufacturer" :label='$t("resource.table.resours.manufacturer")'></el-table-column>
-   
-	  <el-table-column prop="model" :label='$t("resource.table.resours.model")' v-if="this.$store.state.account.permissions.includes('resource:superview')" ></el-table-column>
-      <el-table-column prop="category.data" :label='$t("resource.table.resours.category")' width="100px"></el-table-column>
-      <el-table-column prop="zoneName" :label='$t("resource.table.resours.zoneName")' width="180px"></el-table-column>
-      <el-table-column prop="positionCount" :label='$t("resource.table.resours.nums")' width="120px"></el-table-column>
-      <el-table-column prop="cncProgram" :label='$t("resource.table.resours.isProgram")' width="110px" align="center">
-      	<template slot-scope="{ row }">
-      		<el-tag :type="row.cncProgram == '1' ? 'success' : 'info'">
-      			{{row.cncProgram == '1' ? $t("common.yes") : $t("common.no")}}
-      		</el-tag>
-      	</template>
+      <el-table-column
+        prop="name"
+        :label="$t('resource.table.resours.name')"
+        :show-overflow-tooltip="true"
+        width="180px"
+      ></el-table-column>
+      <el-table-column
+        prop="code"
+        :label="$t('resource.table.resours.no')"
+        :show-overflow-tooltip="true"
+        width="100px"
+      ></el-table-column>
+      <el-table-column
+        prop="brand"
+        :label="$t('resource.table.resours.brand')"
+        width="100px"
+        v-if="
+          this.$store.state.account.permissions.includes('resource:superview')
+        "
+      ></el-table-column>
+      <el-table-column
+        prop="specification"
+        :label="$t('resource.table.resours.specification')"
+      ></el-table-column>
+
+      <el-table-column
+        prop="capitalNo"
+        :label="$t('resource.table.resours.capitalNo')"
+      ></el-table-column>
+      <el-table-column
+        prop="capitalName"
+        :label="$t('resource.table.resours.capitalName')"
+      ></el-table-column>
+      <el-table-column
+        prop="capitalType"
+        :label="$t('resource.table.resours.capitalType')"
+      ></el-table-column>
+      <el-table-column
+        prop="modeSpecification"
+        :label="$t('resource.table.resours.modeSpecification')"
+      ></el-table-column>
+      <el-table-column
+        prop="capitalPrice"
+        :label="$t('resource.table.resours.capitalPrice')"
+      ></el-table-column>
+      <el-table-column
+        prop="productionDate"
+        :label="$t('resource.table.resours.productionDate')"
+      ></el-table-column>
+      <el-table-column
+        prop="productionNo"
+        :label="$t('resource.table.resours.productionNo')"
+      ></el-table-column>
+      <el-table-column
+        prop="manufacturer"
+        :label="$t('resource.table.resours.manufacturer')"
+      ></el-table-column>
+
+      <el-table-column
+        prop="model"
+        :label="$t('resource.table.resours.model')"
+        v-if="
+          this.$store.state.account.permissions.includes('resource:superview')
+        "
+      ></el-table-column>
+      <el-table-column
+        prop="category.data"
+        :label="$t('resource.table.resours.category')"
+        width="100px"
+      ></el-table-column>
+      <el-table-column
+        prop="zoneName"
+        :label="$t('resource.table.resours.zoneName')"
+        width="180px"
+      ></el-table-column>
+      <el-table-column
+        prop="positionCount"
+        :label="$t('resource.table.resours.nums')"
+        width="120px"
+      ></el-table-column>
+      <el-table-column
+        prop="cncProgram"
+        :label="$t('resource.table.resours.isProgram')"
+        width="110px"
+        align="center"
+      >
+        <template slot-scope="{ row }">
+          <el-tag :type="row.cncProgram == '1' ? 'success' : 'info'">
+            {{ row.cncProgram == "1" ? $t("common.yes") : $t("common.no") }}
+          </el-tag>
+        </template>
       </el-table-column>
-      <el-table-column prop="linkStatus" :label='$t("resource.table.resours.linkStatus")' width="180px" align="center">
-      	<template slot-scope="{ row }">
-      		<div class="statusDiv" :style="'background:'+ row.linkStatus.background">{{row.linkStatus.text}}</div>
-      	</template>
+      <el-table-column
+        prop="linkStatus"
+        :label="$t('resource.table.resours.linkStatus')"
+        width="180px"
+        align="center"
+      >
+        <template slot-scope="{ row }">
+          <div
+            class="statusDiv"
+            :style="'background:' + row.linkStatus.background"
+          >
+            {{ row.linkStatus.text }}
+          </div>
+        </template>
       </el-table-column>
-      <el-table-column prop="controlStatus" :label='$t("resource.table.resours.controlStatus")' width="180px" align="center">
-      	<template slot-scope="{ row }">
-      		<div class="statusDiv" :style="'background:'+ row.controlStatus.background">{{row.controlStatus.text}}</div>
-      	</template>
+      <el-table-column
+        prop="controlStatus"
+        :label="$t('resource.table.resours.controlStatus')"
+        width="180px"
+        align="center"
+      >
+        <template slot-scope="{ row }">
+          <div
+            class="statusDiv"
+            :style="'background:' + row.controlStatus.background"
+          >
+            {{ row.controlStatus.text }}
+          </div>
+        </template>
       </el-table-column>
-      <el-table-column prop="productionStatus" :label='$t("resource.table.resours.productionStatus")' width="180px" align="center">
-      	<template slot-scope="{ row }">
-      		<div class="statusDiv" :style="'background:'+ row.productionStatus.background">{{row.productionStatus.text}}</div>
-      	</template>
+      <el-table-column
+        prop="productionStatus"
+        :label="$t('resource.table.resours.productionStatus')"
+        width="180px"
+        align="center"
+      >
+        <template slot-scope="{ row }">
+          <div
+            class="statusDiv"
+            :style="'background:' + row.productionStatus.background"
+          >
+            {{ row.productionStatus.text }}
+          </div>
+        </template>
       </el-table-column>
       <el-table-column
         :label="$t('table.operation')"
@@ -110,47 +256,77 @@
         width="180px"
       >
         <template slot-scope="{ row }">
-        	<!--<el-tooltip class="item" content="查看详情" effect="dark" placement="top-start">
+          <!--<el-tooltip class="item" content="查看详情" effect="dark" placement="top-start">
 	          <i
 	            class="el-icon-view table-operation"
 	            style="color: #87d068;"
 	            @click="view(row)"
 	          />
           </el-tooltip>-->
-          <el-tooltip class="item" :content='$t("resource.buttons.work")' effect="dark" placement="top-start" v-hasPermission="['resource:superview']">
-	          <i
-	            class="el-icon-location-information table-operation"
-	            style="color: #2db7f5;"
-	            @click="equipment(row)"
-	          />
+          <el-tooltip
+            class="item"
+            :content="$t('resource.buttons.work')"
+            effect="dark"
+            placement="top-start"
+            v-hasPermission="['resource:superview']"
+          >
+            <i
+              class="el-icon-location-information table-operation"
+              style="color: #2db7f5"
+              @click="equipment(row)"
+            />
           </el-tooltip>
-          <el-tooltip class="item" :content='$t("resource.buttons.setting")' effect="dark" placement="top-start" v-hasPermission="['resource:superview']">
-	          <i
-	            class="el-icon-setting table-operation"
-	            style="color: #2db7f5;"
-	            @click="edit(row)"
-	          />
+          <el-tooltip
+            class="item"
+            :content="$t('resource.buttons.setting')"
+            effect="dark"
+            placement="top-start"
+            v-hasPermission="['resource:superview']"
+          >
+            <i
+              class="el-icon-setting table-operation"
+              style="color: #2db7f5"
+              @click="edit(row)"
+            />
           </el-tooltip>
-          <el-tooltip class="item" :content='$t("resource.buttons.hardware")' effect="dark" placement="top-start" v-hasPermission="['resource:superview']">
-	          <i
-	            class="el-icon-s-help table-operation"
-	            style="color: #2db7f5;"
-	            @click="editHardware(row)"
-	          />
+          <el-tooltip
+            class="item"
+            :content="$t('resource.buttons.hardware')"
+            effect="dark"
+            placement="top-start"
+            v-hasPermission="['resource:superview']"
+          >
+            <i
+              class="el-icon-s-help table-operation"
+              style="color: #2db7f5"
+              @click="editHardware(row)"
+            />
           </el-tooltip>
-		  <el-tooltip class="item" :content='$t("resource.buttons.autoCode")' effect="dark" placement="top-start" v-if="row.isAutoCode=='1'"  v-hasPermission="['resource:superview']">
-	          <i
-	            class="el-icon-place table-operation"
-	            style="color: #2db7f5;"
-	            @click="autoCode(row)"
-	          />
+          <el-tooltip
+            class="item"
+            :content="$t('resource.buttons.autoCode')"
+            effect="dark"
+            placement="top-start"
+            v-if="row.isAutoCode == '1'"
+            v-hasPermission="['resource:superview']"
+          >
+            <i
+              class="el-icon-place table-operation"
+              style="color: #2db7f5"
+              @click="autoCode(row)"
+            />
           </el-tooltip>
-          <el-tooltip class="item" :content='$t("resource.buttons.detailConf")' effect="dark" placement="top-start">
-	          <i
-	            class="el-icon-guide table-operation"
-	            style="color: #f50;"
-	            @click="detailConf(row)"
-	          />
+          <el-tooltip
+            class="item"
+            :content="$t('resource.buttons.detailConf')"
+            effect="dark"
+            placement="top-start"
+          >
+            <i
+              class="el-icon-guide table-operation"
+              style="color: #f50"
+              @click="detailConf(row)"
+            />
           </el-tooltip>
         </template>
       </el-table-column>
@@ -182,7 +358,7 @@
       @close="editHardwareClose"
       @success="editHardwareSuccess"
     />
-	<!-- 生产资源资料  -->
+    <!-- 生产资源资料  -->
     <detailConf
       ref="detailConf"
       :dialog-visible="dialogDetailConf.isVisible"
@@ -190,17 +366,20 @@
       @close="editDetailConfClose"
       @success="editDetailConfSuccess"
     />
-	
-	<el-dialog	       
-		  :title='$t("resource.buttons.autoCode")'
-		  :visible.sync="autoCodeVisible"
-		  width="80%"
-		  custom-class="dialogNoTop"
-		>
-			<!--【设备自动化节点配置】 -->
-		<autoCode :rowData="rowData" @close="editAutoCodeClose" @success="editAutoCodeSuccess" />
 
-	</el-dialog>
+    <el-dialog
+      :title="$t('resource.buttons.autoCode')"
+      :visible.sync="autoCodeVisible"
+      width="80%"
+      custom-class="dialogNoTop"
+    >
+      <!--【设备自动化节点配置】 -->
+      <autoCode
+        :rowData="rowData"
+        @close="editAutoCodeClose"
+        @success="editAutoCodeSuccess"
+      />
+    </el-dialog>
 
     <!-- 详情 -->
     <tenant-view
@@ -212,7 +391,7 @@
       v-el-drag-dialog
       :close-on-click-modal="false"
       :close-on-press-escape="true"
-      :title='$t("common.preview")'
+      :title="$t('common.preview')"
       width="80%"
       top="50px"
       :visible.sync="preview.isVisible"
@@ -223,186 +402,203 @@
     </el-dialog>
 
     <el-dialog
-		  :title='$t("resource.buttons.position")'
-		  :visible.sync="equipmentVisible"
-		  width="80%"
-		  custom-class="dialogNoTop"
-		>
-			<!--【	工作位置管理】 -->
-			<equipmentPosition :rowData="rowData" @close="editEquipmentClose" @success="editEquipmentSuccess" />
-
-		</el-dialog>
-
+      :title="$t('resource.buttons.position')"
+      :visible.sync="equipmentVisible"
+      width="80%"
+      custom-class="dialogNoTop"
+    >
+      <!--【	工作位置管理】 -->
+      <equipmentPosition
+        :rowData="rowData"
+        @close="editEquipmentClose"
+        @success="editEquipmentSuccess"
+      />
+    </el-dialog>
   </div>
 </template>
 
 <script>
-	import Pagination from "@/components/Pagination"
-	import TenantEdit from "../resourcesMgr/components/Edit"
-	// 【硬件配置】
-	import Hardware from "../resourcesMgr/components/Hardware"
-	import AutoCode from "../resourcesMgr/components/AutoCode"
-	import DetailConf from "../resourcesMgr/components/DetailConf"
-	import TenantView from "../resourcesMgr/components/View"
-	// 【设备管理】-API
-	import equipmentMgrApi from "@/api/resourceProductMgr/equipmentMgr"
-	// 【工作位置管理】组件
-	import equipmentPosition from "../equipmentPosition/Index"
-	import elDragDialog from '@/directive/el-drag-dialog'
-	import { downloadFile, initEnums, initDicts, initQueryParams } from '@/utils/commons'
-	import axios from 'axios'
-	export default {
-	  name: "ResourcesMgr",
-	  directives: { elDragDialog },
-	  components: { Pagination, TenantEdit, Hardware, AutoCode, TenantView, DetailConf, equipmentMgrApi, equipmentPosition },
-	  props: {
-	  },
-	  data () {
-	    return {
-	    	currentRow: null, // 当前选中的行数据
-	    	equipmentVisible: false, // 设备管理
-			autoCodeVisible:false,  //节点配置			
-	    	rowData: {}, // row数据,
-	    	audioStatus: [],
-	      dialog: {
-	        isVisible: false,
-	        title: ""
-	      },
-	      dialogHardware: {
-	        isVisible: false,
-	        title: ""
-	      },
-		  dialogDetailConf: {
-	        isVisible: false,
-	        title: ""
-	      },		  
-	      preview: {
-	        isVisible: false,
-	        context: ''
-	      },
-	      tenantViewVisible: false,
-	      tableKey: 0,
-	      queryParams: initQueryParams({}),
-	      selection: [],
-	      loading: false,
-	      tableData: {
-	        count: 0
-	      },
-	      dicts: {
-          NATION: {}
-        },
-	      enums: {
-	        TenantTypeEnum: {},
-	        TenantStatusEnum: {}
-	      }
-	    }
-	  },
-	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
-	  created() {
-	  	// 调用常量-审核状态
-	  	this.audioStatus = this.$constWKS.SHOWHIDE
-	  	// 加载【字典】
-	  	initDicts(['NATION'], this.dicts);
-	  	// 加载列表数据
-	  	this.fetch()
-		},
-	  computed: {
-	    currentUser () {
-	      return this.$store.state.account.user
-	    },
-	    nationList() {
-        return convertEnum(this.dicts.NATION)
-        }
-	  },
-	  mounted () {
-
-	  },
-	  methods: {
-	  	// table的当前行值变化后
-	  	handleCurrentChange(val) {
-	  		// 设置当前行
-		    this.currentRow = val;
-		  },
-	  	// 【设备管理】按钮-事件
-	  	equipment(row){
-	  		this.rowData = row
-	  		this.equipmentVisible = true
-	  	},
-		// 【节点配置】按钮-事件
-		autoCode(row){
-	  		this.rowData = row
-	  		this.autoCodeVisible = true
-	  	},
-	  	editEquipmentClose(){
-	  		this.equipmentVisible = false
-	  	},
-	  	editEquipmentSuccess(data){
-	  		this.search()
-	  	},
-	    viewClose () {
-	      this.tenantViewVisible = false
-	    },
-	    editClose () {
-	      this.dialog.isVisible = false
-	    },
-	    editSuccess () {
-	      this.search()
-	    },
-		detailConf(row){
-			this.$refs.detailConf.type = 'edit'
-			this.$refs.detailConf.setTenant(row, this.dicts)
-            this.dialogDetailConf.isVisible = true
-		},
-	    // 【硬件配置】-确定
-	    editHardwareSuccess(){
-	    	this.search()
-	    },
-	    // 【硬件配置】-取消
-	    editHardwareClose (){
-	    	this.dialogHardware.isVisible = false
-	    },
-		editAutoCodeClose (){
-	    	this.autoCodeVisible = false
-	    },
-		editAutoCodeSuccess(){
-	    	this.search()
-	    },
-		editDetailConfClose (){
-	    	this.dialogDetailConf.isVisible = false
-	    },
-		editDetailConfSuccess(){
-	    	this.search()
-	    },
-	    onSelectChange (selection) {
-	      this.selection = selection
-	    },
-	    search () {
-	      this.fetch({
-	        ...this.queryParams
-	      })
-	    },
-	    reset () {
-	      this.queryParams = initQueryParams({})
-	      this.$refs.table.clearSort()
-	      this.$refs.table.clearFilter()
-	      this.search()
-	    },
-	    add () {
-	      this.$refs.edit.type = "add"
-	      this.$refs.edit.setTenant(false, this.dicts)
-	      this.dialog.title = this.$t("common.add")
-	      this.dialog.isVisible = true
-	    },
-	    singleDelete (row) {
-	      this.$refs.table.clearSelection()
-	      this.$refs.table.toggleRowSelection(row, true)
-	      // 调用单个删除API
-      	this.remove(row)
-      	// 如果是多选删除API
-      	// this.batchDelete()
-	    },
-	    batchDelete () {
-	      /*if (!this.selection.length) {
+import Pagination from "@/components/Pagination";
+import TenantEdit from "../resourcesMgr/components/Edit";
+// 【硬件配置】
+import Hardware from "../resourcesMgr/components/Hardware";
+import AutoCode from "../resourcesMgr/components/AutoCode";
+import DetailConf from "../resourcesMgr/components/DetailConf";
+import TenantView from "../resourcesMgr/components/View";
+// 【设备管理】-API
+import equipmentMgrApi from "@/api/resourceProductMgr/equipmentMgr";
+// 【工作位置管理】组件
+import equipmentPosition from "../equipmentPosition/Index";
+import elDragDialog from "@/directive/el-drag-dialog";
+//【所属产线】-API
+import areaMgrApi from "@/api/resourceProductMgr/areaMgr";
+import {
+  downloadFile,
+  initEnums,
+  initDicts,
+  initQueryParams,
+} from "@/utils/commons";
+import axios from "axios";
+export default {
+  name: "ResourcesMgr",
+  directives: { elDragDialog },
+  components: {
+    Pagination,
+    TenantEdit,
+    Hardware,
+    AutoCode,
+    TenantView,
+    DetailConf,
+    equipmentMgrApi,
+    equipmentPosition,
+  },
+  props: {},
+  data() {
+    return {
+      currentRow: null, // 当前选中的行数据
+      equipmentVisible: false, // 设备管理
+      autoCodeVisible: false, //节点配置
+      rowData: {}, // row数据,
+      audioStatus: [],
+      zoneList: [],
+      dialog: {
+        isVisible: false,
+        title: "",
+      },
+      dialogHardware: {
+        isVisible: false,
+        title: "",
+      },
+      dialogDetailConf: {
+        isVisible: false,
+        title: "",
+      },
+      preview: {
+        isVisible: false,
+        context: "",
+      },
+      tenantViewVisible: false,
+      tableKey: 0,
+      queryParams: initQueryParams({}),
+      selection: [],
+      loading: false,
+      tableData: {
+        count: 0,
+      },
+      dicts: {
+        NATION: {},
+      },
+      enums: {
+        TenantTypeEnum: {},
+        TenantStatusEnum: {},
+      },
+    };
+  },
+  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+  created() {
+    // 调用常量-审核状态
+    this.audioStatus = this.$constWKS.SHOWHIDE;
+    // 加载【字典】
+    initDicts(["NATION"], this.dicts);
+    // 加载列表数据
+    this.fetch();
+    this.getZoneList();
+  },
+  computed: {
+    currentUser() {
+      return this.$store.state.account.user;
+    },
+    nationList() {
+      return convertEnum(this.dicts.NATION);
+    },
+  },
+  mounted() {},
+  methods: {
+    // table的当前行值变化后
+    handleCurrentChange(val) {
+      // 设置当前行
+      this.currentRow = val;
+    },
+    // 【设备管理】按钮-事件
+    equipment(row) {
+      this.rowData = row;
+      this.equipmentVisible = true;
+    },
+    // 【节点配置】按钮-事件
+    autoCode(row) {
+      this.rowData = row;
+      this.autoCodeVisible = true;
+    },
+    editEquipmentClose() {
+      this.equipmentVisible = false;
+    },
+    editEquipmentSuccess(data) {
+      this.search();
+    },
+    viewClose() {
+      this.tenantViewVisible = false;
+    },
+    editClose() {
+      this.dialog.isVisible = false;
+    },
+    editSuccess() {
+      this.search();
+    },
+    detailConf(row) {
+      this.$refs.detailConf.type = "edit";
+      this.$refs.detailConf.setTenant(row, this.dicts);
+      this.dialogDetailConf.isVisible = true;
+    },
+    // 【硬件配置】-确定
+    editHardwareSuccess() {
+      this.search();
+    },
+    // 【硬件配置】-取消
+    editHardwareClose() {
+      this.dialogHardware.isVisible = false;
+    },
+    editAutoCodeClose() {
+      this.autoCodeVisible = false;
+    },
+    editAutoCodeSuccess() {
+      this.search();
+    },
+    editDetailConfClose() {
+      this.dialogDetailConf.isVisible = false;
+    },
+    editDetailConfSuccess() {
+      this.search();
+    },
+    onSelectChange(selection) {
+      this.selection = selection;
+    },
+    search() {
+      this.fetch({
+        ...this.queryParams,
+      });
+    },
+    reset() {
+      this.queryParams = initQueryParams({});
+      this.$refs.table.clearSort();
+      this.$refs.table.clearFilter();
+      this.search();
+    },
+    add() {
+      this.$refs.edit.type = "add";
+      this.$refs.edit.setTenant(false, this.dicts);
+      this.dialog.title = this.$t("common.add");
+      this.dialog.isVisible = true;
+    },
+    singleDelete(row) {
+      this.$refs.table.clearSelection();
+      this.$refs.table.toggleRowSelection(row, true);
+      // 调用单个删除API
+      this.remove(row);
+      // 如果是多选删除API
+      // this.batchDelete()
+    },
+    batchDelete() {
+      /*if (!this.selection.length) {
 	        this.$message({
 	          message: this.$t("tips.noDataSelected"),
 	          type: "warning"
@@ -418,181 +614,204 @@
 	        return
 	      }*/
 
-	     	if(!this.currentRow){
-	     		this.$message({
-	          message: this.$t("tips.noDataSelected"),
-	          type: "warning"
-	        })
-	        return
-	     	}
+      if (!this.currentRow) {
+        this.$message({
+          message: this.$t("tips.noDataSelected"),
+          type: "warning",
+        });
+        return;
+      }
 
-	      this.$confirm(this.$t("resource.tips.resourTips"), this.$t("common.tips"), {
-	      	distinguishCancelAndClose: true,
-	        confirmButtonText: this.$t("common.confirm"),
-	        cancelButtonText: this.$t("common.cancel"),
-	        type: "warning"
-	      }).then(() => {
-	      	/*const ids = []
+      this.$confirm(
+        this.$t("resource.tips.resourTips"),
+        this.$t("common.tips"),
+        {
+          distinguishCancelAndClose: true,
+          confirmButtonText: this.$t("common.confirm"),
+          cancelButtonText: this.$t("common.cancel"),
+          type: "warning",
+        }
+      )
+        .then(() => {
+          /*const ids = []
 		      this.selection.forEach(item => {
 		        ids.push(item.id)
 		      })
 		      // 如果是多选删除API
 		      this.delete(ids)*/
-		     	// 调用删除API
-    		 	this.remove(this.currentRow)
-	      }).catch(() => {})
-	    },
-	    clearSelections () {
-	      this.$refs.table.clearSelection()
-	    },
-	    delete (ids) {
-	      equipmentMgrApi.remove({ ids: ids }).then(response => {
-	        const res = response.data
-	        if (res.isSuccess) {
-	          this.$message({
-	            message: this.$t("tips.deleteSuccess"),
-	            type: "success"
-	          })
-	          // 查询列表
-	          this.search()
-	          // 清理已经删除的数据
-	          this.$refs.table.clearSelection()
-	        }
-	      })
-	    },
-	    // 【单体-删除】-函数
-	    remove(row) {
-	    	this.$confirm(this.$t("resource.tips.resourTips"), this.$t("common.tips"), {
-	      	distinguishCancelAndClose: true,
-	        confirmButtonText: this.$t("common.confirm"),
-	        cancelButtonText: this.$t("common.cancel"),
-	        type: "warning"
-	      }).then(() => {
-		    	equipmentMgrApi.removeMore(row).then(response => {
-		        const res = response.data
-		        if (res.isSuccess) {
-		          this.$message({
-		            message: this.$t("tips.deleteSuccess"),
-		            type: "success"
-		          })
-		          // 查询列表
-		          this.search()
-		          // 清理已经删除的数据
-	          	this.$refs.table.clearSelection()
-		        }
-		      })
-		    }).catch(() => {
-		    })
-	    },
-	    view (row) {
-	      this.$refs.view.setTenant(row)
-	      this.tenantViewVisible = true
-	    },
-	    // 【修改】表头上Btn-事件
-	    editOne() {
-	    	if (!this.selection.length) {
-	        this.$message({
-	          message: this.$t("tips.noDataSelected"),
-	          type: "warning"
-	        })
-	        return
-	      }
-	    	if (this.selection.length > 1) {
-	        this.$message({
-	          message: this.$t("tips.mustOne"),
-	          type: "warning"
-	        })
-	        return
-	      }
-	    	this.edit(this.selection[0]);
-	    },
-	    edit (row) {
-	      this.$refs.edit.setTenant(row, this.dicts)
-	      this.$refs.edit.type = "edit"
-	      this.dialog.title = this.$t("resource.common.peizhi")
-	      this.dialog.isVisible = true
-	    },
+          // 调用删除API
+          this.remove(this.currentRow);
+        })
+        .catch(() => {});
+    },
+    clearSelections() {
+      this.$refs.table.clearSelection();
+    },
+    delete(ids) {
+      equipmentMgrApi.remove({ ids: ids }).then((response) => {
+        const res = response.data;
+        if (res.isSuccess) {
+          this.$message({
+            message: this.$t("tips.deleteSuccess"),
+            type: "success",
+          });
+          // 查询列表
+          this.search();
+          // 清理已经删除的数据
+          this.$refs.table.clearSelection();
+        }
+      });
+    },
+    // 【单体-删除】-函数
+    remove(row) {
+      this.$confirm(
+        this.$t("resource.tips.resourTips"),
+        this.$t("common.tips"),
+        {
+          distinguishCancelAndClose: true,
+          confirmButtonText: this.$t("common.confirm"),
+          cancelButtonText: this.$t("common.cancel"),
+          type: "warning",
+        }
+      )
+        .then(() => {
+          equipmentMgrApi.removeMore(row).then((response) => {
+            const res = response.data;
+            if (res.isSuccess) {
+              this.$message({
+                message: this.$t("tips.deleteSuccess"),
+                type: "success",
+              });
+              // 查询列表
+              this.search();
+              // 清理已经删除的数据
+              this.$refs.table.clearSelection();
+            }
+          });
+        })
+        .catch(() => {});
+    },
+    view(row) {
+      this.$refs.view.setTenant(row);
+      this.tenantViewVisible = true;
+    },
+    // 【修改】表头上Btn-事件
+    editOne() {
+      if (!this.selection.length) {
+        this.$message({
+          message: this.$t("tips.noDataSelected"),
+          type: "warning",
+        });
+        return;
+      }
+      if (this.selection.length > 1) {
+        this.$message({
+          message: this.$t("tips.mustOne"),
+          type: "warning",
+        });
+        return;
+      }
+      this.edit(this.selection[0]);
+    },
+    edit(row) {
+      this.$refs.edit.setTenant(row, this.dicts);
+      this.$refs.edit.type = "edit";
+      this.dialog.title = this.$t("resource.common.peizhi");
+      this.dialog.isVisible = true;
+    },
 
-	    // 【硬件配置】-事件
-	    editHardware (row) {
-	    	// 如果可以配置(agv、arm、machine)
-	    	let str = "agv,arm,machine";
-	    	if(str.indexOf(row.category.key) > -1) {
-	    		this.$refs.hardware.setTenant(row)
-		      this.$refs.hardware.type = "edit"
-		      this.dialogHardware.title = this.$t("resource.buttons.hardware")
-		      this.dialogHardware.isVisible = true
-	    	} else {
-	    		this.$message({
-              message: this.$t('resource.tips.hardware'),
-              type: 'warning'
-            })
-	    	}
-	    },
-		editAutoCode (row) {
-	    	//
-	    	this.dialogAutoCode.isVisible = true
-	    },
+    // 【硬件配置】-事件
+    editHardware(row) {
+      // 如果可以配置(agv、arm、machine)
+      let str = "agv,arm,machine";
+      if (str.indexOf(row.category.key) > -1) {
+        this.$refs.hardware.setTenant(row);
+        this.$refs.hardware.type = "edit";
+        this.dialogHardware.title = this.$t("resource.buttons.hardware");
+        this.dialogHardware.isVisible = true;
+      } else {
+        this.$message({
+          message: this.$t("resource.tips.hardware"),
+          type: "warning",
+        });
+      }
+    },
+    editAutoCode(row) {
+      //
+      this.dialogAutoCode.isVisible = true;
+    },
 
-	    fetch (params = {}) {
-	      this.loading = true
-	      if (this.queryParams.timeRange) {
-	        this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
-	        this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
-	      }
+    fetch(params = {}) {
+      this.loading = true;
+      if (this.queryParams.timeRange) {
+        this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
+        this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
+      }
 
-	      this.queryParams.current = params.current ? params.current : this.queryParams.current
-	      this.queryParams.size = params.size ? params.size : this.queryParams.size
-	      // 固定参数(采集的生产资源)
-	      this.queryParams.resourceStatus = "1"
-		  this.queryParams.displayStatus = "1"
+      this.queryParams.current = params.current
+        ? params.current
+        : this.queryParams.current;
+      this.queryParams.size = params.size ? params.size : this.queryParams.size;
+      // 固定参数(采集的生产资源)
+      this.queryParams.resourceStatus = "1";
+      this.queryParams.displayStatus = "1";
 
-	      equipmentMgrApi.getPageList(this.queryParams).then(response => {
-	        const res = response.data
-	        if (res.isSuccess) {
-	          // 赋值
-	          this.tableData = res.data			  
-	          if(this.tableData.data && this.tableData.data.length > 0){
-	          	// 设置图片,放大属性
-	          	this.tableData.data.forEach((item, index) => {
-		        		// item.url = 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg';
-		        		item.srcList = [item.pic];
-		        	})
-	          }
-	        }
-	        // eslint-disable-next-line no-return-assign
-	      }).finally(() => this.loading = false)
-
-	    },
-	    cellClick (row, column) {
-	      if (column['columnKey'] === "operation") {
-	        return
-	      }
-	      let flag = false
-	      this.selection.forEach((item) => {
-	        if (item.id === row.id) {
-	          flag = true
-	          this.$refs.table.toggleRowSelection(row)
-	        }
-	      })
+      equipmentMgrApi
+        .getPageList(this.queryParams)
+        .then((response) => {
+          const res = response.data;
+          if (res.isSuccess) {
+            // 赋值
+            this.tableData = res.data;
+            if (this.tableData.data && this.tableData.data.length > 0) {
+              // 设置图片,放大属性
+              this.tableData.data.forEach((item, index) => {
+                // item.url = 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg';
+                item.srcList = [item.pic];
+              });
+            }
+          }
+          // eslint-disable-next-line no-return-assign
+        })
+        .finally(() => (this.loading = false));
+    },
+    getZoneList() {
+      areaMgrApi.getList({ status: 1 }).then((res) => {
+        res = res.data;
+        if (res.isSuccess) {
+          this.zoneList = res.data;
+        }
+      });
+    },
+    cellClick(row, column) {
+      if (column["columnKey"] === "operation") {
+        return;
+      }
+      let flag = false;
+      this.selection.forEach((item) => {
+        if (item.id === row.id) {
+          flag = true;
+          this.$refs.table.toggleRowSelection(row);
+        }
+      });
 
-	      if (!flag) {
-	        this.$refs.table.toggleRowSelection(row, true)
-	      }
-	    }
-	  }
-	}
+      if (!flag) {
+        this.$refs.table.toggleRowSelection(row, true);
+      }
+    },
+  },
+};
 </script>
 <style type="text/css">
-	.dialogNoTop .el-dialog__body{
-		padding: 0;
-	}
+.dialogNoTop .el-dialog__body {
+  padding: 0;
+}
 </style>
 <style lang="scss" scoped>
-	.statusDiv{
-		color: white;
-		-moz-border-radius: 2px;
-		-webkit-border-radius: 2px;
-		border-radius: 2px;
-	}
+.statusDiv {
+  color: white;
+  -moz-border-radius: 2px;
+  -webkit-border-radius: 2px;
+  border-radius: 2px;
+}
 </style>

+ 663 - 454
imcs-ui/src/views/zuihou/resourceProductMgr/resourcesMgr/Index.vue

@@ -1,36 +1,73 @@
 <template>
   <div class="app-container">
-		<!-- 搜索模块 -->
+    <!-- 搜索模块 -->
     <div class="filter-container">
-    	<span>
-    		<span>{{$t("resource.searchForm.name")}}:</span>
-    		<el-input v-model="queryParams.model.name" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
-    	</span>
-    	<span style="margin-left: 15px;">
-    		<span>{{$t("resource.searchForm.no")}}:</span>
-    		<el-input v-model="queryParams.model.code" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
-    	</span>
-      <span style="margin-left: 15px;">
-	      <el-button plain type="primary" icon="el-icon-search" size="medium" @click="search">
-	        {{ $t("table.search") }}
-	      </el-button>
-	      <el-button plain type="warning" icon="el-icon-refresh" size="medium" @click="reset">
-	        {{ $t("table.reset") }}
-	      </el-button>
+      <span>
+        <span>{{ $t("resource.table.resours.zoneName") }}:</span>
+        <el-select
+          v-model="queryParams.model.zoneId"
+          placeholder="请选择"
+          style="width: 20%"
+        >
+          <el-option
+            v-for="(item, index) in zoneList"
+            :key="index"
+            :label="item.name"
+            :value="item.id"
+          />
+        </el-select>
+      </span>
+      <span style="margin-left: 15px">
+        <span>{{ $t("resource.searchForm.name") }}:</span>
+        <el-input
+          v-model="queryParams.model.name"
+          :placeholder="$t('common.pleaseEnter')"
+          style="width: 150px"
+          size="medium"
+        />
+      </span>
+      <span style="margin-left: 15px">
+        <span>{{ $t("resource.searchForm.no") }}:</span>
+        <el-input
+          v-model="queryParams.model.code"
+          :placeholder="$t('common.pleaseEnter')"
+          style="width: 150px"
+          size="medium"
+        />
+      </span>
+      <span style="margin-left: 15px">
+        <el-button
+          plain
+          type="primary"
+          icon="el-icon-search"
+          size="medium"
+          @click="search"
+        >
+          {{ $t("table.search") }}
+        </el-button>
+        <el-button
+          plain
+          type="warning"
+          icon="el-icon-refresh"
+          size="medium"
+          @click="reset"
+        >
+          {{ $t("table.reset") }}
+        </el-button>
       </span>
     </div>
 
     <!-- 功能按钮 -->
     <el-row class="filter-container">
-    	<el-col>
-    		<!--<el-button type="primary" icon="el-icon-s-tools" size="medium">{{ $t("resource.buttons.setBtn") }}</el-button>-->
-	      <!--<el-button type="danger" icon="el-icon-delete" size="medium" @click="batchDelete">
+      <el-col>
+        <!--<el-button type="primary" icon="el-icon-s-tools" size="medium">{{ $t("resource.buttons.setBtn") }}</el-button>-->
+        <!--<el-button type="danger" icon="el-icon-delete" size="medium" @click="batchDelete">
 	        {{ $t("table.delete") }}
 	      </el-button>-->
-    	</el-col>
+      </el-col>
     </el-row>
 
-		<!-- 列表数据 -->
+    <!-- 列表数据 -->
     <el-table
       :key="tableKey"
       ref="table"
@@ -39,68 +76,171 @@
       border
       fit
       row-key="id"
-      style="width: 100%;"
+      style="width: 100%"
       highlight-current-row
-    	@current-change="handleCurrentChange"
+      @current-change="handleCurrentChange"
     >
-    	<el-table-column :label='$t("common.serialNo")' width="55px" align="center">
-	      <template slot-scope="scope">
-	        <div>
-	          {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
-	        </div>
-	      </template>
+      <el-table-column
+        :label="$t('common.serialNo')"
+        width="55px"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <div>
+            {{
+              scope.$index + (queryParams.current - 1) * queryParams.size + 1
+            }}
+          </div>
+        </template>
       </el-table-column>
-      <el-table-column prop="pic" :label='$t("resource.table.resours.pic")' align="center" width="150px">
-      	<template slot-scope="{ row }">
-      		<div v-if="row.pic" class="demo-image__preview">
-					  <el-image
-					    style="width: 100px; height: 60px"
-					    :src="row.pic"
-					    :preview-src-list="row.srcList">
-					  </el-image>
-					</div>
-					<span v-else>{{$t("common.noData")}}</span>
-      	</template>
+      <el-table-column
+        prop="pic"
+        :label="$t('resource.table.resours.pic')"
+        align="center"
+        width="150px"
+      >
+        <template slot-scope="{ row }">
+          <div v-if="row.pic" class="demo-image__preview">
+            <el-image
+              style="width: 100px; height: 60px"
+              :src="row.pic"
+              :preview-src-list="row.srcList"
+            >
+            </el-image>
+          </div>
+          <span v-else>{{ $t("common.noData") }}</span>
+        </template>
       </el-table-column>
-      <el-table-column prop="name" :label='$t("resource.table.resours.name")' :show-overflow-tooltip="true" width="180px"></el-table-column>
-      <el-table-column prop="code" :label='$t("resource.table.resours.no")' :show-overflow-tooltip="true" width="100px"></el-table-column>
-      <el-table-column prop="brand" :label='$t("resource.table.resours.brand")' width="100px"></el-table-column>
-      <el-table-column prop="specification" :label='$t("resource.table.resours.specification")'></el-table-column>
+      <el-table-column
+        prop="name"
+        :label="$t('resource.table.resours.name')"
+        :show-overflow-tooltip="true"
+        width="180px"
+      ></el-table-column>
+      <el-table-column
+        prop="code"
+        :label="$t('resource.table.resours.no')"
+        :show-overflow-tooltip="true"
+        width="100px"
+      ></el-table-column>
+      <el-table-column
+        prop="brand"
+        :label="$t('resource.table.resours.brand')"
+        width="100px"
+      ></el-table-column>
+      <el-table-column
+        prop="specification"
+        :label="$t('resource.table.resours.specification')"
+      ></el-table-column>
 
-	  <el-table-column prop="capitalNo" :label='$t("resource.table.resours.capitalNo")'></el-table-column>
-	  <el-table-column prop="capitalName" :label='$t("resource.table.resours.capitalName")'></el-table-column>
-	  <el-table-column prop="capitalType" :label='$t("resource.table.resours.capitalType")'></el-table-column>
-	  <el-table-column prop="modeSpecification" :label='$t("resource.table.resours.modeSpecification")'></el-table-column>
-	  <el-table-column prop="capitalPrice" :label='$t("resource.table.resours.capitalPrice")'></el-table-column>
-	  <el-table-column prop="productionDate" :label='$t("resource.table.resours.productionDate")'></el-table-column>
-      <el-table-column prop="productionNo" :label='$t("resource.table.resours.productionNo")'></el-table-column>
-	  <el-table-column prop="manufacturer" :label='$t("resource.table.resours.manufacturer")'></el-table-column>
+      <el-table-column
+        prop="capitalNo"
+        :label="$t('resource.table.resours.capitalNo')"
+      ></el-table-column>
+      <el-table-column
+        prop="capitalName"
+        :label="$t('resource.table.resours.capitalName')"
+      ></el-table-column>
+      <el-table-column
+        prop="capitalType"
+        :label="$t('resource.table.resours.capitalType')"
+      ></el-table-column>
+      <el-table-column
+        prop="modeSpecification"
+        :label="$t('resource.table.resours.modeSpecification')"
+      ></el-table-column>
+      <el-table-column
+        prop="capitalPrice"
+        :label="$t('resource.table.resours.capitalPrice')"
+      ></el-table-column>
+      <el-table-column
+        prop="productionDate"
+        :label="$t('resource.table.resours.productionDate')"
+      ></el-table-column>
+      <el-table-column
+        prop="productionNo"
+        :label="$t('resource.table.resours.productionNo')"
+      ></el-table-column>
+      <el-table-column
+        prop="manufacturer"
+        :label="$t('resource.table.resours.manufacturer')"
+      ></el-table-column>
 
-	  <el-table-column prop="model" :label='$t("resource.table.resours.model")'></el-table-column>
-      <el-table-column prop="category.data" :label='$t("resource.table.resours.category")' width="100px"></el-table-column>
-      <el-table-column prop="zoneName" :label='$t("resource.table.resours.zoneName")' width="180px"></el-table-column>
-      <el-table-column prop="positionCount" :label='$t("resource.table.resours.nums")' width="120px"></el-table-column>
-      <el-table-column prop="cncProgram" :label='$t("resource.table.resours.isProgram")' width="110px" align="center">
-      	<template slot-scope="{ row }">
-      		<el-tag :type="row.cncProgram == '1' ? 'success' : 'info'">
-      			{{row.cncProgram == '1' ? $t("common.yes") : $t("common.no")}}
-      		</el-tag>
-      	</template>
+      <el-table-column
+        prop="model"
+        :label="$t('resource.table.resours.model')"
+      ></el-table-column>
+      <el-table-column
+        prop="category.data"
+        :label="$t('resource.table.resours.category')"
+        width="100px"
+      ></el-table-column>
+      <el-table-column
+        prop="zoneName"
+        :label="$t('resource.table.resours.zoneName')"
+        width="180px"
+      ></el-table-column>
+      <el-table-column
+        prop="positionCount"
+        :label="$t('resource.table.resours.nums')"
+        width="120px"
+      ></el-table-column>
+      <el-table-column
+        prop="cncProgram"
+        :label="$t('resource.table.resours.isProgram')"
+        width="110px"
+        align="center"
+      >
+        <template slot-scope="{ row }">
+          <el-tag :type="row.cncProgram == '1' ? 'success' : 'info'">
+            {{ row.cncProgram == "1" ? $t("common.yes") : $t("common.no") }}
+          </el-tag>
+        </template>
       </el-table-column>
-      <el-table-column prop="linkStatus" :label='$t("resource.table.resours.linkStatus")' width="180px" align="center">
-      	<template slot-scope="{ row }">
-      		<div class="statusDiv" :style="'background:'+ row.linkStatus.background">{{row.linkStatus.text}}</div>
-      	</template>
+      <el-table-column
+        prop="linkStatus"
+        :label="$t('resource.table.resours.linkStatus')"
+        width="180px"
+        align="center"
+      >
+        <template slot-scope="{ row }">
+          <div
+            class="statusDiv"
+            :style="'background:' + row.linkStatus.background"
+          >
+            {{ row.linkStatus.text }}
+          </div>
+        </template>
       </el-table-column>
-      <el-table-column prop="controlStatus" :label='$t("resource.table.resours.controlStatus")' width="180px" align="center">
-      	<template slot-scope="{ row }">
-      		<div class="statusDiv" :style="'background:'+ row.controlStatus.background">{{row.controlStatus.text}}</div>
-      	</template>
+      <el-table-column
+        prop="controlStatus"
+        :label="$t('resource.table.resours.controlStatus')"
+        width="180px"
+        align="center"
+      >
+        <template slot-scope="{ row }">
+          <div
+            class="statusDiv"
+            :style="'background:' + row.controlStatus.background"
+          >
+            {{ row.controlStatus.text }}
+          </div>
+        </template>
       </el-table-column>
-      <el-table-column prop="productionStatus" :label='$t("resource.table.resours.productionStatus")' width="180px" align="center">
-      	<template slot-scope="{ row }">
-      		<div class="statusDiv" :style="'background:'+ row.productionStatus.background">{{row.productionStatus.text}}</div>
-      	</template>
+      <el-table-column
+        prop="productionStatus"
+        :label="$t('resource.table.resours.productionStatus')"
+        width="180px"
+        align="center"
+      >
+        <template slot-scope="{ row }">
+          <div
+            class="statusDiv"
+            :style="'background:' + row.productionStatus.background"
+          >
+            {{ row.productionStatus.text }}
+          </div>
+        </template>
       </el-table-column>
       <el-table-column
         :label="$t('table.operation')"
@@ -110,47 +250,73 @@
         width="180px"
       >
         <template slot-scope="{ row }">
-        	<!--<el-tooltip class="item" content="查看详情" effect="dark" placement="top-start">
+          <!--<el-tooltip class="item" content="查看详情" effect="dark" placement="top-start">
 	          <i
 	            class="el-icon-view table-operation"
 	            style="color: #87d068;"
 	            @click="view(row)"
 	          />
           </el-tooltip>-->
-          <el-tooltip class="item" :content='$t("resource.buttons.work")' effect="dark" placement="top-start">
-	          <i
-	            class="el-icon-location-information table-operation"
-	            style="color: #2db7f5;"
-	            @click="equipment(row)"
-	          />
+          <el-tooltip
+            class="item"
+            :content="$t('resource.buttons.work')"
+            effect="dark"
+            placement="top-start"
+          >
+            <i
+              class="el-icon-location-information table-operation"
+              style="color: #2db7f5"
+              @click="equipment(row)"
+            />
           </el-tooltip>
-          <el-tooltip class="item" :content='$t("resource.buttons.setting")' effect="dark" placement="top-start">
-	          <i
-	            class="el-icon-setting table-operation"
-	            style="color: #2db7f5;"
-	            @click="edit(row)"
-	          />
+          <el-tooltip
+            class="item"
+            :content="$t('resource.buttons.setting')"
+            effect="dark"
+            placement="top-start"
+          >
+            <i
+              class="el-icon-setting table-operation"
+              style="color: #2db7f5"
+              @click="edit(row)"
+            />
           </el-tooltip>
-          <el-tooltip class="item" :content='$t("resource.buttons.hardware")' effect="dark" placement="top-start">
-	          <i
-	            class="el-icon-s-help table-operation"
-	            style="color: #2db7f5;"
-	            @click="editHardware(row)"
-	          />
+          <el-tooltip
+            class="item"
+            :content="$t('resource.buttons.hardware')"
+            effect="dark"
+            placement="top-start"
+          >
+            <i
+              class="el-icon-s-help table-operation"
+              style="color: #2db7f5"
+              @click="editHardware(row)"
+            />
           </el-tooltip>
-		  <el-tooltip class="item" :content='$t("resource.buttons.autoCode")' effect="dark" placement="top-start" v-if="row.isAutoCode=='1'">
-	          <i
-	            class="el-icon-place table-operation"
-	            style="color: #2db7f5;"
-	            @click="autoCode(row)"
-	          />
+          <el-tooltip
+            class="item"
+            :content="$t('resource.buttons.autoCode')"
+            effect="dark"
+            placement="top-start"
+            v-if="row.isAutoCode == '1'"
+          >
+            <i
+              class="el-icon-place table-operation"
+              style="color: #2db7f5"
+              @click="autoCode(row)"
+            />
           </el-tooltip>
-          <el-tooltip class="item" :content='$t("resource.buttons.detailConf")' effect="dark" placement="top-start">
-	          <i
-	            class="el-icon-guide table-operation"
-	            style="color: #f50;"
-	            @click="detailConf(row)"
-	          />
+          <el-tooltip
+            class="item"
+            :content="$t('resource.buttons.detailConf')"
+            effect="dark"
+            placement="top-start"
+          >
+            <i
+              class="el-icon-guide table-operation"
+              style="color: #f50"
+              @click="detailConf(row)"
+            />
           </el-tooltip>
         </template>
       </el-table-column>
@@ -182,7 +348,7 @@
       @close="editHardwareClose"
       @success="editHardwareSuccess"
     />
-	<!-- 生产资源资料  -->
+    <!-- 生产资源资料  -->
     <detailConf
       ref="detailConf"
       :dialog-visible="dialogDetailConf.isVisible"
@@ -191,16 +357,19 @@
       @success="editDetailConfSuccess"
     />
 
-	<el-dialog
-		  :title='$t("resource.buttons.autoCode")'
-		  :visible.sync="autoCodeVisible"
-		  width="80%"
-		  custom-class="dialogNoTop"
-		>
-			<!--【设备自动化节点配置】 -->
-		<autoCode :rowData="rowData" @close="editAutoCodeClose" @success="editAutoCodeSuccess" />
-
-	</el-dialog>
+    <el-dialog
+      :title="$t('resource.buttons.autoCode')"
+      :visible.sync="autoCodeVisible"
+      width="80%"
+      custom-class="dialogNoTop"
+    >
+      <!--【设备自动化节点配置】 -->
+      <autoCode
+        :rowData="rowData"
+        @close="editAutoCodeClose"
+        @success="editAutoCodeSuccess"
+      />
+    </el-dialog>
 
     <!-- 详情 -->
     <tenant-view
@@ -212,7 +381,7 @@
       v-el-drag-dialog
       :close-on-click-modal="false"
       :close-on-press-escape="true"
-      :title='$t("common.preview")'
+      :title="$t('common.preview')"
       width="80%"
       top="50px"
       :visible.sync="preview.isVisible"
@@ -223,186 +392,203 @@
     </el-dialog>
 
     <el-dialog
-		  :title='$t("resource.buttons.position")'
-		  :visible.sync="equipmentVisible"
-		  width="80%"
-		  custom-class="dialogNoTop"
-		>
-			<!--【	工作位置管理】 -->
-			<equipmentPosition :rowData="rowData" @close="editEquipmentClose" @success="editEquipmentSuccess" />
-
-		</el-dialog>
-
+      :title="$t('resource.buttons.position')"
+      :visible.sync="equipmentVisible"
+      width="80%"
+      custom-class="dialogNoTop"
+    >
+      <!--【	工作位置管理】 -->
+      <equipmentPosition
+        :rowData="rowData"
+        @close="editEquipmentClose"
+        @success="editEquipmentSuccess"
+      />
+    </el-dialog>
   </div>
 </template>
 
 <script>
-	import Pagination from "@/components/Pagination"
-	import TenantEdit from "./components/Edit"
-	// 【硬件配置】
-	import Hardware from "./components/Hardware"
-	import AutoCode from "./components/AutoCode"
-	import DetailConf from "./components/DetailConf"
-	import TenantView from "./components/View"
-	// 【设备管理】-API
-	import equipmentMgrApi from "@/api/resourceProductMgr/equipmentMgr"
-	// 【工作位置管理】组件
-	import equipmentPosition from "../equipmentPosition/Index"
-	import elDragDialog from '@/directive/el-drag-dialog'
-	import { downloadFile, initEnums, initDicts, initQueryParams } from '@/utils/commons'
-	import axios from 'axios'
-	export default {
-	  name: "ResourcesMgr",
-	  directives: { elDragDialog },
-	  components: { Pagination, TenantEdit, Hardware, AutoCode, TenantView, DetailConf, equipmentMgrApi, equipmentPosition },
-	  props: {
-	  },
-	  data () {
-	    return {
-	    	currentRow: null, // 当前选中的行数据
-	    	equipmentVisible: false, // 设备管理
-			autoCodeVisible:false,  //节点配置
-	    	rowData: {}, // row数据,
-	    	audioStatus: [],
-	      dialog: {
-	        isVisible: false,
-	        title: ""
-	      },
-	      dialogHardware: {
-	        isVisible: false,
-	        title: ""
-	      },
-		  dialogDetailConf: {
-	        isVisible: false,
-	        title: ""
-	      },
-	      preview: {
-	        isVisible: false,
-	        context: ''
-	      },
-	      tenantViewVisible: false,
-	      tableKey: 0,
-	      queryParams: initQueryParams({}),
-	      selection: [],
-	      loading: false,
-	      tableData: {
-	        count: 0
-	      },
-	      dicts: {
-          NATION: {}
-        },
-	      enums: {
-	        TenantTypeEnum: {},
-	        TenantStatusEnum: {}
-	      }
-	    }
-	  },
-	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
-	  created() {
-	  	// 调用常量-审核状态
-	  	this.audioStatus = this.$constWKS.SHOWHIDE
-	  	// 加载【字典】
-	  	initDicts(['NATION'], this.dicts);
-	  	// 加载列表数据
-	  	this.fetch()
-		},
-	  computed: {
-	    currentUser () {
-	      return this.$store.state.account.user
-	    },
-	    nationList() {
-        return convertEnum(this.dicts.NATION)
-        }
-	  },
-	  mounted () {
-
-	  },
-	  methods: {
-	  	// table的当前行值变化后
-	  	handleCurrentChange(val) {
-	  		// 设置当前行
-		    this.currentRow = val;
-		  },
-	  	// 【设备管理】按钮-事件
-	  	equipment(row){
-	  		this.rowData = row
-	  		this.equipmentVisible = true
-	  	},
-		// 【节点配置】按钮-事件
-		autoCode(row){
-	  		this.rowData = row
-	  		this.autoCodeVisible = true
-	  	},
-	  	editEquipmentClose(){
-	  		this.equipmentVisible = false
-	  	},
-	  	editEquipmentSuccess(data){
-	  		this.search()
-	  	},
-	    viewClose () {
-	      this.tenantViewVisible = false
-	    },
-	    editClose () {
-	      this.dialog.isVisible = false
-	    },
-	    editSuccess () {
-	      this.search()
-	    },
-		detailConf(row){
-			this.$refs.detailConf.type = 'edit'
-			this.$refs.detailConf.setTenant(row, this.dicts)
-            this.dialogDetailConf.isVisible = true
-		},
-	    // 【硬件配置】-确定
-	    editHardwareSuccess(){
-	    	this.search()
-	    },
-	    // 【硬件配置】-取消
-	    editHardwareClose (){
-	    	this.dialogHardware.isVisible = false
-	    },
-		editAutoCodeClose (){
-	    	this.autoCodeVisible = false
-	    },
-		editAutoCodeSuccess(){
-	    	this.search()
-	    },
-		editDetailConfClose (){
-	    	this.dialogDetailConf.isVisible = false
-	    },
-		editDetailConfSuccess(){
-	    	this.search()
-	    },
-	    onSelectChange (selection) {
-	      this.selection = selection
-	    },
-	    search () {
-	      this.fetch({
-	        ...this.queryParams
-	      })
-	    },
-	    reset () {
-	      this.queryParams = initQueryParams({})
-	      this.$refs.table.clearSort()
-	      this.$refs.table.clearFilter()
-	      this.search()
-	    },
-	    add () {
-	      this.$refs.edit.type = "add"
-	      this.$refs.edit.setTenant(false, this.dicts)
-	      this.dialog.title = this.$t("common.add")
-	      this.dialog.isVisible = true
-	    },
-	    singleDelete (row) {
-	      this.$refs.table.clearSelection()
-	      this.$refs.table.toggleRowSelection(row, true)
-	      // 调用单个删除API
-      	this.remove(row)
-      	// 如果是多选删除API
-      	// this.batchDelete()
-	    },
-	    batchDelete () {
-	      /*if (!this.selection.length) {
+import Pagination from "@/components/Pagination";
+import TenantEdit from "./components/Edit";
+// 【硬件配置】
+import Hardware from "./components/Hardware";
+import AutoCode from "./components/AutoCode";
+import DetailConf from "./components/DetailConf";
+import TenantView from "./components/View";
+// 【设备管理】-API
+import equipmentMgrApi from "@/api/resourceProductMgr/equipmentMgr";
+  //【所属产线】-API
+import areaMgrApi from "@/api/resourceProductMgr/areaMgr"
+// 【工作位置管理】组件
+import equipmentPosition from "../equipmentPosition/Index";
+import elDragDialog from "@/directive/el-drag-dialog";
+import {
+  downloadFile,
+  initEnums,
+  initDicts,
+  initQueryParams,
+} from "@/utils/commons";
+import axios from "axios";
+export default {
+  name: "ResourcesMgr",
+  directives: { elDragDialog },
+  components: {
+    Pagination,
+    TenantEdit,
+    Hardware,
+    AutoCode,
+    TenantView,
+    DetailConf,
+    equipmentMgrApi,
+    equipmentPosition,
+  },
+  props: {},
+  data() {
+    return {
+      currentRow: null, // 当前选中的行数据
+      equipmentVisible: false, // 设备管理
+      autoCodeVisible: false, //节点配置
+      rowData: {}, // row数据,
+      audioStatus: [],
+      zoneList: [],
+      dialog: {
+        isVisible: false,
+        title: "",
+      },
+      dialogHardware: {
+        isVisible: false,
+        title: "",
+      },
+      dialogDetailConf: {
+        isVisible: false,
+        title: "",
+      },
+      preview: {
+        isVisible: false,
+        context: "",
+      },
+      tenantViewVisible: false,
+      tableKey: 0,
+      queryParams: initQueryParams({}),
+      selection: [],
+      loading: false,
+      tableData: {
+        count: 0,
+      },
+      dicts: {
+        NATION: {},
+      },
+      enums: {
+        TenantTypeEnum: {},
+        TenantStatusEnum: {},
+      },
+    };
+  },
+  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+  created() {
+    // 调用常量-审核状态
+    this.audioStatus = this.$constWKS.SHOWHIDE;
+    // 加载【字典】
+    initDicts(["NATION"], this.dicts);
+    // 加载列表数据
+    this.fetch();
+    this.getZoneList();
+  },
+  computed: {
+    currentUser() {
+      return this.$store.state.account.user;
+    },
+    nationList() {
+      return convertEnum(this.dicts.NATION);
+    },
+  },
+  mounted() {},
+  methods: {
+    // table的当前行值变化后
+    handleCurrentChange(val) {
+      // 设置当前行
+      this.currentRow = val;
+    },
+    // 【设备管理】按钮-事件
+    equipment(row) {
+      this.rowData = row;
+      this.equipmentVisible = true;
+    },
+    // 【节点配置】按钮-事件
+    autoCode(row) {
+      this.rowData = row;
+      this.autoCodeVisible = true;
+    },
+    editEquipmentClose() {
+      this.equipmentVisible = false;
+    },
+    editEquipmentSuccess(data) {
+      this.search();
+    },
+    viewClose() {
+      this.tenantViewVisible = false;
+    },
+    editClose() {
+      this.dialog.isVisible = false;
+    },
+    editSuccess() {
+      this.search();
+    },
+    detailConf(row) {
+      this.$refs.detailConf.type = "edit";
+      this.$refs.detailConf.setTenant(row, this.dicts);
+      this.dialogDetailConf.isVisible = true;
+    },
+    // 【硬件配置】-确定
+    editHardwareSuccess() {
+      this.search();
+    },
+    // 【硬件配置】-取消
+    editHardwareClose() {
+      this.dialogHardware.isVisible = false;
+    },
+    editAutoCodeClose() {
+      this.autoCodeVisible = false;
+    },
+    editAutoCodeSuccess() {
+      this.search();
+    },
+    editDetailConfClose() {
+      this.dialogDetailConf.isVisible = false;
+    },
+    editDetailConfSuccess() {
+      this.search();
+    },
+    onSelectChange(selection) {
+      this.selection = selection;
+    },
+    search() {
+      this.fetch({
+        ...this.queryParams,
+      });
+    },
+    reset() {
+      this.queryParams = initQueryParams({});
+      this.$refs.table.clearSort();
+      this.$refs.table.clearFilter();
+      this.search();
+    },
+    add() {
+      this.$refs.edit.type = "add";
+      this.$refs.edit.setTenant(false, this.dicts);
+      this.dialog.title = this.$t("common.add");
+      this.dialog.isVisible = true;
+    },
+    singleDelete(row) {
+      this.$refs.table.clearSelection();
+      this.$refs.table.toggleRowSelection(row, true);
+      // 调用单个删除API
+      this.remove(row);
+      // 如果是多选删除API
+      // this.batchDelete()
+    },
+    batchDelete() {
+      /*if (!this.selection.length) {
 	        this.$message({
 	          message: this.$t("tips.noDataSelected"),
 	          type: "warning"
@@ -418,179 +604,202 @@
 	        return
 	      }*/
 
-	     	if(!this.currentRow){
-	     		this.$message({
-	          message: this.$t("tips.noDataSelected"),
-	          type: "warning"
-	        })
-	        return
-	     	}
+      if (!this.currentRow) {
+        this.$message({
+          message: this.$t("tips.noDataSelected"),
+          type: "warning",
+        });
+        return;
+      }
 
-	      this.$confirm(this.$t("resource.tips.resourTips"), this.$t("common.tips"), {
-	      	distinguishCancelAndClose: true,
-	        confirmButtonText: this.$t("common.confirm"),
-	        cancelButtonText: this.$t("common.cancel"),
-	        type: "warning"
-	      }).then(() => {
-	      	/*const ids = []
+      this.$confirm(
+        this.$t("resource.tips.resourTips"),
+        this.$t("common.tips"),
+        {
+          distinguishCancelAndClose: true,
+          confirmButtonText: this.$t("common.confirm"),
+          cancelButtonText: this.$t("common.cancel"),
+          type: "warning",
+        }
+      )
+        .then(() => {
+          /*const ids = []
 		      this.selection.forEach(item => {
 		        ids.push(item.id)
 		      })
 		      // 如果是多选删除API
 		      this.delete(ids)*/
-		     	// 调用删除API
-    		 	this.remove(this.currentRow)
-	      }).catch(() => {})
-	    },
-	    clearSelections () {
-	      this.$refs.table.clearSelection()
-	    },
-	    delete (ids) {
-	      equipmentMgrApi.remove({ ids: ids }).then(response => {
-	        const res = response.data
-	        if (res.isSuccess) {
-	          this.$message({
-	            message: this.$t("tips.deleteSuccess"),
-	            type: "success"
-	          })
-	          // 查询列表
-	          this.search()
-	          // 清理已经删除的数据
-	          this.$refs.table.clearSelection()
-	        }
-	      })
-	    },
-	    // 【单体-删除】-函数
-	    remove(row) {
-	    	this.$confirm(this.$t("resource.tips.resourTips"), this.$t("common.tips"), {
-	      	distinguishCancelAndClose: true,
-	        confirmButtonText: this.$t("common.confirm"),
-	        cancelButtonText: this.$t("common.cancel"),
-	        type: "warning"
-	      }).then(() => {
-		    	equipmentMgrApi.removeMore(row).then(response => {
-		        const res = response.data
-		        if (res.isSuccess) {
-		          this.$message({
-		            message: this.$t("tips.deleteSuccess"),
-		            type: "success"
-		          })
-		          // 查询列表
-		          this.search()
-		          // 清理已经删除的数据
-	          	this.$refs.table.clearSelection()
-		        }
-		      })
-		    }).catch(() => {
-		    })
-	    },
-	    view (row) {
-	      this.$refs.view.setTenant(row)
-	      this.tenantViewVisible = true
-	    },
-	    // 【修改】表头上Btn-事件
-	    editOne() {
-	    	if (!this.selection.length) {
-	        this.$message({
-	          message: this.$t("tips.noDataSelected"),
-	          type: "warning"
-	        })
-	        return
-	      }
-	    	if (this.selection.length > 1) {
-	        this.$message({
-	          message: this.$t("tips.mustOne"),
-	          type: "warning"
-	        })
-	        return
-	      }
-	    	this.edit(this.selection[0]);
-	    },
-	    edit (row) {
-	      this.$refs.edit.setTenant(row, this.dicts)
-	      this.$refs.edit.type = "edit"
-	      this.dialog.title = this.$t("resource.common.peizhi")
-	      this.dialog.isVisible = true
-	    },
-
-	    // 【硬件配置】-事件
-	    editHardware (row) {
-	    	// 如果可以配置(agv、arm、machine)
-	    	let str = "agv,arm,machine,tuoban";
-	    	if(str.indexOf(row.category.key) > -1) {
-	    		this.$refs.hardware.setTenant(row)
-		      this.$refs.hardware.type = "edit"
-		      this.dialogHardware.title = this.$t("resource.buttons.hardware")
-		      this.dialogHardware.isVisible = true
-	    	} else {
-	    		this.$message({
-              message: this.$t('resource.tips.hardware'),
-              type: 'warning'
-            })
-	    	}
-	    },
-		editAutoCode (row) {
-	    	//
-	    	this.dialogAutoCode.isVisible = true
-	    },
+          // 调用删除API
+          this.remove(this.currentRow);
+        })
+        .catch(() => {});
+    },
+    clearSelections() {
+      this.$refs.table.clearSelection();
+    },
+    delete(ids) {
+      equipmentMgrApi.remove({ ids: ids }).then((response) => {
+        const res = response.data;
+        if (res.isSuccess) {
+          this.$message({
+            message: this.$t("tips.deleteSuccess"),
+            type: "success",
+          });
+          // 查询列表
+          this.search();
+          // 清理已经删除的数据
+          this.$refs.table.clearSelection();
+        }
+      });
+    },
+    // 【单体-删除】-函数
+    remove(row) {
+      this.$confirm(
+        this.$t("resource.tips.resourTips"),
+        this.$t("common.tips"),
+        {
+          distinguishCancelAndClose: true,
+          confirmButtonText: this.$t("common.confirm"),
+          cancelButtonText: this.$t("common.cancel"),
+          type: "warning",
+        }
+      )
+        .then(() => {
+          equipmentMgrApi.removeMore(row).then((response) => {
+            const res = response.data;
+            if (res.isSuccess) {
+              this.$message({
+                message: this.$t("tips.deleteSuccess"),
+                type: "success",
+              });
+              // 查询列表
+              this.search();
+              // 清理已经删除的数据
+              this.$refs.table.clearSelection();
+            }
+          });
+        })
+        .catch(() => {});
+    },
+    view(row) {
+      this.$refs.view.setTenant(row);
+      this.tenantViewVisible = true;
+    },
+    // 【修改】表头上Btn-事件
+    editOne() {
+      if (!this.selection.length) {
+        this.$message({
+          message: this.$t("tips.noDataSelected"),
+          type: "warning",
+        });
+        return;
+      }
+      if (this.selection.length > 1) {
+        this.$message({
+          message: this.$t("tips.mustOne"),
+          type: "warning",
+        });
+        return;
+      }
+      this.edit(this.selection[0]);
+    },
+    edit(row) {
+      this.$refs.edit.setTenant(row, this.dicts);
+      this.$refs.edit.type = "edit";
+      this.dialog.title = this.$t("resource.common.peizhi");
+      this.dialog.isVisible = true;
+    },
 
-	    fetch (params = {}) {
-	      this.loading = true
-	      if (this.queryParams.timeRange) {
-	        this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
-	        this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
-	      }
+    // 【硬件配置】-事件
+    editHardware(row) {
+      // 如果可以配置(agv、arm、machine)
+      let str = "agv,arm,machine,tuoban";
+      if (str.indexOf(row.category.key) > -1) {
+        this.$refs.hardware.setTenant(row);
+        this.$refs.hardware.type = "edit";
+        this.dialogHardware.title = this.$t("resource.buttons.hardware");
+        this.dialogHardware.isVisible = true;
+      } else {
+        this.$message({
+          message: this.$t("resource.tips.hardware"),
+          type: "warning",
+        });
+      }
+    },
+    editAutoCode(row) {
+      //
+      this.dialogAutoCode.isVisible = true;
+    },
 
-	      this.queryParams.current = params.current ? params.current : this.queryParams.current
-	      this.queryParams.size = params.size ? params.size : this.queryParams.size
-	      // 固定参数(采集的生产资源)
-	      this.queryParams.resourceStatus = "1"
-	      equipmentMgrApi.getPageList(this.queryParams).then(response => {
-	        const res = response.data
-	        if (res.isSuccess) {
-	          // 赋值
-	          this.tableData = res.data
-	          if(this.tableData.data && this.tableData.data.length > 0){
-	          	// 设置图片,放大属性
-	          	this.tableData.data.forEach((item, index) => {
-		        		// item.url = 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg';
-		        		item.srcList = [item.pic];
-		        	})
-	          }
-	        }
-	        // eslint-disable-next-line no-return-assign
-	      }).finally(() => this.loading = false)
+    fetch(params = {}) {
+      this.loading = true;
+      if (this.queryParams.timeRange) {
+        this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
+        this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
+      }
 
-	    },
-	    cellClick (row, column) {
-	      if (column['columnKey'] === "operation") {
-	        return
-	      }
-	      let flag = false
-	      this.selection.forEach((item) => {
-	        if (item.id === row.id) {
-	          flag = true
-	          this.$refs.table.toggleRowSelection(row)
-	        }
-	      })
+      this.queryParams.current = params.current
+        ? params.current
+        : this.queryParams.current;
+      this.queryParams.size = params.size ? params.size : this.queryParams.size;
+      // 固定参数(采集的生产资源)
+      this.queryParams.resourceStatus = "1";
+      equipmentMgrApi
+        .getPageList(this.queryParams)
+        .then((response) => {
+          const res = response.data;
+          if (res.isSuccess) {
+            // 赋值
+            this.tableData = res.data;
+            if (this.tableData.data && this.tableData.data.length > 0) {
+              // 设置图片,放大属性
+              this.tableData.data.forEach((item, index) => {
+                // item.url = 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg';
+                item.srcList = [item.pic];
+              });
+            }
+          }
+          // eslint-disable-next-line no-return-assign
+        })
+        .finally(() => (this.loading = false));
+    },
+    getZoneList() {
+      areaMgrApi.getList({ status: 1 }).then((res) => {
+        res = res.data;
+        if (res.isSuccess) {
+          this.zoneList = res.data;
+        }
+      });
+    },
+    cellClick(row, column) {
+      if (column["columnKey"] === "operation") {
+        return;
+      }
+      let flag = false;
+      this.selection.forEach((item) => {
+        if (item.id === row.id) {
+          flag = true;
+          this.$refs.table.toggleRowSelection(row);
+        }
+      });
 
-	      if (!flag) {
-	        this.$refs.table.toggleRowSelection(row, true)
-	      }
-	    }
-	  }
-	}
+      if (!flag) {
+        this.$refs.table.toggleRowSelection(row, true);
+      }
+    },
+  },
+};
 </script>
 <style type="text/css">
-	.dialogNoTop .el-dialog__body{
-		padding: 0;
-	}
+.dialogNoTop .el-dialog__body {
+  padding: 0;
+}
 </style>
 <style lang="scss" scoped>
-	.statusDiv{
-		color: white;
-		-moz-border-radius: 2px;
-		-webkit-border-radius: 2px;
-		border-radius: 2px;
-	}
+.statusDiv {
+  color: white;
+  -moz-border-radius: 2px;
+  -webkit-border-radius: 2px;
+  border-radius: 2px;
+}
 </style>