Ben Lin
2024-06-24 c8f8a9c645f7857859a9d56fac96192d994be70b
src/views/tigerprojects/system/lowcode/composition/index.vue
@@ -69,7 +69,7 @@
  import GeneralModal from '/@/views/components/GeneralModal.vue';
  import RouteAction from './RouteAction.vue';
  import CustModal from '/@/views/components/CustModal.vue';
  import { OpenCustModal, getOthersValues } from '../data';
  import { OpenCustModal } from '../data';
  import { Ref, onMounted, provide, reactive, ref } from 'vue';
  import { useRoute } from 'vue-router';
  import { useDrawer } from '/@/components/Drawer';
@@ -103,39 +103,15 @@
  const dense = isNullOrUnDef(objParams.value.dense) ? ref(false) : ref(objParams.value.dense);
  const pageTitle = ref(objParams.value.pageTitle);
  const pageContent = ref(objParams.value.pageContent);
  const others = ref(getOthersValues(entityName.value, objParams.value.CODE, objParams.value.ID));
  const prodCode = ref('');
  const rotType = ref('');
  const isMounted = ref(false);
  const custImport = ref(null);
  const custImport = ref<any>(null);
  const [registerCust, { openModal: openCustomModal, closeModal }] = useModal();
  const [registerItemAdd, { openModal: openItemModal }] = useModal();
  const [registerDrawer, { openDrawer }] = useDrawer();
  provide<Ref<string>>('prodCode', prodCode);
  setTitle(objParams.value.Title); //设置标签页标题
  // const [registerTable, { reload }] = useTable({
  //   title: '列表信息',
  //   api: getRoleListByPage,
  //   columns,
  //   formConfig: {
  //     labelWidth: 120,
  //     schemas: searchFormSchema,
  //   },
  //   pagination: false,
  //   striped: false,
  //   useSearchForm: true,
  //   showTableSetting: true,
  //   bordered: true,
  //   showIndexColumn: false,
  //   canResize: false,
  //   actionColumn: {
  //     width: 80,
  //     title: '操作',
  //     dataIndex: 'action',
  //     // slots: { customRender: 'action' },
  //     fixed: undefined,
  //   },
  // });
  /**
   * @description: 获取树形数据
@@ -144,7 +120,7 @@
   */
  async function fetch(type: string) {
    if (!isNullOrUnDef(custImport.value)) {
      const [{ fetchTreeData }] = custImport.value.default();
      const [{ fetchTreeData }] = custImport.value['default']();
    //根据type获取树形数据
    const data = await fetchTreeData(type, objParams.value.CODE);
    title.value = data.title;
@@ -159,7 +135,7 @@
   */
  function goBack() {
    if (!isNullOrUnDef(custImport.value)) {
      const [{ GetHomeUrl }] = custImport.value.default();
      const [{ GetHomeUrl }] = custImport.value['default']();
      // 本例的效果时点击返回始终跳转到账号列表页,实际应用时可返回上一页
      go(GetHomeUrl(entityName.value));
    }
@@ -179,7 +155,7 @@
    if (isNullOrUnDef(custImport.value)) {
      return '';
    } else {
      const [{CreateIcon}] = custImport.value.default();
      const [{CreateIcon}] = custImport.value['default']();
      return CreateIcon(params);
    }
  }
@@ -193,58 +169,6 @@
      isMounted.value = true;
    } catch (e) {}
  });
  /**
   * @description: 生成列表中操作项的按钮
   * @param {*} record
   * @return {*}
   */
  function createActions(record) {
    // return GetActionsData(
    //   {
    //     record,
    //     isUpdate: true,
    //     ifSave: true,
    //     entityName: entityName.value,
    //     formJson: getFormSchema(`${entityName.value}_Crud`),
    //     cType,
    //     dtlSlots,
    //     useModalData,
    //     useFormData,
    //     crudColSlots,
    //   },
    //   openDrawer,
    //   reload,
    //   openCustomModal,
    //   useForm,
    //   useModal,
    // );
  }
  /**
   * @description: 验证表单
   * @return {*}
   */
  async function validate() {
    let validates = {};
    const Keys = Object.getOwnPropertyNames(useFormData.value);
    let i;
    for (i = 0; i < Keys.length; i++) {
      validates[Keys[i]] = await useFormData.value[Keys[i]][1].validate();
    }
    return validates;
  }
  // function handleEdit(record: Recordable) {
  //   openModal(true, {
  //     record,
  //     isUpdate: true,
  //   });
  // }
  // function handleDelete(record: Recordable) {
  //   console.log(record);
  // }
  function handleSelect(deptId = '', info) {
    searchInfo.deptId = deptId;
@@ -263,10 +187,6 @@
    rotType.value = '';
    // reload();
  }
  // function handleSuccess() {
  //   reload();
  // }
  /**
   * @description: 弹出框确定返回