refactor(shopExpressTemplate): 优化运费模板及明细功能界面和数据结构
- 规范和补充ShopExpressTemplate及ShopExpressTemplateDetail接口字段注释 - 调整列表列配置,增加字段宽度和排序支持,优化表格显示 - 添加计费方式和状态的标签显示,替换原有文字提示 - 删除批量移动功能相关代码和UI,简化操作流程 - 搜索组件添加清除按钮,支持批量删除操作提升用户体验 - 编辑弹窗宽度调整,表单控件换为数字输入或单选框提升输入准确性 - 编辑弹窗中新增运费模板下拉选择和表单验证,确保数据完整性 - 移除无用变量和注释,清理代码结构,提高维护性 - 优化时间显示为日期格式,界面更友好
This commit is contained in:
@@ -1,42 +1,68 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-input-search
|
||||
allow-clear
|
||||
placeholder="请输入模板名称"
|
||||
v-model:value="keywords"
|
||||
style="width: 220px"
|
||||
@search="onSearch"
|
||||
/>
|
||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
<a-button
|
||||
danger
|
||||
type="primary"
|
||||
class="ele-btn-icon"
|
||||
:disabled="!selection?.length"
|
||||
@click="remove"
|
||||
>
|
||||
<template #icon>
|
||||
<DeleteOutlined />
|
||||
</template>
|
||||
<span>批量删除</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import type { GradeParam } from '@/api/user/grade/model';
|
||||
import { watch } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import { PlusOutlined, DeleteOutlined } from '@ant-design/icons-vue';
|
||||
import type { ShopExpressTemplateParam } from '@/api/shop/shopExpressTemplate/model';
|
||||
import type { ShopExpressTemplate } from '@/api/shop/shopExpressTemplate/model';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
// 选中的表格数据
|
||||
selection?: ShopExpressTemplate[];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: GradeParam): void;
|
||||
(e: 'search', where?: ShopExpressTemplateParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
}>();
|
||||
|
||||
const keywords = ref('');
|
||||
|
||||
// 搜索
|
||||
const onSearch = () => {
|
||||
emit('search', { title: keywords.value });
|
||||
};
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
// 批量删除
|
||||
const remove = () => {
|
||||
emit('remove');
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user