oms/frontend/src/components/ExportButton.vue
liufumingren 907df04070 feat(frontend): 商品属性、订单状态与导出任务界面
- 新增商品属性页(分类/品牌/单位)与商品表单的品牌/单位选择
- 新增订单状态页:状态分视图列表、新建/编辑弹窗、明细维护、审核/驳回/取消/作废/恢复/推送仓库等操作
- 导出任务按类型动态渲染筛选表单与任务进度;导出按钮/筛选组件抽为公共组件
- 旧地址 order-split / order-create / order-delivery 重定向到 /order,导航与多标签页适配新页面

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-30 23:06:31 +08:00

48 lines
1.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script setup lang="ts">
import { computed } from 'vue'
import { useExportTasks } from '@/composables/useExportTasks'
import type { ExportFilters, ExportType } from '@/api/exportTask'
/**
* 导出按钮(列表页通用)
*
* 用法:<ExportButton type="product" :filters="exportFilters" />
* 点击后按当前页面筛选条件提交导出任务,完成时自动下载(逻辑见 composables/useExportTasks)。
*/
const props = withDefaults(
defineProps<{
/** 导出类型(后端注册表 key) */
type: ExportType
/** 当前页面的筛选条件(字段名需与后端该类型的筛选项一致) */
filters?: ExportFilters
/** 按钮文案 */
label?: string
/** 按钮尺寸 */
size?: 'large' | 'default' | 'small'
/** 是否朴素按钮(列表页次级操作) */
plain?: boolean
}>(),
{
filters: () => ({}),
label: '导出',
size: 'default',
plain: false,
},
)
const { submitting, submit } = useExportTasks()
const text = computed(() => props.label)
function handleClick() {
submit(props.type, props.filters || {})
}
</script>
<template>
<el-button type="success" :size="size" :plain="plain" :loading="submitting" @click="handleClick">
<el-icon><Download /></el-icon>
<span>{{ text }}</span>
</el-button>
</template>