mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-10 11:26:45 +08:00
1104 lines
31 KiB
Vue
1104 lines
31 KiB
Vue
<!-- 外部讲师页面 -->
|
||
<template>
|
||
<div>
|
||
<!-- 搜索框及按钮 -->
|
||
<div class="filter" style="min-width: 1380px;">
|
||
<a-form layout="inline">
|
||
<a-form-item class="select">
|
||
<!-- v-model:value="searchParam.name" -->
|
||
<a-input v-model:value="searchParam.name" style="width: 276px; height: 40px; border-radius: 8px"
|
||
placeholder="请输入讲师姓名/手机号进行检索" allowClear showSearch
|
||
v-on:keydown.enter="enterPressHadlerSearch">
|
||
</a-input>
|
||
</a-form-item >
|
||
<a-form-item class="select">
|
||
<a-select style="width: 276px" v-model:value="searchParam.status" placeholder="账号状态"
|
||
:options="AccountStatusList"
|
||
v-on:keydown.enter="enterPressHadlerSearch">
|
||
</a-select>
|
||
</a-form-item >
|
||
<div style="display: flex; margin-bottom: 20px">
|
||
<a-button @click="searchSubmit()" type="primary" class="resetbtn">查询 </a-button>
|
||
<a-button class="resetbtn " @click="searchReset">重置</a-button>
|
||
</div>
|
||
</a-form>
|
||
<div style="width: 100%;"></div>
|
||
<div style="display: flex; margin-bottom: 20px">
|
||
<a-button @click="addTeacher()" type="primary" class="resetbtn">
|
||
<FolderAddOutlined /> 新增讲师
|
||
</a-button>
|
||
<div style="margin-left: 20px ;">
|
||
<a-button @click="handleExport()" class="resetbtn">
|
||
<UploadOutlined /> 导出
|
||
</a-button>
|
||
</div>
|
||
</div>
|
||
<!-- 表格 -->
|
||
<div style="padding: 10px 0">
|
||
<a-table :header-cell-style="{ 'text-align': 'center' }" style="border: 1px solid #f2f6fe" :columns="columns"
|
||
:data-source="tableData" :loading="tableLoading" @expand="expandTable" :pagination="false">
|
||
<template #bodyCell="{ record, column }">
|
||
<template v-if="column.key === 'operation'">
|
||
<a-space >
|
||
<a-button type="link" @click="() => handleLook(record, String(record.courseform))">查看</a-button>
|
||
<a-button type="link" @click="() => handleModify(record, String(record.courseform))">编辑</a-button>
|
||
<a-button v-if="record.status == '1'" type="link"
|
||
@click="() => handleOperate(record, String(record.courseform))">停用</a-button>
|
||
<a-button v-if="record.status == '2'" type="link"
|
||
@click="() => handleOperate(record, String(record.courseform))">启用</a-button>
|
||
<a-button type="link" @click="() => deleteModal(record, String(record.courseform))"
|
||
>删除</a-button>
|
||
<!-- <a-button type="link" @click="() => deleteModal(record, String(record.courseform))"
|
||
v-if="lecturerAdmin('Lecturer-admin')">删除</a-button> -->
|
||
</a-space>
|
||
</template>
|
||
</template>
|
||
</a-table>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="tableBox ">
|
||
<div class="pa">
|
||
<a-pagination v-if="tableDataTotal > 10" :showSizeChanger="true" :showQuickJumper="false"
|
||
:hideOnSinglePage="true" :pageSize="searchParam.pageSize" :current="searchParam.pageNo" :total="tableDataTotal"
|
||
class="pagination" @change="changePagination" />
|
||
</div>
|
||
</div>
|
||
<!-- 弹窗组件 -->
|
||
<a-drawer v-model:visible="teacherdialog" placement="right" @closa="cancelTeacherDialog" :maskClosable="true"
|
||
width="40%" :title="teacherdialogtitle">
|
||
<a-form :model="formParam" :rules="rules" layout="vertical" ref="formRef" >
|
||
<!-- 基本信息 -->
|
||
<a-row>
|
||
<a-col :span="24">
|
||
<span class="line"></span><span>基本信息</span>
|
||
</a-col>
|
||
<!-- 头像 -->
|
||
</a-row>
|
||
<a-row :gutter="16">
|
||
<a-col :span="24">
|
||
<div class="item_inp" style="background-color: #fff;">
|
||
<a-upload name="avatar" list-type="picture-card" class="avatar-uploader" :show-upload-list="false"
|
||
:headers="headers" :before-upload="beforeUpload">
|
||
<img class="i_upload_img" v-if="formParam.photo" :src="formParam.photo" alt="avatar" title="更换头像" />
|
||
<div class="i_upload" v-else>
|
||
<div class="addimg">
|
||
<div class="heng"></div>
|
||
<div class="shu"></div>
|
||
</div>
|
||
</div>
|
||
</a-upload>
|
||
<div class="i_bottom">
|
||
<div class="tip" style="margin-bottom: 10px;">
|
||
<span style="color: #999999; margin-left: 8px">支持图片格式为jpg/jpeg/png </span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</a-col>
|
||
</a-row>
|
||
<!-- 讲师名称 ,手机号码-->
|
||
<a-row :gutter="16">
|
||
<a-col :span="24">
|
||
<a-form-item label="讲师名称" name="name">
|
||
<a-input v-model:value="formParam.name" class="draitem"
|
||
placeholder="请输入讲师姓名" allowClear showSearch>
|
||
</a-input>
|
||
</a-form-item>
|
||
</a-col>
|
||
<a-col :span="24">
|
||
<a-form-item label="手机号码" name="mobile" prop="mobile">
|
||
<a-input v-model:value="formParam.mobile" class="draitem"
|
||
placeholder="请输入手机号码" allowClear showSearch :maxLength="11" @blur="sendPhone">
|
||
</a-input>
|
||
</a-form-item>
|
||
</a-col>
|
||
</a-row>
|
||
<!-- 供应商 ,邮箱-->
|
||
<a-row :gutter="16">
|
||
<a-col :span="24">
|
||
<a-form-item label="供应商" name="supplier">
|
||
<a-input v-model:value="formParam.supplier" class="draitem"
|
||
placeholder="请输入供应商" allowClear showSearch>
|
||
</a-input>
|
||
</a-form-item>
|
||
</a-col>
|
||
<a-col :span="24">
|
||
<a-form-item label="讲师邮箱" name="email" prop="email">
|
||
<a-input v-model:value="formParam.email" type="email" class="draitem"
|
||
placeholder="请输入讲师邮箱" allowClear showSearch @blur="sendEmail">
|
||
</a-input>
|
||
</a-form-item>
|
||
</a-col>
|
||
</a-row>
|
||
|
||
<!-- 其他信息 -->
|
||
<a-row>
|
||
<a-col :span="24">
|
||
<span class="line"></span><span>其他信息</span>
|
||
</a-col>
|
||
</a-row>
|
||
<!-- 讲师介绍 -->
|
||
<a-row :gutter="16">
|
||
<a-col :span="24">
|
||
<a-form-item label="讲师介绍">
|
||
<Editor v-model:value="formParam.description "/>
|
||
<!-- <a-textarea placeholder="富文本"/> -->
|
||
|
||
</a-form-item>
|
||
</a-col>
|
||
</a-row>
|
||
<!-- 备注 -->
|
||
<a-row :gutter="16">
|
||
<a-col :span="24">
|
||
<a-form-item label="备注">
|
||
<a-textarea
|
||
v-model:value="formParam.remark"
|
||
showCount
|
||
:maxlength="200"
|
||
style="width: 100%; height: 100px; border-radius: 8px"
|
||
placeholder="请输入"/>
|
||
</a-form-item>
|
||
</a-col>
|
||
</a-row>
|
||
</a-form>
|
||
<!-- 交互按钮 -->
|
||
<div
|
||
:style="{
|
||
position: 'absolute',
|
||
right: 0,
|
||
bottom: 0,
|
||
width: '100%',
|
||
borderTop: '1px solid #e9e9e9',
|
||
padding: '10px 16px',
|
||
background: '#fff',
|
||
textAlign: 'right',
|
||
zIndex: 1,
|
||
} "
|
||
>
|
||
<a-button class="drabtn" @click="cancelTeacherDialog" >取消</a-button>
|
||
<a-button class="drabtn" type="primary" @click="createTeacherDialog" :loading="buttonLoading">保存
|
||
</a-button>
|
||
</div>
|
||
</a-drawer>
|
||
|
||
<!-- 删除功能弹窗 -->
|
||
<div>
|
||
<a-modal v-model:visible="deleteTeacherdialog" :footer="null" :closable="close" wrapClassName="canclestu1"
|
||
centered="true">
|
||
<div class="delete">
|
||
<div class="del_header"></div>
|
||
<div class="del_main">
|
||
<div class="header">
|
||
<img src="@/assets/images/coursewareManage/QR.png" alt="" style="margin-right:5px"/>
|
||
<span>提示</span>
|
||
</div>
|
||
<div class="body">
|
||
<span>您确定要删除此讲师吗</span>
|
||
</div>
|
||
<div class="del_btnbox">
|
||
<div class="del_btn btn2" @click="cancelTeacherDialog1" style="margin-right: 32px">
|
||
<div class="btnText">取消</div>
|
||
</div>
|
||
<div class="del_btn btn2" @click="closeDeleteTeacher">
|
||
<div class="btnText">确定</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</a-modal>
|
||
</div>
|
||
<!-- 修改状态功能弹窗 -->
|
||
<div>
|
||
<a-modal v-model:visible="editTeacher" :footer="null" :closable="close" wrapClassName="canclestu1" centered="true">
|
||
<div class="delete">
|
||
<div class="del_header"></div>
|
||
<div class="del_main">
|
||
<div class="header">
|
||
<img src="@/assets/images/coursewareManage/QR.png" alt="" style="margin-right:10px"/>
|
||
<span>提示</span>
|
||
</div>
|
||
<div class="body">
|
||
<span v-if="handleOperate1 == 2">确定要将该讲师启用吗<div></div>启用后讲师可以登录教师端</span>
|
||
<span v-if="handleOperate1 == 1">确定要将该讲师停用吗<div></div>停用后讲师不可登录教师端</span>
|
||
</div>
|
||
<div class="del_btnbox">
|
||
<div class="del_btn btn2" @click="cancelTeacherDialog1" style="margin-right: 32px">
|
||
<div class="btnText">取消</div>
|
||
</div>
|
||
<div class="del_btn btn2" @click="closehandleOperate">
|
||
<div class="btnText">确定</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</a-modal>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
|
||
</div>
|
||
</template>
|
||
<script lang="jsx">
|
||
import { reactive, toRefs, ref,watch } from "vue";
|
||
import Editor from "@/components/project/Editor";
|
||
import { useRouter } from "vue-router";
|
||
import { message } from "ant-design-vue";
|
||
import {
|
||
UploadOutlined,
|
||
FolderAddOutlined
|
||
} from '@ant-design/icons-vue';
|
||
import ProjectManager from "@/components/project/ProjectManagerNew";
|
||
import { getTeacherList, getTeacherById, deleteInTeacher, updateTeacherState, insertTeacher, updateInTeacher } from "../../api/Lecturer";
|
||
import { fileUp } from "../../api/indexEval";
|
||
import {getCookieForName} from "@/api/method"
|
||
import SearchTeacher from "@/components/project/SearchTeacher";
|
||
import boe from '@/assets/boe.jpg'
|
||
export default {
|
||
name: "ExternalLecturer",
|
||
components: {
|
||
// AddTeacher,
|
||
SearchTeacher,
|
||
ProjectManager,
|
||
Editor,
|
||
FolderAddOutlined,//图标--新增
|
||
UploadOutlined,//图标--导出
|
||
},
|
||
setup() {
|
||
const formRef = ref();
|
||
const router = useRouter();
|
||
const state = reactive({
|
||
currentPage1: 1,
|
||
pageSize1: 10,
|
||
close:false,
|
||
log:true,
|
||
promotionrecordsLoading: false, //晋级记录遮罩层
|
||
tableLoading: false,
|
||
tagsshow: "1",
|
||
delTeacherId: null, //删除id确认
|
||
editTeacherid: null,//修改状态id确认
|
||
userNoid: null, //讲师详情工号确认
|
||
id: null, //讲师详情id确认
|
||
newStatus: null, //修改状态码确认
|
||
deleteTeacherdialog: false, //删除弹窗
|
||
editTeacher: false, //修改状态弹窗
|
||
handleOperate1: null, //修改状态弹窗内容
|
||
teacherdialog: false, //控制讲师弹窗
|
||
teacherdialogtitle: '',//讲师弹框title内容
|
||
pageSizeOptions: ['10', '20', '30', '50'], //下拉选择每页显示多少条
|
||
pageSize: 10,
|
||
tableDataTotal: -1,//table列表总条数
|
||
teacherrecordstableDataTotal: -1,//授课记录列表总条数
|
||
tSystemNames:{
|
||
systemName:null,
|
||
levelVoList: []
|
||
},
|
||
formParam: {
|
||
description:"",
|
||
teacherType:'2',
|
||
photo:boe,
|
||
status:1
|
||
},
|
||
vf:true,
|
||
searchParam: {
|
||
teacherType:2,
|
||
name: null,//姓名
|
||
status: null,//状态
|
||
tSystemName: null,
|
||
pageNo: "1",
|
||
pageSize: "10"
|
||
},
|
||
activeName: 'first'
|
||
})
|
||
|
||
const headers = { token: getCookieForName("token") };
|
||
const beforeUpload = (file) => {
|
||
const isJpgOrPng =
|
||
file.type === "image/jpg" ||
|
||
file.type === "image/jpeg" ||
|
||
file.type === "image/png" ||
|
||
file.type === "image/bmp" ||
|
||
file.type === "image/gif";
|
||
if (!isJpgOrPng) {
|
||
message.error("仅支持jpg、gif、png、jpeg、bmp格式!");
|
||
return false;
|
||
}
|
||
let isLt1M = file.size < 500000;
|
||
console.log(file.size, isLt1M)
|
||
if (!isLt1M) {
|
||
message.error("图片不能超过500KB! 请重新上传");
|
||
return false;
|
||
}
|
||
|
||
const formDatas = new FormData();
|
||
formDatas.append("file", file);
|
||
console.log("file", file)
|
||
fileUp(formDatas).then((res) => {
|
||
if (res.data.code === 200) {
|
||
console.log(res.data.data, 45);
|
||
state.formParam.photo = process.env.VUE_APP_FILE_PATH + res.data.data;
|
||
|
||
// state.hasImgName = file.name;
|
||
// emit("src", { id: '', src: res.data.data });
|
||
}
|
||
});
|
||
return false;
|
||
};
|
||
const AccountStatusList = ref([
|
||
{ value: '', label: "全部" },
|
||
{ value: 1, label: "启用" },
|
||
{ value: 2, label: "停用" },
|
||
])
|
||
const columns = ref([
|
||
{
|
||
title: '讲师姓名 ',
|
||
dataIndex: 'name',
|
||
key: 'name',
|
||
elipsis: true, align: "center",
|
||
width: 200,
|
||
},
|
||
{
|
||
title: '手机号码',
|
||
dataIndex: 'mobile',
|
||
key: 'mobile',
|
||
elipsis: true, align: "center",
|
||
width: 400,
|
||
// customRender: (value, record) => {
|
||
// return (
|
||
// <div>
|
||
// {value.record.orgName}
|
||
// </div>
|
||
// )
|
||
// }
|
||
},
|
||
{
|
||
title: '讲师邮箱 ',
|
||
dataIndex: 'email',
|
||
key: 'email',
|
||
elipsis: true, align: "center",
|
||
width: 200,
|
||
},
|
||
{
|
||
title: '授课时长 ',
|
||
dataIndex: 'teaching',
|
||
key: 'teaching',
|
||
elipsis: true, align: "center",
|
||
width: 200,
|
||
},
|
||
{
|
||
title: '账号状态 ',
|
||
dataIndex: 'status',
|
||
key: 'status',
|
||
elipsis: true, align: "center",
|
||
width: 200,
|
||
customRender: (value) => {
|
||
return (
|
||
<div>
|
||
{value.record.status == 0 || value.record.status == 1 || value.record.status == 2
|
||
? {
|
||
'0': "临时",
|
||
'1': "启用",
|
||
'2': "停用"
|
||
}[value.record.status + ""] || ""
|
||
: "-"}
|
||
</div>
|
||
)
|
||
}
|
||
},
|
||
{
|
||
title: '操作 ',
|
||
dataIndex: 'operation',
|
||
key: 'operation',
|
||
elipsis: true, align: "right",
|
||
width: 200,
|
||
scopedSlots: { customRender: "action" },
|
||
},
|
||
])
|
||
//列表数据
|
||
const tableData = ref([
|
||
|
||
])
|
||
// 搜索
|
||
const searchSubmit = () => {
|
||
getTableDate();
|
||
};
|
||
//重置
|
||
const searchReset = () => {
|
||
state.searchParam = {
|
||
pageNo: 1,
|
||
pageSize: 10,
|
||
teacherType:2,
|
||
name: null,
|
||
status: null
|
||
};
|
||
getTableDate();
|
||
};
|
||
// List接口数据
|
||
const getTableDate = () => {
|
||
state.tableLoading = true
|
||
state.loading = true;
|
||
let objA = { ...state.searchParam };
|
||
getTeacherList(objA)
|
||
.then((res) => {
|
||
tableData.value = res.data.data.records
|
||
state.tableDataTotal = Number(res.data.data.total);
|
||
state.tableLoading = false
|
||
// console.log("获取讲师tableDatateacherName", tableData);
|
||
})
|
||
};
|
||
getTableDate()
|
||
// // 翻页
|
||
const changePagination = (page,pageSize) => {
|
||
state.searchParam.pageNo = page;
|
||
state.searchParam.pageSize = pageSize;
|
||
getTableDate();
|
||
};
|
||
// 新增讲师
|
||
const addTeacher = () => {
|
||
cancel()
|
||
state.teacherdialog = true;
|
||
state.teacherdialogtitle = '新增讲师'
|
||
state.vf = true
|
||
state.formParam.photo = state.formParam.photo === null ?boe : state.formParam.photo
|
||
}
|
||
|
||
//修改讲师信息弹窗
|
||
const handleModify = (record) => {
|
||
state.teacherdialog = true;
|
||
state.teacherdialogtitle = '修改信息'
|
||
state.id = record.id
|
||
state.vf = false
|
||
TeacherSystem()
|
||
}
|
||
async function validateField(name) {
|
||
return new Promise((resolve) => {
|
||
formRef.value.validateFields([name])
|
||
.then(() => {
|
||
resolve(false);
|
||
})
|
||
.catch(() => {
|
||
resolve(true);
|
||
});
|
||
});
|
||
}
|
||
//保存
|
||
const createTeacherDialog = async () => {
|
||
const formItemNames = Object.keys(rules);
|
||
for(let i=0;i<formItemNames.length;i++){
|
||
const result = await validateField(formItemNames[i]);
|
||
if (result) {
|
||
return message.error(rules[formItemNames[i]][0].log)
|
||
}
|
||
}
|
||
state.formParam = {...state.formParam}
|
||
if (state.vf == false) {
|
||
updateInTeacher(state.formParam).then(response => {
|
||
message.success("修改成功");
|
||
state.teacherdialog = false;
|
||
cancel()
|
||
getTableDate();
|
||
});
|
||
}
|
||
else {
|
||
insertTeacher(state.formParam)
|
||
.then((res) => {
|
||
message.success("保存成功");
|
||
state.teacherdialog = false;
|
||
cancel()
|
||
getTableDate();
|
||
}).catch((err) => {
|
||
console.log(err);
|
||
});
|
||
}
|
||
};
|
||
//删除弹窗
|
||
const deleteModal = (record) => {
|
||
state.deleteTeacherdialog = true
|
||
state.delTeacherId = record.id
|
||
};
|
||
//修改状态窗口
|
||
const handleOperate = (record) => {
|
||
if (record.status == 1) {
|
||
state.handleOperate1 = record.status
|
||
state.newStatus = 2
|
||
}
|
||
if (record.status == 2) {
|
||
state.handleOperate1 = record.status
|
||
state.newStatus = 1
|
||
}
|
||
state.editTeacherid = record.id
|
||
state.editTeacher = true
|
||
};
|
||
|
||
//确认删除
|
||
const closeDeleteTeacher = () => {
|
||
//调用删除接口
|
||
deleteInTeacher(state.delTeacherId).then((res) => {
|
||
if (res.data.code == 200) {
|
||
message.success("删除成功");
|
||
state.deleteTeacherdialog = false
|
||
getTableDate();
|
||
}
|
||
})
|
||
.catch((err) => {
|
||
state.deleteTeacherdialog = false
|
||
});
|
||
}
|
||
//确认启用停用
|
||
const closehandleOperate = () => {
|
||
//调用接口
|
||
let ids = {
|
||
id: state.editTeacherid,
|
||
status: state.newStatus
|
||
}
|
||
console.log(ids)
|
||
updateTeacherState(ids).then((res) => {
|
||
// message.success("操作成功");
|
||
state.editTeacher = false
|
||
getTableDate();
|
||
})
|
||
.catch((err) => {
|
||
state.editTeacher = false
|
||
});
|
||
}
|
||
//取消按钮 清空输入的数据
|
||
const cancelTeacherDialog = () => {
|
||
if (state.teacherdialog = true) {
|
||
formRef.value.resetFields();
|
||
state.teacherdialog = false
|
||
cancel()
|
||
}
|
||
// state.deleteTeacherdialog = false
|
||
// state.editTeacher = false
|
||
// state.tagsshow = 1
|
||
};
|
||
const cancelTeacherDialog1 = () => {
|
||
state.deleteTeacherdialog = false
|
||
state.editTeacher = false
|
||
state.tagsshow = 1
|
||
};
|
||
watch(() => state.formParam.description, (val) => {
|
||
console.log(val, 'description')
|
||
})
|
||
//清空数据
|
||
const cancel = () => {
|
||
state.formParam = {
|
||
status:1,
|
||
teacherType:2,
|
||
photo:boe,
|
||
name: null,
|
||
mobile: null,
|
||
email: null,
|
||
teacherIntrofuce: null,
|
||
description:"",
|
||
remark: null,
|
||
id:null,
|
||
supplier:null,
|
||
}
|
||
console.log(state.formParam);
|
||
}
|
||
const rules = {
|
||
name: [{ required: true, message: '',log: '讲师不能为空' }],
|
||
supplier:[{ required: true, message: '',log:'供应商不能为空' }],
|
||
email:[
|
||
{
|
||
type: "email",
|
||
message: '',log: '请输入正确的邮箱地址',
|
||
trigger: "blur"
|
||
}
|
||
],
|
||
mobile: [
|
||
{
|
||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||
message: '',log: "请输入正确的手机号码",
|
||
trigger: "blur"
|
||
}
|
||
]
|
||
}
|
||
const rule =()=>{
|
||
if (state.formParam.name==null){
|
||
state.log = true
|
||
message.warning( '讲师不能为空')
|
||
}
|
||
if (state.formParam.supplier==null){
|
||
state.log = true
|
||
message.warning( '供应商不能为空')
|
||
}
|
||
}
|
||
// const sendEmail= ()=>{
|
||
// let regEmail=
|
||
// /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-A-Za-z0-9_-]+(\.[a-a-A-Za-z0-9_-]+)+$/
|
||
// }
|
||
//表格内查看数据操作
|
||
const handleLook = (record) => {
|
||
let id = record.id
|
||
router.push({ path: '/LookExternalLecturer', query: { id } })
|
||
}
|
||
//外部讲师详情
|
||
const TeacherSystem = () => {
|
||
getTeacherById({id:state.id}).then((res) => {
|
||
console.log("外部讲师详情", res.data);
|
||
state.formParam = res.data.data
|
||
state.formParam.description = state.formParam.description === null ? '' : state.formParam.description
|
||
state.formParam.photo = state.formParam.photo === null ?boe : state.formParam.photo
|
||
})
|
||
.catch((err) => {
|
||
console.log("外部讲师详情", err);
|
||
});
|
||
}
|
||
const sendPhone=()=>{
|
||
console.log(state.formParam.mobile)
|
||
const reg = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
|
||
// if (!state.formParam.mobile) {
|
||
// } else if (!reg.test(state.formParam.mobile)) {
|
||
// message.warning( '手机号格式不正确')
|
||
// }
|
||
}
|
||
const sendEmail=()=>{
|
||
const reg = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.\w{2,}$/;
|
||
// if (!reg.test(state.formParam.email)) {
|
||
// message.warning( '邮箱格式不正确')
|
||
// }
|
||
}
|
||
// getpromotionrecordstableData()
|
||
//导出功能
|
||
const handleExport = () => {
|
||
window.open(
|
||
`${process.env.VUE_APP_BASE_API}/admin/export/exportOutTeacher?pageNo=${state.searchParam.pageNo
|
||
}&pageSize=${state.searchParam.pageSize}&name=${state.searchParam.name ? state.searchParam.name : ""}&status=${state.searchParam.status ? state.searchParam.status : ""}`
|
||
);
|
||
// this.download('lesson_records/export', {
|
||
// ...state.searchParam
|
||
// }, `project_${new Date().getTime()}.xlsx` )
|
||
}
|
||
const lecturerAdmin = (admin)=>{
|
||
const roleCode = userInfo.value.roleList.map((item)=>item.roleCode)
|
||
if (admin){
|
||
return roleCode.some(t => t == admin)
|
||
}
|
||
}
|
||
//回车
|
||
const enterPressHadlerSearch = e => {
|
||
console.log("e",e);
|
||
if (e.keyCode === 13) {
|
||
searchSubmit()
|
||
|
||
}
|
||
};
|
||
return {
|
||
...toRefs(state),
|
||
lecturerAdmin,
|
||
enterPressHadlerSearch,
|
||
validateField,
|
||
rules,
|
||
rule,
|
||
formRef,
|
||
sendPhone,
|
||
sendEmail,
|
||
// managerChange,
|
||
headers,
|
||
beforeUpload,
|
||
handleExport,
|
||
AccountStatusList,
|
||
searchSubmit,
|
||
searchReset,
|
||
columns,
|
||
tableData,
|
||
changePagination,
|
||
addTeacher,
|
||
cancelTeacherDialog,
|
||
handleLook,
|
||
cancel,
|
||
deleteModal,
|
||
handleModify,
|
||
closeDeleteTeacher,
|
||
createTeacherDialog,
|
||
handleOperate,
|
||
closehandleOperate,
|
||
getTableDate, //list接口数据调用
|
||
TeacherSystem,
|
||
cancelTeacherDialog1,
|
||
// getpromotionrecordstableData
|
||
}
|
||
},
|
||
};
|
||
</script>
|
||
<style lang="scss" scoped>
|
||
::v-deep .ant-upload.ant-upload-select-picture-card {
|
||
border-radius: 50% !important;
|
||
}
|
||
//导出按钮icon
|
||
.daochu {
|
||
width: 16px;
|
||
height: 18px;
|
||
background-image: url("../../assets/images/coursewareManage/export1.png");
|
||
}
|
||
|
||
//弹窗内详情样式
|
||
.display1 {
|
||
display: inline-block;
|
||
width: 200px;
|
||
}
|
||
|
||
// .display0{
|
||
// display:inline-block ;
|
||
// width:200px ;
|
||
// text-align:center }
|
||
//弹窗内确认取消按钮布局
|
||
.del_btnbox {
|
||
display: flex;
|
||
margin: 30px auto;
|
||
justify-content: center;
|
||
|
||
.del_btn {
|
||
width: 100px;
|
||
height: 40px;
|
||
background: rgba(64, 158, 255, 0);
|
||
border-radius: 8px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
flex-shrink: 0;
|
||
cursor: pointer;
|
||
|
||
.btnText {
|
||
font-size: 14px;
|
||
font-weight: 400;
|
||
line-height: 40px;
|
||
}
|
||
}
|
||
|
||
.btn1 {
|
||
border: 1px solid rgba(64, 158, 255, 1);
|
||
color: #4ea6ff;
|
||
margin-right: 14px;
|
||
}
|
||
|
||
.btn2 {
|
||
background-color: #4ea6ff;
|
||
color: #ffffff;
|
||
}
|
||
}
|
||
|
||
.ant-table-cell-fix-right {
|
||
width: 300px !important;
|
||
}
|
||
|
||
.ant-table-tbody>tr>td {
|
||
text-align: center;
|
||
}
|
||
|
||
.ExternalLecturer { width: 100%;
|
||
height: 100%;
|
||
display: flex;
|
||
flex-direction: column;
|
||
|
||
.filter {
|
||
margin-left: 38px;
|
||
margin-right: 38px;
|
||
margin-top: 30px;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
flex-wrap: wrap;
|
||
.select {
|
||
margin-right: 20px;
|
||
margin-bottom: 20px;
|
||
}
|
||
}}
|
||
|
||
.ant-modal {
|
||
.ant-modal-content {
|
||
width: 424px !important;
|
||
|
||
.ant-modal-body {
|
||
.delete {
|
||
width: 424px;
|
||
background: #ffffff;
|
||
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.21);
|
||
border-radius: 4px;
|
||
position: absolute;
|
||
left: 50%;
|
||
top: 10%;
|
||
transform: translate(-50%, -50%);
|
||
|
||
.del_header {
|
||
position: absolute;
|
||
width: calc(100%);
|
||
height: 40px;
|
||
background: linear-gradient(
|
||
rgba(78, 166, 255, 0.2) 0%,
|
||
rgba(78, 166, 255, 0) 100%
|
||
);
|
||
}
|
||
|
||
.del_main {
|
||
width: 100%;
|
||
position: relative;
|
||
|
||
.header {
|
||
display: flex;
|
||
align-items: center;
|
||
padding-top: 20px;
|
||
padding-left: 26px;
|
||
font-size: 16px;
|
||
|
||
.del-icons {
|
||
width: 16px;
|
||
height: 16px;
|
||
position: relative;
|
||
margin-right: 10px;
|
||
|
||
img {
|
||
width: 100%;
|
||
height: 100%;
|
||
position: absolute;
|
||
top: 0px;
|
||
left: 0px;
|
||
background-size: 100% 100%;
|
||
}
|
||
}
|
||
|
||
.close_exit {
|
||
position: absolute;
|
||
right: 42px;
|
||
cursor: pointer;
|
||
width: 20px;
|
||
height: 20px;
|
||
background-image: url(@/assets/images/coursewareManage/close.png);
|
||
background-size: 100% 100%;
|
||
}
|
||
}
|
||
|
||
.body {
|
||
width: 100%;
|
||
margin: 34px auto 56px auto;
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
}
|
||
|
||
.del_btnbox {
|
||
display: flex;
|
||
margin: 30px auto;
|
||
justify-content: center;
|
||
|
||
.del_btn {
|
||
width: 100px;
|
||
height: 40px;
|
||
background: rgba(64, 158, 255, 0);
|
||
border-radius: 8px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
margin-right: 14px;
|
||
flex-shrink: 0;
|
||
cursor: pointer;
|
||
|
||
.btnText {
|
||
font-size: 14px;
|
||
font-weight: 400;
|
||
line-height: 40px;
|
||
}
|
||
}
|
||
|
||
.btn1 {
|
||
border: 1px solid rgba(64, 158, 255, 1);
|
||
color: #4ea6ff;
|
||
}
|
||
|
||
.btn2 {
|
||
background-color: #4ea6ff;
|
||
color: #ffffff;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
.CreatePath {
|
||
.out {
|
||
z-index: 9999;
|
||
display: block;
|
||
position: absolute;
|
||
top: 90px;
|
||
width: 1080px !important;
|
||
height: 650px;
|
||
overflow: auto;
|
||
background-color: #fff;
|
||
|
||
box-shadow: 0 0 10px rgba(118, 136, 166, 0.21);
|
||
left: 50%;
|
||
top: 300px;
|
||
transform: translate(-50%, -50%);
|
||
|
||
.top {
|
||
width: 100%;
|
||
height: 68px;
|
||
|
||
background: linear-gradient(rgba(78, 166, 255, 0.2) 0%,
|
||
rgba(78, 166, 255, 0) 100%);
|
||
display: flex;
|
||
align-items: center;
|
||
|
||
.topimg {
|
||
width: 18px;
|
||
height: 18px;
|
||
margin-left: 27px;
|
||
margin-top: -2px;
|
||
}
|
||
|
||
.topc {
|
||
color: #000000;
|
||
font-size: 16px;
|
||
margin-left: 8px;
|
||
}
|
||
}
|
||
|
||
.mid {
|
||
width: 100%;
|
||
height: 100%;
|
||
background-color: #fff;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
|
||
.d {
|
||
// margin-top: 8px;
|
||
// color: #ff4e4e;
|
||
margin-left: -5px;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
// 重置样式
|
||
.resetbtn {
|
||
width: 100px;
|
||
height: 40px;
|
||
border-radius: 8px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
margin-right: 14px;
|
||
flex-shrink: 0;
|
||
cursor: pointer;
|
||
}
|
||
|
||
//展开收起样式
|
||
.moreidbtn {
|
||
border: none;
|
||
color: #4ea6ff;
|
||
width: 80px
|
||
}
|
||
|
||
//小竖线
|
||
.line{
|
||
float:left; width: 3px; height: 25px; background: #4ea6ff;border-radius: 30%; margin-right: 5px;
|
||
}
|
||
//抽屉功能
|
||
.drawaer
|
||
/* 改变所有 a-tree-select 输入框的高度 */
|
||
.ant-tree-select .ant-select-selection {
|
||
height: 40px;
|
||
line-height: 40px;
|
||
/* 确保文字垂直居中 */
|
||
}
|
||
.draitem{
|
||
width: 100%;
|
||
height: 40px !important;
|
||
border-radius: 8px;
|
||
line-height: 40px;
|
||
}
|
||
.drabtn{
|
||
height:40px;
|
||
width:80px;
|
||
border-radius:8px;
|
||
margin-right:20px
|
||
}
|
||
::v-deep .ant-select:not(.ant-select-customize-input) .ant-select-selector{
|
||
border-radius:8px;
|
||
height:40px;
|
||
}
|
||
.ant-col-12{
|
||
height:90px;
|
||
}
|
||
.item_inp {
|
||
flex: 1;
|
||
text-align: center ;
|
||
.i_upload_img {
|
||
width: 100px;
|
||
height: 100px;
|
||
border-radius: 8px;
|
||
}
|
||
|
||
.i_upload {
|
||
width: 100px;
|
||
height: 100px;
|
||
border: 1px solid #4ea6ff;
|
||
border-radius:50%;
|
||
text-align: center;
|
||
align-items: center;
|
||
cursor: pointer;
|
||
|
||
.addimg {
|
||
position: relative;
|
||
|
||
.heng {
|
||
position: absolute;
|
||
top: 50px;
|
||
left: 25px;
|
||
width: 50px;
|
||
border: 1px solid #4ea6ff;
|
||
}
|
||
|
||
.shu {
|
||
position: absolute;
|
||
top: 25px;
|
||
left: 50px;
|
||
height: 50px;
|
||
border: 1px solid #4ea6ff;
|
||
}
|
||
}
|
||
}
|
||
|
||
.ant-upload.ant-upload-select-picture-card {
|
||
border: 0px !important;
|
||
border-radius: 50%!important;
|
||
}
|
||
}
|
||
.ant-upload.ant-upload-select-picture-card {
|
||
border: 0px !important;
|
||
border-radius: 50%!important;
|
||
}
|
||
|
||
::v-deep .ant-select-selection-overflow-item {
|
||
margin-top: -2px;
|
||
}
|
||
|
||
::v-deep .ant-select-multiple .ant-select-selection-item {
|
||
height: 34px
|
||
}
|
||
.tableBox {
|
||
padding-bottom: 20px;
|
||
margin: 20px 38px 30px;
|
||
::v-deep .ant-select-dropdown{
|
||
display: inline-block;
|
||
}
|
||
::v-deep .ant-select-selection-item{
|
||
margin-left: 3px;
|
||
}
|
||
::v-deep .ant-pagination-options-size-changer.ant-select{
|
||
width: 84px;
|
||
}
|
||
.pa {
|
||
width: 100%;
|
||
display: flex;
|
||
justify-content: right;
|
||
}
|
||
}
|
||
.item_inp .i_upload_img[data-v-e369ffe0] {
|
||
border-radius:50%
|
||
}
|
||
</style> |