| | |
| | | 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'; |
| | |
| | | LoginLogPageListGetResultModel, |
| | | iSYS_ROLE_ORG, |
| | | iSYS_ROLE_WH, |
| | | EntityParams, |
| | | EntityList, |
| | | } from './model/systemModel'; |
| | | import { defHttp } from '/@/utils/http/axios'; |
| | | import { isNullOrEmpty } from '/@/utils/is'; |
| | |
| | | //导入 |
| | | ValidateTableImport = '/SMT/ValidateTableImport', |
| | | SaveValidateTableImport = '/SMT/SaveValidateTableImport', |
| | | GetEntityNameList = '/System/Entitys/Get', |
| | | } |
| | | |
| | | const globSetting = useGlobSetting(); |
| | | |
| | | /** |
| | | * 生成apiaction,带分页 |
| | |
| | | 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, |
| | | }, |
| | | ); |
| | | }; |