staging #40
|
|
@ -2,6 +2,52 @@ import { ComboModel } from "@/components/hTable/hTable";
|
|||
import { http } from "@/utils/http";
|
||||
import type { Res, ResPage } from "@/utils/http/types";
|
||||
import { Ref } from "vue";
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description 转班学生导入
|
||||
* @return {void}
|
||||
*/
|
||||
export function ImportTransferStudent(file) {
|
||||
let formData = new FormData();
|
||||
formData.append("file", file);
|
||||
return http.request<Res<any>>(
|
||||
"post",
|
||||
`userCenter/back/users/importtransferstudent`,
|
||||
{
|
||||
data: formData
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
},
|
||||
responseType: "blob"
|
||||
}
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @description 退班学生导入
|
||||
* @return {void}
|
||||
*/
|
||||
export function ImportStudentOut(file: any) {
|
||||
let formData = new FormData();
|
||||
formData.append("file", file);
|
||||
return http.request<Res<any>>(
|
||||
"post",
|
||||
`userCenter/back/users/importstudentout`,
|
||||
{
|
||||
data: formData
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
},
|
||||
responseType: "blob"
|
||||
}
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @description 获取枚举下拉
|
||||
* @param {string} type 枚举类型 type=StatusEnum
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-show="search.schoolId" style="width: 145px">
|
||||
<el-form-item v-show="search.schoolId" :style="{ width: '145px' }">
|
||||
<el-select
|
||||
v-model="search.grade"
|
||||
placeholder="年级"
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-show="search.schoolId" style="width: 100px">
|
||||
<el-form-item v-show="search.schoolId" :style="{ width: '100px' }">
|
||||
<el-select v-model="search.classId" placeholder="班级" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in classList"
|
||||
|
|
@ -63,16 +63,35 @@
|
|||
</div>
|
||||
<div v-show="!selectUser" class="toolbar-container">
|
||||
<!-- 按钮组 -->
|
||||
<el-button type="success" @click="importData(ImportStudent)">导入用户</el-button>
|
||||
<el-button type="default" @click="downLoadImportUsersTemplate"
|
||||
>下载学生模板</el-button
|
||||
>
|
||||
<!-- <el-button title="根据当前筛选条件导出" type="primary" @click="exportUser"
|
||||
>导出用户</el-button
|
||||
> -->
|
||||
<el-button type="success" @click="importUpdateStudent"
|
||||
>使用Excel模板更新用户</el-button
|
||||
>
|
||||
<el-button-group style="padding-right: 1rem">
|
||||
<el-button type="success" @click="importData(ImportStudent)">新增学生</el-button>
|
||||
<el-button type="primary" @click="importUpdateStudent">更新学生</el-button>
|
||||
<el-button
|
||||
title="模板"
|
||||
:icon="Tickets"
|
||||
type="default"
|
||||
@click="downLoadImportUsersTemplate"
|
||||
>模板</el-button
|
||||
>
|
||||
</el-button-group>
|
||||
|
||||
<el-button-group style="padding-right: 1rem">
|
||||
<el-button type="success" @click="importData(ImportTransferStudent)"
|
||||
>批量转班学生</el-button
|
||||
>
|
||||
<el-button title="模板" :icon="Tickets" type="default" @click="下载转班模板()"
|
||||
>模板</el-button
|
||||
>
|
||||
</el-button-group>
|
||||
|
||||
<el-button-group>
|
||||
<el-button type="success" @click="importData(ImportStudentOut)"
|
||||
>批量退班</el-button
|
||||
>
|
||||
<el-button title="模板" :icon="Tickets" type="default" @click="下载退班模板()"
|
||||
>模板</el-button
|
||||
>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<div v-show="!selectUser" class="toolbar-container">
|
||||
<!-- 按钮组 -->
|
||||
|
|
@ -81,9 +100,9 @@
|
|||
<el-table
|
||||
ref="selectUserTable"
|
||||
:data="table.data"
|
||||
style="width: 100%"
|
||||
:max-height="maxTableHeight"
|
||||
@row-dblclick="setCurrent"
|
||||
:style="{ width: '100%' }"
|
||||
@row-click="selectUserClick"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
|
|
@ -151,7 +170,7 @@
|
|||
<el-table-column prop="remark" label="备注" />
|
||||
</el-table>
|
||||
<el-pagination
|
||||
style="display: flex; justify-content: center; padding-top: 10px"
|
||||
:style="{ display: 'flex', justifyContent: 'center', paddingTop: '10px' }"
|
||||
:current-page="pagination.now"
|
||||
:page-sizes="[10, 20, 40, 80, 100]"
|
||||
:page-size="pagination.size"
|
||||
|
|
@ -178,6 +197,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ImportTransferStudent, ImportStudentOut } from "@/api/userCenter";
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import type { UploadProps } from "element-plus";
|
||||
|
|
@ -201,6 +221,7 @@ import {
|
|||
Message,
|
||||
ArrowDownBold,
|
||||
Search,
|
||||
Tickets,
|
||||
Star,
|
||||
} from "@element-plus/icons-vue";
|
||||
import { ComboModel, gradeComboModel } from "@/components/hTable/hTable";
|
||||
|
|
@ -741,6 +762,22 @@ const readerBlob = (data: Blob): Promise<any> => {
|
|||
};
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 退班模板
|
||||
*/
|
||||
const 下载退班模板 = () => {
|
||||
let impUrl =
|
||||
import.meta.env.VITE_API_USERCENTER_URL + "/back/users/dwstudentoutinfotemplate";
|
||||
window.open(impUrl, "_blank");
|
||||
};
|
||||
/**
|
||||
* 转班模板
|
||||
*/
|
||||
const 下载转班模板 = () => {
|
||||
let impUrl =
|
||||
import.meta.env.VITE_API_USERCENTER_URL + "/back/users/dwtransferuserinfotemplate";
|
||||
window.open(impUrl, "_blank");
|
||||
};
|
||||
|
||||
const downLoadImportUsersTemplate = () => {
|
||||
let impUrl = import.meta.env.VITE_API_BASEURL + "/Student/DwImportTemplate";
|
||||
|
|
|
|||
|
|
@ -109,13 +109,17 @@
|
|||
</div>
|
||||
<div v-show="!selectUser" class="toolbar-container">
|
||||
<!-- 按钮组 -->
|
||||
<el-button type="success" @click="importData">导入用户</el-button>
|
||||
<el-button type="default" @click="downLoadImportUsersTemplate"
|
||||
>下载导入用户模板</el-button
|
||||
>
|
||||
<!-- <el-button title="根据当前筛选条件导出" type="primary" @click="exportUser"
|
||||
>导出用户</el-button
|
||||
> -->
|
||||
|
||||
<el-button-group style="padding-right: 1rem">
|
||||
<el-button
|
||||
title="模板"
|
||||
:icon="Tickets"
|
||||
type="default"
|
||||
@click="downLoadImportUsersTemplate"
|
||||
>模板</el-button
|
||||
>
|
||||
<el-button type="success" @click="importData">导入用户</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<div v-show="!selectUser" class="toolbar-container">
|
||||
<!-- 按钮组 -->
|
||||
|
|
@ -124,7 +128,7 @@
|
|||
<el-table
|
||||
ref="selectUserTable"
|
||||
:data="table.data"
|
||||
style="width: 100%"
|
||||
:style="{ width: '100%' }"
|
||||
:max-height="maxTableHeight"
|
||||
@row-dblclick="setCurrent"
|
||||
@row-click="selectUserClick"
|
||||
|
|
@ -247,6 +251,7 @@ import {
|
|||
Message,
|
||||
ArrowDownBold,
|
||||
Search,
|
||||
Tickets,
|
||||
Star,
|
||||
Phone,
|
||||
} from "@element-plus/icons-vue";
|
||||
|
|
|
|||
Loading…
Reference in New Issue