From 69c32b259340355477b439b8bd71f36f877dcaa1 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 16 Apr 2024 11:41:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=BD=AF=E4=BB=B6=E5=8C=85=E5=A4=9A?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ne/neSoftware/components/EditModal.vue | 3 +- .../neSoftware/components/UploadMoreFile.vue | 248 ++++++++++++++++++ src/views/ne/neSoftware/index.vue | 54 ++-- 3 files changed, 277 insertions(+), 28 deletions(-) create mode 100644 src/views/ne/neSoftware/components/UploadMoreFile.vue diff --git a/src/views/ne/neSoftware/components/EditModal.vue b/src/views/ne/neSoftware/components/EditModal.vue index d9e250ba..9524b927 100644 --- a/src/views/ne/neSoftware/components/EditModal.vue +++ b/src/views/ne/neSoftware/components/EditModal.vue @@ -4,7 +4,6 @@ import { message, Form, Upload } from 'ant-design-vue/lib'; import useI18n from '@/hooks/useI18n'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { NE_TYPE_LIST } from '@/constants/ne-constants'; -import useDictStore from '@/store/modules/dict'; import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface'; import { addNeSoftware, @@ -111,7 +110,7 @@ function fnModalOk() { content: t('common.operateOk'), duration: 3, }); - emit('ok'); + emit('ok', from); fnModalCancel(); } else { message.error({ diff --git a/src/views/ne/neSoftware/components/UploadMoreFile.vue b/src/views/ne/neSoftware/components/UploadMoreFile.vue new file mode 100644 index 00000000..91ca9629 --- /dev/null +++ b/src/views/ne/neSoftware/components/UploadMoreFile.vue @@ -0,0 +1,248 @@ + + + + + diff --git a/src/views/ne/neSoftware/index.vue b/src/views/ne/neSoftware/index.vue index 62ffbf21..d1fd4ce3 100644 --- a/src/views/ne/neSoftware/index.vue +++ b/src/views/ne/neSoftware/index.vue @@ -13,10 +13,14 @@ import { parseDateToStr } from '@/utils/date-utils'; import { downloadFile } from '@/api/tool/file'; import { saveAs } from 'file-saver'; const { t } = useI18n(); + // 异步加载组件 const EditModal = defineAsyncComponent( () => import('./components/EditModal.vue') ); +const UploadMoreFile = defineAsyncComponent( + () => import('./components/UploadMoreFile.vue') +); /**网元参数 */ let neOtions = ref[]>([]); @@ -55,8 +59,6 @@ type TabeStateType = { loading: boolean; /**紧凑型 */ size: SizeType; - /**斑马纹 */ - striped: boolean; /**搜索栏 */ seached: boolean; /**记录数据 */ @@ -67,7 +69,6 @@ type TabeStateType = { let tableState: TabeStateType = reactive({ loading: false, size: 'middle', - striped: false, seached: false, data: [], }); @@ -161,11 +162,6 @@ function fnTableSize({ key }: MenuInfo) { tableState.size = key as SizeType; } -/**表格斑马纹 */ -function fnTableStriped(_record: unknown, index: number): any { - return tableState.striped && index % 2 === 1 ? 'table-striped' : undefined; -} - /**查询列表, pageNum初始页数 */ function fnGetList(pageNum?: number) { if (tableState.loading) return; @@ -199,6 +195,8 @@ type ModalStateType = { visibleByEdit: boolean; /**新增框或修改框ID */ editId: string; + /**多文件上传 */ + visibleByMoreFile: boolean; /**确定按钮 loading */ confirmLoading: boolean; }; @@ -207,6 +205,7 @@ type ModalStateType = { let modalState: ModalStateType = reactive({ visibleByEdit: false, editId: '', + visibleByMoreFile: false, confirmLoading: false, }); @@ -238,6 +237,7 @@ function fnModalEditOk() { function fnModalEditCancel() { modalState.editId = ''; modalState.visibleByEdit = false; + modalState.visibleByMoreFile = false; } /**删除软件包 */ @@ -393,10 +393,19 @@ onMounted(() => { @@ -411,15 +420,6 @@ onMounted(() => { size="small" /> - - - - @@ -461,7 +461,6 @@ onMounted(() => { :loading="tableState.loading" :data-source="tableState.data" :size="tableState.size" - :row-class-name="fnTableStriped" :pagination="tablePagination" :scroll="{ y: 'calc(100vh - 480px)' }" @resizeColumn="(w:number, col:any) => (col.width = w)" @@ -529,6 +528,13 @@ onMounted(() => { @ok="fnModalEditOk" @cancel="fnModalEditCancel" > + + + @@ -536,8 +542,4 @@ onMounted(() => { .table :deep(.ant-pagination) { padding: 0 24px; } - -.table :deep(.table-striped) td { - background-color: #fafafa; -}