feat: There is no way the, plan lxd

This commit is contained in:
super_liu
2022-01-18 16:13:56 +08:00
parent 68471bda31
commit dae0e83a6c
5 changed files with 110 additions and 3 deletions
+6
View File
@@ -8,6 +8,7 @@ import hasPermission from './hasPermission'
import preview from './preview'
import onlineEdit from './onlineEdit'
import onlinePreview from './onlinePreview'
import onlineEditPreview from './onlineEditPreview'
// 表单验证
import verify from './verify'
@@ -46,6 +47,11 @@ const install = function (Vue) {
return onlinePreview
}
},
$onlineEditPreview: {
get () {
return onlineEditPreview
}
},
$onlineEdit: {
get () {
return onlineEdit
+29
View File
@@ -0,0 +1,29 @@
/**
* 工作流文件在线编辑预览
*/
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
}
editFileInfo.fileSuffix = 'docx'
const nowTime = new Date().getTime()
window.open(onlyOfficeUrl+'/onlyOffice?oldFileName=' + showName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName)
}
}).catch(e => {
})
}
@@ -502,10 +502,13 @@ export default {
handleFilePreview(file,type) {
let id = ""
let fileName = ""
let fileNam2 = ""
if(this.qbfsForm.esName && this.qbfsForm.esName !== ''){
fileName = this.qbfsForm.esName+'-立项单.docx'
fileNam2 = this.qbfsForm.esName+'-立项单'
}else {
fileName = '立项单.docx'
fileNam2 = '立项单'
}
if(file && file.id){
id = file.id
@@ -519,9 +522,9 @@ export default {
this.$message.warning('文件不存在,下载失败')
}
} else if(type === 'preview'){
this.$onlinePreview(id)
this.$onlineEditPreview(id,fileNam2,this.$store.getters.userInfo.userId,this.$store.getters.userInfo.userName)
}else {
this.$onlineEdit(id,'立项单',this.$store.getters.userInfo.userId,this.$store.getters.userInfo.userName)
this.$onlineEdit(id,fileNam2,this.$store.getters.userInfo.userId,this.$store.getters.userInfo.userName)
}
},
//体系结构单选
@@ -380,7 +380,6 @@ export default {
})
},
methods:{
// 文件预览及下载
handleFilePreview(file,type) {
let id = ""
@@ -402,6 +402,17 @@
v-model="addForm.esMatingRelations"
></custom-input-for-all-standards2>
</template>
<el-form-item label="立项单" prop="LXDName" class="add-form-item" :class="DrawerType === 'see' ? 'form-item-disabled' : ''">
<div v-if="LXDList.length > 0" v-for="(item,index) in LXDList" :key="index" style="color: #409eff;cursor:pointer">
<span style="width: 80%;" @click="handleFilePreview(item,'preview')">{{ item.name }}</span>
<span style="width: 20%;margin-left: 15px;" v-if="item.id !== ''">
<el-button type="primary" size="mini" plain icon="el-icon-download" @click="handleFilePreview(item,'down')"></el-button>
</span>
<span style="width: 20%;margin-left: 15px;" v-if="item.id !== '' && DrawerType !== 'see'">
<el-button type="primary" size="mini" plain icon="el-icon-edit" @click="handleFilePreview(item,'onlineEdit')"></el-button>
</span>
</div>
</el-form-item>
</el-form>
</el-col>
</el-row>
@@ -597,6 +608,7 @@
},
data() {
return {
LXDList: [],
CBList: [],
BZList: [],
TXJGList: [],
@@ -1031,6 +1043,34 @@
this.form.pageSize = pageSize
this.getData()
},
handleFilePreview(file,type) {
let id = ""
let fileName = ""
let fileNam2 = ""
if(this.addForm.esName && this.addForm.esName !== ''){
fileName = this.addForm.esName+'-立项单.docx'
fileNam2 = this.addForm.esName+'-立项单'
}else {
fileName = '立项单.docx'
fileNam2 = '立项单'
}
if(file && file.id){
id = file.id
}else {
id = file.response.data.id
}
if (type === 'down') {
if (id) {
window.open('/api/lawss/activiti/downloadFileForSar?fileId=' + id +'&oldFileName='+fileName)
} else {
this.$message.warning('文件不存在,下载失败')
}
} else if(type === 'preview'){
this.$onlineEditPreview(id,fileNam2,this.$store.getters.userInfo.userId,this.$store.getters.userInfo.userName)
}else {
this.$onlineEdit(id,fileNam2,this.$store.getters.userInfo.userId,this.$store.getters.userInfo.userName)
}
},
handleCommand (command) {
switch (command[1]) {
case '编辑':
@@ -1064,6 +1104,16 @@
drafterName: command[0].drafterName, // 起草人
drafter: command[0].drafter,
}
this.addForm.LXD = command[0].lxd
let fileName1 = ""
if(this.addForm.esName && this.addForm.esName !== ''){
fileName1 = this.addForm.esName+'-立项单'
}else {
fileName1 = '立项单'
}
this.addForm.LXDName = fileName1
this.LXDList=this.assemble(command[0].lxd,fileName1)
console.log(this.LXDList)
if (typeof (this.addForm.area) === 'string') {
this.addForm.area = command[0].area.split(',')
}
@@ -1096,12 +1146,32 @@
this.DrawerType = 'see'
this.addDrawer = true
this.addForm = command[0]
this.addForm.LXD = command[0].lxd
let fileName = ""
if(this.addForm.esName && this.addForm.esName !== ''){
fileName = this.addForm.esName+'-立项单'
}else {
fileName = '立项单'
}
this.addForm.LXDName = fileName
this.LXDList=this.assemble(command[0].lxd,fileName);
console.log(this.LXDList)
if (typeof (this.addForm.area) === 'string') {
this.addForm.area = command[0].area.split(',')
}
break
}
},
assemble(ids,names){
let list= new Array();
let idArray=ids.split(',');
let nameArray=names.split(',');
for(let i=0; i<idArray.length; i++){
list.push({id:idArray[i],name:nameArray[i]});
}
return list;
},
getData () {
this.loading = true
this.$http.post('esRevisePlan/es-revise-plan/queryAllPlans', this.form, {