修改文档详情的右上角按钮

This commit is contained in:
范强强
2022-09-09 11:15:00 +08:00
parent a8d2ea549f
commit e542b9bd1d
6 changed files with 83 additions and 19 deletions
+5 -1
View File
@@ -134,11 +134,15 @@
this.getData() this.getData()
this.getTableList() this.getTableList()
}) })
if (this.$route.query.serial_number) {
this.searchParmes.serialNumber = this.$route.query.serial_number
this.searchParmes = { ...this.searchParmes }
}
this.getData() this.getData()
this.getTableList() this.getTableList()
this.userData = this.userInfo() this.userData = this.userInfo()
}, },
beforeDestroy(){ beforeDestroy() {
eventBUs.$off('searchQuery') eventBUs.$off('searchQuery')
eventBUs.$off('searchReset') eventBUs.$off('searchReset')
eventBUs.$off('searchGetData') eventBUs.$off('searchGetData')
@@ -21,20 +21,23 @@
<a-icon type="reload"/> <a-icon type="reload"/>
{{$t('UpdateLog')}} {{$t('UpdateLog')}}
</div> </div>
<div @click="DocumentSplitting" v-has="'bussLog:page'" class="operator-text-text" <div @click="DocumentSplitting" v-has="'bussLog:splitting'" class="operator-text-text"
:title="$t('DocumentSplitting')"> :title="$t('DocumentSplitting')">
<a-icon type="codepen"/> <a-icon type="codepen"/>
{{$t('DocumentSplitting')}} {{$t('DocumentSplitting')}}
</div> </div>
<div @click="UpdateLog" v-has="'bussLog:page'" class="operator-text-text" :title="$t('DocumentTranslation')"> <div @click="DocumentTranslationClick" v-has="'bussLog:translation'" class="operator-text-text"
:title="$t('DocumentTranslation')">
<a-icon type="file-pdf"/> <a-icon type="file-pdf"/>
{{$t('DocumentTranslation')}} {{$t('DocumentTranslation')}}
</div> </div>
<div @click="UpdateLog" v-has="'bussLog:page'" class="operator-text-text" :title="$t('DocumentComparison')"> <div @click="DocumentComparisonClick" v-has="'bussLog:comparison'" class="operator-text-text"
:title="$t('DocumentComparison')">
<a-icon type="wallet"/> <a-icon type="wallet"/>
{{$t('DocumentComparison')}} {{$t('DocumentComparison')}}
</div> </div>
<div @click="UpdateLog" v-has="'bussLog:page'" class="operator-text-text" :title="$t('KnowledgeDatabase')"> <div @click="KnowledgeDatabaseClick" v-has="'bussLog:database'" class="operator-text-text"
:title="$t('KnowledgeDatabase')">
<a-icon type="folder"/> <a-icon type="folder"/>
{{$t('KnowledgeDatabase')}} {{$t('KnowledgeDatabase')}}
</div> </div>
@@ -357,6 +360,46 @@
}, },
methods: { methods: {
...mapGetters(['userInfo']), ...mapGetters(['userInfo']),
DocumentTranslationClick() {
let serial_number = ''
if (this.detailList.length > 0) {
this.detailList[0][this.$t('essentialInformation')].forEach(res => {
if (res.db_field_name == 'serial_number') {
serial_number = res.value
}
})
}
let newUrl = this.$router.resolve({
path: '/documentTranslation',
query: {
serial_number: serial_number
}
})
window.open(newUrl.href, '_blank')
},
DocumentComparisonClick() {
let serial_number = ''
if (this.detailList.length > 0) {
this.detailList[0][this.$t('essentialInformation')].forEach(res => {
if (res.db_field_name == 'serial_number') {
serial_number = res.value
}
})
}
let newUrl = this.$router.resolve({
path: '/documentComparison',
query: {
serial_number: serial_number
}
})
window.open(newUrl.href, '_blank')
},
KnowledgeDatabaseClick() {
let newUrl = this.$router.resolve({
path: '/problemknowledgeBase',
})
window.open(newUrl.href, '_blank')
},
getTitle(callback) { getTitle(callback) {
let _id = this.$route.query.documentId === undefined ? this.$route.query.id : this.$route.query.documentId let _id = this.$route.query.documentId === undefined ? this.$route.query.id : this.$route.query.documentId
getAction(this.url.getTitle, { id: _id }).then((res) => { getAction(this.url.getTitle, { id: _id }).then((res) => {
@@ -459,10 +502,18 @@
this.bussLogList() this.bussLogList()
}, },
DocumentSplitting() { DocumentSplitting() {
let serial_number = ''
if (this.detailList.length > 0) {
this.detailList[0][this.$t('essentialInformation')].forEach(res => {
if (res.db_field_name == 'serial_number') {
serial_number = res.value
}
})
}
let newUrl = this.$router.resolve({ let newUrl = this.$router.resolve({
path: '/docManage/splite', path: '/docManage/splite',
query: { query: {
serial_number: this.$route.query.serial_number serial_number: serial_number
} }
}) })
window.open(newUrl.href, '_blank') window.open(newUrl.href, '_blank')
@@ -539,7 +590,7 @@
} }
.doc-detail-right { .doc-detail-right {
width: 800px; /*width: 800px;*/
line-height: 68px; line-height: 68px;
display: flex; display: flex;
@@ -642,7 +693,7 @@
font-weight: 400; font-weight: 400;
color: #040B29; color: #040B29;
display: inline-block; display: inline-block;
width: 20%; width: 100px;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
@@ -137,7 +137,7 @@
}, },
mounted() { mounted() {
if (this.$route.query.serial_number !== undefined) { if (this.$route.query.serial_number) {
this.serialnumber = this.$route.query.serial_number this.serialnumber = this.$route.query.serial_number
} }
}, },
@@ -220,6 +220,10 @@
} }
}, },
mounted() { mounted() {
if (this.$route.query.serial_number) {
this.queryParam.serialNumber = this.$route.query.serial_number
this.queryParam = { ...this.queryParam }
}
this.userInfoQuery = this.userInfo() this.userInfoQuery = this.userInfo()
this.getList() this.getList()
}, },
@@ -85,16 +85,16 @@
this.loadingRight = true this.loadingRight = true
// this.readExcelFromRemoteFileLeft(this.downLoadFileUrl + '/' + this.fileQuery.sourceFileId + fileSuffix) // this.readExcelFromRemoteFileLeft(this.downLoadFileUrl + '/' + this.fileQuery.sourceFileId + fileSuffix)
// this.readExcelFromRemoteFileRight(this.downLoadFileUrl + '/' + this.fileQuery.targetFileId + fileSuffix) // this.readExcelFromRemoteFileRight(this.downLoadFileUrl + '/' + this.fileQuery.targetFileId + fileSuffix)
let href = location.href.slice(0, 5) // let href = location.href.slice(0, 5)
if (href.indexOf('s') == '-1') { // if (href.indexOf('s') == '-1') {
this.detailUrlLeft = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + this.fileQuery.sourceFileId + fileSuffix) this.detailUrlLeft = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + this.fileQuery.sourceFileId + fileSuffix)
this.detailUrlRight = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + this.fileQuery.targetFileId + fileSuffix) this.detailUrlRight = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + this.fileQuery.targetFileId + fileSuffix)
console.log(this.detailUrlLeft) // console.log(this.detailUrlLeft)
} else { // } else {
this.detailUrlLeft = window._CONFIG['httpsOnlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + this.fileQuery.sourceFileId + fileSuffix) // this.detailUrlLeft = window._CONFIG['httpsOnlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + this.fileQuery.sourceFileId + fileSuffix)
this.detailUrlRight = window._CONFIG['httpsOnlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + this.fileQuery.targetFileId + fileSuffix) // this.detailUrlRight = window._CONFIG['httpsOnlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + this.fileQuery.targetFileId + fileSuffix)
console.log(this.detailUrlLeft) // console.log(this.detailUrlLeft)
} // }
}, },
readExcelFromRemoteFileLeft: function(url) { readExcelFromRemoteFileLeft: function(url) {
var vm = this var vm = this
@@ -227,6 +227,10 @@
} }
}, },
mounted() { mounted() {
if (this.$route.query.serial_number) {
this.queryParam.serialNumber = this.$route.query.serial_number
this.queryParam = { ...this.queryParam }
}
this.getList() this.getList()
this.userInfoQuery = this.userInfo() this.userInfoQuery = this.userInfo()
}, },
@@ -455,12 +459,13 @@
margin-right: 4px; margin-right: 4px;
display: inline-block; display: inline-block;
} }
::v-deep .ant-table-row:first-child { ::v-deep .ant-table-row:first-child {
background: #fff!important; background: #fff !important;
opacity: 0.9; opacity: 0.9;
} }
::v-deep .ant-table-body { ::v-deep .ant-table-body {
background: transparent!important; background: transparent !important;
} }
</style> </style>