【issues/5213】JPopup抛出change事件

pull/755/head
zhangdaiscott 2023-08-11 15:09:34 +08:00
parent 2cd31c30cd
commit ca643f210a
1 changed files with 9 additions and 3 deletions

View File

@ -57,7 +57,7 @@
default: () => [], default: () => [],
}, },
}, },
emits: ['update:value', 'register'], emits: ['update:value', 'register', 'change','focus' ],
setup(props, { emit, refs }) { setup(props, { emit, refs }) {
const { createMessage } = useMessage(); const { createMessage } = useMessage();
const attrs = useAttrs(); const attrs = useAttrs();
@ -67,9 +67,11 @@
//model //model
const [regModal, { openModal }] = useModal(); const [regModal, { openModal }] = useModal();
// //
let { groupId, code, fieldConfig } = props; let {code, fieldConfig } = props;
// update-begin--author:liaozhiyang---date:20230811---forissues/675Popup
//groupId //groupId
const uniqGroupId = computed(() => (groupId ? `${groupId}_${code}_${fieldConfig[0]['source']}_${fieldConfig[0]['target']}` : '')); const uniqGroupId = computed(() => (props.groupId ? `${props.groupId}_${code}_${fieldConfig[0]['source']}_${fieldConfig[0]['target']}` : ''));
// update-begin--author:liaozhiyang---date:20230811---forissues/675Popup
/** /**
* 判断popup配置项是否正确 * 判断popup配置项是否正确
*/ */
@ -94,6 +96,7 @@
* 打开pop弹出框 * 打开pop弹出框
*/ */
function handleOpen() { function handleOpen() {
emit('focus');
!props.disabled && openModal(true); !props.disabled && openModal(true);
} }
@ -121,6 +124,9 @@
props.formElRef && props.formElRef.setFieldsValue(values); props.formElRef && props.formElRef.setFieldsValue(values);
// //
props.setFieldsValue && props.setFieldsValue(values); props.setFieldsValue && props.setFieldsValue(values);
// update-begin--author:liaozhiyang---date:20230811---forissues/5213JPopupchange
emit('change', values);
// update-end--author:liaozhiyang---date:20230811---forissues/5213JPopupchange
} }
return { return {