From 67000bf11ea45f2f29177e203e91d42f524faa59 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期一, 31 三月 2025 16:33:48 +0800
Subject: [PATCH] art: 设备管理-保养标准-编辑功能

---
 src/views/eam/base/EamMaintenanceStandardList.vue |   51 +++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 43 insertions(+), 8 deletions(-)

diff --git a/src/views/eam/base/EamMaintenanceStandardList.vue b/src/views/eam/base/EamMaintenanceStandardList.vue
index 7d68d68..571d403 100644
--- a/src/views/eam/base/EamMaintenanceStandardList.vue
+++ b/src/views/eam/base/EamMaintenanceStandardList.vue
@@ -83,7 +83,9 @@
         class="j-table-force-nowrap"
         :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
         @change="handleTableChange">
-
+        <template slot="referenceFile" slot-scope="text, record, index">
+          <a v-if="text && text !== ''" @click="handlePreview(record)">棰勮</a>
+        </template>
         <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">缂栬緫</a>
 
@@ -106,6 +108,7 @@
 
     <!-- 琛ㄥ崟鍖哄煙 -->
     <eamMaintenanceStandard-modal ref="modalForm" @ok="modalFormOk"></eamMaintenanceStandard-modal>
+    <lx-file-preview ref="lxFilePreview" :fileUrl="fileUrl"></lx-file-preview>
   </a-card>
 </template>
 
@@ -113,6 +116,7 @@
 import '@/assets/less/TableExpand.less'
 import EamMaintenanceStandardModal from './modules/EamMaintenanceStandardModal'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+
 
 export default {
   name: 'EamMaintenanceStandardList',
@@ -146,29 +150,45 @@
           dataIndex: 'standardName'
         },
         {
-          title: '淇濆吇鍛ㄦ湡',
+          title: '鏂囦欢缂栧彿',
+          align: 'center',
+          dataIndex: 'fileCode'
+        },
+        {
+          title: '淇濆吇鍛ㄦ湡(澶�)',
           align: 'center',
           dataIndex: 'maintenancePeriod'
         },
         {
+          title: '鍒濆鏃ユ湡',
+          align: 'center',
+          dataIndex: 'initialDate'
+        },
+        {
           title: '淇濆吇鍒嗙被',
           align: 'center',
-          dataIndex: 'maintenanceCategory'
+          dataIndex: 'maintenanceCategory_dictText'
         },
         {
           title: '璁惧缂栧彿',
           align: 'center',
-          dataIndex: 'equipmentCode'
+          dataIndex: 'equipmentId_dictText'
         },
         {
           title: '鏍囧噯鐘舵��',
           align: 'center',
-          dataIndex: 'standardStatus'
+          dataIndex: 'standardStatus_dictText'
         },
         {
-          title: '鏍囧噯鐗堟湰',
+          title: '鐗堟湰',
           align: 'center',
           dataIndex: 'standardVersion'
+        },
+        {
+          title: '鍙傝�冩枃浠�',
+          align: 'center',
+          dataIndex: 'referenceFile',
+          scopedSlots: { customRender: 'referenceFile' }
         },
         {
           title: '鎿嶄綔',
@@ -183,7 +203,8 @@
         deleteBatch: '/eam/maintenanceStandard/deleteBatch',
         exportXlsUrl: 'eam/maintenanceStandard/exportXls',
         importExcelUrl: 'eam/maintenanceStandard/importExcel'
-      }
+      },
+      fileUrl: '',
     }
   },
   computed: {
@@ -191,7 +212,21 @@
       return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
     }
   },
-  methods: {}
+  methods: {
+    handlePreview: function (record) {
+      if(record.referenceFile) {
+        try {
+          let file = JSON.parse(record.referenceFile);
+          this.$refs.lxFilePreview.preview(file.filePath);
+        }catch (e) {
+          console.error(e);
+          this.$message.error(e.message);
+        }
+      }else {
+        this.$message.warning("鍙傝�冩枃浠朵负绌猴紒");
+      }
+    },
+  }
 }
 </script>
 <style scoped>

--
Gitblit v1.9.3