fix(公共): 解决编译报错
This commit is contained in:
parent
25a957cabe
commit
970c9cf053
|
@ -69,16 +69,16 @@
|
|||
}
|
||||
});
|
||||
// 计算远程检索的表单项
|
||||
const getOptionsRequest = debounce((val: any) => {
|
||||
const getOptionsRequest = debounce((val: FormRuleItem) => {
|
||||
// 获取当前变化的一项 监视到被级联的表单项
|
||||
// 从所有的列表项里边获取所有的link到的那一项
|
||||
const totalFormList = formCreateStore.formCreateRuleMap.get(props.formCreateKey);
|
||||
if (totalFormList) {
|
||||
const resultItem = totalFormList.find(
|
||||
(item: Record<string, any>) => item.link && (item.link as string[]).indexOf(val.field as string) > -1
|
||||
(item: any) => item.link && (item.link as string[]).indexOf(val.field as string) > -1
|
||||
);
|
||||
if (resultItem) {
|
||||
formCreateStore.getOptions(val, props.formCreateKey, resultItem as Rule, formApi.value);
|
||||
formCreateStore.getOptions(val, props.formCreateKey, resultItem as FormRuleItem, formApi.value);
|
||||
}
|
||||
}
|
||||
}, 300);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { FieldRule } from '@arco-design/web-vue';
|
||||
|
||||
import { Rule } from '@form-create/arco-design';
|
||||
import type { Rule } from '@form-create/arco-design';
|
||||
|
||||
export type FormItemType =
|
||||
| 'INPUT'
|
||||
|
@ -30,11 +30,16 @@ export interface FormItemDefaultOptions {
|
|||
text: string;
|
||||
value: string;
|
||||
}
|
||||
// 内置formCreateRule所有配置的项
|
||||
export type FormRuleItem = Rule & {
|
||||
props: Record<string, any>;
|
||||
export interface PropsRecord {
|
||||
[key: string]: any;
|
||||
};
|
||||
}
|
||||
// 内置formCreateRule所有配置的项
|
||||
export type FormRuleItem = any;
|
||||
// TODO
|
||||
// export type FormRuleItem = Rule & {
|
||||
// props: Record<string, any>;
|
||||
// [key: string]: any;
|
||||
// };
|
||||
// 表单配置项
|
||||
export interface FormItem {
|
||||
type: FormItemType;
|
||||
|
|
|
@ -105,14 +105,14 @@ const useFormCreateStore = defineStore('form-create', {
|
|||
async getOptions(
|
||||
val: FormRuleItem,
|
||||
key: FormCreateKeyEnum[keyof FormCreateKeyEnum],
|
||||
cascadeItem: Rule,
|
||||
cascadeItem: FormRuleItem,
|
||||
formValueApi: any
|
||||
) {
|
||||
const formValue = formValueApi.formData();
|
||||
// 设置自定义属性给到searchSelect
|
||||
const formCreateRuleArr = this.formCreateRuleMap.get(key) as Rule[];
|
||||
const formCreateRuleArr = this.formCreateRuleMap.get(key);
|
||||
if (formCreateRuleArr) {
|
||||
const formCreateItem = formCreateRuleArr.find((item: Rule) => cascadeItem.field === item.field);
|
||||
const formCreateItem = formCreateRuleArr.find((item: FormRuleItem) => cascadeItem.field === item.field);
|
||||
if (formCreateItem && formCreateItem.props) {
|
||||
formCreateItem.props.keyword = val.value;
|
||||
formCreateItem.props.formValue = formValue;
|
||||
|
|
Loading…
Reference in New Issue