n20-common-lib 2.11.22 → 2.11.23

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": "n20-common-lib",
3
- "version": "2.11.22",
3
+ "version": "2.11.23",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -92,6 +92,7 @@ export default {
92
92
  }
93
93
  }
94
94
  return {
95
+ name: '',
95
96
  // 附件预览
96
97
  imgType: /\.jpg|\.png|\.gif|\.jpeg|\.svg$/i,
97
98
  seeTypes: /\.(jpg|png|gif|svg|pdf|swf|xlsx|xls|docx|doc)$/i,
@@ -114,7 +115,8 @@ export default {
114
115
  },
115
116
 
116
117
  methods: {
117
- async fileShow(id) {
118
+ async fileShow(id, fileName = '') {
119
+ this.name = fileName
118
120
  const { url, name, sameOrg } = await this.getFileInfo(id)
119
121
  if (url) {
120
122
  this.previewSameOrg = sameOrg
@@ -133,7 +135,7 @@ export default {
133
135
  )
134
136
  const blob = response
135
137
  // 下载文件名
136
- const name = blob.name
138
+ const name = this.name || blob.name
137
139
  let url = ''
138
140
  if (this.imgType.test(name)) {
139
141
  url = URL.createObjectURL(blob)