Ben Lin
2024-06-02 6f6207ef6eb81d2abb3805bc2cba889ea2abd135
低代码更新
已修改13个文件
已添加6个文件
1592 ■■■■ 文件已修改
.env.development 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.production 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/tigerapi/model/systemModel.ts 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/tigerapi/system.ts 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/tigerapi/wms/wms_item_his.ts 77 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/icons/add_blue.svg 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/icons/subtract.svg 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/hooks/setting/index.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/lang/en.ts 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/lang/zh_CN.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/env.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/EntityModal.vue 156 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/ItemModal.vue 236 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/normal/index.vue 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/normal/normalDrawer.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/setting/index.vue 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/setting/pageDetail.vue 760 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tigerprojects/system/lowcode/setting/setting.data.ts 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
types/config.d.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.development
@@ -6,6 +6,7 @@
# Basic interface address SPA
VITE_GLOB_API_URL=http://localhost:9528/api
VITE_GLOB_SYS_API_URL=http://localhost:9528
 #VITE_GLOB_API_URL=http://172.18.8.56:9633/api
# VITE_GLOB_API_URL=http://localhost:9633/api
#Tsk Interface address
.env.production
@@ -14,6 +14,7 @@
# VITE_GLOB_API_URL=/basic-api
# VITE_GLOB_API_URL=http://172.18.8.55:9533/api
VITE_GLOB_API_URL=http://47.115.28.255:9520/api
VITE_GLOB_SYS_API_URL=http://47.115.28.255:9520
# VITE_GLOB_API_URL=http://localhost:9527/api
#Tsk Interface address
# VITE_GLOB_TSK_API_URL=http://172.18.8.55:9533/api
src/api/tigerapi/model/systemModel.ts
@@ -1,4 +1,5 @@
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
export type AD_INFO = {
  nation?: string;
  province?: string;
@@ -118,7 +119,7 @@
  USER_NAME: string;
  USER_PWD: string;
  CREATE_TIME: string;
  STATUS_CODE:any;
  STATUS_CODE: any;
}
export interface UserGPListItem {
@@ -280,6 +281,46 @@
  HALF_CHECK: string;
}
export type EntityParams = {
  Namespace?: string;
  StartWith?: string;
};
export interface EntityList {
  Total: number;
  Data: EntityListItem[];
}
export interface EntityListItem {
  FullName: string;
  Namespace: string;
  Name: string;
  Properties: EntityPropertie[];
}
export interface EntityPropertie {
  Name: string;
  Type: string;
}
export interface SYS_LOW_CODE {
  ID: string;
  CREATE_TIME: Date;
  CREATE_USER: string;
  UPDATE_TIME: Date;
  UPDATE_USER: string;
  GHOST_ROW: boolean;
  AUTH_ORG: string;
  AUTH_PROD: string;
  AUTH_WH: string;
  SEARCH_FORM_JSON: string;
  BASE_FORM_JSON: string;
  FORM_JSON: string;
  ASSEMBLY_NAME: string;
  SEARCH_ASSY_NAME: string;
  CRUD_ASSY_NAME: string;
}
/**
 * @description: Request list return value
 */
@@ -290,3 +331,4 @@
export type RoleListGetResultModel = RoleListItem[];
export type ParamsListGetResultModel = BasicFetchResult<ParamsListItem>;
export type LoginLogPageListGetResultModel = BasicFetchResult<LoginLogListItem>;
export type EntityListGetResultModel = BasicFetchResult<EntityPropertie>;
src/api/tigerapi/system.ts
@@ -1,4 +1,5 @@
import { UserConfigFn } from 'vite';
import { useGlobSetting } from '/@/hooks/setting';
import { buildUUID } from '../../utils/uuid';
import { DateFormat } from '../../utils/dataformat';
import { ApiAction, ApiActionJob, ApiActionPage } from '../model/baseModel';
@@ -25,6 +26,8 @@
  LoginLogPageListGetResultModel,
  iSYS_ROLE_ORG,
  iSYS_ROLE_WH,
  EntityParams,
  EntityList,
} from './model/systemModel';
import { defHttp } from '/@/utils/http/axios';
import { isNullOrEmpty } from '/@/utils/is';
@@ -76,7 +79,10 @@
  //导入
  ValidateTableImport = '/SMT/ValidateTableImport',
  SaveValidateTableImport = '/SMT/SaveValidateTableImport',
  GetEntityNameList = '/System/Entitys/Get',
}
const globSetting = useGlobSetting();
/**
 * ç”Ÿæˆapiaction,带分页
@@ -726,3 +732,58 @@
export function getClassName<T>(ctor: new () => T): string {
  return ctor.name;
}
export const getEntityList = (params?: EntityParams) =>
  defHttp.get<EntityList>(
    { url: Api.GetEntityNameList, params },
    {
      isTransformResponse: false,
      apiUrl: globSetting.sysApiUrl,
    },
  );
export async function getEntityNameList(params?: EntityParams) {
  const data = await defHttp.get<EntityList>(
    { url: Api.GetEntityNameList, params },
    {
      isTransformResponse: false,
      apiUrl: globSetting.sysApiUrl,
    },
  );
  const model = {
    items: data.Data,
    total: data.Total,
  };
  return model;
}
export async function getEntityPropertieList(params?: EntityParams) {
  const data = await defHttp.get<EntityList>(
    { url: Api.GetEntityNameList, params },
    {
      isTransformResponse: false,
      apiUrl: globSetting.sysApiUrl,
    },
  );
  const model = {
    items: data.Data.filter((x) => x.Name == params?.StartWith)[0].Properties,
    total: data.Total,
  };
  return model;
}
/* é€šç”¨èŽ·å–å®žä½“è®°å½• */
export const getEntity = async (params: { sqlcmd: string; entityName: string }) => {
  const usParams = genAction(params.entityName, {
    QueryAble_T: '',
    where: params.sqlcmd,
    order: '',
  });
  return await defHttp.post(
    { url: Api.QueryUrl, params: usParams },
    {
      errorMessageMode: 'none',
      isTransformResponse: false,
    },
  );
};
src/api/tigerapi/wms/wms_item_his.ts
@@ -10,9 +10,9 @@
 * èŽ·å–å®žæ—¶åº“å­˜åˆ†é¡µåˆ—è¡¨
 */
