|
@@ -4,9 +4,9 @@
|
|
<!--用户数据1-->
|
|
<!--用户数据1-->
|
|
<el-col :xs="24">
|
|
<el-col :xs="24">
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="88px">
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="88px">
|
|
- <el-form-item label="学号" prop="className">
|
|
|
|
|
|
+ <el-form-item label="学号" prop="UserName">
|
|
<el-input
|
|
<el-input
|
|
- v-model="queryParams.className"
|
|
|
|
|
|
+ v-model="queryParams.UserName"
|
|
placeholder="请输入学号"
|
|
placeholder="请输入学号"
|
|
clearable
|
|
clearable
|
|
style="width: 150px"
|
|
style="width: 150px"
|
|
@@ -14,9 +14,9 @@
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="姓名" prop="className">
|
|
|
|
|
|
+ <el-form-item label="姓名" prop="nickName">
|
|
<el-input
|
|
<el-input
|
|
- v-model="queryParams.className"
|
|
|
|
|
|
+ v-model="queryParams.nickName"
|
|
placeholder="请输入姓名"
|
|
placeholder="请输入姓名"
|
|
clearable
|
|
clearable
|
|
style="width: 150px"
|
|
style="width: 150px"
|
|
@@ -24,7 +24,7 @@
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="班级名称" prop="className">
|
|
|
|
|
|
+ <!-- <el-form-item label="班级名称" prop="className">
|
|
<el-input
|
|
<el-input
|
|
v-model="queryParams.className"
|
|
v-model="queryParams.className"
|
|
placeholder="请输入班级名称"
|
|
placeholder="请输入班级名称"
|
|
@@ -41,7 +41,7 @@
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
@keyup.enter.native="handleQuery"
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
/>
|
|
- </el-form-item>
|
|
|
|
|
|
+ </el-form-item> -->
|
|
|
|
|
|
<el-form-item label="创建时间">
|
|
<el-form-item label="创建时间">
|
|
<el-date-picker
|
|
<el-date-picker
|
|
@@ -68,7 +68,6 @@
|
|
icon="el-icon-plus"
|
|
icon="el-icon-plus"
|
|
size="mini"
|
|
size="mini"
|
|
@click="handleAdd"
|
|
@click="handleAdd"
|
|
- v-hasPermi="['system:user:add']"
|
|
|
|
>新增</el-button>
|
|
>新增</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
@@ -79,7 +78,6 @@
|
|
size="mini"
|
|
size="mini"
|
|
:disabled="single"
|
|
:disabled="single"
|
|
@click="handleUpdate"
|
|
@click="handleUpdate"
|
|
- v-hasPermi="['system:user:edit']"
|
|
|
|
>修改</el-button>
|
|
>修改</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
@@ -90,7 +88,6 @@
|
|
size="mini"
|
|
size="mini"
|
|
:disabled="multiple"
|
|
:disabled="multiple"
|
|
@click="handleDelete"
|
|
@click="handleDelete"
|
|
- v-hasPermi="['system:user:remove']"
|
|
|
|
>删除</el-button>
|
|
>删除</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
|
@@ -99,8 +96,8 @@
|
|
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
|
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
|
<el-table-column type="selection" width="50" align="center" />
|
|
<el-table-column type="selection" width="50" align="center" />
|
|
<el-table-column label="编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
|
|
<el-table-column label="编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
|
|
- <el-table-column label="学号" align="center" key="xuehao" prop="xuehao" v-if="columns[1].visible" />
|
|
|
|
- <el-table-column label="姓名" align="center" key="xingming" prop="xingming" v-if="columns[2].visible" />
|
|
|
|
|
|
+ <el-table-column label="学号" align="center" key="userName" prop="userName" v-if="columns[1].visible" />
|
|
|
|
+ <el-table-column label="姓名" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" />
|
|
<el-table-column label="区队/班级" align="center" key="className" prop="className" v-if="columns[3].visible" :show-overflow-tooltip="true" />
|
|
<el-table-column label="区队/班级" align="center" key="className" prop="className" v-if="columns[3].visible" :show-overflow-tooltip="true" />
|
|
<el-table-column label="专业名称" align="center" key="majorName" prop="majorName" v-if="columns[4].visible" :show-overflow-tooltip="true" />
|
|
<el-table-column label="专业名称" align="center" key="majorName" prop="majorName" v-if="columns[4].visible" :show-overflow-tooltip="true" />
|
|
<el-table-column label="备注" align="center" key="remark" prop="remark" v-if="columns[5].visible" :show-overflow-tooltip="true" />
|
|
<el-table-column label="备注" align="center" key="remark" prop="remark" v-if="columns[5].visible" :show-overflow-tooltip="true" />
|
|
@@ -121,20 +118,17 @@
|
|
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']"
|
|
|
|
>修改</el-button>
|
|
>修改</el-button>
|
|
<el-button
|
|
<el-button
|
|
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']"
|
|
|
|
>删除</el-button>
|
|
>删除</el-button>
|
|
- <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['simulator:user:resetPwd', 'simulator:user:edit']">
|
|
|
|
|
|
+ <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['sim:student:resetPwd', 'sim:student:edit']">
|
|
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
|
|
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
|
|
<el-dropdown-menu slot="dropdown">
|
|
<el-dropdown-menu slot="dropdown">
|
|
<el-dropdown-item command="handleResetPwd" icon="el-icon-key"
|
|
<el-dropdown-item command="handleResetPwd" icon="el-icon-key"
|
|
- v-hasPermi="['simulator:user:resetPwd']">重置密码</el-dropdown-item>
|
|
|
|
|
|
+ v-hasPermi="['sim:student:resetPwd']">重置密码</el-dropdown-item>
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
</template>
|
|
</template>
|
|
@@ -155,19 +149,58 @@
|
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
<el-row>
|
|
<el-row>
|
|
- <el-col :span="24">
|
|
|
|
- <el-form-item label="班级名称" prop="nickName">
|
|
|
|
- <el-input v-model="form.nickName" placeholder="请输入班级名称" maxlength="30" />
|
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item v-if="form.userId == undefined" label="学号" prop="userName">
|
|
|
|
+ <el-input v-model="form.userName" placeholder="请输入学号" maxlength="30" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item v-if="form.userId == undefined" label="登录密码" prop="password">
|
|
|
|
+ <el-input v-model="form.password" placeholder="请输入登录密码" type="password" maxlength="20" show-password/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
<el-row>
|
|
<el-row>
|
|
- <el-col :span="24">
|
|
|
|
- <el-form-item label="专业" prop="nickName">
|
|
|
|
- <el-input v-model="form.nickName" placeholder="请输入专业" maxlength="30" />
|
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="姓名" prop="nickName">
|
|
|
|
+ <el-input v-model="form.nickName" placeholder="请输入姓名" maxlength="30" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+ <!-- <el-col :span="12">
|
|
|
|
+ <el-form-item label="手机号码" prop="phonenumber">
|
|
|
|
+ <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
+
|
|
|
|
+ <el-row>-->
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="状态">
|
|
|
|
+ <el-radio-group v-model="form.status">
|
|
|
|
+ <el-radio
|
|
|
|
+ v-for="dict in dict.type.sys_normal_disable"
|
|
|
|
+ :key="dict.value"
|
|
|
|
+ :label="dict.value"
|
|
|
|
+ >{{dict.label}}</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <!-- <el-row>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="角色">
|
|
|
|
+ <el-select v-model="form.roleIds" multiple placeholder="请选择角色">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in roleOptions"
|
|
|
|
+ :key="item.roleId"
|
|
|
|
+ :label="item.roleName"
|
|
|
|
+ :value="item.roleId"
|
|
|
|
+ :disabled="item.status == 1"
|
|
|
|
+ ></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row> -->
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
<el-form-item label="备注">
|
|
<el-form-item label="备注">
|
|
@@ -187,13 +220,13 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
|
|
|
|
|
|
+import { listStudent, getStudent, delStudent, addStudent, updateStudent } from "@/api/sim/student";
|
|
import { getToken } from "@/utils/auth";
|
|
import { getToken } from "@/utils/auth";
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- name: "User",
|
|
|
|
|
|
+ name: "Student",
|
|
dicts: ['sys_normal_disable', 'sys_user_sex'],
|
|
dicts: ['sys_normal_disable', 'sys_user_sex'],
|
|
components: { Treeselect },
|
|
components: { Treeselect },
|
|
data() {
|
|
data() {
|
|
@@ -232,21 +265,6 @@ export default {
|
|
children: "children",
|
|
children: "children",
|
|
label: "label"
|
|
label: "label"
|
|
},
|
|
},
|
|
- // 用户导入参数
|
|
|
|
- upload: {
|
|
|
|
- // 是否显示弹出层(用户导入)
|
|
|
|
- open: false,
|
|
|
|
- // 弹出层标题(用户导入)
|
|
|
|
- title: "",
|
|
|
|
- // 是否禁用上传
|
|
|
|
- isUploading: false,
|
|
|
|
- // 是否更新已经存在的用户数据
|
|
|
|
- updateSupport: 0,
|
|
|
|
- // 设置上传的请求头部
|
|
|
|
- headers: { Authorization: "Bearer " + getToken() },
|
|
|
|
- // 上传的地址
|
|
|
|
- url: process.env.VUE_APP_BASE_API + "/system/user/importData"
|
|
|
|
- },
|
|
|
|
// 查询参数
|
|
// 查询参数
|
|
queryParams: {
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
@@ -261,8 +279,8 @@ export default {
|
|
{ key: 0, label: `编号`, visible: true },
|
|
{ key: 0, label: `编号`, visible: true },
|
|
{ key: 1, label: `编号`, visible: true },
|
|
{ key: 1, label: `编号`, visible: true },
|
|
{ key: 2, label: `姓名`, visible: true },
|
|
{ key: 2, label: `姓名`, visible: true },
|
|
- { key: 3, label: `班级名称`, visible: true },
|
|
|
|
- { key: 4, label: `专业`, visible: true },
|
|
|
|
|
|
+ { key: 3, label: `班级名称`, visible: false },
|
|
|
|
+ { key: 4, label: `专业`, visible: false },
|
|
{ key: 5, label: `备注`, visible: true },
|
|
{ key: 5, label: `备注`, visible: true },
|
|
{ key: 6, label: `创建时间`, visible: true }
|
|
{ key: 6, label: `创建时间`, visible: true }
|
|
],
|
|
],
|
|
@@ -280,20 +298,6 @@ export default {
|
|
{ min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' },
|
|
{ min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' },
|
|
{ pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" }
|
|
{ pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" }
|
|
],
|
|
],
|
|
- email: [
|
|
|
|
- {
|
|
|
|
- type: "email",
|
|
|
|
- message: "请输入正确的邮箱地址",
|
|
|
|
- trigger: ["blur", "change"]
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
- phonenumber: [
|
|
|
|
- {
|
|
|
|
- pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
|
|
- message: "请输入正确的手机号码",
|
|
|
|
- trigger: "blur"
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
}
|
|
}
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -314,7 +318,7 @@ export default {
|
|
/** 查询用户列表 */
|
|
/** 查询用户列表 */
|
|
getList() {
|
|
getList() {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
- listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
|
|
|
|
|
+ listStudent(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
|
this.userList = response.rows;
|
|
this.userList = response.rows;
|
|
this.total = response.total;
|
|
this.total = response.total;
|
|
this.loading = false;
|
|
this.loading = false;
|
|
@@ -346,17 +350,11 @@ export default {
|
|
reset() {
|
|
reset() {
|
|
this.form = {
|
|
this.form = {
|
|
userId: undefined,
|
|
userId: undefined,
|
|
- deptId: undefined,
|
|
|
|
userName: undefined,
|
|
userName: undefined,
|
|
nickName: undefined,
|
|
nickName: undefined,
|
|
password: undefined,
|
|
password: undefined,
|
|
- phonenumber: undefined,
|
|
|
|
- email: undefined,
|
|
|
|
- sex: undefined,
|
|
|
|
status: "0",
|
|
status: "0",
|
|
remark: undefined,
|
|
remark: undefined,
|
|
- postIds: [],
|
|
|
|
- roleIds: []
|
|
|
|
};
|
|
};
|
|
this.resetForm("form");
|
|
this.resetForm("form");
|
|
},
|
|
},
|
|
@@ -394,26 +392,26 @@ export default {
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
handleAdd() {
|
|
handleAdd() {
|
|
this.reset();
|
|
this.reset();
|
|
- getUser().then(response => {
|
|
|
|
- this.postOptions = response.posts;
|
|
|
|
- this.roleOptions = response.roles;
|
|
|
|
|
|
+ // getUser().then(response => {
|
|
|
|
+ // this.postOptions = response.posts;
|
|
|
|
+ // this.roleOptions = response.roles;
|
|
this.open = true;
|
|
this.open = true;
|
|
- this.title = "添加用户";
|
|
|
|
|
|
+ this.title = "添加学员";
|
|
this.form.password = this.initPassword;
|
|
this.form.password = this.initPassword;
|
|
- });
|
|
|
|
|
|
+ // });
|
|
},
|
|
},
|
|
/** 修改按钮操作 */
|
|
/** 修改按钮操作 */
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
this.reset();
|
|
this.reset();
|
|
const userId = row.userId || this.ids;
|
|
const userId = row.userId || this.ids;
|
|
- getUser(userId).then(response => {
|
|
|
|
|
|
+ getStudent(userId).then(response => {
|
|
this.form = response.data;
|
|
this.form = response.data;
|
|
- this.postOptions = response.posts;
|
|
|
|
- this.roleOptions = response.roles;
|
|
|
|
- this.$set(this.form, "postIds", response.postIds);
|
|
|
|
- this.$set(this.form, "roleIds", response.roleIds);
|
|
|
|
|
|
+ // this.postOptions = response.posts;
|
|
|
|
+ // this.roleOptions = response.roles;
|
|
|
|
+ // this.$set(this.form, "postIds", response.postIds);
|
|
|
|
+ // this.$set(this.form, "roleIds", response.roleIds);
|
|
this.open = true;
|
|
this.open = true;
|
|
- this.title = "修改用户";
|
|
|
|
|
|
+ this.title = "修改学员";
|
|
this.form.password = "";
|
|
this.form.password = "";
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -446,13 +444,13 @@ export default {
|
|
this.$refs["form"].validate(valid => {
|
|
this.$refs["form"].validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
if (this.form.userId != undefined) {
|
|
if (this.form.userId != undefined) {
|
|
- updateUser(this.form).then(response => {
|
|
|
|
|
|
+ updateStudent(this.form).then(response => {
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.open = false;
|
|
this.open = false;
|
|
this.getList();
|
|
this.getList();
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- addUser(this.form).then(response => {
|
|
|
|
|
|
+ addStudent(this.form).then(response => {
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.open = false;
|
|
this.open = false;
|
|
this.getList();
|
|
this.getList();
|
|
@@ -464,45 +462,14 @@ export default {
|
|
/** 删除按钮操作 */
|
|
/** 删除按钮操作 */
|
|
handleDelete(row) {
|
|
handleDelete(row) {
|
|
const userIds = row.userId || this.ids;
|
|
const userIds = row.userId || this.ids;
|
|
- this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
|
|
|
|
- return delUser(userIds);
|
|
|
|
|
|
+ this.$modal.confirm('是否确认删除编号为"' + userIds + '"的数据项?').then(function() {
|
|
|
|
+ return delStudent(userIds);
|
|
}).then(() => {
|
|
}).then(() => {
|
|
this.getList();
|
|
this.getList();
|
|
this.$modal.msgSuccess("删除成功");
|
|
this.$modal.msgSuccess("删除成功");
|
|
}).catch(() => {});
|
|
}).catch(() => {});
|
|
},
|
|
},
|
|
- /** 导出按钮操作 */
|
|
|
|
- handleExport() {
|
|
|
|
- this.download('system/user/export', {
|
|
|
|
- ...this.queryParams
|
|
|
|
- }, `user_${new Date().getTime()}.xlsx`)
|
|
|
|
- },
|
|
|
|
- /** 导入按钮操作 */
|
|
|
|
- handleImport() {
|
|
|
|
- this.upload.title = "用户导入";
|
|
|
|
- this.upload.open = true;
|
|
|
|
- },
|
|
|
|
- /** 下载模板操作 */
|
|
|
|
- importTemplate() {
|
|
|
|
- this.download('system/user/importTemplate', {
|
|
|
|
- }, `user_template_${new Date().getTime()}.xlsx`)
|
|
|
|
- },
|
|
|
|
- // 文件上传中处理
|
|
|
|
- handleFileUploadProgress(event, file, fileList) {
|
|
|
|
- this.upload.isUploading = true;
|
|
|
|
- },
|
|
|
|
- // 文件上传成功处理
|
|
|
|
- handleFileSuccess(response, file, fileList) {
|
|
|
|
- this.upload.open = false;
|
|
|
|
- this.upload.isUploading = false;
|
|
|
|
- this.$refs.upload.clearFiles();
|
|
|
|
- this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
|
|
|
- this.getList();
|
|
|
|
- },
|
|
|
|
- // 提交上传文件
|
|
|
|
- submitFileForm() {
|
|
|
|
- this.$refs.upload.submit();
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|