BIP树形表格的参照过滤
{ "code": 200, "message": "操作成功", "data": [ { "orgtype": 1, "parent": "", "code": "1", "level": 1, "sort": 1, "isEnd": 0, "shortname": "中国三峡集团", "innercode": "ETJP", "orgid": "0707202206301001", "vid": "0707202206301001", "path": "0707202206301001|", "children": [ { "orgtype": 2, "parent": "0707202206301001", "code": "101", "level": 2, "sort": 1, "isEnd": 1, "innercode": "ETJPHIOO", "orgid": "1001AA100000000109BN", "vid": "1001AA100000000109BN", "path": "0707202206301001|1001AA100000000109BN|", "enable": 1, "codename": "集团公司领导", "name": "集团公司领导", "parent_code": "1", "id": "1001AA100000000109BN", "isbizunit": 1, "pubts": "2023-11-30 17:23:23" }, { "orgtype": 2, "parent": "0707202206301001", "code": "135", "level": 2, "sort": 99999, "isEnd": 0, "innercode": "ETJPMSNH", "orgid": "1001A11000000010Y1SZ", "vid": "1001A11000000010Y1SZ", "path": "0707202206301001|1001A11000000010Y1SZ|", "children": [ { "orgtype": 2, "parent": "1001A11000000010Y1SZ", "code": "13502", "level": 3, "sort": 99999, "isEnd": 1, "shortname": "湖南分公司市场发展部", "innercode": "ETJPMSNHUB95", "orgid": "1001A11000000013577Z", "vid": "1001A11000000013577Z", "path": "0707202206301001|1001A11000000010Y1SZ|1001A11000000013577Z|", "enable": 1, "codename": "湖南分公司市场发展部", "name": "湖南分公司市场发展部", "parent_code": "135", "id": "1001A11000000013577Z", "isbizunit": 1, "pubts": "2023-12-06 09:07:43" }, { "orgtype": 2, "parent": "1001A11000000010Y1SZ", "code": "13503", "level": 3, "sort": 99999, "isEnd": 1, "innercode": "ETJPMSNHQT6H", "orgid": "1001A110000000135782", "vid": "1001A110000000135782", "path": "0707202206301001|1001A11000000010Y1SZ|1001A110000000135782|", "enable": 1, "codename": "湖南分公司党群工作部(纪检工作部)", "name": "湖南分公司党群工作部(纪检工作部)", "parent_code": "135", "id": "1001A110000000135782", "isbizunit": 1, "pubts": "2023-11-30 17:32:11" }, { "orgtype": 2, "parent": "1001A11000000010Y1SZ", "code": "13507", "level": 3, "sort": 999999, "isEnd": 1, "innercode": "ETJPMSNHEGN1", "vid": "1877997892350246915", "path": "0707202206301001|1001A11000000010Y1SZ|1877997892350246915|", "enable": 1, "codename": "湖南分公司2", "name": "湖南分公司2", "parent_code": "135", "id": "1877997892350246915", "isbizunit": 1, "pubts": "2023-12-06 10:26:07" } ], "enable": 1, "codename": "湖南分公司", "name": "湖南分公司", "parent_code": "1", "id": "1001A11000000010Y1SZ", "isbizunit": 1, "pubts": "2023-11-30 17:25:08" }, { "orgtype": 2, "parent": "0707202206301001", "code": "136", "level": 2, "sort": 99999, "isEnd": 0, "innercode": "ETJPURJY", "orgid": "1001A11000000011DCMX", "vid": "1001A11000000011DCMX", "path": "0707202206301001|1001A11000000011DCMX|", "children": [ { "orgtype": 2, "parent": "1001A11000000011DCMX", "code": "13601", "level": 3, "sort": 99999, "isEnd": 1, "innercode": "ETJPURJYQOG2", "orgid": "1001A11000000013577H", "vid": "1001A11000000013577H", "path": "0707202206301001|1001A11000000011DCMX|1001A11000000013577H|", "enable": 1, "codename": "贵州分公司综合管理部", "name": "贵州分公司综合管理部", "parent_code": "136", "id": "1001A11000000013577H", "isbizunit": 1, "pubts": "2023-11-30 17:45:46" }, { "orgtype": 2, "parent": "1001A11000000011DCMX", "code": "13602", "level": 3, "sort": 99999, "isEnd": 1, "innercode": "ETJPURJYQL6I", "orgid": "1001A11000000013577K", "vid": "1001A11000000013577K", "path": "0707202206301001|1001A11000000011DCMX|1001A11000000013577K|", "enable": 1, "codename": "贵州分公司市场发展部", "name": "贵州分公司市场发展部", "parent_code": "136", "id": "1001A11000000013577K", "isbizunit": 1, "pubts": "2023-11-30 17:45:46" }, { "orgtype": 2, "parent": "1001A11000000011DCMX", "code": "13603", "level": 3, "sort": 99999, "isEnd": 1, "innercode": "ETJPURJYVBHH", "orgid": "1001A11000000013577Q", "vid": "1001A11000000013577Q", "path": "0707202206301001|1001A11000000011DCMX|1001A11000000013577Q|", "enable": 1, "codename": "贵州分公司党群工作部(纪检工作部)", "name": "贵州分公司党群工作部(纪检工作部)", "parent_code": "136", "id": "1001A11000000013577Q", "isbizunit": 1, "pubts": "2023-11-30 17:45:46" } ], "enable": 1, "codename": "贵州分公司", "name": "贵州分公司", "parent_code": "1", "id": "1001A11000000011DCMX", "isbizunit": 1, "pubts": "2023-11-30 17:25:20" } ], "enable": 1, "codename": "中国长江三峡集团有限公司", "name": "中国长江三峡集团有限公司", "id": "0707202206301001", "isbizunit": 1, "pubts": "2023-09-30 09:34:16" }, ], "traceId": "00e4255866eba74f" }
viewModel .get("placesdownentity_1898089337058230276") .on("beforeBrowse", function (arg) { debugger; if (arg.cellName == "item25ki_name") { let orgIdr = orgId ? orgId : ""; // let value = []; // value.push(orgIdr); var condition = { isExtend: true, simpleVOs: [ { field: "path", op: "like", value1: orgIdr //'1001A11000000010Y1SZ', }, ], }; arg.context.setTreeFilter(condition); //arg.context.setFilter(condition); return true; } });
复制参照返回的数据,找规律,发现有个path属性。 根据这个path属性进行过滤。 使用like属性。 (父组件传递参数数据给子组件 组织id)
setTreeFilter 是树形参照
setFilter 是表格参照
实现这种效果
vendorextends!lifecycleStatus_name 将 ! 和_ 感叹号和下划线改为.
vendorextends.lifecycleStatus.name
案例 如下
//浏览前事件 组织参照过滤 viewModel.get("adjustpricedetail").on("beforeBrowse", function(arg) { debugger; if (arg.cellName == "vendorCode") { let orgId = "潜在"; let value = []; value.push(orgId); // value.push("1"); // value.push("2"); // value.push("0"); var condition = { isExtend: true, simpleVOs: [{ field: "vendorextends.lifecycleStatus.name", op: "neq", value1: '潜在' // value1: value }, ], }; arg.context.setFilter(condition); return true; } });