adtec-core-package 2.8.5 → 2.8.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adtec-core-package",
3
- "version": "2.8.5",
3
+ "version": "2.8.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -46,7 +46,7 @@
46
46
  :before-upload="beforeUpload"
47
47
  drag
48
48
  :accept="getAccept"
49
- :action="'/api/doc/uploadFile/' + business + '/' + businessId + '/' + association"
49
+ :action="'/api/doc/uploadFile/' + business + '/' + businessId + '/' + association+(watermarkCode ? '?watermarkCode=' + watermarkCode : '')"
50
50
  multiple
51
51
  :limit="limit"
52
52
  :headers="uploadHeaders"
@@ -205,7 +205,11 @@ const props = defineProps({
205
205
  showOptMessage: {
206
206
  type:Boolean,
207
207
  default:true
208
- }
208
+ },
209
+ watermarkCode: {
210
+ type: String,
211
+ default: () => undefined
212
+ },
209
213
  })
210
214
  const mousemove = (fileName: string) => {
211
215
  hoverfileName.value = fileName
@@ -6,29 +6,27 @@
6
6
  <div v-if="!isEdlt">
7
7
  <el-auto-tool-tip v-if="uploadFilesList?.length">
8
8
  <template #tooltipContent>
9
- <div style="display:flex;flex-direction:column">
10
- <span
11
- v-for="item in uploadFilesList"
12
- :key="item.id"
13
- style="margin: 0 2px"
14
- >{{ item.name }}
15
- </span>
9
+ <div style="display: flex; flex-direction: column">
10
+ <span v-for="item in uploadFilesList" :key="item.id" style="margin: 0 2px"
11
+ >{{ item.name }}
12
+ </span>
16
13
  </div>
17
14
  </template>
18
15
  <template #content>
19
- <div style="display:flex;flex-direction:column">
20
- <div v-for="item in uploadFilesList" :key="item.id"
21
- class="file-item"
22
- style="display:flex; align-items:center;overflow: hidden">
16
+ <div style="display: flex; flex-direction: column">
17
+ <div
18
+ v-for="item in uploadFilesList"
19
+ :key="item.id"
20
+ class="file-item"
21
+ style="display: flex; align-items: center; overflow: hidden"
22
+ >
23
23
  <el-icons :model-value="getIcon(item.name)" style="margin-right: 5px"></el-icons>
24
24
  <span class="link-name" @click="fileView(item.id)">{{ item.name }}</span>
25
25
  </div>
26
26
  </div>
27
27
  </template>
28
28
  </el-auto-tool-tip>
29
- <div style="text-align: center;color: var(--el-disabled-text-color)" v-else>
30
- 暂无附件
31
- </div>
29
+ <div style="text-align: center; color: var(--el-disabled-text-color)" v-else>暂无附件</div>
32
30
  </div>
33
31
  <el-upload
34
32
  v-else
@@ -42,7 +40,15 @@
42
40
  :before-upload="beforeUpload"
43
41
  drag
44
42
  :accept="getAccept"
45
- :action="'/api/doc/uploadFile/' + business + '/' + businessId + '/' + association"
43
+ :action="
44
+ '/api/doc/uploadFile/' +
45
+ business +
46
+ '/' +
47
+ businessId +
48
+ '/' +
49
+ association +
50
+ (watermarkCode ? '?watermarkCode=' + watermarkCode : '')
51
+ "
46
52
  multiple
47
53
  :limit="limit"
48
54
  :headers="uploadHeaders"
@@ -71,7 +77,7 @@
71
77
  </el-flex>
72
78
  <el-flex align="center" justify="flex-end" width="50px">
73
79
  <el-text v-if="!file?.businessId && file.percentage !== 100"
74
- >{{ file.percentage }}%
80
+ >{{ file.percentage }}%
75
81
  </el-text>
76
82
  <el-icons
77
83
  v-if="file?.businessId || file.percentage === 100"
@@ -92,7 +98,13 @@
92
98
  <script setup lang="ts">
93
99
  import { UploadFilled } from '@element-plus/icons-vue'
94
100
  import { computed, onMounted, ref, watch } from 'vue'
95
- import { ElMessage, ElMessageBox, type UploadFile, type UploadFiles, type UploadUserFile } from 'element-plus'
101
+ import {
102
+ ElMessage,
103
+ ElMessageBox,
104
+ type UploadFile,
105
+ type UploadFiles,
106
+ type UploadUserFile,
107
+ } from 'element-plus'
96
108
  import type { ISysUploadFiles } from '../../interface/ISysUploadFiles'
97
109
  //@ts-ignore
98
110
  import useFileView from '../../hooks/useFileView.ts'
@@ -102,7 +114,7 @@ import { userInfoStore } from '../../stores/userInfoStore'
102
114
 
103
115
  const { fileView: fileView } = useFileView()
104
116
  const uploadHeaders = ref({
105
- Authorization: ''
117
+ Authorization: '',
106
118
  })
107
119
  const userInfo = userInfoStore()
108
120
  const ref_upload = ref()
@@ -114,7 +126,7 @@ const props = defineProps({
114
126
  */
115
127
  limit: {
116
128
  type: Number,
117
- default: 1
129
+ default: 1,
118
130
  },
119
131
  /**
120
132
  * @description 纵向排列
@@ -122,7 +134,7 @@ const props = defineProps({
122
134
  */
123
135
  vertical: {
124
136
  type: Boolean,
125
- default: false
137
+ default: false,
126
138
  },
127
139
  /**
128
140
  * @description 上传文件类型
@@ -131,7 +143,7 @@ const props = defineProps({
131
143
  */
132
144
  accept: {
133
145
  type: String,
134
- default: ''
146
+ default: '',
135
147
  },
136
148
  /**
137
149
  * @description 业务类型
@@ -139,7 +151,7 @@ const props = defineProps({
139
151
  */
140
152
  business: {
141
153
  type: String,
142
- default: 'default'
154
+ default: 'default',
143
155
  },
144
156
  /**
145
157
  * @description 业务id
@@ -147,14 +159,14 @@ const props = defineProps({
147
159
  */
148
160
  businessId: {
149
161
  type: String,
150
- default: 'default'
162
+ default: 'default',
151
163
  },
152
164
  /**
153
165
  * 文件列表
154
166
  */
155
167
  uploadFilesList: {
156
168
  type: Array<ISysUploadFiles>,
157
- default: () => []
169
+ default: () => [],
158
170
  },
159
171
  /**
160
172
  * @description 是否编辑状态
@@ -163,7 +175,7 @@ const props = defineProps({
163
175
  */
164
176
  isEdlt: {
165
177
  type: Boolean,
166
- default: true
178
+ default: true,
167
179
  },
168
180
  /**
169
181
  * @description 文档上传是否默认关联,默认不关联
@@ -172,17 +184,21 @@ const props = defineProps({
172
184
  */
173
185
  association: {
174
186
  type: Boolean,
175
- default: false
187
+ default: false,
176
188
  },
177
189
  size: {
178
190
  type: Number,
179
- default: 50
191
+ default: 50,
180
192
  },
181
193
  //附件宽度
182
194
  itemWidth: {
183
195
  type: String,
184
- default: '100%'
185
- }
196
+ default: '100%',
197
+ },
198
+ watermarkCode: {
199
+ type: String,
200
+ default: () => undefined,
201
+ },
186
202
  })
