imatrix-ui 2.9.99 → 7.7.20-p2

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.
Files changed (35) hide show
  1. package/lib/super-ui.css +1 -1
  2. package/lib/super-ui.umd.min.js +13 -6
  3. package/package.json +3 -2
  4. package/src/api/sso-service.js +12 -1
  5. package/src/directives/permission/permission.js +1 -1
  6. package/src/i18n/langs/cn.js +64 -3
  7. package/src/i18n/langs/en.js +65 -4
  8. package/src/permission.js +16 -22
  9. package/src/router/index.js +18 -1
  10. package/src/store/getters.js +2 -1
  11. package/src/store/modules/user.js +16 -1
  12. package/src/styles/index.scss +11 -2
  13. package/src/utils/calculator/calculator-factory.js +125 -0
  14. package/src/utils/calculator/calculator-util.js +6 -0
  15. package/src/utils/common-util.js +21 -1
  16. package/src/utils/eventBus.js +2 -0
  17. package/src/utils/iconUtils.js +23 -0
  18. package/src/utils/jump-page-utils.js +467 -0
  19. package/src/utils/permission.js +1 -1
  20. package/src/utils/permissionAuth.js +1 -1
  21. package/src/utils/request.js +4 -2
  22. package/src/utils/restful-interface-utils.js +47 -0
  23. package/src/utils/util.js +451 -0
  24. package/src/utils/watermark.js +95 -0
  25. package/src/views/layout/NewLayout.vue +77 -0
  26. package/src/views/layout/components/AppMain.vue +9 -0
  27. package/src/views/layout/components/Breadcrumb/index.vue +33 -1
  28. package/src/views/layout/components/Menubar/Item.vue +46 -0
  29. package/src/views/layout/components/Menubar/Link.vue +31 -0
  30. package/src/views/layout/components/Menubar/SidebarItem.vue +101 -0
  31. package/src/views/layout/components/Menubar/index.vue +143 -0
  32. package/src/views/layout/components/iframe-page.vue +31 -0
  33. package/src/views/layout/components/index.js +1 -0
  34. package/src/views/redirect/index.vue +3 -3
  35. package/src/views/wf-history/tache-subprocess-history.vue +45 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imatrix-ui",
3
- "version": "2.9.99",
3
+ "version": "7.7.20-p2",
4
4
  "description": "前端组件库:表格、表单、组织结构树等",
5
5
  "main": "lib/super-ui.umd.min.js",
6
6
  "private": false,
@@ -28,13 +28,14 @@
28
28
  "babel-cli": "^6.26.0",
29
29
  "babel-eslint": "^10.0.1",
30
30
  "chai": "4.2.0",
31
- "element-ui": "2.9.1",
31
+ "element-ui": "2.15.3",
32
32
  "eslint": "5.16.0",
33
33
  "eslint-plugin-vue": "5.2.2",
34
34
  "node-sass": "4.12.0",
35
35
  "nprogress": "^0.2.0",
36
36
  "sass-loader": "^7.1.0",
37
37
  "sessionstorage": "^0.1.0",
38
+ "super-pages": "0.6.73",
38
39
  "vue": "^2.6.10",
39
40
  "vue-cli-plugin-element": "^1.0.1",
40
41
  "vue-i18n": "^8.17.4",
@@ -74,6 +74,16 @@ function resetPassword(username, password) {
74
74
  function isLoginTimeOut() {
75
75
  return request.get(Vue.prototype.baseAPI + '/sso/current-users/is-login-time-out')
76
76
  }
77
+
78
+ function getUserPermissionMenusBySystemCode(systemCode) {
79
+ if (!systemCode) {
80
+ systemCode = Vue.prototype.currentSystem
81
+ }
82
+ if (!systemCode) {
83
+ systemCode = Vue.prototype.systemCode
84
+ }
85
+ return request.get(Vue.prototype.baseAPI + '/component/permission-menus/systems/' + systemCode)
86
+ }
77
87
  export default {
78
88
  login,
79
89
  getCurrentUser,
@@ -85,5 +95,6 @@ export default {
85
95
  forgetPasswordSendMail,
86
96
  isResetPasswordJwtOverdue,
87
97
  resetPassword,
88
- isLoginTimeOut
98
+ isLoginTimeOut,
99
+ getUserPermissionMenusBySystemCode
89
100
  }
@@ -12,7 +12,7 @@ export default {
12
12
  el.parentNode && el.parentNode.removeChild(el)
13
13
  }
14
14
  } else {
15
- throw new Error(`need permission! Like v-permission="acs.department.save"`)
15
+ throw new Error(`need permission1! Like v-permission="acs.department.save"`)
16
16
  }
17
17
  }
