@byteluck-fe/model-driven-shared 2.7.0-alpha.0 → 2.7.0-alpha.4
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.
- package/dist/esm/EventLogic.js +85 -72
- package/dist/esm/RulesMessage.js +18 -5
- package/dist/esm/calc.js +43 -12
- package/dist/esm/constant.js +1 -1
- package/dist/esm/entity/Department.js +25 -5
- package/dist/esm/entity/User.js +79 -5
- package/dist/esm/entity/index.js +2 -2
- package/dist/esm/enum.js +133 -129
- package/dist/esm/genNonDuplicateId.js +3 -3
- package/dist/esm/index.js +13 -13
- package/dist/esm/locales/index.js +3 -3
- package/dist/esm/log.js +17 -17
- package/dist/esm/loopControls.js +3 -3
- package/dist/esm/updateValueFromKeys.js +3 -3
- package/dist/esm/utils.js +14 -14
- package/dist/esm/watcher.js +215 -99
- package/dist/index.umd.js +1 -1
- package/dist/types/EventLogic.d.ts +1 -1
- package/dist/types/RulesMessage.d.ts +3 -3
- package/dist/types/enum.d.ts +3 -1
- package/package.json +2 -2
package/dist/esm/EventLogic.js
CHANGED
|
@@ -17,123 +17,136 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
|
17
17
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
18
|
return Constructor;
|
|
19
19
|
}
|
|
20
|
+
function _defineProperty(obj, key, value) {
|
|
21
|
+
if (key in obj) {
|
|
22
|
+
Object.defineProperty(obj, key, {
|
|
23
|
+
value: value,
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true
|
|
27
|
+
});
|
|
28
|
+
} else {
|
|
29
|
+
obj[key] = value;
|
|
30
|
+
}
|
|
31
|
+
return obj;
|
|
32
|
+
}
|
|
20
33
|
// type InnerEventCode = 'click' | 'click-finish' | 'change'
|
|
21
34
|
var eventMap = [
|
|
22
35
|
{
|
|
23
|
-
key:
|
|
24
|
-
name:
|
|
25
|
-
code:
|
|
36
|
+
key: "on_click",
|
|
37
|
+
name: "点击时",
|
|
38
|
+
code: "click"
|
|
26
39
|
},
|
|
27
40
|
{
|
|
28
|
-
key:
|
|
29
|
-
name:
|
|
30
|
-
code:
|
|
41
|
+
key: "on_click_finish",
|
|
42
|
+
name: "执行完成时",
|
|
43
|
+
code: "click-finish"
|
|
31
44
|
},
|
|
32
45
|
{
|
|
33
|
-
key:
|
|
34
|
-
name:
|
|
35
|
-
code:
|
|
46
|
+
key: "on_change",
|
|
47
|
+
name: "值发生变化时",
|
|
48
|
+
code: "change"
|
|
36
49
|
},
|
|
37
50
|
{
|
|
38
|
-
key:
|
|
39
|
-
name:
|
|
40
|
-
code:
|
|
51
|
+
key: "on_search",
|
|
52
|
+
name: "搜索时",
|
|
53
|
+
code: "search"
|
|
41
54
|
},
|
|
42
55
|
{
|
|
43
|
-
key:
|
|
44
|
-
name:
|
|
45
|
-
code:
|
|
56
|
+
key: "on_list_change",
|
|
57
|
+
name: "列表数据变化时",
|
|
58
|
+
code: "list-change"
|
|
46
59
|
},
|
|
47
60
|
{
|
|
48
|
-
key:
|
|
49
|
-
name:
|
|
50
|
-
code:
|
|
61
|
+
key: "on_list_search",
|
|
62
|
+
name: "列表数据查询构建时",
|
|
63
|
+
code: "list-search"
|
|
51
64
|
},
|
|
52
65
|
{
|
|
53
|
-
key:
|
|
54
|
-
name:
|
|
55
|
-
code:
|
|
66
|
+
key: "on_list_mounted",
|
|
67
|
+
name: "列表数据返回时",
|
|
68
|
+
code: "list-mounted"
|
|
56
69
|
},
|
|
57
70
|
{
|
|
58
|
-
key:
|
|
59
|
-
name:
|
|
60
|
-
code:
|
|
71
|
+
key: "on_list_delete",
|
|
72
|
+
name: "列表数据删除时",
|
|
73
|
+
code: "list-delete"
|
|
61
74
|
},
|
|
62
75
|
{
|
|
63
|
-
key:
|
|
64
|
-
name:
|
|
65
|
-
code:
|
|
76
|
+
key: "on_list_before_insert",
|
|
77
|
+
name: "列表数据插入前",
|
|
78
|
+
code: "list-before-insert"
|
|
66
79
|
},
|
|
67
80
|
{
|
|
68
|
-
key:
|
|
69
|
-
name:
|
|
70
|
-
code:
|
|
81
|
+
key: "on_input",
|
|
82
|
+
name: "用户输入时",
|
|
83
|
+
code: "input"
|
|
71
84
|
},
|
|
72
85
|
{
|
|
73
|
-
key:
|
|
74
|
-
name:
|
|
75
|
-
code:
|
|
86
|
+
key: "on_blur",
|
|
87
|
+
name: "失去焦点时",
|
|
88
|
+
code: "blur"
|
|
76
89
|
},
|
|
77
90
|
{
|
|
78
|
-
key:
|
|
79
|
-
name:
|
|
80
|
-
code:
|
|
91
|
+
key: "on_focus",
|
|
92
|
+
name: "获取焦点时",
|
|
93
|
+
code: "focus"
|
|
81
94
|
},
|
|
82
95
|
{
|
|
83
|
-
key:
|
|
84
|
-
name:
|
|
85
|
-
code:
|
|
96
|
+
key: "on_wps_open",
|
|
97
|
+
name: "打开文件时",
|
|
98
|
+
code: "wps-open"
|
|
86
99
|
},
|
|
87
100
|
{
|
|
88
|
-
key:
|
|
89
|
-
name:
|
|
90
|
-
code:
|
|
101
|
+
key: "on_wps_save",
|
|
102
|
+
name: "保存文件时",
|
|
103
|
+
code: "wps-save"
|
|
91
104
|
},
|
|
92
105
|
{
|
|
93
|
-
key:
|
|
94
|
-
name:
|
|
95
|
-
code:
|
|
106
|
+
key: "on_wps_rename",
|
|
107
|
+
name: "重命名时",
|
|
108
|
+
code: "wps-rename"
|
|
96
109
|
},
|
|
97
110
|
{
|
|
98
|
-
key:
|
|
99
|
-
name:
|
|
100
|
-
code:
|
|
111
|
+
key: "on_list_actions",
|
|
112
|
+
name: "点击操作按钮时",
|
|
113
|
+
code: "list-actions"
|
|
101
114
|
},
|
|
102
115
|
{
|
|
103
|
-
key:
|
|
104
|
-
name:
|
|
105
|
-
code:
|
|
116
|
+
key: "on_list_render_operation",
|
|
117
|
+
name: "操作列渲染时",
|
|
118
|
+
code: "list-render-operation"
|
|
106
119
|
},
|
|
107
120
|
{
|
|
108
|
-
key:
|
|
109
|
-
name:
|
|
110
|
-
code:
|
|
121
|
+
key: "on_list_rowclick",
|
|
122
|
+
name: "行点击时",
|
|
123
|
+
code: "list-rowclick"
|
|
111
124
|
},
|
|
112
125
|
{
|
|
113
|
-
key:
|
|
114
|
-
name:
|
|
115
|
-
code:
|
|
126
|
+
key: "on_list_before_rowdelete",
|
|
127
|
+
name: "行删除前",
|
|
128
|
+
code: "list-before-rowdelete"
|
|
116
129
|
},
|
|
117
130
|
{
|
|
118
|
-
key:
|
|
119
|
-
name:
|
|
120
|
-
code:
|
|
131
|
+
key: "on_list_before_import",
|
|
132
|
+
name: "列表数据导入前",
|
|
133
|
+
code: "list-before-import"
|
|
121
134
|
},
|
|
122
135
|
{
|
|
123
|
-
key:
|
|
124
|
-
name:
|
|
125
|
-
code:
|
|
136
|
+
key: "on_list_rows_checked",
|
|
137
|
+
name: "行选中时",
|
|
138
|
+
code: "list-rows-checked"
|
|
126
139
|
},
|
|
127
140
|
{
|
|
128
|
-
key:
|
|
129
|
-
name:
|
|
130
|
-
code:
|
|
141
|
+
key: "on_change_tab",
|
|
142
|
+
name: "标签页切换时",
|
|
143
|
+
code: "change-tab"
|
|
131
144
|
},
|
|
132
145
|
{
|
|
133
|
-
key:
|
|
134
|
-
name:
|
|
135
|
-
code:
|
|
136
|
-
}
|
|
146
|
+
key: "on_modal_ok",
|
|
147
|
+
name: "弹窗确认时",
|
|
148
|
+
code: "modal-ok"
|
|
149
|
+
}
|
|
137
150
|
];
|
|
138
151
|
export var EventLogic = /*#__PURE__*/ function() {
|
|
139
152
|
"use strict";
|
|
@@ -144,7 +157,7 @@ export var EventLogic = /*#__PURE__*/ function() {
|
|
|
144
157
|
{
|
|
145
158
|
key: "getEventsFromKeys",
|
|
146
159
|
value: function getEventsFromKeys(keys) {
|
|
147
|
-
var eventKeys = typeof keys ===
|
|
160
|
+
var eventKeys = typeof keys === "string" ? [
|
|
148
161
|
keys
|
|
149
162
|
] : keys;
|
|
150
163
|
return EventLogic.events.filter(function(item) {
|
|
@@ -155,4 +168,4 @@ export var EventLogic = /*#__PURE__*/ function() {
|
|
|
155
168
|
]);
|
|
156
169
|
return EventLogic;
|
|
157
170
|
}();
|
|
158
|
-
EventLogic
|
|
171
|
+
_defineProperty(EventLogic, "events", eventMap);
|
package/dist/esm/RulesMessage.js
CHANGED
|
@@ -17,9 +17,22 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
|
17
17
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
18
|
return Constructor;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
function _defineProperty(obj, key, value) {
|
|
21
|
+
if (key in obj) {
|
|
22
|
+
Object.defineProperty(obj, key, {
|
|
23
|
+
value: value,
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true
|
|
27
|
+
});
|
|
28
|
+
} else {
|
|
29
|
+
obj[key] = value;
|
|
30
|
+
}
|
|
31
|
+
return obj;
|
|
32
|
+
}
|
|
33
|
+
import OkI18n from "ok-i18n";
|
|
34
|
+
import messages from "./locales";
|
|
35
|
+
import { DEFAULT_LOCALE } from "./constant";
|
|
23
36
|
export var RulesMessage = /*#__PURE__*/ function() {
|
|
24
37
|
"use strict";
|
|
25
38
|
function RulesMessage() {
|
|
@@ -30,7 +43,7 @@ export var RulesMessage = /*#__PURE__*/ function() {
|
|
|
30
43
|
key: "getMessage",
|
|
31
44
|
value: function getMessage(messageKey) {
|
|
32
45
|
var variable = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
33
|
-
return this.$i18n.$t(messageKey,
|
|
46
|
+
return this.$i18n.$t(messageKey, "", variable);
|
|
34
47
|
}
|
|
35
48
|
},
|
|
36
49
|
{
|
|
@@ -52,4 +65,4 @@ export var RulesMessage = /*#__PURE__*/ function() {
|
|
|
52
65
|
]);
|
|
53
66
|
return RulesMessage;
|
|
54
67
|
}();
|
|
55
|
-
RulesMessage
|
|
68
|
+
_defineProperty(RulesMessage, "$i18n", RulesMessage.resetI18n());
|
package/dist/esm/calc.js
CHANGED
|
@@ -3,6 +3,19 @@ function _classCallCheck(instance, Constructor) {
|
|
|
3
3
|
throw new TypeError("Cannot call a class as a function");
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
|
+
function _defineProperty(obj, key, value) {
|
|
7
|
+
if (key in obj) {
|
|
8
|
+
Object.defineProperty(obj, key, {
|
|
9
|
+
value: value,
|
|
10
|
+
enumerable: true,
|
|
11
|
+
configurable: true,
|
|
12
|
+
writable: true
|
|
13
|
+
});
|
|
14
|
+
} else {
|
|
15
|
+
obj[key] = value;
|
|
16
|
+
}
|
|
17
|
+
return obj;
|
|
18
|
+
}
|
|
6
19
|
export var CALC_TOKEN_TYPE;
|
|
7
20
|
(function(CALC_TOKEN_TYPE) {
|
|
8
21
|
CALC_TOKEN_TYPE[/**
|
|
@@ -45,16 +58,34 @@ export var CALC_AGGREGATE_TYPE;
|
|
|
45
58
|
export var CalcScriptEchoItem = function CalcScriptEchoItem(props) {
|
|
46
59
|
"use strict";
|
|
47
60
|
_classCallCheck(this, CalcScriptEchoItem);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
/**
|
|
62
|
+
* 变量名称或者公式符号或者数值
|
|
63
|
+
* */ _defineProperty(this, "name", void 0);
|
|
64
|
+
/**
|
|
65
|
+
* 如果是变量的话,id为控件id
|
|
66
|
+
* */ _defineProperty(this, "id", void 0);
|
|
67
|
+
/**
|
|
68
|
+
* 当前值的类型
|
|
69
|
+
* */ _defineProperty(this, "type", void 0);
|
|
70
|
+
/**
|
|
71
|
+
* 绑定的是明细子表变量时,必须有subTableId
|
|
72
|
+
* */ _defineProperty(this, "subTableId", void 0);
|
|
73
|
+
/**
|
|
74
|
+
* 绑定的是明细子表内变量时,必须有subTableName
|
|
75
|
+
* */ _defineProperty(this, "subTableName", void 0);
|
|
76
|
+
/**
|
|
77
|
+
* 绑定的是其它明细子表内变量时,必须有aggregateType
|
|
78
|
+
* */ _defineProperty(this, "aggregateType", void 0);
|
|
79
|
+
var _props_name;
|
|
80
|
+
this.name = (_props_name = props === null || props === void 0 ? void 0 : props.name) !== null && _props_name !== void 0 ? _props_name : "";
|
|
81
|
+
var _props_id;
|
|
82
|
+
this.id = (_props_id = props === null || props === void 0 ? void 0 : props.id) !== null && _props_id !== void 0 ? _props_id : "";
|
|
83
|
+
var _props_type;
|
|
84
|
+
this.type = (_props_type = props === null || props === void 0 ? void 0 : props.type) !== null && _props_type !== void 0 ? _props_type : CALC_TOKEN_TYPE.Number;
|
|
85
|
+
var _props_subTableId;
|
|
86
|
+
this.subTableId = (_props_subTableId = props === null || props === void 0 ? void 0 : props.subTableId) !== null && _props_subTableId !== void 0 ? _props_subTableId : undefined;
|
|
87
|
+
var _props_subTableId1;
|
|
88
|
+
this.subTableName = (_props_subTableId1 = props === null || props === void 0 ? void 0 : props.subTableId) !== null && _props_subTableId1 !== void 0 ? _props_subTableId1 : undefined;
|
|
89
|
+
var _props_aggregateType;
|
|
90
|
+
this.aggregateType = (_props_aggregateType = props === null || props === void 0 ? void 0 : props.aggregateType) !== null && _props_aggregateType !== void 0 ? _props_aggregateType : undefined;
|
|
60
91
|
};
|
package/dist/esm/constant.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var DEFAULT_LOCALE =
|
|
1
|
+
export var DEFAULT_LOCALE = "zh-CN";
|
|
2
2
|
export var noop = function() {};
|
|
@@ -1,12 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @author qiyu
|
|
3
|
+
* @description 属性只是简单从接口拿过来,还未仔细考虑
|
|
4
|
+
*/ function _classCallCheck(instance, Constructor) {
|
|
2
5
|
if (!(instance instanceof Constructor)) {
|
|
3
6
|
throw new TypeError("Cannot call a class as a function");
|
|
4
7
|
}
|
|
5
8
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
function _defineProperty(obj, key, value) {
|
|
10
|
+
if (key in obj) {
|
|
11
|
+
Object.defineProperty(obj, key, {
|
|
12
|
+
value: value,
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true
|
|
16
|
+
});
|
|
17
|
+
} else {
|
|
18
|
+
obj[key] = value;
|
|
19
|
+
}
|
|
20
|
+
return obj;
|
|
21
|
+
}
|
|
22
|
+
export var DepartmentEntity = function DepartmentEntity() {
|
|
10
23
|
"use strict";
|
|
11
24
|
_classCallCheck(this, DepartmentEntity);
|
|
25
|
+
_defineProperty(this, "department_en_name", void 0);
|
|
26
|
+
/**
|
|
27
|
+
* 部门编号
|
|
28
|
+
*/ _defineProperty(this, "department_id", void 0);
|
|
29
|
+
/**
|
|
30
|
+
* 部门名称
|
|
31
|
+
*/ _defineProperty(this, "department_name", void 0);
|
|
12
32
|
};
|
package/dist/esm/entity/User.js
CHANGED
|
@@ -1,12 +1,86 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @author qiyu
|
|
3
|
+
* @description 属性只是简单从接口拿过来,还未仔细考虑
|
|
4
|
+
*/ function _classCallCheck(instance, Constructor) {
|
|
2
5
|
if (!(instance instanceof Constructor)) {
|
|
3
6
|
throw new TypeError("Cannot call a class as a function");
|
|
4
7
|
}
|
|
5
8
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
function _defineProperty(obj, key, value) {
|
|
10
|
+
if (key in obj) {
|
|
11
|
+
Object.defineProperty(obj, key, {
|
|
12
|
+
value: value,
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true
|
|
16
|
+
});
|
|
17
|
+
} else {
|
|
18
|
+
obj[key] = value;
|
|
19
|
+
}
|
|
20
|
+
return obj;
|
|
21
|
+
}
|
|
22
|
+
export var UserEntity = function UserEntity() {
|
|
10
23
|
"use strict";
|
|
11
24
|
_classCallCheck(this, UserEntity);
|
|
25
|
+
_defineProperty(this, "avatar_big", void 0);
|
|
26
|
+
_defineProperty(this, "avatar_small", void 0);
|
|
27
|
+
/**
|
|
28
|
+
* 员工头像地址
|
|
29
|
+
*/ _defineProperty(this, "avatar_url", void 0);
|
|
30
|
+
/**
|
|
31
|
+
* 归属部门英文名称
|
|
32
|
+
*/ _defineProperty(this, "belong_dept_en_name", void 0);
|
|
33
|
+
_defineProperty(this, "belong_dept_id_list", void 0);
|
|
34
|
+
/**
|
|
35
|
+
* 归属部门ID
|
|
36
|
+
*/ _defineProperty(this, "belong_dept_ids", void 0);
|
|
37
|
+
/**
|
|
38
|
+
* 归属部门名称
|
|
39
|
+
*/ _defineProperty(this, "belong_dept_name", void 0);
|
|
40
|
+
/**
|
|
41
|
+
* 当前语言版本
|
|
42
|
+
*/ _defineProperty(this, "cookie_language_enum", void 0);
|
|
43
|
+
/**
|
|
44
|
+
* 部门id
|
|
45
|
+
*/ _defineProperty(this, "department_id", void 0);
|
|
46
|
+
/**
|
|
47
|
+
* 部门名称
|
|
48
|
+
*/ _defineProperty(this, "department_name", void 0);
|
|
49
|
+
/**
|
|
50
|
+
* 员工邮箱
|
|
51
|
+
*/ _defineProperty(this, "email", void 0);
|
|
52
|
+
/**
|
|
53
|
+
* 工号
|
|
54
|
+
*/ _defineProperty(this, "employee_card", void 0);
|
|
55
|
+
/**
|
|
56
|
+
* 英文名
|
|
57
|
+
*/ _defineProperty(this, "employee_en_name", void 0);
|
|
58
|
+
/**
|
|
59
|
+
* 员工编号
|
|
60
|
+
*/ _defineProperty(this, "employee_id", void 0);
|
|
61
|
+
/**
|
|
62
|
+
* 员工姓名
|
|
63
|
+
*/ _defineProperty(this, "employee_name", void 0);
|
|
64
|
+
_defineProperty(this, "external_user", void 0);
|
|
65
|
+
/**
|
|
66
|
+
* 性别
|
|
67
|
+
*/ _defineProperty(this, "gender", void 0);
|
|
68
|
+
_defineProperty(this, "is_show_chat_group", void 0);
|
|
69
|
+
/**
|
|
70
|
+
* 负责部门英文名称
|
|
71
|
+
*/ _defineProperty(this, "manage_dept_en_name", void 0);
|
|
72
|
+
/**
|
|
73
|
+
* 负责部门ID
|
|
74
|
+
*/ _defineProperty(this, "manage_dept_ids", void 0);
|
|
75
|
+
/**
|
|
76
|
+
* 负责部门名称
|
|
77
|
+
*/ _defineProperty(this, "manage_dept_name", void 0);
|
|
78
|
+
_defineProperty(this, "msg_relation_type", void 0);
|
|
79
|
+
/**
|
|
80
|
+
* 职级
|
|
81
|
+
*/ _defineProperty(this, "sequence", void 0);
|
|
82
|
+
/**
|
|
83
|
+
* 固定电话
|
|
84
|
+
*/ _defineProperty(this, "telephone", void 0);
|
|
85
|
+
_defineProperty(this, "tenant_id", void 0);
|
|
12
86
|
};
|
package/dist/esm/entity/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./Department";
|
|
2
|
+
export * from "./User";
|