imatrix-ui 2.8.21-dw → 2.8.21

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 +4 -2
  4. package/packages/breadcrumb/index.js +6 -0
  5. package/packages/breadcrumb/src/breadcrumb.vue +71 -0
  6. package/packages/department-tree/index.js +6 -0
  7. package/packages/department-tree/src/department-tree.vue +108 -0
  8. package/packages/department-tree-inline/index.js +6 -0
  9. package/packages/department-tree-inline/src/department-multi-tree-inline.vue +402 -0
  10. package/packages/department-tree-inline/src/department-single-tree-inline.vue +284 -0
  11. package/packages/department-tree-inline/src/department-tree-inline.vue +86 -0
  12. package/packages/department-tree-inline/src/department-tree-service.js +245 -0
  13. package/packages/department-tree-inline/src/search-result.vue +176 -0
  14. package/packages/department-user-tree/index.js +6 -0
  15. package/packages/department-user-tree/src/department-user-multiple-tree.vue +116 -0
  16. package/packages/department-user-tree/src/department-user-single-tree.vue +76 -0
  17. package/packages/department-user-tree/src/department-user-tree.vue +101 -0
  18. package/packages/department-user-tree-inline/index.js +6 -0
  19. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +626 -0
  20. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +269 -0
  21. package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +79 -0
  22. package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +230 -0
  23. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +122 -0
  24. package/packages/department-user-tree-inline/src/search-result.vue +197 -0
  25. package/packages/directives/prevent-reclick.js +19 -0
  26. package/packages/dynamic-source-select/index.js +6 -0
  27. package/packages/dynamic-source-select/src/dynamic-source-select-service.js +70 -0
  28. package/packages/dynamic-source-select/src/dynamic-source-select.vue +440 -0
  29. package/packages/dynamic-source-select/src/events.js +55 -0
  30. package/packages/fs-preview/index.js +6 -0
  31. package/packages/fs-preview/src/fs-preview.vue +226 -0
  32. package/packages/fs-upload/index.js +6 -0
  33. package/packages/fs-upload/src/fs-upload-multi.vue +420 -0
  34. package/packages/fs-upload/src/fs-upload-single.vue +312 -0
  35. package/packages/fs-upload/src/fs-upload.vue +189 -0
  36. package/packages/fs-upload/src/see-big-picture.vue +55 -0
  37. package/packages/fs-upload-list/index.js +6 -0
  38. package/packages/fs-upload-list/src/fs-upload-list.vue +287 -0
  39. package/packages/hamburger/index.js +6 -0
  40. package/packages/hamburger/src/hamburger.vue +38 -0
  41. package/packages/index.js +121 -0
  42. package/packages/multipart-upload/index.js +6 -0
  43. package/packages/multipart-upload/src/index.vue +73 -0
  44. package/packages/multipart-upload/src/multipart-upload-form.vue +297 -0
  45. package/packages/multipart-upload/src/multipart-upload-list.vue +378 -0
  46. package/packages/organization-input/index.js +6 -0
  47. package/packages/organization-input/src/organization-input.vue +542 -0
  48. package/packages/plugins/export-data-new.js +453 -0
  49. package/packages/plugins/export-data.js +361 -0
  50. package/packages/plugins/index.js +15 -0
  51. package/packages/plugins/public-method.js +43 -0
  52. package/packages/remove-department/index.js +6 -0
  53. package/packages/remove-department/src/remove-department.vue +172 -0
  54. package/packages/remove-department/src/remove-dept-service.js +20 -0
  55. package/packages/remove-user/index.js +6 -0
  56. package/packages/remove-user/src/remove-user-service.js +20 -0
  57. package/packages/remove-user/src/remove-user.vue +195 -0
  58. package/packages/remove-workgroup/index.js +6 -0
  59. package/packages/remove-workgroup/src/remove-workgroup-service.js +20 -0
  60. package/packages/remove-workgroup/src/remove-workgroup.vue +159 -0
  61. package/packages/rich-editor/index.js +7 -0
  62. package/packages/rich-editor/index.vue +278 -0
  63. package/packages/rich-editor/langs/zh-Hans.js +1 -0
  64. package/packages/rich-editor/viewer.vue +103 -0
  65. package/packages/scan-code-input/index.js +6 -0
  66. package/packages/scan-code-input/src/events.js +33 -0
  67. package/packages/scan-code-input/src/scan-code-input-colse.vue +131 -0
  68. package/packages/scan-code-input/src/scan-code-input.vue +116 -0
  69. package/packages/secret-info/index.js +7 -0
  70. package/packages/secret-info/index.vue +90 -0
  71. package/packages/super-grid/index.js +7 -0
  72. package/packages/super-grid/src/apis.js +763 -0
  73. package/packages/super-grid/src/columns-config.vue +335 -0
  74. package/packages/super-grid/src/custom-formatter.js +250 -0
  75. package/packages/super-grid/src/dynamic-input.vue +1279 -0
  76. package/packages/super-grid/src/eventBus.js +2 -0
  77. package/packages/super-grid/src/events.js +55 -0
  78. package/packages/super-grid/src/formValidatorUtil.js +226 -0
  79. package/packages/super-grid/src/formatter.js +181 -0
  80. package/packages/super-grid/src/group-column.vue +100 -0
  81. package/packages/super-grid/src/header-context-menu.vue +87 -0
  82. package/packages/super-grid/src/index-column.vue +51 -0
  83. package/packages/super-grid/src/normal-column.vue +769 -0
  84. package/packages/super-grid/src/public-methods.js +31 -0
  85. package/packages/super-grid/src/row-operation.vue +161 -0
  86. package/packages/super-grid/src/search-button.vue +66 -0
  87. package/packages/super-grid/src/search-condition-input.vue +61 -0
  88. package/packages/super-grid/src/search-condition-list.vue +59 -0
  89. package/packages/super-grid/src/search-form-advancedQuery.vue +653 -0
  90. package/packages/super-grid/src/search-form-dialog.vue +79 -0
  91. package/packages/super-grid/src/search-form-item.vue +386 -0
  92. package/packages/super-grid/src/search-form-number.vue +38 -0
  93. package/packages/super-grid/src/search-form-open.vue +162 -0
  94. package/packages/super-grid/src/search-form-ordinarySearch.vue +188 -0
  95. package/packages/super-grid/src/search-form.vue +634 -0
  96. package/packages/super-grid/src/search-methods.js +387 -0
  97. package/packages/super-grid/src/selection-column.vue +43 -0
  98. package/packages/super-grid/src/store.js +3 -0
  99. package/packages/super-grid/src/super-grid-service.js +561 -0
  100. package/packages/super-grid/src/super-grid.vue +2793 -0
  101. package/packages/super-grid/src/utils.js +763 -0
  102. package/packages/super-grid/src/view-image-dialog.vue +130 -0
  103. package/packages/super-nine-grid/index.js +7 -0
  104. package/packages/super-nine-grid/src/apis.js +103 -0
  105. package/packages/super-nine-grid/src/custom-formatter.js +66 -0
  106. package/packages/super-nine-grid/src/formatter.js +132 -0
  107. package/packages/super-nine-grid/src/search-form-number.vue +38 -0
  108. package/packages/super-nine-grid/src/search-form.vue +430 -0
  109. package/packages/super-nine-grid/src/search-methods.js +134 -0
  110. package/packages/super-nine-grid/src/store.js +3 -0
  111. package/packages/super-nine-grid/src/super-grid-service.js +91 -0
  112. package/packages/super-nine-grid/src/super-nine-grid.vue +872 -0
  113. package/packages/super-nine-grid/src/utils.js +261 -0
  114. package/packages/svg-icon/index.js +6 -0
  115. package/packages/svg-icon/src/svg-icon.vue +43 -0
  116. package/packages/utils/utils.js +152 -0
  117. package/packages/utils/value-set.js +86 -0
  118. package/packages/valid-code/index.js +7 -0
  119. package/packages/valid-code/src/valid-code.vue +95 -0
  120. package/packages/workflow-button/index.js +6 -0
  121. package/packages/workflow-button/src/workflow-button.vue +325 -0
  122. package/packages/workflow-history-list/index.js +6 -0
  123. package/packages/workflow-history-list/src/api.js +7 -0
  124. package/packages/workflow-history-list/src/workflow-history-list.vue +185 -0
  125. package/packages/workgroup-tree/index.js +6 -0
  126. package/packages/workgroup-tree/src/workgroup-tree.vue +76 -0
  127. package/packages/workgroup-tree-inline/index.js +6 -0
  128. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +317 -0
  129. package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +43 -0
  130. package/packages/workgroup-user-tree/index.js +6 -0
  131. package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +100 -0
  132. package/packages/workgroup-user-tree-inline/index.js +6 -0
  133. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +163 -0
  134. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +436 -0
  135. package/packages/year-range-picker/index.js +6 -0
  136. package/packages/year-range-picker/src/year-range-picker.vue +51 -0
  137. package/src/i18n/i18n.js +1 -1
  138. package/src/i18n/langs/cn.js +4 -2
  139. package/src/i18n/langs/en.js +4 -2
  140. package/src/index.js +93 -0
  141. package/src/permission.js +7 -3
  142. package/src/plugins.js +3 -3
  143. package/src/router/index.js +24 -0
  144. package/src/store/getters.js +2 -1
  145. package/src/store/modules/app.js +10 -1
  146. package/src/styles/display-layout.scss +34 -0
  147. package/src/styles/index.scss +32 -4
  148. package/src/styles/theme/dark-blue/button.scss +9 -0
  149. package/src/styles/theme/dark-blue/card.scss +64 -0
  150. package/src/styles/theme/dark-blue/checkbox.scss +10 -0
  151. package/src/styles/theme/dark-blue/dark-blue-var.scss +8 -0
  152. package/src/styles/theme/dark-blue/dialog.scss +21 -0
  153. package/src/styles/theme/dark-blue/element-variables.scss +7 -0
  154. package/src/styles/theme/dark-blue/font.scss +71 -0
  155. package/src/styles/theme/dark-blue/form.scss +51 -0
  156. package/src/styles/theme/dark-blue/index.scss +247 -0
  157. package/src/styles/theme/dark-blue/input.scss +15 -0
  158. package/src/styles/theme/dark-blue/pagination.scss +14 -0
  159. package/src/styles/theme/dark-blue/scrollbar-style.scss +32 -0
  160. package/src/styles/theme/dark-blue/sidebar.scss +296 -0
  161. package/src/styles/theme/dark-blue/tab.scss +83 -0
  162. package/src/styles/theme/dark-blue/table.scss +60 -0
  163. package/src/styles/theme/dark-blue/tree.scss +31 -0
  164. package/src/styles/theme/dark-blue/var.scss +1028 -0
  165. package/src/styles/theme/gray/form-style.scss +2 -2
  166. package/src/styles/theme/gray/input-style.scss +8 -0
  167. package/src/utils/auth-api.js +115 -0
  168. package/src/utils/auth.js +34 -42
  169. package/src/utils/calculator/calculator-factory.js +2 -2
  170. package/src/utils/common-util.js +34 -0
  171. package/src/utils/jump-page-utils.js +29 -5
  172. package/src/utils/menu.js +19 -0
  173. package/src/utils/permission.js +4 -0
  174. package/src/utils/request.js +18 -2
  175. package/src/utils/util.js +7 -3
  176. package/src/views/dsc-component/Sidebar/Item.vue +4 -4
  177. package/src/views/dsc-component/Sidebar/Link.vue +11 -2
  178. package/src/views/dsc-component/Sidebar/SidebarItem.vue +36 -20
  179. package/src/views/dsc-component/Sidebar/index.vue +24 -12
  180. package/src/views/dsc-component/tabs/tab-content.vue +16 -1
  181. package/src/views/login/index.vue +1 -1
@@ -0,0 +1,226 @@
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>
@@ -0,0 +1,6 @@
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
@@ -0,0 +1,420 @@
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>