|
|
@@ -16,6 +16,7 @@
|
|
|
<el-tree
|
|
|
:data="dataSource"
|
|
|
node-key="id"
|
|
|
+ :default-expanded-keys="[2, 3, 16]"
|
|
|
:expand-on-click-node="false"
|
|
|
>
|
|
|
<template #default="{ node, data }">
|
|
|
@@ -93,7 +94,7 @@
|
|
|
type="primary"
|
|
|
color="rgba(0, 97, 255, 1)"
|
|
|
@click="addMemberClick"
|
|
|
- :disabled="isManage!=1"
|
|
|
+ :disabled="isManage != 1"
|
|
|
plain
|
|
|
>添加成员</el-button
|
|
|
>
|
|
|
@@ -101,21 +102,25 @@
|
|
|
type="primary"
|
|
|
color="rgba(0, 97, 255, 1)"
|
|
|
@click="moveMemberClick"
|
|
|
- :disabled="isManage!=1"
|
|
|
+ :disabled="isManage != 1"
|
|
|
plain
|
|
|
>移动成员</el-button
|
|
|
>
|
|
|
|
|
|
- <el-dropdown >
|
|
|
+ <el-dropdown>
|
|
|
<el-button color="rgba(0, 97, 255, 1)" plain>批量操作</el-button>
|
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
|
- <el-dropdown-item :disabled="isManage!=1" @click="addBatchClick"
|
|
|
+ <el-dropdown-item
|
|
|
+ :disabled="isManage != 1"
|
|
|
+ @click="addBatchClick"
|
|
|
>批量导入</el-dropdown-item
|
|
|
>
|
|
|
- <!-- <el-dropdown-item @click="delBatchClick"
|
|
|
- >批量删除</el-dropdown-item
|
|
|
- > -->
|
|
|
+ <el-dropdown-item
|
|
|
+ :disabled="isManage != 1"
|
|
|
+ @click="updateBatchClick"
|
|
|
+ >批量更新</el-dropdown-item
|
|
|
+ >
|
|
|
</el-dropdown-menu>
|
|
|
</template>
|
|
|
</el-dropdown>
|
|
|
@@ -130,7 +135,7 @@
|
|
|
type="primary"
|
|
|
color="rgba(0, 97, 255, 1)"
|
|
|
@click="delDelClick"
|
|
|
- :disabled="isManage!=1"
|
|
|
+ :disabled="isManage != 1"
|
|
|
plain
|
|
|
>勾选删除</el-button
|
|
|
>
|
|
|
@@ -144,7 +149,7 @@
|
|
|
type="primary"
|
|
|
color="rgba(0, 97, 255, 1)"
|
|
|
@click="importExcel"
|
|
|
- :disabled="isManage!=1"
|
|
|
+ :disabled="isManage != 1"
|
|
|
plain
|
|
|
>导出用户</el-button
|
|
|
>
|
|
|
@@ -153,7 +158,7 @@
|
|
|
type="primary"
|
|
|
color="rgba(0, 97, 255, 1)"
|
|
|
@click="DelRecordClick"
|
|
|
- :disabled="isManage!=1"
|
|
|
+ :disabled="isManage != 1"
|
|
|
plain
|
|
|
>删除记录</el-button
|
|
|
>
|
|
|
@@ -177,14 +182,19 @@
|
|
|
<el-table-column align="center" prop="department" label="部门" />
|
|
|
<el-table-column align="center" prop="cardNo" label="学号" />
|
|
|
<el-table-column align="center" prop="img" label="人脸照片">
|
|
|
- <template #default="{ row }" >
|
|
|
+ <template #default="{ row }">
|
|
|
<div class="img">
|
|
|
- <img @click="imgClick(row)" :src="row.headImage" alt="" />
|
|
|
+ <img
|
|
|
+ v-if="row.headImage"
|
|
|
+ @click="imgClick(row)"
|
|
|
+ :src="row.headImage"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="操作" width="200">
|
|
|
- <template #default="scope" v-if="isManage==1">
|
|
|
+ <template #default="scope" v-if="isManage == 1">
|
|
|
<div class="edit">
|
|
|
<div class="look" @click="editClick(scope.row)">编辑</div>
|
|
|
</div>
|
|
|
@@ -231,7 +241,10 @@
|
|
|
<img src="@/assets/images/basicInfo.png" alt="" />
|
|
|
<span>基本信息</span>
|
|
|
</div>
|
|
|
- <el-form-item label="学号 :" :prop="addMemberRuleForm.identity == 1? '': 'serialNumber'">
|
|
|
+ <el-form-item
|
|
|
+ label="学号 :"
|
|
|
+ :prop="addMemberRuleForm.identity == 1 ? '' : 'serialNumber'"
|
|
|
+ >
|
|
|
<el-input
|
|
|
:disabled="addMemberTitle == '编辑成员' ? true : false"
|
|
|
v-model="addMemberRuleForm.serialNumber"
|
|
|
@@ -289,7 +302,10 @@
|
|
|
|
|
|
</el-tooltip> -->
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="身份证号 :" :prop="addMemberRuleForm.identity == 1? '': 'icCard'">
|
|
|
+ <el-form-item
|
|
|
+ label="身份证号 :"
|
|
|
+ :prop="addMemberRuleForm.identity == 1 ? '' : 'icCard'"
|
|
|
+ >
|
|
|
<el-input
|
|
|
v-model="addMemberRuleForm.icCard"
|
|
|
placeholder="请输入身份证号"
|
|
|
@@ -324,7 +340,10 @@
|
|
|
clearable
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="人脸照片 :" :prop="addMemberRuleForm.identity == 1 ? '' : 'facePhoto'">
|
|
|
+ <el-form-item
|
|
|
+ label="人脸照片 :"
|
|
|
+ :prop="addMemberRuleForm.identity == 1 ? '' : 'facePhoto'"
|
|
|
+ >
|
|
|
<div class="facePhoto">
|
|
|
<div v-if="addMemberRuleForm.facePhoto">
|
|
|
<img
|
|
|
@@ -406,8 +425,7 @@
|
|
|
<el-form-item
|
|
|
v-if="addMemberRuleForm.identity != 3"
|
|
|
label="时间组 :"
|
|
|
- :prop="
|
|
|
- addMemberRuleForm.identity == 1? '': 'timeGroupId'"
|
|
|
+ :prop="addMemberRuleForm.identity == 1 ? '' : 'timeGroupId'"
|
|
|
>
|
|
|
<el-select
|
|
|
v-model="addMemberRuleForm.timeGroupId"
|
|
|
@@ -593,16 +611,19 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 批量添加 -->
|
|
|
- <div class="addMember" v-if="addBatchShow">
|
|
|
+ <div
|
|
|
+ class="addMember"
|
|
|
+ v-if="addBatchShow"
|
|
|
+ v-loading="startImprot"
|
|
|
+ element-loading-text="人员信息导入中..."
|
|
|
+ >
|
|
|
<div class="left">
|
|
|
<img src="@/assets/images/close.png" alt="" @click="addBatchConcel" />
|
|
|
<span class="add">批量添加</span>
|
|
|
</div>
|
|
|
<div class="content">
|
|
|
<div class="form">
|
|
|
- <div
|
|
|
- class="imgUpload"
|
|
|
- >
|
|
|
+ <div class="imgUpload">
|
|
|
<el-upload
|
|
|
style="width: 500px"
|
|
|
class="upload-demo"
|
|
|
@@ -630,8 +651,8 @@
|
|
|
</template> -->
|
|
|
</el-upload>
|
|
|
<el-upload
|
|
|
- v-loading="imgLoading"
|
|
|
- element-loading-text="图片导入中..."
|
|
|
+ v-loading="imgLoading"
|
|
|
+ element-loading-text="图片导入中..."
|
|
|
style="width: 500px"
|
|
|
class="img-upload-demo"
|
|
|
drag
|
|
|
@@ -666,15 +687,31 @@
|
|
|
/> -->
|
|
|
<div class="startImport">
|
|
|
<el-button
|
|
|
-
|
|
|
+ v-if="!imgLoading && upload2File && uploadImgList"
|
|
|
type="primary"
|
|
|
color="rgba(0, 97, 255, 1)"
|
|
|
@click="bulkImport"
|
|
|
plain
|
|
|
- :disabled="allImgShow"
|
|
|
>开始导入</el-button
|
|
|
>
|
|
|
<span
|
|
|
+ v-else
|
|
|
+ type="primary"
|
|
|
+ color="rgba(236, 245, 255, 1)"
|
|
|
+ style="
|
|
|
+ display: inline-block;
|
|
|
+ width: 500px;
|
|
|
+ height: 42px;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 42px;
|
|
|
+ color: rgb(160, 207, 255);
|
|
|
+ border: 1px solid #dcdfe6;
|
|
|
+ border-radius: 4px;
|
|
|
+ "
|
|
|
+ plain
|
|
|
+ >开始导入</span
|
|
|
+ >
|
|
|
+ <span
|
|
|
style="
|
|
|
width: 120px;
|
|
|
margin-left: 20px;
|
|
|
@@ -684,7 +721,12 @@
|
|
|
@click="resetImport"
|
|
|
>重置</span
|
|
|
>
|
|
|
- <span class="downLoad" @click="downLoadtempAdd">下载模板</span>
|
|
|
+ <span class="downLoad" @click="downLoadtempAdd(1)"
|
|
|
+ >下载学生模板</span
|
|
|
+ >
|
|
|
+ <span class="downLoad" @click="downLoadtempAdd(2)"
|
|
|
+ >下载教师模板</span
|
|
|
+ >
|
|
|
</div>
|
|
|
<!-- <div class="tableTitle">导入历史</div>
|
|
|
<div class="footer">
|
|
|
@@ -745,6 +787,97 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <!-- 批量更新 -->
|
|
|
+ <div
|
|
|
+ class="addMember"
|
|
|
+ v-if="updateBatchShow"
|
|
|
+ v-loading="startUpdate"
|
|
|
+ element-loading-text="人员信息更新中..."
|
|
|
+ >
|
|
|
+ <div class="left">
|
|
|
+ <img
|
|
|
+ src="@/assets/images/close.png"
|
|
|
+ alt=""
|
|
|
+ @click="updateBatchConcel"
|
|
|
+ />
|
|
|
+ <span class="add">批量更新</span>
|
|
|
+ </div>
|
|
|
+ <div class="content">
|
|
|
+ <div class="form">
|
|
|
+ <div class="imgUpload">
|
|
|
+ <el-upload
|
|
|
+ style="width: 500px"
|
|
|
+ class="upload-demo"
|
|
|
+ ref="batchUpload"
|
|
|
+ drag
|
|
|
+ action="#"
|
|
|
+ :on-preview="handlePreviewUpdate"
|
|
|
+ :on-remove="handleRemoveUpdate"
|
|
|
+ :on-change="handleChangeUpdate"
|
|
|
+ :http-request="handleUploadUpdate"
|
|
|
+ :before-upload="beforeAvatarUploadUpdate"
|
|
|
+ :limit="1"
|
|
|
+ :on-exceed="handleExceedUpdate"
|
|
|
+ >
|
|
|
+ <el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
|
|
+ <div class="el-upload__text">
|
|
|
+ <span style="font-size: 20px">点击上传或拖拽文件</span><br />
|
|
|
+ <em>请按照标准模板填写信息</em><br />
|
|
|
+ <em> </em>
|
|
|
+ </div>
|
|
|
+ <!-- <template #tip>
|
|
|
+ <div class="el-upload__tip">
|
|
|
+ jpg/png files with a size less than 500kb
|
|
|
+ </div>
|
|
|
+ </template> -->
|
|
|
+ </el-upload>
|
|
|
+ <!-- <el-upload
|
|
|
+ v-loading="imgLoading"
|
|
|
+ element-loading-text="图片导入中..."
|
|
|
+ style="width: 500px"
|
|
|
+ class="img-upload-demo"
|
|
|
+ drag
|
|
|
+ action="#"
|
|
|
+ multiple
|
|
|
+ ref="allImgUpload"
|
|
|
+ :on-preview="handlePreviewImgUpload"
|
|
|
+ :on-remove="handleRemoveImgUpload"
|
|
|
+ :on-change="handleChangeImgUpload"
|
|
|
+ :http-request="handleUploadImgUpload"
|
|
|
+ :before-upload="beforeAvatarUploadImgUpload"
|
|
|
+ :on-success="handleSuccessImgUpload"
|
|
|
+ >
|
|
|
+ <el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
|
|
+ <div class="el-upload__text">
|
|
|
+ <span style="font-size: 20px">点击上传图片文件夹</span><br />
|
|
|
+ <em> 图片格式为jpeg/jpg/png格式且每张图片不能超过2MB </em><br />
|
|
|
+ <em> 上传文件夹中照片不要超过1000张 </em>
|
|
|
+ </div>
|
|
|
+ </el-upload> -->
|
|
|
+ </div>
|
|
|
+ <div class="startImport">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ color="rgba(0, 97, 255, 1)"
|
|
|
+ @click="bulkUpdateImport"
|
|
|
+ plain
|
|
|
+ >开始更新</el-button
|
|
|
+ >
|
|
|
+ <!-- <span
|
|
|
+ style="
|
|
|
+ width: 120px;
|
|
|
+ margin-left: 20px;
|
|
|
+ cursor: pointer;
|
|
|
+ color: rgba(0, 97, 255, 1);
|
|
|
+ "
|
|
|
+ @click="resetImport"
|
|
|
+ >重置</span
|
|
|
+ > -->
|
|
|
+ <span class="downLoad" @click="downLoadtempUpdate">下载模板</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<!-- 删除记录页面 -->
|
|
|
<div class="delRecord" v-if="delRecordShow">
|
|
|
<div class="left">
|
|
|
@@ -1250,7 +1383,7 @@ const dataSource = ref([
|
|
|
// 被点击的树形节点 id
|
|
|
const treeNodeId = ref();
|
|
|
const treeNodeName = ref();
|
|
|
-const isManage=ref()// 判断当前节点是否是编辑权限
|
|
|
+const isManage = ref(); // 判断当前节点是否是编辑权限
|
|
|
|
|
|
// 主页面数据(----------------------------------------------)
|
|
|
// 表格数据
|
|
|
@@ -1451,11 +1584,19 @@ const addBatch_pageSize = ref(7);
|
|
|
const addBatch_total = ref(8); // 当前总数
|
|
|
const upload2 = ref(); // ref 导入文件ref
|
|
|
const allImgUpload = ref(); // ref 导入图片ref
|
|
|
-const allImgShow = ref(true) // 导入时判断图片和文件是否都有
|
|
|
-const imgLoading=ref(false)// 导入时判断图片全部导入成功
|
|
|
+
|
|
|
+const imgLoading = ref(false); // 导入时判断图片全部导入成功
|
|
|
+const startImprot = ref(false); // 开始导入时全屏加载
|
|
|
+
|
|
|
const upload2File = ref(); // 批量导入的文件
|
|
|
const uploadImgList = ref(); // 批量导入的图片列表
|
|
|
|
|
|
+// 批量更新 (-----------------------------------------)
|
|
|
+const updateBatchShow = ref(false);
|
|
|
+const batchUpload = ref(); // ref 更新文件ref
|
|
|
+const startUpdate = ref(false); // 开始更新时全屏加载
|
|
|
+const batchUpdateFile = ref(); // 批量更新的文件
|
|
|
+
|
|
|
// 批量删除(--------------------------------------------)
|
|
|
const delBatchShow = ref(false);
|
|
|
const delBatchData = reactive({
|
|
|
@@ -1542,6 +1683,7 @@ const getList = async () => {
|
|
|
departmentId: treeNodeId.value,
|
|
|
name: searchInput.keyWord,
|
|
|
};
|
|
|
+ // api.value='/smartApi'
|
|
|
let res = await axios({
|
|
|
method: "get",
|
|
|
url: api.value + "/wanzai/api/smartUser/queryPageSmartUser",
|
|
|
@@ -1591,9 +1733,9 @@ const getDepartment = async () => {
|
|
|
loading.value = false;
|
|
|
if (treeNodeId.value && treeNodeName.value) {
|
|
|
} else {
|
|
|
- treeNodeId.value = JSON.parse(eds.decryptDes(res.data.data))[0].id;
|
|
|
- treeNodeName.value = JSON.parse(eds.decryptDes(res.data.data))[0].name;
|
|
|
- isManage.value=JSON.parse(eds.decryptDes(res.data.data))[0].isManage
|
|
|
+ treeNodeId.value = JSON.parse(eds.decryptDes(res.data.data))[0].id;
|
|
|
+ treeNodeName.value = JSON.parse(eds.decryptDes(res.data.data))[0].name;
|
|
|
+ isManage.value = JSON.parse(eds.decryptDes(res.data.data))[0].isManage;
|
|
|
getList();
|
|
|
}
|
|
|
dataSource.value = JSON.parse(eds.decryptDes(res.data.data));
|
|
|
@@ -1617,7 +1759,7 @@ const getDepartment = async () => {
|
|
|
const nodeClick = (node, data) => {
|
|
|
treeNodeId.value = data.id;
|
|
|
treeNodeName.value = data.name;
|
|
|
- isManage.value=data.isManage
|
|
|
+ isManage.value = data.isManage;
|
|
|
getList();
|
|
|
console.log(data);
|
|
|
};
|
|
|
@@ -2283,7 +2425,6 @@ const addBatchClick = () => {
|
|
|
addBatchShow.value = true;
|
|
|
homeShow.value = false;
|
|
|
delRecordShow.value = false;
|
|
|
- allImgShow.value=true // 将开始导入按钮禁用
|
|
|
nextTick(() => {
|
|
|
const Ele = document.querySelector(".img-upload-demo .el-upload__input");
|
|
|
Ele["webkitdirectory"] = true;
|
|
|
@@ -2295,55 +2436,63 @@ const addBatchConcel = () => {
|
|
|
delRecordShow.value = false;
|
|
|
upload2File.value = "";
|
|
|
uploadImgList.value = "";
|
|
|
- allImgShow.value=true
|
|
|
allImgUpload.value.clearFiles();
|
|
|
upload2.value.clearFiles();
|
|
|
};
|
|
|
|
|
|
-// 打开删除记录页面
|
|
|
-const DelRecordClick = async () => {
|
|
|
- delRecordShow.value = true;
|
|
|
- delBatchShow.value = false;
|
|
|
+// 批量更新 (------------------------------------------------------)
|
|
|
+const updateBatchClick = () => {
|
|
|
homeShow.value = false;
|
|
|
- addMemberTitle.value = "删除记录";
|
|
|
- let data = {
|
|
|
- currentPage: delRecordCurrentPage.value,
|
|
|
- pageCount: delRecordPageSize.value,
|
|
|
- };
|
|
|
- let res = await axios({
|
|
|
- method: "get",
|
|
|
- url: api.value + "/wanzai/api/smartUser/queryUserDeletePage",
|
|
|
- headers: {
|
|
|
- token: sessionStorage.getItem("token"),
|
|
|
- user_head: sessionStorage.getItem("userhead"),
|
|
|
- },
|
|
|
- params: data,
|
|
|
- });
|
|
|
- console.log(res, JSON.parse(eds.decryptDes(res.data.data)), "删除记录分页");
|
|
|
- if (res.data.code == 200) {
|
|
|
- delRecordDatas.value = JSON.parse(eds.decryptDes(res.data.data)).list;
|
|
|
- delRecordTotal.value = JSON.parse(eds.decryptDes(res.data.data)).totalCount;
|
|
|
- } else {
|
|
|
- ElMessage({
|
|
|
- type: "error",
|
|
|
- showClose: true,
|
|
|
- message: res.data.message,
|
|
|
- center: true,
|
|
|
- });
|
|
|
- }
|
|
|
-};
|
|
|
-// 关闭删除记录页面
|
|
|
-const delRecordClose = () => {
|
|
|
+ updateBatchShow.value = true;
|
|
|
delRecordShow.value = false;
|
|
|
- delBatchShow.value = false;
|
|
|
+};
|
|
|
+const updateBatchConcel = () => {
|
|
|
+ updateBatchShow.value = false;
|
|
|
homeShow.value = true;
|
|
|
+ delRecordShow.value = false;
|
|
|
+ batchUpdateFile.value = "";
|
|
|
+ batchUpload.value.clearFiles();
|
|
|
};
|
|
|
-
|
|
|
-// 批量导入模板下载
|
|
|
-const downLoadtempAdd = async () => {
|
|
|
+// 添加文件信息
|
|
|
+const handleChangeUpdate = async (file, fileLists) => {
|
|
|
+ console.log(file, "1111");
|
|
|
+ batchUpdateFile.value = file.raw;
|
|
|
+};
|
|
|
+// 可以获取文件参数
|
|
|
+const handleUploadUpdate = async (file) => {
|
|
|
+ console.log(file, "22222222");
|
|
|
+};
|
|
|
+// 上传文件时覆盖上一个文件
|
|
|
+const handleExceedUpdate = (files) => {
|
|
|
+ batchUpload.value.clearFiles();
|
|
|
+ const file = files[0];
|
|
|
+ file.uid = genFileId();
|
|
|
+ batchUpload.value.handleStart(file);
|
|
|
+};
|
|
|
+// 移出文件
|
|
|
+const handleRemoveUpdate = (uploadFile, uploadFiles) => {
|
|
|
+ batchUpdateFile.value = "";
|
|
|
+};
|
|
|
+// 更新时限制上传文件的大小
|
|
|
+const beforeAvatarUploadUpdate = (rawFile) => {
|
|
|
+ console.log(rawFile.type, "文件类型");
|
|
|
+ if (
|
|
|
+ rawFile.type !==
|
|
|
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
|
+ ) {
|
|
|
+ ElMessage.error("文件格式必须为xlsx格式!");
|
|
|
+ return false;
|
|
|
+ } else if (rawFile.size / 1024 / 1024 > 100) {
|
|
|
+ ElMessage.error("文件的大小不能超过100MB!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+};
|
|
|
+// 批量更新模板下载
|
|
|
+const downLoadtempUpdate = async () => {
|
|
|
let res = await axios({
|
|
|
method: "get",
|
|
|
- url: api.value + "/wanzai/api/smartUser/downloadUserExcel",
|
|
|
+ url: api.value + "/wanzai/api/smartUser/downloadUpdateUserExcel",
|
|
|
headers: {
|
|
|
token: sessionStorage.getItem("token"),
|
|
|
user_head: sessionStorage.getItem("userhead"),
|
|
|
@@ -2353,7 +2502,7 @@ const downLoadtempAdd = async () => {
|
|
|
console.log(
|
|
|
res,
|
|
|
JSON.parse(eds.decryptDes(res.data.data)),
|
|
|
- "批量导入模板下载"
|
|
|
+ "批量更新模板下载"
|
|
|
);
|
|
|
|
|
|
if (res.data.code == 200) {
|
|
|
@@ -2383,6 +2532,173 @@ const downLoadtempAdd = async () => {
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
+// 开始批量更新按钮
|
|
|
+const bulkUpdateImport = async () => {
|
|
|
+ startUpdate.value = true;
|
|
|
+ console.log(batchUpdateFile.value, "更新文件");
|
|
|
+
|
|
|
+ const formData = new FormData();
|
|
|
+ formData.append("file", batchUpdateFile.value);
|
|
|
+
|
|
|
+ let res = await axios({
|
|
|
+ method: "post",
|
|
|
+ url: api.value + "/wanzai/api/smartUser/importExcelUpdateUsers",
|
|
|
+ headers: {
|
|
|
+ token: sessionStorage.getItem("token"),
|
|
|
+ user_head: sessionStorage.getItem("userhead"),
|
|
|
+ },
|
|
|
+ data: formData,
|
|
|
+ });
|
|
|
+ console.log(res, "确定批量更新");
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ getList();
|
|
|
+ batchUpdateFile.value = "";
|
|
|
+ batchUpload.value.clearFiles();
|
|
|
+ startUpdate.value = false;
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ startUpdate.value = false;
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 打开删除记录页面 (--------------------------------------------------)
|
|
|
+const DelRecordClick = async () => {
|
|
|
+ delRecordShow.value = true;
|
|
|
+ delBatchShow.value = false;
|
|
|
+ homeShow.value = false;
|
|
|
+ addMemberTitle.value = "删除记录";
|
|
|
+ let data = {
|
|
|
+ currentPage: delRecordCurrentPage.value,
|
|
|
+ pageCount: delRecordPageSize.value,
|
|
|
+ };
|
|
|
+ let res = await axios({
|
|
|
+ method: "get",
|
|
|
+ url: api.value + "/wanzai/api/smartUser/queryUserDeletePage",
|
|
|
+ headers: {
|
|
|
+ token: sessionStorage.getItem("token"),
|
|
|
+ user_head: sessionStorage.getItem("userhead"),
|
|
|
+ },
|
|
|
+ params: data,
|
|
|
+ });
|
|
|
+ console.log(res, JSON.parse(eds.decryptDes(res.data.data)), "删除记录分页");
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ delRecordDatas.value = JSON.parse(eds.decryptDes(res.data.data)).list;
|
|
|
+ delRecordTotal.value = JSON.parse(eds.decryptDes(res.data.data)).totalCount;
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+// 关闭删除记录页面
|
|
|
+const delRecordClose = () => {
|
|
|
+ delRecordShow.value = false;
|
|
|
+ delBatchShow.value = false;
|
|
|
+ homeShow.value = true;
|
|
|
+};
|
|
|
+
|
|
|
+// 批量导入模板下载 (-------------------------------------------------)
|
|
|
+const downLoadtempAdd = async (flag) => {
|
|
|
+ if (flag == 1) {
|
|
|
+ let res = await axios({
|
|
|
+ method: "get",
|
|
|
+ url: api.value + "/wanzai/api/smartUser/downloadUserExcel",
|
|
|
+ headers: {
|
|
|
+ token: sessionStorage.getItem("token"),
|
|
|
+ user_head: sessionStorage.getItem("userhead"),
|
|
|
+ },
|
|
|
+ // params: data,
|
|
|
+ });
|
|
|
+ console.log(
|
|
|
+ res,
|
|
|
+ JSON.parse(eds.decryptDes(res.data.data)),
|
|
|
+ "批量导入学生模板下载"
|
|
|
+ );
|
|
|
+
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ var downloadPath = JSON.parse(eds.decryptDes(res.data.data));
|
|
|
+ // window.open(downloadPath);
|
|
|
+ window.location.href = downloadPath;
|
|
|
+ var downloadLink = document.createElement("a");
|
|
|
+ downloadLink.style.display = "none"; // 使其隐藏
|
|
|
+ downloadLink.href = downloadPath;
|
|
|
+ downloadLink.download = "";
|
|
|
+ downloadLink.click();
|
|
|
+ document.body.appendChild(downloadLink);
|
|
|
+ document.body.removeChild(downloadLink);
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ loading.value = false;
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let res = await axios({
|
|
|
+ method: "get",
|
|
|
+ url: api.value + "/wanzai/api/smartUser/downloadTeacherExcel",
|
|
|
+ headers: {
|
|
|
+ token: sessionStorage.getItem("token"),
|
|
|
+ user_head: sessionStorage.getItem("userhead"),
|
|
|
+ },
|
|
|
+ // params: data,
|
|
|
+ });
|
|
|
+ console.log(
|
|
|
+ res,
|
|
|
+ JSON.parse(eds.decryptDes(res.data.data)),
|
|
|
+ "批量导入教师模板下载"
|
|
|
+ );
|
|
|
+
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ var downloadPath = JSON.parse(eds.decryptDes(res.data.data));
|
|
|
+ // window.open(downloadPath);
|
|
|
+ window.location.href = downloadPath;
|
|
|
+ var downloadLink = document.createElement("a");
|
|
|
+ downloadLink.style.display = "none"; // 使其隐藏
|
|
|
+ downloadLink.href = downloadPath;
|
|
|
+ downloadLink.download = "";
|
|
|
+ downloadLink.click();
|
|
|
+ document.body.appendChild(downloadLink);
|
|
|
+ document.body.removeChild(downloadLink);
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ loading.value = false;
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
// 移出照片
|
|
|
const handleRemove2 = (uploadFile, uploadFiles) => {
|
|
|
// console.log(uploadFile.uid, uploadFiles);
|
|
|
@@ -2524,20 +2840,18 @@ const handleUploadImgUpload = async (file) => {
|
|
|
uploadImgList.value =
|
|
|
uploadImgList.value + "," + "https://" + data.Location;
|
|
|
// 成功
|
|
|
- successAllImg()
|
|
|
+ successAllImg();
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
};
|
|
|
-const successAllImg=()=>{
|
|
|
- imgLoading.value=true
|
|
|
- allImgShow.value=true
|
|
|
+const successAllImg = () => {
|
|
|
+ imgLoading.value = true;
|
|
|
clearTimeout(timer);
|
|
|
- timer =setInterval(()=>{
|
|
|
- imgLoading.value=false
|
|
|
- allImgShow.value=false
|
|
|
- },1000)
|
|
|
-}
|
|
|
+ timer = setInterval(() => {
|
|
|
+ imgLoading.value = false;
|
|
|
+ }, 1000);
|
|
|
+};
|
|
|
// 文件上传成功时的钩子
|
|
|
const handleSuccessImgUpload = (response, uploadFile, uploadFiles) => {
|
|
|
// console.log(response,uploadFile,uploadFiles,"上传成功");
|
|
|
@@ -2554,16 +2868,17 @@ const resetImport = () => {
|
|
|
};
|
|
|
// 批量导入按钮
|
|
|
const bulkImport = async () => {
|
|
|
- if (upload2File.value && uploadImgList.value) {
|
|
|
- } else {
|
|
|
- ElMessage({
|
|
|
- type: "warning",
|
|
|
- showClose: true,
|
|
|
- message: "上传文件或图片不能为空",
|
|
|
- center: true,
|
|
|
- });
|
|
|
- return false;
|
|
|
- }
|
|
|
+ // if (upload2File.value && uploadImgList.value) {
|
|
|
+ // } else {
|
|
|
+ // ElMessage({
|
|
|
+ // type: "warning",
|
|
|
+ // showClose: true,
|
|
|
+ // message: "上传文件或图片不能为空",
|
|
|
+ // center: true,
|
|
|
+ // });
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ startImprot.value = true;
|
|
|
// uploadImgList.value = uploadImgList.value.slice(1);
|
|
|
console.log(uploadImgList.value, "拼接好的图片地址");
|
|
|
console.log(upload2File.value, "导入的文件");
|
|
|
@@ -2588,6 +2903,7 @@ const bulkImport = async () => {
|
|
|
uploadImgList.value = "";
|
|
|
allImgUpload.value.clearFiles();
|
|
|
upload2.value.clearFiles();
|
|
|
+ startImprot.value = false;
|
|
|
ElMessage({
|
|
|
type: "success",
|
|
|
showClose: true,
|
|
|
@@ -2595,6 +2911,7 @@ const bulkImport = async () => {
|
|
|
center: true,
|
|
|
});
|
|
|
} else {
|
|
|
+ startImprot.value = false;
|
|
|
ElMessage({
|
|
|
type: "error",
|
|
|
showClose: true,
|
|
|
@@ -2966,15 +3283,21 @@ const handleCurrentChange = (value) => {
|
|
|
currentPage.value = value;
|
|
|
getList();
|
|
|
};
|
|
|
-
|
|
|
+const Enters = (e) => {
|
|
|
+ // console.log("按键:", e.key);
|
|
|
+ if (e.key == "Enter") {
|
|
|
+ searchBtn();
|
|
|
+ }
|
|
|
+};
|
|
|
onBeforeMount(async () => {
|
|
|
+ document.addEventListener("keyup", Enters);
|
|
|
api.value = store.state.user.api;
|
|
|
getDepartment(); // 左边部门树形结构
|
|
|
classDataList(); // 添加成员中 获取身份数据下拉、年级数据下拉、班级数据下拉
|
|
|
postList(); // 职务数据
|
|
|
});
|
|
|
onUnmounted(() => {
|
|
|
- // document.removeEventListener("keyup", Enters);
|
|
|
+ document.removeEventListener("keyup", Enters);
|
|
|
});
|
|
|
</script>
|
|
|
|