This commit is contained in:
YunaiV 2021-03-13 19:43:47 +08:00
commit 4dc484f51d

View File

@ -142,34 +142,41 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="large"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:user:edit']" v-hasPermi="['system:role:edit']"
>修改</el-button> >修改</el-button>
<el-button <el-dropdown @command="(command) => handleCommand(command, scope.$index, scope.row)">
<span class="el-dropdown-link">
更多操作<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
command="handleDelete"
v-if="scope.row.id !== 1" v-if="scope.row.id !== 1"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:user:remove']" v-hasPermi="['system:user:remove']"
>删除</el-button> >删除</el-dropdown-item>
<el-button <el-dropdown-item
command="handleResetPwd"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-key" icon="el-icon-key"
@click="handleResetPwd(scope.row)"
v-hasPermi="['system:user:resetPwd']" v-hasPermi="['system:user:resetPwd']"
>重置</el-button> >重置</el-dropdown-item>
<el-button <el-dropdown-item
command="handleRole"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-circle-check" icon="el-icon-circle-check"
@click="handleRole(scope.row)"
v-hasPermi="['system:permission:assign-user-role']" v-hasPermi="['system:permission:assign-user-role']"
>分配角色</el-button> >分配角色</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -452,6 +459,25 @@ export default {
}); });
}, },
methods: { methods: {
//
handleCommand(command, index, row) {
switch (command) {
case 'handleUpdate':
this.handleUpdate(row);//
break;
case 'handleDelete':
this.handleDelete(row);//
break;
case 'handleResetPwd':
this.handleResetPwd(row);
break;
case 'handleRole':
this.handleRole(row);
break;
default:
break;
}
},
/** 查询用户列表 */ /** 查询用户列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -713,3 +739,13 @@ export default {
} }
}; };
</script> </script>
<style>
.el-dropdown-link {
cursor: pointer;
color: #1890ff;
margin-left: 5px;
}
.el-icon-arrow-down {
font-size: 14px;
}
</style>