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

update: 更新自动填充编辑器

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