60 lines
2.0 KiB
Vue
60 lines
2.0 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'
|
|
|
|
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 serialNumber = 'x/xx xxxx-xxxx'
|
|
const standName = '比亚迪企业标准'
|
|
const estDepart = '起草部门'
|
|
const drafts = '起草人'
|
|
const assessor = '评审人员'
|
|
const focalUnit = '归口单位'
|
|
const watermark = '比亚迪'
|
|
const replaceStand = ''
|
|
// 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=' + val.id + nowTime + '&filePath=' + val.editFilePath + '&fileName=' + val.fileName +
|
|
'&userId=' + val.userId + '&userName=admin' + '&serialNumber=' + serialNumber +
|
|
'&standName=' + standName + '&replaceStand=' + replaceStand + '&drafts=' + drafts +
|
|
'&estDepart=' + estDepart + '&focalUnit=' + focalUnit + '&watermark=' + watermark)
|
|
}
|
|
})
|
|
} else {
|
|
this.$message.warning('获取文件失败')
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.onlyoffice-box {
|
|
width: 100%;
|
|
}
|
|
</style>
|