imatrix-ui 2.9.15-dw-tmp2 → 2.9.16-boe10

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 (194) hide show
  1. package/lib/super-ui.css +1 -1
  2. package/lib/super-ui.umd.min.js +5 -35
  3. package/package.json +2 -2
  4. package/src/api/sso-service.js +19 -1
  5. package/src/assets/nonemessage.png +0 -0
  6. package/src/i18n/i18n.js +1 -1
  7. package/src/i18n/langs/cn.js +18 -6
  8. package/src/i18n/langs/en.js +20 -7
  9. package/src/permission.js +2 -2
  10. package/src/plugins.js +3 -3
  11. package/src/router/index.js +10 -0
  12. package/src/store/modules/tab-content.js +6 -0
  13. package/src/store/modules/user.js +32 -2
  14. package/src/styles/display-layout.scss +1 -1
  15. package/src/styles/index.scss +74 -4
  16. package/src/styles/theme/black/font-style.scss +70 -0
  17. package/src/styles/theme/black/index.scss +6 -30
  18. package/src/styles/theme/blue/font-style.scss +37 -0
  19. package/src/styles/theme/blue/index.scss +2 -18
  20. package/src/styles/theme/blue2/font-style.scss +70 -0
  21. package/src/styles/theme/blue2/index.scss +3 -13
  22. package/src/styles/theme/dark-blue/card.scss +4 -6
  23. package/src/styles/theme/dark-blue/form.scss +7 -4
  24. package/src/styles/theme/dark-blue/index.scss +30 -5
  25. package/src/styles/theme/dark-blue/message.scss +8 -0
  26. package/src/styles/theme/dark-blue/radio.scss +13 -0
  27. package/src/styles/theme/dark-blue/sidebar.scss +7 -37
  28. package/src/styles/theme/dark-blue/tab.scss +4 -1
  29. package/src/styles/theme/dark-blue/table.scss +1 -1
  30. package/src/styles/theme/dark-blue/tree.scss +35 -10
  31. package/src/styles/theme/gray/card-style.scss +13 -1
  32. package/src/styles/theme/gray/font-style.scss +38 -0
  33. package/src/styles/theme/gray/index.scss +13 -25
  34. package/src/styles/theme/gray/scrollbar-style.scss +32 -0
  35. package/src/styles/theme/gray/sidebar.scss +7 -14
  36. package/src/utils/auth-api.js +47 -1
  37. package/src/utils/common-util.js +22 -81
  38. package/src/utils/jump-page-utils.js +8 -10
  39. package/src/utils/range-selector.js +185 -0
  40. package/src/utils/request.js +6 -3
  41. package/src/utils/util.js +13 -11
  42. package/src/utils/workflow-util.js +3 -0
  43. package/src/views/dsc-component/Sidebar/Item.vue +7 -5
  44. package/src/views/dsc-component/Sidebar/SidebarItem.vue +2 -3
  45. package/src/views/dsc-component/Sidebar/index.vue +12 -20
  46. package/src/views/dsc-component/tabs/tab-content.vue +8 -9
  47. package/src/views/layout/EmptyLayout.vue +4 -1
  48. package/src/views/layout/NewLayout.vue +6 -65
  49. package/src/views/layout/components/AppMain.vue +2 -1
  50. package/src/views/layout/components/Menubar/Item.vue +23 -7
  51. package/src/views/layout/components/Menubar/Link.vue +11 -2
  52. package/src/views/layout/components/Menubar/SidebarItem.vue +50 -7
  53. package/src/views/layout/components/Menubar/index.vue +51 -16
  54. package/src/views/layout/components/tabs/tab-content.vue +162 -0
  55. package/src/views/layout/tab-content-iframe-index.vue +31 -0
  56. package/src/views/layout/tab-content-index.vue +85 -0
  57. package/src/views/login/index.vue +1 -1
  58. package/packages/breadcrumb/index.js +0 -6
  59. package/packages/breadcrumb/src/breadcrumb.vue +0 -71
  60. package/packages/department-tree/index.js +0 -6
  61. package/packages/department-tree/src/department-tree.vue +0 -108
  62. package/packages/department-tree-inline/index.js +0 -6
  63. package/packages/department-tree-inline/src/department-multi-tree-inline.vue +0 -408
  64. package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -290
  65. package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
  66. package/packages/department-tree-inline/src/department-tree-service.js +0 -273
  67. package/packages/department-tree-inline/src/search-result.vue +0 -176
  68. package/packages/department-user-tree/index.js +0 -6
  69. package/packages/department-user-tree/src/department-user-multiple-tree.vue +0 -116
  70. package/packages/department-user-tree/src/department-user-single-tree.vue +0 -76
  71. package/packages/department-user-tree/src/department-user-tree.vue +0 -101
  72. package/packages/department-user-tree-inline/index.js +0 -6
  73. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +0 -636
  74. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -271
  75. package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +0 -79
  76. package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +0 -248
  77. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -142
  78. package/packages/department-user-tree-inline/src/search-result.vue +0 -197
  79. package/packages/directives/prevent-reclick.js +0 -19
  80. package/packages/dynamic-source-select/index.js +0 -6
  81. package/packages/dynamic-source-select/src/dynamic-source-select-service.js +0 -70
  82. package/packages/dynamic-source-select/src/dynamic-source-select.vue +0 -440
  83. package/packages/dynamic-source-select/src/events.js +0 -55
  84. package/packages/fs-preview/index.js +0 -6
  85. package/packages/fs-preview/src/fs-preview.vue +0 -226
  86. package/packages/fs-upload/index.js +0 -6
  87. package/packages/fs-upload/src/fs-upload-multi.vue +0 -420
  88. package/packages/fs-upload/src/fs-upload-single.vue +0 -312
  89. package/packages/fs-upload/src/fs-upload.vue +0 -189
  90. package/packages/fs-upload/src/see-big-picture.vue +0 -55
  91. package/packages/fs-upload-list/index.js +0 -6
  92. package/packages/fs-upload-list/src/fs-upload-list.vue +0 -287
  93. package/packages/hamburger/index.js +0 -6
  94. package/packages/hamburger/src/hamburger.vue +0 -38
  95. package/packages/index.js +0 -121
  96. package/packages/multipart-upload/index.js +0 -6
  97. package/packages/multipart-upload/src/index.vue +0 -73
  98. package/packages/multipart-upload/src/multipart-upload-form.vue +0 -297
  99. package/packages/multipart-upload/src/multipart-upload-list.vue +0 -378
  100. package/packages/organization-input/index.js +0 -6
  101. package/packages/organization-input/src/organization-input.vue +0 -542
  102. package/packages/plugins/export-data-new.js +0 -466
  103. package/packages/plugins/export-data.js +0 -361
  104. package/packages/plugins/index.js +0 -15
  105. package/packages/plugins/public-method.js +0 -43
  106. package/packages/remove-department/index.js +0 -6
  107. package/packages/remove-department/src/remove-department.vue +0 -172
  108. package/packages/remove-department/src/remove-dept-service.js +0 -20
  109. package/packages/remove-user/index.js +0 -6
  110. package/packages/remove-user/src/remove-user-service.js +0 -20
  111. package/packages/remove-user/src/remove-user.vue +0 -195
  112. package/packages/remove-workgroup/index.js +0 -6
  113. package/packages/remove-workgroup/src/remove-workgroup-service.js +0 -20
  114. package/packages/remove-workgroup/src/remove-workgroup.vue +0 -159
  115. package/packages/rich-editor/index.js +0 -7
  116. package/packages/rich-editor/index.vue +0 -278
  117. package/packages/rich-editor/langs/zh-Hans.js +0 -1
  118. package/packages/rich-editor/viewer.vue +0 -103
  119. package/packages/scan-code-input/index.js +0 -6
  120. package/packages/scan-code-input/src/events.js +0 -33
  121. package/packages/scan-code-input/src/scan-code-input-colse.vue +0 -131
  122. package/packages/scan-code-input/src/scan-code-input.vue +0 -116
  123. package/packages/secret-info/index.js +0 -7
  124. package/packages/secret-info/index.vue +0 -90
  125. package/packages/super-grid/index.js +0 -7
  126. package/packages/super-grid/src/apis.js +0 -820
  127. package/packages/super-grid/src/columns-config.vue +0 -335
  128. package/packages/super-grid/src/custom-formatter.js +0 -278
  129. package/packages/super-grid/src/dynamic-input.vue +0 -1279
  130. package/packages/super-grid/src/eventBus.js +0 -2
  131. package/packages/super-grid/src/events.js +0 -55
  132. package/packages/super-grid/src/formValidatorUtil.js +0 -226
  133. package/packages/super-grid/src/formatter.js +0 -181
  134. package/packages/super-grid/src/group-column.vue +0 -100
  135. package/packages/super-grid/src/header-context-menu.vue +0 -87
  136. package/packages/super-grid/src/index-column.vue +0 -51
  137. package/packages/super-grid/src/normal-column.vue +0 -771
  138. package/packages/super-grid/src/public-methods.js +0 -31
  139. package/packages/super-grid/src/row-operation.vue +0 -161
  140. package/packages/super-grid/src/search-button.vue +0 -66
  141. package/packages/super-grid/src/search-condition-input.vue +0 -61
  142. package/packages/super-grid/src/search-condition-list.vue +0 -59
  143. package/packages/super-grid/src/search-form-advancedQuery.vue +0 -653
  144. package/packages/super-grid/src/search-form-dialog.vue +0 -79
  145. package/packages/super-grid/src/search-form-item.vue +0 -404
  146. package/packages/super-grid/src/search-form-number.vue +0 -38
  147. package/packages/super-grid/src/search-form-open.vue +0 -170
  148. package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -196
  149. package/packages/super-grid/src/search-form.vue +0 -642
  150. package/packages/super-grid/src/search-methods.js +0 -448
  151. package/packages/super-grid/src/selection-column.vue +0 -43
  152. package/packages/super-grid/src/store.js +0 -3
  153. package/packages/super-grid/src/super-grid-service.js +0 -593
  154. package/packages/super-grid/src/super-grid.vue +0 -2882
  155. package/packages/super-grid/src/utils.js +0 -762
  156. package/packages/super-grid/src/view-image-dialog.vue +0 -130
  157. package/packages/super-nine-grid/index.js +0 -7
  158. package/packages/super-nine-grid/src/apis.js +0 -103
  159. package/packages/super-nine-grid/src/custom-formatter.js +0 -66
  160. package/packages/super-nine-grid/src/formatter.js +0 -132
  161. package/packages/super-nine-grid/src/search-form-number.vue +0 -38
  162. package/packages/super-nine-grid/src/search-form.vue +0 -430
  163. package/packages/super-nine-grid/src/search-methods.js +0 -134
  164. package/packages/super-nine-grid/src/store.js +0 -3
  165. package/packages/super-nine-grid/src/super-grid-service.js +0 -91
  166. package/packages/super-nine-grid/src/super-nine-grid.vue +0 -872
  167. package/packages/super-nine-grid/src/utils.js +0 -261
  168. package/packages/svg-icon/index.js +0 -6
  169. package/packages/svg-icon/src/svg-icon.vue +0 -43
  170. package/packages/utils/memory-cache-utils.js +0 -90
  171. package/packages/utils/utils.js +0 -152
  172. package/packages/utils/value-set.js +0 -86
  173. package/packages/valid-code/index.js +0 -7
  174. package/packages/valid-code/src/valid-code.vue +0 -95
  175. package/packages/workflow-button/index.js +0 -6
  176. package/packages/workflow-button/src/workflow-button.vue +0 -325
  177. package/packages/workflow-history-list/index.js +0 -6
  178. package/packages/workflow-history-list/src/api.js +0 -7
  179. package/packages/workflow-history-list/src/workflow-history-list.vue +0 -185
  180. package/packages/workgroup-tree/index.js +0 -6
  181. package/packages/workgroup-tree/src/workgroup-tree.vue +0 -76
  182. package/packages/workgroup-tree-inline/index.js +0 -6
  183. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +0 -317
  184. package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +0 -43
  185. package/packages/workgroup-user-tree/index.js +0 -6
  186. package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +0 -100
  187. package/packages/workgroup-user-tree-inline/index.js +0 -6
  188. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +0 -163
  189. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +0 -436
  190. package/packages/year-range-picker/index.js +0 -6
  191. package/packages/year-range-picker/src/year-range-picker.vue +0 -51
  192. package/report.20190716.140129.216348.001.json +0 -354
  193. package/src/index.js +0 -93
  194. package/src/styles/theme/gray/form-style.scss +0 -41
