|
@@ -89,7 +89,7 @@
|
|
</template>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
<template v-else-if="column.dataIndex === 'courseCodes'">
|
|
<template v-else-if="column.dataIndex === 'courseCodes'">
|
|
- {{record.courseCodes?.join('、')}}
|
|
|
|
|
|
+ {{ record.courseCodes?.join("、") }}
|
|
</template>
|
|
</template>
|
|
<template v-else-if="column.dataIndex === 'operation'">
|
|
<template v-else-if="column.dataIndex === 'operation'">
|
|
<div
|
|
<div
|
|
@@ -107,6 +107,7 @@
|
|
>编辑</span
|
|
>编辑</span
|
|
>
|
|
>
|
|
<span
|
|
<span
|
|
|
|
+ v-if="record.role !== 'SECTION_LEADER'"
|
|
class="tw-cursor-pointer tw-p-2 tw-ml-1"
|
|
class="tw-cursor-pointer tw-p-2 tw-ml-1"
|
|
@click="onResetPwd(record)"
|
|
@click="onResetPwd(record)"
|
|
>重置密码
|
|
>重置密码
|
|
@@ -146,11 +147,11 @@
|
|
<a-form-item label="角色" v-bind="validateInfos.role">
|
|
<a-form-item label="角色" v-bind="validateInfos.role">
|
|
<a-select v-model:value="userInfo.role" placeholder="请选择角色">
|
|
<a-select v-model:value="userInfo.role" placeholder="请选择角色">
|
|
<a-select-option value="SCHOOL_ADMIN">{{
|
|
<a-select-option value="SCHOOL_ADMIN">{{
|
|
- ROLE.SCHOOL_ADMIN
|
|
|
|
- }}</a-select-option>
|
|
|
|
|
|
+ ROLE.SCHOOL_ADMIN
|
|
|
|
+ }}</a-select-option>
|
|
<a-select-option value="SECTION_LEADER">{{
|
|
<a-select-option value="SECTION_LEADER">{{
|
|
- ROLE.SECTION_LEADER
|
|
|
|
- }}</a-select-option>
|
|
|
|
|
|
+ ROLE.SECTION_LEADER
|
|
|
|
+ }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<a-form-item label="姓名" v-bind="validateInfos.name">
|
|
<a-form-item label="姓名" v-bind="validateInfos.name">
|
|
@@ -399,10 +400,16 @@ const columns: TableColumnType[] = [
|
|
ellipsis: true,
|
|
ellipsis: true,
|
|
},
|
|
},
|
|
{ title: "角色", dataIndex: "roleName", align: "center", width: 120 },
|
|
{ title: "角色", dataIndex: "roleName", align: "center", width: 120 },
|
|
- { title: "科目代码", dataIndex: "courseCodes", align: "center", minWidth: 80 },
|
|
|
|
- { title: "更新时间", dataIndex: "updateTime", width: 200, ellipsis: true },
|
|
|
|
|
|
+ {
|
|
|
|
+ title: "科目代码",
|
|
|
|
+ dataIndex: "courseCodes",
|
|
|
|
+ align: "center",
|
|
|
|
+ ellipsis: true,
|
|
|
|
+ minWidth: 120,
|
|
|
|
+ },
|
|
|
|
+ { title: "更新时间", dataIndex: "updateTime", width: 150, ellipsis: true },
|
|
{ title: "状态", dataIndex: "enable", align: "center", width: 80 },
|
|
{ title: "状态", dataIndex: "enable", align: "center", width: 80 },
|
|
- { title: "操作", dataIndex: "operation", width: 240 },
|
|
|
|
|
|
+ { title: "操作", dataIndex: "operation", width: 200 },
|
|
];
|
|
];
|
|
|
|
|
|
/** 用户列表信息 */
|
|
/** 用户列表信息 */
|
|
@@ -513,34 +520,36 @@ const onPutUser = () => {
|
|
// @ts-ignore
|
|
// @ts-ignore
|
|
{ pattern: /\d{11}/, message: "请填写正确的手机号" },
|
|
{ pattern: /\d{11}/, message: "请填写正确的手机号" },
|
|
],
|
|
],
|
|
- passwd: []
|
|
|
|
|
|
+ passwd: [],
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
Object.assign(userRules, {
|
|
Object.assign(userRules, {
|
|
loginName: [{ required: true, message: "请填写登录名" }],
|
|
loginName: [{ required: true, message: "请填写登录名" }],
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- validate().then((valid) => {
|
|
|
|
- if (valid) {
|
|
|
|
- const { role, course, schoolTableData, passwd,...info } = userInfo;
|
|
|
|
- editUserInfoHttp({
|
|
|
|
- ...info,
|
|
|
|
- role,
|
|
|
|
- passwd: role === "SECTION_LEADER" ? "" : passwd,
|
|
|
|
- course: role === "SECTION_LEADER" ? course : "",
|
|
|
|
- }).then(() => {
|
|
|
|
- message.success(`${isEdit ? "修改" : "添加"}成功`);
|
|
|
|
- queryUserList();
|
|
|
|
- toggleAddUserModal(false);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }).catch(()=>{
|
|
|
|
- if (userInfo.id) {
|
|
|
|
- Object.assign(userRules, { schoolId: [], passwd: [] });
|
|
|
|
- } else {
|
|
|
|
- Object.assign(userRules, { ...addUserRules() });
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ validate()
|
|
|
|
+ .then((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ const { role, course, schoolTableData, passwd, ...info } = userInfo;
|
|
|
|
+ editUserInfoHttp({
|
|
|
|
+ ...info,
|
|
|
|
+ role,
|
|
|
|
+ passwd: role === "SECTION_LEADER" ? "" : passwd,
|
|
|
|
+ course: role === "SECTION_LEADER" ? course : "",
|
|
|
|
+ }).then(() => {
|
|
|
|
+ message.success(`${isEdit ? "修改" : "添加"}成功`);
|
|
|
|
+ queryUserList();
|
|
|
|
+ toggleAddUserModal(false);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ if (userInfo.id) {
|
|
|
|
+ Object.assign(userRules, { schoolId: [], passwd: [] });
|
|
|
|
+ } else {
|
|
|
|
+ Object.assign(userRules, { ...addUserRules() });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
};
|
|
};
|
|
|
|
|
|
/** 导入用户 */
|
|
/** 导入用户 */
|