mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-09 20:57:17 +08:00
feat: 部门管理新增导出
This commit is contained in:
@@ -27,3 +27,8 @@ export function updateDept(data: any, id: string) {
|
|||||||
export function deleteDept(id: string) {
|
export function deleteDept(id: string) {
|
||||||
return http.del(`${BASE_URL}/${id}`)
|
return http.del(`${BASE_URL}/${id}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @desc 导出部门 */
|
||||||
|
export function exportDept(query: System.DeptQuery) {
|
||||||
|
return http.download<any>(`${BASE_URL}/export`, query)
|
||||||
|
}
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
<span>新增</span>
|
<span>新增</span>
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-tooltip content="导出">
|
<a-tooltip content="导出">
|
||||||
<a-button>
|
<a-button @click="onExport">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<icon-download />
|
<icon-download />
|
||||||
</template>
|
</template>
|
||||||
@@ -81,11 +81,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { listDept, deleteDept, type DeptResp, type DeptQuery } from '@/apis'
|
import { listDept, deleteDept, exportDept, type DeptResp, type DeptQuery } from '@/apis'
|
||||||
import { Message, type TableInstance } from '@arco-design/web-vue'
|
import { Message, type TableInstance } from '@arco-design/web-vue'
|
||||||
import type GiTable from '@/components/GiTable/index.vue'
|
import type GiTable from '@/components/GiTable/index.vue'
|
||||||
import AddDeptModal from './AddDeptModal.vue'
|
import AddDeptModal from './AddDeptModal.vue'
|
||||||
import { DisEnableStatusList } from '@/constant/common'
|
import { DisEnableStatusList } from '@/constant/common'
|
||||||
|
import { useDownload } from '@/hooks'
|
||||||
import { isMobile } from '@/utils'
|
import { isMobile } from '@/utils'
|
||||||
|
|
||||||
defineOptions({ name: 'Dept' })
|
defineOptions({ name: 'Dept' })
|
||||||
@@ -145,6 +146,11 @@ const onDelete = async (item: DeptResp) => {
|
|||||||
search()
|
search()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 导出
|
||||||
|
const onExport = ()=>{
|
||||||
|
useDownload(() => exportDept(queryForm))
|
||||||
|
}
|
||||||
|
|
||||||
const AddDeptModalRef = ref<InstanceType<typeof AddDeptModal>>()
|
const AddDeptModalRef = ref<InstanceType<typeof AddDeptModal>>()
|
||||||
// 新增
|
// 新增
|
||||||
const onAdd = (id?: string) => {
|
const onAdd = (id?: string) => {
|
||||||
|
Reference in New Issue
Block a user