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

14

parent 6433b9e7
...@@ -95,7 +95,8 @@ export const projectStore = { ...@@ -95,7 +95,8 @@ export const projectStore = {
state: { state: {
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>
<el-tag <div class="user-list" v-if="operators.length > 0">
:key="tag" <el-tag
v-for="tag in authList" :key="tag"
closable v-for="tag in operators"
:disable-transitions="false" closable
@close="deleteAuth(tag)" :disable-transitions="false"
> @close="deleteAuth(tag)"
{{ tag }} >
</el-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> </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