提交 eeb288f8 编写于 作者: 邱定凯's avatar 邱定凯

update: 更新自动填充编辑器

上级 f5152855
......@@ -46,18 +46,23 @@
{{#and item.psEditor.psAppDEACMode item.psEditor.psAppDEACMode.minorSortPSAppDEField}}
sort="{{lowerCase item.psEditor.psAppDEACMode.minorSortPSAppDEField}},{{#if item.psEditor.psAppDEACMode.minorSortDir}}{{item.psEditor.psAppDEACMode.minorSortDir}}{{else}}asc{{/if}}"
{{/and}}
{{#if item.psEditor.editorParams.defaultOpen}}
:defaultOpen="{{item.psEditor.editorParams.defaultOpen}}"
{{/if}}
{{#if item.psEditor.editorParams.pickUpData}}
:pickUpData="{{item.psEditor.editorParams.pickUpData}}"
{{/if}}
{{#if item.psEditor.disabled}}
disabled="{{item.psEditor.disabled}}"
{{/if}}
{{#if item.psEditor.readOnly}}
:readOnly="{{item.psEditor.readOnly}}"
{{/if}}
{{#if item.psEditor.editorParams.multiple}}
:multiple="{{item.psEditor.editorParams.multiple}}"
{{/if}}
{{#if item.psEditor.editorParams}}
{{#jsonParse item.psEditor.editorParams}}
{{#if defaultOpen}}
:defaultOpen="{{defaultOpen}}"
{{/if}}
{{/jsonParse}}
{{/if}}
{{#eq item.psEditor.editorType "AC_NOBUTTON"}}
:showButton="false"
{{/eq}}
......
......@@ -62,11 +62,6 @@ interface AutoCompleteProps {
*/
sort?: string;
/**
* @description 外键值附加数据
*/
pickUpData?: string;
/**
* @description 是否默认展开
*/
......@@ -85,7 +80,7 @@ interface AutoCompleteProps {
/**
* @description 只读
*/
readonly?: boolean;
readOnly?: boolean;
/**
* @description 部件服务
......@@ -100,7 +95,7 @@ const props = withDefaults(defineProps<AutoCompleteProps>(), {
deMajorField: "srfmajortext",
deKeyField: "srfkey",
disabled: false,
readonly: false,
readOnly: false,
showButton: true,
defaultOpen: true,
});
......@@ -138,7 +133,12 @@ const onSearch = (value: string) => {
};
const filterOption= (inputValue: string,option: IParam) => {
if(option[props.deMajorField]) {
return option[props.deMajorField].toUpperCase().indexOf(inputValue.toUpperCase()) >= 0;
}else {
return false
}
}
const onSelect = (value: any) => {
......@@ -151,18 +151,29 @@ const onSelect = (value: any) => {
data: selectItem[props.deMajorField!],
});
}
const curValue= computed({
get: ()=> {
return props.value;
},
set: (val:any)=> {
emit("editorEvent", {
tag: props.name,
action: "valueChange",
data: val,
});
}
})
</script>
<template>
<a-auto-complete
:class="['app-editor-container', 'app-auto-complete', `app-auto-complete-${name}`]"
:allowClear="true"
v-model:value="value"
v-model:value="curValue"
:placeholder="placeholder"
:options="items"
:filterOption="filterOption"
:disabled="disabled || readonly"
:disabled="disabled || readOnly"
@search="onSearch"
:defaultOpen="true"
>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册