imatrix-ui 2.9.9-dw → 2.9.11-boe1

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 (181) 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/i18n/i18n.js +1 -1
  6. package/src/i18n/langs/cn.js +14 -4
  7. package/src/i18n/langs/en.js +16 -5
  8. package/src/permission.js +1 -1
  9. package/src/plugins.js +3 -3
  10. package/src/router/index.js +10 -0
  11. package/src/store/modules/tab-content.js +6 -0
  12. package/src/store/modules/user.js +19 -0
  13. package/src/styles/index.scss +74 -4
  14. package/src/styles/theme/black/font-style.scss +70 -0
  15. package/src/styles/theme/black/index.scss +6 -30
  16. package/src/styles/theme/blue/font-style.scss +37 -0
  17. package/src/styles/theme/blue/index.scss +2 -18
  18. package/src/styles/theme/blue2/font-style.scss +70 -0
  19. package/src/styles/theme/blue2/index.scss +3 -13
  20. package/src/styles/theme/dark-blue/index.scss +27 -5
  21. package/src/styles/theme/dark-blue/message.scss +8 -0
  22. package/src/styles/theme/dark-blue/sidebar.scss +7 -37
  23. package/src/styles/theme/dark-blue/table.scss +1 -1
  24. package/src/styles/theme/gray/card-style.scss +13 -1
  25. package/src/styles/theme/gray/font-style.scss +38 -0
  26. package/src/styles/theme/gray/index.scss +13 -25
  27. package/src/styles/theme/gray/scrollbar-style.scss +32 -0
  28. package/src/styles/theme/gray/sidebar.scss +7 -14
  29. package/src/utils/auth-api.js +45 -1
  30. package/src/utils/common-util.js +21 -81
  31. package/src/utils/range-selector.js +185 -0
  32. package/src/utils/request.js +6 -3
  33. package/src/utils/util.js +12 -10
  34. package/src/views/dsc-component/Sidebar/Item.vue +7 -5
  35. package/src/views/dsc-component/Sidebar/SidebarItem.vue +2 -3
  36. package/src/views/dsc-component/Sidebar/index.vue +12 -20
  37. package/src/views/dsc-component/tabs/tab-content.vue +1 -5
  38. package/src/views/layout/NewLayout.vue +6 -65
  39. package/src/views/layout/components/Menubar/Item.vue +23 -7
  40. package/src/views/layout/components/Menubar/Link.vue +11 -2
  41. package/src/views/layout/components/Menubar/SidebarItem.vue +50 -7
  42. package/src/views/layout/components/Menubar/index.vue +51 -16
  43. package/src/views/layout/components/tabs/tab-content.vue +160 -0
  44. package/src/views/layout/tab-content-iframe-index.vue +31 -0
  45. package/src/views/layout/tab-content-index.vue +85 -0
  46. package/src/views/login/index.vue +1 -1
  47. package/packages/breadcrumb/index.js +0 -6
  48. package/packages/breadcrumb/src/breadcrumb.vue +0 -71
  49. package/packages/department-tree/index.js +0 -6
  50. package/packages/department-tree/src/department-tree.vue +0 -108
  51. package/packages/department-tree-inline/index.js +0 -6
  52. package/packages/department-tree-inline/src/department-multi-tree-inline.vue +0 -402
  53. package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -284
  54. package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
  55. package/packages/department-tree-inline/src/department-tree-service.js +0 -245
  56. package/packages/department-tree-inline/src/search-result.vue +0 -176
  57. package/packages/department-user-tree/index.js +0 -6
  58. package/packages/department-user-tree/src/department-user-multiple-tree.vue +0 -116
  59. package/packages/department-user-tree/src/department-user-single-tree.vue +0 -76
  60. package/packages/department-user-tree/src/department-user-tree.vue +0 -101
  61. package/packages/department-user-tree-inline/index.js +0 -6
  62. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +0 -626
  63. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -269
  64. package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +0 -79
  65. package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +0 -230
  66. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -122
  67. package/packages/department-user-tree-inline/src/search-result.vue +0 -197
  68. package/packages/directives/prevent-reclick.js +0 -19
  69. package/packages/dynamic-source-select/index.js +0 -6
  70. package/packages/dynamic-source-select/src/dynamic-source-select-service.js +0 -70
  71. package/packages/dynamic-source-select/src/dynamic-source-select.vue +0 -440
  72. package/packages/dynamic-source-select/src/events.js +0 -55
  73. package/packages/fs-preview/index.js +0 -6
  74. package/packages/fs-preview/src/fs-preview.vue +0 -226
  75. package/packages/fs-upload/index.js +0 -6
  76. package/packages/fs-upload/src/fs-upload-multi.vue +0 -420
  77. package/packages/fs-upload/src/fs-upload-single.vue +0 -312
  78. package/packages/fs-upload/src/fs-upload.vue +0 -189
  79. package/packages/fs-upload/src/see-big-picture.vue +0 -55
  80. package/packages/fs-upload-list/index.js +0 -6
  81. package/packages/fs-upload-list/src/fs-upload-list.vue +0 -287
  82. package/packages/hamburger/index.js +0 -6
  83. package/packages/hamburger/src/hamburger.vue +0 -38
  84. package/packages/index.js +0 -121
  85. package/packages/multipart-upload/index.js +0 -6
  86. package/packages/multipart-upload/src/index.vue +0 -73
  87. package/packages/multipart-upload/src/multipart-upload-form.vue +0 -297
  88. package/packages/multipart-upload/src/multipart-upload-list.vue +0 -378
  89. package/packages/organization-input/index.js +0 -6
  90. package/packages/organization-input/src/organization-input.vue +0 -542
  91. package/packages/plugins/export-data-new.js +0 -453
  92. package/packages/plugins/export-data.js +0 -361
  93. package/packages/plugins/index.js +0 -15
  94. package/packages/plugins/public-method.js +0 -43
  95. package/packages/remove-department/index.js +0 -6
  96. package/packages/remove-department/src/remove-department.vue +0 -172
  97. package/packages/remove-department/src/remove-dept-service.js +0 -20
  98. package/packages/remove-user/index.js +0 -6
  99. package/packages/remove-user/src/remove-user-service.js +0 -20
  100. package/packages/remove-user/src/remove-user.vue +0 -195
  101. package/packages/remove-workgroup/index.js +0 -6
  102. package/packages/remove-workgroup/src/remove-workgroup-service.js +0 -20
  103. package/packages/remove-workgroup/src/remove-workgroup.vue +0 -159
  104. package/packages/rich-editor/index.js +0 -7
  105. package/packages/rich-editor/index.vue +0 -278
  106. package/packages/rich-editor/langs/zh-Hans.js +0 -1
  107. package/packages/rich-editor/viewer.vue +0 -103
  108. package/packages/scan-code-input/index.js +0 -6
  109. package/packages/scan-code-input/src/events.js +0 -33
  110. package/packages/scan-code-input/src/scan-code-input-colse.vue +0 -131
  111. package/packages/scan-code-input/src/scan-code-input.vue +0 -116
  112. package/packages/secret-info/index.js +0 -7
  113. package/packages/secret-info/index.vue +0 -90
  114. package/packages/super-grid/index.js +0 -7
  115. package/packages/super-grid/src/apis.js +0 -763
  116. package/packages/super-grid/src/columns-config.vue +0 -335
  117. package/packages/super-grid/src/custom-formatter.js +0 -250
  118. package/packages/super-grid/src/dynamic-input.vue +0 -1279
  119. package/packages/super-grid/src/eventBus.js +0 -2
  120. package/packages/super-grid/src/events.js +0 -55
  121. package/packages/super-grid/src/formValidatorUtil.js +0 -226
  122. package/packages/super-grid/src/formatter.js +0 -181
  123. package/packages/super-grid/src/group-column.vue +0 -100
  124. package/packages/super-grid/src/header-context-menu.vue +0 -87
  125. package/packages/super-grid/src/index-column.vue +0 -51
  126. package/packages/super-grid/src/normal-column.vue +0 -769
  127. package/packages/super-grid/src/public-methods.js +0 -31
  128. package/packages/super-grid/src/row-operation.vue +0 -161
  129. package/packages/super-grid/src/search-button.vue +0 -66
  130. package/packages/super-grid/src/search-condition-input.vue +0 -61
  131. package/packages/super-grid/src/search-condition-list.vue +0 -59
  132. package/packages/super-grid/src/search-form-advancedQuery.vue +0 -653
  133. package/packages/super-grid/src/search-form-dialog.vue +0 -79
  134. package/packages/super-grid/src/search-form-item.vue +0 -386
  135. package/packages/super-grid/src/search-form-number.vue +0 -38
  136. package/packages/super-grid/src/search-form-open.vue +0 -162
  137. package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -188
  138. package/packages/super-grid/src/search-form.vue +0 -634
  139. package/packages/super-grid/src/search-methods.js +0 -387
  140. package/packages/super-grid/src/selection-column.vue +0 -43
  141. package/packages/super-grid/src/store.js +0 -3
  142. package/packages/super-grid/src/super-grid-service.js +0 -561
  143. package/packages/super-grid/src/super-grid.vue +0 -2829
  144. package/packages/super-grid/src/utils.js +0 -763
  145. package/packages/super-grid/src/view-image-dialog.vue +0 -130
  146. package/packages/super-nine-grid/index.js +0 -7
  147. package/packages/super-nine-grid/src/apis.js +0 -103
  148. package/packages/super-nine-grid/src/custom-formatter.js +0 -66
  149. package/packages/super-nine-grid/src/formatter.js +0 -132
  150. package/packages/super-nine-grid/src/search-form-number.vue +0 -38
  151. package/packages/super-nine-grid/src/search-form.vue +0 -430
  152. package/packages/super-nine-grid/src/search-methods.js +0 -134
  153. package/packages/super-nine-grid/src/store.js +0 -3
  154. package/packages/super-nine-grid/src/super-grid-service.js +0 -91
  155. package/packages/super-nine-grid/src/super-nine-grid.vue +0 -872
  156. package/packages/super-nine-grid/src/utils.js +0 -261
  157. package/packages/svg-icon/index.js +0 -6
  158. package/packages/svg-icon/src/svg-icon.vue +0 -43
  159. package/packages/utils/utils.js +0 -152
  160. package/packages/utils/value-set.js +0 -86
  161. package/packages/valid-code/index.js +0 -7
  162. package/packages/valid-code/src/valid-code.vue +0 -95
  163. package/packages/workflow-button/index.js +0 -6
  164. package/packages/workflow-button/src/workflow-button.vue +0 -325
  165. package/packages/workflow-history-list/index.js +0 -6
  166. package/packages/workflow-history-list/src/api.js +0 -7
  167. package/packages/workflow-history-list/src/workflow-history-list.vue +0 -185
  168. package/packages/workgroup-tree/index.js +0 -6
  169. package/packages/workgroup-tree/src/workgroup-tree.vue +0 -76
  170. package/packages/workgroup-tree-inline/index.js +0 -6
  171. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +0 -317
  172. package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +0 -43
  173. package/packages/workgroup-user-tree/index.js +0 -6
  174. package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +0 -100
  175. package/packages/workgroup-user-tree-inline/index.js +0 -6
  176. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +0 -163
  177. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +0 -436
  178. package/packages/year-range-picker/index.js +0 -6
  179. package/packages/year-range-picker/src/year-range-picker.vue +0 -51
  180. package/src/index.js +0 -93
  181. package/src/styles/theme/gray/form-style.scss +0 -41
