Commit bc26a93f by 乔延琦

Merge branch 'develop-zhouyi' into 'develop'

fix(invoice): 查看影像卡顿等问题

See merge request GFP/RBC/rbc-frontend!145
parents 45dfd243 27f23075
...@@ -10,10 +10,17 @@ export default { ...@@ -10,10 +10,17 @@ export default {
const tableObj = targetSubTable[i] const tableObj = targetSubTable[i]
const invoiceId = tableObj.getValue('imageId') const invoiceId = tableObj.getValue('imageId')
if (invoiceId == imageId) { if (invoiceId == imageId) {
curbill.deleteSubData(param.param.targetTableName, i, true) curbill.deleteSubData(param.param.targetTableName, i, false, tableObj.getData())
} }
} }
} }
curbill.deleteSubData(param.param.tableName, curbill.getSubFocus(), true)
for (let i = imageTable.length - 1; i >= 0; --i) {
const tableObj = imageTable[i]
const id = tableObj.getValue('imageId')
if (id == imageId) {
curbill.deleteSubData(param.param.tableName, i, true)
}
}
} }
} }
\ No newline at end of file
...@@ -55,7 +55,9 @@ export default { ...@@ -55,7 +55,9 @@ export default {
} }
this.bill.refreshSubDataRow(subBillName) this.bill.refreshSubDataRow(subBillName)
}) })
this.componentName && GMS.$hideContainer.remove(this.componentName) setTimeout(() => {
this.componentName && GMS.$hideContainer.remove(this.componentName)
}, 500);
}) })
} }
......
...@@ -1817,6 +1817,7 @@ export default { ...@@ -1817,6 +1817,7 @@ export default {
"description": "", "description": "",
"title": "财务_影像电子凭证[CW_imageView]", "title": "财务_影像电子凭证[CW_imageView]",
"value": "CW_imageView", "value": "CW_imageView",
"alwaysUse":true
}, },
{ {
"discard": false, "discard": false,
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
:currentIndex="currentImgIndex" :currentIndex="currentImgIndex"
/> />
</div> </div>
<div class="right"> <div class="right" v-if="imgList && imgList.length">
<div class="tool-bar"> <div class="tool-bar">
<div class="info"> <div class="info">
<span class="number">{{currentImgIndex + 1}}</span>张,共<span class="number">{{imgList.length}}</span> <span class="number">{{currentImgIndex + 1}}</span>张,共<span class="number">{{imgList.length}}</span>
...@@ -50,7 +50,6 @@ export default { ...@@ -50,7 +50,6 @@ export default {
yearFlag: null, yearFlag: null,
yearFlags: [], yearFlags: [],
currentImgIndex: 0, currentImgIndex: 0,
imgUrlSet: new Set(),
imageTableName: null, imageTableName: null,
componentName: null, componentName: null,
}; };
...@@ -58,20 +57,20 @@ export default { ...@@ -58,20 +57,20 @@ export default {
watch: { watch: {
modalVisible(visible) { modalVisible(visible) {
if (!visible) { if (!visible) {
for (let o of this.imgUrlSet) { for (let o of this.imgList) {
window.URL.revokeObjectURL(o) window.URL.revokeObjectURL(o.imgUrl)
} }
this.imgUrlSet = new Set()
this.bill = null this.bill = null
this.imageId = null this.imageId = null
this.yearFlags = [] this.yearFlags = []
this.componentName && window.GMS.$hideContainer.remove(this.componentName) setTimeout(() => {
this.componentName && window.GMS.$hideContainer.remove(this.componentName)
}, 500);
} }
}, },
imageId(id) { imageId(id) {
if (!id) return if (!id) return
getImgUrl(id, this.yearFlag).then(({ url, fileName }) => { getImgUrl(id, this.yearFlag).then(({ url, fileName }) => {
this.imgUrlSet.add(url)
this.imgList = [{ this.imgList = [{
imgUrl: url, imgUrl: url,
id, id,
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</svg> </svg>
</div> </div>
<div class="viewer-container"> <div class="viewer-container">
<img style="display: none" id="invoice-viewerjs-imgsource" :src="img.imgUrl" :alt="img.fileName"> <img style="display: none" ref="imgEle" id="invoice-viewerjs-imgsource" :src="img.imgUrl" :alt="img.fileName">
</div> </div>
</div> </div>
</template> </template>
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
console.log('viewer already destroyed?') console.log('viewer already destroyed?')
} }
this.viewer = null this.viewer = null
const ele = document.getElementById('invoice-viewerjs-imgsource') const ele = this.$refs.imgEle
const parentEle = ele.parentElement const parentEle = ele.parentElement
const childList = Array.from(parentEle.children) const childList = Array.from(parentEle.children)
childList.forEach((node) => { childList.forEach((node) => {
...@@ -103,7 +103,7 @@ export default { ...@@ -103,7 +103,7 @@ export default {
}, },
methods: { methods: {
createViewer() { createViewer() {
this.viewer = new Viewer(document.getElementById('invoice-viewerjs-imgsource'), { this.viewer = new Viewer(this.$refs.imgEle, {
inline: true, inline: true,
toolbar: 0, toolbar: 0,
title: false, title: false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment