接口联调

This commit is contained in:
wangxuemei
2024-08-15 18:04:20 +08:00
parent 63baa9f5d2
commit 0985531a5b
5 changed files with 187 additions and 130 deletions

View File

@@ -6,12 +6,9 @@
<a-form layout="inline">
<a-form-item class="select">
<!-- v-model:value="searchParam.name" -->
<div style="width: 276px; height: 40px; border-radius: 8px" >
<ProjectManager v-model:value="searchParam.managerId"
v-model:name="searchParam.manager"
placeholder="请输入工号/讲师姓名进行检索"
@onChange="managerChange" mode="multiple"></ProjectManager>
</div>
<a-input v-model:value="searchParam.teacherNameOrMobel" style="width: 276px; height: 40px; border-radius: 8px"
placeholder="请输入工号/讲师姓名进行检索" allowClear showSearch>
</a-input>
</a-form-item >
<a-form-item class="select">
<a-select style="width: 230px" v-model:value="searchParam.status" placeholder="账号状态"
@@ -84,17 +81,19 @@
<a-row :gutter="16">
<a-col :span="24">
<div class="item_inp" style="background-color: #fff;">
<a-tooltip>
<template #title>修改头像</template>
<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" />
<div class="i_upload" v-else>
:headers="headers" :before-upload="beforeUpload" >
<img class="i_upload_img" v-if="formParam.photo" :src="formParam.photo" alt="avatar" />
<div class="i_upload" v-else>
<div class="addimg">
<div class="heng"></div>
<div class="shu"></div>
</div>
</div>
</a-upload>
</a-tooltip>
<div class="i_bottom">
<div class="tip" style="margin-bottom: 10px;">
<span style="color: #999999; margin-left: 8px">支持图片格式为jpg/jpeg/png 图片最大为500KB</span>
@@ -274,6 +273,7 @@ export default {
currentPage1: 1,
pageSize1: 10,
close:false,
log:true,
promotionrecordsLoading: false, //晋级记录遮罩层
tableLoading: false,
tagsshow: "1",
@@ -298,7 +298,7 @@ export default {
},
vf:true,
searchParam: {
name: null,//姓名
teacherNameOrMobel: null,//姓名
status: null,//状态
pageNo: "1",
pageSize: "10"
@@ -341,6 +341,7 @@ export default {
return false;
};
const AccountStatusList = ref([
{ value: '', label: "全部" },
{ value: 0, label: "启用" },
{ value: 1, label: "停用" },
])
@@ -422,7 +423,7 @@ export default {
state.searchParam = {
pageNo: 1,
pageSize: 10,
name: null,
teacherNameOrMobel: null,
status: null
};
getTableDate();
@@ -441,36 +442,15 @@ export default {
})
};
getTableDate()
// // List接口数据
// const getTableDate = ()=>{
// state.tableloading = true ;
// api
// // api 接口命名
// getTeacherList({
// ...state.searchParam
// })
// .then((res)=>{
// console.log(res.data.rows)
// // state.tableDataTotal = Number(res.data.data.total);
// // state.tableLoading = false;
// // const tableData = res.data.rows;
// // // initDataSublist("", data);
// // console.log(data);
// // tableData.value = data;
// // console.log("tableData", tableData);
// })
// }
// 获取项目列表信息
//let tableData = ref([]);
// // 翻页
const changePagination = (page) => {
state.searchParam.pageNo = page;
state.currentPage1 = page;
state.pageSize1 = pageSize;
state.searchParam.pageSize = pageSize;
getTableDate();
};
// 新增讲师
const addTeacher = () => {
cancel()
state.teacherdialog = true;
state.teacherdialogtitle = '新增讲师'
state.vf = true
@@ -488,6 +468,11 @@ export default {
//保存
const createTeacherDialog = () => {
console.log(state.formParam);
rule()
if( state.log = true){
state.teacherdialog = true;
}
else{
if (state.vf == false) {
updateOutTeacher(state.formParam).then(response => {
message.success("修改成功");
@@ -500,6 +485,7 @@ export default {
}).catch((err) => {
console.log(err);
});
}
}
state.teacherdialog = false;
getTableDate();
@@ -565,6 +551,7 @@ export default {
const cancel = () => {
state.formParam = {
teacherType:'1',
photo: 'https://p0.itc.cn/q_70/images01/20211013/f45d91616a364d6ea9c42a8db69734aa.png',
name: null,
mobile: null,
email: null,
@@ -580,6 +567,16 @@ export default {
name: [{ required: true, message: '讲师不能为空' }],
supplier:[{ required: true, message: '供应商不能为空' }],
}
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_-]+)+$/
@@ -600,29 +597,27 @@ export default {
.catch((err) => {
console.log("外部讲师详情", err);
});
// state.formParam={
// name:record.name,
// mobile:record.mobile,
// email:record.email,
// teacherIntrofuce:record.teacherIntrofuce,
// remark:record.remark,
// }
// if(record.id!=null ){
// state.formParam.id = record.id
// }
}
function managerChange(e, l, d, t, orgName) {
console.log(e, l);
state.searchParam.userNo = d;
state.searchParam.name = t;
// state.searchParam.trainorgName=orgName
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 = () => {
const handleExport = () => {
window.open(
`${process.env.VUE_APP_BASE_API}/teacher/export?pageNo=${state.currentPage1
}&pageSize=${state.pageSize1}&name=${state.searchParam.name ? state.searchParam.name : ""}&status=${state.searchParam.status ? state.searchParam.status : ""}`
`${process.env.VUE_APP_BASE_API}/teacher/export?pageNo=${state.searchParam.currentPage
}&pageSize=${state.searchParam.pageSize}&teacherNameOrMobel=${state.searchParam.teacherNameOrMobel ? state.searchParam.teacherNameOrMobel : ""}&status=${state.searchParam.status ? state.searchParam.status : ""}`
);
// this.download('lesson_records/export', {
// ...state.searchParam
@@ -631,7 +626,10 @@ export default {
return {
...toRefs(state),
rules,
managerChange,
rule,
sendPhone,
sendEmail,
// managerChange,
headers,
beforeUpload,
handleExport,

View File

@@ -50,7 +50,7 @@
</a-select>
</a-form-item>
<a-form-item class="select" v-if="moreid == 2">
<a-select style="width: 230px" v-model:value="searchParam.id" placeholder="内容分类"
<a-select style="width: 230px" v-model:value="searchParam.systypeid" placeholder="内容分类"
:options="getTeacherExpertiseList" allowClear>
</a-select>
</a-form-item>
@@ -110,7 +110,7 @@
<a-drawer v-model:visible="teacherdialog" placement="right" @closa="cancelTeacherDialog" :maskClosable="true"
dropdown-style="drawaer" width="60%" :title="teacherdialogtitle">
<a-form :model="formParam" :rules="rules" layout="vertical">
<!--讲师名称 teacher 内容分类 id -->
<!--讲师名称 teacher 内容分类 systypeid -->
<a-row :gutter="16">
<a-col :span="12">
<a-form-item label="讲师名称" name="teacher">
@@ -120,8 +120,8 @@
@onChange="managerChange" mode="multiple"></ProjectManager> </a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="内容分类" name="id">
<a-select class="draitem" v-model:value="formParam.id" placeholder="内容分类"
<a-form-item label="内容分类" name="systypeid">
<a-select class="draitem" v-model:value="formParam.systypeid" placeholder="内容分类"
:options="getTeacherExpertiseList" allowClear>
</a-select>
</a-form-item>
@@ -214,7 +214,7 @@
<a-descriptions-item label="课程名称">{{ formParam.name }}</a-descriptions-item>
<a-descriptions-item label="开课状态">{{ formParam.status == 0 ? '未开课' : formParam.status == 1
? '已开课' : '' }}</a-descriptions-item>
<a-descriptions-item label="内容分类 ">{{ formParam.teaching }}</a-descriptions-item>
<a-descriptions-item label="内容分类 ">{{ formParam.sysTypeId }}</a-descriptions-item>
<a-descriptions-item label="授课/课程日期 ">{{ formParam.beginTime }}</a-descriptions-item>
<a-descriptions-item label="授课时长 ">{{ formParam.duration }}</a-descriptions-item>
<a-descriptions-item label="评分 ">{{ formParam.score }}</a-descriptions-item>
@@ -342,7 +342,7 @@ export default {
]);
const rules = {
teacher: [{ required: true, message: '讲师不能为空' }],
id: [{ required: true, message: '内容分类不能为空' }],
systypeid: [{ required: true, message: '内容分类不能为空' }],
name: [{ required: true, message: '课程名称不能为空' }],
status: [{ required: true, message: '讲开课状态不能为空' }],
duration: [{ required: true, message: '授课时长不能为空' }],
@@ -464,12 +464,18 @@ export default {
width: 100,
},
{
title: '内容分类',
dataIndex: 'teaching',
key: 'teaching',
elipsis: true, align: "center",
width: 100,
},
title: "内容分类",
width: 100,
dataIndex: "sysType1",
ellipsis: true,
key: "keywords",
align: "center",
customRender: ({ record,text }) =>
`${getSysTypeMap(record.sysType1, record.sysTypeId)?getSysTypeMap(record.sysType1) : ""}
${getSysTypeMap(record.sysType2, record.sysTypeId)?'-'+getSysTypeMap(record.sysType2) : ""}
${getSysTypeMap(record.sysType3, record.sysTypeId)?'-'+getSysTypeMap(record.sysType3) : ""}
`
},
{
title: '授课时长(H) ',
dataIndex: 'duration',

View File

@@ -85,6 +85,7 @@
<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>
@@ -101,7 +102,7 @@
<div class="tableBox ">
<div style="float: right;">
<a-pagination v-if="tableDataTotal > 10" :showSizeChanger="false" :showQuickJumper="true" :hideOnSinglePage="true"
<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>
@@ -118,16 +119,19 @@
<a-row :gutter="16">
<a-col :span="24">
<div class="item_inp" style="background-color: #fff;">
<a-tooltip>
<template #title>修改头像</template>
<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" />
<div class="i_upload" v-else>
:headers="headers" :before-upload="beforeUpload" >
<img class="i_upload_img" v-if="formParam.photo" :src="formParam.photo" alt="avatar" />
<div class="i_upload" v-else>
<div class="addimg">
<div class="heng"></div>
<div class="shu"></div>
</div>
</div>
</a-upload>
</a-tooltip>
<div class="i_bottom">
<div class="tip" style="margin-bottom: 10px;">
<span style="color: #999999; margin-left: 8px">支持图片格式为jpg/jpeg/png 图片最大为500KB</span>
@@ -139,12 +143,11 @@
<a-row :gutter="16">
<a-col :span="12">
<a-form-item label="讲师名称" name="name">
<!-- <ProjectManager v-model:value="formParam.userNo"
v-model:name="formParam.name"
placeholder="请输入工号/讲师姓名进行检索"
@onChange="managerChange" mode="multiple"></ProjectManager> -->
<SearchTeacher v-model:value="formParam.name" v-model:lable="formParam.orgName"></SearchTeacher>
<SearchTeacher v-model:value="formParam.name" v-model:lable="formParam.orgName" v-model:newlable="formParam.neworgName"></SearchTeacher>
<!-- <a-tree-select v-model:value="formParam.name"
show-search allow-clear tree-data-simple-mode class="draitem"
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" :tree-data="treeData" placeholder="请输入讲师名称" /> -->
@@ -152,10 +155,12 @@
</a-col>
<a-col :span="12">
<a-form-item label="讲师组织" name="orgName">
<a-popover title="讲师组织">
<a-popover >
<template #content>
{{ formParam.orgName }}
{{formParam.neworgName }}
</template>
<a-input disabled v-model:value="formParam.neworgName" class="draitem"
placeholder="自动带出讲师的组织,展示主要部分,鼠标浮上去展示所有" allowClear showSearch>
</a-input>
@@ -558,13 +563,12 @@ export default {
const router = useRouter();
const state = reactive({
Addtitle: '选择教师专长',
log:false,
showContent: false,
closableQR:false,
updialog: false,
moreid: 1,
byPid: null,
currentPage1: 1,
pageSize1: 10,
tableLoading: false,
tagsshow: "1",
PlaceOfPayList: [],
@@ -592,6 +596,8 @@ export default {
photo: 'https://p0.itc.cn/q_70/images01/20211013/f45d91616a364d6ea9c42a8db69734aa.png'
},
searchParam: {
currentPage: 1,
pageSize1: 10,
teacherNameOrUserNo: null,
systemId: null,
tlevelId: null,
@@ -631,6 +637,13 @@ export default {
watch(() => state.formParam.courses, (val) => {
console.log(val, 'courses')
})
watch(()=>state.formParam.orgName,(val)=>{
console.log(val, 'orgName')
// if( val !==null ){
// state.formParam.neworgName=val.split('/')
// state.formParam.neworgName= state.formParam.neworgName[state.formParam.neworgName.length-1]
// }
})
let isLt1M = file.size < 500000;
console.log(file.size, isLt1M)
if (!isLt1M) {
@@ -944,7 +957,7 @@ export default {
])
//列表数据
const tableData = ref([
])
// 搜索
const searchSubmit = () => {
@@ -991,8 +1004,8 @@ export default {
// // 翻页
const changePagination = (page, pageSize) => {
state.searchParam.pageNo = page;
state.currentPage1 = page;
state.pageSize1 = pageSize;
// state.currentPage = page;
state.searchParam.pageSize = pageSize;
getTableDate();
};
// 新增讲师
@@ -1014,7 +1027,12 @@ export default {
}
//保存
const createTeacherDialog = () => {
if (state.vf == false) {
rule()
if( state.log = true){
state.teacherdialog = true;
}
else
{ if (state.vf == false) {
updateInTeacher(state.formParam).then(response => {
message.success("修改成功");
});
@@ -1028,28 +1046,7 @@ export default {
});
}
state.teacherdialog = false;
getTableDate();
// let a =
// {"teacherType":"0",
// "name":"张六0804",
// "status": 1,
// "certStatus": "0",
// "tsystemId":"",
// "defaultteachingTime": "110",
// "tlevelId":"",
// "userNo":"",
// "kid":"",
// "photo":" ",
// "description":"介绍",
// "expertise":"工作经历",
// "workExperience": "卫健委因无法准确掌握实际数量即日起不再公布无症状感染者数据。2、官方在感染高风险人群、60岁以上老年人群等开展第二剂次加强免疫接种",
// }
// insertTeacher(a)
// .then((res) => {
// message.success("保存成功");
// }).catch((err) => {
// console.log(err);
// });
getTableDate();}
};
//删除弹窗
const deleteModal = (record) => {
@@ -1135,8 +1132,35 @@ export default {
certStatus: [{ required: true, message: '认证状态不能为空' }],
}
//表格内查看数据操作
const rule =()=>{
if (state.formParam.name==null){
state.log = true
message.warning( '讲师不能为空')
}
if (state.formParam.newdepartId==null){
state.log = true
message.warning( '组织不能为空')
}
if (state.formParam.tlevelId==null){
state.log = true
message.warning( '讲师级别不能为空')
}
if (state.formParam.tsystemId==null){
state.log = true
message.warning( '讲师体系不能为空')
}
if (state.formParam.defaultteachingTime==null){
state.log = true
message.warning( '授课时长不能为空')
}
if (state.formParam.certStatus==null){
state.log = true
message.warning( '认证状态不能为空')
}
}
// //表格内查看数据操作
const handleLook = (record) => {
let id = record.id
router.push({ path: '/LookInsideLecturer', query: { id } })
}
@@ -1144,13 +1168,13 @@ export default {
const TeacherSystem = () => {
getTeacherById(state.id).then((res) => {
if (res.data.code === 200) {
let objA= res.data.data[0]
if( objA.orgName !==null ){
objA.neworgName=objA.orgName.split('/')
// let objA= res.data.data[0]
// if( objA.orgName !==null ){
// objA.neworgName=objA.orgName.split('/')
objA.neworgName= objA.neworgName[objA.neworgName.length-1]
}
state.formParam = objA
// objA.neworgName= objA.neworgName[objA.neworgName.length-1]
// }
state.formParam = res.data.data[0]
state.formParam.description = state.formParam.description === null ? '' : state.formParam.description
state.formParam.workExperience = state.formParam.workExperience === null ? '' : state.formParam.workExperience
state.formParam.courses = state.formParam.courses === null ? '' : state.formParam.courses
@@ -1170,11 +1194,14 @@ export default {
// state.searchParam.name = t;
// // state.searchParam.trainorgName=orgName
// }
// const customPreview =(e)=>{
// e.stopPropagation()
// }
//导出功能
const handleExport = () => {
window.open(
`${process.env.VUE_APP_BASE_API}/teacher/export?pageNo=${state.currentPage1
}&pageSize=${state.pageSize1}
window.open (
`${process.env.VUE_APP_BASE_API}/teacher/export?pageNo=${state.searchParam.currentPage
}&pageSize=${state.searchParam.pageSize}
&teacherNameOrUserNo=${state.searchParam.teacherNameOrUserNo ? state.searchParam.teacherNameOrUserNo : ""}
&systemId=${state.searchParam.systemId ? state.searchParam.systemId : ""}
&tlevelId=${state.searchParam.tlevelId ? state.searchParam.tlevelId : ""
@@ -1189,6 +1216,8 @@ export default {
return {
...toRefs(state),
rules,
rule,
// customPreview,
clearNonNumber,
// managerChange,
headers,

View File

@@ -32,8 +32,9 @@ ExternalLecturer
<span class="line" ></span>
<a-descriptions title="其他信息" bordered :column="4" :contentStyle="rowCenter" :labelStyle="rowCenter" >
<!-- 一层 -->
<a-descriptions-item label="讲师介绍" :span="4"><div style="min-width: 500px;">{{formParam.description}}</div> </a-descriptions-item>
<a-descriptions-item label="备注" :span="4">{{formParam.remark}}</a-descriptions-item>
<a-descriptions-item label="讲师介绍" :span="4"><div style="min-width: 500px;"> {{formParam.description===null?'--':formParam.description}}</div> </a-descriptions-item>
<a-descriptions-item label="备注" :span="4">
{{formParam.remark===null?'--':formParam.remark}}</a-descriptions-item>
</a-descriptions>
<!-- 记录 -->
<div style="margin-top: 1px;"></div>
@@ -80,7 +81,7 @@ ExternalLecturer
<script lang ="jsx">
import { useRouter,useRoute } from "vue-router";
import { reactive, toRefs, ref } from "vue"
import {getOuterTeacherById,getTeacherCourseList } from "../../api/Lecturer";
import {getTeacherById,getTeacherCourseList } from "../../api/Lecturer";
export default{
name :"LookExternalLecturer",
components:{
@@ -113,9 +114,9 @@ export default{
//外部讲师详情
const TeacherSystem = () => {
getOuterTeacherById(state.id).then((res) => {
getTeacherById(state.id).then((res) => {
console.log("内部讲师详情", res.data);
state.formParam = res.data.data
state.formParam = res.data.data[0]
state.formParam.photo = state.formParam.photo ===null ? 'https://p0.itc.cn/q_70/images01/20211013/f45d91616a364d6ea9c42a8db69734aa.png' : state.formParam.photo
})
.catch((err) => {

View File

@@ -5,9 +5,12 @@
<span>查看讲师</span>
<router-link to="/lecturerList" class="goback">
<span class="return"></span>
<router-link class="returntext" to="/lecturerList" style="line-height:47px ">
<!-- <router-link class="returntext" to="/lecturerList" style="line-height:47px ">
返回
</router-link>
</router-link> -->
<div class="returntext" to="/goback" style="line-height:47px " @click="goback">
返回
</div>
</router-link>
</a-layout-header>
<a-divider style="height: 1px; background-color: #b7b8b7 ;margin: 0;" />
@@ -117,7 +120,8 @@
</template>
<script lang ="jsx">
import { useRouter,useRoute } from "vue-router";
import { reactive, toRefs, ref } from "vue"
import { reactive, toRefs, ref, computed } from "vue"
import { useStore } from "vuex";
import {getTeacherById,getTeacherCourseList ,getTeacherLogList} from "../../api/Lecturer";
export default{
name :"LookInsideLecturer",
@@ -170,10 +174,6 @@ export default{
});
}
TeacherSystem()
//返回上一层
const handleBack=()=>{
router.back()
};
//授课记录列表
const teacherrecordsColumns = ref([
{
@@ -199,12 +199,18 @@ export default{
width: 120,
},
{
title: '内容分类',
dataIndex: 'teaching',
key: 'teaching',
elipsis: true, align: "center",
width: 120,
},
title: "内容分类",
width: 100,
dataIndex: "sysType1",
ellipsis: true,
key: "keywords",
align: "center",
// customRender: ({ record,text }) =>
// `${getSysTypeMap(record.sysType1, record.sysTypeId)?getSysTypeMap(record.sysType1) : ""}
// ${getSysTypeMap(record.sysType2, record.sysTypeId)?'-'+getSysTypeMap(record.sysType2) : ""}
// ${getSysTypeMap(record.sysType3, record.sysTypeId)?'-'+getSysTypeMap(record.sysType3) : ""}
// `
},
{
title: '课程类型',
dataIndex: 'type',
@@ -284,6 +290,7 @@ export default{
// api接口
getTeacherCourseList(obj).then((res) => {
console.log(res);
teacherrecordstableData.value = res.data.data.records
state.teacherrecordstableDataTotal = Number(res.data.data.total);
state.teacherrecordsLoading = false
@@ -343,12 +350,28 @@ export default{
})
state.promotionrecordsLoading = false
};
const goback = ()=>{
router.back()
}
// const store = useStore();
// // 内容分类
// const sysTypeOptions = computed(() => {return store.state.content_type;});
// //内容分类
// const getSysTypeMap = (code) => {
// if(code=="")return
// // console.log(store.state.sysTypeMap,'map集合');
// return store.state.sysTypeMap.get(code)
// }
// getSysTypeMap()
// getpromotionrecordstableData()
return{
...toRefs(state),
router,
goback,
// getSysTypeMap,
// sysTypeOptions,
TeacherSystem,
handleBack,
rowCenter:{"text-align":"center"},
teacherrecordstableData,
teacherrecordsColumns,