agilebuilder-ui 1.0.621 → 1.0.962
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/lib/super-ui.css +1 -1
- package/lib/super-ui.js +115880 -110424
- package/lib/super-ui.umd.cjs +103 -95
- package/package.json +6 -3
- package/packages/department-tree/src/department-tree.vue +27 -10
- package/packages/department-tree-inline/src/department-tree-service.js +20 -41
- package/packages/department-tree-mobile/src/department-tree-app.vue +6 -6
- package/packages/department-tree-mobile/src/department-tree-inline-app.vue +15 -15
- package/packages/department-user-tree/src/department-user-tree.vue +17 -2
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +61 -26
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +64 -22
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -6
- package/packages/department-user-tree-inline/src/group-user/group-input.vue +162 -0
- package/packages/department-user-tree-inline/src/group-user/group-list.vue +99 -0
- package/packages/department-user-tree-inline/src/group-user/group-user.vue +42 -0
- package/packages/department-user-tree-inline/src/group-user-multiple-tree.vue +304 -0
- package/packages/department-user-tree-inline/src/group-user-single-tree.vue +155 -0
- package/packages/department-user-tree-inline/src/group-user-tree-service.js +74 -0
- package/packages/department-user-tree-inline/src/search-result.vue +34 -36
- package/packages/department-user-tree-mobile/src/department-user-tree-app.vue +6 -6
- package/packages/department-user-tree-mobile/src/department-user-tree-inline-app.vue +17 -19
- package/packages/department-user-tree-mobile/src/department-user-tree-service.ts +0 -11
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +795 -799
- package/packages/dynamic-source-select/src/events.js +11 -16
- package/packages/fs-upload-list/src/fs-upload-list.vue +183 -122
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-app.vue +246 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +480 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-component.vue +127 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-input.vue +246 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload.vue +255 -0
- package/packages/fs-upload-new/src/fs-button-upload.vue +10 -13
- package/packages/fs-upload-new/src/fs-drag-upload.vue +4 -8
- package/packages/fs-upload-new/src/fs-preview-new.vue +103 -36
- package/packages/fs-upload-new/src/fs-upload-new.vue +160 -13
- package/packages/index.js +11 -2
- package/packages/organization-input/src/organization-input.vue +493 -539
- package/packages/plugins/export-data-new.js +34 -1
- package/packages/rich-editor/index.vue +29 -0
- package/packages/row-form/index.js +7 -0
- package/packages/row-form/index.vue +211 -0
- package/packages/scan-code-input/src/scan-code-input.vue +136 -104
- package/packages/scan-code-input-browser/index.js +6 -0
- package/packages/{scan-code-input/src/scan-code-input-colse.vue → scan-code-input-browser/src/scan-code-input.vue} +1 -28
- package/packages/secret-info/index.vue +2 -2
- package/packages/super-grid/src/apis.js +158 -10
- package/packages/super-grid/src/components/grid-icon.vue +7 -14
- package/packages/super-grid/src/components/hyperlinks.vue +24 -8
- package/packages/super-grid/src/custom-formatter.js +312 -380
- package/packages/super-grid/src/dynamic-input.vue +346 -43
- package/packages/super-grid/src/formValidatorUtil.js +79 -15
- package/packages/super-grid/src/group-column.vue +5 -0
- package/packages/super-grid/src/normal-column-content.vue +1056 -0
- package/packages/super-grid/src/normal-column.vue +57 -740
- package/packages/super-grid/src/row-detail.vue +50 -0
- package/packages/super-grid/src/row-operation.vue +19 -10
- package/packages/super-grid/src/scan-util.ts +243 -0
- package/packages/super-grid/src/search-button.vue +18 -14
- package/packages/super-grid/src/search-form-advancedQuery.vue +9 -2
- package/packages/super-grid/src/search-form-item.vue +10 -3
- package/packages/super-grid/src/search-form-mobile.vue +250 -0
- package/packages/super-grid/src/search-form.vue +159 -82
- package/packages/super-grid/src/super-grid-service.js +51 -6
- package/packages/super-grid/src/super-grid.vue +657 -761
- package/packages/super-grid/src/utils.js +126 -170
- package/packages/super-nine-grid/src/super-nine-grid.vue +1032 -1141
- package/packages/workflow-button/src/workflow-button.vue +6 -1
- package/packages/workgroup-tree/src/workgroup-tree.vue +31 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +28 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +26 -0
- package/packages/workgroup-tree-mobile/index.js +6 -0
- package/packages/workgroup-tree-mobile/src/dept-result.vue +51 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-app.vue +120 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-inline-app.vue +375 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-service.ts +62 -0
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +15 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +27 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +11 -0
- package/packages/workgroup-user-tree-mobile/index.js +6 -0
- package/packages/workgroup-user-tree-mobile/src/dept-path.vue +36 -0
- package/packages/workgroup-user-tree-mobile/src/dept-result.vue +58 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-app.vue +119 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-inline-app.vue +394 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-service.ts +41 -0
- package/src/api/sso-service.js +44 -15
- package/src/directives/permission/permission.js +4 -3
- package/src/i18n/langs/cn.js +19 -3
- package/src/i18n/langs/en.js +18 -2
- package/src/permission.js +114 -122
- package/src/store/modules/user.js +32 -33
- package/src/styles/index.scss +1 -0
- package/src/styles/table.scss +12 -0
- package/src/styles/theme/dark-blue/button.scss +2 -2
- package/src/styles/theme/dark-blue/index.scss +1 -1
- package/src/styles/theme/dark-blue/sidebar.scss +10 -0
- package/src/styles/theme/dark-blue/table.scss +8 -52
- package/src/styles/theme/green/button.scss +2 -2
- package/src/styles/theme/green/green.scss +1 -1
- package/src/styles/theme/green/index.scss +1 -1
- package/src/styles/theme/green/sidebar.scss +20 -0
- package/src/styles/theme/green/table.scss +7 -51
- package/src/styles/theme/ocean-blue/button.scss +2 -2
- package/src/styles/theme/ocean-blue/index.scss +1 -1
- package/src/styles/theme/ocean-blue/ocean-blue.scss +1 -1
- package/src/styles/theme/ocean-blue/sidebar.scss +10 -0
- package/src/styles/theme/ocean-blue/table.scss +7 -52
- package/src/utils/auth.js +23 -3
- package/src/utils/calculator/calculator-factory.js +4 -4
- package/src/utils/calculator/calculator-util.js +14 -0
- package/src/utils/common-util.js +270 -124
- package/src/utils/i18n-util.js +145 -0
- package/src/utils/jump-page-utils.js +245 -314
- package/src/utils/permission.js +7 -1
- package/src/utils/permissionAuth.js +155 -37
- package/src/utils/request.js +10 -11
- package/src/utils/util.js +154 -205
- package/src/views/layout/EmptyLayout.vue +1 -1
- package/src/views/layout/components/Menubar/Item.vue +27 -4
- package/src/views/layout/components/Menubar/SidebarItem.vue +7 -3
- package/src/views/layout/components/Menubar/index.vue +14 -2
- package/src/views/layout/tab-content-index.vue +1 -1
|
@@ -4,57 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
$table-cell-font-color: #313233;
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
.el-table th {
|
|
9
|
-
background-color: $th-cell-background !important;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.el-table__header-wrapper {
|
|
7
|
+
.el-table__header tr{
|
|
13
8
|
background-color: $th-cell-background;
|
|
9
|
+
color: #333333;
|
|
14
10
|
}
|
|
15
|
-
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
// background-color: $th-cell-background;
|
|
22
|
-
// }
|
|
23
|
-
|
|
24
|
-
.el-table .el-table__cell {
|
|
25
|
-
color: $table-cell-font-color;
|
|
26
|
-
padding: 0;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// 表头字体样式
|
|
30
|
-
.el-table th.el-table__cell>.cell {
|
|
31
|
-
// color: $table-cell-font-color; 不能在这里设置,不然会覆盖header-cell-style事件 传递的样式
|
|
32
|
-
font-family: Source Han Sans CN;
|
|
33
|
-
font-weight: medium;
|
|
34
|
-
font-size: 14px;
|
|
35
|
-
line-height: 22px;
|
|
36
|
-
letter-spacing: 0px;
|
|
37
|
-
// text-align: left;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// 表格内容颜色
|
|
41
|
-
.el-table .cell {
|
|
42
|
-
font-family: Source Han Sans CN;
|
|
43
|
-
font-weight: regular;
|
|
44
|
-
font-size: 14px;
|
|
45
|
-
line-height: 22px;
|
|
46
|
-
letter-spacing: 0px;
|
|
47
|
-
// text-align: left;
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.el-button--text {
|
|
52
|
-
color: $--color-primary;
|
|
53
|
-
font-family: Source Han Sans CN;
|
|
54
|
-
font-weight: regular;
|
|
55
|
-
font-size: 14px;
|
|
56
|
-
line-height: 22px;
|
|
57
|
-
letter-spacing: 0px;
|
|
58
|
-
text-align: center;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
11
|
+
//.el-button--text {
|
|
12
|
+
// color: $--color-primary;
|
|
13
|
+
// font-size: 16px;
|
|
14
|
+
// text-align: center;
|
|
15
|
+
//}
|
|
16
|
+
}
|
|
@@ -111,10 +111,10 @@
|
|
|
111
111
|
}
|
|
112
112
|
//page-runtime 头部按钮样式
|
|
113
113
|
.page-runtime-header-btn{
|
|
114
|
-
margin-bottom:
|
|
114
|
+
margin-bottom: 10px;
|
|
115
115
|
display: inline-block;
|
|
116
116
|
}
|
|
117
117
|
.page-runtime-header-btn + .page-runtime-header-btn{
|
|
118
|
-
margin-left:
|
|
118
|
+
margin-left: 5px;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -284,14 +284,25 @@
|
|
|
284
284
|
.router-link-active >.is-active{
|
|
285
285
|
color: $--menu-dont-color;
|
|
286
286
|
}
|
|
287
|
+
|
|
287
288
|
.el-menu-item{
|
|
288
289
|
color: #FFFFFF;
|
|
289
290
|
}
|
|
291
|
+
|
|
290
292
|
.el-menu-item:hover{
|
|
291
293
|
background-color: $--menu-hove-background-color;
|
|
292
294
|
color: #FFFFFF;
|
|
293
295
|
}
|
|
294
296
|
|
|
297
|
+
.el-menu-item.is-active {
|
|
298
|
+
color: $--menu-dont-color;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.el-menu-item.is-active:hover {
|
|
302
|
+
background-color: $--menu-hove-background-color;
|
|
303
|
+
color: #FFFFFF;
|
|
304
|
+
}
|
|
305
|
+
|
|
295
306
|
.el-sub-menu .el-sub-menu__title{
|
|
296
307
|
color: #FFFFFF;
|
|
297
308
|
}
|
|
@@ -309,4 +320,13 @@
|
|
|
309
320
|
color: #FFFFFF;
|
|
310
321
|
background-color: $--menu-hove-background-color;
|
|
311
322
|
}
|
|
323
|
+
运行时工具栏样式
|
|
324
|
+
.amb-widget-tools-parent{
|
|
325
|
+
margin-bottom: 20px;
|
|
326
|
+
}
|
|
327
|
+
.amb-widget-container-tool{
|
|
328
|
+
display: flex;
|
|
329
|
+
overflow-x: auto;
|
|
330
|
+
padding: 10px 0;
|
|
331
|
+
}
|
|
312
332
|
}
|
|
@@ -4,57 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
$table-cell-font-color: #313233;
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
.el-table th {
|
|
9
|
-
background-color: $th-cell-background !important;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.el-table__header-wrapper {
|
|
7
|
+
.el-table__header tr{
|
|
13
8
|
background-color: $th-cell-background;
|
|
9
|
+
color: #333333;
|
|
14
10
|
}
|
|
15
|
-
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
// .el-table thead.is-group th.el-table__cell {
|
|
21
|
-
// background-color: $th-cell-background;
|
|
22
|
-
// }
|
|
23
|
-
|
|
24
|
-
.el-table .el-table__cell {
|
|
25
|
-
color: $table-cell-font-color;
|
|
26
|
-
padding: 0;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// 表头字体样式
|
|
30
|
-
.el-table th.el-table__cell>.cell {
|
|
31
|
-
color: $table-cell-font-color;
|
|
32
|
-
font-family: Source Han Sans CN;
|
|
33
|
-
font-weight: medium;
|
|
34
|
-
font-size: 14px;
|
|
35
|
-
line-height: 22px;
|
|
36
|
-
letter-spacing: 0px;
|
|
37
|
-
// text-align: left;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// 表格内容颜色
|
|
41
|
-
.el-table .cell {
|
|
42
|
-
font-family: Source Han Sans CN;
|
|
43
|
-
font-weight: regular;
|
|
44
|
-
font-size: 14px;
|
|
45
|
-
line-height: 22px;
|
|
46
|
-
letter-spacing: 0px;
|
|
47
|
-
// text-align: left;
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.el-button--text {
|
|
52
|
-
color: $--color-primary;
|
|
53
|
-
font-family: Source Han Sans CN;
|
|
54
|
-
font-weight: regular;
|
|
55
|
-
font-size: 14px;
|
|
56
|
-
line-height: 22px;
|
|
57
|
-
letter-spacing: 0px;
|
|
58
|
-
text-align: center;
|
|
59
|
-
}
|
|
11
|
+
//.el-button--text {
|
|
12
|
+
// color: $--color-primary;
|
|
13
|
+
// font-size: 16px;
|
|
14
|
+
// text-align: center;
|
|
15
|
+
//}
|
|
60
16
|
}
|
|
@@ -112,10 +112,10 @@
|
|
|
112
112
|
|
|
113
113
|
//page-runtime 头部按钮样式
|
|
114
114
|
.page-runtime-header-btn{
|
|
115
|
-
margin-bottom:
|
|
115
|
+
margin-bottom: 10px;
|
|
116
116
|
display: inline-block;
|
|
117
117
|
}
|
|
118
118
|
.page-runtime-header-btn + .page-runtime-header-btn{
|
|
119
|
-
margin-left:
|
|
119
|
+
margin-left: 5px;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
@@ -276,4 +276,14 @@
|
|
|
276
276
|
.el-sub-menu__title:hover{
|
|
277
277
|
background-color: $--menu-hove-background-color;
|
|
278
278
|
}
|
|
279
|
+
|
|
280
|
+
运行时工具栏样式
|
|
281
|
+
.amb-widget-tools-parent{
|
|
282
|
+
margin-bottom: 20px;
|
|
283
|
+
}
|
|
284
|
+
.amb-widget-container-tool{
|
|
285
|
+
display: flex;
|
|
286
|
+
overflow-x: auto;
|
|
287
|
+
padding: 10px 0;
|
|
288
|
+
}
|
|
279
289
|
}
|
|
@@ -1,60 +1,15 @@
|
|
|
1
1
|
@import "./ocean-blue.scss";
|
|
2
2
|
|
|
3
3
|
.ocean-blue {
|
|
4
|
-
|
|
5
4
|
$table-cell-font-color: #313233;
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
.el-table th {
|
|
9
|
-
background-color: $th-cell-background !important;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.el-table__header-wrapper {
|
|
6
|
+
.el-table__header tr{
|
|
13
7
|
background-color: $th-cell-background;
|
|
8
|
+
color: #333333;
|
|
14
9
|
}
|
|
15
|
-
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
// .el-table thead.is-group th.el-table__cell {
|
|
21
|
-
// background-color: $th-cell-background;
|
|
22
|
-
// }
|
|
23
|
-
|
|
24
|
-
.el-table .el-table__cell {
|
|
25
|
-
color: $table-cell-font-color;
|
|
26
|
-
padding: 0;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// 表头字体样式
|
|
30
|
-
.el-table th.el-table__cell>.cell {
|
|
31
|
-
color: $table-cell-font-color;
|
|
32
|
-
font-family: Source Han Sans CN;
|
|
33
|
-
font-weight: medium;
|
|
34
|
-
font-size: 14px;
|
|
35
|
-
line-height: 22px;
|
|
36
|
-
letter-spacing: 0px;
|
|
37
|
-
// text-align: left;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// 表格内容颜色
|
|
41
|
-
.el-table .cell {
|
|
42
|
-
font-family: Source Han Sans CN;
|
|
43
|
-
font-weight: regular;
|
|
44
|
-
font-size: 14px;
|
|
45
|
-
line-height: 22px;
|
|
46
|
-
letter-spacing: 0px;
|
|
47
|
-
// text-align: left;
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.el-button--text {
|
|
52
|
-
color: $--color-primary;
|
|
53
|
-
font-family: Source Han Sans CN;
|
|
54
|
-
font-weight: regular;
|
|
55
|
-
font-size: 14px;
|
|
56
|
-
line-height: 22px;
|
|
57
|
-
letter-spacing: 0px;
|
|
58
|
-
text-align: center;
|
|
59
|
-
}
|
|
10
|
+
//.el-button--text {
|
|
11
|
+
// color: $--color-primary;
|
|
12
|
+
// font-size: 16px;
|
|
13
|
+
// text-align: center;
|
|
14
|
+
//}
|
|
60
15
|
}
|
package/src/utils/auth.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import authApi from './auth-api'
|
|
2
|
+
import { removeAllSystemPermissions } from './permissionAuth'
|
|
2
3
|
|
|
3
4
|
export function getToken() {
|
|
4
5
|
return authApi.getToken()
|
|
@@ -68,7 +69,7 @@ export function setLanguage(language) {
|
|
|
68
69
|
authApi.setLanguage(language)
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
|
|
72
|
+
function removeLanguage() {
|
|
72
73
|
authApi.removeLanguage()
|
|
73
74
|
}
|
|
74
75
|
|
|
@@ -80,7 +81,7 @@ export function setAllLanguages(langs) {
|
|
|
80
81
|
authApi.setAllLanguages(langs)
|
|
81
82
|
}
|
|
82
83
|
|
|
83
|
-
|
|
84
|
+
function removeAllLanguages() {
|
|
84
85
|
authApi.removeAllLanguages()
|
|
85
86
|
}
|
|
86
87
|
|
|
@@ -113,7 +114,7 @@ export function removeAllThemes() {
|
|
|
113
114
|
authApi.removeAllThemes()
|
|
114
115
|
}
|
|
115
116
|
|
|
116
|
-
|
|
117
|
+
function removePublishControl() {
|
|
117
118
|
authApi.removePublishControl()
|
|
118
119
|
}
|
|
119
120
|
/**
|
|
@@ -140,4 +141,23 @@ export function removeProjectSettings() {
|
|
|
140
141
|
|
|
141
142
|
export function removeProjectCode() {
|
|
142
143
|
authApi.removeCookieCache('_PROJECT_CDOE')
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export function getRunCurrentRole() {
|
|
147
|
+
let runCurrentRoleKey = '_RUN_CURRENT_ROLE'
|
|
148
|
+
if(!isDevpSystem()){
|
|
149
|
+
return authApi.getSessionCache(runCurrentRoleKey)
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
// 清空token时需要清除的缓存信息
|
|
153
|
+
export function clearPermission() {
|
|
154
|
+
removeToken()
|
|
155
|
+
removeLanguage()
|
|
156
|
+
removeAllLanguages()
|
|
157
|
+
|
|
158
|
+
removeUsername()
|
|
159
|
+
removeCurrentUser()
|
|
160
|
+
|
|
161
|
+
removeAllSystemPermissions()
|
|
162
|
+
removePublishControl()
|
|
143
163
|
}
|
|
@@ -101,13 +101,13 @@ class TextCalculator extends CalculatorFactory {
|
|
|
101
101
|
this.result = false
|
|
102
102
|
} else {
|
|
103
103
|
if (operator === 'NET') {
|
|
104
|
-
this.result = leftVale !== rightValue
|
|
104
|
+
this.result = (leftVale+'') !== (rightValue+'')
|
|
105
105
|
} else if (operator === 'EQ') {
|
|
106
|
-
this.result = leftVale === rightValue
|
|
106
|
+
this.result = (leftVale+'') === (rightValue+'')
|
|
107
107
|
} else if (operator === 'NOT_CONTAIN') {
|
|
108
|
-
this.result = !leftVale.includes(rightValue)
|
|
108
|
+
this.result = !(leftVale+'').includes(rightValue+'')
|
|
109
109
|
} else if (operator === 'CONTAIN') {
|
|
110
|
-
this.result = leftVale.includes(rightValue)
|
|
110
|
+
this.result = (leftVale+'').includes(rightValue+'')
|
|
111
111
|
} else if (operator === 'IS_NULL') {
|
|
112
112
|
this.result =
|
|
113
113
|
leftVale === undefined || leftVale === null || leftVale === ''
|
|
@@ -3,6 +3,20 @@ import { getAbstractUserFactoryWf } from './calculator-factory-wf'
|
|
|
3
3
|
import { getPropValue, getEntityFieldValue } from '../util'
|
|
4
4
|
export function executeExpression(leftValue, operator, rightValue, dataType) {
|
|
5
5
|
const Calculator = getAbstractUserFactory(dataType)
|
|
6
|
+
if (dataType === 'DATE' || dataType === 'TIME') {
|
|
7
|
+
return executeDateExpression(leftValue, operator, rightValue, Calculator)
|
|
8
|
+
}
|
|
9
|
+
const calculatorObj = new Calculator(leftValue, operator, rightValue)
|
|
10
|
+
return calculatorObj.result
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function executeDateExpression(leftValue, operator, rightValue, Calculator) {
|
|
14
|
+
if (rightValue && typeof (rightValue) === 'string') {
|
|
15
|
+
rightValue = new Date(rightValue).getTime()
|
|
16
|
+
}
|
|
17
|
+
if (leftValue && typeof (leftValue) === 'string') {
|
|
18
|
+
leftValue = new Date(leftValue).getTime()
|
|
19
|
+
}
|
|
6
20
|
const calculatorObj = new Calculator(leftValue, operator, rightValue)
|
|
7
21
|
return calculatorObj.result
|
|
8
22
|
}
|