diff --git a/src/api/process.js b/src/api/process.js index 10bc76630..a5ea70a6e 100644 --- a/src/api/process.js +++ b/src/api/process.js @@ -448,6 +448,22 @@ export function processModelHisOne (data) { }) } +export function saveEditFile (data) { + return axios({ + url: '/api/lawss/activiti/saveEditFile', + method: 'get', + params: data + }) +} + +export function processEditFile (data) { + return axios({ + url: '/api/lawss/activiti/processEditFile', + method: 'get', + params: data + }) +} + export function processModelHisOneCount (data) { return axios({ url: '/api/lawss/activiti/processModelHisOneCount', diff --git a/src/common/index.js b/src/common/index.js index 9e702c2e8..54496fe12 100644 --- a/src/common/index.js +++ b/src/common/index.js @@ -6,6 +6,8 @@ import base64 from './base64' import dateFormat from './date' import hasPermission from './hasPermission' import preview from './preview' +import onlineEdit from './onlineEdit' +import onlinePreview from './onlinePreview' // 表单验证 import verify from './verify' @@ -38,7 +40,17 @@ const install = function (Vue) { get () { return preview } - } + }, + $onlinePreview: { + get () { + return onlinePreview + } + }, + $onlineEdit: { + get () { + return onlineEdit + } + }, }) } export default { diff --git a/src/common/onlineEdit/index.js b/src/common/onlineEdit/index.js new file mode 100644 index 000000000..7b1eff3d1 --- /dev/null +++ b/src/common/onlineEdit/index.js @@ -0,0 +1,27 @@ +/** + * 在线编辑 + */ +import { onlyOfficeUrl,kkFileViewUrl } from '@/sysConfig' +import { processEditFile } from 'api/process' +let Base64 = require('js-base64').Base64; +export default (id,nodeName,userId,userName) => { + processEditFile({ + id + }).then(res => { + if(res){ + const editFileInfo = res + const showName = nodeName + const editFilePath = editFileInfo.editFilePath.split("/") + editFileInfo.filePath = editFilePath[0]+'/'+editFilePath[1]+'/' + editFileInfo.fileName = editFilePath[2] + editFileInfo.userId = userId + editFileInfo.userName = userName + if(editFileInfo.pid){ + editFileInfo.pId = editFileInfo.pid + } + const nowTime = new Date().getTime() + window.open(onlyOfficeUrl+'/editor?pid='+editFileInfo.pId+'&taskIds='+editFileInfo.taskId+'&editType='+editFileInfo.editType+'&oldFileName=' + showName + '&fileType=' + 'docx' + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName+'&userId='+editFileInfo.userId+'&userName='+editFileInfo.userName) + } + }).catch(e => { + }) +} diff --git a/src/common/onlinePreview/index.js b/src/common/onlinePreview/index.js new file mode 100644 index 000000000..4df73731a --- /dev/null +++ b/src/common/onlinePreview/index.js @@ -0,0 +1,17 @@ +/** + * 工作流文件预览 + */ +import { onlyOfficeUrl,kkFileViewUrl } from '@/sysConfig' +import { processEditFile } from 'api/process' +let Base64 = require('js-base64').Base64; +export default id => { + processEditFile({ + id + }).then(res => { + if(res){ + const editFileInfo = res + window.open(kkFileViewUrl+'/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))); + } + }).catch(e => { + }) +} diff --git a/src/pages/processCenter/pages/creatProcess/qbzxdjhgk/component/establish.vue b/src/pages/processCenter/pages/creatProcess/qbzxdjhgk/component/establish.vue index cba002292..249c1438b 100644 --- a/src/pages/processCenter/pages/creatProcess/qbzxdjhgk/component/establish.vue +++ b/src/pages/processCenter/pages/creatProcess/qbzxdjhgk/component/establish.vue @@ -171,6 +171,17 @@ placeholder="请输入立项原因" :maxlength="500"/> + +
+ {{ item.name }} + + + + + + +
+
{ + console.log(res) + if(res){ + this.qbfsForm.LXD = res.id + this.qbfsForm.LXDName = '立项单' + this.LXDList=this.assemble(res.id,'立项单'); + } + + }) + } }, methods: { + assemble(ids,names){ + let list= new Array(); + let idArray=ids.split(','); + let nameArray=names.split(','); + for(let i=0; i + +
+ {{ item.name }} + + + + + + +
+
{ this.qbfsForm = JSON.parse(JSON.stringify(item)) this.type = item.type + this.LXDList=this.assemble(this.qbfsForm.LXD,this.qbfsForm.LXDName); }) }, + assemble(ids,names){ + let list= new Array(); + let idArray=ids.split(','); + let nameArray=names.split(','); + for(let i=0; i + +
+ {{ item.name }} + + + + + + +
+
+ +
+ {{ item.name }} + + + + + + +
+
{ this.qbfsForm = JSON.parse(JSON.stringify(item)) this.type = item.type + this.LXDList=this.assemble(this.qbfsForm.LXD,this.qbfsForm.LXDName); }) }, + assemble(ids,names){ + let list= new Array(); + let idArray=ids.split(','); + let nameArray=names.split(','); + for(let i=0; i + +
+ {{ item.name }} + + + + + + +
+
{ this.qbfsForm = JSON.parse(JSON.stringify(item)) this.type = item.type + this.LXDList=this.assemble(this.qbfsForm.LXD,this.qbfsForm.LXDName); }) }, + assemble(ids,names){ + let list= new Array(); + let idArray=ids.split(','); + let nameArray=names.split(','); + for(let i=0; i + +
+ {{ item.name }} + + + + + + +
+
{ this.qbfsForm = JSON.parse(JSON.stringify(item)) this.type = item.type + this.LXDList=this.assemble(this.qbfsForm.LXD,this.qbfsForm.LXDName); }) }, + assemble(ids,names){ + let list= new Array(); + let idArray=ids.split(','); + let nameArray=names.split(','); + for(let i=0; i