From 1e41a759d4b0ee5b6072e5bd45d9938591f90bc9 Mon Sep 17 00:00:00 2001 From: Cloud Zhang <941187371@qq.com> Date: 星期三, 22 五月 2024 20:21:06 +0800 Subject: [PATCH] 侧边框优化 --- src/api/tigerapi/mes/router.ts | 109 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 96 insertions(+), 13 deletions(-) diff --git a/src/api/tigerapi/mes/router.ts b/src/api/tigerapi/mes/router.ts index 8b14995..b815637 100644 --- a/src/api/tigerapi/mes/router.ts +++ b/src/api/tigerapi/mes/router.ts @@ -1,9 +1,10 @@ -import { ApiAction } from '../../model/baseModel'; -import { genAction } from '../system'; +import { ApiAction, ApiActionPage } from '../../model/baseModel'; +import { Api, genAction, genActionPage } from '../system'; import { defHttp } from '/@/utils/http/axios'; import { MES_ROUTE, RouteData } from '../model/router'; import { mesApi } from './mesApi'; import { useUserStore } from '/@/store/modules/user'; +import { RoutePageListGetResultModel, RoutelistPageParams } from '../model/mesModel'; /* * 鑾峰彇宸ヨ壓璺嚎鍒楄〃 @@ -49,14 +50,96 @@ ); return data; }; -//鍒犻櫎 -// export const DeleteOper = async (params: Recordable) => { -// const usParams = genAction('MES_OPERATION', [params]); -// return await defHttp.post( -// { url: Api.DeleteList, params: usParams }, -// { -// errorMessageMode: 'none', -// isTransformResponse: false, -// }, -// ); -// }; + +export const RouteTypeStatus = async () => { + const usParams = genAction('MES_ROUTE+ROT_TYPEs', ''); + return await defHttp.post( + { url: Api.urlQueryEnum, params: usParams }, + { + errorMessageMode: 'none', + isTransformResponse: false, + //apiUrl: globSetting.taskApiUrl + }, + ); +}; + +/* + * 鑾峰彇宸ヨ壓璺嚎鍒嗛〉鍒楄〃 + */ +export const getRouteListByPage = async (params: RoutelistPageParams) => { + let sqlcmd = ''; + if (params?.IS_ACTIVE != undefined && params?.IS_ACTIVE != '') { + sqlcmd += " And IS_ACTIVE = '" + params?.IS_ACTIVE + "'"; + } + if (params?.ROT_CODE != undefined && params?.ROT_CODE != '') { + sqlcmd += "And ROT_CODE like '%" + params?.ROT_CODE + "%'"; + } + if (params?.ROT_NAME != undefined && params?.ROT_NAME != '') { + sqlcmd += "And ROT_NAME like '%" + params?.ROT_NAME + "%'"; + } + const rParams = genActionPage('MES_ROUTE', sqlcmd, params.page, params.pageSize); + return getRoleListByPageAsync(rParams); +}; +async function getRoleListByPageAsync(params: ApiActionPage) { + const data = await defHttp.post<ApiActionPage>( + { url: Api.EntityPageList, params }, + { + isTransformResponse: false, + }, + ); + const model: RoutePageListGetResultModel = { + items: data.Data.data, + total: data.Data.totals, + }; + return model; +} + +/* + * 鍒犻櫎宸ヨ壓璺嚎 + */ +export const DeleteRoute = async (params: string) => { + const usParams = genAction('MES_ROUTE', params); + return await defHttp.post( + { url: mesApi.DeleteRoute, params: usParams }, + { + errorMessageMode: 'none', + isTransformResponse: false, + }, + ); +}; + +export const setRouteStatus = (params: MES_ROUTE) => + defHttp.post( + { url: Api.UpdateEntity, params: genAction('MES_ROUTE', params) }, + { + errorMessageMode: 'none', + isTransformResponse: false, + }, + ); + +/* + *琛屼负鐩稿叧 + */ +export const ActTypeStatus = async () => { + const usParams = genAction('MES_ROUTE_NODE_ACT+ACT_TYPEs', ''); + return await defHttp.post( + { url: Api.urlQueryEnum, params: usParams }, + { + errorMessageMode: 'none', + isTransformResponse: false, + //apiUrl: globSetting.taskApiUrl + }, + ); +}; + +export const DoTypeStatus = async () => { + const usParams = genAction('MES_ROUTE_NODE_ACT+DO_TYPEs', ''); + return await defHttp.post( + { url: Api.urlQueryEnum, params: usParams }, + { + errorMessageMode: 'none', + isTransformResponse: false, + //apiUrl: globSetting.taskApiUrl + }, + ); +}; -- Gitblit v1.9.3