From b4edf6ce42debe4edcc85414d9f6c0d41f480587 Mon Sep 17 00:00:00 2001 From: cuilei <ray_tsu1@163.com> Date: 星期五, 20 六月 2025 11:36:06 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/eam/purchase/EamPurchasePlanAttachmentList.vue | 186 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 186 insertions(+), 0 deletions(-) diff --git a/src/views/eam/purchase/EamPurchasePlanAttachmentList.vue b/src/views/eam/purchase/EamPurchasePlanAttachmentList.vue new file mode 100644 index 0000000..b0c59be --- /dev/null +++ b/src/views/eam/purchase/EamPurchasePlanAttachmentList.vue @@ -0,0 +1,186 @@ +<template> + <a-card :bordered="false"> + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <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 --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eam-purchase-plan-attachment-modal ref="modalForm" @ok="modalFormOk" :planId="queryParam.planId"></eam-purchase-plan-attachment-modal> + <lx-file-preview ref="lxFilePreview" :fileUrl="fileUrl"></lx-file-preview> + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import EamPurchasePlanAttachmentModal from './modules/EamPurchasePlanAttachmentModal.vue' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { downFile } from '@api/manage' + +export default { + name: 'EamPurchasePlanAttachmentList', + mixins: [JeecgListMixin], + components: { + EamPurchasePlanAttachmentModal + }, + data() { + return { + description: '璁惧閲囪喘璁″垝闄勪欢绠$悊椤甸潰', + disableMixinCreated: true, + fileUrl: '', + queryParam: {}, + // 琛ㄥご + 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/eamPurchasePlanAttachment/list', + delete: '/eam/eamPurchasePlanAttachment/delete', + deleteBatch: '/eam/eamPurchasePlanAttachment/deleteBatch', + download: '/eam/eamPurchasePlanAttachment/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