提交 1502ef3e 编写于 作者: zhf's avatar zhf

feat: 更新模板

上级 f730a906
import { useNamespace } from '@ibiz-template/vue-util';
import { defineComponent, ref } from 'vue';
import { PropType, defineComponent, ref } from 'vue';
import '@ibiz-template/theme/style/components/common/data-import/data-import.scss';
import { HttpError } from '@ibiz-template/core';
......@@ -14,6 +14,9 @@ export const DataImport = defineComponent({
type: String,
required: true,
},
dismiss: {
type: Function as PropType<(_result: IParams) => void>,
},
},
setup(props, { emit }) {
const ns = useNamespace('data-import');
......@@ -102,6 +105,7 @@ export const DataImport = defineComponent({
const onCancelButtonClick = () => {
emit('close', { ok: false, data: {} });
props.dismiss?.({ ok: false, data: {} });
};
return {
......
......@@ -26,6 +26,9 @@ export const IBizPicker = defineComponent({
// 是否显示所有数据
const isShowAll = ref(true);
// 自动完成组件
const autocomplete = ref();
watch(
() => props.value,
newVal => {
......@@ -83,6 +86,12 @@ export const IBizPicker = defineComponent({
// 往外抛值
const onACSelect = async (item: IData) => {
if (autocomplete.value) {
if (item[c.textName] === curValue.value) {
autocomplete.value.currentValue = curValue.value;
}
autocomplete.value.$refs?.select?.hideMenu?.();
}
await handleDataSelect(item);
isShowAll.value = true;
emit('operate', false);
......@@ -132,6 +141,7 @@ export const IBizPicker = defineComponent({
c,
curValue,
items,
autocomplete,
openPickUpView,
openLinkView,
onACSelect,
......@@ -195,6 +205,7 @@ export const IBizPicker = defineComponent({
h(
'IAutoComplete',
{
ref: 'autocomplete',
props: {
...this.c.customProps,
value: this.curValue,
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册