|
@@ -7,7 +7,7 @@
|
|
v-model:value="query.schoolId"
|
|
v-model:value="query.schoolId"
|
|
show-search
|
|
show-search
|
|
:filterOption="false"
|
|
:filterOption="false"
|
|
- @search="querySchoolList"
|
|
|
|
|
|
+ @search="(name:string) => querySchoolList(name,'list')"
|
|
placeholder="学校名称"
|
|
placeholder="学校名称"
|
|
>
|
|
>
|
|
<a-select-option
|
|
<a-select-option
|
|
@@ -19,12 +19,19 @@
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<a-form-item label="登录名">
|
|
<a-form-item label="登录名">
|
|
- <a-input v-model:value="query.loginName"></a-input>
|
|
|
|
|
|
+ <a-input
|
|
|
|
+ v-model:value="query.loginName"
|
|
|
|
+ placeholder="登录手机号"
|
|
|
|
+ ></a-input>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<a-form-item label="角色">
|
|
<a-form-item label="角色">
|
|
- <a-select v-model:value="query.role">
|
|
|
|
- <a-select-option value="SCHOOL_ADMIN">学校管理员</a-select-option>
|
|
|
|
- <a-select-option value="SECTION_LEADER">科组长</a-select-option>
|
|
|
|
|
|
+ <a-select v-model:value="query.role" placeholder="用户角色">
|
|
|
|
+ <a-select-option value="SCHOOL_ADMIN">{{
|
|
|
|
+ ROLE.SCHOOL_ADMIN
|
|
|
|
+ }}</a-select-option>
|
|
|
|
+ <a-select-option value="SECTION_LEADER">{{
|
|
|
|
+ ROLE.SECTION_LEADER
|
|
|
|
+ }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<a-form-item>
|
|
<a-form-item>
|
|
@@ -80,7 +87,10 @@
|
|
</template>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
<template v-else-if="column.dataIndex === 'operation'">
|
|
<template v-else-if="column.dataIndex === 'operation'">
|
|
- <div class="tw-flex tw-items-center">
|
|
|
|
|
|
+ <div
|
|
|
|
+ class="tw-flex tw-items-center"
|
|
|
|
+ v-if="record.role !== 'SUPER_ADMIN'"
|
|
|
|
+ >
|
|
<span
|
|
<span
|
|
class="tw-cursor-pointer tw-p-2"
|
|
class="tw-cursor-pointer tw-p-2"
|
|
@click="updateUserStatus(record)"
|
|
@click="updateUserStatus(record)"
|
|
@@ -108,7 +118,7 @@
|
|
cancelText="取消"
|
|
cancelText="取消"
|
|
:maskClosable="false"
|
|
:maskClosable="false"
|
|
@ok="onPutUser"
|
|
@ok="onPutUser"
|
|
- :after-close="resetUserFields"
|
|
|
|
|
|
+ :afterClose="resetUserFields"
|
|
>
|
|
>
|
|
<a-form :labelCol="{ span: 6 }">
|
|
<a-form :labelCol="{ span: 6 }">
|
|
<a-form-item label="学校" v-bind="validateInfos.schoolId">
|
|
<a-form-item label="学校" v-bind="validateInfos.schoolId">
|
|
@@ -117,11 +127,11 @@
|
|
show-search
|
|
show-search
|
|
:disabled="!!userInfo.id"
|
|
:disabled="!!userInfo.id"
|
|
:filterOption="false"
|
|
:filterOption="false"
|
|
- @search="querySchoolList"
|
|
|
|
|
|
+ @search="(name:string) => querySchoolList(name,'form')"
|
|
placeholder="学校名称"
|
|
placeholder="学校名称"
|
|
>
|
|
>
|
|
<a-select-option
|
|
<a-select-option
|
|
- v-for="school in schoolTableData.result"
|
|
|
|
|
|
+ v-for="school in userInfo.schoolTableData.result"
|
|
:key="school.id"
|
|
:key="school.id"
|
|
:value="school.id"
|
|
:value="school.id"
|
|
>{{ school.name }}</a-select-option
|
|
>{{ school.name }}</a-select-option
|
|
@@ -129,22 +139,37 @@
|
|
</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">
|
|
- <a-input v-model:value="userInfo.name"></a-input>
|
|
|
|
|
|
+ <a-input
|
|
|
|
+ v-model:value="userInfo.name"
|
|
|
|
+ placeholder="请输入姓名"
|
|
|
|
+ ></a-input>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<a-form-item label="登录名" v-bind="validateInfos.loginName">
|
|
<a-form-item label="登录名" v-bind="validateInfos.loginName">
|
|
<a-input
|
|
<a-input
|
|
:disabled="!!userInfo.id"
|
|
:disabled="!!userInfo.id"
|
|
v-model:value="userInfo.loginName"
|
|
v-model:value="userInfo.loginName"
|
|
|
|
+ maxlength="11"
|
|
placeholder="请输入登录手机号"
|
|
placeholder="请输入登录手机号"
|
|
></a-input>
|
|
></a-input>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
- <a-form-item label="密码" v-bind="validateInfos.passwd">
|
|
|
|
- <a-input v-model:value="userInfo.passwd"></a-input>
|
|
|
|
|
|
+ <a-form-item
|
|
|
|
+ v-if="!userInfo.id"
|
|
|
|
+ label="密码"
|
|
|
|
+ v-bind="validateInfos.passwd"
|
|
|
|
+ >
|
|
|
|
+ <a-input-password
|
|
|
|
+ v-model:value="userInfo.passwd"
|
|
|
|
+ placeholder="请输入密码"
|
|
|
|
+ ></a-input-password>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<a-form-item label="角色" v-bind="validateInfos.role">
|
|
<a-form-item label="角色" v-bind="validateInfos.role">
|
|
- <a-select v-model:value="userInfo.role">
|
|
|
|
- <a-select-option value="SCHOOL_ADMIN">学校管理员</a-select-option>
|
|
|
|
- <a-select-option value="SECTION_LEADER">科组长</a-select-option>
|
|
|
|
|
|
+ <a-select v-model:value="userInfo.role" placeholder="请选择角色">
|
|
|
|
+ <a-select-option value="SCHOOL_ADMIN">{{
|
|
|
|
+ ROLE.SCHOOL_ADMIN
|
|
|
|
+ }}</a-select-option>
|
|
|
|
+ <a-select-option value="SECTION_LEADER">{{
|
|
|
|
+ ROLE.SECTION_LEADER
|
|
|
|
+ }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<a-form-item
|
|
<a-form-item
|
|
@@ -152,7 +177,10 @@
|
|
label="所属科目"
|
|
label="所属科目"
|
|
v-bind="validateInfos.course"
|
|
v-bind="validateInfos.course"
|
|
>
|
|
>
|
|
- <a-textarea v-model:value="userInfo.course"></a-textarea>
|
|
|
|
|
|
+ <a-textarea
|
|
|
|
+ v-model:value="userInfo.course"
|
|
|
|
+ placeholder="请填写所属科目代码, 以','分隔;"
|
|
|
|
+ ></a-textarea>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-form>
|
|
</a-form>
|
|
</a-modal>
|
|
</a-modal>
|
|
@@ -164,39 +192,59 @@
|
|
cancelText="取消"
|
|
cancelText="取消"
|
|
:maskClosable="false"
|
|
:maskClosable="false"
|
|
@ok="onUpdateUserPwd"
|
|
@ok="onUpdateUserPwd"
|
|
- :after-close="clearFileList"
|
|
|
|
|
|
+ :afterClose="resetPwdFields"
|
|
>
|
|
>
|
|
<a-form :labelCol="{ span: 3 }">
|
|
<a-form :labelCol="{ span: 3 }">
|
|
<a-form-item label="密码" v-bind="validatePwdInfos.passwd">
|
|
<a-form-item label="密码" v-bind="validatePwdInfos.passwd">
|
|
- <a-input v-model:value="resetPwd.passwd"></a-input>
|
|
|
|
|
|
+ <a-input-password v-model:value="resetPwd.passwd"></a-input-password>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-form>
|
|
</a-form>
|
|
</a-modal>
|
|
</a-modal>
|
|
|
|
|
|
<a-modal
|
|
<a-modal
|
|
v-model:visible="showImportModal"
|
|
v-model:visible="showImportModal"
|
|
- title="导入用户"
|
|
|
|
- :footer="false"
|
|
|
|
:maskClosable="false"
|
|
:maskClosable="false"
|
|
- :after-close="resetPwdFields"
|
|
|
|
|
|
+ title="导入用户"
|
|
|
|
+ okText="确认上传"
|
|
|
|
+ cancelText="取消"
|
|
|
|
+ @ok="onImportUserList"
|
|
|
|
+ :afterClose="resetImportFields"
|
|
>
|
|
>
|
|
- <a-upload
|
|
|
|
- :file-list="fileList"
|
|
|
|
- :before-upload="beforeUpload"
|
|
|
|
- @remove="handleRemove"
|
|
|
|
- :max-count="1"
|
|
|
|
- type="primary"
|
|
|
|
- >
|
|
|
|
- <a-button>
|
|
|
|
- <upload-outlined></upload-outlined>
|
|
|
|
- 选择文件
|
|
|
|
- </a-button>
|
|
|
|
- </a-upload>
|
|
|
|
- <div class="operation-group">
|
|
|
|
- <a-button type="primary" @click="downloadTemplate">下载模板</a-button>
|
|
|
|
- <a-button type="primary" @click="clearFileList">清空上传文件</a-button>
|
|
|
|
- <a-button type="primary" @click="onImportUserList">确认上传</a-button>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <a-form :labelCol="{ span: 6 }">
|
|
|
|
+ <a-form-item label="学校名称" v-bind="validateImportInfos.schoolId">
|
|
|
|
+ <a-select
|
|
|
|
+ v-model:value="importUserForm.schoolId"
|
|
|
|
+ show-search
|
|
|
|
+ :filterOption="false"
|
|
|
|
+ @search="(name: string) => querySchoolList(name,'import')"
|
|
|
|
+ placeholder="学校名称"
|
|
|
|
+ >
|
|
|
|
+ <a-select-option
|
|
|
|
+ v-for="school in importUserForm.schoolTableData.result"
|
|
|
|
+ :key="school.id"
|
|
|
|
+ :value="school.id"
|
|
|
|
+ >{{ school.name }}</a-select-option
|
|
|
|
+ >
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <a-form-item label="用户导入文件" v-bind="validateImportInfos.fileList">
|
|
|
|
+ <a-upload
|
|
|
|
+ :file-list="importUserForm.fileList"
|
|
|
|
+ :before-upload="beforeUpload"
|
|
|
|
+ @remove="handleRemove"
|
|
|
|
+ :max-count="1"
|
|
|
|
+ type="primary"
|
|
|
|
+ >
|
|
|
|
+ <a-button>
|
|
|
|
+ <upload-outlined></upload-outlined>
|
|
|
|
+ 选择文件
|
|
|
|
+ </a-button>
|
|
|
|
+ <a class="tw-ml-4 tw-align-bottom" @click.stop="downloadTemplate">
|
|
|
|
+ 下载导入模板
|
|
|
|
+ </a>
|
|
|
|
+ </a-upload>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-form>
|
|
</a-modal>
|
|
</a-modal>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -223,6 +271,8 @@ import { Form } from "ant-design-vue";
|
|
import { getSchoolListHttp } from "@/apis/school";
|
|
import { getSchoolListHttp } from "@/apis/school";
|
|
import type { UploadProps, TableColumnType } from "ant-design-vue";
|
|
import type { UploadProps, TableColumnType } from "ant-design-vue";
|
|
import { useMainStore } from "@/store/main";
|
|
import { useMainStore } from "@/store/main";
|
|
|
|
+import { throttle } from "lodash-es";
|
|
|
|
+import { ROLE } from "@/constants/dicts";
|
|
|
|
|
|
const mainStore = useMainStore();
|
|
const mainStore = useMainStore();
|
|
|
|
|
|
@@ -230,17 +280,36 @@ const showModal = ref(false);
|
|
const showResetPwdModal = ref(false);
|
|
const showResetPwdModal = ref(false);
|
|
const showImportModal = ref(false);
|
|
const showImportModal = ref(false);
|
|
|
|
|
|
-const fileList = ref<UploadProps["fileList"]>([]);
|
|
|
|
|
|
+const importUserForm = reactive<{
|
|
|
|
+ schoolId: string;
|
|
|
|
+ fileList: UploadProps["fileList"];
|
|
|
|
+ schoolTableData: MultiplePageData<SchoolListInfo>;
|
|
|
|
+}>({
|
|
|
|
+ schoolId: "",
|
|
|
|
+ fileList: [],
|
|
|
|
+ schoolTableData: { totalCount: 0, result: [] },
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+const importRules = {
|
|
|
|
+ schoolId: [{ required: true, message: "请选择学校" }],
|
|
|
|
+ fileList: [
|
|
|
|
+ { required: true, type: "array", len: 1, message: "请选择导入文件" },
|
|
|
|
+ ],
|
|
|
|
+};
|
|
|
|
|
|
-const userInfo = ref<EditUserInfo>({
|
|
|
|
|
|
+const userInfo = reactive<
|
|
|
|
+ EditUserInfo & { schoolTableData: MultiplePageData<SchoolListInfo> }
|
|
|
|
+>({
|
|
schoolId: "",
|
|
schoolId: "",
|
|
name: "",
|
|
name: "",
|
|
loginName: "",
|
|
loginName: "",
|
|
- role: void 0,
|
|
|
|
course: "",
|
|
course: "",
|
|
|
|
+ role: void 0,
|
|
|
|
+ id: void 0,
|
|
|
|
+ schoolTableData: { totalCount: 0, result: [] },
|
|
});
|
|
});
|
|
|
|
|
|
-const resetPwd = ref({
|
|
|
|
|
|
+const resetPwd = reactive({
|
|
passwd: "",
|
|
passwd: "",
|
|
userId: "",
|
|
userId: "",
|
|
});
|
|
});
|
|
@@ -276,12 +345,19 @@ const {
|
|
validate,
|
|
validate,
|
|
validateInfos,
|
|
validateInfos,
|
|
resetFields: resetUserFields,
|
|
resetFields: resetUserFields,
|
|
-} = Form.useForm(userInfo.value, userRules);
|
|
|
|
|
|
+} = Form.useForm(userInfo, userRules);
|
|
|
|
+
|
|
const {
|
|
const {
|
|
validate: validatePwd,
|
|
validate: validatePwd,
|
|
validateInfos: validatePwdInfos,
|
|
validateInfos: validatePwdInfos,
|
|
resetFields: resetPwdFields,
|
|
resetFields: resetPwdFields,
|
|
-} = Form.useForm(resetPwd.value, pwdRules);
|
|
|
|
|
|
+} = Form.useForm(resetPwd, pwdRules);
|
|
|
|
+
|
|
|
|
+const {
|
|
|
|
+ validate: validateImport,
|
|
|
|
+ validateInfos: validateImportInfos,
|
|
|
|
+ resetFields: resetImportFields,
|
|
|
|
+} = Form.useForm(importUserForm, importRules);
|
|
|
|
|
|
/** 请求参数 */
|
|
/** 请求参数 */
|
|
const query = reactive<FetchUserListQuery>({
|
|
const query = reactive<FetchUserListQuery>({
|
|
@@ -318,22 +394,41 @@ const schoolTableData = reactive<MultiplePageData<SchoolListInfo>>({
|
|
});
|
|
});
|
|
|
|
|
|
/** 查询学校列表 */
|
|
/** 查询学校列表 */
|
|
-const querySchoolList = async (name?: string) => {
|
|
|
|
- try {
|
|
|
|
- const { result = [], totalCount } = await getSchoolListHttp({
|
|
|
|
- name,
|
|
|
|
- pageNumber: 1,
|
|
|
|
- pageSize: 10,
|
|
|
|
- });
|
|
|
|
- Object.assign(schoolTableData, { result, totalCount });
|
|
|
|
- } catch (error) {
|
|
|
|
- console.error(error);
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
|
|
+const querySchoolList = throttle(
|
|
|
|
+ async (name: string = "", type: "list" | "form" | "import" = "list") => {
|
|
|
|
+ const isList = type === "list";
|
|
|
|
+ const isForm = type === "form";
|
|
|
|
+ try {
|
|
|
|
+ const { result = [], totalCount } = await getSchoolListHttp({
|
|
|
|
+ name,
|
|
|
|
+ pageNumber: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ });
|
|
|
|
+ Object.assign(
|
|
|
|
+ isList
|
|
|
|
+ ? schoolTableData
|
|
|
|
+ : isForm
|
|
|
|
+ ? userInfo.schoolTableData
|
|
|
|
+ : importUserForm.schoolTableData,
|
|
|
|
+ {
|
|
|
|
+ result,
|
|
|
|
+ totalCount,
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ } catch (error) {
|
|
|
|
+ return Promise.reject(error);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ 100
|
|
|
|
+);
|
|
|
|
|
|
/** 显示新增用户弹窗 */
|
|
/** 显示新增用户弹窗 */
|
|
const toggleAddUserModal = (show: boolean = true) => {
|
|
const toggleAddUserModal = (show: boolean = true) => {
|
|
showModal.value = show;
|
|
showModal.value = show;
|
|
|
|
+ if (show) {
|
|
|
|
+ Object.assign(userInfo, { schoolId: mainStore.systemUserInfo?.schoolId });
|
|
|
|
+ querySchoolList("", "form");
|
|
|
|
+ }
|
|
};
|
|
};
|
|
|
|
|
|
/** 查询用户列表 */
|
|
/** 查询用户列表 */
|
|
@@ -357,17 +452,20 @@ const updateUserStatus = (record: UserInfo) => {
|
|
|
|
|
|
/** 编辑用户 */
|
|
/** 编辑用户 */
|
|
const onEdit = (record: UserInfo) => {
|
|
const onEdit = (record: UserInfo) => {
|
|
- Object.assign(userInfo.value, {
|
|
|
|
- ...record,
|
|
|
|
|
|
+ Object.assign(userInfo, {
|
|
course: record.courseCodes?.join(","),
|
|
course: record.courseCodes?.join(","),
|
|
- role: `${record.roleId}` === "2" ? "SCHOOL_ADMIN" : "SECTION_LEADER",
|
|
|
|
|
|
+ id: record.id,
|
|
|
|
+ schoolId: record.schoolId,
|
|
|
|
+ name: record.name,
|
|
|
|
+ loginName: record.loginName,
|
|
|
|
+ role: record.role,
|
|
});
|
|
});
|
|
toggleAddUserModal(true);
|
|
toggleAddUserModal(true);
|
|
};
|
|
};
|
|
|
|
|
|
/** 重置密码 */
|
|
/** 重置密码 */
|
|
const onResetPwd = (record: UserInfo) => {
|
|
const onResetPwd = (record: UserInfo) => {
|
|
- Object.assign(resetPwd.value, { passwd: "", userId: `${record.id}` });
|
|
|
|
|
|
+ Object.assign(resetPwd, { passwd: "", userId: `${record.id}` });
|
|
showResetPwdModal.value = true;
|
|
showResetPwdModal.value = true;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -375,10 +473,15 @@ const onResetPwd = (record: UserInfo) => {
|
|
const onPutUser = () => {
|
|
const onPutUser = () => {
|
|
validate().then((valid) => {
|
|
validate().then((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- editUserInfoHttp(userInfo.value).then(() => {
|
|
|
|
- message.success(`${userInfo.value.id ? "修改" : "添加"}成功`);
|
|
|
|
- toggleAddUserModal(false);
|
|
|
|
|
|
+ const { role, course, schoolTableData, ...info } = userInfo;
|
|
|
|
+ editUserInfoHttp({
|
|
|
|
+ ...info,
|
|
|
|
+ role,
|
|
|
|
+ course: role === "SECTION_LEADER" ? course : "",
|
|
|
|
+ }).then(() => {
|
|
|
|
+ message.success(`${userInfo.id ? "修改" : "添加"}成功`);
|
|
queryUserList();
|
|
queryUserList();
|
|
|
|
+ toggleAddUserModal(false);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -386,49 +489,57 @@ const onPutUser = () => {
|
|
|
|
|
|
/** 导入用户 */
|
|
/** 导入用户 */
|
|
const importUserList = () => {
|
|
const importUserList = () => {
|
|
- if (!query.schoolId) {
|
|
|
|
- return message.error("请选择学校");
|
|
|
|
- }
|
|
|
|
showImportModal.value = true;
|
|
showImportModal.value = true;
|
|
|
|
+ Object.assign(importUserForm, {
|
|
|
|
+ schoolId: mainStore.systemUserInfo?.schoolId,
|
|
|
|
+ });
|
|
|
|
+ querySchoolList("", "import");
|
|
};
|
|
};
|
|
|
|
|
|
const handleRemove: UploadProps["onRemove"] = (file) => {
|
|
const handleRemove: UploadProps["onRemove"] = (file) => {
|
|
- const index = fileList.value!.indexOf(file);
|
|
|
|
- const newFileList = fileList.value!.slice();
|
|
|
|
|
|
+ const index = importUserForm.fileList!.indexOf(file);
|
|
|
|
+ const newFileList = importUserForm.fileList!.slice();
|
|
newFileList.splice(index, 1);
|
|
newFileList.splice(index, 1);
|
|
- fileList.value = newFileList;
|
|
|
|
|
|
+ importUserForm.fileList = newFileList;
|
|
};
|
|
};
|
|
|
|
|
|
const beforeUpload: UploadProps["beforeUpload"] = (file) => {
|
|
const beforeUpload: UploadProps["beforeUpload"] = (file) => {
|
|
- fileList.value = [file];
|
|
|
|
|
|
+ importUserForm.fileList = [file];
|
|
return false;
|
|
return false;
|
|
};
|
|
};
|
|
|
|
|
|
-const clearFileList = () => {
|
|
|
|
- fileList.value = [];
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-const downloadTemplate = () => {
|
|
|
|
- downloadImportUserHttp();
|
|
|
|
|
|
+/** 下载导入模板 */
|
|
|
|
+const downloadTemplate = async () => {
|
|
|
|
+ try {
|
|
|
|
+ await downloadImportUserHttp();
|
|
|
|
+ } catch (error) {
|
|
|
|
+ return Promise.reject(error);
|
|
|
|
+ }
|
|
};
|
|
};
|
|
|
|
|
|
-const onImportUserList = () => {
|
|
|
|
- if (!query.schoolId) {
|
|
|
|
- return;
|
|
|
|
|
|
+const onImportUserList = async () => {
|
|
|
|
+ try {
|
|
|
|
+ const valid = await validateImport();
|
|
|
|
+ if (valid) {
|
|
|
|
+ const formData = new FormData();
|
|
|
|
+ formData.append("schoolId", `${importUserForm.schoolId}`);
|
|
|
|
+ importUserForm.fileList?.forEach((file: any) => {
|
|
|
|
+ formData.append("file", file);
|
|
|
|
+ });
|
|
|
|
+ await importUserHttp(formData);
|
|
|
|
+ queryUserList();
|
|
|
|
+ showImportModal.value = false;
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ return Promise.reject(error);
|
|
}
|
|
}
|
|
- const formData = new FormData();
|
|
|
|
- formData.append("schoolId", `${query.schoolId}`);
|
|
|
|
- fileList.value?.forEach((file: any) => {
|
|
|
|
- formData.append("file", file);
|
|
|
|
- });
|
|
|
|
- importUserHttp(formData);
|
|
|
|
};
|
|
};
|
|
|
|
|
|
/** 修改密码 */
|
|
/** 修改密码 */
|
|
const onUpdateUserPwd = () => {
|
|
const onUpdateUserPwd = () => {
|
|
validatePwd().then((valid) => {
|
|
validatePwd().then((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- resetUserPwdHttp(resetPwd.value).then(() => {
|
|
|
|
|
|
+ resetUserPwdHttp(resetPwd).then(() => {
|
|
message.success(`重置成功`);
|
|
message.success(`重置成功`);
|
|
showResetPwdModal.value = false;
|
|
showResetPwdModal.value = false;
|
|
});
|
|
});
|