From b7ad54294da15dccc59f7b6c879af3e000024d9d Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期四, 19 六月 2025 17:51:30 +0800
Subject: [PATCH] 1、全局树组件多选设备抽屉组件增加点击树节点名称也可以选中当前节点 2、设备监控页面布局图查看设备详情时首次进入清空上一次设备信息(由于数据为定时刷新不能每次获取数据均清空) 3、设备类型管理页面调整设备类型图片尺寸以解决表格错行问题 4、设备管理页面添加或编辑设备弹窗选择设备时增加点击行即可选中

---
 src/views/mdc/base/modules/EquipmentList/DeviceListModal.vue |  205 ++++++++++++---------------------------------------
 1 files changed, 48 insertions(+), 157 deletions(-)

diff --git a/src/views/mdc/base/modules/EquipmentList/DeviceListModal.vue b/src/views/mdc/base/modules/EquipmentList/DeviceListModal.vue
index f799bac..0e5a69c 100644
--- a/src/views/mdc/base/modules/EquipmentList/DeviceListModal.vue
+++ b/src/views/mdc/base/modules/EquipmentList/DeviceListModal.vue
@@ -6,13 +6,13 @@
       <div class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="searchQuery">
           <a-row :gutter="24">
-            <a-col :md="7" :sm="7">
+            <a-col :md="9" :sm="9">
               <a-form-item label="缁熶竴缂栫爜">
                 <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜妫�绱�" v-model="queryParam.equipmentid"></a-input>
               </a-form-item>
             </a-col>
 
-            <a-col :md="7" :sm="7">
+            <a-col :md="9" :sm="9">
               <a-form-item label="璁惧鍚嶇О">
                 <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉版绱�" v-model="queryParam.equipmentname"></a-input>
               </a-form-item>
@@ -21,7 +21,7 @@
             <a-col :md="3" :sm="3">
               <a-space>
                 <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
-                <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>
+                <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>
               </a-space>
             </a-col>
           </a-row>
@@ -30,8 +30,8 @@
 
       <!-- table鍖哄煙-begin -->
       <div>
-        <a-table ref="table" size="middle" bordered rowKey="id" :scroll="{聽 y: 300聽}" :columns="columns"
-                 :dataSource="dataSource" :pagination="ipagination" :loading="loading"
+        <a-table bordered rowKey="equipmentid" :scroll="{聽 y: 300聽}" :columns="columns"
+                 :dataSource="dataSource" :pagination="ipagination" :loading="loading" :customRow="customRow"
                  :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
                  @change="handleTableChange">
         </a-table>
@@ -42,215 +42,106 @@
 </template>
 
 <script>
