n20-common-lib 2.9.26 → 2.9.28

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.9.26",
3
+ "version": "2.9.28",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -63,6 +63,7 @@
63
63
  "strip-json-comments": "*",
64
64
  "v-viewer": "1.6.4",
65
65
  "vue-jsonp": "2.0.0",
66
+ "jsencrypt": "^3.3.2",
66
67
  "vuedraggable": "*",
67
68
  "webpack-duplicate-relano-plugin": "^0.1.0",
68
69
  "xe-utils": "^3.5.11"
@@ -93,7 +94,6 @@
93
94
  "fuse.js": "^6.6.2",
94
95
  "html-webpack-tags-plugin": "^2.0.17",
95
96
  "jest": "^27.0.5",
96
- "jsencrypt": "^3.3.2",
97
97
  "jszip": "^3.10.0",
98
98
  "md2vue-loader": "file:./md2vue-loader",
99
99
  "mockjs": "^1.1.0",
@@ -182,7 +182,7 @@
182
182
  </el-table-column>
183
183
  </el-table>
184
184
 
185
- <!-- <Dialog
185
+ <Dialog
186
186
  v-drag
187
187
  class="p-a-0"
188
188
  :title="'附件预览' | $lc"
@@ -218,8 +218,7 @@
218
218
  </div>
219
219
  </component>
220
220
  </div>
221
- </Dialog> -->
222
- <Preview ref="preview" @preSee="preSee" @nextSee="nextSee" :visible.sync="visibleP"></Preview>
221
+ </Dialog>
223
222
  <Dialog
224
223
  v-drag
225
224
  :title="'附件批量上传' | $lc"
@@ -284,7 +283,6 @@ import axios from '../../utils/axios'
284
283
  import { $lc } from '../../utils/i18n/index'
285
284
  import importG from '../../utils/importGlobal.js'
286
285
  import Dialog from '../Dialog/index.vue'
287
- import Preview from '../Preview/index.vue'
288
286
  import Upload from '../Upload/index.vue'
289
287
 
290
288
  const ViewerImg = async function () {
@@ -310,8 +308,7 @@ export default {
310
308
  components: {
311
309
  Upload,
312
310
  Dialog,
313
- ViewerImg,
314
- Preview
311
+ ViewerImg
315
312
  },
316
313
  filters: {
317
314
  typeFiter(type, typeOptions) {
@@ -627,9 +624,17 @@ export default {
627
624
  }
628
625
  },
629
626
  async seeFile(row) {
630
- this.visibleP = true
631
- // this.seeRow = row
632
- this.$refs.preview.fileShow(row[this.keys.rowKey])
627
+ let { url, name, sameOrg } = await this.getFileInfo(row, 'preview')
628
+ if (url) {
629
+ this.previewSameOrg = sameOrg
630
+ this.previewUrl = url
631
+ this.previewName = name
632
+ this.visibleP = true
633
+
634
+ clearTimeout(this.visiblePvT)
635
+ this.visiblePv = true
636
+ this.seeRow = row
637
+ }
633
638
  },
634
639
  preSee() {
635
640
  let i = this.tableData.findIndex((row) => row === this.seeRow)
@@ -641,6 +646,14 @@ export default {
641
646
  let row = this.tableData[i + 1] || this.tableData[0]
642
647
  this.seeFile(row)
643
648
  },
649
+ closeSee() {
650
+ this.previewUrl && URL.revokeObjectURL(this.previewUrl)
651
+ this.previewUrl = undefined
652
+
653
+ this.visiblePvT = setTimeout(() => {
654
+ this.visiblePv = false
655
+ }, 300)
656
+ },
644
657
  uploadHttpRequestBath(opt) {
645
658
  if (this.uploadHttpRequest) {
646
659
  return this.uploadHttpRequest(opt)