187
203
  const mousemove = (fileName: string) => {
188
204
  hoverfileName.value = fileName
@@ -251,7 +267,7 @@ watch(
251
267
  loading.value = false
252
268
  }
253
269
  },
254
- { deep: true }
270
+ { deep: true },
255
271
  )
256
272
  const beforeUpload = (file: File) => {
257
273
  const f = props.uploadFilesList.find((c) => c.name === file.name)
@@ -262,9 +278,7 @@ const beforeUpload = (file: File) => {
262
278
  ElMessage.warning('文件大小不能超过' + props.size + 'MB')
263
279
  return false
264
280
  }
265
- const acceptSuffixes = getAccept.value
266
- ?.split(',')
267
- .map(suffix => suffix.slice(1).toLowerCase())
281
+ const acceptSuffixes = getAccept.value?.split(',').map((suffix) => suffix.slice(1).toLowerCase())
268
282
  const fileSuffix = file.name.split('.').pop()?.toLowerCase()
269
283
  if (acceptSuffixes && !acceptSuffixes.includes(fileSuffix ?? '')) {
270
284
  ElMessage.error(`文件 ${file.name} 格式不支持,仅允许 ${getAccept.value}!`)
@@ -285,7 +299,7 @@ const fileClick = async (file: UploadFile & ISysUploadFiles) => {
285
299
  const flag = await ElMessageBox.confirm('删除不可恢复!您确定删除此附件?', '提示', {
286
300
  confirmButtonText: '确定',
287
301
  cancelButtonText: '取消',
288
- type: 'warning'
302
+ type: 'warning',
289
303
  })
290
304
  if (!flag) {
291
305
  return
@@ -332,7 +346,7 @@ onMounted(() => {
332
346
  uploadHeaders.value.Authorization = sessionStorage.getItem('Authorization') + ''
333
347
  })
334
348
  defineExpose({
335
- remove
349
+ remove,
336
350
  })
337
351
  </script>
338
352
  <style scoped lang="scss">