fix: warn

This commit is contained in:
xingyu4j
2025-10-17 18:17:01 +08:00
parent 23537b9f74
commit b23581ba3b
4 changed files with 31 additions and 20 deletions

View File

@@ -8,9 +8,11 @@ import FcDesigner from '@form-create/antd-designer';
import { Button, message } from 'ant-design-vue'; import { Button, message } from 'ant-design-vue';
import { getFormDetail } from '#/api/bpm/form'; import { getFormDetail } from '#/api/bpm/form';
import { useFormCreateDesigner } from '#/components/form-create'; import {
setConfAndFields,
useFormCreateDesigner,
} from '#/components/form-create';
import { router } from '#/router'; import { router } from '#/router';
import { setConfAndFields } from '#/utils';
import Form from '#/views/bpm/form/modules/form.vue'; import Form from '#/views/bpm/form/modules/form.vue';
defineOptions({ name: 'BpmFormEditor' }); defineOptions({ name: 'BpmFormEditor' });

View File

@@ -456,9 +456,9 @@ onBeforeUnmount(() => {
> >
{{ index + 1 }} {{ index + 1 }}
</div> </div>
<span class="whitespace-nowrap text-base font-bold">{{ <span class="whitespace-nowrap text-base font-bold">
step.title {{ step.title }}
}}</span> </span>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -43,12 +43,16 @@ export function useFormSchema(formApi?: any): VbenFormSchema[] {
.min(1, 'ProductKey 不能为空') .min(1, 'ProductKey 不能为空')
.max(32, 'ProductKey 长度不能超过 32 个字符'), .max(32, 'ProductKey 长度不能超过 32 个字符'),
suffix: () => { suffix: () => {
return h(Button, { return h(
type: 'default', Button,
onClick: () => { {
formApi?.setFieldValue('productKey', generateProductKey()); type: 'default',
onClick: () => {
formApi?.setFieldValue('productKey', generateProductKey());
},
}, },
}, { default: () => '重新生成' }); { default: () => '重新生成' },
);
}, },
}, },
// 编辑时的 ProductKey 字段(禁用,无按钮) // 编辑时的 ProductKey 字段(禁用,无按钮)
@@ -157,7 +161,7 @@ export function useFormSchema(formApi?: any): VbenFormSchema[] {
placeholder: '请输入产品描述', placeholder: '请输入产品描述',
rows: 3, rows: 3,
}, },
} },
]; ];
} }
@@ -192,12 +196,16 @@ export function useBasicFormSchema(formApi?: any): VbenFormSchema[] {
.min(1, 'ProductKey 不能为空') .min(1, 'ProductKey 不能为空')
.max(32, 'ProductKey 长度不能超过 32 个字符'), .max(32, 'ProductKey 长度不能超过 32 个字符'),
suffix: () => { suffix: () => {
return h(Button, { return h(
type: 'default', Button,
onClick: () => { {
formApi?.setFieldValue('productKey', generateProductKey()); type: 'default',
onClick: () => {
formApi?.setFieldValue('productKey', generateProductKey());
},
}, },
}, { default: () => '重新生成' }); { default: () => '重新生成' },
);
}, },
}, },
// 编辑时的 ProductKey 字段(禁用,无按钮) // 编辑时的 ProductKey 字段(禁用,无按钮)
@@ -297,7 +305,7 @@ export function useBasicFormSchema(formApi?: any): VbenFormSchema[] {
placeholder: '请选择定位类型', placeholder: '请选择定位类型',
}, },
rules: 'required', rules: 'required',
} },
]; ];
} }
@@ -307,7 +315,7 @@ export function useAdvancedFormSchema(): VbenFormSchema[] {
{ {
fieldName: 'icon', fieldName: 'icon',
label: '产品图标', label: '产品图标',
component: 'IconPicker',//用这个组件 产品卡片列表 可以根据这个显示 否则就显示默认的 component: 'IconPicker', // 用这个组件 产品卡片列表 可以根据这个显示 否则就显示默认的
componentProps: { componentProps: {
placeholder: '请选择产品图标', placeholder: '请选择产品图标',
prefix: 'carbon', prefix: 'carbon',
@@ -440,7 +448,8 @@ export function useImagePreview() {
/** 生成 ProductKey包含大小写字母和数字 */ /** 生成 ProductKey包含大小写字母和数字 */
export function generateProductKey(): string { export function generateProductKey(): string {
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; const chars =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let result = ''; let result = '';
for (let i = 0; i < 16; i++) { for (let i = 0; i < 16; i++) {
result += chars.charAt(Math.floor(Math.random() * chars.length)); result += chars.charAt(Math.floor(Math.random() * chars.length));