This commit is contained in:
caozehui
2024-11-05 15:38:34 +08:00
parent c0fcba6a25
commit c4c10ab9b4
2 changed files with 15 additions and 10 deletions

View File

@@ -21,4 +21,7 @@ export const deleteDictType = (params: string[]) => {
return http.post(`/dictType/delete`, params) return http.post(`/dictType/delete`, params)
} }
//导出字典类型
export const exportdictType=(params: Dict.ReqDictTypeParams)=>{
return http.post(`/dictType/export`, params)
}

View File

@@ -7,7 +7,7 @@
> >
<template #tableHeader='scope'> <template #tableHeader='scope'>
<el-button type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button> <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' <el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
@click='batchDelete(scope.selectedListIds)'> @click='batchDelete(scope.selectedListIds)'>
批量删除 批量删除
@@ -26,18 +26,15 @@
</template> </template>
<script setup lang='tsx' name='dict'> <script setup lang='tsx' name='dict'>
import {CirclePlus, Delete, EditPen, Download, View} from '@element-plus/icons-vue' import {CirclePlus, Delete, Download, EditPen, View} from '@element-plus/icons-vue'
import {Dict} from '@/api/system/dictionary/interface' import {Dict} from '@/api/system/dictionary/interface'
import {ProTableInstance, ColumnProps} from '@/components/ProTable/interface' import {ColumnProps, ProTableInstance} from '@/components/ProTable/interface'
import TypePopup from '@/views/system/dictionary/dictType/components/typePopup.vue'
import DictData from '@/views/system/dictionary/dictData/index.vue' import DictData from '@/views/system/dictionary/dictData/index.vue'
import {useDictStore} from '@/stores/modules/dict' import {useDictStore} from '@/stores/modules/dict'
import {useHandleData} from '@/hooks/useHandleData' import {useHandleData} from '@/hooks/useHandleData'
import {useViewSize} from '@/hooks/useViewSize' import {useViewSize} from '@/hooks/useViewSize'
import { import {useDownload} from '@/hooks/useDownload'
getDictTypeList, import {deleteDictType, getDictTypeList,exportdictType} from '@/api/system/dictionary/dictType'
deleteDictType,
} from '@/api/system/dictionary/dictType'
const dictStore = useDictStore() const dictStore = useDictStore()
const {popupBaseView, viewWidth, viewHeight} = useViewSize() const {popupBaseView, viewWidth, viewHeight} = useViewSize()
@@ -114,5 +111,10 @@ const toDictData = (row: Dict.ResDictType) => {
openView.value.open(row) openView.value.open(row)
} }
// 导出字典类型列表
const downloadFile = async () => {
ElMessageBox.confirm('确认导出字典类型数据?', '温馨提示', { type: 'warning' }).then(() =>
useDownload(exportdictType, '字典类型导出数据', proTable.value?.searchParam,true,'.xls'),
)
}
</script> </script>