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,226 +0,0 @@
1
- <!-- 文件预览 -->
2
- <template>
3
- <div v-if="label">
4
- <div class="list-file" @click="previewMuti()" @dblclick="dblclickEvent">
5
- <i class="el-icon-paperclip" />
6
- {{ label }}
7
- <i class="el-icon-view annex-cell" />
8
- </div>
9
-
10
- <el-dialog
11
- :append-to-body="true"
12
- :show-close="true"
13
- :title="$t('imatrixUIPublicModel.previewImage')"
14
- :visible.sync="showPreviewSingleImage"
15
- @close="$emit('close')"
16
- >
17
- <span slot="title">{{ $t('imatrixUIPublicModel.previewImage') }}
18
- <!-- <i v-if="downloadable" class="el-icon-download" style="padding-left:5px;cursor:pointer;color:#409EFF" @click="downloadFile()" /> -->
19
- <!-- <i v-if="deleteable" class="el-icon-delete" style="padding-left:5px;cursor:pointer;color:#F56C6C" @click="deleteFile()" /> -->
20
- </span>
21
- <el-image v-if="previewImageInfo&&previewImageInfo.isImg" :preview-src-list="[previewImageInfo.src]" :src="previewImageInfo.src" />
22
- </el-dialog>
23
- <el-dialog
24
- :append-to-body="true"
25
- :show-close="true"
26
- :title="$t('imatrixUIPublicModel.preview')"
27
- :visible.sync="showPreviewMulti"
28
- width="30%"
29
- @close="$emit('close')"
30
- >
31
- <span slot="title">{{ $t('imatrixUIPublicModel.preview') }}
32
- <!-- <i v-if="downloadable" class="el-icon-download" style="padding-left:5px;cursor:pointer;color:#409EFF" @click="downloadFile()" /> -->
33
- <!-- <i v-if="deleteable" class="el-icon-delete" style="padding-left:5px;cursor:pointer;color:#F56C6C" @click="deleteFile()" /> -->
34
- </span>
35
- <el-table
36
- :show-header="false"
37
- :data="fileList"
38
- >
39
- <el-table-column
40
- prop="showName"
41
- width="200"
42
- />
43
- <el-table-column align="right">
44
- <template slot-scope="scope">
45
- <el-tooltip :content="$t('imatrixUIPublicModel.preview')" class="item" effect="dark" placement="top">
46
- <i class="el-icon-view" style="cursor:pointer;" @click="previewSingle(scope.row)" />
47
- </el-tooltip>
48
- </template>
49
- </el-table-column>
50
- <el-table-column>
51
- <template slot-scope="scope">
52
- <el-tooltip :content="$t('imatrixUIPublicModel.download')" class="item" effect="dark" placement="top">
53
- <i class="el-icon-download" style="cursor:pointer;" @click="donwloadFile(scope.$index, fileList)" />
54
- </el-tooltip>
55
- </template>
56
- </el-table-column>
57
- </el-table>
58
- </el-dialog>
59
- </div>
60
- </template>
61
-
62
- <script>
63
- import Vue from 'vue'
64
- import { isPlateSys, getSystemFrontendUrl } from '../../../src/utils/common-util'
65
- import { isImage, getEntityFieldValue } from '../../../src/utils/util'
66
- import { packageFile } from '../../super-grid/src/utils'
67
- import { getToken } from '../../../src/utils/auth'
68
- export default {
69
- name: 'FsPreview',
70
- components: {
71
- },
72
- props: {
73
- label: {
74
- type: String,
75
- default: null
76
- },
77
- fileSetObj: {
78
- type: Object,
79
- default: null
80
- },
81
- isSql: {
82
- type: Boolean,
83
- default: false
84
- },
85
- entity: {
86
- type: Object,
87
- default: () => {
88
- return {}
89
- }
90
- }
91
- },
92
- data() {
93
- return {
94
- showPreviewSingleImage: false,
95
- showPreviewMulti: false,
96
- previewImageInfo: {},
97
- fileList: []
98
- }
99
- },
100
- created() {
101
- // let fileList = []
102
- // if (this.column.fileSet && this.column.fileSet !== '' && (this.column.componentType === 'annex' || this.column.componentType === 'multipartUpload')) {
103
- // const fileSetObj = JSON.parse(this.column.fileSet)
104
- // const keyValueParam = this.analysisFileSetObj(fileSetObj, this.isSql)
105
- // if (fileSetObj && fileSetObj.multiple) {
106
- // if (fileSetObj.childAnnexDataTableCode) {
107
- // // const lowerStr = fileSetObj.childAnnexDataTableCode.toLowerCase()
108
- // const fileArr = this.entity[this.column.prop]
109
- // // 子表
110
- // fileList = otherFilesToStandard(fileSetObj, keyValueParam, fileArr, null)
111
- // } else {
112
- // const filesStringData = {
113
- // 'showName': getEntityFieldValue(this.entity, keyValueParam.showName),
114
- // 'serverPath': getEntityFieldValue(this.entity, keyValueParam.serverPath)
115
- // }
116
- // fileList = otherFilesToStandard(fileSetObj, keyValueParam, null, filesStringData)
117
- // }
118
- // } else {
119
- // const showName = getEntityFieldValue(this.entity, keyValueParam.showName)
120
- // const serverPath = getEntityFieldValue(this.entity, keyValueParam.serverPath)
121
- // fileList.push(packageFile(showName, serverPath))
122
- // }
123
- // }
124
- },
125
- methods: {
126
- dblclickEvent() {
127
- clearTimeout(this.time)
128
- },
129
- previewSingle(fileInfo) {
130
- fileInfo = packageFile(fileInfo.showName, fileInfo.serverPath)
131
- if (isImage(fileInfo.showName)) {
132
- this.previewImageInfo = fileInfo
133
- this.showPreviewSingleImage = true
134
- } else {
135
- this.previewDoc(fileInfo)
136
- }
137
- },
138
- previewMuti() {
139
- const keyValueParam = this.analysisFileSetObj(this.fileSetObj, this.isSql)
140
- const serverPath = getEntityFieldValue(this.entity, keyValueParam.serverPath)
141
- if (serverPath) {
142
- const uuids = serverPath.split(',')
143
- this.$http.post(Vue.prototype.baseURL + '/common/fs-upload/search-file-names', uuids).then(result => {
144
- this.fileList = []
145
- uuids.forEach(uuid => {
146
- this.fileList.push({ showName: result[uuid], serverPath: uuid })
147
- })
148
- this.showPreviewMulti = true
149
- })
150
- }
151
-
152
- // var that = this
153
- // clearTimeout(that.time)
154
- // that.time = setTimeout(() => {
155
- // }, 200)
156
- },
157
- previewDoc(fileInfo) {
158
- const token = getToken()
159
- let previewUrl = Vue.prototype.baseURL + '/common/fs-upload/preview?jwt=' + token
160
- if (isPlateSys(Vue.prototype.systemCode)) {
161
- previewUrl = Vue.prototype.baseAPI + '/component/fs-upload/preview?jwt=' + token
162
- }
163
- const showName = fileInfo.showName
164
- if (Vue.prototype.customPreviewUrl) {
165
- window.open(getSystemFrontendUrl(Vue.prototype.portalUrl) + '/#/file-service/preview?serverPath=' + fileInfo.serverPath +
166
- '&showName=' + encodeURI(showName),
167
- fileInfo.showName
168
- )
169
- } else {
170
- window.open(previewUrl + '&showName=' + encodeURI(showName) + '&serverPath=' + fileInfo.serverPath)
171
- }
172
- },
173
- donwloadFile(index, fileList) {
174
- const token = getToken()
175
- const showName = this.formatFileName(this.fileList[index].showName)
176
- if (!this.fileList[index].src) {
177
- let url = Vue.prototype.baseURL + '/common/super-form/downloads?jwt=' + token
178
- if (isPlateSys(Vue.prototype.systemCode)) {
179
- url = Vue.prototype.baseAPI + '/component/super-form/downloads?jwt=' + token
180
- }
181
- const src = url + '&showName=' + encodeURI(showName) + '&serverPath=' + this.fileList[index].serverPath
182
- window.open(src)
183
- } else {
184
- window.open(this.fileList[index].src)
185
- }
186
- },
187
- analysisFileSetObj(fileSetObj, isSql) {
188
- let showName = ''
189
- let serverPath = ''
190
- if (fileSetObj) {
191
- if (fileSetObj.showNameData) {
192
- if (isSql) {
193
- if (fileSetObj.showNameData.dbName) {
194
- showName = fileSetObj.showNameData.dbName
195
- }
196
- } else {
197
- if (fileSetObj.showNameData.name) {
198
- showName = fileSetObj.showNameData.name
199
- }
200
- }
201
- }
202
- if (fileSetObj.serverNameData) {
203
- if (isSql) {
204
- if (fileSetObj.serverNameData.dbName) {
205
- serverPath = fileSetObj.serverNameData.dbName
206
- }
207
- } else {
208
- if (fileSetObj.serverNameData.name) {
209
- serverPath = fileSetObj.serverNameData.name
210
- }
211
- }
212
- }
213
- }
214
- return {
215
- 'showName': showName,
216
- 'serverPath': serverPath
217
- }
218
- },
219
- formatFileName(fileName) {
220
- return fileName.replace('#', '~~').replace('?', '~$').replace('&', '$')
221
- }
222
- }
223
- }
224
- </script>
225
-
226
- <style scoped></style>
@@ -1,6 +0,0 @@
1
- import FsUpload from './src/fs-upload.vue'
2
- FsUpload.install = function (Vue) {
3
- Vue.component(FsUpload.name, FsUpload)
4
- }
5
-
6
- export default FsUpload
@@ -1,420 +0,0 @@
1
- <!-- 文件上传 -->
2
- <template>
3
- <div v-loading="loading">
4
- <el-button
5
- v-if="isShowButton && !disabled"
6
- size="small"
7
- type="primary"
8
- icon="el-icon-upload2"
9
- @click="selectDataFile"
10
- >
11
- {{ $t('fsUpload.upload') }}
12
- </el-button>
13
- <input
14
- ref="uploadTemplate"
15
- type="file"
16
- name="uploadTemplate"
17
- style="display:none"
18
- :accept="accepts"
19
- @change="upload"
20
- >
21
- <div v-if="unifiedEnclosures && unifiedEnclosures.length > 0 && isShowData">
22
- <div v-if="isImg">
23
- <el-table
24
- :data="unifiedEnclosures"
25
- :height="tableHeight"
26
- style="width: 100%"
27
- >
28
- <el-table-column :label="$t('fsUpload.name')" width="240">
29
- <template slot-scope="scope">
30
- <el-link
31
- :href="
32
- baseURL +
33
- '/common/fs-upload/download?serverPath=' +
34
- scope.row.uuid +
35
- '&showName=' +
36
- scope.row.fileName
37
- "
38
- type="primary"
39
- >
40
- {{ scope.row.fileName }}
41
- </el-link>
42
- </template>
43
- </el-table-column>
44
- <el-table-column :label="$t('fsUpload.picture')" width="240">
45
- <template slot-scope="scope">
46
- <el-image
47
- :src="
48
- baseURL +
49
- '/common/fs-upload/download?serverPath=' +
50
- scope.row.uuid +
51
- '&showName=' +
52
- scope.row.fileName
53
- "
54
- :preview-src-list="[ baseURL +
55
- '/common/fs-upload/download?serverPath=' +
56
- scope.row.uuid +
57
- '&showName=' +
58
- scope.row.fileName]"
59
- @click="bigPicture(scope.$index)"
60
- />
61
- </template>
62
- </el-table-column>
63
- <el-table-column
64
- v-if="!disabled"
65
- :label="$t('fsUpload.operating')"
66
- width="120"
67
- >
68
- <template slot-scope="scope">
69
- <el-button
70
- size="mini"
71
- type="danger"
72
- @click="deleteFile(scope.$index)"
73
- >
74
- {{ $t('fsUpload.delete') }}
75
- </el-button>
76
- </template>
77
- </el-table-column>
78
- </el-table>
79
- </div>
80
- <div v-else-if="isShowList">
81
- <el-table
82
- :data="unifiedEnclosures"
83
- :height="tableHeight"
84
- style="width: 100%"
85
- >
86
- <el-table-column :label="$t('fsUpload.name')" width="240">
87
- <template slot-scope="scope">
88
- <el-link
89
- :href="
90
- baseURL +
91
- '/common/fs-upload/download?serverPath=' +
92
- scope.row.uuid +
93
- '&showName=' +
94
- scope.row.fileName
95
- "
96
- type="primary"
97
- >
98
- {{ scope.row.fileName }}
99
- </el-link>
100
- </template>
101
- </el-table-column>
102
- <el-table-column width="200" :label="$t('fsUpload.operating')">
103
- <template slot-scope="scope">
104
- <el-button
105
- v-if="!disabled"
106
- size="mini"
107
- type="danger"
108
- @click="deleteFile(scope.$index)"
109
- >
110
- {{ $t('fsUpload.delete') }}
111
- </el-button>
112
- <el-button size="mini" @click="preview(scope.row)">
113
- {{ $t('fsUpload.preview') }}
114
- </el-button>
115
- </template>
116
- </el-table-column>
117
- </el-table>
118
- </div>
119
- <div v-else>
120
- <div v-for="(item, index) in unifiedEnclosures" :key="index">
121
- <el-link
122
- :href="
123
- baseURL +
124
- '/common/fs-upload/download?serverPath=' +
125
- item.uuid +
126
- '&showName=' +
127
- item.fileName
128
- "
129
- type="primary"
130
- >
131
- {{ item.fileName }}
132
- </el-link>
133
- <el-tooltip :content="$t('fsUpload.delete')" effect="light">
134
- <i
135
- v-if="!disabled"
136
- class="el-icon-delete"
137
- style="color:red;margin-left: 10px"
138
- @click="deleteFile(index)"
139
- />
140
- </el-tooltip>
141
- <el-tooltip
142
- :content="$t('fsUpload.preview')"
143
- style="margin-left: 10px"
144
- effect="light"
145
- >
146
- <i class="el-icon-view" @click="preview(item)" />
147
- </el-tooltip>
148
- </div>
149
- </div>
150
- </div>
151
- <see-big-picture
152
- v-if="bigPictureVisible"
153
- :show-index="showIndex"
154
- :unified-enclosures="unifiedEnclosures"
155
- @close="bigPictureVisible = false"
156
- />
157
- </div>
158
- </template>
159
-
160
- <script>
161
- import Vue from 'vue'
162
- import seeBigPicture from './see-big-picture.vue'
163
- import { getToken } from '../../../src/utils/auth'
164
- import { isPlateSys, getSystemFrontendUrl } from '../../../src//utils//common-util.js'
165
- export default {
166
- name: 'FsUploadMulti',
167
- components: {
168
- seeBigPicture
169
- },
170
- props: {
171
- /**
172
- * 系统编码
173
- */
174
- systemCode: {
175
- type: String,
176
- default: null
177
- },
178
- /**
179
- * 上传限制的类型
180
- */
181
- accept: {
182
- type: String,
183
- default: null
184
- },
185
- /**
186
- * 是否是图片
187
- */
188
- isImg: {
189
- type: Boolean,
190
- default: false
191
- },
192
- /**
193
- * 针对多选情况
194
- * 是否显示拼接字符串
195
- * 如果未选择,直接显示表单
196
- */
197
- isShowList: {
198
- type: Boolean,
199
- default: true
200
- },
201
- /**
202
- * 针对图片类型
203
- * 具体参考element-ui中的图片参数fit属性
204
- */
205
- fit: {
206
- type: String,
207
- default: null
208
- },
209
- /**
210
- * 禁止编辑
211
- */
212
- disabled: {
213
- type: Boolean,
214
- default: false
215
- },
216
- /**
217
- * 是否显示按钮
218
- */
219
- isShowButton: {
220
- type: Boolean,
221
- default: true
222
- },
223
- /**
224
- * 是否显示数据
225
- */
226
- isShowData: {
227
- type: Boolean,
228
- default: true
229
- },
230
- /**
231
- * 回传数据
232
- */
233
- data: {
234
- type: Array,
235
- default: null
236
- },
237
- /** 图片显示数量 */
238
- imgSize: {
239
- type: Number,
240
- default: 0
241
- },
242
- /** 设置附件的上传数量 */
243
- fileSize: {
244
- type: Number,
245
- default: 0
246
- },
247
- /** 设置table高度 */
248
- tableHeight: {
249
- type: String,
250
- default: null
251
- }
252
- },
253
- data() {
254
- return {
255
- unifiedEnclosures: [],
256
- bigPictureVisible: false,
257
- baseURL: '',
258
- accepts: '',
259
- showIndex: 0,
260
- loading: ''
261
- }
262
- },
263
- created() {
264
- this.baseURL = Vue.prototype.baseURL
265
- if (this.data) {
266
- this.unifiedEnclosures = this.data
267
- }
268
- this.judgeImg()
269
- },
270
- methods: {
271
- // 预览图片
272
- bigPicture(index) {
273
- this.showIndex = index
274
- this.bigPictureVisible = true
275
- },
276
- // 成功后返回数据
277
- onSuccess() {
278
- const data = this.unifiedEnclosures
279
- this.$emit('onSuccess', data)
280
- },
281
- // 判断是否是图片格式,如果是限制只能上传图片
282
- judgeImg() {
283
- if (this.isImg) {
284
- this.accepts = 'image/*'
285
- } else {
286
- if (this.accept) {
287
- this.accepts = this.accept
288
- }
289
- }
290
- },
291
- selectDataFile() {
292
- this.$refs.uploadTemplate.click()
293
- },
294
- deleteFile(index) {
295
- this.deleteUuid = this.unifiedEnclosures[index].uuid
296
- this.unifiedEnclosures.splice(index, 1)
297
- this.deleteSuccess()
298
- },
299
- deleteSuccess() {
300
- const data = this.unifiedEnclosures
301
- this.$emit('deleteSuccess', this.deleteUuid, data)
302
- },
303
- // 预览
304
- preview(row) {
305
- if (Vue.prototype.isOffice) {
306
- const jwt = getToken()
307
- const map = {
308
- fileName:
309
- Vue.prototype.officeweb365Url +
310
- '/common/fs-upload/download?serverPath=' +
311
- row.uuid +
312
- '&showName=' +
313
- row.fileName +
314
- '&jwt=' +
315
- jwt
316
- }
317
- const http = this.$http
318
- http
319
- .post(Vue.prototype.baseURL + '/common/fs-upload/des-encrypt', map)
320
- .then(data => {
321
- window.open(Vue.prototype.isOffice + data)
322
- })
323
- } else {
324
- let showName
325
- const split = row.fileName.split('.')
326
- if (
327
- split[split.length - 1].toLowerCase() === 'xls' ||
328
- split[split.length - 1].toLowerCase() === 'xlsx' ||
329
- split[split.length - 1].toLowerCase() === 'csv'
330
- ) {
331
- showName = split[0] + '.html'
332
- } else {
333
- showName = split[0] + '.pdf'
334
- }
335
- const token = getToken()
336
- if (Vue.prototype.customPreviewUrl) {
337
- window.open(getSystemFrontendUrl(Vue.prototype.portalUrl) + '/#/file-service/preview?serverPath=' + row.uuid +
338
- '&showName=' + encodeURI(row.fileName),
339
- showName
340
- )
341
- } else {
342
- let url = Vue.prototype.baseURL +
343
- '/common/fs-upload/preview?serverPath=' +
344
- row.uuid +
345
- '&showName=' +
346
- row.fileName + '&jwt=' + token
347
- if (isPlateSys(Vue.prototype.systemCode)) {
348
- url = Vue.prototype.baseAPI +
349
- '/common/fs-upload/preview?serverPath=' +
350
- row.uuid +
351
- '&showName=' +
352
- row.fileName + '&jwt=' + token
353
- }
354
- window.open(url,
355
- showName
356
- )
357
- }
358
- }
359
- },
360
- // 上传
361
- upload(params) {
362
- let message
363
- if (this.fileSize) {
364
- if (
365
- this.fileSize !== 0 &&
366
- this.unifiedEnclosures.length >= this.fileSize
367
- ) {
368
- message =
369
- this.$t('fsUpload.theNumberOfUploadsExceedsTheLimitTheLimitIs') +
370
- ':' +
371
- this.fileSize
372
- }
373
- }
374
-
375
- if (!message) {
376
- this.loading = true
377
- const param = new FormData()
378
- param.append('file', this.$refs.uploadTemplate.files[0])
379
- const http = this.$http
380
- http.headers = "'Content-Type': 'multipart/form-data'"
381
- http
382
- .post(
383
- Vue.prototype.baseURL +
384
- '/common/fs-upload/upload-template/' +
385
- this.systemCode,
386
- param,
387
- { headers: { 'Content-Type': 'multipart/form-data' }}
388
- )
389
- .then(data => {
390
- this.unifiedEnclosures.push(data)
391
- params.target.value = ''
392
- console.log('data', data)
393
- this.judgeImg()
394
- console.log(' this.unifiedEnclosures', this.unifiedEnclosures)
395
- this.onSuccess()
396
- this.$message({
397
- showClose: true,
398
- type: 'success',
399
- message: this.$t('fsUpload.uploadSucceeded')
400
- })
401
- this.loading = false
402
- })
403
- .catch(() => {
404
- params.target.value = ''
405
- this.loading = false
406
- })
407
- } else {
408
- params.target.value = ''
409
- this.$message({
410
- showClose: true,
411
- type: 'warning',
412
- message: message
413
- })
414
- }
415
- }
416
- }
417
- }
418
- </script>
419
-
420
- <style scoped></style>