export const getWmsItemHisListByPage = async (params: WmsItemPageParams) => {
  let order = ''
  let order = '';
  if (params.order != undefined) {
    order = params.order == 'descend' ? (params.field + ' desc') : params.field
    order = params.order == 'descend' ? params.field + ' desc' : params.field;
  }
  let sqlcmd = '1=1';
  if (params?.SN != undefined && params?.SN != '') {
@@ -27,57 +27,64 @@
  if (params?.TRACE_INFO != undefined && params?.TRACE_INFO != '') {
    sqlcmd += " And TRACE_INFO like '" + params?.TRACE_INFO + "%'";
  }
  var option ={
    UserId:useUserStore().getUserInfo.userId as string,
    ByOrg:true,
    OrgCode:useUserStore().getUserInfo.orgCode as string
  }
  const option = {
    UserId: useUserStore().getUserInfo.userId as string,
    ByOrg: true,
    OrgCode: useUserStore().getUserInfo.orgCode as string,
  };
  //const rParams = genActionPage('V_WMS_ITEM_HIS', sqlcmd, params.page, params.pageSize);
  if(!isNullOrEmpty(params.page)){
    const usParams = genAction('V_WMS_ITEM_HIS', {
      QueryAble_T: '',
      where: sqlcmd,
      order: order,
      page: {
        pageAble_T: 'string',
        draw: 1,
        pageIndex: params.page,
        pageSize: params.pageSize,
      },option
    },option);
  if (!isNullOrEmpty(params.page)) {
    const usParams = genAction(
      'V_WMS_ITEM_HIS',
      {
        QueryAble_T: '',
        where: sqlcmd,
        order: order,
        page: {
          pageAble_T: 'string',
          draw: 1,
          pageIndex: params.page,
          pageSize: params.pageSize,
        },
        option,
      },
      option,
    );
    return getWmsItemListByPageAsync(usParams);
  }else{
    const usParams = genAction('V_WMS_ITEM_HIS', {
      QueryAble_T: '',
      where: sqlcmd,
      option
    },option);
  } else {
    const usParams = genAction(
      'V_WMS_ITEM_HIS',
      {
        QueryAble_T: '',
        where: sqlcmd,
        option,
      },
      option,
    );
    return getWmsItemListByPageAsync(usParams);
  }
};
async function getWmsItemListByPageAsync(params: any) {
  const data = await defHttp.post(
    { url: Api.QueryUrl, params,timeout: 10*60*1000 },
    { url: Api.QueryUrl, params, timeout: 10 * 60 * 1000 },
    {
      isTransformResponse: false,
    },
  );
  let model = {}
  if(isNullOrEmpty(data.Data.page)){
     model = {
  let model = {};
  if (isNullOrEmpty(data.Data.page)) {
    model = {
      items: data.Data.Items,
    };
  }else{
      model = {
  } else {
    model = {
      items: data.Data.page.data,
      total: data.Data.page.totals,
    };
  }
  return model;
}
//下拉列表
// STATUSs ä»“库状态
@@ -91,4 +98,4 @@
      // apiUrl: globSetting.taskApiUrl
    },
  );
};
};
src/assets/icons/add_blue.svg
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1717145055695" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4247" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M524.8 64c4.693 0 8.533 3.84 8.533 8.533v418.134h418.134c4.693 0 8.533 3.84 8.533 8.533v46.933a8.533 8.533 0 0 1-8.533 8.534H533.333V972.8a8.533 8.533 0 0 1-8.533 8.533h-46.933a8.533 8.533 0 0 1-8.534-8.533V554.667H51.2a8.533 8.533 0 0 1-8.533-8.534V499.2c0-4.693 3.84-8.533 8.533-8.533h418.133V72.533c0-4.693 3.84-8.533 8.534-8.533H524.8z" fill="#0a6fa4" p-id="4248"></path></svg>
src/assets/icons/subtract.svg
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1717145761846" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7020" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M85.33 469.33h853.33v85.33H85.33z" p-id="7021" fill="#0a6fa4"></path></svg>
src/hooks/setting/index.ts
@@ -11,12 +11,14 @@
    VITE_GLOB_MAP_KEY,
    VITE_GLOB_TSK_API_URL,
    VITE_GLOB_DOWNLOAD_URL,
    VITE_GLOB_SYS_API_URL,
  } = getAppEnvConfig();
  // Take global configuration
  const glob: Readonly<GlobConfig> = {
    title: VITE_GLOB_APP_TITLE,
    apiUrl: VITE_GLOB_API_URL,
    sysApiUrl: VITE_GLOB_SYS_API_URL,
    taskApiUrl: VITE_GLOB_TSK_API_URL,
    shortName: VITE_GLOB_APP_TITLE.replace(/\s/g, '_').replace(/-/g, '_'),
    urlPrefix: VITE_GLOB_API_URL_PREFIX,
src/locales/lang/en.ts
@@ -10,7 +10,10 @@
    antdLocale,
  },
  apiMessage: {
    ...(await defHttp.get({ url: `${Api.GetLanguage}?locale=en` }, { isTransformResponse: false })),
    ...(await defHttp.get(
      { url: `${Api.GetLanguage}?locale=en-us` },
      { isTransformResponse: false },
    )),
    antdLocale,
  },
  dateLocale: null,
