refactor:vue3 export function

pull/2/head
xingyu 2022-07-28 18:23:09 +08:00
parent 4825e3a2e3
commit e16f8abc3a
14 changed files with 18 additions and 78 deletions

View File

@ -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>

View File

@ -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>
<!-- 列表 -->

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>