微调
This commit is contained in:
@@ -22,6 +22,6 @@ export const deleteDictType = (params: string[]) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//导出字典类型
|
//导出字典类型
|
||||||
export const exportdictType=(params: Dict.ReqDictTypeParams)=>{
|
export const exportDictType=(params: Dict.ReqDictTypeParams)=>{
|
||||||
return http.post(`/dictType/export`, params)
|
return http.download(`/dictType/export`, params)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class='table-box' ref='popupBaseView'>
|
<div class='table-box' ref='popupBaseView'>
|
||||||
<ProTable
|
<ProTable
|
||||||
ref='proTable'
|
ref='proTable'
|
||||||
:columns='columns'
|
:columns='columns'
|
||||||
:request-api='getDictTypeList'
|
:request-api='getDictTypeList'
|
||||||
>
|
>
|
||||||
<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>
|
||||||
@@ -21,31 +21,31 @@
|
|||||||
</template>
|
</template>
|
||||||
</ProTable>
|
</ProTable>
|
||||||
</div>
|
</div>
|
||||||
<DictData :width='viewWidth' :height='viewHeight' ref='openView'/>
|
<DictData :width='viewWidth' :height='viewHeight' ref='openView' />
|
||||||
<TypePopup :refresh-table='proTable?.getTableList' ref='typePopup'/>
|
<TypePopup :refresh-table='proTable?.getTableList' ref='typePopup' />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang='tsx' name='dict'>
|
<script setup lang='tsx' name='dict'>
|
||||||
import {CirclePlus, Delete, Download, EditPen, 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 {ColumnProps, ProTableInstance} from '@/components/ProTable/interface'
|
import { ColumnProps, ProTableInstance } from '@/components/ProTable/interface'
|
||||||
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 {useDownload} from '@/hooks/useDownload'
|
import { useDownload } from '@/hooks/useDownload'
|
||||||
import {deleteDictType, getDictTypeList,exportdictType} from '@/api/system/dictionary/dictType'
|
import { deleteDictType, getDictTypeList, exportDictType } from '@/api/system/dictionary/dictType'
|
||||||
|
|
||||||
const dictStore = useDictStore()
|
const dictStore = useDictStore()
|
||||||
const {popupBaseView, viewWidth, viewHeight} = useViewSize()
|
const { popupBaseView, viewWidth, viewHeight } = useViewSize()
|
||||||
|
|
||||||
const proTable = ref<ProTableInstance>()
|
const proTable = ref<ProTableInstance>()
|
||||||
const typePopup = ref()
|
const typePopup = ref()
|
||||||
const openView = ref()
|
const openView = ref()
|
||||||
|
|
||||||
const columns = reactive<ColumnProps<Dict.ResDictType>[]>([
|
const columns = reactive<ColumnProps<Dict.ResDictType>[]>([
|
||||||
{type: 'selection', fixed: 'left', width: 70},
|
{ type: 'selection', fixed: 'left', width: 70 },
|
||||||
{type: 'index', fixed: 'left', width: 70, label: '序号'},
|
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
||||||
{
|
{
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
label: '类型名称',
|
label: '类型名称',
|
||||||
@@ -55,7 +55,7 @@ const columns = reactive<ColumnProps<Dict.ResDictType>[]>([
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'code',
|
prop: 'code',
|
||||||
label: '类型编码',
|
label: '类型编码',
|
||||||
width: 180,
|
width: 180,
|
||||||
search: {
|
search: {
|
||||||
@@ -86,12 +86,6 @@ const openDialog = (titleType: string, row: Partial<Dict.ResDictType> = {}) => {
|
|||||||
typePopup.value?.open(titleType, row)
|
typePopup.value?.open(titleType, row)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出字典类型
|
|
||||||
// const downloadFile = async () => {
|
|
||||||
// ElMessageBox.confirm('确认导出字典类型数据?', '温馨提示', { type: 'warning' }).then(() =>
|
|
||||||
// useDownload(exportDictType, '字典类型列表', proTable.value?.searchParam),
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 批量删除字典类型
|
// 批量删除字典类型
|
||||||
const batchDelete = async (id: string[]) => {
|
const batchDelete = async (id: string[]) => {
|
||||||
@@ -114,7 +108,7 @@ const toDictData = (row: Dict.ResDictType) => {
|
|||||||
// 导出字典类型列表
|
// 导出字典类型列表
|
||||||
const downloadFile = async () => {
|
const downloadFile = async () => {
|
||||||
ElMessageBox.confirm('确认导出字典类型数据?', '温馨提示', { type: 'warning' }).then(() =>
|
ElMessageBox.confirm('确认导出字典类型数据?', '温馨提示', { type: 'warning' }).then(() =>
|
||||||
useDownload(exportdictType, '字典类型导出数据', proTable.value?.searchParam,true,'.xls'),
|
useDownload(exportDictType, '字典类型导出数据', proTable.value?.searchParam, false,'.xls'),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user