doctor-admin-components 1.0.14-beta.11 → 1.0.14-beta.13

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,7 +1,7 @@
1
1
  {
2
2
  "name": "doctor-admin-components",
3
3
  "version1": "1.0.11",
4
- "version": "1.0.14-beta.11",
4
+ "version": "1.0.14-beta.13",
5
5
  "private": false,
6
6
  "main1": "lib/index.umd.min.js",
7
7
  "main": "packages/index.js",
@@ -32,18 +32,35 @@ export function batchAsZip(fileList, zipName) {
32
32
  background: "rgba(0, 0, 0, 0.7)",
33
33
  });
34
34
  const zip = new JSZip();
35
- const promises = [];
36
- const cache = {};
35
+ // const promises = [];
36
+ // const cache = {};
37
37
  console.log(fileList);
38
- fileList.forEach((item) => {
39
- const promise = getFile(item.url).then((data) => {
40
- // 下载文件, 并存成ArrayBuffer对象
41
- // const file_name = item.realName // 获取文件名
42
- zip.file(item.fileName, data, { binary: true });
43
- cache[item.fileName] = data;
44
- });
45
- promises.push(promise);
46
- });
38
+ const usedFileNames = {} // 用于跟踪已使用的文件名
39
+ // fileList.forEach((item) => {
40
+ // const promise = getFile(item.url).then((data) => {
41
+ // // 下载文件, 并存成ArrayBuffer对象
42
+ // // const file_name = item.realName // 获取文件名
43
+ // zip.file(item.fileName, data, { binary: true });
44
+ // cache[item.fileName] = data;
45
+ // });
46
+ // promises.push(promise);
47
+ // });
48
+ const promises = fileList.map((item) => {
49
+ return getFile(item.url).then((data) => {
50
+ let fileName = item.fileName
51
+ let count = 1
52
+
53
+ // 如果文件名已存在,则添加递增的数字后缀
54
+ while (usedFileNames[fileName]) {
55
+ fileName = `${count}_${item.fileName}`
56
+ count++
57
+ }
58
+
59
+ usedFileNames[fileName] = true
60
+
61
+ zip.file(fileName, data, { binary: true })
62
+ })
63
+ })
47
64
  Promise.all(promises)
48
65
  .then(() => {
49
66
  zip.generateAsync({ type: "blob" }).then((f) => {
@@ -57,6 +74,7 @@ export function batchAsZip(fileList, zipName) {
57
74
  })
58
75
  .catch((res) => {
59
76
  Message.error("下载文件出现错误,请联系管理员!");
77
+ console.log(res)
60
78
  downloadLoadingInstance.close();
61
79
  });
62
80
  }
@@ -1591,6 +1591,7 @@ export default {
1591
1591
  const ids = this.selectFileList.map((item) => item.fileId)
1592
1592
  delBizFileInfo(ids).then(() => {
1593
1593
  this.$message.success('删除成功')
1594
+ this.selectFileList = []
1594
1595
  this.handleRefresh()
1595
1596
  })
1596
1597
  })
@@ -12,14 +12,14 @@
12
12
  <div class="app-container-left">
13
13
  <div class="contract-number">
14
14
  <div>{{ $t('contractDetail.Contract_No') }}</div>
15
- <div>{{ contract.contractNo }}</div>
15
+ <div style="word-wrap: break-word;">{{ contract.contractNo }}</div>
16
16
  </div>
17
17
  <div class="contract-number">
18
18
  <div>
19
19
  <span>{{$t('contractDetail.Reference_No')}}</span>
20
20
  <el-button size="mini" type="text" icon="el-icon-edit" @click="clickEditReference"></el-button>
21
21
  </div>
22
- <div>{{ contract.reference || '--' }}</div>
22
+ <div style="word-wrap: break-word;">{{ contract.reference || '--' }}</div>
23
23
  </div>
24
24
  <div class="tab-root">
25
25
  <div :class="['tab', activeName == tabsItem.name ? 'active' : '']" v-for="tabsItem in saleTabsArr" :key="tabsItem.id" @click="changeTabs(tabsItem)">