feat:【antd】【crm】优化整体的 allowClear

This commit is contained in:
YunaiV
2025-09-30 14:56:55 +08:00
parent 2d5f24c626
commit 0d07db46f0
8 changed files with 34 additions and 38 deletions

View File

@@ -37,6 +37,7 @@ export namespace CrmCustomerApi {
updateTime: Date; // 更新时间
poolDay?: number; // 距离进入公海天数
}
export interface CustomerImport {
ownerUserId: number;
file: File;

View File

@@ -1,11 +1,3 @@
import { defineAsyncComponent } from 'vue';
// TODO @xingyu我直接引入貌似没问题呀。
// TODO @xingyuapps/web-antd/src/views/crm/followup/index.ts 走的异步组件,不过名字是 FollowUp 没 Async。可能要一起讨论怎么保持相对的一致性
export const AsyncOperateLog = defineAsyncComponent(
() => import('./operate-log.vue'),
);
export { default as OperateLog } from './operate-log.vue';
export type { OperateLogProps } from './typing';

View File

@@ -29,7 +29,7 @@ export function useFormSchema(): VbenFormSchema[] {
rules: 'required',
componentProps: {
placeholder: '请输入联系人姓名',
},
},
},
{
fieldName: 'ownerUserId',
@@ -66,7 +66,7 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Input',
componentProps: {
placeholder: '请输入手机号',
},
},
},
{
fieldName: 'telephone',
@@ -74,7 +74,7 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Input',
componentProps: {
placeholder: '请输入电话',
},
},
},
{
fieldName: 'email',
@@ -82,7 +82,7 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Input',
componentProps: {
placeholder: '请输入邮箱',
},
},
},
{
fieldName: 'wechat',
@@ -90,7 +90,7 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Input',
componentProps: {
placeholder: '请输入微信',
},
},
},
{
fieldName: 'qq',
@@ -98,7 +98,7 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Input',
componentProps: {
placeholder: '请输入QQ',
},
},
},
{
fieldName: 'post',
@@ -106,7 +106,7 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Input',
componentProps: {
placeholder: '请输入职位',
},
},
},
{
fieldName: 'master',
@@ -115,7 +115,7 @@ export function useFormSchema(): VbenFormSchema[] {
componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'),
placeholder: '请选择是否关键决策人',
buttonStyle: 'solid',
buttonStyle: 'solid',
optionType: 'button',
},
defaultValue: false,
@@ -127,7 +127,7 @@ export function useFormSchema(): VbenFormSchema[] {
componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'),
placeholder: '请选择性别',
},
},
},
{
fieldName: 'parentId',
@@ -158,7 +158,7 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Input',
componentProps: {
placeholder: '请输入详细地址',
},
},
},
{
fieldName: 'contactNextTime',
@@ -169,7 +169,7 @@ export function useFormSchema(): VbenFormSchema[] {
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
placeholder: '请选择下次联系时间',
},
},
},
{
fieldName: 'remark',
@@ -177,7 +177,7 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Textarea',
componentProps: {
placeholder: '请输入备注',
},
},
},
];
}
@@ -196,8 +196,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
value: 'id',
},
placeholder: '请选择客户',
allowClear: true,
},
},
},
{
fieldName: 'name',
@@ -206,7 +205,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
componentProps: {
placeholder: '请输入联系人姓名',
allowClear: true,
},
},
},
{
fieldName: 'mobile',
@@ -215,7 +214,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
componentProps: {
placeholder: '请输入手机号',
allowClear: true,
},
},
},
{
fieldName: 'telephone',
@@ -224,7 +223,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
componentProps: {
placeholder: '请输入电话',
allowClear: true,
},
},
},
{
fieldName: 'wechat',
@@ -233,7 +232,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
componentProps: {
placeholder: '请输入微信',
allowClear: true,
},
},
},
{
fieldName: 'email',
@@ -242,7 +241,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
componentProps: {
placeholder: '请输入电子邮箱',
allowClear: true,
},
},
},
];
}

