diff --git a/apps/web-antd/src/views/crm/contract/config/data.ts b/apps/web-antd/src/views/crm/contract/config/data.ts new file mode 100644 index 000000000..2792b3601 --- /dev/null +++ b/apps/web-antd/src/views/crm/contract/config/data.ts @@ -0,0 +1,37 @@ +import type { VbenFormSchema } from '#/adapter/form'; + +export const schema: VbenFormSchema[] = [ + { + component: 'RadioGroup', + fieldName: 'notifyEnabled', + label: '提前提醒设置', + componentProps: { + options: [ + { label: '提醒', value: true }, + { label: '不提醒', value: false }, + ], + }, + defaultValue: true, + }, + { + component: 'InputNumber', + fieldName: 'notifyDays', + componentProps: { + min: 0, + precision: 0, + }, + renderComponentContent: () => ({ + addonBefore: () => '提前', + addonAfter: () => '天提醒', + }), + dependencies: { + triggerFields: ['notifyEnabled'], + show: (values) => values.notifyEnabled, + trigger(values) { + if (!values.notifyEnabled) { + values.notifyDays = undefined; + } + }, + }, + }, +]; diff --git a/apps/web-antd/src/views/crm/contract/config/index.vue b/apps/web-antd/src/views/crm/contract/config/index.vue index 932dbe30e..d85040bcc 100644 --- a/apps/web-antd/src/views/crm/contract/config/index.vue +++ b/apps/web-antd/src/views/crm/contract/config/index.vue @@ -1,5 +1,4 @@