瀏覽代碼

refactor:vue3 export function

xingyu 2 年之前
父節點
當前提交
e16f8abc3a

+ 1 - 6
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')"
       >
         <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
       </el-button>

+ 1 - 5
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()
     <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
   </ContentWrap>
   <ContentWrap>
-    <el-button v-hasPermi="['infra:api-error-log:export']" @click="handleExport">
+    <el-button v-hasPermi="['infra:api-error-log:export']" @click="exportList('错误数据.xls')">
       <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
     </el-button>
     <!-- 列表 -->

+ 1 - 6
yudao-ui-admin-vue3/src/views/infra/config/index.vue

@@ -19,11 +19,6 @@ const { register, tableObject, methods } = useTable<ConfigVO>({
 })
 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')"
       >
         <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
       </el-button>

+ 1 - 5
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')"
       >
         <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
       </el-button>

+ 1 - 6
yudao-ui-admin-vue3/src/views/infra/job/index.vue

@@ -22,11 +22,6 @@ const { register, tableObject, methods } = useTable<JobVO>({
 })
 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')"
       >
         <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
       </el-button>

+ 1 - 6
yudao-ui-admin-vue3/src/views/pay/app/index.vue

@@ -19,11 +19,6 @@ const { register, tableObject, methods } = useTable<AppVO>({
 })
 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')"
       >
         <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
       </el-button>

+ 1 - 6
yudao-ui-admin-vue3/src/views/pay/merchant/index.vue

@@ -19,11 +19,6 @@ const { register, tableObject, methods } = useTable<MerchantVO>({
 })
 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')"
       >
         <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
       </el-button>

+ 1 - 5
yudao-ui-admin-vue3/src/views/pay/order/index.vue

@@ -17,10 +17,6 @@ const { register, tableObject, methods } = useTable<OrderVO>({
   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')"
       >
         <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
       </el-button>

+ 1 - 6
yudao-ui-admin-vue3/src/views/pay/refund/index.vue

@@ -17,11 +17,6 @@ const { register, tableObject, methods } = useTable<RefundVO>({
 })
 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')"
       >
         <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
       </el-button>

+ 1 - 5
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')"
       >
         <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
       </el-button>

+ 1 - 6
yudao-ui-admin-vue3/src/views/system/post/index.vue

@@ -19,11 +19,6 @@ const { register, tableObject, methods } = useTable<PostVO>({
 })
 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')"
       >
         <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
       </el-button>

+ 1 - 5
yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue

@@ -19,10 +19,6 @@ const { register, tableObject, methods } = useTable<SensitiveWordVO>({
 })
 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')"
       >
         <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
       </el-button>

+ 1 - 5
yudao-ui-admin-vue3/src/views/system/tenant/index.vue

@@ -21,10 +21,6 @@ const { register, tableObject, methods } = useTable<TenantVO>({
 })
 const { getList, setSearchParams, delList, exportList } = methods
 
-// 导出操作
-const handleExport = async () => {
-  await exportList('租户数据.xls')
-}
 // ========== 套餐 ==========
 const tenantPackageId = ref() // 套餐
 const tenantPackageOptions = ref<TenantPackageVO[]>([]) //套餐列表
@@ -129,7 +125,7 @@ onMounted(async () => {
         type="warning"
         v-hasPermi="['system:tenant:export']"
         :loading="tableObject.exportLoading"
-        @click="handleExport"
+        @click="exportList('租户数据.xls')"
       >
         <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
       </el-button>

+ 5 - 6
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()
         >
           <Icon icon="ep:upload" class="mr-5px" /> {{ t('action.import') }}
         </el-button>
-        <el-button type="warning" v-hasPermi="['system:user:export']" @click="handleExport">
+        <el-button
+          type="warning"
+          v-hasPermi="['system:user:export']"
+          @click="exportList('用户数据.xls')"
+        >
           <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
         </el-button>
       </div>