bug修改

This commit is contained in:
zhaoxiao
2021-10-13 11:30:57 +08:00
parent 02898fd216
commit 896ad36e6a
6 changed files with 85 additions and 46 deletions
@@ -92,13 +92,14 @@
</template>
<span slot="action" class="action-span-cell" slot-scope="text, record">
<template v-if="record.showOperate">
<a @click="goFilesMaintenance(record)" v-has="'workingGroupProject:fileMaintenance'">文件维护</a>
<a @click="goConferenceMaintenance(record)" v-has="'workingGroupProject:meetingMaintenance'">会议维护</a>
<a @click="copyWorkGroup(record.id)" v-has="'workingGroupProject:copy'" v-if="record.canOperate">复制</a>
<a @click="handleEdit(record)" v-has="'workingGroupProject:edit'" v-if="record.canOperate">编辑</a>
<a @click="handleDelete(record.id)" v-has="'workingGroupProject:delete'" v-if="record.canOperate">删除</a>
</template>
<a @click="goFilesMaintenance(record)" v-has="'workingGroupProject:fileMaintenance'">文件维护</a>
<a @click="goConferenceMaintenance(record)" v-has="'workingGroupProject:meetingMaintenance'">会议维护</a>
<a @click="copyWorkGroup(record.id)" v-has="'workingGroupProject:copy'"
v-if="record.checkoutOperation === 1">复制</a>
<a @click="handleEdit(record)" v-has="'workingGroupProject:edit'"
v-if="record.checkoutOperation === 1">编辑</a>
<a @click="handleDelete(record.id)" v-has="'workingGroupProject:delete'"
v-if="record.checkoutOperation === 1">删除</a>
</span>
</a-table>
</div>
@@ -212,36 +213,36 @@ export default {
}
}).finally(() => {
this.loading = false
// 判断登录用户是否为负责人B
if (this.dataSource.length > 0) {
for (let index = 0; index < this.dataSource.length; index++) {
this.checkWorkingGroupPrincipal(index).then((res) => {
res.showOperate = true
this.$set(this.dataSource, index, res)
})
}
}
// 判断登录用户是否为负责人B 2021-10-13:修改为后端在列表字段返回checkoutOperation字段控制,1--可操作,2--不可操作
// if (this.dataSource.length > 0) {
// for (let index = 0; index < this.dataSource.length; index++) {
// this.checkWorkingGroupPrincipal(index).then((res) => {
// res.showOperate = true
// this.$set(this.dataSource, index, res)
// })
// }
// }
})
},
/**
* 判断登录用户是否为负责人B
*/
checkWorkingGroupPrincipal(index) {
let item = this.dataSource[index]
// (负责人B不可操作)
return new Promise(resolve => {
checkoutWorkingGroupPrincipal({ id: item.id }).then(res => {
// 不可操作则置否
if (res.success) {
item.canOperate = true
} else {
item.canOperate = false
}
}).finally(() => {
resolve(item)
})
})
},
// checkWorkingGroupPrincipal(index) {
// let item = this.dataSource[index]
// // (负责人B不可操作)
// return new Promise(resolve => {
// checkoutWorkingGroupPrincipal({ id: item.id }).then(res => {
// // 不可操作则置否
// if (res.success) {
// item.canOperate = true
// } else {
// item.canOperate = false
// }
// }).finally(() => {
// resolve(item)
// })
// })
// },
/**
* 文件维护
* @param record
@@ -252,7 +253,7 @@ export default {
path: '/projectManagement/WorkingGroupProjectDataMaintenance',
query: {
workingGroupId: record.id,
canOperate: record.canOperate
canOperate: record.checkoutOperation === 1
}
})
},
@@ -266,7 +267,7 @@ export default {
query: {
workingGroupProject: record.workingGroupProject,
workingGroupProjectId: record.id,
canOperate: record.canOperate
canOperate: record.checkoutOperation === 1
}
})
},
@@ -295,7 +296,7 @@ export default {
query: {
workingGroupProject: record.workingGroupProject,
workingGroupProjectId: record.id,
canOperate: record.canOperate
canOperate: record.checkoutOperation === 1
}
})
},
@@ -307,7 +308,7 @@ export default {
year: new Date().getFullYear().toString()
}
this.loadData(1)
},
}
}
}
</script>