bug修改
This commit is contained in:
@@ -92,11 +92,13 @@
|
||||
</template>
|
||||
|
||||
<span slot="action" class="action-span-cell" slot-scope="text, record">
|
||||
<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 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>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
@@ -170,7 +172,8 @@ export default {
|
||||
width: 300,
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
]
|
||||
],
|
||||
operateData: [] // 进行操作权限校验时使用的数据
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -196,19 +199,6 @@ export default {
|
||||
} else {
|
||||
this.ipagination.total = 0
|
||||
}
|
||||
// 判断登录用户是否为负责人B
|
||||
this.dataSource.forEach((item, index) => {
|
||||
// (负责人B不可操作)
|
||||
checkoutWorkingGroupPrincipal({ id: item.id }).then(res => {
|
||||
// 不可操作则置否
|
||||
if (res.success) {
|
||||
item.canOperate = true
|
||||
} else {
|
||||
item.canOperate = false
|
||||
}
|
||||
this.$set(this.dataSource, index, item)
|
||||
})
|
||||
})
|
||||
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
||||
}
|
||||
if (res.code === 510) {
|
||||
@@ -216,6 +206,34 @@ 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
|
||||
*/
|
||||
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)
|
||||
})
|
||||
})
|
||||
},
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user