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