@zgfe/modules-settings 1.2.20 → 1.2.21

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.
@@ -0,0 +1,30 @@
1
+ .set-data-dialog {
2
+ .ant-card-head-title {
3
+ // display: none;
4
+ }
5
+
6
+ .group-config {
7
+ display: flex;
8
+ margin-top: 26px;
9
+
10
+ .config-name {
11
+ margin-right: 20px;
12
+ color: #5f6085;
13
+ font-size: 14px;
14
+ white-space: nowrap;
15
+ }
16
+
17
+ .ant-card {
18
+ width: 100%;
19
+ border: none;
20
+
21
+ .ant-card-head {
22
+ // display: none;
23
+ }
24
+
25
+ .biz-user-condition {
26
+ background-color: #fff;
27
+ }
28
+ }
29
+ }
30
+ }
@@ -9,6 +9,8 @@ export declare const queryRolePage: (data: {
9
9
  userIds: number[];
10
10
  menuCodeMap: {};
11
11
  settingMenuList: [];
12
+ authGroupList: [];
13
+ roleAuthStatus: number;
12
14
  }> | null>, queryRoleDataConfig: (data: {
13
15
  id: number | null;
14
16
  }) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, queryRoleMenuTree: (data: {
@@ -22,4 +24,10 @@ export declare const queryRolePage: (data: {
22
24
  id: number | null;
23
25
  }) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, deleteRole: (data: {
24
26
  id: number | null;
27
+ }) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, queryEventEnvDataApi: (data: {
28
+ id: number | null;
29
+ }) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, qeuryUserPropMetaApi: (data: {
30
+ id: number | null;
31
+ }) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, queryEventMetasOfGroupApi: (data: {
32
+ id: number | null;
25
33
  }) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>;
@@ -85,6 +85,31 @@ var Department = /*#__PURE__*/function () {
85
85
  data: data
86
86
  });
87
87
  }
88
+ // 事件
89
+ }, {
90
+ key: "queryEventEnvDataApi",
91
+ value: function queryEventEnvDataApi(data) {
92
+ return ajax(api.setting.queryEventEnvData, {
93
+ method: 'post',
94
+ data: data
95
+ });
96
+ }
97
+ }, {
98
+ key: "qeuryUserPropMetaApi",
99
+ value: function qeuryUserPropMetaApi(data) {
100
+ return ajax(api.setting.qeuryUserPropMeta, {
101
+ method: 'post',
102
+ data: data
103
+ });
104
+ }
105
+ }, {
106
+ key: "queryEventMetasOfGroupApi",
107
+ value: function queryEventMetasOfGroupApi(data) {
108
+ return ajax(api.setting.queryEventMetasOfGroup, {
109
+ method: 'post',
110
+ data: data
111
+ });
112
+ }
88
113
  }]);
89
114
  return Department;
90
115
  }();
@@ -96,5 +121,8 @@ var _Department = new Department(),
96
121
  queryCompanyUser = _Department.queryCompanyUser,
97
122
  addRole = _Department.addRole,
98
123
  updateRole = _Department.updateRole,
99
- deleteRole = _Department.deleteRole;
100
- export { queryRolePage, queryRoleDetails, queryRoleDataConfig, queryRoleMenuTree, queryCompanyUser, addRole, updateRole, deleteRole };
124
+ deleteRole = _Department.deleteRole,
125
+ queryEventEnvDataApi = _Department.queryEventEnvDataApi,
126
+ qeuryUserPropMetaApi = _Department.qeuryUserPropMetaApi,
127
+ queryEventMetasOfGroupApi = _Department.queryEventMetasOfGroupApi;
128
+ export { queryRolePage, queryRoleDetails, queryRoleDataConfig, queryRoleMenuTree, queryCompanyUser, addRole, updateRole, deleteRole, queryEventEnvDataApi, qeuryUserPropMetaApi, queryEventMetasOfGroupApi };
@@ -231,5 +231,6 @@ declare const util: {
231
231
  disabled: boolean | number;
232
232
  children: object[] | undefined;
233
233
  }[];
234
+ validateUserCondition(conditions: any[]): "" | "用户定义不能为空" | "事件不能为空" | "用户标签不能为空" | "明细数据不能为空" | "明细表不能为空" | "字段不能为空" | "筛选规则不能为空" | "筛选条件不能为空" | "值类型不能为空" | "用户属性不能为空" | "属性值不能为空" | "时间不能为空" | "次数不能为空" | "事件属性不能为空";
234
235
  };
235
236
  export default util;
package/es/utils/util.js CHANGED
@@ -721,6 +721,110 @@ var util = {
721
721
  newItem.children = (newItem === null || newItem === void 0 ? void 0 : newItem.children) && (newItem === null || newItem === void 0 ? void 0 : newItem.children.length) > 0 ? util.menuTreeData(newItem === null || newItem === void 0 ? void 0 : newItem.children) : undefined;
722
722
  return newItem;
723
723
  });