18
18
  }
@@ -11,7 +11,35 @@ const cn = {
11
11
  clear: '清空',
12
12
  download: '下载',
13
13
  delete: '删除',
14
- preview: '预览'
14
+ preview: '预览',
15
+ add: '增加',
16
+ graphView: '图形视图',
17
+ listView: '列表视图',
18
+ fieldName: '字段名(*)',
19
+ operator: '操作符',
20
+ value: '值(*)',
21
+ andOr: '并且/或者',
22
+ whenTheVariableIsEmpty: '变量为空时',
23
+ perhaps: '或者',
24
+ also: '并且',
25
+ greaterThan: '大于',
26
+ lessThan: '小于',
27
+ beEqualTo: '等于',
28
+ notGreaterThan: '不大于',
29
+ notLessThan: '不小于',
30
+ notEqualTo: '不等于',
31
+ contain: '包含',
32
+ notIncluded: '不包含',
33
+ laterThan: '晚于',
34
+ earlierThan: '早于',
35
+ noLaterThan: '不晚于',
36
+ noEarlierThan: '不早于',
37
+ ignore11: '忽略(1=1)',
38
+ nonConformity: '不符合(1<>1)',
39
+ switchToNormalQuery: '切换为普通查询',
40
+ switchToAdvancedQuery: '切换为高级查询',
41
+ isNull: '等于Null',
42
+ isNotNull: '不等于Null'
15
43
  },