src/locales/lang/zh_CN.ts
@@ -11,7 +11,7 @@
  },
  apiMessage: {
    ...(await defHttp.get(
      { url: `${Api.GetLanguage}?locale=zh-CN` },
      { url: `${Api.GetLanguage}?locale=zh-cn` },
      { isTransformResponse: false },
    )),
    antdLocale,
src/utils/env.ts
@@ -28,6 +28,7 @@
  const {
    VITE_GLOB_APP_TITLE,
    VITE_GLOB_API_URL,
    VITE_GLOB_SYS_API_URL,
    VITE_GLOB_API_URL_PREFIX,
    VITE_GLOB_UPLOAD_URL,
    VITE_GLOB_MAP_KEY,
@@ -38,6 +39,7 @@
  return {
    VITE_GLOB_APP_TITLE,
    VITE_GLOB_API_URL,
    VITE_GLOB_SYS_API_URL,
    VITE_GLOB_TSK_API_URL,
    VITE_GLOB_API_URL_PREFIX,
    VITE_GLOB_UPLOAD_URL,
src/views/components/EntityModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,156 @@
<template>
  <BasicModal
    width="800px"
    :height="600"
    v-bind="$attrs"
    @register="register"
    title="实体列表"
    @ok="handleSubmit"
  >
    <!-- <div class="pt-3px pr-3px">
        <BasicForm @register="registerForm" :model="model" />
      </div> -->
    <div>
      <BasicTable @register="registerTable">
        <!-- <template #toolbar>
                  <a-button type="primary" @click="handleCreate"> æ–°å¢žç›˜ç‚¹ </a-button>
                </template> -->
      </BasicTable>
    </div>
  </BasicModal>
</template>
<script lang="ts" setup>
  import { ref, unref } from 'vue';
  import { BasicModal, useModalInner } from '/@/components/Modal';
  import { FormSchema } from '/@/components/Form/index';
  import { BasicTable, BasicColumn, useTable } from '/@/components/Table';
  import { useI18n } from '/@/hooks/web/useI18n';
  import { getEntityNameList } from '/@/api/tigerapi/system';
  const { t } = useI18n();
  const schemas: FormSchema[] = [
    {
      field: 'StartWith',
      component: 'Input',
      label: '实体名',
      colProps: {
        span: 12,
      },
    },
  ];
  //列表
  const ItemColumns: BasicColumn[] = [
    {
      title: t('实体名'),
      dataIndex: 'Name',
      resizable: true,
      sorter: true,
      width: 180,
    },
    {
      title: t('实体全名'),
      dataIndex: 'FullName',
      resizable: true,
      sorter: true,
      width: 200,
    },
    {
      title: t('命名空间'),
      dataIndex: 'Namespace',
      resizable: true,
      sorter: true,
      width: 200,
    },
  ];
  const emit = defineEmits(['success', 'register']);
  const checkedKeys = ref<Array<string | number>>([]);
  const [registerTable, { reload, getForm }] = useTable({
    title: '实体列表',
    api: getEntityNameList,
    searchInfo: { StartWith: '', Namespace: 'Tiger.Model' },
    columns: ItemColumns,
    formConfig: {
      labelWidth: 120,
      schemas,
    },
    useSearchForm: true,
    showTableSetting: false,
    // pagination: { pageSize: 8 },
    rowKey: 'Name',
    rowSelection: {
      selectedRowKeys: checkedKeys,
      type: 'checkbox',
      // getCheckboxProps(record: Recordable) {
      //   // Demo: ç¬¬ä¸€è¡Œï¼ˆid为0)的选择框禁用
      //   if (record.id === '0') {
      //     return { disabled: true };
      //   } else {
      //     return { disabled: false };
      //   }
      // },
      onSelect: onSelect,
      onSelectAll: onSelectAll,
    },
    bordered: true,
    showIndexColumn: false,
    // actionColumn: {
    //   width: 80,
    //   title: '操作',
    //   dataIndex: 'action',
    //   slots: { customRender: 'action' },
    //   fixed: 'right' //undefined,
    // },
  });
  const [register, { setModalProps, closeModal }] = useModalInner((data) => {
    setModalProps({ confirmLoading: false });
    data && onDataReceive(data);
  });
  async function onDataReceive(data) {
    console.log('Data Received', data);
    getForm().resetFields();
    checkedKeys.value = [];
    reload();
    // æ–¹å¼1;
    // setFieldsValue({
    //   field2: data.data,
    //   field1: data.info,
    // });
  }
  async function handleSubmit() {
    try {
      var values = '';
      // checkedKeys.value.forEach(element => {
      //   values+=element;
      // });
      values = checkedKeys.value.join(',');
      closeModal();
      emit('success', {
        isUpdate: unref(false),
        values: { values, id: 0 },
      });
    } finally {
      setModalProps({ confirmLoading: false });
    }
  }
  function onSelect(record, selected) {
    if (selected) {
      checkedKeys.value = [...checkedKeys.value, record.Name];
    } else {
      checkedKeys.value = checkedKeys.value.filter((Name) => Name !== record.Name);
    }
  }
  function onSelectAll(selected, selectedRows, changeRows) {
    const changeIds = changeRows.map((item) => item.Name);
    if (selected) {
      checkedKeys.value = [...checkedKeys.value, ...changeIds];
    } else {
      checkedKeys.value = checkedKeys.value.filter((Name) => {
        return !changeIds.includes(Name);
      });
    }
  }
</script>
src/views/components/ItemModal.vue
@@ -19,11 +19,10 @@
    </div>
  </BasicModal>
</template>
<script lang="ts">
  import { defineComponent, ref, unref } from 'vue';
<script lang="ts" setup>
  import { ref, unref } from 'vue';
  import { BasicModal, useModalInner } from '/@/components/Modal';
  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
  import { getTreeList } from '/@/api/tigerapi/dept';
  import { BasicTable, BasicColumn, TableAction, useTable } from '/@/components/Table';
  import { getItemListByPage } from '/@/api/tigerapi/wms/inventory';
  import { useI18n } from '/@/hooks/web/useI18n';
@@ -41,7 +40,7 @@
  ];
  //物料列表
  export const ItemColumns: BasicColumn[] = [
  const ItemColumns: BasicColumn[] = [
    {
      title: t('物料编码'),
      dataIndex: 'ITEM_CODE',
@@ -82,148 +81,97 @@
    //   resizable:true,
    // }
  ];
  export default defineComponent({
    components: { BasicModal, BasicForm, BasicTable, TableAction },
    props: {
      userData: { type: Object },
  const emit = defineEmits(['success', 'register']);
  const checkedKeys = ref<Array<string | number>>([]);
  const [registerTable, { reload, getForm }] = useTable({
    title: '物料列表',
    api: getItemListByPage,
    columns: ItemColumns,
    formConfig: {
      labelWidth: 120,
      schemas,
    },
    emit: ['success', 'register'],
    setup(_, { emit }) {
      const modelRef = ref({});
      const [
        registerForm,
        {
          // setFieldsValue,
          // setProps
          updateSchema,
          //validate
        },
      ] = useForm({
        labelWidth: 120,
        schemas,
        showActionButtonGroup: false,
        actionColOptions: {
          span: 24,
        },
      });
      const checkedKeys = ref<Array<string | number>>([]);
      const [registerTable, { reload }] = useTable({
        title: '物料列表',
        api: getItemListByPage,
        columns: ItemColumns,
        formConfig: {
          labelWidth: 120,
          schemas,
        },
        useSearchForm: true,
        showTableSetting: true,
        rowKey: 'ITEM_CODE',
        rowSelection: {
          selectedRowKeys: checkedKeys,
    useSearchForm: true,
    showTableSetting: false,
    rowKey: 'ITEM_CODE',
    rowSelection: {
      selectedRowKeys: checkedKeys,
          type: 'checkbox',
          // getCheckboxProps(record: Recordable) {
          //   // Demo: ç¬¬ä¸€è¡Œï¼ˆid为0)的选择框禁用
          //   if (record.id === '0') {
          //     return { disabled: true };
          //   } else {
          //     return { disabled: false };
          //   }
          // },
          onSelect: onSelect,
          onSelectAll: onSelectAll,
        },
        bordered: true,
        showIndexColumn: false,
        // actionColumn: {
        //   width: 80,
        //   title: '操作',
        //   dataIndex: 'action',
        //   slots: { customRender: 'action' },
        //   fixed: 'right' //undefined,
        // },
      });
      const [register, { setModalProps, closeModal }] = useModalInner((data) => {
        setModalProps({ confirmLoading: false });
        data && onDataReceive(data);
      });
      async function onDataReceive(data) {
        console.log('Data Received', data);
        // æ–¹å¼1;
        // setFieldsValue({
        //   field2: data.data,
        //   field1: data.info,
        // });
        // // æ–¹å¼2
        modelRef.value = { field2: data.data, field1: data.info };
        const treeData = await getTreeList();
        updateSchema([
          {
            field: 'USER_PWD',
            show: !unref(false),
          },
          {
            field: 'ORG_CODE',
            componentProps: { treeData },
          },
        ]);
        // setProps({
        //   model:{ field2: data.data, field1: data.info }
        // })
      }
      // function handleVisibleChange(v) {
      //   v && props.userData && nextTick(() => onDataReceive(props.userData));
      // }
      async function handleSubmit() {
        try {
          var values = '';
          // checkedKeys.value.forEach(element => {
          //   values+=element;
          // });
          values = checkedKeys.value.join(',');
          closeModal();
          emit('success', {
            isUpdate: unref(false),
            values: { values, id: 0 },
          });
        } finally {
          setModalProps({ confirmLoading: false });
        }
      }
      function onSelect(record, selected) {
        if (selected) {
          checkedKeys.value = [...checkedKeys.value, record.ITEM_CODE];
        } else {
          checkedKeys.value = checkedKeys.value.filter(
            (ITEM_CODE) => ITEM_CODE !== record.ITEM_CODE,
          );
        }
      }
      function onSelectAll(selected, selectedRows, changeRows) {
        const changeIds = changeRows.map((item) => item.ITEM_CODE);
        if (selected) {
          checkedKeys.value = [...checkedKeys.value, ...changeIds];
        } else {
          checkedKeys.value = checkedKeys.value.filter((ITEM_CODE) => {
            return !changeIds.includes(ITEM_CODE);
          });
        }
      }
      return {
        register,
        schemas,
        registerForm,
        model: modelRef,
        handleSubmit,
        registerTable,
        onSelect,
        onSelectAll,
      };
      type: 'checkbox',
      // getCheckboxProps(record: Recordable) {
      //   // Demo: ç¬¬ä¸€è¡Œï¼ˆid为0)的选择框禁用
      //   if (record.id === '0') {
      //     return { disabled: true };
      //   } else {
      //     return { disabled: false };
      //   }
      // },
      onSelect: onSelect,
      onSelectAll: onSelectAll,
    },
    bordered: true,
    showIndexColumn: false,
    // actionColumn: {
    //   width: 80,
    //   title: '操作',
    //   dataIndex: 'action',
    //   slots: { customRender: 'action' },
    //   fixed: 'right' //undefined,
    // },
  });
  const [register, { setModalProps, closeModal }] = useModalInner((data) => {
    setModalProps({ confirmLoading: false });
    data && onDataReceive(data);
  });
  async function onDataReceive(data) {
    console.log('Data Received', data);
    // æ–¹å¼1;
    // setFieldsValue({
    //   field2: data.data,
    //   field1: data.info,
    // });
    checkedKeys.value = [];
    getForm().resetFields();
    reload();
  }
  // function handleVisibleChange(v) {
  //   v && props.userData && nextTick(() => onDataReceive(props.userData));
  // }
  async function handleSubmit() {
    try {
      var values = '';
      // checkedKeys.value.forEach(element => {
      //   values+=element;
      // });
      values = checkedKeys.value.join(',');
      closeModal();
      emit('success', {
        isUpdate: unref(false),
        values: { values, id: 0 },
      });
    } finally {
      setModalProps({ confirmLoading: false });
    }
  }
  function onSelect(record, selected) {
    if (selected) {
      checkedKeys.value = [...checkedKeys.value, record.ITEM_CODE];
    } else {
      checkedKeys.value = checkedKeys.value.filter((ITEM_CODE) => ITEM_CODE !== record.ITEM_CODE);
    }
  }
  function onSelectAll(selected, selectedRows, changeRows) {
    const changeIds = changeRows.map((item) => item.ITEM_CODE);
    if (selected) {
      checkedKeys.value = [...checkedKeys.value, ...changeIds];
    } else {
      checkedKeys.value = checkedKeys.value.filter((ITEM_CODE) => {
        return !changeIds.includes(ITEM_CODE);
      });
    }
  }
</script>
src/views/tigerprojects/system/lowcode/normal/index.vue
@@ -28,19 +28,22 @@
  </div>
</template>
<script lang="ts" setup>
  import { onMounted, ref } from 'vue';
  import { h, onMounted, ref } from 'vue';
  import { BasicTable, useTable, TableAction, BasicColumn, FormSchema } from '/@/components/Table';
  import { useDrawer } from '/@/components/Drawer';
  import normalDrawer from './normalDrawer.vue';
  import { DeleteEntity, fetchJson, getListByPage } from '/@/api/tigerapi/system';
  import { DeleteEntity, fetchJson, getEntity, getListByPage } from '/@/api/tigerapi/system';
  import { useGlobSetting } from '/@/hooks/setting';
  import { useRoute } from 'vue-router';
  import { Tag, Tooltip } from 'ant-design-vue';
  import { isNullOrEmpty } from '/@/utils/is';
  const route = useRoute();
  const objParams = ref(JSON.parse(decodeURI(route.params?.id as string)));
  const globSetting = useGlobSetting();
  const _columns = ref([]);
  const _searchFormSchema = ref([]);
  const _crudFormSchema = ref([]);
  const [registerDrawer, { openDrawer }] = useDrawer();
  const [registerTable, { reload }] = useTable({
    title: '列表信息',
@@ -69,6 +72,7 @@
    openDrawer(true, {
      isUpdate: false,
      entityName: objParams.value.ID,
      formJson: _crudFormSchema.value,
    });
  }
@@ -77,6 +81,7 @@
      record,
      isUpdate: true,
      entityName: objParams.value.ID,
      formJson: _crudFormSchema.value,
    });
  }
@@ -96,11 +101,31 @@
  }
  onMounted(async () => {
    _searchFormSchema.value = await fetchJson(
      `${globSetting.downloadUrl}/LowCode/${objParams.value.ID}/${objParams.value.ID}_Searchform.json`,
    );
    _columns.value = await fetchJson(
      `${globSetting.downloadUrl}/LowCode/${objParams.value.ID}/${objParams.value.ID}_Baseform.json`,
    );
    /* ç”¨json获取列 */
    // _searchFormSchema.value = await fetchJson(
    //   `${globSetting.downloadUrl}/LowCode/${objParams.value.ID}/${objParams.value.ID}_Searchform.json`,
    // );
    // var objs = await fetchJson(
    //   `${globSetting.downloadUrl}/LowCode/${objParams.value.ID}/${objParams.value.ID}_Baseform.json`,
    // );
    // for (const i in objs) {
    //   if (!isNullOrEmpty(objs[i].customRender)) {
    //     const func = new Function(objs[i].customRender)();
    //     objs[i].customRender = ({ record }) => {
    //       let texts = func(record);
    //       return h(Tooltip, { title: texts.text }, () =>
    //         h(Tag, { color: texts.color }, () => texts.text),
    //       );
    //     };
    //   }
    // }
    // _columns.value = objs;
    const data = await getEntity({
      sqlcmd: "ASSEMBLY_NAME ='" + objParams.value.ID + "'",
      entityName: 'SYS_LOW_CODE',
    });
    _searchFormSchema.value = JSON.parse(data.Data.Items[0].SEARCH_FORM_JSON);
    _columns.value = JSON.parse(data.Data.Items[0].BASE_FORM_JSON);
    _crudFormSchema.value = JSON.parse(data.Data.Items[0].FORM_JSON);
  });
</script>
src/views/tigerprojects/system/lowcode/normal/normalDrawer.vue
@@ -34,11 +34,12 @@
  const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
    isUpdate.value = !!data?.isUpdate;
    entityName.value = data?.entityName;
    formSchema.value = await fetchJson(
      `${globSetting.downloadUrl}/LowCode/${unref(entityName)}/${
        entityName.value
      }_addEditform.json`,
    );
    // formSchema.value = await fetchJson(
    //   `${globSetting.downloadUrl}/LowCode/${unref(entityName)}/${
    //     entityName.value
    //   }_addEditform.json`,
    // );
    formSchema.value = data?.formJson;
    resetFields();
    setDrawerProps({ confirmLoading: false });
src/views/tigerprojects/system/lowcode/setting/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,97 @@
<template>
  <div>
    <BasicTable @register="registerTable">
      <template #toolbar>
        <a-button type="primary" @click="handleCreate" preIcon="add_02|svg"> æ–°å¢ž </a-button>
      </template>
      <template #action="{ record }">
        <TableAction
          :actions="[
            {
              icon: 'clarity:note-edit-line',
              onClick: handleEdit.bind(null, record),
            },
            {
              icon: 'ant-design:delete-outlined',
              color: 'error',
              popConfirm: {
                title: '是否确认删除?',
                placement: 'left',
                confirm: handleDelete.bind(null, record),
              },
            },
          ]"
        />
      </template>
    </BasicTable>
  </div>
</template>
<script lang="ts" setup>
  import { onMounted, ref } from 'vue';
  import { BasicTable, useTable, TableAction, BasicColumn, FormSchema } from '/@/components/Table';
  import { DeleteEntity, fetchJson, getListByPage } from '/@/api/tigerapi/system';
  import { useGlobSetting } from '/@/hooks/setting';
  import { useGo } from '/@/hooks/web/usePage';
  import { buildUUID } from '/@/utils/uuid';
  const go = useGo();
  const globSetting = useGlobSetting();
  const _columns = ref([]);
  const _searchFormSchema = ref([]);
  const [registerTable, { reload }] = useTable({
    title: '列表信息',
    api: getListByPage,
    searchInfo: { TABLE_NAME: 'SYS_LOW_CODE' },
    columns: _columns as unknown as BasicColumn[],
    formConfig: {
      labelWidth: 120,
      schemas: _searchFormSchema as unknown as FormSchema[],
    },
    useSearchForm: true,
    showTableSetting: true,
    bordered: true,
    canResize: true,
    showIndexColumn: false,
    actionColumn: {
      width: 80,
      title: '操作',
      dataIndex: 'action',
      slots: { customRender: 'action' },
      fixed: undefined,
    },
  });
  function handleCreate() {
    const ID = { Update: '0', ID: buildUUID(), Name: '' };
    go(`/PageDetail/${encodeURI(JSON.stringify(ID))}`);
  }
  function handleEdit(record: Recordable) {
    const ID = { Update: '1', ID: record.ID, Name: record.ASSEMBLY_NAME };
    go(`/PageDetail/${encodeURI(JSON.stringify(ID))}`);
  }
  function handleDelete(record: Recordable) {
    console.log(record);
    //删除
    const apiAction = DeleteEntity(record, 'SYS_LOW_CODE');
    apiAction.then((action) => {
      if (action.IsSuccessed) {
        reload();
      }
    });
  }
  function handleSuccess() {
    reload();
  }
  onMounted(async () => {
    _searchFormSchema.value = await fetchJson(
      `${globSetting.downloadUrl}/LowCode/SYS_LOW_CODE/SYS_LOW_CODE_Searchform.json`,
    );
    _columns.value = await fetchJson(
      `${globSetting.downloadUrl}/LowCode/SYS_LOW_CODE/SYS_LOW_CODE_Baseform.json`,
    );
  });
</script>
src/views/tigerprojects/system/lowcode/setting/pageDetail.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,760 @@
<template>
  <PageWrapper
    class="high-form"
    title="低代码页面管理"
    content="这是低代码页面管理,在这能够根据实体类配置增删改功能页面。"
    @back="goBack"
  >
    <a-card title="查询条件配置" :bordered="false">
      <BasicForm @register="register">
        <template #add="{ field }">
          <a-button
            v-if="field"
            class="mt-1 ml-1"
            size="small"
            @click="handleSelecNew"
            preIcon="search|svg"
          />
          <EntityModal @register="registerNewAdd" @success="handleNewSuccess" />
        </template>
        <template #condAdd="{ field }">
          <a-button
            v-if="field"
            class="mt-1 ml-1"
            size="small"
            @click="condAdd"
            preIcon="add_blue|svg"
          />
        </template>
        <template #subtract="{ field }">
          <a-button
            v-if="field"
            class="mt-1 ml-1"
            size="small"
            @click="del(field)"
            preIcon="subtract|svg"
          />
        </template>
        <template #[item]="{ model, field }" v-for="(item, index) in searchSlots" :key="item">
          <a-input-group compact>
            <ApiSelect
              style="width: 25%"
              :api="getEntityPropertieList"
              :params="{ StartWith: getFieldsValue().ASSEMBLY_NAME, Namespace: 'Tiger.Model' }"
              v-model:value="model[field]"
              resultField="items"
              label-field="Name"
              valueField="Name"
            />
            <a-input v-model:value="objInputs[field]" style="width: 55%" />
            <Select
              ref="select"
              v-model:value="searchSelectVals[field]"
              style="width: 20%"
              :options="options"
              :readonly="true"
            />
          </a-input-group>
        </template>
        <template #[item]="{ model, field }" v-for="item in swSlots" :key="item">
          <a-switch v-model:checked="model[field]" />
        </template>
      </BasicForm>
    </a-card>
    <a-card title="主表格配置" :bordered="false" class="!mt-5">
      <div>
        <BasicForm @register="registerMain">
          <template #add="{ field }">
            <a-button
              v-if="field"
              class="mt-1 ml-1"
              size="small"
              @click="mainSelectAssy"
              preIcon="search|svg"
            />
            <EntityModal @register="registerMainAdd" @success="mainAssySuccess" />
          </template>
          <template #mainCondAdd="{ field }">
            <a-button
              v-if="field"
              class="mt-1 ml-1"
              size="small"
              @click="mainCondAdd"
              preIcon="add_blue|svg"
            />
          </template>
          <template #mainSubtract="{ field }">
            <a-button
              v-if="field"
              class="mt-1 ml-1"
              size="small"
              @click="mainDel(field)"
              preIcon="subtract|svg"
            />
          </template>
          <template #[item]="{ model, field }" v-for="(item, index) in mainSlots" :key="item">
            <a-input-group compact>
              <ApiSelect
                style="width: 30%"
                :api="getEntityPropertieList"
                :params="{
                  StartWith: getFieldsValueMain().MainAssemblyName,
                  Namespace: 'Tiger.Model',
                }"
                v-model:value="model[field]"
                resultField="items"
                label-field="Name"
                valueField="Name"
              />
              <a-input v-model:value="mainInputs[field]" style="width: 70%" />
            </a-input-group>
          </template>
          <template #[item]="{ model, field }" v-for="item in mainSwSlots" :key="item">
            <a-switch v-model:checked="model[field]" />
          </template>
          <template #[item]="{ model, field }" v-for="item in mainsSwSlots" :key="item">
            <a-switch v-model:checked="model[field]" />
          </template>
          <template #[item]="{ model, field }" v-for="item in mainwSwSlots" :key="item">
            <a-switch v-model:checked="model[field]" />
          </template>
        </BasicForm>
      </div>
    </a-card>
    <a-card title="增删改配置" :bordered="false" class="!mt-5">
      <BasicForm @register="registerCrud">
        <template #add="{ field }">
          <a-button
            v-if="field"
            class="mt-1 ml-1"
            size="small"
            @click="handleSelectCrud"
            preIcon="search|svg"
          />
          <EntityModal @register="registerCrudAdd" @success="handleCrudSuccess" />
        </template>
        <template #crudCondAdd="{ field }">
          <a-button
            v-if="field"
            class="mt-1 ml-1"
            size="small"
            @click="crudCondAdd"
            preIcon="add_blue|svg"
          />
        </template>
        <template #crudSubtract="{ field }">
          <a-button
            v-if="field"
            class="mt-1 ml-1"
            size="small"
            @click="crudDel(field)"
            preIcon="subtract|svg"
          />
        </template>
        <template #[item]="{ model, field }" v-for="(item, index) in crudSlots" :key="item">
          <a-input-group compact>
            <ApiSelect
              style="width: 25%"
              :api="getEntityPropertieList"
              :params="{
                StartWith: getFieldsValueCrud().crudAssemblyName,
                Namespace: 'Tiger.Model',
              }"
              v-model:value="model[field]"
              resultField="items"
              label-field="Name"
              valueField="Name"
            />
            <a-input v-model:value="crudInputs[field]" style="width: 55%" />
            <Select
              ref="select"
              v-model:value="crudSelectVals[field]"
              style="width: 20%"
              :options="options"
              :readonly="true"
            />
          </a-input-group>
        </template>
        <template #[item]="{ model, field }" v-for="item in crudSwSlots" :key="item">
          <a-switch v-model:checked="model[field]" />
        </template>
        <template #[item]="{ model, field }" v-for="item in crudrSwSlots" :key="item">
          <a-switch v-model:checked="model[field]" />
        </template>
      </BasicForm>
    </a-card>
    <template #rightFooter>
      <a-button class="mr-4" type="info" @click="cancel"> å–消 </a-button>
      <a-button type="primary" @click="submitAll"> ç”Ÿæˆ </a-button>
    </template>
  </PageWrapper>
</template>
<script lang="ts" setup>
  import { BasicForm, useForm } from '/@/components/Form';
  import { onMounted, ref, unref } from 'vue';
  import { Card, InputGroup, Select, Input, Switch } from 'ant-design-vue';
  import { ApiSelect } from '/@/components/Form/index';
  import { useRoute, useRouter } from 'vue-router';
  import { PageWrapper } from '/@/components/Page';
  import { useGo } from '/@/hooks/web/usePage';
  import { newFormSchema, crudSchemas, mainSchemas } from './setting.data';
  import { useTabs } from '/@/hooks/web/useTabs';
  import EntityModal from '/@/views/components/EntityModal.vue';
  import { buildUUID } from '/@/utils/uuid';
  import { SelectTypes } from 'ant-design-vue/es/select';
  import { useMultipleTabStore } from '/@/store/modules/multipleTab';
  import { useModal } from '/@/components/Modal';
  import { SaveEntity, getEntityPropertieList } from '/@/api/tigerapi/system';
  import { EntityPropertie, SYS_LOW_CODE } from '/@/api/tigerapi/model/systemModel';
  import { isNullOrEmpty } from '/@/utils/is';
  import { useUserStore } from '/@/store/modules/user';
  const ACard = Card;
  const AInputGroup = InputGroup;
  const AInput = Input;
  const ASwitch = Switch;
  const route = useRoute();
  const go = useGo();
  const objParams = ref(JSON.parse(decodeURI(route.params?.id as string)));
  const { setTitle } = useTabs();
  const tabStore = useMultipleTabStore();
  const router = useRouter();
  const { currentRoute } = router;
  function getCurrentTab() {
    const route = unref(currentRoute);
    return tabStore.getTabList.find((item) => item.fullPath === route.fullPath)!;
  }
  const currentTab = getCurrentTab();
  var _title =
    objParams.value.Update == '0'
      ? '低代码页面详情新增'
      : `低代码页面详情编辑:${objParams.value.Name}`;
  setTitle(_title);
  const [registerCrudAdd, { openModal: openCrudModal }] = useModal();
  const [registerNewAdd, { openModal: openNewModal }] = useModal();
  const [registerMainAdd, { openModal: openMainModal }] = useModal();
  const [
    register,
    {
      resetFields,
      setFieldsValue,
      getFieldsValue,
      appendSchemaByField,
      removeSchemaByField,
      validate,
    },
  ] = useForm({
    labelWidth: 120,
    baseColProps: {
      span: 24,
    },
    schemas: newFormSchema,
    showActionButtonGroup: false,
  });
  const [
    registerCrud,
    {
      setFieldsValue: setFieldsValueCrud,
      getFieldsValue: getFieldsValueCrud,
      appendSchemaByField: appendSchemaByFieldCrud,
      removeSchemaByField: removeSchemaByFieldCrud,
      validate: crudvalidate,
    },
  ] = useForm({
    labelWidth: 120,
    baseColProps: {
      span: 24,
    },
    schemas: crudSchemas,
    showActionButtonGroup: false,
  });
  const [
    registerMain,
    {
      setFieldsValue: setFieldsValueMain,
      getFieldsValue: getFieldsValueMain,
      appendSchemaByField: appendSchemaByFieldMain,
      removeSchemaByField: removeSchemaByFieldMain,
      validate: validateMainForm,
    },
  ] = useForm({
    labelWidth: 120,
    baseColProps: {
      span: 24,
    },
    schemas: mainSchemas,
    showActionButtonGroup: false,
  });
  const objInputs = ref({} as { [key: string]: any });
  const mainInputs = ref({} as { [key: string]: any });
  const crudInputs = ref({} as { [key: string]: any });
  const searchProperties = ref([] as EntityPropertie[]);
  const mainProperties = ref([] as EntityPropertie[]);
  const crudProperties = ref([] as EntityPropertie[]);
  const searchSlots = ref([] as string[]);
  const mainSlots = ref([] as string[]);
  const crudSlots = ref([] as string[]);
  const swSlots = ref([] as string[]);
  const mainSwSlots = ref([] as string[]);
  const crudSwSlots = ref([] as string[]);
  const mainsSwSlots = ref([] as string[]);
  const mainwSwSlots = ref([] as string[]);
  const crudrSwSlots = ref([] as string[]);
  const searchSelectVals = ref({} as { [key: string]: any });
  const mainSelectVals = ref({} as { [key: string]: any });
  const crudSelectVals = ref({} as { [key: string]: any });
  const options = ref<SelectTypes['options']>([
    {
      value: 'Input',
      label: '输入框',
    },
    {
      value: 'InputPassword',
      label: '输入密码框',
    },
    {
      value: 'InputNumber',
      label: '输入数字框',
    },
    {
      value: 'Select',
      label: '下拉框',
    },
    {
      value: 'ApiSelect',
      label: 'Api下拉框',
    },
    {
      value: 'Checkbox',
      label: 'Checkbox',
    },
    {
      value: 'TimePicker',
      label: '时间选择器',
    },
    {
      value: 'Switch',
      label: '开关',
    },
  ]);
  onMounted(async () => {});
  async function submitAll() {
    try {
      const [values, crudvalues, mainvalues] = await Promise.all([
        validate(),
        crudvalidate(),
        validateMainForm(),
      ]);
      /* æŸ¥è¯¢æ¡ä»¶Json */
      const Keys = Object.getOwnPropertyNames(values);
      var searchjsons = [];
      var _json = {};
      var _n = 0;
      for (const k in Keys) {
        console.log(`${k}:${Keys[k]}`);
        if (!isNullOrEmpty(values[Keys[k]])) {
          if (Keys[k].toString().startsWith(getFieldsValue().ASSEMBLY_NAME)) {
            _json['field'] = values[Keys[k]];
            _json['label'] = objInputs.value[Keys[k]];
            _json['defaultValue'] = '';
            _json['component'] = searchSelectVals.value[Keys[k]];
            _n = _n + 4;
          }
          if (Keys[k].toString().startsWith('InputNumber')) {
            _json['colProps'] = { span: values[Keys[k]] };
            _n++;
          }
          if (Keys[k].toString().startsWith('Switch')) {
            _json['ifShow'] = values[Keys[k]] as boolean;
            _n++;
          }
          if (!isNullOrEmpty(_json) && _n == 6) {
            searchjsons.push(_json);
            _json = {};
            _n = 0;
          }
        }
      }
      console.log(JSON.stringify(searchjsons));
      /* ä¸»è¡¨æ ¼Json */
      const mKeys = Object.getOwnPropertyNames(mainvalues);
      var mjsons = [];
      var mjson = {};
      var i = 0;
      for (const k in mKeys) {
        console.log(`${k}:${mKeys[k]}`);
        if (isNullOrEmpty(mainvalues[mKeys[k]])) {
          if (
            mKeys[k].toString().startsWith('Switch') ||
            mKeys[k].toString().startsWith('sSwitch') ||
            mKeys[k].toString().startsWith('wSwitch')
          ) {
            mainvalues[mKeys[k]] = false;
          }
        }
        if (!isNullOrEmpty(mainvalues[mKeys[k]])) {
          if (mKeys[k].toString().startsWith(getFieldsValueMain().MainAssemblyName)) {
            mjson['dataIndex'] = mainvalues[mKeys[k]];
            mjson['title'] = mainInputs.value[mKeys[k]];
            i = i + 2;
          }
          if (mKeys[k].toString().startsWith('Switch')) {
            mjson['ifShow'] = mainvalues[mKeys[k]] as boolean;
            i++;
          }
          if (mKeys[k].toString().startsWith('sSwitch')) {
            mjson['sorter'] = mainvalues[mKeys[k]] as boolean;
            i++;
          }
          if (mKeys[k].toString().startsWith('wSwitch')) {
            mjson['resizable'] = mainvalues[mKeys[k]] as boolean;
            i++;
          }
          if (!isNullOrEmpty(mjson) && i == 5) {
            mjsons.push(mjson);
            i = 0;
            mjson = {};
          }
        }
      }
      console.log(JSON.stringify(mjsons));
      /* å¢žåˆ æ”¹Json */
      const cKeys = Object.getOwnPropertyNames(crudvalues);
      var cjsons = [];
      var cjson = {};
      var c = 0;
      for (const k in cKeys) {
        console.log(`${k}:${cKeys[k]}`);
        if (isNullOrEmpty(crudvalues[mKeys[k]])) {
          if (
            cKeys[k].toString().startsWith('Switch') ||
            cKeys[k].toString().startsWith('rSwitch')
          ) {
            crudvalues[mKeys[k]] = false;
          }
        }
        if (!isNullOrEmpty(crudvalues[cKeys[k]])) {
          if (cKeys[k].toString().startsWith(getFieldsValueCrud().crudAssemblyName)) {
            cjson['field'] = crudvalues[cKeys[k]];
            cjson['label'] = crudInputs.value[cKeys[k]];
            cjson['component'] = crudSelectVals.value[cKeys[k]];
            c = c + 3;
          }
          if (cKeys[k].toString().startsWith('Switch')) {
            cjson['show'] = crudvalues[cKeys[k]] as boolean;
            c++;
          }
          if (cKeys[k].toString().startsWith('rSwitch')) {
            cjson['required'] = crudvalues[cKeys[k]] as boolean;
            c++;
          }
          if (cKeys[k].toString().startsWith('InputNumber')) {
            cjson['colProps'] = { span: crudvalues[cKeys[k]] };
            c++;
          }
          if (!isNullOrEmpty(cjson) && c == 6) {
            cjsons.push(cjson);
            c = 0;
            cjson = {};
          }
        }
      }
      console.log(JSON.stringify(cjsons));
      var entity: SYS_LOW_CODE = {
        CREATE_USER: useUserStore().getUserInfo.userId as string,
        UPDATE_USER: useUserStore().getUserInfo.userId as string,
        SEARCH_FORM_JSON: JSON.stringify(searchjsons),
        BASE_FORM_JSON: JSON.stringify(mjsons),
        FORM_JSON: JSON.stringify(cjsons),
        ASSEMBLY_NAME: getFieldsValueMain().MainAssemblyName,
        CRUD_ASSY_NAME: getFieldsValueCrud().crudAssemblyName,
        SEARCH_ASSY_NAME: getFieldsValue().ASSEMBLY_NAME,
      };
      SaveEntity(entity, unref(objParams.value.Update) == '1', 'SYS_LOW_CODE').then((action) => {
        if (action.IsSuccessed) {
          cancel();
        }
      });
    } catch (error) {
      console.log(error);
    }
  }
  async function cancel() {
    try {
      tabStore.closeTab(currentTab, router);
    } catch (error) {}
  }
  async function handleCreate() {
    await validate();
  }
  function handleEdit(record: Recordable) {}
  //点击打开物料列表框
  function handleSelecNew() {
    openNewModal(true, {
      data: 'content',
      info: 'Info',
    });
  }
  function mainSelectAssy() {
    openMainModal(true, {
      data: 'content',
      info: 'Info',
    });
  }
  function handleSelectCrud() {
    openCrudModal(true, {
      data: 'content',
      info: 'Info',
    });
  }
  async function mainAssySuccess(d, u) {
    setFieldsValueMain({
      MainAssemblyName: d.values.values,
    });
    var data = await getEntityPropertieList({
      StartWith: d.values.values,
      Namespace: 'Tiger.Model',
    });
    mainProperties.value = data.items;
  }
  async function handleNewSuccess(d, u) {
    setFieldsValue({
      ASSEMBLY_NAME: d.values.values,
    });
    var data = await getEntityPropertieList({
      StartWith: d.values.values,
      Namespace: 'Tiger.Model',
    });
    searchProperties.value = data.items;
  }
  function handleCrudSuccess(d, u) {
    setFieldsValueCrud({
      crudAssemblyName: d.values.values,
    });
  }
  const n = ref(1);
  const m = ref(1);
  const j = ref(1);
  /**
   * @description: æ‰¹é‡æ·»åŠ  æŸ¥è¯¢é…ç½®
   */
  function condAdd() {
    appendSchemaByField(
      [
        {
          field: `${getFieldsValue().ASSEMBLY_NAME}${n.value}a`,
          component: 'InputGroup',
          label: '字段' + n.value,
          // required: true,
          slot: 'fac' + n.value,
          colProps: { span: 14 },
        },
        {
          field: `Switch${n.value}`,
          component: 'Switch',
          label: '是否显示',
          slot: `sw${n.value}`,
          colProps: { span: 3 },
        },
        {
          field: `InputNumber${n.value}`,
          component: 'InputNumber',
          label: '列宽',
          colProps: { span: 3 },
        },
        {
          field: `${n.value}`,
          component: 'Input',
          label: ' ',
          slot: 'subtract',
          colProps: { span: 4 },
        },
      ],
      '',
    );
    searchSlots.value.push('fac' + n.value);
    swSlots.value.push(`sw${n.value}`);
    objInputs.value[`${getFieldsValue().ASSEMBLY_NAME}${n.value}a`] = '';
    searchSelectVals.value[`${getFieldsValue().ASSEMBLY_NAME}${n.value}a`] = '';
    console.log(searchSlots.value);
    n.value++;
  }
  function del(field) {
    removeSchemaByField([
      `${getFieldsValue().ASSEMBLY_NAME}${field}a`,
      `Switch${field}`,
      `InputNumber${field}`,
      `${field}`,
    ]);
    swSlots.value.splice(swSlots.value.indexOf(`sw${field}`), 1);
    searchSlots.value.splice(searchSlots.value.indexOf(`fac${field}`), 1);
    if (searchSlots.value.length == 0) {
      n.value = 1;
    }
  }
  /* ä¸»è¡¨é…ç½® */
  function mainCondAdd() {
    appendSchemaByFieldMain(
      [
        {
          field: `${getFieldsValueMain().MainAssemblyName}${m.value}a`,
          component: 'InputGroup',
          label: '字段' + m.value,
          // required: true,
          slot: 'mainfac' + m.value,
          colProps: { span: 12 },
        },
        {
          field: `Switch${m.value}`,
          component: 'Switch',
          label: '是否显示',
          slot: `mainSw${m.value}`,
          colProps: { span: 3 },
        },
        {
          field: `sSwitch${m.value}`,
          component: 'Switch',
          label: '是否排序',
          slot: `mainsSw${m.value}`,
          colProps: { span: 3 },
        },
        {
          field: `wSwitch${m.value}`,
          component: 'Switch',
          label: '是否可调宽',
          slot: `mainwSw${m.value}`,
          colProps: { span: 3 },
        },
        // {
        //   field: `InputNumber${m.value}`,
        //   component: 'InputNumber',
        //   label: '列宽',
        //   colProps: { span: 3 },
        // },
        {
          field: `${m.value}`,
          component: 'Input',
          label: ' ',
          slot: 'mainSubtract',
          colProps: { span: 3 },
        },
      ],
      '',
    );
    mainSlots.value.push('mainfac' + m.value);
    mainSwSlots.value.push(`mainSw${m.value}`);
    mainsSwSlots.value.push(`mainsSw${m.value}`);
    mainwSwSlots.value.push(`mainwSw${m.value}`);
    mainInputs.value[`${getFieldsValueMain().MainAssemblyName}${m.value}a`] = '';
    mainSelectVals.value[`${getFieldsValueMain().MainAssemblyName}${m.value}a`] = '';
    console.log(mainSlots.value);
    m.value++;
  }
  function mainDel(field) {
    removeSchemaByFieldMain([
      `${getFieldsValueMain().MainAssemblyName}${field}a`,
      `Switch${field}`,
      `sSwitch${field}`,
      `wSwitch${field}`,
      `InputNumber${field}`,
      `${field}`,
    ]);
    mainSwSlots.value.splice(mainSwSlots.value.indexOf(`mainSw${field}`), 1);
    mainsSwSlots.value.splice(mainsSwSlots.value.indexOf(`mainsSw${field}`), 1);
    mainwSwSlots.value.splice(mainwSwSlots.value.indexOf(`mainwSw${field}`), 1);
    mainSlots.value.splice(mainSlots.value.indexOf(`mainfac${field}`), 1);
    if (mainSlots.value.length == 0) {
      m.value = 1;
    }
  }
  /* å¢žåˆ æ”¹é…ç½® */
  function crudCondAdd() {
    appendSchemaByFieldCrud(
      [
        {
          field: `${getFieldsValueCrud().crudAssemblyName}${j.value}a`,
          component: 'InputGroup',
          label: '字段' + j.value,
          // required: true,
          slot: 'crudfac' + j.value,
          colProps: { span: 12 },
        },
        {
          field: `Switch${j.value}`,
          component: 'Switch',
          label: '是否显示',
          slot: `crudSw${j.value}`,
          colProps: { span: 3 },
        },
        {
          field: `rSwitch${j.value}`,
          component: 'Switch',
          label: '是否必填',
          slot: `crudrSw${j.value}`,
          colProps: { span: 3 },
        },
        {
          field: `InputNumber${j.value}`,
          component: 'InputNumber',
          label: '列宽',
          colProps: { span: 3 },
        },
        {
          field: `${j.value}`,
          component: 'Input',
          label: ' ',
          slot: 'crudSubtract',
          colProps: { span: 3 },
        },
      ],
      '',
    );
    crudSlots.value.push('crudfac' + j.value);
    crudSwSlots.value.push(`crudSw${j.value}`);
    crudrSwSlots.value.push(`crudrSw${j.value}`);
    crudInputs.value[`${getFieldsValueCrud().crudAssemblyName}${j.value}a`] = '';
    crudSelectVals.value[`${getFieldsValueCrud().crudAssemblyName}${j.value}a`] = '';
    console.log(crudSlots.value);
    j.value++;
  }
  function crudDel(field) {
    removeSchemaByFieldCrud([
      `${getFieldsValueCrud().crudAssemblyName}${field}a`,
      `Switch${field}`,
      `rSwitch${field}`,
      `InputNumber${field}`,
      `${field}`,
    ]);
    crudSwSlots.value.splice(crudSwSlots.value.indexOf(`crudSw${field}`), 1);
    crudrSwSlots.value.splice(crudrSwSlots.value.indexOf(`crudrSw${field}`), 1);
    crudSlots.value.splice(crudSlots.value.indexOf(`crudfac${field}`), 1);
    if (crudSlots.value.length == 0) {
      j.value = 1;
    }
  }
  function goBack() {
    // æœ¬ä¾‹çš„æ•ˆæžœæ—¶ç‚¹å‡»è¿”回始终跳转到账号列表页,实际应用时可返回上一页
    go('/LowCodePage');
  }
</script>
<style lang="less" scoped>
  .high-form {
    padding-bottom: 48px;
  }
</style>
src/views/tigerprojects/system/lowcode/setting/setting.data.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,92 @@
import { BasicColumn, FormSchema } from '/@/components/Table';
//列表显示
export const dtlColumns: BasicColumn[] = [
  {
    title: '字段名',
    dataIndex: 'FieldName',
    ifShow: false,
    width: 180,
  },
];
export const newFormSchema: FormSchema[] = [
  {
    field: 'ASSEMBLY_NAME',
    label: '实体类名',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: '00',
    component: 'Input',
    label: '1',
    colSlot: 'add',
    colProps: {
      span: 2,
    },
  },
  {
    field: '0',
    component: 'Input',
    label: '1',
    colSlot: 'condAdd',
    colProps: {
      span: 10,
    },
  },
];
export const crudSchemas: FormSchema[] = [
  {
    field: 'crudAssemblyName',
    label: '实体类名',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: '00',
    component: 'Input',
    label: '1',
    colSlot: 'add',
    colProps: {
      span: 2,
    },
  },
  {
    field: '0',
    component: 'Input',
    label: '1',
    colSlot: 'crudCondAdd',
    colProps: {
      span: 10,
    },
  },
];
export const mainSchemas: FormSchema[] = [
  {
    field: 'MainAssemblyName',
    label: '实体类名',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: '00',
    component: 'Input',
    label: '1',
    colSlot: 'add',
    colProps: {
      span: 2,
    },
  },
  {
    field: '0',
    component: 'Input',
    label: '1',
    colSlot: 'mainCondAdd',
    colProps: {
      span: 10,
    },
  },
];
types/config.d.ts
@@ -141,6 +141,7 @@
  title: string;
  // Service interface url
  apiUrl: string;
  sysApiUrl: string;
  taskApiUrl: string;
  // Upload url
  uploadUrl?: string;
@@ -156,6 +157,7 @@
  VITE_GLOB_APP_TITLE: string;
  // Service interface url
  VITE_GLOB_API_URL: string;
  VITE_GLOB_SYS_API_URL: string;
  VITE_GLOB_TSK_API_URL: string;
  // Service interface url prefix
  VITE_GLOB_API_URL_PREFIX?: string;