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

14

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