From e16f8abc3ae59c03c942b188fcc8e37b8ba01037 Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 28 Jul 2022 18:23:09 +0800 Subject: [PATCH] =?UTF-8?q?refactor=EF=BC=9Avue3=20export=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/codegen/vue3/views/index.vue.vm | 7 +------ .../src/views/infra/apiErrorLog/index.vue | 6 +----- yudao-ui-admin-vue3/src/views/infra/config/index.vue | 7 +------ yudao-ui-admin-vue3/src/views/infra/job/JobLog.vue | 6 +----- yudao-ui-admin-vue3/src/views/infra/job/index.vue | 7 +------ yudao-ui-admin-vue3/src/views/pay/app/index.vue | 7 +------ yudao-ui-admin-vue3/src/views/pay/merchant/index.vue | 7 +------ yudao-ui-admin-vue3/src/views/pay/order/index.vue | 6 +----- yudao-ui-admin-vue3/src/views/pay/refund/index.vue | 7 +------ .../src/views/system/operatelog/index.vue | 6 +----- yudao-ui-admin-vue3/src/views/system/post/index.vue | 7 +------ .../src/views/system/sensitiveWord/index.vue | 6 +----- yudao-ui-admin-vue3/src/views/system/tenant/index.vue | 6 +----- yudao-ui-admin-vue3/src/views/system/user/index.vue | 11 +++++------ 14 files changed, 18 insertions(+), 78 deletions(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm index 8ed527d0b..7d1b18b4f 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm @@ -19,11 +19,6 @@ }) const { getList, setSearchParams, delList, exportList } = methods - // 导出操作 - const handleExport = async () => { - await exportList('数据.xls') - } - // ========== CRUD 相关 ========== const actionLoading = ref(false) // 遮罩层 const actionType = ref('') // 操作按钮的类型 @@ -103,7 +98,7 @@ type="warning" v-hasPermi="['${permissionPrefix}:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('数据.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/infra/apiErrorLog/index.vue b/yudao-ui-admin-vue3/src/views/infra/apiErrorLog/index.vue index 7d14768e8..f6d2e44ed 100644 --- a/yudao-ui-admin-vue3/src/views/infra/apiErrorLog/index.vue +++ b/yudao-ui-admin-vue3/src/views/infra/apiErrorLog/index.vue @@ -23,10 +23,6 @@ const { getList, setSearchParams, exportList } = methods const detailRef = ref() // 详情 Ref const dialogVisible = ref(false) // 是否显示弹出层 const dialogTitle = ref('') // 弹出层标题 -// 导出操作 -const handleExport = async () => { - await exportList('错误数据.xls') -} // 详情操作 const handleDetail = (row: ApiErrorLogVO) => { @@ -57,7 +53,7 @@ getList() - + {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/infra/config/index.vue b/yudao-ui-admin-vue3/src/views/infra/config/index.vue index e35ee258e..991c47a9b 100644 --- a/yudao-ui-admin-vue3/src/views/infra/config/index.vue +++ b/yudao-ui-admin-vue3/src/views/infra/config/index.vue @@ -19,11 +19,6 @@ const { register, tableObject, methods } = useTable({ }) const { getList, setSearchParams, delList, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('参数配置.xls') -} - // ========== CRUD 相关 ========== const actionLoading = ref(false) // 遮罩层 const actionType = ref('') // 操作按钮的类型 @@ -103,7 +98,7 @@ getList() type="warning" v-hasPermi="['infra:config:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('参数配置.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/infra/job/JobLog.vue b/yudao-ui-admin-vue3/src/views/infra/job/JobLog.vue index 477d78a09..1648c8fc3 100644 --- a/yudao-ui-admin-vue3/src/views/infra/job/JobLog.vue +++ b/yudao-ui-admin-vue3/src/views/infra/job/JobLog.vue @@ -25,10 +25,6 @@ const getTableList = async () => { } await getList() } -// 导出操作 -const handleExport = async () => { - await exportList('定时任务日志.xls') -} // ========== CRUD 相关 ========== const dialogVisible = ref(false) // 是否显示弹出层 @@ -63,7 +59,7 @@ onMounted(() => { type="warning" v-hasPermi="['infra:job:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('定时任务日志.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/infra/job/index.vue b/yudao-ui-admin-vue3/src/views/infra/job/index.vue index 2830cb69a..14742bbe2 100644 --- a/yudao-ui-admin-vue3/src/views/infra/job/index.vue +++ b/yudao-ui-admin-vue3/src/views/infra/job/index.vue @@ -22,11 +22,6 @@ const { register, tableObject, methods } = useTable({ }) const { getList, setSearchParams, delList, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('定时任务.xls') -} - // ========== CRUD 相关 ========== const actionLoading = ref(false) // 遮罩层 const actionType = ref('') // 操作按钮的类型 @@ -121,7 +116,7 @@ getList() type="warning" v-hasPermi="['infra:job:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('定时任务.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/pay/app/index.vue b/yudao-ui-admin-vue3/src/views/pay/app/index.vue index 0d444a873..36ded7be7 100644 --- a/yudao-ui-admin-vue3/src/views/pay/app/index.vue +++ b/yudao-ui-admin-vue3/src/views/pay/app/index.vue @@ -19,11 +19,6 @@ const { register, tableObject, methods } = useTable({ }) const { getList, setSearchParams, delList, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('应用数据.xls') -} - // ========== CRUD 相关 ========== const actionLoading = ref(false) // 遮罩层 const actionType = ref('') // 操作按钮的类型 @@ -103,7 +98,7 @@ getList() type="warning" v-hasPermi="['system:post:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('应用数据.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/pay/merchant/index.vue b/yudao-ui-admin-vue3/src/views/pay/merchant/index.vue index b33ed5386..e30cad5ef 100644 --- a/yudao-ui-admin-vue3/src/views/pay/merchant/index.vue +++ b/yudao-ui-admin-vue3/src/views/pay/merchant/index.vue @@ -19,11 +19,6 @@ const { register, tableObject, methods } = useTable({ }) const { getList, setSearchParams, delList, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('商户数据.xls') -} - // ========== CRUD 相关 ========== const actionLoading = ref(false) // 遮罩层 const actionType = ref('') // 操作按钮的类型 @@ -103,7 +98,7 @@ getList() type="warning" v-hasPermi="['system:post:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('商户数据.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/pay/order/index.vue b/yudao-ui-admin-vue3/src/views/pay/order/index.vue index c1775bc9d..63a8da7d2 100644 --- a/yudao-ui-admin-vue3/src/views/pay/order/index.vue +++ b/yudao-ui-admin-vue3/src/views/pay/order/index.vue @@ -17,10 +17,6 @@ const { register, tableObject, methods } = useTable({ exportListApi: OrderApi.exportOrderApi }) const { getList, setSearchParams, delList, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('订单数据.xls') -} // ========== CRUD 相关 ========== const actionLoading = ref(false) // 遮罩层 const actionType = ref('') // 操作按钮的类型 @@ -100,7 +96,7 @@ getList() type="warning" v-hasPermi="['pay:order:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('订单数据.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/pay/refund/index.vue b/yudao-ui-admin-vue3/src/views/pay/refund/index.vue index b9253e0fb..1f4315099 100644 --- a/yudao-ui-admin-vue3/src/views/pay/refund/index.vue +++ b/yudao-ui-admin-vue3/src/views/pay/refund/index.vue @@ -17,11 +17,6 @@ const { register, tableObject, methods } = useTable({ }) const { getList, setSearchParams, delList, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('退款订单.xls') -} - // ========== CRUD 相关 ========== const dialogVisible = ref(false) // 是否显示弹出层 const dialogTitle = ref('edit') // 弹出层标题 @@ -53,7 +48,7 @@ getList() type="warning" v-hasPermi="['system:post:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('退款订单.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/system/operatelog/index.vue b/yudao-ui-admin-vue3/src/views/system/operatelog/index.vue index 2d863f2a8..b190674ba 100644 --- a/yudao-ui-admin-vue3/src/views/system/operatelog/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/operatelog/index.vue @@ -18,10 +18,6 @@ const detailRef = ref() // 详情 Ref const dialogVisible = ref(false) // 是否显示弹出层 const dialogTitle = ref(t('action.detail')) // 弹出层标题 const { getList, setSearchParams, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('操作日志.xls') -} // 详情 const handleDetail = (row: OperateLogVO) => { // 设置数据 @@ -41,7 +37,7 @@ getList() type="warning" v-hasPermi="['system:operate-log:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('操作日志.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/system/post/index.vue b/yudao-ui-admin-vue3/src/views/system/post/index.vue index d9fc255a4..3995b6759 100644 --- a/yudao-ui-admin-vue3/src/views/system/post/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/post/index.vue @@ -19,11 +19,6 @@ const { register, tableObject, methods } = useTable({ }) const { getList, setSearchParams, delList, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('岗位数据.xls') -} - // ========== CRUD 相关 ========== const actionLoading = ref(false) // 遮罩层 const actionType = ref('') // 操作按钮的类型 @@ -103,7 +98,7 @@ getList() type="warning" v-hasPermi="['system:post:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('岗位数据.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue b/yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue index 22340744f..69f9f97c5 100644 --- a/yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue @@ -19,10 +19,6 @@ const { register, tableObject, methods } = useTable({ }) const { getList, setSearchParams, delList, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('敏感词数据.xls') -} // 获取标签 const tagsOptions = ref() const getTags = async () => { @@ -111,7 +107,7 @@ onMounted(async () => { type="warning" v-hasPermi="['system:post:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('敏感词数据.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/system/tenant/index.vue b/yudao-ui-admin-vue3/src/views/system/tenant/index.vue index 80bf06dc1..76bdf9b9f 100644 --- a/yudao-ui-admin-vue3/src/views/system/tenant/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/tenant/index.vue @@ -21,10 +21,6 @@ const { register, tableObject, methods } = useTable({ }) const { getList, setSearchParams, delList, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('租户数据.xls') -} // ========== 套餐 ========== const tenantPackageId = ref() // 套餐 const tenantPackageOptions = ref([]) //套餐列表 @@ -129,7 +125,7 @@ onMounted(async () => { type="warning" v-hasPermi="['system:tenant:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('租户数据.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/system/user/index.vue b/yudao-ui-admin-vue3/src/views/system/user/index.vue index 0d327dc0d..5a9057a74 100644 --- a/yudao-ui-admin-vue3/src/views/system/user/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/user/index.vue @@ -165,11 +165,6 @@ const handleResetPwd = (row: UserVO) => { }) } -// 导出操作 -const handleExport = async () => { - await exportList('用户数据.xls') -} - // ========== 详情相关 ========== const detailRef = ref() @@ -296,7 +291,11 @@ getList() > {{ t('action.import') }} - + {{ t('action.export') }}