From cba73428d36a0e0b0f66394f29715b430808de3d Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期三, 29 五月 2024 00:25:49 +0800 Subject: [PATCH] 一些优化 --- src/api/tigerapi/system.ts | 81 +++++++++++++++++++++++++++------------- 1 files changed, 54 insertions(+), 27 deletions(-) diff --git a/src/api/tigerapi/system.ts b/src/api/tigerapi/system.ts index 579e8b0..b92ba55 100644 --- a/src/api/tigerapi/system.ts +++ b/src/api/tigerapi/system.ts @@ -1,7 +1,7 @@ import { UserConfigFn } from 'vite'; import { buildUUID } from '../../utils/uuid'; import { DateFormat } from '../../utils/dataformat'; -import { ApiAction,ApiActionJob, ApiActionPage } from '../model/baseModel'; +import { ApiAction, ApiActionJob, ApiActionPage } from '../model/baseModel'; import { MenuParams, RoleParams, @@ -27,7 +27,6 @@ iSYS_ROLE_WH, } from './model/systemModel'; import { defHttp } from '/@/utils/http/axios'; -import { isUnDef } from '/@/utils/is'; export enum Api { QueryUrl = '/Base/Query', @@ -49,7 +48,7 @@ GetOrgTreeList = '/SYS/getOrgTreeList', GetHouseTreeList = '/WMS/GetHouseModel', GetHouseOrgTreeList = '/WMS/GetHouseModelOrg', - GetCreateBillCode = '/WMS/CreateBillCode', + GetCreateBillCode = '/WMS/CreateBillCode', GetCreateTFBillCode = '/WMS/CreateTFBillCode', GetAllRoleList = '/system/getAllRoleList', urlSetSysUserToGroup = '/SYS/SetSysUserToGroup', @@ -57,22 +56,25 @@ StartJob = '/Tsk/StartJob', StopJob = '/Tsk/PauseJob', AddJob = '/Tsk/AddJob', - UpdateJob= '/Tsk/UpdateJob', - urlQueryEnum= '/Base/QueryEnum', - DeleteWareHouse='/WMS/DelWareHouseModel', - AddLocation='/WMS/AddLoctionModel', - CheckLocation='/WMS/CheckLocation', - SummaryCount='/WMS/SummaryCount', - GenerateCount='/WMS/GenerateCount', - GetUpdateOrg='/WMS/GetUpdateOrg', - GetQrCode='/WMS/Item/GetQRCode', - UpdateReq='/WMS/UpdateReq', - MaterialResale='/WMS/MaterialResale', - GetProdctResult='/WMS/ProductInput/GetProdctResult', + UpdateJob = '/Tsk/UpdateJob', + urlQueryEnum = '/Base/QueryEnum', + DeleteWareHouse = '/WMS/DelWareHouseModel', + AddLocation = '/WMS/AddLoctionModel', + CheckLocation = '/WMS/CheckLocation', + SummaryCount = '/WMS/SummaryCount', + GenerateCount = '/WMS/GenerateCount', + GetUpdateOrg = '/WMS/GetUpdateOrg', + GetQrCode = '/WMS/Item/GetQRCode', + UpdateReq = '/WMS/UpdateReq', + MaterialResale = '/WMS/MaterialResale', + GetProdctResult = '/WMS/ProductInput/GetProdctResult', // 瀹屽伐鍏ュ簱鐘舵�佽繕鍘� GetStatusRestored = '/WMS/ProductInput/StatusRestored', // 鎵归噺鏇存柊鍐呭 - GetUpdateTime = '/MaterialInfo/UpdateTime' + GetUpdateTime = '/MaterialInfo/UpdateTime', + //瀵煎叆 + ValidateTableImport = '/SMT/ValidateTableImport', + SaveValidateTableImport = '/SMT/SaveValidateTableImport', } /** @@ -83,12 +85,18 @@ * @param pageSize * @returns */ -export function genActionPage(datatype: string, sqlcmd: string, page: number, pageSize: number,option?:object) { +export function genActionPage( + datatype: string, + sqlcmd: string, + page: number, + pageSize: number, + option?: object, +) { const time = new Date(); const params: ApiActionPage = { id: buildUUID(), dataType: datatype, - Options:option, + Options: option, isAsync: true, timestamp: time.toDateString(), isSuccessed: true, @@ -113,12 +121,12 @@ /* * 鐢熸垚Action */ -export function genAction<T>(datatype: string, data: T,option?:object) { +export function genAction<T>(datatype: string, data: T, option?: object) { const time = new Date(); const params: ApiAction<T> = { ID: buildUUID(), - DataAssembly:'', - Options:option, + DataAssembly: '', + Options: option, DataType: datatype, IsAsync: true, Timestamp: time.toDateString(), @@ -126,14 +134,21 @@ Message: '', StatusCode: 0, Data: data, + LocaleMsg: undefined, }; return params; } -export function genActionjob<sting>(datatype: string, assembly: string, data: string,timeone:number,remark:string) { +export function genActionjob<sting>( + datatype: string, + assembly: string, + data: string, + timeone: number, + remark: string, +) { const time = new Date(); const params: ApiActionJob<string> = { ID: buildUUID(), - DataAssembly:assembly, + DataAssembly: assembly, DataType: datatype, IsAsync: true, Timestamp: time.toDateString(), @@ -141,9 +156,9 @@ Message: '', StatusCode: 0, Data: { - jobName:data, - period:timeone, - remark: remark + jobName: data, + period: timeone, + remark: remark, }, }; return params; @@ -491,7 +506,7 @@ }, ); - export const setBasStatus = (params: any) => +export const setBasStatus = (params: any) => defHttp.post( { url: Api.UpdateEntity, params: genAction('BAS_ITEM', params) }, { @@ -613,3 +628,15 @@ }; return model; } + +export const GetEnum = async (enumName: { name: string }) => { + const usParams = genAction(enumName.name, ''); + return await defHttp.post( + { url: Api.urlQueryEnum, params: usParams }, + { + errorMessageMode: 'none', + isTransformResponse: false, + //apiUrl: globSetting.taskApiUrl + }, + ); +}; -- Gitblit v1.9.3