16
44
  imatrixUIMessage: {
17
45
  whetherToConfirmDeletion: '是否确认删除',
@@ -35,7 +63,10 @@ const cn = {
35
63
  organizationTreeNoResultNotRemove: '未选择任何信息,无需移除',
36
64
  exceedFileSize: '超过文件大小限制{fileSize}M',
37
65
  upload: '上传',
38
- invalideDoubleValue: '{num} 不是合法的小数'
66
+ invalideDoubleValue: '{num} 不是合法的小数',
67
+ noJumpPage: '未配置跳转页面',
68
+ saveSuccessfully: '保存成功',
69
+ pleaseInputSearchCondition: '请输入查询条件'
39
70
  },
40
71
  // 列表组件
41
72
  superGrid: {
@@ -55,6 +86,21 @@ const cn = {
55
86
  fileName: '文件名称',
56
87
  deleteSuccessful: '删除成功',
57
88
  index: '序号',
89
+ searchConditionName: '查询条件名称',
90
+ pleaseInputSearchConditionName: '请输入查询条件名称',
91
+ saveCondition: '保存条件',
92
+ saveConditionTitle: '保存查询条件',
93
+ displayOrder: '显示顺序',
94
+ width: '列宽',
95
+ default: '默认',
96
+ custom: '自定义',
97
+ show: '显示',
98
+ hidden: '隐藏',
99
+ export: '导出',
100
+ unExport: '不导出',
101
+ whetherToConfirmReset: '是否确认重置?',
102
+ resetSuccessful: '重置成功',
103
+ dargColumnOrderMessage: '支持拖动改变列顺序',
58
104
  selectAll: '全选'
59
105
  },
60
106
  // 部门树组件
@@ -128,7 +174,7 @@ const cn = {
128
174
  process_start: '[{1}]流程开始',
129
175
  prcoess_end: '[{1}]流程结束',
130
176
  force_end_process: '{1}强制结束了该流程,[{2}]的任务被取消',
131
- history_jump: '流程跳转到[{1}],[{2}]的任务被取消',
177
+ history_jump: '流程{3}到[{1}],[{2}]的任务被取消',
132
178
  history_back: '{1}退回任务,流程退回到[{2}]',
133
179
  history_removesign: '{1}给[{2}]减签',
134
180
  history_changetransactor_and_delegate: '{1}把办理人[{2}]更改成[{3})],{4}把任务委托给了[{5}]',
@@ -157,6 +203,21 @@ const cn = {
157
203
  timeout: '接口调用超时',
158
204
  callFailed: '接口调用失败'
159
205
  },
206
+ // 九宫格列表组件
207
+ superNineGrid: {
208
+ add: '新建'
209
+ },
210
+ fsUpload: {
211
+ upload: '上传',
212
+ download: '下载',
213
+ delete: '删除',
214
+ preview: '预览',
215
+ name: '名称',
216
+ picture: '图片',
217
+ operating: '操作',
218
+ uploadSucceeded: '上传成功',
219
+ theNumberOfUploadsExceedsTheLimitTheLimitIs: '上传数量超过限制,限制数量为'
220
+ },
160
221
  ...zhLocale
161
222
  }
162
223
  export default cn
@@ -11,7 +11,35 @@ const en = {
11
11
  clear: 'Clear',
12
12
  download: 'Download',
13
13
  delete: 'Delete',
14
- preview: 'Preview'
14
+ preview: 'Preview',
15
+ add: 'Add',
16
+ graphView: 'Graphic view',
17
+ listView: 'List View',
18
+ fieldName: 'Field Name',
19
+ operator: 'Operator',
20
+ value: 'Value',
21
+ andOr: 'And/Or',
22
+ whenTheVariableIsEmpty: 'When The Variable Is Empty',
23
+ perhaps: 'Perhaps',
24
+ also: 'Also',
25
+ greaterThan: 'Greater Than',
26
+ lessThan: 'Less Than',
27
+ beEqualTo: 'Be Equal To',
28
+ notGreaterThan: 'Not Greater Than',
29
+ notLessThan: 'Not Less Than',
30
+ notEqualTo: 'Not Equal To',
31
+ contain: 'Contain',
32
+ notIncluded: 'Not Included',
33
+ laterThan: 'Later Than',
34
+ earlierThan: 'Earlier Than',
35
+ noLaterThan: 'No Later Than',
36
+ noEarlierThan: 'No Earlier Than',
37
+ ignore11: 'Ignore (1 = 1)',
38
+ nonConformity: 'Non Conformity (1 < > 1)',
39
+ switchToNormalQuery: 'Switch To Normal Query',
40
+ switchToAdvancedQuery: 'Switch To Advanced Query',
41
+ isNull: 'Is Null',
42
+ isNotNull: 'Is Not Null'
15
43
  },
16
44
  imatrixUIMessage: {
17
45
  whetherToConfirmDeletion: 'Whether To Confirm Deletion',
@@ -35,7 +63,10 @@ const en = {
35
63
  organizationTreeNoResultNotRemove: 'No information selected, no need to remove',
36
64
  exceedFileSize: 'File size limit {filesize} M exceeded',
37
65
  upload: 'Upload',
38
- invalideDoubleValue: '{num} is not a legal decimal'
66
+ invalideDoubleValue: '{num} is not a legal decimal',
67
+ noJumpPage: 'Jump page not configured',
68
+ saveSuccessfully: 'Savee successfully',
69
+ pleaseInputSearchCondition: 'Please enter the query criteria'
39
70
  },
40
71
  superGrid: {
41
72
  columnConfig: 'Column Config',
@@ -54,6 +85,21 @@ const en = {
54
85
  fileName: 'File Name',
55
86
  deleteSuccessful: 'Deleted successfully',
56
87
  index: 'No.',
88
+ searchConditionName: 'Search Condition Name',
89
+ pleaseInputSearchConditionName: 'Please enter the name of the query criteria',
90
+ saveCondition: 'Save Condition',
91
+ saveConditionTitle: 'Save Condition',
92
+ displayOrder: 'Display Order',
93
+ width: 'Column Width',
94
+ default: 'Default',
95
+ custom: 'Custom',
96
+ show: 'Show',
97
+ hidden: 'Hidden',
98
+ export: 'Export',
99
+ unExport: 'Not Export',
100
+ whetherToConfirmReset: 'Are you sure you want to reset?',
101
+ resetSuccessful: 'Reset successfully',
102
+ dargColumnOrderMessage: 'Supports dragging to change column order',
57
103
  selectAll: 'Select All'
58
104
  },
59
105
  departmentTree: {
@@ -124,8 +170,8 @@ const en = {
124
170
  processEnd: 'Process End',
125
171
  process_start: '[{1}] process start',
126
172
  prcoess_end: '[{1}] process End',
127
- force_end_process: ' {1}forced to end the process, and the task of [{2}] was canceled',
128
- history_jump: 'Process jump to [{1}], [{2}] task cancelled',
173
+ force_end_process: '{1}forced to end the process, and the task of [{2}] was canceled',
174
+ history_jump: 'Process {3} to [{1}], [{2}] task cancelled',
129
175
  history_back: '{1} returned to task,process returned to [{2}]',
130
176
  history_removesign: '{1} minus [{2}]',
131
177
  history_changetransactor_and_delegate: '{1} changed the handler [{2}] to [{3}], [{4}] delegated the task to [{5}]',
@@ -153,6 +199,21 @@ const en = {
153
199
  timeout: 'Interface call timeout',
154
200
  callFailed: 'Interface call failed'
155
201
  },
202
+ // 九宫格列表组件
203
+ superNineGrid: {
204
+ add: 'Create'
205
+ },
206
+ fsUpload: {
207
+ upload: 'Upload',
208
+ download: 'Download',
209
+ delete: 'Delete',
210
+ preview: 'Preview',
211
+ name: 'Name',
212
+ picture: 'Picture',
213
+ operating: 'Operating',
214
+ uploadSucceeded: 'Upload succeeded',
215
+ theNumberOfUploadsExceedsTheLimitTheLimitIs: 'The number of uploads exceeds the limit. The limit is'
216
+ },
156
217
  ...enLocale
157
218
  }
158
219
  export default en
package/src/permission.js CHANGED
@@ -5,25 +5,25 @@ import store from './store'
5
5
  import router, { errorRouterMap } from './router'
6
6
  NProgress.configure({ showSpinner: false })// NProgress Configuration
7
7
  import { Message } from 'element-ui'
8
+ import Vue from 'vue'
8
9
 
9
10
  const whiteList = ['/login', '/update-password', '/forget-password', '/reset-password', '/redirect'] // 不重定向白名单
10
11
  router.beforeEach((to, from, next) => {
11
12
  NProgress.start()
12
13
  console.log('router.beforeEach-to=', to)
13
14
  console.log('router.beforeEach-from=', from)
14
- console.log('router.beforeEach-to.path=', to.path)
15
+ // console.log('router.beforeEach-to.path=', to.path)
15
16
  let token = getToken()
17
+ // console.log('router.beforeEach-to.query.JWT=', to.query.JWT)
16
18
  if (!token && to.query && to.query.JWT) {
17
19
  token = to.query.JWT
18
- console.log('router.beforeEach-to.query.JWT=', token)
19
20
  if (token) {
20
21
  // 微信小程序web-view直接访问路径时使用?将JWT传过来
21
22
  setToken(token)
22
23
  }
23
24
  }
24
- console.log('router.beforeEach-getToken()=', token)
25
+ // console.log('router.beforeEach-getToken()=', token)
25
26
  if (['/update-password', '/forget-password', '/reset-password', '/redirect'].indexOf(to.path) === -1 && token) {
26
- console.log('to.path不是白名单路径[/update-password, /forget-password, /reset-password,/redirect];且token不为空', 'to.path=', to.path)
27
27
  if (to.path === '/login') {
28
28
  next({ path: '/' })
29
29
  NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it
@@ -34,7 +34,6 @@ router.beforeEach((to, from, next) => {
34
34
  console.log('router.beforeEach-store.getters.name === ""')
35
35
  store.dispatch('isLoginTimeOut').then((result) => {
36
36
  if (result === true) {
37
- console.log('isLoginTimeOut请求结果为true,表示登录超时 clearToken ==')
38
37
  store.dispatch('clearToken').then(() => {
39
38
  next({ path: '/', replace: true })
40
39
  NProgress.done()
@@ -44,22 +43,21 @@ router.beforeEach((to, from, next) => {
44
43
  console.log('router.beforeEach-getCurrentUser')
45
44
  return store.dispatch('getCurrentUserPermissions', user.loginName)
46
45
  }).then(permissions => {
47
- console.log('iMatrix-router.beforeEach-generateRoutes')
46
+ console.log('router.beforeEach-getCurrentUserPermissions-result==')
48
47
  return store.dispatch('generateRoutes', permissions)
48
+ }).then(() => {
49
+ console.log('iMatrix-router.beforeEach2-getPermissionMenus')
50
+ return store.dispatch('getPermissionMenus', Vue.prototype.currentSystem)
49
51
  }).then(() => {
50
52
  // 根据roles权限生成可访问的路由表
51
- return new Promise((resolve, reject) => {
52
- console.log('iMatrix-router.beforeEach-addRoutes')
53
- router.addRoutes(store.getters.protectedRouters) // 动态添加可访问路由表
54
- // 404等错误路由一定要放到受权限保护的路由之后
55
- router.addRoutes(errorRouterMap)
56
- // sessionStorage.setItem(new Date().getTime() + '-name=null-from~~toPath', from.path + '~~' + to.path)
57
- console.log('router.beforeEach-addRoutes==to.path=', to.path)
58
- next({ ...to, replace: true })
59
- resolve()
60
- })
53
+ console.log('router.beforeEach-generateRoutes==to=', to, ',from=', from)
54
+ router.addRoutes(store.getters.protectedRouters) // 动态添加可访问路由表
55
+ // 404等错误路由一定要放到受权限保护的路由之后
56
+ router.addRoutes(errorRouterMap)
57
+ sessionStorage.setItem(new Date().getTime() + '-name=null-from~~toPath', from.path + '~~' + to.path)
58
+ console.log('router.beforeEach-generateRoutes==to.path=', to.path)
59
+ next({ ...to, replace: true })
61
60
  }).catch((err) => {
62
- console.log('getCurrentUser/getCurrentUserPermissions/generateRoutes/处理generateRoutes的结果 error clearToken ==')
63
61
  store.dispatch('clearToken').then(() => {
64
62
  Message.error(err || 'Verification failed, please login again')
65
63
  next({ path: '/' })
@@ -67,26 +65,22 @@ router.beforeEach((to, from, next) => {
67
65
  })
68
66
  }
69
67
  }).catch((err) => {
70
- console.log('isLoginTimeOut请求出错 clearToken ==')
71
68
  store.dispatch('clearToken').then(() => {
72
69
  Message.error(err || 'Verification failed, please login again')
73
70
  next({ path: '/' })
74
71
  })
75
72
  })
76
73
  } else {
77
- // sessionStorage.setItem(new Date().getTime() + '-name!==null-from~~toPath', from.path + '~~' + to.path)
74
+ sessionStorage.setItem(new Date().getTime() + '-name!==null-from~~toPath', from.path + '~~' + to.path)
78
75
  console.log('router.beforeEach-store.getters.name ==', store.getters.name)
79
76
  next()
80
77
  }
81
78
  }
82
79
  } else {
83
- console.log('to.path是白名单路径[/login,/update-password, /forget-password, /reset-password,/redirect];或token为空', 'to.path=', to.path)
84
80
  if (whiteList.indexOf(to.path) !== -1) {
85
- console.log('to.path是白名单路径[/login,/update-password, /forget-password, /reset-password,/redirect]', 'to.path=', to.path)
86
81
  next()
87
82
  } else {
88
83
  // 必须使用to.fullPath,fullPath是带有参数的,to.path没有参数,会导致跳转到的页面参数丢失
89
- console.log('token为空跳转到/login登录页面', 'to.path=', to.path, 'to.fullPath=', to.fullPath)
90
84
  next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
91
85
  NProgress.done()
92
86
  }
@@ -7,7 +7,7 @@ import Router from 'vue-router'
7
7
  Vue.use(Router)
8
8
 
9
9
  /* Layout */
10
- import Layout from '../views/layout/Layout'
10
+ import Layout from '../views/layout/NewLayout'
11
11
 
12
12
  /**
13
13
  * hidden: true if `hidden:true` will not show in the sidebar(default is false)
@@ -33,6 +33,18 @@ export const publicRouterMap = [
33
33
  }
34
34
  ]
35
35
  },
36
+ {
37
+ path: '/iframe-page',
38
+ component: Layout,
39
+ hidden: true,
40
+ children: [
41
+ {
42
+ path: 'page',
43
+ component: () => import('../views/layout/components/iframe-page'),
44
+ hidden: true
45
+ }
46
+ ]
47
+ },
36
48
  // {
37
49
  // path: '/login',
38
50
  // component: () => import('../views/login/index'),
@@ -52,6 +64,11 @@ export const publicRouterMap = [
52
64
  path: '/401',
53
65
  component: () => import('../views/error-page/401'),
54
66
  hidden: true
67
+ },
68
+ {
69
+ path: '/show-sub-wf-history',
70
+ component: () => import('../views/wf-history/tache-subprocess-history'),
71
+ hidden: true
55
72
  }
56
73
 
57
74
  ]
@@ -6,6 +6,7 @@ const getters = {
6
6
  // routers: state => state.permission.routers,
7
7
  protectedRouters: state => state.permission.protectedRouters,
8
8
  currentUserPermissions: state => state.permission.currentUserPermissions,
9
- preventReclick: state => state.app.preventReclick
9
+ preventReclick: state => state.app.preventReclick,
10
+ menus: state => state.user.menus
10
11
  }
11
12
  export default getters
@@ -6,7 +6,8 @@ import { removePermissions, getPermissions, setPermissions } from '../../utils/p
6
6
  const user = {
7
7
  state: {
8
8
  token: '',
9
- name: ''
9
+ name: '',
10
+ menus: []
10
11
  },
11
12
 
12
13
  mutations: {
@@ -15,6 +16,9 @@ const user = {
15
16
  },
16
17
  setName: (state, name) => {
17
18
  state.name = name
19
+ },
20
+ setMenus: (state, menus) => {
21
+ state.menus = menus
18
22
  }
19
23
  },
20
24
 
@@ -148,6 +152,17 @@ const user = {
148
152
  reject(error)
149
153
  })
150
154
  })
155
+ },
156
+ // 获得有权限的菜单集合
157
+ getPermissionMenus({ commit }, systemCode) {
158
+ return new Promise((resolve, reject) => {
159
+ ssoService.getUserPermissionMenusBySystemCode(systemCode).then(menus => {
160
+ commit('setMenus', menus)
161
+ resolve(menus)
162
+ }).catch(error => {
163
+ reject(error)
164
+ })
165
+ })
151
166
  }
152
167
 
153
168
  }
@@ -8,7 +8,7 @@ body {
8
8
  }
9
9
  // 省略号
10
10
  .ellipsis{
11
- display: inline-block;
11
+ // display: inline-block;
12
12
  overflow:hidden;
13
13
  text-overflow:ellipsis;
14
14
  white-space:nowrap;
@@ -112,6 +112,11 @@ body .el-table colgroup.gutter{
112
112
  .form-container .el-form .el-card:last-child{
113
113
  margin-bottom:0;
114
114
  }
115
+ // 带有tab页签的表单高度
116
+ .tab-form-container{
117
+ height:calc(100vh - 190px);
118
+ overflow: auto;
119
+ }
115
120
 
116
121
 
117
122
  // 解决tab页签中内容多时没有滚动条问题
@@ -267,7 +272,11 @@ body .el-table colgroup.gutter{
267
272
  .form-container .el-form .el-card:last-child{
268
273
  margin-bottom:0;
269
274
  }
270
-
275
+ // 带有tab页签的表单高度
276
+ .tab-form-container{
277
+ height:calc(100vh - 190px);
278
+ overflow: auto;
279
+ }
271
280
  // 解决tab页签中内容多时没有滚动条问题
272
281
  .el-tabs__content{
273
282
  flex-grow: 1;
@@ -0,0 +1,125 @@
1
+ class CalculatorFactory {
2
+ constructor() {
3
+ if (new.target === CalculatorFactory) {
4
+ throw new Error('抽象类不能实例化!')
5
+ }
6
+ }
7
+ /**
8
+ * 空IS NULL操作符时相的处理
9
+ * @param leftVale
10
+ * @param operator
11
+ * @return
12
+ */
13
+ isNullValue(leftValue, operator) {
14
+ return (leftValue === undefined || leftValue === null || leftValue + '' === '') && operator === 'IS_NULL'
15
+ }
16
+ /**
17
+ * 空IS NOT NULL操作符时的处理
18
+ * @param leftVale
19
+ * @param operator
20
+ * @return true 表示给定的值不为空
21
+ */
22
+ isNotNullValue(leftValue, operator) {
23
+ return (leftValue !== undefined && leftValue !== null && leftValue + '' !== '') && operator === 'IS_NOT_NULL'
24
+ }
25
+ /**
26
+ * 空值时相等的处理
27
+ * @param leftVale
28
+ * @param operator
29
+ * @param rightValue
30
+ * @return
31
+ */
32
+ isEQEmptyValue(leftVale, operator, rightValue) {
33
+ return (leftVale === undefined || leftVale === null || leftVale + '' === '') &&
34
+ (rightValue === undefined || rightValue === null || rightValue + '' === '') &&
35
+ (operator === 'EQ' || operator === 'CONTAIN')
36
+ }
37
+ }
38
+
39
+ class NumberCalculator extends CalculatorFactory {
40
+ constructor(leftVale, operator, rightValue) {
41
+ super()
42
+ if (this.isNotNullValue(leftVale, operator)) {
43
+ this.result = true
44
+ } else if (this.isNullValue(leftVale, operator)) {
45
+ this.result = true
46
+ } else if (this.isEQEmptyValue(leftVale, operator, rightValue)) {
47
+ this.result = true
48
+ } else if (leftVale === null) {
49
+ this.result = false
50
+ } else {
51
+ const preOperand = Number(leftVale + '')
52
+ const value = Number(rightValue + '')
53
+ if (operator === 'GET') {
54
+ this.result = preOperand >= value
55
+ } else if (operator === 'LET') {
56
+ this.result = preOperand <= value
57
+ } else if (operator === 'GT') {
58
+ this.result = preOperand > value
59
+ } else if (operator === 'LT') {
60
+ this.result = preOperand < value
61
+ } else if (operator === 'NET') {
62
+ this.result = preOperand !== value
63
+ } else if (operator === 'EQ') {
64
+ this.result = preOperand === value
65
+ } else if (operator === 'IS_NULL') {
66
+ this.result = leftVale === undefined || leftVale === null
67
+ } else if (operator === 'IS_NOT_NULL') {
68
+ this.result = leftVale !== undefined && leftVale !== null
69
+ } else {
70
+ throw new Error('表达式不合法:' + leftVale + ' ' + operator + ' ' + rightValue)
71
+ }
72
+ }
73
+ }
74
+ }
75
+ class TextCalculator extends CalculatorFactory {
76
+ constructor(leftVale, operator, rightValue) {
77
+ super()
78
+ if (this.isNullValue(leftVale, operator)) {
79
+ this.result = true
80
+ } else if (this.isEQEmptyValue(leftVale, operator, rightValue)) {
81
+ this.result = true
82
+ } else if (this.isNotNullValue(leftVale, operator)) {
83
+ this.result = true
84
+ } else if (leftVale === null) {
85
+ this.result = false
86
+ } else {
87
+ if (operator === 'NET') {
88
+ this.result = leftVale !== rightValue
89
+ } else if (operator === 'EQ') {
90
+ this.result = leftVale === rightValue
91
+ } else if (operator === 'NOT_CONTAIN') {
92
+ this.result = !leftVale.includes(rightValue)
93
+ } else if (operator === 'CONTAIN') {
94
+ this.result = leftVale.includes(rightValue)
95
+ } else if (operator === 'IS_NULL') {
96
+ this.result = leftVale === undefined || leftVale === null || leftVale === ''
97
+ } else if (operator === 'IS_NOT_NULL') {
98
+ this.result = leftVale !== undefined && leftVale !== null && leftVale !== ''
99
+ } else {
100
+ throw new Error('表达式不合法:' + leftVale + ' ' + operator + ' ' + rightValue)
101
+ }
102
+ }
103
+ }
104
+ }
105
+
106
+ export function getAbstractUserFactory(dataType) {
107
+ switch (dataType) {
108
+ case 'TEXT':
109
+ return TextCalculator
110
+ case 'DOUBLE':
111
+ return NumberCalculator
112
+ case 'FLOAT':
113
+ return NumberCalculator
114
+ case 'INTEGER':
115
+ return NumberCalculator
116
+ case 'LONG':
117
+ return NumberCalculator
118
+ case 'DATE':
119
+ return NumberCalculator
120
+ case 'TIME':
121
+ return NumberCalculator
122
+ default:
123
+ return TextCalculator
124
+ }
125
+ }
@@ -0,0 +1,6 @@
1
+ import { getAbstractUserFactory } from './calculator-factory'
2
+ export function executeExpression(leftValue, operator, rightValue, dataType) {
3
+ const Calculator = getAbstractUserFactory(dataType)
4
+ const calculatorObj = new Calculator(leftValue, operator, rightValue)
5
+ return calculatorObj.result
6
+ }
@@ -25,7 +25,11 @@ export function getRelativeBaseUrl(originalBaseUrl) {
25
25
  relativeUrl = relativeUrl.substring(0, relativeUrl.lastIndexOf('/'))
26
26
  }
27
27
  // console.log('getRelativeBaseUrl---relativeUrl=',relativeUrl)
28
- return relativeUrl + baseUrlSuffix
28
+ if (baseUrlSuffix) {
29
+ return relativeUrl + baseUrlSuffix
30
+ } else {
31
+ return relativeUrl
32
+ }
29
33
  }
30
34
  }
31
35
  return originalBaseUrl
@@ -136,3 +140,19 @@ export function isShowSystemMenu() {
136
140
  }
137
141
  return showSystemMenu === 'true'
138
142
  }
143
+
144
+ export function getSystemFrontendUrl(frontendUrl) {
145
+ if (Vue.prototype.projectModel && Vue.prototype.projectModel === 'developing.model' && Vue.prototype.frontUrl) {
146
+ return Vue.prototype.frontUrl
147
+ } else {
148
+ return getRelativeBaseUrl(frontendUrl)
149
+ }
150
+ }
151
+
152
+ export function getSystemBackendUrl(backendUrl) {
153
+ if (Vue.prototype.projectModel && Vue.prototype.projectModel === 'developing.model' && Vue.prototype.baseURL) {
154
+ return Vue.prototype.baseURL
155
+ } else {
156
+ return getRelativeBaseUrl(backendUrl)
157
+ }
158
+ }
@@ -0,0 +1,2 @@
1
+ import Vue from 'vue'
2
+ export default new Vue()
@@ -0,0 +1,23 @@
1
+ import sessionStorage from 'sessionstorage'
2
+ import Vue from 'vue'
3
+
4
+ export function getRedisButtonGeneralIcon(buttonCode) {
5
+ let buttonIcon = ''
6
+ const buttonIcons = sessionStorage.getItem('button-icon')
7
+ if (buttonIcons && buttonIcons !== undefined && buttonIcons !== 'undefined') {
8
+ const buttonIconMap = JSON.parse(buttonIcons)
9
+ buttonIcon = buttonIconMap[buttonCode]
10
+ }
11
+ return buttonIcon
12
+ }
13
+
14
+ export function findRedisButtonGeneralIcon() {
15
+ return new Promise((resolve, reject) => {
16
+ Vue.prototype.$http.get(Vue.prototype.baseAPI + '/component/general-icon/find-redis-button-icon').then(data => {
17
+ sessionStorage.setItem('button-icon', JSON.stringify(data))
18
+ resolve(data)
19
+ }).catch(error => {
20
+ reject(error)
21
+ })
22
+ })
23
+ }