import { ElMessage } from 'element-plus';
|
import request from '/@/utils/request';
|
/**
|
* @summary 获取策略
|
*/
|
export const GetLogicPolicyStd = async (req: any = request) => {
|
return req({
|
url: '/Phm/Logic/Policy/Std/GetAll@V1.0',
|
method: 'GET',
|
});
|
};
|
|
/**
|
* 调用接口,返回策略
|
* 报错时返回 undefined
|
* @returns
|
*/
|
export const getLogicPolicyStd = async (req: any = request) => {
|
const res = await GetLogicPolicyStd(req).catch(() => {
|
return undefined;
|
});
|
|
if (res?.Code === 0) {
|
const resData = (res.Data || []) as [];
|
return resData;
|
} else {
|
ElMessage.error('获取策略失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
|
return undefined;
|
}
|
};
|
|
/**
|
* @summary 获取默认的策略
|
*/
|
export const GetDefaultLogicPolicyStd = async (req: any = request) => {
|
return req({
|
url: '/Phm/Logic/Policy/Std/GetDefault@V1.0',
|
method: 'GET',
|
});
|
};
|
|
/**
|
* 获取默认的策略
|
* 报错时返回 undefined
|
* @returns
|
*/
|
export const getDefaultLogicPolicyStd = async (req: any = request) => {
|
const res = await GetDefaultLogicPolicyStd(req).catch(() => {
|
return undefined;
|
});
|
|
if (res?.Code === 0) {
|
const resData = res.Data as any;
|
return resData;
|
} else {
|
ElMessage.error('获取默认策略失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
|
return undefined;
|
}
|
};
|
|
/**
|
* @summary 获取区域
|
*/
|
export const GetLogicAreaByPolicyIDStd = async (params, req: any = request) => {
|
return req({
|
url: '/Phm/Logic/Area/Std/GetByPolicyID@V1.0',
|
method: 'GET',
|
params,
|
});
|
};
|
|
/**
|
* 调用接口,通过策略ID,返回区域
|
* 报错时返回 undefined
|
* @returns
|
*/
|
export const getLogicAreaByPolicyIDStd = async (params, req: any = request) => {
|
const res = await GetLogicAreaByPolicyIDStd(params, req).catch(() => {
|
return undefined;
|
});
|
|
if (res?.Code === 0) {
|
const resData = (res.Data || []) as [];
|
return resData;
|
} else {
|
ElMessage.error('获取区域失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
|
return undefined;
|
}
|
};
|