[update] 打包管理接口联调;工作组项目文件预览

This commit is contained in:
zhaoxiao
2021-09-13 16:53:38 +08:00
parent 33012457c3
commit 844787e991
6 changed files with 196 additions and 69 deletions
@@ -13,9 +13,8 @@
:key="index">
<div class="work-group-detail-item-title">{{ item.title }}</div>
<div class="work-group-detail-item-content work-group-detail-item-filename"
v-if="(item.fieldName === 'chargeNoticeA' || item.fieldName === 'chargeNoticeB') && workingGroupDetail[item.fieldName]"
@click="previewFile(workingGroupDetail[item.fieldName])">
{{ workingGroupDetail[item.fieldName].fileName }}
v-if="(item.fieldName === 'chargeNoticeAId' || item.fieldName === 'chargeNoticeBId') && workingGroupDetail[item.fieldName]">
<preview-file :file-id="workingGroupDetail[item.fieldName]"></preview-file>
</div>
<div class="work-group-detail-item-content" v-else>{{ workingGroupDetail[item.fieldName] }}</div>
</div>
@@ -139,6 +138,7 @@ import WorkingGroupMemberSetChargeNotice from './modules/WorkingGroupMemberSetCh
import { getFileInfo } from '../../api/api'
import Vue from 'vue'
import { ACCESS_TOKEN } from '../../store/mutation-types'
import PreviewFile from '../../components/jero/PreviewFile'
const Base64 = require('js-base64').Base64
export default {
@@ -149,7 +149,8 @@ export default {
StatusSlot,
ProjectDetailModal,
WorkingGroupMemberUnitModule,
WorkingGroupMemberSetChargeNotice
WorkingGroupMemberSetChargeNotice,
PreviewFile
},
mixins: [JeroListMixin],
computed: {
@@ -187,7 +188,7 @@ export default {
fieldName: 'chargeNoticeNoA'
}, {
title: '收费通知A',
fieldName: 'chargeNoticeA'
fieldName: 'chargeNoticeAId'
}, {
title: '本年应收款B',
fieldName: 'yearChargeB'
@@ -196,7 +197,7 @@ export default {
fieldName: 'chargeNoticeNoB'
}, {
title: '收费通知B',
fieldName: 'chargeNoticeB'
fieldName: 'chargeNoticeBId'
}
],
labelCol: {
@@ -309,23 +310,11 @@ export default {
}
getWorkingGroupById(param).then(res => {
this.workingGroupDetail = res.result
// this.workingGroupDetail.chargeNoticeA = {}
// this.workingGroupDetail.chargeNoticeB = {}
this.getFile()
}).finally(() => {
this.spinning = false
})
},
async getFile() {
await getFileInfo({ id: this.workingGroupDetail.chargeNoticeAId }).then(res => {
this.workingGroupDetail.chargeNoticeA = res.result
this.$forceUpdate()
})
await getFileInfo({ id: this.workingGroupDetail.chargeNoticeBId }).then(res => {
this.workingGroupDetail.chargeNoticeB = res.result
this.$forceUpdate()
})
},
handleAdd: function () {
this.getChargeNoticeList()
this.$refs.modalForm.workingGroupId = this.workingGroupProjectId
@@ -342,9 +331,13 @@ export default {
this.$refs.modalForm.title = '编辑'
this.$refs.modalForm.disableSubmit = false
},
/**
* 获取收费通知列表
*/
getChargeNoticeList() {
this.chargeNoticeList = []
let chargeNoticeA, chargeNoticeB
// 是否存在收费通知A
if (this.workingGroupDetail.chargeNoticeNoA && this.workingGroupDetail.chargeNoticeNoA !== '') {
chargeNoticeA = {
type: 'chargeNoticeA',
@@ -353,7 +346,9 @@ export default {
yearCharge: this.workingGroupDetail.yearChargeA,
chargeNoticeId: this.workingGroupDetail.chargeNoticeAId
}
this.chargeNoticeList.push(chargeNoticeA)
}
// 是否存在收费通知B
if (this.workingGroupDetail.chargeNoticeNoB && this.workingGroupDetail.chargeNoticeNoB !== '') {
chargeNoticeB = {
type: 'chargeNoticeB',
@@ -362,11 +357,6 @@ export default {
yearCharge: this.workingGroupDetail.yearChargeB,
chargeNoticeId: this.workingGroupDetail.chargeNoticeBId
}
}
if (chargeNoticeA && chargeNoticeA.hasOwnProperty.call(chargeNoticeA, 'value')) {
this.chargeNoticeList.push(chargeNoticeA)
}
if (chargeNoticeB && chargeNoticeB.hasOwnProperty.call(chargeNoticeA, 'value')) {
this.chargeNoticeList.push(chargeNoticeB)
}
},