Ben Lin
2024-07-16 5a4d79d9765dfca8812638b57d5f5fe21f7a06ee
src/views/tigerprojects/system/lowcode/normal/index.vue
@@ -4,39 +4,42 @@
 * @version: 
 * @Date: 2024-05-30 13:28:20
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-24 18:49:29
 * @LastEditTime: 2024-07-16 16:24:23
-->
<template>
  <div>
    <Suspense>
      <mainTable />
    </Suspense>
    <CustModal
      @register="registerCust"
      @success="custSuccess"
      :type="cType"
      :detailSlots="dtlSlots"
    >
      <!-- 用插槽自定义多表单 -->
      <template #[item.name] v-for="item in dtlSlots" :key="item.name">
        <BasicForm @register="useFormData[item.name][0]" v-if="useFormData[item.name]">
          <!-- 用插槽自定义弹出选择框 -->
          <template #[name]="{ field }" v-for="name in item.slots" :key="name">
            <a-button
              class="mt-1 ml-1"
              size="small"
              @click="handleCustClick(field)"
              :preIcon="item.preIcons[name]"
            />
            <GeneralModal
              @register="useModalData[name][0]"
              @success="(d, u) => handleEntSuccess(d, u, item.name)"
            />
          </template>
        </BasicForm>
        <!-- 自定义内容 -->
      </template>
    </CustModal>
    <Suspense>
      <CustModal
        @register="registerCust"
        @success="custSuccess"
        :type="cType"
        :detailSlots="dtlSlots"
        :entityName="entityName"
      >
        <!-- 用插槽自定义多表单 -->
        <template #[item.name] v-for="item in dtlSlots" :key="item.name">
          <BasicForm @register="useFormData[item.name][0]" v-if="useFormData[item.name]">
            <!-- 用插槽自定义弹出选择框 -->
            <template #[name]="{ field }" v-for="name in item.slots" :key="name">
              <a-button
                class="mt-1 ml-1"
                size="small"
                @click="handleCustClick(field)"
                :preIcon="item.preIcons[name]"
              />
              <GeneralModal
                @register="useModalData[name][0]"
                @success="(d, u) => handleEntSuccess(d, u, item.name)"
              />
            </template>
          </BasicForm>
          <!-- 自定义内容 -->
        </template>
      </CustModal>
    </Suspense>
  </div>
</template>
<script lang="ts" setup>
@@ -63,6 +66,7 @@
  const { currentRoute } = useRouter();
  const go = useGo();
  const objParams = ref(JSON.parse(decodeURI(route.params?.id as string)));
  const entityName = ref(objParams.value.ID);
  const _columns = ref([]);
  const _searchFormSchema = ref([]);
  const _crudFormSchema = ref([]);
@@ -75,13 +79,13 @@
  const custImport = ref<any>(null);
  const isMounted = ref(false);
  const buttons = ref([]);
  const others = ref<any>(null);
  const keyFieldValues = ref<any>(null);
  provide<Ref<any>>('objParams', objParams.value);
  provide<Ref<any[]>>('_columns', _columns);
  provide<Ref<any[]>>('_searchFormSchema', _searchFormSchema);
  provide<Ref<any[]>>('_crudFormSchema', _crudFormSchema);
  provide<Ref<string>>('isExistSql', isExistSql);
  provide<Ref<any>>('others', others);
  provide<Ref<any>>('keyFieldValues', keyFieldValues);
  const [registerCust, { openModal: openCustomModal, closeModal }] = useModal();
@@ -118,6 +122,7 @@
    const data = await getEntity({
      sqlcmd: "ASSEMBLY_NAME ='" + objParams.value.ID + "'",
      entityName: 'SYS_LOW_CODE',
      order: '',
    });
    var searchForms = JSON.parse(data.Data.Items[0].SEARCH_FORM_JSON);
    for (const i in searchForms) {
@@ -166,6 +171,7 @@
        _cruds[i].componentProps.api = uploadApi;
        _cruds[i].componentProps.multiple = false;
        _cruds[i].componentProps.maxNumber = 1;
        _cruds[i].componentProps.uploadParams = { entityName: objParams.value.ID };
        _cruds[i].rules = [{ required: true, message: '请选择上传文件' }];
      }
      if (_cruds[i].isexist == 'Y') {