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,195 +0,0 @@
1
- <template>
2
- <div>
3
- <el-dialog
4
- class="user-tree"
5
- visible
6
- :title="$t('departmentUserTreeInline.removeUser')"
7
- append-to-body
8
- :close-on-click-modal="false"
9
- :width="width"
10
- @open="$emit('open')"
11
- @opend="$emit('opend')"
12
- @close="$emit('close')"
13
- @closed="$emit('closed')"
14
- >
15
- <div style="margin-bottom:10px">
16
- <el-button type="danger" size="mini" icon="el-icon-delete" @click="removeAllUser()">
17
- {{ $t('imatrixUIPublicModel.clear') }}
18
- </el-button>
19
- </div>
20
-
21
- <el-table
22
- ref="removeUserGrid"
23
- :data="users"
24
- row-key="id"
25
- border
26
- :height="height"
27
- >
28
- <el-table-column
29
- :label="$t('departmentUserTreeInline.name')"
30
- prop="name"
31
- />
32
- <el-table-column
33
- :label="$t('departmentUserTreeInline.department')"
34
- prop="mainDepartmentName"
35
- />
36
- <el-table-column
37
- v-if="containBranch"
38
- :label="$t('departmentUserTreeInline.branch')"
39
- prop="subCompanyName"
40
- />
41
- <el-table-column :label="$t('imatrixUIPublicModel.edit')" align="center" width="60px">
42
- <template slot-scope="scope">
43
- <div>
44
- <el-button type="danger" size="mini" icon="el-icon-delete" circle @click="removeUser(scope.$index)" />
45
- </div>
46
- </template>
47
- </el-table-column>
48
- </el-table>
49
- <div slot="footer" class="dialog-footer">
50
- <el-button size="small" @click="$emit('close')">
51
- {{ $t('imatrixUIPublicModel.cancel') }}
52
- </el-button>
53
- <el-button size="small" type="primary" @click="confirmSelectUser">
54
- {{ $t('imatrixUIPublicModel.sure') }}
55
- </el-button>
56
- </div>
57
- </el-dialog>
58
- </div>
59
- </template>
60
- <style>
61
- </style>
62
- <script>
63
- import removeUserService from './remove-user-service'
64
- export default {
65
- name: 'RemoveUser',
66
- components: {
67
- },
68
- props: {
69
- // 多选用户树时,已选择用户id或登录名集合,多个之间以逗号隔开
70
- selectUserInfo: {
71
- type: [String, Number],
72
- default: null
73
- },
74
- // 移除用户时,用户属性名称:id、loginName、email、telephone,默认是loginName
75
- searchField: {
76
- type: String,
77
- default: 'loginName'
78
- },
79
- // 弹框的宽度
80
- width: {
81
- type: String,
82
- default: '30%'
83
- },
84
- // 弹框的高度
85
- height: {
86
- type: String,
87
- default: '300px'
88
- },
89
- // 多选树时结果之间的分隔符,默认是逗号分隔
90
- separator: {
91
- type: String,
92
- default: ','
93
- }
94
- },
95
- data() {
96
- return {
97
- users: [],
98
- originalUsers: [], // 原来选择的用户集合
99
- containBranch: false, // 是否包含分支
100
- tenantNodeId: -1 // 公司节点的id
101
- }
102
- },
103
- created() {
104
- if (this.selectUserInfo) {
105
- if (this.selectUserInfo === '所有用户') {
106
- // 表示已选择所有用户
107
- this.users.push(this.packageAllUser())
108
- } else if (this.selectUserInfo === '所有工作组人员') {
109
- this.users.push(this.packageAllWgUser())
110
- } else {
111
- // 表示不是选择的所有用户
112
- this.getSelectUsers(this.searchField, this.selectUserInfo, this.separator).then(users => {
113
- this.originalUsers = users
114
- this.users = users
115
- })
116
- }
117
- }
118
- },
119
- methods: {
120
- ...removeUserService,
121
- confirmSelectUser() {
122
- const searchFieldValues = []
123
- const retainSelectUsers = {
124
- userIds: [],
125
- loginNames: [],
126
- emails: [],
127
- telephones: [],
128
- users: [],
129
- userNames: []
130
- }
131
- for (var i = 0; i < this.users.length; i++) {
132
- var user = this.users[i]
133
- retainSelectUsers.userIds.push(user.id)
134
- retainSelectUsers.loginNames.push(user.loginName)
135
- if (user.email && user.email !== '') {
136
- retainSelectUsers.emails.push(user.email)
137
- }
138
- if (user.telephone && user.telephone !== '') {
139
- retainSelectUsers.telephones.push(user.telephone)
140
- }
141
- retainSelectUsers.users.push(user)
142
- var name = user.name
143
- if (this.containBranch && user.subCompanyName) {
144
- // 如果包含分支机构,则拼接分支机构名称
145
- name = name + '(' + user.subCompanyName + ')'
146
- }
147
- retainSelectUsers.userNames.push(name)
148
- // 将用于查询的字段的值存到数组中,获得移除的元素时使用
149
- searchFieldValues.push(user[this.searchField])
150
- }
151
- const removeItems = this.getRemoveItems(this.originalUsers, searchFieldValues, this.searchField)
152
- this.$emit('close', retainSelectUsers, removeItems)
153
- },
154
- // 部门人员树选中了组织结构树的根节点
155
- packageAllUser() {
156
- // 表示集合中不存在该用户,则封装该用户
157
- var allUser = {
158
- id: this.tenantNodeId,
159
- name: '所有用户'
160
- }
161
- return allUser
162
- },
163
- // 工作组人员树选中了组织结构树的根节点
164
- packageAllWgUser() {
165
- // 表示集合中不存在该用户,则封装该用户
166
- var allUser = {
167
- id: this.tenantNodeId,
168
- name: '所有工作组人员'
169
- }
170
- return allUser
171
- },
172
- // 移除用户
173
- removeUser(index) {
174
- this.users.splice(index, 1)
175
- },
176
- // 清空用户
177
- removeAllUser() {
178
- this.users = []
179
- },
180
- // 获得移除的元素集合
181
- getRemoveItems(allValues, retainValues, searchField) {
182
- if (retainValues === undefined || retainValues.length === 0) {
183
- // 表示没有保留任何一条记录,即移除了所有元素
184
- return allValues
185
- }
186
- if (allValues) {
187
- // 根据id筛选出
188
- return allValues.filter(item => retainValues.indexOf(item[searchField]) === -1)
189
- }
190
- return []
191
- }
192
-
193
- }
194
- }
195
- </script>
@@ -1,6 +0,0 @@
1
- import RemoveWorkgroup from './src/remove-workgroup.vue'
2
- RemoveWorkgroup.install = function(Vue) {
3
- Vue.component(RemoveWorkgroup.name, RemoveWorkgroup)
4
- }
5
-
6
- export default RemoveWorkgroup
@@ -1,20 +0,0 @@
1
- import Vue from 'vue'
2
- const removeUserService = {
3
- // 根据指定工作组信息获得工作组集合
4
- getSelectWgs(searchField, selectWgInfo, separator) {
5
- return new Promise((resolve, reject) => {
6
- if (!searchField) {
7
- resolve([])
8
- } else if (!selectWgInfo) {
9
- resolve([])
10
- } else {
11
- this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/select-workgroups?searchField=' + searchField + '&selectWorkgroupInfo=' + selectWgInfo + '&separator=' + separator).then(workgroups => {
12
- resolve(workgroups)
13
- }).catch(error => {
14
- reject(error)
15
- })
16
- }
17
- })
18
- }
19
- }
20
- export default removeUserService
@@ -1,159 +0,0 @@
1
- <template>
2
- <div>
3
- <el-dialog
4
- class="user-tree"
5
- visible
6
- :title="$t('workgroupTree.removeWorkgroup')"
7
- append-to-body
8
- :close-on-click-modal="false"
9
- :width="width"
10
- @open="$emit('open')"
11
- @opend="$emit('opend')"
12
- @close="$emit('close')"
13
- @closed="$emit('closed')"
14
- >
15
- <div style="margin-bottom:10px">
16
- <el-button type="danger" size="mini" icon="el-icon-delete" @click="removeAllWg()">
17
- {{ $t('imatrixUIPublicModel.clear') }}
18
- </el-button>
19
- </div>
20
-
21
- <el-table
22
- ref="removeWgGrid"
23
- :data="workgroups"
24
- row-key="id"
25
- border
26
- :height="height"
27
- >
28
- <el-table-column
29
- :label="$t('workgroupTree.name')"
30
- prop="name"
31
- />
32
- <el-table-column
33
- :label="$t('workgroupTree.code')"
34
- prop="code"
35
- />
36
- <el-table-column :label="$t('imatrixUIPublicModel.edit')" align="center" width="60px">
37
- <template slot-scope="scope">
38
- <div>
39
- <el-button type="danger" size="mini" icon="el-icon-delete" circle @click="removeWg(scope.$index)" />
40
- </div>
41
- </template>
42
- </el-table-column>
43
- </el-table>
44
- <div slot="footer" class="dialog-footer">
45
- <el-button size="small" @click="$emit('close')">
46
- {{ $t('imatrixUIPublicModel.cancel') }}
47
- </el-button>
48
- <el-button size="small" type="primary" @click="confirmSelectWg">
49
- {{ $t('imatrixUIPublicModel.sure') }}
50
- </el-button>
51
- </div>
52
- </el-dialog>
53
- </div>
54
- </template>
55
- <style>
56
- </style>
57
- <script>
58
- import removeWorkgroupService from './remove-workgroup-service'
59
- export default {
60
- name: 'RemoveWorkgroup',
61
- components: {
62
- },
63
- props: {
64
- // 多选工作组树时,已选择工作组id或工作组名称或编码集合,多个之间以逗号隔开
65
- selectWorkgroupInfo: {
66
- type: [String, Number],
67
- default: null
68
- },
69
- // 移除工作组时,工作组属性名称:id、name、code,默认是id
70
- searchField: {
71
- type: String,
72
- default: 'id'
73
- },
74
- // 弹框的宽度
75
- width: {
76
- type: String,
77
- default: '30%'
78
- },
79
- // 弹框的高度
80
- height: {
81
- type: String,
82
- default: '300px'
83
- },
84
- // 多选树时结果之间的分隔符,默认是逗号分隔
85
- separator: {
86
- type: String,
87
- default: ','
88
- }
89
- },
90
- data() {
91
- return {
92
- workgroups: [],
93
- originalWgs: [], // 原来选择的工作组集合
94
- tenantNodeId: -1 // 公司节点的id
95
- }
96
- },
97
- created() {
98
- if (this.selectWorkgroupInfo) {
99
- this.getSelectWgs(this.searchField, this.selectWorkgroupInfo, this.separator).then(workgroups => {
100
- this.originalWgs = workgroups
101
- this.workgroups = workgroups
102
- })
103
- }
104
- },
105
- methods: {
106
- ...removeWorkgroupService,
107
- confirmSelectWg() {
108
- const searchFieldValues = []
109
- var retainSelectWgs = {
110
- ids: [],
111
- names: [],
112
- codes: [],
113
- workgroups: []
114
- }
115
- for (var i = 0; i < this.workgroups.length; i++) {
116
- var workgroup = this.workgroups[i]
117
- retainSelectWgs.ids.push(workgroup.id)
118
- retainSelectWgs.codes.push(workgroup.code)
119
- retainSelectWgs.workgroups.push(workgroup)
120
- retainSelectWgs.names.push(workgroup.name)
121
- // 将用于查询的字段的值存到数组中,获得移除的元素时使用
122
- searchFieldValues.push(workgroup[this.searchField])
123
- }
124
- const removeItems = this.getRemoveItems(this.originalWgs, searchFieldValues, this.searchField)
125
- this.$emit('close', retainSelectWgs, removeItems)
126
- },
127
- // 选中了组织结构树的根节点
128
- packageAllWg() {
129
- // 表示集合中不存在该用户,则封装该用户
130
- var allDept = {
131
- id: this.tenantNodeId,
132
- name: '所有工作组'
133
- }
134
- return allDept
135
- },
136
- // 移除用户
137
- removeWg(index) {
138
- this.workgroups.splice(index, 1)
139
- },
140
- // 清空用户
141
- removeAllWg() {
142
- this.workgroups = []
143
- },
144
- // 获得移除的元素集合
145
- getRemoveItems(allValues, retainValues, searchField) {
146
- if (retainValues === undefined || retainValues.length === 0) {
147
- // 表示没有保留任何一条记录,即移除了所有元素
148
- return allValues
149
- }
150
- if (allValues) {
151
- // 根据id筛选出
152
- return allValues.filter(item => retainValues.indexOf(item[searchField]) === -1)
153
- }
154
- return []
155
- }
156
-
157
- }
158
- }
159
- </script>
@@ -1,7 +0,0 @@
1
- import RichEditor from './index.vue'
2
-
3
- RichEditor.install = function(Vue) {
4
- Vue.component(RichEditor.name, RichEditor)
5
- }
6
-
7
- export default RichEditor
@@ -1,278 +0,0 @@
1
- <template>
2
- <div :style="{maxHeight: maxHeight+'px'}">
3
- <Editor
4
- v-if="!disabled"
5
- v-model="contentValue"
6
- :init="init"
7
- :disabled="disabled"
8
- />
9
- <div v-else>
10
- <div :id="viewerId" :style="{maxHeight: maxHeight+'px'}" style="overflow: auto;border: 1px solid #DCDFE6;padding: 2px;" />
11
- <el-tooltip :content="$t('imatrixUIPublicModel.fullScreen')" class="item" effect="dark" placement="top">
12
- <em
13
- class="el-icon-full-screen"
14
- style="z-index: 1;right: 20px;position: absolute;top:2px"
15
- @click="fullScreenContent"
16
- />
17
- </el-tooltip>
18
- <el-image
19
- ref="previewImg"
20
- :src="srcList[0]"
21
- :preview-src-list="srcList"
22
- style="display: none;width: 100px; height: 100px"
23
- />
24
- </div>
25
- <el-dialog
26
- :visible.sync="dialogVisible"
27
- :title="title"
28
- destroy-on-close
29
- append-to-body
30
- fullscreen
31
- >
32
- <div :id="fullscreenViewerId" />
33
- </el-dialog>
34
- </div>
35
- </template>
36
-
37
- <script>
38
-
39
- import { getLanguageWithLocale } from '../../src/utils/util'
40
- // 引入tinymce编辑器
41
- import Editor from '@tinymce/tinymce-vue'
42
- // 引入node_modules里的tinymce相关文件文件
43
- import tinymce from 'tinymce/tinymce.min.js' // tinymce默认hidden,不引入则不显示编辑器
44
- import 'tinymce/themes/silver' // 编辑器主题,不引入则报错
45
- import 'tinymce/icons/default' // 引入编辑器图标icon,不引入则不显示对应图标
46
-
47
- // 引入编辑器插件
48
- import 'tinymce/plugins/advlist' // 高级列表
49
- import 'tinymce/plugins/directionality' // 文字方向
50
- import 'tinymce/plugins/fullscreen' // 全屏
51
- import 'tinymce/plugins/hr' // 水平分割线
52
- import 'tinymce/plugins/image' // 插入编辑图片
53
- import 'tinymce/plugins/link' // 超链接
54
- import 'tinymce/plugins/lists' // 列表插件
55
- import 'tinymce/plugins/paste' // 粘贴插件
56
- import 'tinymce/plugins/preview'// 预览
57
- import 'tinymce/plugins/print'// 打印
58
- import 'tinymce/plugins/quickbars' // 快速工具栏
59
- import 'tinymce/plugins/save' // 保存
60
- import 'tinymce/plugins/searchreplace' // 查找替换
61
- // import 'tinymce/plugins/spellchecker' //拼写检查,暂未加入汉化,不建议使用
62
- // import 'tinymce/plugins/tabfocus' // 切入切出,按tab键切出编辑器,切入页面其他输入框中
63
- import 'tinymce/plugins/table' // 表格
64
- // import 'tinymce/plugins/template' // 内容模板
65
- import 'tinymce/plugins/textcolor' // 文字颜色
66
- // import 'tinymce/plugins/textpattern' // 快速排版
67
- // import 'tinymce/plugins/toc' // 目录生成器
68
- // import 'tinymce/plugins/visualblocks' // 显示元素范围
69
- // import 'tinymce/plugins/visualchars' // 显示不可见字符
70
- import 'tinymce/plugins/wordcount' // 字数统计
71
- // 样式
72
- // import 'tinymce/skins/content/default/content.min.css'
73
- import 'tinymce/skins/ui/oxide/skin.min.css'
74
- import 'tinymce/skins/ui/oxide/content.min.css'
75
- // 主题
76
- import 'tinymce/themes/silver'
77
- // skin_url: '/tinymce/skins/ui/oxide-dark',//皮肤:暗色
78
- import Vue from 'vue'
79
- export default {
80
- name: 'RichEditor',
81
- components: {
82
- Editor
83
- },
84
- props: {
85
- entity: {
86
- type: Object,
87
- default: null
88
- },
89
- prop: {
90
- type: String,
91
- default: null
92
- },
93
- value: {
94
- type: String,
95
- default: ''
96
- },
97
- disabled: {
98
- type: Boolean,
99
- default: false
100
- },
101
- options: {
102
- type: Object,
103
- default: null
104
- },
105
- title: {
106
- type: String,
107
- default: ''
108
- },
109
- plugins: {
110
- type: [String, Array],
111
- default: 'paste print preview searchreplace directionality fullscreen image link table hr advlist lists wordcount '
112
- },
113
- toolbar: {
114
- type: [String, Array],
115
- default: ' undo redo | formatselect fontsizeselect bold italic strikethrough underline hr forecolor backcolor | image | ' +
116
- ' lineheight bullist numlist table | print fullscreen preview '
117
- }
118
- },
119
- data() {
120
- const _that = this
121
- if (getLanguageWithLocale() === 'zh_CN') {
122
- require('./langs/zh-Hans.js')
123
- }
124
- let maxHeight = '400'
125
- if (this.options && this.options.maxHeight) {
126
- maxHeight = this.options.maxHeight
127
- }
128
- return {
129
- maxHeight,
130
- init: {
131
- height: maxHeight,
132
- language: 'zh-Hans', // 语言类型
133
- plugins: this.plugins, // 插件配置
134
- toolbar: this.toolbar, // 工具栏配置,设为false则隐藏
135
- menubar: false, // 菜单栏配置,设为false则隐藏,不配置则默认显示全部菜单,也可自定义配置--查看 http://tinymce.ax-z.cn/configure/editor-appearance.php --搜索“自定义菜单”
136
- fontsize_formats: '12px 14px 16px 18px 20px 22px 24px 28px 32px 36px 48px 56px 72px', // 字体大小
137
- font_formats: '微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;', // 字体样式
138
- // 自带默认字体:'Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats'
139
- lineheight_formats: '0.5 0.8 1 1.2 1.5 1.75 2 2.5 3 4 5', // 行高配置,也可配置成"12px 14px 16px 20px"这种形式
140
- placeholder: '在这里输入文字',
141
- branding: false, // tiny技术支持信息是否显示
142
- resize: false, // 编辑器宽高是否可变,false-否,true-高可变,'both'-宽高均可,注意引号
143
- // statusbar: false, //最下方的元素路径和字数统计那一栏是否显示
144
- elementpath: false, // 元素路径是否显示
145
- // image_caption: true,
146
- // relative_urls: false, //false: tinymce将不再自动将文件路径由绝对转为相对
147
- // convert_urls: false, //false: tinymce将不再自动处理文件路径
148
- // file_picker_callback: () => {
149
- // alert(11)
150
- // },
151
- image_description: false,
152
- content_style: 'img {width:400px;height:300px}', // 直接自定义可编辑区域的css样式
153
- // content_css: '/tinycontent.css', //以css文件方式自定义可编辑区域的css样式,css文件需自己创建并引入
154
- // images_upload_url: '/apib/api-upload/uploadimg', //后端处理程序的url,建议直接自定义上传函数image_upload_handler,这个就可以不用了
155
- // images_upload_base_path: '/demo', //相对基本路径--关于图片上传建议查看--http://tinymce.ax-z.cn/general/upload-images.php
156
- paste_data_images: true, // 图片是否可粘贴'
157
- urlconverter_callback: (url, node, onSave, name) => {
158
- if (node === 'img' && url.startsWith('blob:')) {
159
- console.log('urlconverter_callback ....')
160
- tinymce.activeEditor && tinymce.activeEditor.uploadImages()
161
- return url
162
- }
163
- return url
164
- },
165
- images_upload_handler: (blobInfo, success, failure, progress) => {
166
- let file
167
- if (blobInfo.blob() instanceof File) {
168
- console.log('images_upload_handler .File')
169
- file = blobInfo.blob()
170
- } else {
171
- console.log('images_upload_handler .base64')
172
- file = _that.base64ToFile(blobInfo.base64(), 'a.png')
173
- }
174
- const params = new FormData()
175
- params.append('file', file)
176
- const config = {
177
- headers: {
178
- 'Content-Type': 'multipart/form-data'
179
- }
180
- }
181
- _that.$http.post('/common/fs-upload/rich-editor-image', params, config).then(res => {
182
- console.log(res)
183
- success(res.url)
184
- }).catch(() => {
185
- failure('上传出错,服务器开小差了呢')
186
- })
187
- }
188
-
189
- },
190
- contentValue: this.value,
191
- markValue: '',
192
- srcList: [],
193
- psrcList: [],
194
- viewerId: 'aglie_rich_editor_' + (new Date()).getTime(),
195
- dialogVisible: false,
196
- fullscreenViewerId: 'editor_viewer_' + (new Date()).getTime(),
197
- ImageComponent: null
198
- }
199
- },
200
- watch: {
201
- value: {
202
- deep: true,
203
- handler(newValue, oldValue) {
204
- this.contentValue = newValue
205
- this.entity[this.prop] = newValue
206
- }
207
- },
208
- contentValue: {
209
- deep: true,
210
- handler(newValue, oldValue) {
211
- this.$emit('input', newValue)
212
- this.entity[this.prop] = newValue
213
- }
214
- },
215
- disabled: {
216
- deep: true,
217
- handler(newValue, oldValue) {
218
- if (newValue) {
219
- this.initViewer()
220
- }
221
- }
222
- }
223
- },
224
- created() {
225
- },
226
- mounted() {
227
- if (this.disabled) {
228
- this.initViewer()
229
- } else {
230
- tinymce.init(this.init)
231
- }
232
- },
233
- methods: {
234
- showImage($event) {
235
- console.log(this.$refs.previewImg)
236
- this.srcList = [$event.target.currentSrc]
237
- this.$refs.previewImg.showViewer = true
238
- },
239
- fullScreenContent() {
240
- this.dialogVisible = true
241
- this.$nextTick(() => {
242
- // 必须得再new一个, 不然会导致表单里显示。弹框不显示,弹框显示,表单不显示内容
243
- const viewContent = new this.ImageComponent().$mount()
244
- document.getElementById(this.fullscreenViewerId).appendChild(viewContent.$el)
245
- })
246
- },
247
- initViewer() {
248
- const that = this
249
- let m = this.value.replaceAll('<img', '<img @click="showImage" ')
250
- m = '<div> ' + m + ' </div> '
251
- this.ImageComponent = Vue.extend({
252
- methods: {
253
- showImage($event) {
254
- console.log($event)
255
- that.showImage($event)
256
- }
257
- },
258
- template: m
259
- })
260
- const viewContent = new this.ImageComponent().$mount()
261
- this.$nextTick(() => {
262
- document.getElementById(this.viewerId).appendChild(viewContent.$el)
263
- })
264
- },
265
- base64ToFile(data, filename) {
266
- var bstr = atob(data)
267
- var n = bstr.length
268
- var u8arr = new Uint8Array(n)
269
- filename = new Date().getTime() + '-' + Math.floor((Math.random() * 10000)) + '.png'
270
- while (n--) {
271
- u8arr[n] = bstr.charCodeAt(n)
272
- }
273
- return new File([u8arr], filename, { type: 'image/png' })
274
- }
275
- }
276
- }
277
- </script>
278
-