View File

@@ -352,7 +352,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
title: '距离进入公海天数',
minWidth: 140,
formatter: ({ cellValue }) =>
cellValue == null ? '-' : `${cellValue}`,
cellValue === null ? '-' : `${cellValue}`,
},
{
field: 'ownerUserName',

View File

@@ -13,6 +13,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'Input',
componentProps: {
placeholder: '请输入客户名称',
allowClear: true,
},
},
{
@@ -21,6 +22,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'Input',
componentProps: {
placeholder: '请输入手机',
allowClear: true,
},
},
{
@@ -30,6 +32,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
componentProps: {
options: getDictOptions(DICT_TYPE.CRM_CUSTOMER_INDUSTRY, 'number'),
placeholder: '请选择所属行业',
allowClear: true,
},
},
{
@@ -39,6 +42,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
componentProps: {
options: getDictOptions(DICT_TYPE.CRM_CUSTOMER_LEVEL, 'number'),
placeholder: '请选择客户级别',
allowClear: true,
},
},
{
@@ -48,6 +52,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
componentProps: {
options: getDictOptions(DICT_TYPE.CRM_CUSTOMER_SOURCE, 'number'),
placeholder: '请选择客户来源',
allowClear: true,
},
},
];

View File

@@ -31,7 +31,7 @@ const props = defineProps<{
const { push } = useRouter();
/** 刷新表格 */
function onRefresh() {
function handleRefresh() {
gridApi.query();
}
@@ -48,10 +48,8 @@ async function handleDelete(row: CrmFollowUpApi.FollowUpRecord) {
});
try {
await deleteFollowUpRecord(row.id);
message.success({
content: $t('ui.actionMessage.deleteSuccess', [row.id]),
});
onRefresh();
message.success($t('ui.actionMessage.deleteSuccess', [row.id]));
handleRefresh();
} catch {
hideLoading();
}
@@ -129,6 +127,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
},
rowConfig: {
keyField: 'id',
isHover: true,
},
toolbarConfig: {
refresh: true,
@@ -146,7 +145,7 @@ watch(
<template>
<div>
<FormModal @success="onRefresh" />
<FormModal @success="handleRefresh" />
<Grid>
<template #toolbar-tools>
<TableAction

View File

@@ -14,7 +14,7 @@ import { getOperateLogPage } from '#/api/crm/operateLog';
import { BizTypeEnum } from '#/api/crm/permission';
import { getProduct } from '#/api/crm/product';
import { useDescription } from '#/components/description';
import { AsyncOperateLog } from '#/components/operate-log';
import { OperateLog } from '#/components/operate-log';
import { useDetailSchema } from './data';
import Info from './modules/info.vue';
@@ -83,7 +83,7 @@ onMounted(() => {
<Info :product="product" />
</Tabs.TabPane>
<Tabs.TabPane tab="操作日志" key="2" :force-render="true">
<AsyncOperateLog :log-list="logList" />
<OperateLog :log-list="logList" />
</Tabs.TabPane>
</Tabs>
</Card>

View File

@@ -15,7 +15,7 @@ import { getOperateLogPage } from '#/api/crm/operateLog';
import { BizTypeEnum } from '#/api/crm/permission';
import { getReceivablePlan } from '#/api/crm/receivable/plan';
import { useDescription } from '#/components/description';
import { AsyncOperateLog } from '#/components/operate-log';
import { OperateLog } from '#/components/operate-log';
import { $t } from '#/locales';
import { PermissionList } from '#/views/crm/permission';
import { ReceivablePlanDetailsInfo } from '#/views/crm/receivable/plan/components';
@@ -131,7 +131,7 @@ onMounted(() => {
/>
</Tabs.TabPane>
<Tabs.TabPane tab="操作日志" key="3" :force-render="true">
<AsyncOperateLog :log-list="logList" />
<OperateLog :log-list="logList" />
</Tabs.TabPane>
</Tabs>
</Card>