|
|
|
@ -6,7 +6,7 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="16" style="text-align: left">
|
|
|
|
|
<el-button type="success" style="width: 120px;text-align: left" icon="el-icon-circle-plus-outline"
|
|
|
|
|
@click="addUser">新增用户
|
|
|
|
|
@click="editUser(null)">新增用户
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button type="danger" plain icon="el-icon-delete" style="width: 120px;text-align: left"
|
|
|
|
|
@click="deleteUserMul" v-if="items.length">多选删除
|
|
|
|
@ -25,8 +25,8 @@
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-tag
|
|
|
|
|
:type="scope.row.position === 1 ? 'primary' : scope.row.position ===2 ? 'success': 'warning'"
|
|
|
|
|
disable-transitions>{{scope.row.position ===1 ? '教 师' :
|
|
|
|
|
scope.row.position ===2 ? '实验室管理员': '超级管理员'}}
|
|
|
|
|
disable-transitions>{{scope.row.position ===1 ? '教 师' :
|
|
|
|
|
scope.row.position ===2 ? '实验室管理员': '超级管理员'}}
|
|
|
|
|
</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
@ -36,9 +36,14 @@
|
|
|
|
|
<el-table-column prop="email" label="邮箱"></el-table-column>
|
|
|
|
|
<el-table-column fixed="right" label="操作" width="300">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button @click="editUser(scope.row)" type="primary" size="mini" plain icon="el-icon-edit" v-if="scope.row.position!==3">编辑</el-button>
|
|
|
|
|
<el-button @click="deleteUser(scope.row)" type="danger" size="mini" plain icon="el-icon-delete" v-if="scope.row.position!==3">删除</el-button>
|
|
|
|
|
<el-button @click="handleClick(scope.row)" size="mini" plain v-if="scope.row.position === 1">查看课表</el-button>
|
|
|
|
|
<el-button @click="editUser(scope.row)" type="primary" size="mini" plain icon="el-icon-edit"
|
|
|
|
|
v-if="scope.row.position!==3">编辑
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button @click="deleteUser(scope.row)" type="danger" size="mini" plain icon="el-icon-delete"
|
|
|
|
|
v-if="scope.row.position!==3">删除
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button @click="handleClick(scope.row)" size="mini" plain v-if="scope.row.position === 1">查看课表
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
@ -81,18 +86,6 @@
|
|
|
|
|
handleSelectionChange(val) {
|
|
|
|
|
this.items = val;
|
|
|
|
|
},
|
|
|
|
|
addUser() {
|
|
|
|
|
this.edit = false
|
|
|
|
|
this.userForm = {
|
|
|
|
|
nickname: "",
|
|
|
|
|
tel: "",
|
|
|
|
|
email: "",
|
|
|
|
|
username: "",
|
|
|
|
|
office: "",
|
|
|
|
|
position: ''
|
|
|
|
|
}
|
|
|
|
|
this.dialogFormVisible = true
|
|
|
|
|
},
|
|
|
|
|
// 删除用户
|
|
|
|
|
async deleteUser(item) {
|
|
|
|
|
await showDialog("确认要删除吗?", this)
|
|
|
|
@ -105,21 +98,30 @@
|
|
|
|
|
showFail("删除失败 " + e.msg, this)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
async deleteUserMul(){
|
|
|
|
|
async deleteUserMul() {
|
|
|
|
|
await showDialog("确认要删除吗?", this)
|
|
|
|
|
showFail("尚未开发",this)
|
|
|
|
|
showFail("尚未开发", this)
|
|
|
|
|
},
|
|
|
|
|
// 编辑用户
|
|
|
|
|
async editUser(item) {
|
|
|
|
|
this.edit = true
|
|
|
|
|
this.userForm = item
|
|
|
|
|
// 判断是否为编辑模式
|
|
|
|
|
this.edit = !!item
|
|
|
|
|
this.userForm = item ? item : {
|
|
|
|
|
nickname: "",
|
|
|
|
|
tel: "",
|
|
|
|
|
email: "",
|
|
|
|
|
username: "",
|
|
|
|
|
office: "",
|
|
|
|
|
position: ''
|
|
|
|
|
}
|
|
|
|
|
// 弹出编辑框
|
|
|
|
|
this.dialogFormVisible = true
|
|
|
|
|
},
|
|
|
|
|
cancel(){
|
|
|
|
|
cancel() {
|
|
|
|
|
this.load()
|
|
|
|
|
this.dialogFormVisible = false
|
|
|
|
|
},
|
|
|
|
|
confirm(){
|
|
|
|
|
this.load()
|
|
|
|
|
confirm() {
|
|
|
|
|
this.cancel()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|