@@ -1,297 +0,0 @@
1
- <!-- 文件上传 -->
2
- <template>
3
- <div>
4
- <template v-if="!disabled">
5
- <el-input
6
- ref="item"
7
- :readonly="true"
8
- :disabled="disabled"
9
- :value="value"
10
- :placeholder="$t('imatrixUIMessage.fileUpload')"
11
- >
12
- <el-button v-if="!disabled" slot="append" size="mini" icon="el-icon-upload2" @click="openAnnexUpload" />
13
- <el-button slot="append" size="mini" icon="el-icon-zoom-in" @click="preview" />
14
- </el-input>
15
-
16
- <el-dialog
17
- :title="$t('imatrixUIMessage.tips')"
18
- :visible.sync="annexUploadFlag"
19
- :append-to-body="true"
20
- :show-close="true"
21
- width="30%"
22
- >
23
- <el-upload
24
- v-if="annexUploadFlag"
25
- :action="defaultAction"
26
- :accept="fileSetObj.accept?fileSetObj.accept:null"
27
- :on-success="uploadOnSuccess"
28
- :headers="headers"
29
- :before-upload="handleBeforeUpload"
30
- :with-credentials="true"
31
- name="file"
32
- >
33
- <el-button>{{ $t('imatrixUIMessage.upload') }}</el-button>
34
- </el-upload>
35
- </el-dialog>
36
- <el-dialog
37
- :append-to-body="true"
38
- :show-close="true"
39
- :title="$t('imatrixUIPublicModel.previewImage')"
40
- :visible.sync="showPreviewSingleImage"
41
- @close="$emit('close')"
42
- >
43
- <span slot="title">{{ $t('imatrixUIPublicModel.previewImage') }}
44
- <!-- <i v-if="downloadable" class="el-icon-download" style="padding-left:5px;cursor:pointer;color:#409EFF" @click="downloadFile()" /> -->
45
- <!-- <i v-if="deleteable" class="el-icon-delete" style="padding-left:5px;cursor:pointer;color:#F56C6C" @click="deleteFile()" /> -->
46
- </span>
47
- <el-image v-if="previewImageInfo&&previewImageInfo.isImg" :preview-src-list="[previewImageInfo.src]" :src="previewImageInfo.src" />
48
- </el-dialog>
49
- <el-dialog
50
- :append-to-body="true"
51
- :show-close="true"
52
- :title="$t('imatrixUIPublicModel.preview')"
53
- :visible.sync="showPreviewMulti"
54
- width="30%"
55
- @close="$emit('close')"
56
- >
57
- <span slot="title">{{ $t('imatrixUIPublicModel.preview') }}
58
- <!-- <i v-if="downloadable" class="el-icon-download" style="padding-left:5px;cursor:pointer;color:#409EFF" @click="downloadFile()" /> -->
59
- <!-- <i v-if="deleteable" class="el-icon-delete" style="padding-left:5px;cursor:pointer;color:#F56C6C" @click="deleteFile()" /> -->
60
- </span>
61
- <el-table
62
- :show-header="false"
63
- :data="showFileList"
64
- >
65
- <el-table-column
66
- width="300"
67
- prop="showName"
68
- />
69
- <el-table-column align="right">
70
- <template slot-scope="scope">
71
- <el-tooltip :content="$t('imatrixUIPublicModel.preview')" class="item" effect="dark" placement="top">
72
- <i class="el-icon-view" style="cursor:pointer;" @click="previewSingle(scope.row)" />
73
- </el-tooltip>
74
- </template>
75
- </el-table-column>
76
- <el-table-column v-if="!disabled">
77
- <template slot-scope="scope">
78
- <el-tooltip :content="$t('imatrixUIPublicModel.delete')" class="item" effect="dark" placement="top">
79
- <i class="el-icon-delete" style="cursor:pointer;" @click="deleteRow(scope.$index)" />
80
- </el-tooltip>
81
- </template>
82
- </el-table-column>
83
- </el-table>
84
- </el-dialog>
85
- </template>
86
- <template v-else>
87
- <fs-preview :label="value" :file-list="showFileList" />
88
- </template>
89
- </div>
90
- </template>
91
-
92
- <script>
93
-
94
- import { getToken } from '../../../src/utils/auth'
95
- import { isImage } from '../../../src/utils/util'
96
- import { isPlateSys, getSystemFrontendUrl } from '../../../src/utils/common-util'
97
- import Vue from 'vue'
98
- import FsPreview from '../../fs-preview/src/fs-preview.vue'
99
- export default {
100
- name: 'MultipartUploadForm',
101
- components: {
102
- FsPreview
103
-
104
- },
105
- props: {
106
- value: {
107
- type: String,
108
- default: null
109
- },
110
- // name ','分隔的名称 和serverPath
111
- fileInfo: {
112
- type: Object,
113
- default: () => {
114
- return {
115
- name: null,
116
- serverPath: null
117
- }
118
- }
119
- },
120
- fileSetObj: {
121
- type: Object,
122
- default: () => {
123
- return { limitFileSize: 30, multiple: false, accept: null }
124
- }
125
- },
126
- customViewUrl: {
127
- type: Boolean,
128
- default: false
129
- },
130
- disabled: {
131
- type: Boolean,
132
- default: false
133
- },
134
- uploadAble: {
135
- type: Boolean,
136
- default: true
137
- },
138
- deletaAble: {
139
- type: Boolean,
140
- default: true
141
- },
142
- // 文件详细消息
143
- fileList: {
144
- type: Array,
145
- default: () => {
146
- return []
147
- }
148
- }
149
-
150
- },
151
- data() {
152
- const headers = { Authorization: getToken() }
153
- let defaultAction = Vue.prototype.baseURL + '/common/fs-upload'
154
- if (isPlateSys(Vue.prototype.systemCode)) {
155
- defaultAction = Vue.prototype.baseAPI + '/component/super-form/uploads'
156
- }
157
- return {
158
- deleteUuids: [],
159
- headers,
160
- defaultAction,
161
- annexUploadFlag: false,
162
- showPreviewSingleImage: false,
163
- showPreviewMulti: false,
164
- lastFileName: null,
165
- previewImageInfo: {},
166
- showFileList: this.fileList
167
- }
168
- },
169
- created() {
170
-
171
- },
172
- mounted() {
173
- this.getFileList()
174
- },
175
- methods: {
176
- openAnnexUpload() {
177
- this.annexUploadFlag = true
178
- },
179
- handleBeforeUpload(file) {
180
- let limitFileSize = this.fileSetObj.limitFileSize
181
- if (limitFileSize === undefined) {
182
- // 默认是30M
183
- limitFileSize = 30
184
- }
185
- if (file.size > limitFileSize * 1024 * 1024) {
186
- // 超过最大限制
187
- this.$message({
188
- type: 'warning',
189
- message: this.$t('imatrixUIMessage.exceedFileSize', { fileSize: limitFileSize }),
190
- showClose: true
191
- })
192
- // 返回false停止上传
193
- return false
194
- }
195
- },
196
- // 上传成功
197
- uploadOnSuccess(response, file) {
198
- if (response) {
199
- this.$emit('upload-success', { showName: response.name, serverPath: response.serverPath })
200
- if (this.fileSetObj.multiple) {
201
- if (this.fileInfo.showName) {
202
- const nameArr = this.fileInfo.showName.split(',')
203
- const serverPathArr = this.fileInfo.serverPath.split(',')
204
- nameArr.push(response.name)
205
- serverPathArr.push(response.serverPath)
206
- this.fileInfo.showName = nameArr.join(',')
207
- this.fileInfo.serverPath = serverPathArr.join(',')
208
- } else {
209
- this.fileInfo.showName = response.name
210
- this.fileInfo.serverPath = response.serverPath
211
- }
212
- } else {
213
- this.fileInfo.showName = response.name
214
- this.fileInfo.serverPath = response.serverPath
215
- }
216
- }
217
- this.annexUploadFlag = false
218
- },
219
- preview() {
220
- this.getFileList()
221
- this.showPreviewMulti = true
222
- },
223
- previewSingle(file) {
224
- if (isImage(file.showName)) {
225
- this.previewImageInfo = file
226
- this.showPreviewSingleImage = true
227
- } else {
228
- this.previewDoc(file)
229
- }
230
- },
231
- getFileList() {
232
- if (!this.customViewUrl) {
233
- const nameArr = this.fileInfo.showName.split(',')
234
- const serverPath = this.fileInfo.serverPath.split(',')
235
- if (nameArr.length === 0 || serverPath.length === 0 || nameArr.length !== serverPath.length) {
236
- return
237
- }
238
- const fileList = []
239
- const url = Vue.prototype.baseURL + '/common/super-form/downloads?jwt=' + getToken()
240
- for (let index = 0; index < nameArr.length; index++) {
241
- const tempName = nameArr[index]
242
- if (tempName && serverPath[index]) {
243
- const standardFile = {
244
- showName: tempName,
245
- serverPath: serverPath[index],
246
- src: url + '&showName=' + tempName + '&serverPath=' + serverPath[index]
247
- }
248
- if (isImage(tempName)) {
249
- standardFile.isImg = true
250
- } else {
251
- standardFile.isImg = false
252
- }
253
- fileList.push(standardFile)
254
- }
255
- }
256
- this.showFileList = fileList
257
- } else {
258
- this.showFileList = this.fileList
259
- }
260
- },
261
- previewDoc(file) {
262
- const token = getToken()
263
- let previewUrl = Vue.prototype.baseURL + '/common/fs-upload/preview?jwt=' + token
264
- if (isPlateSys(Vue.prototype.systemCode)) {
265
- previewUrl = Vue.prototype.baseAPI + '/component/fs-upload/preview?jwt=' + token
266
- }
267
- if (Vue.prototype.customPreviewUrl) {
268
- window.open(getSystemFrontendUrl(Vue.prototype.portalUrl) + '/#/file-service/preview?serverPath=' + file.serverPath +
269
- '&showName=' + encodeURI(file.showName),
270
- file.showName
271
- )
272
- } else {
273
- window.open(previewUrl + '&showName=' + encodeURI(file.showName) + '&serverPath=' + file.serverPath)
274
- }
275
- },
276
- deleteRow(index) {
277
- const deleteFile = this.showFileList[index]
278
- // this.fileList.splice(index, 1)
279
- const nameArr = []
280
- const pathArr = []
281
- for (let i = 0; i < this.showFileList.length; i++) {
282
- if (i !== index) {
283
- nameArr.push(this.showFileList[i].showName)
284
- pathArr.push(this.showFileList[i].serverPath)
285
- }
286
- }
287
- this.fileInfo.showName = nameArr.join(',')
288
- this.fileInfo.serverPath = pathArr.join(',')
289
- this.getFileList()
290
- this.$emit('delete-success', { deleteFile: deleteFile, all: this.showFileList })
291
- this.$emit('delete', this.showFileList, index)
292
- }
293
- }
294
- }
295
- </script>
296
-
297
- <style scoped></style>
@@ -1,378 +0,0 @@
1
- <!-- 文件上传 -->
2
- <template>
3
- <div>
4
- <template v-if="!disabled">
5
- <el-input
6
- ref="item"
7
- :readonly="true"
8
- :disabled="disabled"
9
- :value="value"
10
- :placeholder="$t('imatrixUIMessage.fileUpload')"
11
- >
12
- <el-button v-if="!disabled" slot="append" size="mini" icon="el-icon-upload2" @click="openAnnexUpload" />
13
- </el-input>
14
-
15
- <el-dialog
16
- :title="$t('imatrixUIMessage.tips')"
17
- :visible.sync="annexUploadFlag"
18
- :append-to-body="true"
19
- :show-close="true"
20
- width="40%"
21
- >
22
- <el-upload id="upload" :show-file-list="false" :auto-upload="false" :on-change="uploadFile" action>
23
- <el-button size="small" type="primary">
24
- 选择文件
25
- </el-button>
26
- <span
27
- slot="tip"
28
- style="margin-left:12px"
29
- class="el-upload__tip"
30
- >
31
- 上传文件不能超过{{ fileSetObj.limitFileSize }}M
32
- <span v-if="fileSetObj.accept">,并且只接受{{ fileSetObj.accept }}类型文件</span>
33
- </span>
34
- </el-upload>
35
- <br>
36
- <el-row v-for="(file, index) in uploadingFile" :key="index">
37
- <el-tag
38
- size="small form-list-file"
39
- >
40
- <span>
41
- <i class="el-icon-paperclip" />
42
- <span style="margin-left:6.5px">{{ file.name }}</span>
43
- </span>
44
-
45
- <el-tooltip content="取消上传" placement="right" effect="light">
46
- <i
47
- class="el-icon-close"
48
- style="margin-left:8px"
49
- @click="cancelUpload(file.serverName)"
50
- />
51
- </el-tooltip>
52
- </el-tag>
53
- <el-progress :percentage="file.uploadProgress" />
54
- </el-row>
55
- <div
56
- style="line-height 30px;"
57
- >
58
- <el-row>
59
- <el-col>
60
- <el-tag
61
- v-for="(file, index) in fileContent"
62
- :key="index"
63
- size="small form-list-file"
64
- >
65
- <span @click="preview(file.name, file.serverName)">
66
- <i class="el-icon-paperclip" />
67
- <span style="margin-left:6.5px">{{ file.name }}</span>
68
- </span>
69
- <el-tooltip content="移除已上传文件" placement="right" effect="light">
70
- <i
71
- class="el-icon-close"
72
- style="margin-left:8px"
73
- @click="handleOnRemove(index,file)"
74
- />
75
- </el-tooltip>
76
- </el-tag>
77
- </el-col>
78
- </el-row>
79
- </div>
80
- </el-dialog>
81
- <el-dialog
82
- :append-to-body="true"
83
- :show-close="true"
84
- :title="$t('imatrixUIPublicModel.previewImage')"
85
- :visible.sync="showPreviewSingleImage"
86
- @close="$emit('close')"
87
- >
88
- <span slot="title">{{ $t('imatrixUIPublicModel.previewImage') }}
89
- <!-- <i v-if="downloadable" class="el-icon-download" style="padding-left:5px;cursor:pointer;color:#409EFF" @click="downloadFile()" /> -->
90
- <!-- <i v-if="deleteable" class="el-icon-delete" style="padding-left:5px;cursor:pointer;color:#F56C6C" @click="deleteFile()" /> -->
91
- </span>
92
- <el-image :src="previewImageInfo.src" :preview-src-list="[previewImageInfo.src]" />
93
- </el-dialog>
94
- <el-dialog
95
- :append-to-body="true"
96
- :show-close="true"
97
- :title="$t('imatrixUIPublicModel.preview')"
98
- :visible.sync="showPreviewMulti"
99
- width="30%"
100
- @close="$emit('close')"
101
- >
102
- <span slot="title">{{ $t('imatrixUIPublicModel.preview') }}
103
- <!-- <i v-if="downloadable" class="el-icon-download" style="padding-left:5px;cursor:pointer;color:#409EFF" @click="downloadFile()" /> -->
104
- <!-- <i v-if="deleteable" class="el-icon-delete" style="padding-left:5px;cursor:pointer;color:#F56C6C" @click="deleteFile()" /> -->
105
- </span>
106
- <el-table
107
- :show-header="false"
108
- :data="showFileList"
109
- >
110
- <el-table-column
111
- width="300"
112
- prop="showName"
113
- />
114
- <el-table-column align="right">
115
- <template slot-scope="scope">
116
- <el-tooltip :content="$t('imatrixUIPublicModel.preview')" class="item" effect="dark" placement="top">
117
- <i class="el-icon-view" style="cursor:pointer;" @click="previewSingle(scope.row)" />
118
- </el-tooltip>
119
- </template>
120
- </el-table-column>
121
- <el-table-column v-if="!disabled">
122
- <template slot-scope="scope">
123
- <el-tooltip :content="$t('imatrixUIPublicModel.delete')" class="item" effect="dark" placement="top">
124
- <i class="el-icon-delete" style="cursor:pointer;" @click="deleteRow(scope.$index)" />
125
- </el-tooltip>
126
- </template>
127
- </el-table-column>
128
- </el-table>
129
- </el-dialog>
130
- </template>
131
- <template v-else>
132
- <fs-preview :label="value" :file-list="showFileList" />
133
- </template>
134
- </div>
135
- </template>
136
-
137
- <script>
138
-
139
- import { getToken } from '../../../src/utils/auth'
140
- import { isImage } from '../../../src/utils/util'
141
- import { isPlateSys, getSystemFrontendUrl } from '../../../src/utils/common-util'
142
- import Vue from 'vue'
143
- import FsPreview from '../../fs-preview/src/fs-preview.vue'
144
- export default {
145
- name: 'MultipartUploadList',
146
- components: {
147
- FsPreview
148
- },
149
- props: {
150
- value: {
151
- type: String,
152
- default: null
153
- },
154
- entity: {
155
- type: Object,
156
- default: null
157
- },
158
- fileSetObj: {
159
- type: Object,
160
- default: () => {
161
- return { limitFileSize: 10, multiple: false, accept: null }
162
- }
163
- },
164
- disabled: {
165
- type: Boolean,
166
- default: false
167
- }
168
- },
169
- data() {
170
- const headers = { Authorization: getToken() }
171
- let defaultAction = Vue.prototype.baseURL + '/common/fs-upload'
172
- if (isPlateSys(Vue.prototype.systemCode)) {
173
- defaultAction = Vue.prototype.baseAPI + '/component/super-form/uploads'
174
- }
175
- return {
176
- deleteUuids: [],
177
- headers,
178
- defaultAction,
179
- annexUploadFlag: false,
180
- showPreviewSingleImage: false,
181
- showPreviewMulti: false,
182
- lastFileName: null,
183
- previewImageInfo: {},
184
- showFileList: [],
185
- // /
186
- uploadingFile: [], // 正在上传的文件
187
- cancelUploadFile: [],
188
- fileContent: [],
189
- chunkSize: 5 * 1024 * 1024// 定义5M为一片
190
-
191
- }
192
- },
193
- created() {
194
-
195
- },
196
- mounted() {
197
- if (!this.fileSetObj.limitFileSize) {
198
- this.fileSetObj.limitFileSize = 10
199
- }
200
- const name = this.entity[this.fileSetObj.showNameData.dbName]
201
- const serverName = this.entity[this.fileSetObj.serverNameData.dbName]
202
- if (name && serverName) {
203
- const nameArr = name.split(',')
204
- const serverNameArr = serverName.split(',')
205
- nameArr.forEach((element, index) => {
206
- this.fileContent.push({ name: element, serverName: serverNameArr[index] })
207
- const token = getToken()
208
- let url = Vue.prototype.baseURL + '/common/super-form/downloads?jwt=' + token
209
- if (isPlateSys(Vue.prototype.systemCode)) {
210
- url = Vue.prototype.baseAPI + '/component/super-form/downloads?jwt=' + token
211
- }
212
- const src = url + '&showName=' + encodeURI(element) + '&serverPath=' + serverNameArr[index]
213
- this.showFileList.push({ showName: element, serverPath: serverNameArr[index], src: src })
214
- })
215
- }
216
- },
217
- methods: {
218
- openAnnexUpload() {
219
- this.annexUploadFlag = true
220
- },
221
- // //////
222
- async uploadFile(res) {
223
- if (this.uploadingFile.length > 0 && !this.fileSetObj.multiple) {
224
- this.$message({
225
- showClose: true,
226
- message: '文件单选,请勿同时上传多份文件!',
227
- type: 'warning'
228
- })
229
- return
230
- }
231
- // 占位 ,防止分片初始化未完成又选择文件上传
232
- const uploadTimestamp = Date.now()
233
- this.uploadingFile.push({ name: res.raw.name, uploadProgress: 0, serverName: uploadTimestamp })
234
- // 获取用户选择的文件
235
- const file = res.raw
236
- const fileSize = file.size
237
- // 计算当前选择文件需要的分片数量
238
- const chunkCount = Math.ceil(fileSize / this.chunkSize)
239
- console.log('文件大小:', (file.size / 1024 / 1024) + 'Mb', '分片数:', chunkCount)
240
- console.log('向后端请求本次分片上传初始化')
241
- const requestData = { fileName: file.name, chunkCount: chunkCount }
242
- // 向后端请求本次分片上传初始化
243
-
244
- this.$http.post(Vue.prototype.baseURL + '/common/mutipart-upload/create', requestData).then(
245
- async res => {
246
- console.log(this.cancelUploadFile, 'sssssssssssss')
247
- if (this.cancelUploadFile.indexOf(requestData.serverName) > 0) {
248
- return
249
- }
250
- const currentUploadInex = this.uploadingFile.findIndex(item => item.serverName === uploadTimestamp)
251
- const serverName = res.serverName
252
- this.uploadingFile[currentUploadInex] = { uploadProgress: 0, name: file.name, serverName: serverName, folder: res.folder }
253
- console.log(this.uploadingFile, 'uploadingFile')
254
- const chunkNames = []
255
- for (let i = 0; i < chunkCount; i++) {
256
- // 分片开始位置
257
- const start = i * this.chunkSize
258
- // 分片结束位置
259
- const end = Math.min(fileSize, start + this.chunkSize)
260
- // 取文件指定范围内的byte,从而得到分片数据
261
- const _chunkFile = file.slice(start, end)
262
- console.log('开始上传第' + (i + 1) + '个分片' + ',共' + chunkCount + '个')
263
- const formData = new FormData()
264
- formData.append('folder', res.folder)
265
- formData.append('serverName', serverName)
266
- formData.append('file', _chunkFile)
267
- if (this.cancelUploadFile.indexOf(serverName) > 0) {
268
- break
269
- } else {
270
- await this.$http.post(Vue.prototype.baseURL + '/common/mutipart-upload/upload', formData).then(uploadPieceRes => {
271
- chunkNames.push(uploadPieceRes.uploadName)
272
- const uploadProgress = parseInt(((i + 1) / chunkCount) * 100)
273
- this.uploadingFile[currentUploadInex].uploadProgress = (uploadProgress > 100 ? 100 : uploadProgress)
274
- this.$set(this.uploadingFile, currentUploadInex, this.uploadingFile[currentUploadInex])
275
- console.log('第' + (i + 1) + '个分片上传完成', this.uploadingFile)
276
- })
277
- }
278
- }
279
- if (this.cancelUploadFile.indexOf(serverName) < 0) {
280
- // 请求后端合并文件
281
- this.composeFile(file.name, chunkCount, fileSize, serverName, chunkNames, res.folder)
282
- } else {
283
- await this.$http.post(Vue.prototype.baseURL + '/common/mutipart-upload/remove-chunks', { serverName: serverName, folder: res.folder }).then(uploadPieceRes => {
284
- console.log('取消上传,并移除已上传的文件碎片')
285
- })
286
- }
287
- })
288
- },
289
- /**
290
- * 请求后端合并文件
291
- * @param serverName
292
- * @param fileName
293
- */
294
- composeFile(fileName, chunkSize, fileSize, serverName, chunkNames, folder) {
295
- const data = {
296
- fileName: fileName, // 文件名称
297
- chunkSize: chunkSize, // 分片数量
298
- fileSize: fileSize, // 文件大小byte
299
- serverName: serverName, // serverName
300
- chunkNames: chunkNames, // 上传分片的编号
301
- folder: folder
302
- }
303
- console.log(data, '开始请求后端合并文件')
304
- this.$http.post(Vue.prototype.baseURL + '/common/mutipart-upload/merge', data).then(res => {
305
- this.uploadingFile.splice(this.uploadingFile.findIndex(item => item.serverName === serverName), 1)
306
- if (this.fileSetObj.multiple) {
307
- this.fileContent.push({ name: fileName, serverName: serverName })
308
- const currentShowName = this.entity[this.fileSetObj.showNameData.dbName]
309
- if (currentShowName && currentShowName.length > 0) {
310
- this.setEntityValue(currentShowName + ',' + fileName,
311
- this.entity[this.fileSetObj.serverNameData.dbName] + ',' + serverName)
312
- } else {
313
- this.setEntityValue(fileName, serverName)
314
- }
315
- } else {
316
- this.fileContent = [{ name: fileName, serverName: serverName }]
317
- this.setEntityValue(fileName, serverName)
318
- }
319
- // this.$emit('sendFileObjToParent', res.data)// 传递给父组件请求结果
320
- console.log('合并文件完成', res, this.entity)
321
- })
322
- },
323
- setEntityValue(fileName, serverName) {
324
- this.$set(this.entity, this.fileSetObj.showNameData.dbName, fileName)
325
- this.$set(this.entity, this.fileSetObj.serverNameData.dbName, serverName)
326
- },
327
- cancelUpload(serverName) {
328
- this.$set(this.entity, 'DOC_NAME', null)
329
- this.$set(this.entity, 'DOC_PATH', null)
330
- this.cancelUploadFile.push(serverName)
331
- this.uploadingFile.splice(this.uploadingFile.findIndex(item => item.serverName === serverName), 1)
332
- },
333
- preview(name, serverName) {
334
- if (isImage(name)) {
335
- this.previewImageInfo = {
336
- src: Vue.prototype.baseURL + '/common/super-form/downloads?jwt=' + getToken() + '&showName=' + name + '&serverPath=' + serverName
337
- }
338
- this.showPreviewSingleImage = true
339
- } else {
340
- this.previewDoc(name, serverName)
341
- }
342
- },
343
- previewDoc(name, serverName) {
344
- const token = getToken()
345
- let previewUrl = Vue.prototype.baseURL + '/common/fs-upload/preview?jwt=' + token
346
- if (isPlateSys(Vue.prototype.systemCode)) {
347
- previewUrl = Vue.prototype.baseAPI + '/component/fs-upload/preview?jwt=' + token
348
- }
349
- if (Vue.prototype.customPreviewUrl) {
350
- window.open(getSystemFrontendUrl(Vue.prototype.portalUrl) + '/#/file-service/preview?serverPath=' + serverName +
351
- '&showName=' + encodeURI(name),
352
- name
353
- )
354
- } else {
355
- window.open(previewUrl + '&showName=' + encodeURI(name) + '&serverPath=' + serverName)
356
- }
357
- },
358
- handleOnRemove(index) {
359
- this.fileContent.splice(index, 1)
360
- if (this.fileSetObj.multiple) {
361
- const nameArr = []
362
- const serverNameArr = []
363
- this.fileContent.forEach(element => {
364
- if (element.name && element.serverName) {
365
- nameArr.push(element.name)
366
- serverNameArr.push(element.serverName)
367
- }
368
- })
369
- this.setEntityValue(nameArr.join(','), serverNameArr.join(','))
370
- } else {
371
- this.setEntityValue(null, null)
372
- }
373
- }
374
- }
375
- }
376
- </script>
377
-
378
- <style scoped></style>
@@ -1,6 +0,0 @@
1
- import OrganizationInput from './src/organization-input.vue'
2
- OrganizationInput.install = function(Vue) {
3
- Vue.component(OrganizationInput.name, OrganizationInput)
4
- }
5
-
6
- export default OrganizationInput