微调
This commit is contained in:
@@ -26,4 +26,9 @@ export const getDicDataById = (params: string) => {
|
||||
return http.post('/dictData/getDicDataById', params)
|
||||
}
|
||||
|
||||
//导出字典数据
|
||||
export const exportDictData = (params: Dict.ReqDictDataParams) => {
|
||||
return http.download(`/dictData/export`, params)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<ProTable ref='proTable' :columns="columns" :request-api='getDictDataListByTypeId' :initParam="initParam">
|
||||
<template #tableHeader="scope">
|
||||
<el-button type="primary" :icon="CirclePlus" @click="openDialog('add')">新增</el-button>
|
||||
<el-button type='primary' :icon='Download' plain>导出</el-button>
|
||||
<el-button type='primary' :icon='Download' plain @click="downloadFile">导出</el-button>
|
||||
<el-button type="danger" :icon="Delete" plain :disabled="!scope.isSelected"
|
||||
@click="batchDelete(scope.selectedListIds)">
|
||||
批量删除
|
||||
@@ -27,13 +27,11 @@
|
||||
<script setup lang="tsx" name="dictData">
|
||||
import {CirclePlus, Delete, Download, EditPen} from '@element-plus/icons-vue'
|
||||
import {Dict} from '@/api/system/dictionary/interface'
|
||||
import {ProTableInstance, ColumnProps} from '@/components/ProTable/interface'
|
||||
import {ColumnProps, ProTableInstance} from '@/components/ProTable/interface'
|
||||
import {useHandleData} from '@/hooks/useHandleData'
|
||||
import DataPopup from '@/views/system/dictionary/dictData/components/dataPopup.vue'
|
||||
import {
|
||||
getDictDataListByTypeId,
|
||||
deleteDictData,
|
||||
} from "@/api/system/dictionary/dictData";
|
||||
import {deleteDictData, getDictDataListByTypeId, exportDictData} from "@/api/system/dictionary/dictData";
|
||||
import {useDownload} from "@/hooks/useDownload";
|
||||
import {exportDictType} from "@/api/system/dictionary/dictType";
|
||||
|
||||
const proTable = ref<ProTableInstance>()
|
||||
const dialogVisible = ref(false)
|
||||
@@ -136,4 +134,10 @@ const handleDelete = async (params: Dict.ResDictData) => {
|
||||
await useHandleData(deleteDictData, [params.id], `删除【${params.name}】字典数据`)
|
||||
proTable.value?.getTableList()
|
||||
}
|
||||
|
||||
const downloadFile = async () => {
|
||||
ElMessageBox.confirm('确认导出字典数据?', '温馨提示', {type: 'warning'}).then(() =>
|
||||
useDownload(exportDictData, '字典数据导出数据', {typeId: dictTypeId.value, ...(proTable.value?.searchParam)}, false, '.xls'),
|
||||
)
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user