wujingjing
2024-04-22 f106e4dffb8279cb90726e83e7edd631f4c77699
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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;
    }
};