Ben Lin
2024-07-02 2069d53e9be24adec3c8d6717fd7317555bd9a52
src/views/tigerprojects/system/lowcode/high/dtl.vue
@@ -53,6 +53,7 @@
  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: [] } },
@@ -61,6 +62,7 @@
  });
  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();
@@ -103,10 +105,11 @@
  ] = 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) => {
@@ -157,7 +160,7 @@
      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,
@@ -183,8 +186,7 @@
    if (isNullOrUnDef(custImport.value)) {
      return actionItem;
    }
    const [{ ActionItem }] = custImport.value['default']();
    return ActionItem(
    return nActionItem(
      params,
      actionItem,
      useDrawers[index][item][1].openDrawer,
@@ -242,18 +244,18 @@
      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,
      });