@@ -1,163 +0,0 @@
1
- import Vue from 'vue'
2
- import { getI18n } from '../../../src/utils/util'
3
- const workgroupTreeInlineService = {
4
- // 后台查询部门,并拼接树节点
5
- filterAppendNodes(value) {
6
- this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/searches', this.searchParam).then(result => {
7
- if (result) {
8
- if (result.length === 0) {
9
- this.$message({
10
- showClose: true,
11
- type: 'error',
12
- message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
13
- })
14
- return
15
- }
16
- // result的格式为[WORKGROUP~1,WORKGROUP~4,WORKGROUP~10]
17
- result.forEach(nodeId => {
18
- var dataId = nodeId
19
- // 节点类型和数据id的分隔符
20
- var nodeTypeAndDataIdSeparator = '~'
21
- // nodeId格式为WORKGROUP~4
22
- if (nodeId.indexOf(nodeTypeAndDataIdSeparator) > -1) {
23
- dataId = nodeId.substring(nodeId.indexOf('~') + 1)
24
- }
25
- if (this.allSearchNodeIds.indexOf(nodeId) === -1) {
26
- // 表示没有加载过该节点,需要放到allSearchNodeIds集合中,并加载该节点内容
27
- this.allSearchNodeIds.push(nodeId)
28
- this.loadWorkgroup(dataId, nodeId, true, value)
29
- }
30
- })
31
- } else {
32
- this.$message({
33
- showClose: true,
34
- type: 'error',
35
- message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
36
- })
37
- }
38
- })
39
- },
40
- // 选中节点时
41
- checkedNode(data, isClickNode) {
42
- const children = data.children
43
- if (children && children.length > 0) {
44
- // 展开当前选中的节点
45
- this.$refs.workgroupUserTree.store.nodesMap[data.nodeId].expanded = true
46
- // 选中当前节点及其子节点
47
- this.checkedNodeAndChildren(data)
48
- } else {
49
- if (!data.leaf) {
50
- // 不是叶子节点,并且没有加载过该父节点的子节点时,需要走后台展开子节点
51
- if (!isClickNode) {
52
- var param = {
53
- parentId: data.id,
54
- departmentInfo: this.branchInfo
55
- }
56
- this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/workgroup-users', param).then(result => {
57
- // 更新当前点击的节点的子节点
58
- this.$refs.workgroupUserTree.updateKeyChildren(data.nodeId, result)
59
- // 展开当前选中的节点
60
- this.$refs.workgroupUserTree.store.nodesMap[data.nodeId].expanded = true
61
- // 获得所有应该选中的节点
62
- this.checkedNodeAndChildren(data)
63
- })
64
- } else {
65
- this.isClickNode = true
66
- }
67
- }
68
- }
69
- },
70
- // 获得所有指定工作组下的用户信息
71
- getAllSelectedWorkgroupUsers(parentIds, selectNodeInfo) {
72
- this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/user-in-workgroups', parentIds).then(users => {
73
- users.forEach(user => {
74
- this.addSelectedUserInfo(selectNodeInfo, user)
75
- })
76
- if (selectNodeInfo.userIds.length > 0) {
77
- this.$emit('result', selectNodeInfo)
78
- } else {
79
- this.$alert(getI18n().t('imatrixUIMessage.pleaseSelectPersonnel'), getI18n().t('imatrixUIMessage.tips'), {
80
- confirmButtonText: getI18n().t('imatrixUIPublicModel.sure')
81
- })
82
- }
83
- })
84
- },
85
- // 初始化树 或 点击三角展开节点时动态加载子节点
86
- loadNode(node, resolve) {
87
- var parentId = 0
88
- var parentNodeId = '0'
89
- if (node.level === 0) {
90
- // 表示初始化树
91
- parentId = 0
92
- parentNodeId = '0'
93
- } else {
94
- parentId = node.data.id
95
- parentNodeId = node.data.nodeId
96
- }
97
- var checkedKeys = []
98
- if (this.$refs.workgroupUserTree) {
99
- checkedKeys = this.$refs.workgroupUserTree.getCheckedKeys()
100
- }
101
- // 初始化部门树
102
- this.initLoad(parentId, parentNodeId, node, resolve, checkedKeys)
103
- },
104
- // 初始化部门树
105
- initLoad(parentId, parentNodeId, node, resolve, checkedKeys) {
106
- const param = {
107
- parentId: parentId,
108
- departmentInfo: this.branchInfo
109
- }
110
- this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/workgroup-users', param).then(data => {
111
- resolve(data)
112
- // 更新当前点击的节点的子节点
113
- this.$refs.workgroupUserTree.updateKeyChildren(parentNodeId, data)
114
- if (parentId === 0) {
115
- // 初始化树时,展开公司节点
116
- const tenantData = data[0].data
117
- this.tenantInfo = JSON.parse(tenantData)
118
- this.containBranch = data[0].containBranch
119
- // 加载整个组织结构树时,展开公司节点
120
- this.loadWorkgroup(this.tenantNodeId, this.tenantNodeId + '')
121
- }
122
- if (this.isClickNode) {
123
- // 表示点击工作组节点选中时展开
124
- this.isClickNode = false
125
- this.checkedNode(node.data)
126
- } else {
127
- // 表示是点击三角展开节点时
128
- if (checkedKeys && checkedKeys.indexOf(parentNodeId) > -1) {
129
- // 点击公司名称前的三角标识展开节点时,保持当前节点的选中状态
130
- // 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
131
- this.checkedNode(node.data)
132
- }
133
- }
134
- })
135
- },
136
- // 加载当前节点的子节点
137
- loadWorkgroup(parentId, parentNodeId, isSearch, searchValue) {
138
- const param = {
139
- parentId: parentId,
140
- departmentInfo: this.branchInfo
141
- }
142
- this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/workgroup-users', param).then(children => {
143
- this.$refs.workgroupUserTree.updateKeyChildren(parentNodeId, children)
144
- if (this.$refs.workgroupUserTree.store.nodesMap[parentNodeId]) {
145
- this.$refs.workgroupUserTree.store.nodesMap[parentNodeId].expanded = true
146
- }
147
- if (isSearch) {
148
- // 查询时处理
149
- if (this.allExpandNodeIds.indexOf(parentNodeId) === -1) {
150
- // allExpandNodeIds集合中是否包含当前parentId节点id
151
- this.allExpandNodeIds.push(parentNodeId)
152
- }
153
- if (this.allExpandNodeIds.length === this.allSearchNodeIds.length) {
154
- // 表示所有节点已展开,执行树的过滤方法
155
- this.$refs.workgroupUserTree.filter(searchValue)
156
- this.allExpandNodeIds = []
157
- this.allSearchNodeIds = []
158
- }
159
- }
160
- })
161
- }
162
- }
163
- export default workgroupTreeInlineService
@@ -1,436 +0,0 @@
1
- <template>
2
- <div>
3
- <el-container style="height: 395px">
4
- <el-header style="text-align: right; font-size: 12px;height: 35px">
5
- <el-autocomplete
6
- v-model="filterText"
7
- size="small"
8
- select-when-unmatched
9
- class="inline-input inline-input-custom"
10
- :fetch-suggestions="querySearch"
11
- :placeholder="$t('departmentUserTree.pleaseEnterUserInformation')"
12
- :trigger-on-focus="false"
13
- @select="handleSelect"
14
- @keyup.enter.native="clickSearch"
15
- >
16
- <el-button slot="append" icon="el-icon-search" @click="clickSearch" />
17
- </el-autocomplete>
18
- </el-header>
19
- <el-main style="padding: 10px">
20
- <div style="padding-top:5px;overflow:auto;width: auto;display: inline-block !important;">
21
- <el-tree
22
- ref="workgroupUserTree"
23
- :props="defaultProps"
24
- :load="loadNode"
25
- lazy
26
- :show-checkbox="multiple"
27
- node-key="nodeId"
28
- :render-content="renderContent"
29
- :filter-node-method="filterNode"
30
- @check="handleCheckNode"
31
- @node-click="handleNodeClick"
32
- />
33
- </div>
34
- </el-main>
35
- </el-container>
36
- </div>
37
- </template>
38
- <style>
39
- .searchResult {
40
- color:red
41
- }
42
- .inline-input-custom {
43
- width : 90%
44
- }
45
- </style>
46
-
47
- <script>
48
- import localStorage from '../../../src/utils/local-storage'
49
- import utils from '../../utils/utils'
50
- import workgroupTreeInlineService from './workgroup-tree-inline-service'
51
- export default {
52
- name: 'InlineWorkgroupUserTree',
53
- props: {
54
- // 是否是多选树,默认是true
55
- multiple: {
56
- type: Boolean,
57
- default: true
58
- },
59
- // 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
60
- branchInfo: {
61
- type: Array,
62
- default: null
63
- },
64
- // 多选用户树时,已选择用户id或登录名集合,多个之间以逗号隔开
65
- selectUserInfo: {
66
- type: [String, Number],
67
- default: null
68
- },
69
- // 移除用户时,用户属性名称:id、loginName、email、telephone,默认是loginName
70
- searchField: {
71
- type: String,
72
- default: 'loginName'
73
- },
74
- // 多选树时结果之间的分隔符,默认是逗号分隔
75
- separator: {
76
- type: String,
77
- default: ','
78
- }
79
-
80
- },
81
- data() {
82
- return {
83
- filterText: '',
84
- defaultProps: {
85
- id: 'id',
86
- label: 'name',
87
- children: 'children',
88
- isLeaf: 'leaf'
89
- },
90
- searchParam: {
91
- userField: null,
92
- searchValue: null,
93
- treeType: 'MAN_GROUP_TREE',
94
- departmentInfo: null
95
- },
96
- containBranch: false, // 当前租户内是否包含分支机构。获得当前选中部门名称时,如果有分支,则需要将分支名称返回给用户,例如:部门1(分支1)
97
- tenantNodeId: -1, // 公司节点的id
98
- allSearchNodeIds: [], // 用于保存所有查询出的节点id
99
- allExpandNodeIds: [], // 用于保存allSearchNodeIds中所有已加载子节点的id集合
100
- isClickNode: false,
101
- restaurants: [], // 查询的备选值
102
- searchValue: null, // 查询条件
103
- searchStoreKey: 'searchWorkgroupUser',
104
- selectNodeInfo: null, // 单选时,选择的用户信息
105
- tenantInfo: {} // 公司根节点信息
106
- }
107
- },
108
- computed: {
109
- },
110
- watch: {
111
- filterText(val) {
112
- if (!val) {
113
- this.searchValue = val
114
- // 清空查询内容时,重新加载整个树
115
- this.loadWorkgroup(this.tenantNodeId, this.tenantNodeId + '')
116
- }
117
- }
118
- },
119
- created() {
120
- },
121
- mounted() {
122
- var searchWorkgroup = localStorage.getObject(this.searchStoreKey)
123
- if (searchWorkgroup) {
124
- this.restaurants = searchWorkgroup
125
- } else {
126
- this.restaurants = []
127
- }
128
- },
129
- methods: {
130
- ...utils,
131
- ...workgroupTreeInlineService,
132
- handleSelect(item) {
133
- this.handleSelectUtil(item, localStorage)
134
- },
135
- search(value) {
136
- this.searchValue = value
137
- let mySearchValue = value
138
- if (mySearchValue) {
139
- mySearchValue = mySearchValue.trim()
140
- }
141
- this.searchParam.searchValue = mySearchValue
142
- this.searchParam.departmentInfo = this.branchInfo
143
- // this.searchParam.userField = this.searchField
144
- // 后台查询部门,并拼接树节点
145
- this.filterAppendNodes(value)
146
- },
147
- // 点击查询按钮调用的方法
148
- clickSearch() {
149
- this.storeSeachValue(localStorage, this.searchStoreKey, this.filterText)
150
- this.search(this.filterText)
151
- },
152
- filterNode(value, data, node) {
153
- if (!value) {
154
- return true
155
- } else {
156
- if (data.nodeType && data.nodeType === 'USER') {
157
- // data.data是用户的所有数据
158
- const user = JSON.parse(data.data)
159
- return this.filterUserVal(user, value)
160
- } else {
161
- // 表示不是用户节点
162
- return false
163
- }
164
- }
165
- },
166
- filterUserVal(user, searchVal) {
167
- const searchFields = ['name', 'loginName', 'email', 'telephone', 'jobNumber', 'honorificName']
168
- let isHasVal = false
169
- for (let i = 0; i < searchFields.length; i++) {
170
- const searchField = searchFields[i]
171
- const userValue = user[searchField]
172
- if (userValue.indexOf(searchVal) !== -1 || (searchField === 'name' && user['enName'] && user['enName'].indexOf(searchVal) !== -1)) {
173
- isHasVal = true
174
- } else {
175
- isHasVal = false
176
- break
177
- }
178
- }
179
- return isHasVal
180
- },
181
- // 点击复选框时处理
182
- handleCheckNode(data, checkObj) {
183
- if (checkObj.checkedKeys.indexOf(data.nodeId) > -1) {
184
- // 表示正选中data节点
185
- this.checkedNode(data, false)
186
- } else {
187
- // 表示正取消选中data节点,同时要取消其子节点的选中状态
188
- this.cancelCheckedNode(data)
189
- }
190
- },
191
- // 选中当前节点及其子节点
192
- checkedNodeAndChildren(data) {
193
- // 取消选中状态时,保持节点是展开的状态,不要折叠
194
- this.$refs.workgroupUserTree.store.nodesMap[data.nodeId].expanded = true
195
- // 获得所有应该选中的节点
196
- this.$refs.workgroupUserTree.setChecked(data.nodeId, true)
197
- const children = data.children
198
- if (children) {
199
- // 递归设置子子节点的选中状态
200
- children.forEach(nodeData => {
201
- this.checkedNodeAndChildren(nodeData)
202
- })
203
- }
204
- },
205
- // 取消节点选中状态时
206
- cancelCheckedNode(data) {
207
- if (data.id === this.tenantNodeId) {
208
- // 表示取消公司节点的选中状态,即取消所有节点的勾选状态
209
- this.$refs.workgroupUserTree.setCheckedKeys([])
210
- } else if (data.nodeType && data.nodeType === 'WORKGROUP') {
211
- this.cancelCheckedUserNodesWithWorkgroup(data)
212
- }
213
- },
214
- // 选中了根节点公司节点时,选中所有工作组
215
- checkedAllWorkgroups(root) {
216
- const children = root.children
217
- if (children) {
218
- children.forEach(workgroupNode => {
219
- this.$refs.workgroupUserTree.setChecked(workgroupNode.nodeId, true)
220
- })
221
- }
222
- },
223
- // 取消指定工作组下的用户节点的选中状态
224
- cancelCheckedUserNodesWithWorkgroup(workgroupData) {
225
- const children = workgroupData.children
226
- if (children) {
227
- children.forEach(userNode => {
228
- this.$refs.workgroupUserTree.setChecked(userNode.nodeId, false)
229
- })
230
- }
231
- },
232
- handleNodeClick(data, node, nodeTree) {
233
- if (this.multiple) {
234
- // 多选部门树时,处理点击节点事件
235
- this.clickNodeWhenMultiple(data)
236
- }
237
- this.selectSingleNode(data, false)
238
- },
239
- selectSingleNode(data, isClickOkBtn) {
240
- if (this.isUserNode(data) && !this.multiple) {
241
- // 点击的是工作组节点,并且是单选树时,点击部门节点直接关闭弹框
242
- const user = JSON.parse(data.data)
243
- user.tenantCode = this.tenantInfo.code
244
- user.tenantName = this.tenantInfo.tenantName
245
- let name = user.name
246
- if (user.enName && user.enName.trim() !== '') {
247
- name = name + '(' + user.enName + ')'
248
- }
249
- const selectNodeInfo = {
250
- id: user.id,
251
- name: name,
252
- loginName: user.loginName,
253
- email: user.email,
254
- telephone: user.telephone,
255
- containBranch: this.containBranch,
256
- user: user,
257
- enName: user.enName,
258
- subCompanyName: user.subCompanyName
259
- }
260
- this.selectNodeInfo = selectNodeInfo
261
- if (isClickOkBtn === true) {
262
- // 点击确定按钮时才需要调result回调事件,关闭弹框
263
- this.$emit('result', selectNodeInfo)
264
- }
265
- }
266
- },
267
- // 多选树时,点击节点处理复选框的选中状态
268
- clickNodeWhenMultiple(data) {
269
- var checkedKeys = []
270
- if (this.$refs.workgroupUserTree) {
271
- checkedKeys = this.$refs.workgroupUserTree.getCheckedKeys()
272
- }
273
- // 取消选中状态时,保持节点是展开的状态,不要折叠
274
- this.$refs.workgroupUserTree.store.nodesMap[data.nodeId].expanded = true
275
- if (checkedKeys.indexOf(data.nodeId) > -1) {
276
- // 表示当前节点是选中状态,则需要取消其选中状态
277
- // 取消当前节点的勾选状态
278
- this.$refs.workgroupUserTree.setChecked(data.nodeId, false)
279
- this.cancelCheckedNode(data)
280
- } else {
281
- // 表示当前节点不是选中的状态,需要勾选该节点
282
- this.$refs.workgroupUserTree.setChecked(data.nodeId, true)
283
- this.checkedNode(data, true)
284
- }
285
- },
286
- isUserNode(data) {
287
- // 当前节点不是公司节点,也不是分支机构节点,表示是部门节点
288
- return data.id !== this.tenantNodeId && data.nodeType && data.nodeType === 'USER'
289
- },
290
- selectWorkgroupUser() {
291
- // 是否需要显示提示框,默认不显示
292
- var showTip = false
293
- if (this.multiple) {
294
- // 选中的用户结果
295
- var selectNodeInfo = {
296
- userIds: [],
297
- userNames: [],
298
- loginNames: [],
299
- emails: [],
300
- telephones: [],
301
- users: []
302
- }
303
- var parentIds = []
304
-
305
- var nodes = this.$refs.workgroupUserTree.getCheckedNodes()
306
- if (nodes) {
307
- if (nodes.length === 0) {
308
- // 没有选择任何节点
309
- showTip = true
310
- } else {
311
- for (var i = 0; i < nodes.length; i++) {
312
- var node = nodes[i]
313
- if (this.isSelectTenantNode(node.id)) {
314
- // 表示选择了所有工作组人员
315
- selectNodeInfo.userIds = []
316
- selectNodeInfo.userNames = []
317
- selectNodeInfo.userIds.push(node.id)
318
- selectNodeInfo.userNames.push('所有工作组人员')
319
- break
320
- } else if (node.id !== this.tenantNodeId) {
321
- // 不是公司根节点
322
- if (node.leaf) {
323
- // 如果是叶子节点
324
- if (this.isUserNode(node)) {
325
- const user = JSON.parse(node.data)
326
- this.addSelectedUserInfo(selectNodeInfo, user)
327
- }
328
- } else {
329
- // 表示是工作组节点,且该节点下存在用户
330
- const userDatas = node.children
331
- if (userDatas && userDatas.length > 0) {
332
- // 表示已展开过该工作组
333
- userDatas.forEach(userData => {
334
- const user = JSON.parse(userData.data)
335
- this.addSelectedUserInfo(selectNodeInfo, user)
336
- })
337
- } else {
338
- // 表示没有展开过该节点,需要去后台获得该工作组下的人员信息
339
- parentIds.push(node.id)
340
- }
341
- }
342
- }
343
- }
344
- if (parentIds.length > 0) {
345
- // 表示选中的工作组节点未展开过,则需要去后台查询获得这些工作组下的人员集合
346
- this.getAllSelectedWorkgroupUsers(parentIds, selectNodeInfo)
347
- showTip = false
348
- } else {
349
- if (selectNodeInfo.userIds.length > 0) {
350
- this.$emit('result', selectNodeInfo)
351
- } else {
352
- showTip = true
353
- }
354
- }
355
- }
356
- } else {
357
- showTip = true
358
- }
359
- } else {
360
- const data = this.$refs.workgroupUserTree.getCurrentNode()
361
- if (data && data !== null) {
362
- this.selectSingleNode(data, true)
363
- } else {
364
- showTip = true
365
- }
366
- }
367
-
368
- if (showTip) {
369
- this.$alert(this.$t('imatrixUIMessage.pleaseSelectPersonnel'), this.$t('imatrixUIMessage.tips'), {
370
- confirmButtonText: this.$t('imatrixUIPublicModel.sure')
371
- })
372
- }
373
- },
374
- // 是否选中了公司节点
375
- isSelectTenantNode(dataId) {
376
- return dataId === this.tenantNodeId && (!this.branchInfo || this.branchInfo.length === 0)
377
- },
378
- // 将选中的部门节点添加到结果集合中
379
- addSelectedUserInfo(result, user) {
380
- const filterResult = result.userIds.filter(this.filterUserNode(user))
381
- if (filterResult.length === 0) {
382
- let name = user.name
383
- if (user.enName && user.enName !== '') {
384
- name = name + '(' + user.enName + ')'
385
- }
386
- // if (this.containBranch && user.subCompanyName) {
387
- // // 如果包含分支机构,则拼接分支机构名称
388
- // name = name + '(' + user.subCompanyName + ')'
389
- // }
390
- user.tenantCode = this.tenantInfo.code
391
- user.tenantName = this.tenantInfo.tenantName
392
- result.containBranch = this.containBranch
393
- result.users.push(user)
394
- result.userIds.push(user.id)
395
- result.loginNames.push(user.loginName)
396
- result.userNames.push(name)
397
- result.emails.push(user.email)
398
- result.telephones.push(user.telephone)
399
- }
400
- },
401
- filterUserNode(queryUser) {
402
- return (userId) => {
403
- return (userId === queryUser.id)
404
- }
405
- },
406
- // 给节点添加自定义图标
407
- renderContent(h, { node, data, store }) {
408
- var className
409
- if (node.data.id === -1) {
410
- // node.id ===-1表示公司节点,node.branch表示是分支机构节点
411
- className = 'el-icon-menu'
412
- } else {
413
- // 表示是工作组节点
414
- className = 'el-icon-date'
415
- }
416
- if (data.nodeType && data.nodeType === 'USER' &&
417
- this.searchValue && this.filterUserVal(data, this.searchValue)) {
418
- // 如果是查询条件
419
- return (
420
- <span>
421
- <i class={className}></i>
422
- <span class='searchResult' title={node.label}>{node.label}</span>
423
- </span>
424
- )
425
- }
426
- return (
427
- <span>
428
- <i class={className}></i>
429
- <span title={node.label}>{node.label}</span>
430
- </span>
431
- )
432
- }
433
-
434
- }
435
- }
436
- </script>
@@ -1,6 +0,0 @@
1
- import YearRangePicker from './src/year-range-picker.vue'
2
- YearRangePicker.install = function(Vue) {
3
- Vue.component(YearRangePicker.name, YearRangePicker)
4
- }
5
-
6
- export default YearRangePicker
@@ -1,51 +0,0 @@
1
- <template>
2
- <div>
3
- <el-date-picker
4
- v-model="value[0]"
5
- style="width:47%"
6
- value-format="yyyy"
7
- type="year"
8
- :placeholder="$t('imatrixUIMessage.selectYear')"
9
- @change="changeStart"
10
- />
11
- -
12
- <el-date-picker
13
- v-model="value[1]"
14
- style="width:47%"
15
- value-format="yyyy"
16
- type="year"
17
- :placeholder="$t('imatrixUIMessage.selectYear')"
18
- @change="changeEnd"
19
- />
20
- </div>
21
- </template>
22
- <script>
23
- export default {
24
- name: 'YearRangePicker',
25
- props: {
26
- value: {
27
- type: Array,
28
- default: () => {
29
- return []
30
- }
31
- }
32
- },
33
- data() {
34
- return {
35
- yearStart: '',
36
- yearEnd: ''
37
- }
38
- },
39
- methods: {
40
- changeStart(value) {
41
- this.value[0] = value
42
- this.$emit('change', this.value)
43
- },
44
- changeEnd(value) {
45
- this.value[1] = value
46
- this.$emit('change', this.value)
47
- }
48
-
49
- }
50
- }
51
- </script>