Commit 0b5f668e authored by rockyl's avatar rockyl

过滤创建者

parent 5200368d
<template>
<div class="project-auth-manager">
<p><b>{{$t('Creator')}}</b>:{{project.creator}}</p>
<el-select style="width: 100%;" size="mini" v-model="operators" filterable multiple :disabled="!editable">
<el-select style="width: 100%;" size="mini" v-model="operatorsExcludeCreator" filterable multiple :disabled="!editable">
<el-option v-for="(item, index) in devPersons"
:key="index"
:disabled="item.name === project.creator || item.name === currentOperator"
v-if="item.name !== project.creator"
:disabled="item.name === currentOperator"
:label="item.name"
:value="item.name">
</el-option>
......@@ -23,6 +24,7 @@
return {
devPersons: [],
operators: [],
operatorsExcludeCreator: [],
};
},
computed: {
......@@ -40,22 +42,24 @@
async edit() {
this.devPersons = await getDevPersons();
this.operators = this.project.operators.split(',');
this.operatorsExcludeCreator = this.operators.concat().filter(item=>item !== this.project.creator);
this.operatorsOrigin = this.operators.concat().sort().join(',');
},
async save() {
let operatorsNew = this.operators.concat().sort().join(',');
let operators = this.operatorsExcludeCreator.concat();
operators.unshift(this.project.creator);
let operatorsNew = operators.sort().join(',');
if (operatorsNew === this.operatorsOrigin) {
return;
}
let operatorsStr = this.operators.join(',');
updateOperators(this.projectId, operatorsStr)
updateOperators(this.projectId, operatorsNew)
.then(() => {
this.$message({
message: this.$t("Operate success"),
type: "success",
});
this.modifyOperators(operatorsStr);
this.modifyOperators(operatorsNew);
})
.catch((e) => {
this.$message({message: e.message, type: "error"});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment