n20-common-lib 3.2.56 → 3.2.57

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": "3.2.56",
3
+ "version": "3.2.57",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -298,7 +298,7 @@
298
298
  :multiple="true"
299
299
  :show-file-list="true"
300
300
  :action="apiPrefix ? apiPrefix + action : action"
301
- :data="_batchFileData || fileData"
301
+ :data="batchFileData || fileData"
302
302
  :headers="headers"
303
303
  :accept="fileAccept"
304
304
  :size="fileSize"
@@ -516,7 +516,7 @@ export default {
516
516
  officeStatus: false,
517
517
  batchUploading: false,
518
518
  // 批量上传使用的文件数据(避免直接修改计算属性)
519
- _batchFileData: null,
519
+ batchFileData: null,
520
520
  sortable: null
521
521
  }
522
522
  },
@@ -604,10 +604,11 @@ export default {
604
604
  return
605
605
  }
606
606
  this.tableData.splice(newIndex, 0, targetRow)
607
- this.$emit('sort', this.tableData.slice())
607
+ // 先调用保存排序接口,确保即使 $emit 抛出异常也能执行
608
608
  this.saveFileSort().catch(() => {
609
609
  this.$message.error($lc('附件排序保存失败'))
610
610
  })
611
+ this.$emit('sort', this.tableData.slice())
611
612
  }
612
613
  })
613
614
  })
@@ -630,9 +631,12 @@ export default {
630
631
  return
631
632
  }
632
633
 
634
+ // 排序请求每次数据不同,跳过 axios 请求去重和 loading,
635
+ // 避免短时间内第二次拖拽排序被错误合并到第一次请求
633
636
  await axios.post(
634
637
  this.apiPrefix ? `${this.apiPrefix}/neams/eamsbaserecord/fileSort` : '/neams/eamsbaserecord/fileSort',
635
- sortList
638
+ sortList,
639
+ { loading: false }
636
640
  )
637
641
  },
638
642
  // ai校验取消
@@ -779,7 +783,7 @@ export default {
779
783
  if (code === 200) {
780
784
  let aDom = document.createElement('a')
781
785
  aDom.href = data
782
- aDom.download = $lc('批量附件.pdf')
786
+ aDom.download = $lc('批量附件.pdf')
783
787
  aDom.click()
784
788
 
785
789
  this.$nextTick(() => {
@@ -797,7 +801,7 @@ export default {
797
801
  let fileData = this.fileData || {}
798
802
  let dto = JSON.parse(fileData.data || '{}')
799
803
  dto[this.keys.type] = this.bathType
800
- this._batchFileData = {
804
+ this.batchFileData = {
801
805
  ...fileData,
802
806
  data: JSON.stringify(dto)
803
807
  }