-  import {
-    ajaxGetSelectItems
-  } from '@/api/api'
-  import JDictSelectTag from '@/components/dict/JDictSelectTag'
-  import {
-    deleteAction,
-    requestPut,
-    getAction
-  } from '@/api/manage'
-  import {
-    JeecgListMixin
-  } from '@/mixins/JeecgListMixin'
-  import JInput from '@/components/jeecg/JInput'
-  import JEllipsis from '@/components/jeecg/JEllipsis'
-  import Tooltip from 'ant-design-vue/es/tooltip'
-  import JDate from '@/components/jeecg/JDate'
-  import moment from 'moment'
-  import { filterObj } from '@/utils/util';
+  import { getAction } from '@/api/manage'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 
   export default {
     name: 'DeviceListModel',
     mixins: [JeecgListMixin],
-    components: {
-      JDictSelectTag,
-      JEllipsis,
-      JInput,
-      Tooltip,
-      JDate
-    },
-    props: {
-      status: {
-        type: Number,
-        default: 1
-      }
-    },
     data() {
       return {
-        title:'',
+        title: '',
         visible: false,
         disableMixinCreated: true,
-        queryParam: {},
-        columns: [{
-          title: '缁熶竴缂栫爜',
-          align: 'center',
-          dataIndex: 'equipmentid',
-        },
+        columns: [
+          {
+            title: '缁熶竴缂栫爜',
+            align: 'center',
+            dataIndex: 'equipmentid'
+          },
           {
             title: '璁惧鍚嶇О',
             align: 'center',
-            dataIndex: 'equipmentname',
+            dataIndex: 'equipmentname'
           },
           {
             title: '璁惧鍨嬪彿',
             align: 'center',
-            dataIndex: 'equipmentmodel',
+            dataIndex: 'equipmentmodel'
           },
-          // {
-          //   title: '璁惧绫诲瀷',
-          //   align: 'center',
-          //   dataIndex: 'equipmentType',
-          // },
           {
             title: '鏈哄簥IP',
             align: 'center',
-            dataIndex: 'equipmentip',
+            dataIndex: 'equipmentip'
           },
           {
             title: '椹卞姩绫诲瀷',
             align: 'center',
-            dataIndex: 'drivetype',
+            dataIndex: 'drivetype'
           },
           {
             title: '绔彛',
             align: 'center',
-            dataIndex: 'dataport',
+            dataIndex: 'dataport'
           },
           {
             title: '鏁版帶绯荤粺',
             align: 'center',
-            dataIndex: 'controlsystem',
+            dataIndex: 'controlsystem'
           }
         ],
-        url: {
-          list: '/mdc/equipment/list',
+        /* 鎺掑簭鍙傛暟 */
+        isorter: {
+          column: '',
+          order: ''
         },
-
+        url: {
+          list: '/mdc/equipment/list'
+        }
       }
-    },
-    created() {
-
     },
     methods: {
       openPage() {
         this.visible = true
         this.onClearSelected()
-        this.dataSource = [];
-        // this.queryParam = {
-        //   status: this.status
-        // };
-        this.loadData();
+        this.dataSource = []
+        this.loadData()
       },
-      getQueryParams() {
-        //鑾峰彇鏌ヨ鏉′欢
-        let sqp = {}
-        if(this.superQueryParams){
-          sqp['superQueryParams']=encodeURI(this.superQueryParams)
-          sqp['superQueryMatchType'] = this.superQueryMatchType
-        }
-        var param = Object.assign(sqp, this.queryParam);
-        // param.field = this.getQueryField();
-        param.pageNo = this.ipagination.current;
-        param.pageSize = this.ipagination.pageSize;
-        //鑾峰彇鐢ㄦ埛瀹氬埗鐨勫弬鏁板睘鎬�
-        // if (this.getCustomQueryParams) {
-        //   param = this.getCustomQueryParams(param);
-        //   if(!param){
-        //     return false;
-        //   }
-        // }
 
-        return filterObj(param);
-      },
-      loadData(arg) {
-        if(!this.url.list){
-          this.$message.error("璇疯缃畊rl.list灞炴��!")
-          return
-        }
-        //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭
-        if (arg === 1) {
-          this.ipagination.current = 1;
-        }
-        var params = this.getQueryParams();//鏌ヨ鏉′欢
-
-        if(!params){
-          return false;
-        }
-
-        this.loading = true;
-        getAction(this.url.list, params).then((res) => {
-          if (res.success) {
-            // console.log(res)
-            //update-begin---author:zhangyafei    Date:20201118  for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
-            this.dataSource = res.result.records||res.result;
-            if(res.result.total)
-            {
-              this.ipagination.total = res.result.total;
-            }else{
-              this.ipagination.total = 0;
+      /**
+       * 鑷畾涔夎〃鏍艰
+       * @param record 琛ㄦ牸琛屼俊鎭�
+       * @returns {{style: {cursor: string}, on: {click: on.click}}}
+       */
+      customRow(record) {
+        return {
+          style: {
+            cursor: 'pointer'
+          },
+          on: {
+            click: () => {
+              this.onSelectChange([record.equipmentid], [record])
             }
-            //update-end---author:zhangyafei    Date:20201118  for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
-          }else{
-            // this.$message.warning(res.message)
-            this.$notification.warning({
-              message:'娑堟伅',
-              description:res.message
-            });
           }
-        }).finally(() => {
-          this.loading = false
-        })
+        }
       },
-      getQueryField() {
-        //TODO 瀛楁鏉冮檺鎺у埗
-        // var str = "";
-        // this.columns.forEach(function (value) {
-        //   str +=  value.dataIndex +"," ;
-        // });
-        // return str;
-      },
-      modalFormOk(val) {
-        // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃
-        this.loadData();
-        this.selectedRowKeys = [val.id];
-      },
-      searchQuery() {
-        this.loadData();
-        this.onClearSelected()
-      },
-      searchReset() {
-        this.queryParam = {}
-        this.loadData();
-        this.onClearSelected()
-      },
+
       close() {
         this.$emit('close')
         this.visible = false
       },
+
       handleCancel() {
         this.close()
       },
+
       handleOk() {
         this.$emit('sendSelectionRows', this.selectionRows[0])
         this.close()
-      },
-    },
+      }
+    }
   }
 </script>
 <style>
   @import '~@assets/less/common.less';
-
-  .frozenRowClass {
-    color: #c9c9c9;
-  }
-
-  .success {
-    color: green;
-  }
-
-  .error {
-    color: red;
-  }
 </style>

--
Gitblit v1.9.3