【修改】监控流程
This commit is contained in:
@@ -17,4 +17,11 @@ export default {
|
||||
data: data
|
||||
})
|
||||
},
|
||||
deletReport(data){
|
||||
return request({
|
||||
url: '/api/report/powerApply/deleteAct',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<vxe-column show-overflow show-header-overflow field="privacyLevel" title="隐私等级"></vxe-column>
|
||||
<vxe-column show-overflow show-header-overflow title="操作" width="200" fixed="right" v-if="!disabled">
|
||||
<template #default="{ row }">
|
||||
<el-button type="text" class="del-btn" @click="reportDelete(row.reportId)">删除</el-button>
|
||||
<el-button type="text" class="del-btn" @click="reportDelete(row)">删除</el-button>
|
||||
<!-- <el-button type="text" @click="downloadRow(row)">下载</el-button>-->
|
||||
</template>
|
||||
</vxe-column>
|
||||
@@ -135,15 +135,11 @@ export default {
|
||||
},
|
||||
selectAllEvent ({ checked }) {
|
||||
const records = this.$refs.xTable.getCheckboxRecords()
|
||||
this.checkIds = records.map(item => {
|
||||
return item.reportId
|
||||
})
|
||||
this.checkIds = records
|
||||
},
|
||||
selectChangeEvent ({ checked }) {
|
||||
const records = this.$refs.xTable.getCheckboxRecords()
|
||||
this.checkIds = records.map(item => {
|
||||
return item.reportId
|
||||
})
|
||||
this.checkIds = records
|
||||
},
|
||||
addReport () {
|
||||
this.$refs.reportDialog.show()
|
||||
@@ -151,27 +147,88 @@ export default {
|
||||
deleteAll () {
|
||||
this.reportDelete(this.checkIds)
|
||||
},
|
||||
reportDelete (id) {
|
||||
reportDelete (row) {
|
||||
// 删除报告 假删除
|
||||
if (typeof id === 'string') {
|
||||
this.$confirm('此操作将删除所选数据, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$emit('updateTable', this.value.filter(item => item.reportId !== id))
|
||||
})
|
||||
} else {
|
||||
if (Array.isArray(id)) {
|
||||
|
||||
if (Array.isArray(row)) {
|
||||
this.$confirm('此操作将删除所选数据, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$emit('updateTable', this.value.filter(item => id.indexOf(item.reportId) === -1))
|
||||
if (this.$route.query.taskDefinitionKey == 'aid4' ){
|
||||
// 有idde
|
||||
console.log(this.value)
|
||||
debugger
|
||||
let idsList=this.checkIds.filter(item=>{
|
||||
if(item.id && item.id !=''){
|
||||
return item
|
||||
}
|
||||
})
|
||||
let reportList=this.checkIds.filter(item=>{
|
||||
if(!item.id ){
|
||||
return item
|
||||
}
|
||||
})
|
||||
|
||||
let newValue=[]
|
||||
if(idsList.length>0){
|
||||
idsList=idsList.map(item=>{
|
||||
return item.id
|
||||
})
|
||||
reportList=reportList.map(item=>{
|
||||
return item.reportId
|
||||
})
|
||||
this.$api.permissionProcess.deletReport({ids:idsList}).then(()=>{
|
||||
if(reportList.length>0){
|
||||
let reportids= row.map(item=>item.reportId)
|
||||
newValue=this.value.filter(item =>
|
||||
reportids.indexOf(item.reportId)==-1
|
||||
)
|
||||
this.$emit('updateTable', newValue)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
if(reportList.length>0){
|
||||
reportList=reportList.map(item=>{
|
||||
return item.reportId
|
||||
})
|
||||
newValue=this.value.filter(item => reportList.indexOf(item.reportId)>-1
|
||||
)
|
||||
this.$emit('updateTable', newValue)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
let id=row.map(item=>item.reportId)
|
||||
this.$emit('updateTable', this.value.filter(item => id.indexOf(item.reportId) === -1))
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.$confirm('此操作将删除所选数据, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if (this.$route.query.taskDefinitionKey == 'aid4' ){
|
||||
if(row.id && row.id !=''){
|
||||
this.$api.permissionProcess.deletReport({ids:[row.id]}).then(()=>{
|
||||
this.$message.success("删除成功")
|
||||
this.$emit('updateTable',this.value.filter(item => item.id !== row.id))
|
||||
})
|
||||
}else{
|
||||
this.$emit('updateTable', this.value.filter(item => item.reportId !== row.reportId))
|
||||
}
|
||||
|
||||
}else{
|
||||
this.$emit('updateTable', this.value.filter(item => item.reportId !== row.reportId))
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user