@zgfe/modules-page 1.0.1-alpha.16 → 1.0.1-alpha.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BizSelectTypes } from '@zgfe/business-lib';
|
|
1
|
+
import { AttrConditionTypes, BizSelectTypes } from '@zgfe/business-lib';
|
|
2
2
|
import { FormValue, SearchValue } from './types';
|
|
3
3
|
export declare const formValue: (source?: SearchValue, userGroupList?: BizSelectTypes.Option[]) => FormValue;
|
|
4
4
|
export declare const formatValue: (source: FormValue) => {
|
|
@@ -6,5 +6,5 @@ export declare const formatValue: (source: FormValue) => {
|
|
|
6
6
|
pageTitle: string | undefined;
|
|
7
7
|
pageUrl: string | undefined;
|
|
8
8
|
pageGroup: number | undefined;
|
|
9
|
-
filters:
|
|
9
|
+
filters: AttrConditionTypes.GroupValue | undefined;
|
|
10
10
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { util } from '@zgfe/business-lib';
|
|
2
2
|
import _ from 'lodash';
|
|
3
|
+
import { OperateTypes } from '@zgfe/business-lib/es/attrConditions/types';
|
|
3
4
|
export var formValue = function formValue(source, userGroupList) {
|
|
4
5
|
var data = _.cloneDeep(source) || {};
|
|
5
6
|
// 用户群变形
|
|
@@ -39,7 +40,7 @@ export var formatValue = function formatValue(source) {
|
|
|
39
40
|
item.forEach(function (cItem) {
|
|
40
41
|
var name = '';
|
|
41
42
|
if (!cItem || !cItem.length) return;
|
|
42
|
-
name = "".concat(cItem[1].id, ":").concat(cItem[2].
|
|
43
|
+
name = "".concat(cItem[1].id, ":").concat(cItem[2].layerLabelId);
|
|
43
44
|
childGroup.push(name);
|
|
44
45
|
});
|
|
45
46
|
group.push(childGroup);
|
|
@@ -48,11 +49,42 @@ export var formatValue = function formatValue(source) {
|
|
|
48
49
|
group.push(item.id);
|
|
49
50
|
}
|
|
50
51
|
});
|
|
52
|
+
var filters = undefined;
|
|
53
|
+
if (data.filters) {
|
|
54
|
+
var conditions = getConditionList(data.filters.conditions);
|
|
55
|
+
if (conditions) {
|
|
56
|
+
filters = {
|
|
57
|
+
conditions: conditions,
|
|
58
|
+
relation: 'and'
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
51
62
|
return {
|
|
52
63
|
userGroup: group.length ? group : [0],
|
|
53
64
|
pageTitle: (_data$page = data.page) === null || _data$page === void 0 ? void 0 : _data$page.pageTitle,
|
|
54
65
|
pageUrl: (_data$page2 = data.page) === null || _data$page2 === void 0 ? void 0 : _data$page2.pageUrl,
|
|
55
66
|
pageGroup: (_data$page3 = data.page) === null || _data$page3 === void 0 ? void 0 : _data$page3.pageGroup,
|
|
56
|
-
filters:
|
|
67
|
+
filters: filters
|
|
57
68
|
};
|
|
58
|
-
};
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 筛选条件当未选择值时,不查询
|
|
73
|
+
* @param condition 筛选条件数组
|
|
74
|
+
* @returns
|
|
75
|
+
*/
|
|
76
|
+
function getConditionList(condition) {
|
|
77
|
+
if (!condition) return;
|
|
78
|
+
var conditionList = [];
|
|
79
|
+
condition.forEach(function (item) {
|
|
80
|
+
if (!item.attrId && !item.attrName) return;
|
|
81
|
+
if (!item.values || !item.values.length) {
|
|
82
|
+
if (item.operator === OperateTypes.IsNotNull || item.operator === OperateTypes.IsNull) {
|
|
83
|
+
conditionList.push(item);
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
conditionList.push(item);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
return conditionList.length ? conditionList : undefined;
|
|
90
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-page",
|
|
3
|
-
"version": "1.0.1-alpha.
|
|
3
|
+
"version": "1.0.1-alpha.17",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@types/lodash": "^4.14.197",
|
|
40
40
|
"@umijs/fabric": "^2.8.1",
|
|
41
41
|
"@umijs/test": "^3.0.5",
|
|
42
|
-
"@zgfe/business-lib": "1.1.81-page.
|
|
42
|
+
"@zgfe/business-lib": "1.1.81-page.3",
|
|
43
43
|
"antd": "^4.22.6",
|
|
44
44
|
"dumi": "^1.1.0",
|
|
45
45
|
"father": "^4.0.0-rc.2",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"prettier": "^2.2.1",
|
|
51
51
|
"yorkie": "^2.0.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "ec25eecbfc957817643b49e2df5d8f03e14463e4"
|
|
54
54
|
}
|