From c172f50f28cb37b982eb39a0a9a257cbc60b3a3e Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期二, 18 三月 2025 18:04:53 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/eam/base/EamSysFilesList.vue |  204 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 204 insertions(+), 0 deletions(-)

diff --git a/src/views/eam/base/EamSysFilesList.vue b/src/views/eam/base/EamSysFilesList.vue
new file mode 100644
index 0000000..f1c6ae6
--- /dev/null
+++ b/src/views/eam/base/EamSysFilesList.vue
@@ -0,0 +1,204 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 鏌ヨ鍖哄煙 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="鏂囦欢鍚嶇О">
+              <j-input placeholder="璇疯緭鍏ユ枃浠跺悕绉�" v-model="queryParam.fileName"></j-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
+              <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>
+            </span>
+          </a-col>
+
+        </a-row>
+      </a-form>
+    </div>
+
+    <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel">
+            <a-icon type="delete" />
+            鍒犻櫎
+          </a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔
+          <a-icon type="down" />
+        </a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table鍖哄煙-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a
+        style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤�
+        <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        class="j-table-force-nowrap"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        @change="handleTableChange">
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">缂栬緫</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                 <a @click="handlePreview(record)">棰勮</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="纭畾涓嬭浇鏂囦欢鍚�?" @confirm="() => handleDownload(record)">
+                  <a>涓嬭浇</a>
+                </a-popconfirm>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)">
+                  <a>鍒犻櫎</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+    <!-- table鍖哄煙-end -->
+
+    <!-- 琛ㄥ崟鍖哄煙 -->
+    <eamSysFiles-modal ref="modalForm" @ok="modalFormOk"></eamSysFiles-modal>
+    <lx-file-preview ref="lxFilePreview" :fileUrl="fileUrl"></lx-file-preview>
+  </a-card>
+</template>
+
+<script>
+import '@/assets/less/TableExpand.less'
+import EamSysFilesModal from './modules/EamSysFilesModal'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { downFile } from '@/api/manage';
+
+export default {
+  name: 'EamSysFilesList',
+  mixins: [JeecgListMixin],
+  components: {
+    EamSysFilesModal
+  },
+  data() {
+    return {
+      description: '璁惧闄勪欢绠$悊绠$悊椤甸潰',
+      fileUrl: '',
+      // 琛ㄥご
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: 'center',
+          customRender: function(t, r, index) {
+            return parseInt(index) + 1
+          }
+        },
+        {
+          title: '鏂囦欢鍔犲瘑鍚�',
+          align: 'center',
+          dataIndex: 'fileEncodeName',
+          ellipsis: true,
+        },
+        {
+          title: '鏂囦欢鍚嶇О',
+          align: 'center',
+          dataIndex: 'fileName',
+          ellipsis: true,
+        },
+        {
+          title: '鏂囦欢璺緞',
+          align: 'center',
+          dataIndex: 'filePath',
+          ellipsis: true,
+        },
+        {
+          title: '鏂囦欢鍚庣紑鍚�',
+          align: 'center',
+          dataIndex: 'fileSuffix'
+        },
+        {
+          title: '鏂囦欢澶у皬',
+          align: 'center',
+          dataIndex: 'fileSize'
+        },
+        {
+          title: '鎻忚堪',
+          align: 'center',
+          dataIndex: 'description',
+          ellipsis: true,
+        },
+        {
+          title: '鎿嶄綔',
+          dataIndex: 'action',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      url: {
+        list: '/eam/sysFiles/list',
+        delete: '/eam/sysFiles/delete',
+        deleteBatch: '/eam/sysFiles/deleteBatch',
+        download: '/eam/sysFiles/downloadFile',
+      }
+    }
+  },
+  computed: {},
+  methods: {
+    handleDownload(record) {
+      downFile(this.url.download, { id: record.id }).then((res) => {
+        if (!res) {
+          this.$message.warning('鏂囦欢涓嬭浇澶辫触')
+          return
+        } else {
+          let fileName = record.fileName;
+          if (typeof window.navigator.msSaveBlob !== 'undefined') {
+            window.navigator.msSaveBlob(new Blob([res]), fileName);
+          } else {
+            let url = window.URL.createObjectURL(new Blob([res]));
+            let link = document.createElement('a');
+            link.style.display = 'none';
+            link.href = url;
+            link.setAttribute('download', fileName);
+            document.body.appendChild(link);
+            link.click()
+            document.body.removeChild(link) //涓嬭浇瀹屾垚绉婚櫎鍏冪礌
+            window.URL.revokeObjectURL(url) //閲婃斁鎺塨lob瀵硅薄
+          }
+        }
+      })
+    },
+    handlePreview: function (record) {
+      this.$refs.lxFilePreview.preview(record.filePath);
+    },
+  }
+}
+</script>
+<style scoped>
+@import '~@assets/less/common.less';
+</style>
\ No newline at end of file

--
Gitblit v1.9.3