Commit 88eae161 authored by 张超's avatar 张超 🎱

14

parent 6433b9e7
......@@ -96,6 +96,7 @@ export const projectStore = {
id: '',
name: '',
creator: '',
operators: '张超',
data: {
options: {},
views: [],
......
......@@ -2,15 +2,27 @@
<div class="project-auth-manager">
<el-card shadow="hover">
<h3 class="title">当前权限用户列表</h3>
<div class="user-list" v-if="operators.length > 0">
<el-tag
:key="tag"
v-for="tag in authList"
v-for="tag in operators"
closable
:disable-transitions="false"
@close="deleteAuth(tag)"
>
{{ tag }}
</el-tag>
</div>
<p v-else></p>
<el-divider></el-divider>
<el-button type="primary" size="small">增加权限</el-button>
<el-checkbox-group v-model="checkList">
<el-checkbox label="张超"></el-checkbox>
<el-checkbox label="复选框 B"></el-checkbox>
<el-checkbox label="复选框 C"></el-checkbox>
<el-checkbox label="禁用" disabled></el-checkbox>
<el-checkbox label="选中且禁用" disabled></el-checkbox>
</el-checkbox-group>
</el-card>
</div>
</template>
......@@ -22,18 +34,45 @@ export default {
data() {
return {
authList: ["张超", "姜西西", "王竹君"],
checkList: ["张超"]
};
},
computed: {
...mapState({
operators: (state) =>
state.project.operators && state.project.operators.split(","),
}),
},
mounted() {
},
methods: {
// edit() {
// this.operators = clonePureObj(this.operators).split(",");
// },
save() {
// this.modifyEnv(this.editData);
},
onAdd() {
// this.editData.push({
// name: "",
// value: "",
// });
},
deleteAuth(tag) {
this.$confirm(this.$t('Are you sure to delete this user auth') + tag, this.$t('Alert'), {
confirmButtonText: this.$t('Confirm'),
cancelButtonText: this.$t('Cancel'),
type: 'warning'
}).then(() => {
this.authList = this.authList.filter(item => item !== tag);
}).catch((e) => {
});
this.$confirm(
this.$t("Are you sure to delete this user auth") + tag,
this.$t("Alert"),
{
confirmButtonText: this.$t("Confirm"),
cancelButtonText: this.$t("Cancel"),
type: "warning",
}
)
.then(() => {
this.authList = this.authList.filter((item) => item !== tag);
})
.catch((e) => {});
console.log(tag);
},
},
......
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