724
+ },
725
+ validateUserCondition: function validateUserCondition(conditions) {
726
+ if (!conditions.length) return '用户定义不能为空';
727
+ var _iterator2 = _createForOfIteratorHelper(conditions),
728
+ _step2;
729
+ try {
730
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
731
+ var orConditions = _step2.value;
732
+ if (!orConditions.length) return '用户定义不能为空';
733
+ var _iterator3 = _createForOfIteratorHelper(orConditions),
734
+ _step3;
735
+ try {
736
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
737
+ var orCondition = _step3.value;
738
+ if (orCondition.eventId === 0) return '事件不能为空';
739
+ if (orCondition.eventId === undefined) {
740
+ if (orCondition.labels) {
741
+ var _orCondition$labels$v;
742
+ if (((_orCondition$labels$v = orCondition.labels.values) === null || _orCondition$labels$v === void 0 ? void 0 : _orCondition$labels$v.length) === 0) return '用户标签不能为空';
743
+ } else if (orCondition.dataset) {
744
+ if (!orCondition.dataset.length) return '明细数据不能为空';
745
+ var _iterator4 = _createForOfIteratorHelper(orCondition.dataset),
746
+ _step4;
747
+ try {
748
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
749
+ var item = _step4.value;
750
+ if (!item || !item.datasetTable) return '明细表不能为空';
751
+ if (!item.fieldName) return '字段不能为空';
752
+ if (!item.operator) return '筛选规则不能为空';
753
+ if (!/^is null$|^is not null$/.test(item.operator) && !item.params.length) {
754
+ return '筛选条件不能为空';
755
+ }
756
+ }
757
+ } catch (err) {
758
+ _iterator4.e(err);
759
+ } finally {
760
+ _iterator4.f();
761
+ }
762
+ } else if (orCondition.data_set_csh) {
763
+ if (!orCondition.data_set_csh.length) return '明细数据不能为空';
764
+ var _iterator5 = _createForOfIteratorHelper(orCondition.data_set_csh),
765
+ _step5;
766
+ try {
767
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
768
+ var _item = _step5.value;
769
+ if (!_item || !_item.datasetTable) return '明细表不能为空';
770
+ if (!_item.fieldName) return '字段不能为空';
771
+ if (!_item.operator) return '筛选规则不能为空';
772
+ if (_item.subCondition) {
773
+ if (!_item.subCondition.datasetTable) return '明细表不能为空';
774
+ if (!_item.subCondition.fieldName) return '字段不能为空';
775
+ if (!_item.subCondition.operator) return '筛选规则不能为空';
776
+ if (!_item.subCondition.calculate) return '值类型不能为空';
777
+ }
778
+ if (!/^is null$|^is not null$/.test(_item.operator) && !(_item.params || _item.between && _item.between[0] && _item.between[1])) {
779
+ return '筛选条件不能为空';
780
+ }
781
+ }
782
+ } catch (err) {
783
+ _iterator5.e(err);
784
+ } finally {
785
+ _iterator5.f();
786
+ }
787
+ } else if (!orCondition.attrs.length || !orCondition.attrs[0].attrName) {
788
+ return '用户属性不能为空';
789
+ } else if (!/^is null$|^is not null$/.test(orCondition.attrs[0].operator) && !orCondition.attrs[0].params.length) {
790
+ return '属性值不能为空';
791
+ }
792
+ } else {
793
+ if (orCondition.runPeriod && orCondition.runPeriod.values && (!orCondition.runPeriod.values[0] || !orCondition.runPeriod.values[1])) {
794
+ return '时间不能为空';
795
+ }
796
+ if (orCondition.runTimes && !orCondition.runTimes.values[0]) {
797
+ return '次数不能为空';
798
+ }
799
+ if (orCondition.attrs) {
800
+ var _iterator6 = _createForOfIteratorHelper(orCondition.attrs),
801
+ _step6;
802
+ try {
803
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
804
+ var attr = _step6.value;
805
+ if (!attr.attrId && !attr.attrName) return '事件属性不能为空';
806
+ if (!attr.params.length && !/^is null$|^is not null$/.test(attr.operator)) return '属性值不能为空';
807
+ }
808
+ } catch (err) {
809
+ _iterator6.e(err);
810
+ } finally {
811
+ _iterator6.f();
812
+ }
813
+ }
814
+ }
815
+ }
816
+ } catch (err) {
817
+ _iterator3.e(err);
818
+ } finally {
819
+ _iterator3.f();
820
+ }
821
+ }
822
+ } catch (err) {
823
+ _iterator2.e(err);
824
+ } finally {
825
+ _iterator2.f();
826
+ }
827
+ return '';
724
828
  }
725
829
  };
726
830
  export default util;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-settings",
3
- "version": "1.2.20",
3
+ "version": "1.2.21",
4
4
  "module": "es/index.js",
5
5
  "typings": "es/index.d.ts",
6
6
  "files": [
@@ -51,7 +51,7 @@
51
51
  "umi-request": "^1.4.0",
52
52
  "yorkie": "^2.0.0"
53
53
  },
54
- "gitHead": "63405c164be35af509a55cb6e5444be77867fad3",
54
+ "gitHead": "517512432eafe3a7cdec5cfbef4eff8d644c39d5",
55
55
  "gitHooks": {
56
56
  "pre-commit": "lint-staged"
57
57
  }