| | |
| | | |
| | | const { t } = useI18n(); |
| | | const ACard = Card; |
| | | const emit = defineEmits(['search']); |
| | | const props = defineProps({ |
| | | colSlots: { type: Array as PropType<any[]> }, |
| | | useTableData: { type: Object as PropType<{}>, default: { table: [] } }, |
| | |
| | | }); |
| | | const objParams = inject('objParams') as Ref<any>; |
| | | const data = inject('data') as Ref<any>; |
| | | const _useTables = inject('useTables') as Ref<any>; |
| | | const useFormData = inject('useFormData') as Ref<{}>; |
| | | const others = inject('others') as Ref<Recordable[]>; |
| | | const go = useGo(); |
| | |
| | | ] = isNullOrUnDef(custImport.value['default']) |
| | | ? EntityCustFunction.value |
| | | : custImport.value['default'](); |
| | | others.value = OthersValues(objParams['CODE'], objParams['ID']); |
| | | const drawers = ref<any[]>(objParams['drawers']); |
| | | const useTables = GetUseTables(data); |
| | | others.value = OthersValues(objParams.value['CODE'], objParams.value['ID']); |
| | | const drawers = ref<any[]>(objParams.value['drawers']); |
| | | const useTables = GetUseTables(data, emit); |
| | | const useDrawers = GetUseDrawers(); |
| | | _useTables.value = useTables; |
| | | // watch( |
| | | // () => props.dataSource, |
| | | // (newVal, oldVal) => { |
| | |
| | | isUpdate: true, |
| | | ifSave: true, |
| | | entityName: props.entityName, |
| | | formJson: GetCrudForm(item), //getFormSchema(`${entityName.value}_Crud`), |
| | | formJson: GetCrudForm(item, data), //getFormSchema(`${entityName.value}_Crud`), |
| | | cType, |
| | | dtlSlots, |
| | | useModalData, |
| | |
| | | if (isNullOrUnDef(custImport.value)) { |
| | | return actionItem; |
| | | } |
| | | const [{ ActionItem }] = custImport.value['default'](); |
| | | return ActionItem( |
| | | return nActionItem( |
| | | params, |
| | | actionItem, |
| | | useDrawers[index][item][1].openDrawer, |
| | |
| | | const Keys = Object.getOwnPropertyNames(useFormData.value); |
| | | let i; |
| | | for (i = 0; i < Keys.length; i++) { |
| | | others.value[objParams['pCode']] = objParams['IsID'] |
| | | others.value[objParams.value['pCode']] = objParams.value['IsID'] |
| | | ? res[Keys[i]]['ID'] |
| | | : res[Keys[i]][objParams['pCode']] == '0' || |
| | | isNullOrUnDef(res[Keys[i]][objParams['pCode']]) |
| | | ? res[Keys[i]][objParams['mCode']] |
| | | : res[Keys[i]][objParams['pCode']]; |
| | | : res[Keys[i]][objParams.value['pCode']] == '0' || |
| | | isNullOrUnDef(res[Keys[i]][objParams.value['pCode']]) |
| | | ? res[Keys[i]][objParams.value['mCode']] |
| | | : res[Keys[i]][objParams.value['pCode']]; |
| | | } |
| | | useDrawers[index][item][1].openDrawer(true, { |
| | | isUpdate: false, |
| | | ifSave: true, |
| | | entityName: props.entityName, |
| | | formJson: GetCrudForm(item), //getFormSchema(`${entityName.value}_Crud`), |
| | | formJson: GetCrudForm(item, data), //getFormSchema(`${entityName.value}_Crud`), |
| | | crudColSlots: props.crudColSlots, |
| | | others: others.value, |
| | | }); |