赞
踩
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => { //重置表单 await resetFields(); setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter}); isUpdate.value = !!data?.isUpdate; // if (unref(isUpdate)) { // //表单赋值 // await setFieldsValue({ // ...data.record, // }); // } let campaignId = unref(data?.record.campaignId); updateSchema([ { field: 'campaignId', componentProps: { // 如果是添加子部门,就禁用该字段 disabled: campaignId, }, } ]); let record = unref(data?.record); // 隐藏底部时禁用整个表单 if (typeof record !== 'object') { record = {}; } //赋默认值 record = Object.assign( record, { campaignId: data.record.campaignId } ); model.value = record; await setFieldsValue({ ...record }); setProps({ disabled: !data?.showFooter }) // setProps({ disabled: false }) });
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。