import { ElMessage } from 'element-plus';
|
import request from '/@/utils/request';
|
/**
|
* @summary 通过策略ID,获取清单数据(树结构)
|
*/
|
export const GetLogicTreeListByPolicyIDStd = async (params, req: any = request) => {
|
return req({
|
url: '/Phm/Logic/Tree/Std/GetTreeListByPolicyID@V1.0',
|
method: 'GET',
|
params,
|
});
|
};
|
|
/**
|
* 通过策略ID,获取清单数据(树结构)
|
* 报错时返回 undefined
|
* @returns
|
*/
|
export const getLogicTreeListByPolicyIDStd = async (params, req: any = request) => {
|
const res = await GetLogicTreeListByPolicyIDStd(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;
|
}
|
};
|
|
/**
|
* @summary 通过策略ID,获取清单数据(列表结构,ParentID)
|
*/
|
export const GetLogicTreeItemListByPolicyIDStd = async (params, req: any = request) => {
|
return req({
|
url: '/Phm/Logic/Tree/Std/GetTreeItemListByPolicyID@V1.0',
|
method: 'GET',
|
params,
|
});
|
};
|
|
/**
|
* 通过策略ID,获取清单数据(列表结构,ParentID)
|
* 报错时返回 undefined
|
* @returns
|
*/
|
export const getLogicTreeItemListByPolicyIDStd = async (params, req: any = request) => {
|
const res = await GetLogicTreeItemListByPolicyIDStd(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;
|
}
|
};
|