commit
This commit is contained in:
@@ -22,25 +22,29 @@ const flowMixins = {
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
|
||||
console.log(this.$refs)
|
||||
console.log(this.$refs.guava)
|
||||
|
||||
// this.oepnAudit({})
|
||||
//
|
||||
//
|
||||
// this.$axios.post(location.pathname + '/queryTask', {taskId}).then(res => {
|
||||
// if (res.code === 0) {
|
||||
// // 延迟1.5秒 显示loading动画 解决Guava异步加载 获取不到实例的问题
|
||||
// setTimeout(() => {
|
||||
// if (res.data.taskState === 10) {
|
||||
// this.openAudit(res.data);
|
||||
// } else {
|
||||
// this.openView(res.data);
|
||||
// }
|
||||
// loading.close();
|
||||
// }, 1500)
|
||||
// }
|
||||
// })
|
||||
let delayCloseLoading = false
|
||||
this.$axios.post(location.pathname + "/queryTask", {taskId}).then((res) => {
|
||||
if (res.code === 0 && res.data) {
|
||||
delayCloseLoading = true
|
||||
// Guava 为异步组件,等待组件实例完成挂载后再打开任务弹窗。
|
||||
setTimeout(() => {
|
||||
try {
|
||||
if (res.data.taskState === 10) {
|
||||
this.openAudit(res.data)
|
||||
} else {
|
||||
this.openView(res.data)
|
||||
}
|
||||
} finally {
|
||||
loading.close()
|
||||
}
|
||||
}, 1500)
|
||||
}
|
||||
}).finally(() => {
|
||||
// 查询失败或未返回任务数据时,必须关闭全屏 Loading。
|
||||
if (!delayCloseLoading) {
|
||||
loading.close()
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,11 +71,13 @@ const initTableMixins = {
|
||||
const address = this.pageDataUrl ? this.pageDataUrl : loc() + "/pageData"
|
||||
this.tableLoading = true
|
||||
this.$axios.post(address, data ? data : this.pageForm).then((res) => {
|
||||
this.tableLoading = false
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
}
|
||||
}).finally(() => {
|
||||
// 接口异常时同样结束加载状态,避免表格持续显示加载动画。
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
notifySuccess(msg) {
|
||||
|
||||
@@ -35,8 +35,9 @@
|
||||
:accept="fileAccept"
|
||||
:multiple="true"
|
||||
list-type="picture-card"
|
||||
:class="{ 'image-upload-entry-hidden': !showImageUploadEntry }"
|
||||
>
|
||||
<i class="el-icon-plus"></i>
|
||||
<i v-if="showImageUploadEntry" class="el-icon-plus"></i>
|
||||
<!-- <div class="el-upload__tip" v-if="fileList.length < upload_number">-->
|
||||
<!-- <div style="margin-top: 8px">{{ upload_text }}</div>-->
|
||||
<!-- </div>-->
|
||||
@@ -208,6 +209,10 @@ module.exports = {
|
||||
const number = Number(this.upload_number)
|
||||
return Number.isFinite(number) && number > 0 ? number : 1
|
||||
},
|
||||
// 单图上传完成后隐藏上传入口;删除图片后 fileList 清空,入口会自动恢复。
|
||||
showImageUploadEntry() {
|
||||
return this.uploadLimitNumber !== 1 || this.fileList.length < this.uploadLimitNumber
|
||||
},
|
||||
upload_tips() {
|
||||
const uploadNumber = this.uploadLimitNumber
|
||||
const fileAccept = this.fileAccept
|
||||
@@ -655,4 +660,10 @@ module.exports = {
|
||||
height: var(--upload-height, 148px);
|
||||
}
|
||||
|
||||
/* 单图已上传时只隐藏图片卡片上传入口,保留图片预览列表与删除按钮。 */
|
||||
.image-upload-entry-hidden.el-upload--picture-card,
|
||||
.image-upload-entry-hidden .el-upload--picture-card {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user