Commit e16f8abc3ae59c03c942b188fcc8e37b8ba01037

Authored by xingyu
1 parent 4825e3a2

refactor:vue3 export function

yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm
... ... @@ -19,11 +19,6 @@
19 19 })
20 20 const { getList, setSearchParams, delList, exportList } = methods
21 21  
22   - // 导出操作
23   - const handleExport = async () => {
24   - await exportList('数据.xls')
25   - }
26   -
27 22 // ========== CRUD 相关 ==========
28 23 const actionLoading = ref(false) // 遮罩层
29 24 const actionType = ref('') // 操作按钮的类型
... ... @@ -103,7 +98,7 @@
103 98 type="warning"
104 99 v-hasPermi="['${permissionPrefix}:export']"
105 100 :loading="tableObject.exportLoading"
106   - @click="handleExport"
  101 + @click="exportList('数据.xls')"
107 102 >
108 103 <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
109 104 </el-button>
... ...
yudao-ui-admin-vue3/src/views/infra/apiErrorLog/index.vue
... ... @@ -23,10 +23,6 @@ const { getList, setSearchParams, exportList } = methods
23 23 const detailRef = ref() // 详情 Ref
24 24 const dialogVisible = ref(false) // 是否显示弹出层
25 25 const dialogTitle = ref('') // 弹出层标题
26   -// 导出操作
27   -const handleExport = async () => {
28   - await exportList('错误数据.xls')
29   -}
30 26  
31 27 // 详情操作
32 28 const handleDetail = (row: ApiErrorLogVO) => {
... ... @@ -57,7 +53,7 @@ getList()
57 53 <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
58 54 </ContentWrap>
59 55 <ContentWrap>
60   - <el-button v-hasPermi="['infra:api-error-log:export']" @click="handleExport">
  56 + <el-button v-hasPermi="['infra:api-error-log:export']" @click="exportList('错误数据.xls')">
61 57 <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
62 58 </el-button>
63 59 <!-- 列表 -->
... ...
yudao-ui-admin-vue3/src/views/infra/config/index.vue
... ... @@ -19,11 +19,6 @@ const { register, tableObject, methods } = useTable&lt;ConfigVO&gt;({
19 19 })
20 20 const { getList, setSearchParams, delList, exportList } = methods
21 21  
22   -// 导出操作
23   -const handleExport = async () => {
24   - await exportList('参数配置.xls')
25   -}
26   -
27 22 // ========== CRUD 相关 ==========
28 23 const actionLoading = ref(false) // 遮罩层
29 24 const actionType = ref('') // 操作按钮的类型
... ... @@ -103,7 +98,7 @@ getList()
103 98 type="warning"
104 99 v-hasPermi="['infra:config:export']"
105 100 :loading="tableObject.exportLoading"
106   - @click="handleExport"
  101 + @click="exportList('参数配置.xls')"
107 102 >
108 103 <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
109 104 </el-button>
... ...
yudao-ui-admin-vue3/src/views/infra/job/JobLog.vue
... ... @@ -25,10 +25,6 @@ const getTableList = async () =&gt; {
25 25 }
26 26 await getList()
27 27 }
28   -// 导出操作
29   -const handleExport = async () => {
30   - await exportList('定时任务日志.xls')
31   -}
32 28  
33 29 // ========== CRUD 相关 ==========
34 30 const dialogVisible = ref(false) // 是否显示弹出层
... ... @@ -63,7 +59,7 @@ onMounted(() =&gt; {
63 59 type="warning"
64 60 v-hasPermi="['infra:job:export']"
65 61 :loading="tableObject.exportLoading"
66   - @click="handleExport"
  62 + @click="exportList('定时任务日志.xls')"
67 63 >
68 64 <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
69 65 </el-button>
... ...
yudao-ui-admin-vue3/src/views/infra/job/index.vue
... ... @@ -22,11 +22,6 @@ const { register, tableObject, methods } = useTable&lt;JobVO&gt;({
22 22 })
23 23 const { getList, setSearchParams, delList, exportList } = methods
24 24  
25   -// 导出操作
26   -const handleExport = async () => {
27   - await exportList('定时任务.xls')
28   -}
29   -
30 25 // ========== CRUD 相关 ==========
31 26 const actionLoading = ref(false) // 遮罩层
32 27 const actionType = ref('') // 操作按钮的类型
... ... @@ -121,7 +116,7 @@ getList()
121 116 type="warning"
122 117 v-hasPermi="['infra:job:export']"
123 118 :loading="tableObject.exportLoading"
124   - @click="handleExport"
  119 + @click="exportList('定时任务.xls')"
125 120 >
126 121 <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
127 122 </el-button>
... ...
yudao-ui-admin-vue3/src/views/pay/app/index.vue
... ... @@ -19,11 +19,6 @@ const { register, tableObject, methods } = useTable&lt;AppVO&gt;({
19 19 })
20 20 const { getList, setSearchParams, delList, exportList } = methods
21 21  
22   -// 导出操作
23   -const handleExport = async () => {
24   - await exportList('应用数据.xls')
25   -}
26   -
27 22 // ========== CRUD 相关 ==========
28 23 const actionLoading = ref(false) // 遮罩层
29 24 const actionType = ref('') // 操作按钮的类型
... ... @@ -103,7 +98,7 @@ getList()
103 98 type="warning"
104 99 v-hasPermi="['system:post:export']"
105 100 :loading="tableObject.exportLoading"
106   - @click="handleExport"
  101 + @click="exportList('应用数据.xls')"
107 102 >
108 103 <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
109 104 </el-button>
... ...
yudao-ui-admin-vue3/src/views/pay/merchant/index.vue
... ... @@ -19,11 +19,6 @@ const { register, tableObject, methods } = useTable&lt;MerchantVO&gt;({
19 19 })
20 20 const { getList, setSearchParams, delList, exportList } = methods
21 21  
22   -// 导出操作
23   -const handleExport = async () => {
24   - await exportList('商户数据.xls')
25   -}
26   -
27 22 // ========== CRUD 相关 ==========
28 23 const actionLoading = ref(false) // 遮罩层
29 24 const actionType = ref('') // 操作按钮的类型
... ... @@ -103,7 +98,7 @@ getList()
103 98 type="warning"
104 99 v-hasPermi="['system:post:export']"
105 100 :loading="tableObject.exportLoading"
106   - @click="handleExport"
  101 + @click="exportList('商户数据.xls')"
107 102 >
108 103 <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
109 104 </el-button>
... ...
yudao-ui-admin-vue3/src/views/pay/order/index.vue
... ... @@ -17,10 +17,6 @@ const { register, tableObject, methods } = useTable&lt;OrderVO&gt;({
17 17 exportListApi: OrderApi.exportOrderApi
18 18 })
19 19 const { getList, setSearchParams, delList, exportList } = methods
20   -// 导出操作
21   -const handleExport = async () => {
22   - await exportList('订单数据.xls')
23   -}
24 20 // ========== CRUD 相关 ==========
25 21 const actionLoading = ref(false) // 遮罩层
26 22 const actionType = ref('') // 操作按钮的类型
... ... @@ -100,7 +96,7 @@ getList()
100 96 type="warning"
101 97 v-hasPermi="['pay:order:export']"
102 98 :loading="tableObject.exportLoading"
103   - @click="handleExport"
  99 + @click="exportList('订单数据.xls')"
104 100 >
105 101 <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
106 102 </el-button>
... ...
yudao-ui-admin-vue3/src/views/pay/refund/index.vue
... ... @@ -17,11 +17,6 @@ const { register, tableObject, methods } = useTable&lt;RefundVO&gt;({
17 17 })
18 18 const { getList, setSearchParams, delList, exportList } = methods
19 19  
20   -// 导出操作
21   -const handleExport = async () => {
22   - await exportList('退款订单.xls')
23   -}
24   -
25 20 // ========== CRUD 相关 ==========
26 21 const dialogVisible = ref(false) // 是否显示弹出层
27 22 const dialogTitle = ref('edit') // 弹出层标题
... ... @@ -53,7 +48,7 @@ getList()
53 48 type="warning"
54 49 v-hasPermi="['system:post:export']"
55 50 :loading="tableObject.exportLoading"
56   - @click="handleExport"
  51 + @click="exportList('退款订单.xls')"
57 52 >
58 53 <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
59 54 </el-button>
... ...
yudao-ui-admin-vue3/src/views/system/operatelog/index.vue
... ... @@ -18,10 +18,6 @@ const detailRef = ref() // 详情 Ref
18 18 const dialogVisible = ref(false) // 是否显示弹出层
19 19 const dialogTitle = ref(t('action.detail')) // 弹出层标题
20 20 const { getList, setSearchParams, exportList } = methods
21   -// 导出操作
22   -const handleExport = async () => {
23   - await exportList('操作日志.xls')
24   -}
25 21 // 详情
26 22 const handleDetail = (row: OperateLogVO) => {
27 23 // 设置数据
... ... @@ -41,7 +37,7 @@ getList()
41 37 type="warning"
42 38 v-hasPermi="['system:operate-log:export']"
43 39 :loading="tableObject.exportLoading"
44   - @click="handleExport"
  40 + @click="exportList('操作日志.xls')"
45 41 >
46 42 <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
47 43 </el-button>
... ...
yudao-ui-admin-vue3/src/views/system/post/index.vue
... ... @@ -19,11 +19,6 @@ const { register, tableObject, methods } = useTable&lt;PostVO&gt;({
19 19 })
20 20 const { getList, setSearchParams, delList, exportList } = methods
21 21  
22   -// 导出操作
23   -const handleExport = async () => {
24   - await exportList('岗位数据.xls')
25   -}
26   -
27 22 // ========== CRUD 相关 ==========
28 23 const actionLoading = ref(false) // 遮罩层
29 24 const actionType = ref('') // 操作按钮的类型
... ... @@ -103,7 +98,7 @@ getList()
103 98 type="warning"
104 99 v-hasPermi="['system:post:export']"
105 100 :loading="tableObject.exportLoading"
106   - @click="handleExport"
  101 + @click="exportList('岗位数据.xls')"
107 102 >
108 103 <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
109 104 </el-button>
... ...
yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue
... ... @@ -19,10 +19,6 @@ const { register, tableObject, methods } = useTable&lt;SensitiveWordVO&gt;({
19 19 })
20 20 const { getList, setSearchParams, delList, exportList } = methods
21 21  
22   -// 导出操作
23   -const handleExport = async () => {
24   - await exportList('敏感词数据.xls')
25   -}
26 22 // 获取标签
27 23 const tagsOptions = ref()
28 24 const getTags = async () => {
... ... @@ -111,7 +107,7 @@ onMounted(async () =&gt; {
111 107 type="warning"
112 108 v-hasPermi="['system:post:export']"
113 109 :loading="tableObject.exportLoading"
114   - @click="handleExport"
  110 + @click="exportList('敏感词数据.xls')"
115 111 >
116 112 <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
117 113 </el-button>
... ...
yudao-ui-admin-vue3/src/views/system/tenant/index.vue
... ... @@ -21,10 +21,6 @@ const { register, tableObject, methods } = useTable&lt;TenantVO&gt;({
21 21 })
22 22 const { getList, setSearchParams, delList, exportList } = methods
23 23  
24   -// 导出操作
25   -const handleExport = async () => {
26   - await exportList('租户数据.xls')
27   -}
28 24 // ========== 套餐 ==========
29 25 const tenantPackageId = ref() // 套餐
30 26 const tenantPackageOptions = ref<TenantPackageVO[]>([]) //套餐列表
... ... @@ -129,7 +125,7 @@ onMounted(async () =&gt; {
129 125 type="warning"
130 126 v-hasPermi="['system:tenant:export']"
131 127 :loading="tableObject.exportLoading"
132   - @click="handleExport"
  128 + @click="exportList('租户数据.xls')"
133 129 >
134 130 <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
135 131 </el-button>
... ...
yudao-ui-admin-vue3/src/views/system/user/index.vue
... ... @@ -165,11 +165,6 @@ const handleResetPwd = (row: UserVO) =&gt; {
165 165 })
166 166 }
167 167  
168   -// 导出操作
169   -const handleExport = async () => {
170   - await exportList('用户数据.xls')
171   -}
172   -
173 168 // ========== 详情相关 ==========
174 169 const detailRef = ref()
175 170  
... ... @@ -296,7 +291,11 @@ getList()
296 291 >
297 292 <Icon icon="ep:upload" class="mr-5px" /> {{ t('action.import') }}
298 293 </el-button>
299   - <el-button type="warning" v-hasPermi="['system:user:export']" @click="handleExport">
  294 + <el-button
  295 + type="warning"
  296 + v-hasPermi="['system:user:export']"
  297 + @click="exportList('用户数据.xls')"
  298 + >
300 299 <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
301 300 </el-button>
302 301 </div>
... ...