65 lines
2.3 KiB
Vue
65 lines
2.3 KiB
Vue
<template>
|
|
<a-card :bordered="false">
|
|
<div class="onlyoffice-box">
|
|
<a-button icon="plus" type="primary" @click="fileClick">
|
|
打开onlyoffice
|
|
</a-button>
|
|
</div>
|
|
</a-card>
|
|
</template>
|
|
|
|
<script>
|
|
import { postAction, getAction } from '../../api/manage'
|
|
import { ACCESS_TOKEN, OAUTH2_LOGIN_PAGE_PATH } from '@/store/mutation-types'
|
|
import Vue from 'vue'
|
|
|
|
export default {
|
|
name: 'index',
|
|
data () {
|
|
return {}
|
|
},
|
|
methods: {
|
|
fileClick () {
|
|
getAction('/onlyOffice/saveEditFile', { model: 'model_qb' }).then((res) => {
|
|
if (res.success) {
|
|
getAction('/onlyOffice/processEditFile', { id: res.result.id }).then((val) => {
|
|
if (val.id) {
|
|
const oldFileName = '比亚迪企业标准'
|
|
const nowTime = new Date().getTime()
|
|
const standCode = 'G/BYD xxxx-xxxx'
|
|
const standName = '比亚迪企业标准'
|
|
const draftingDepartment = '起草部门'
|
|
const draftsman = '起草人'
|
|
const assessor = '评审人员'
|
|
const focalUnit = '归口单位'
|
|
const watermark = '比亚迪'
|
|
const replaceStand = ''
|
|
const Authorization = 'token'
|
|
const appId = 'appId'
|
|
// http://39.98.140.126:8999
|
|
// http://127.0.0.1:8080
|
|
window.open(window.CONFIG.onlyOfficeRoute + '/editor?fileId=' + val.id + '&pid=' + val.pid +
|
|
'&taskIds=' + val.taskId + '&oldFileName=' + oldFileName + '&assessor=' + assessor +
|
|
'&fileType=docx' + '&attId=' + val.id + '&fileUrl=' + val.downLoadUrl +
|
|
'&key=' + nowTime + '&filePath=' + val.editFilePath + '&fileName=' + val.fileName +
|
|
'&userId=' + val.userId + '&userName=admin' + '&standCode=' + standCode +
|
|
'&standName=' + standName + '&replaceStand=' + replaceStand + '&draftsman=' + draftsman +
|
|
'&draftingDepartment=' + draftingDepartment + '&focalUnit=' + focalUnit + '&watermark=' + watermark +
|
|
'&Authorization=' + Authorization + '&appId=' + appId)
|
|
}
|
|
})
|
|
} else {
|
|
this.$message.warning('获取文件失败')
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.onlyoffice-box {
|
|
width: 100%;
|
|
}
|
|
</style>
|