| | |
| | | * @version: |
| | | * @Date: 2024-06-23 17:21:29 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-07-29 16:25:07 |
| | | * @LastEditTime: 2024-08-01 10:40:57 |
| | | --> |
| | | <template> |
| | | <a-card |
| | |
| | | import { getEntity } from '/@/api/tigerapi/system'; |
| | | import { isNullOrEmpty } from '/@/utils/is'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | |
| | | import { isFunction } from 'xe-utils'; |
| | | |
| | | const { t } = useI18n(); |
| | | const props = defineProps({ |
| | | entityName: { type: String }, |
| | |
| | | const custImport = ref<any[]>(await import(`../entityts/${props.entityName}.ts`)); |
| | | const [{ GetBaseForm, GetBaseCards, GetUseModals }] = custImport.value['default'](); |
| | | const formSchemas = ref({ |
| | | BaseForm: GetBaseForm(), |
| | | BaseForm: GetBaseForm(props.entityName), |
| | | }); |
| | | const colSlots = ref<any[]>(objParams.value['colSlots']); |
| | | const useModals = ref<any>(GetUseModals()); |
| | | const colSlots = ref<any[]>(objParams.value['colSlotsInHigh']); |
| | | const useModals = |
| | | GetUseModals && isFunction(GetUseModals) ? ref<any>(GetUseModals()) : ref<any>({}); |
| | | |
| | | //弹出框或高级页面多表单结构 |
| | | useFormData.value = { |
| | |
| | | }); |
| | | }); |
| | | |
| | | |
| | | /** |
| | | * @description: 弹出选择框选择成功后事件 |
| | | * @param {*} d |
| | |
| | | * @param {*} item 页面上循环抽屉列表传入的实体名字,作为各表格相关方法的key,从而调用各表格相关的方法,如:useFormData.value[_baseCards.value[0]['name']][1].getForm() |
| | | * @return {*} |
| | | */ |
| | | function handleItemSuccess(d, u, item) { |
| | | function handleItemSuccess(d, u, item) { |
| | | /* 动态import实体名.ts的自定义方法 */ |
| | | try { |
| | | import( |
| | |
| | | */ |
| | | function handleSelectItem(item) { |
| | | /* 动态import实体名.ts的自定义方法 */ |
| | | const name = useFormData.value[_baseCards.value[0]['name']][1].getFieldsValue()[`${item.replace(/form-/, '').replace(/add/, '')}PSelect_0`]; |
| | | const name = |
| | | useFormData.value[_baseCards.value[0]['name']][1].getFieldsValue()[ |
| | | `${item.replace(/form-/, '').replace(/add/, '')}PSelect_0` |
| | | ]; |
| | | const openModal = useModals.value[item][1].openModal; |
| | | try { |
| | | import( |
| | | `../entityts/${name}.ts` |
| | | ) |
| | | import(`../entityts/${name}.ts`) |
| | | .then((m) => { |
| | | const [{ OpenSelectItem }] = m.default(); |
| | | OpenSelectItem(openModal); |