富文本组件调整

This commit is contained in:
wangxuemei
2024-08-09 16:31:41 +08:00
parent 5adb182c1f
commit 860cb821ae
7 changed files with 99 additions and 90 deletions

View File

@@ -1,9 +1,10 @@
import http from "./config"; import http from "./config";
//列表查询内部讲师授课记录 //列表查询内部讲师授课记录
export const getNewInTeacherCourseList = (obj) => http.post('/admin/teacher/getNewInTeacherCourseList', obj) // http://127.0.0.1:30001/admin/teacher/getTeacherCourseList
// export const getNewInTeacherCourseList = (obj) => http.post('/admin/teacher/getNewInTeacherCourseList', obj)
//内部讲师授课记录详情 //内部讲师授课记录详情
export const getTeacherCourseList = (obj) => http.post(`/admin/teacher/getTeacherCourseList?id=${obj}`) // export const getTeacherCourseList = (obj) => http.post(`/admin/teacher/getTeacherCourseList?id=${obj}`)
// export const getTeacherCourseList = (obj) => http.post('/admin/teacher/getTeacherCourseList', obj) export const getTeacherCourseList = (obj) => http.post('/admin/teacher/getTeacherCourseList', obj)
//授课记录导出 //授课记录导出
export const getexport = (obj) => http.post('/lesson_records/export', obj) export const getexport = (obj) => http.post('/lesson_records/export', obj)
//授课记录导入 //授课记录导入

View File

@@ -17,15 +17,28 @@
// 富文本编辑器文档链接: https://www.wangeditor.com/v5/getting-started.html // 富文本编辑器文档链接: https://www.wangeditor.com/v5/getting-started.html
// 引入富文本编辑器CSS // 引入富文本编辑器CSS
import '@wangeditor/editor/dist/css/style.css'; import '@wangeditor/editor/dist/css/style.css';
import { onBeforeUnmount, ref, shallowRef } from 'vue'; import { onBeforeUnmount, ref, shallowRef,watch,defineProps, defineEmits } from 'vue';
// 导入富文本编辑器的组件 // 导入富文本编辑器的组件
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'; import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
const props = defineProps({
value: {
type: String,
default: ()=>'',
},
});
// 编辑器实例,必须用 shallowRef // 编辑器实例,必须用 shallowRef
const editorRef = shallowRef(); const editorRef = shallowRef();
const emit = defineEmits(['update:value'])
// 内容 HTML // 内容 HTML
const valueHtml = ref(''); const valueHtml = ref('');
watch(()=>valueHtml.value,(val)=>{
emit('update:value',val)
})
watch(()=>props.value,(val)=>{
valueHtml.value = val
console.log(val,'222222222222222');
})
const toolbarConfig = { const toolbarConfig = {
excludeKeys: [ excludeKeys: [
'insertLink', // 排除菜单组,写菜单组 key 的值即可 'insertLink', // 排除菜单组,写菜单组 key 的值即可

View File

@@ -124,9 +124,9 @@
<!-- 供应商 ,邮箱--> <!-- 供应商 ,邮箱-->
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="供应商" name="levelId"> <a-form-item label="供应商" name="supplier">
<a-input v-model:value="formParam.levelId" class="draitem" <a-input v-model:value="formParam.supplier" class="draitem"
placeholder="请输入供应商(未命名)" allowClear showSearch> placeholder="请输入供应商" allowClear showSearch>
</a-input> </a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -556,13 +556,14 @@ export default {
teacherIntrofuce: null, teacherIntrofuce: null,
description:null, description:null,
remark: null, remark: null,
id:null id:null,
supplier:null,
} }
console.log(state.formParam); console.log(state.formParam);
} }
const rules = { const rules = {
name: [{ required: true, message: '讲师不能为空' }], name: [{ required: true, message: '讲师不能为空' }],
supplier:[{ required: true, message: '供应商不能为空' }],
} }
//表格内查看数据操作 //表格内查看数据操作
const handleLook = (record) => { const handleLook = (record) => {

View File

@@ -2,7 +2,7 @@
<template> <template>
<div> <div>
<!-- 搜索框及按钮 --> <!-- 搜索框及按钮 -->
<div class="filter" style="min-width: 1380px;"> <div class="filter" >
<a-form layout="inline"> <a-form layout="inline">
<a-form-item class="select"> <a-form-item class="select">
<!-- v-model:value="searchParam.name" --> <!-- v-model:value="searchParam.name" -->
@@ -386,28 +386,28 @@ export default {
// dataIndex: 'userNo', // dataIndex: 'userNo',
// key: 'userNo', // key: 'userNo',
// elipsis: true, // elipsis: true,
// width: 120, // width: 100,
// }, // },
{ {
title: '授课讲师 ', title: '授课讲师 ',
dataIndex: 'teacher', dataIndex: 'teacher',
key: 'teacher', key: 'teacher',
elipsis: true, align: "center", elipsis: true, align: "center",
width: 120, width: 100,
}, },
{ {
title: '手机号码 ', title: '手机号码 ',
dataIndex: 'mobile', dataIndex: 'mobile',
key: 'mobile', key: 'mobile',
elipsis: true, align: "center", elipsis: true, align: "center",
width: 120, width: 100,
}, },
{ {
title: '课程类型 ', title: '课程类型 ',
dataIndex: 'type', dataIndex: 'type',
key: 'type', key: 'type',
elipsis: true, align: "center", elipsis: true, align: "center",
width: 120, width: 100,
customRender: (value) => { customRender: (value) => {
return ( return (
<div> <div>
@@ -427,14 +427,14 @@ export default {
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
elipsis: true, align: "center", elipsis: true, align: "center",
width: 120, width: 100,
}, },
{ {
title: '数据来源', title: '数据来源',
dataIndex: 'entryType', dataIndex: 'entryType',
key: 'entryType', key: 'entryType',
elipsis: true, align: "center", elipsis: true, align: "center",
width: 120, width: 100,
customRender: (value) => { customRender: (value) => {
return ( return (
<div> <div>
@@ -453,49 +453,49 @@ export default {
dataIndex: 'beginTime', dataIndex: 'beginTime',
key: 'beginTime', key: 'beginTime',
elipsis: true, align: "center", elipsis: true, align: "center",
width: 120, width: 100,
}, },
{ {
title: '开课场地 ', title: '开课场地 ',
dataIndex: 'address', dataIndex: 'address',
key: 'address', key: 'address',
elipsis: true, align: "center", elipsis: true, align: "center",
width: 120, width: 100,
}, },
{ {
title: '内容分类', title: '内容分类',
dataIndex: 'teaching', dataIndex: 'teaching',
key: 'teaching', key: 'teaching',
elipsis: true, align: "center", elipsis: true, align: "center",
width: 120, width: 100,
}, },
{ {
title: '授课时长(H) ', title: '授课时长(H) ',
dataIndex: 'duration', dataIndex: 'duration',
key: 'duration', key: 'duration',
elipsis: true, align: "center", elipsis: true, align: "center",
width: 120, width: 100,
}, },
{ {
title: '参训总人数', title: '参训总人数',
dataIndex: 'studys', dataIndex: 'studys',
key: 'studys', key: 'studys',
elipsis: true, align: "center", elipsis: true, align: "center",
width: 120, width: 80,
}, },
{ {
title: '评分', title: '评分',
dataIndex: 'score', dataIndex: 'score',
key: 'score', key: 'score',
elipsis: true, align: "center", elipsis: true, align: "center",
width: 120, width: 80,
}, },
{ {
title: '开课状态 ', title: '开课状态 ',
dataIndex: 'status', dataIndex: 'status',
key: 'status', key: 'status',
elipsis: true, align: "center", elipsis: true, align: "center",
width: 120, width: 100,
customRender: (value) => { customRender: (value) => {
return ( return (
<div> <div>
@@ -516,7 +516,7 @@ export default {
elipsis: true, elipsis: true,
align: "right", align: "right",
fixed: "right", fixed: "right",
width: 400, width: 200,
scopedSlots: { customRender: "action" }, scopedSlots: { customRender: "action" },
}, },
]) ])

View File

@@ -218,11 +218,11 @@
<!-- 初始时长 认证 --> <!-- 初始时长 认证 -->
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="初始授课时长" name="defaultTeachingTime"> <a-form-item label="初始授课时长" name="defaultteachingTime">
<a-input v-model:value="formParam.defaultTeachingTime" style="width:80%; height: 40px; border-radius: 8px; " placeholder="0" <a-input v-model:value="formParam.defaultteachingTime" style="width:80%; height: 40px; border-radius: 8px; " placeholder="0"
allowClear showSearch suffix="分钟"> allowClear showSearch suffix="分钟">
</a-input> </a-input>
<span style="margin-left: 5px ;" v-if="formParam.defaultTeachingTime!= null">{{ (formParam.defaultTeachingTime /60 ).toFixed(2)}}小时</span> <span style="margin-left: 5px ;" v-if="formParam.defaultteachingTime!= null">{{ (formParam.defaultteachingTime /60 ).toFixed(2)}}小时</span>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
@@ -268,8 +268,9 @@
<!-- 工作经历 --> <!-- 工作经历 -->
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="24"> <a-col :span="24">
{{ formParam.workExperience }}
<a-form-item label="工作经历"> <a-form-item label="工作经历">
<Editor v-model="formParam.workExperience "/> <Editor v-model:value="formParam.workExperience" :isupload="isupload"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@@ -426,8 +427,8 @@ export default {
formParam: { formParam: {
userNo:null, userNo:null,
certStatus: 0,//认证状态 certStatus: 0,//认证状态
defaultTeachingTime: '0', defaultteachingTime: '0',
vf:true
}, },
searchParam: { searchParam: {
name:null, name:null,
@@ -464,7 +465,9 @@ export default {
message.error("仅支持jpg、gif、png、jpeg、svg、bmp格式!"); message.error("仅支持jpg、gif、png、jpeg、svg、bmp格式!");
return false; return false;
} }
watch(()=>state.formParam.workExperience,(val)=>{
console.log(val,'11111')
})
let isLt1M = file.size < 2000000; let isLt1M = file.size < 2000000;
console.log(file.size, isLt1M) console.log(file.size, isLt1M)
if (!isLt1M) { if (!isLt1M) {
@@ -549,6 +552,10 @@ const beforeUpload2 = (file) => {
console.log("获取讲师", LecturerSystemList); console.log("获取讲师", LecturerSystemList);
}) })
} }
const isupload = (val)=>{
console.log(val,'val')
}
const addContentData = () => { const addContentData = () => {
state.showContent = true state.showContent = true
} }
@@ -788,14 +795,14 @@ console.log( "讲师体系id" +val);
dataIndex: 'teaching', dataIndex: 'teaching',
key: 'teaching', key: 'teaching',
elipsis: true, align: "center", elipsis: true, align: "center",
width: 100, width: 120,
}, },
{ {
title: '在职状态 ', title: '在职状态 ',
dataIndex: 'waitStatus', dataIndex: 'waitStatus',
key: 'waitStatus', key: 'waitStatus',
elipsis: true, align: "center", elipsis: true, align: "center",
width: 100, width: 120,
customRender: (value) => { customRender: (value) => {
return ( return (
<div> <div>
@@ -814,7 +821,7 @@ console.log( "讲师体系id" +val);
dataIndex: 'certStatus', dataIndex: 'certStatus',
key: 'certStatus', key: 'certStatus',
elipsis: true, align: "center", elipsis: true, align: "center",
width: 100, width: 120,
customRender: (value) => { customRender: (value) => {
return ( return (
<div> <div>
@@ -833,7 +840,7 @@ console.log( "讲师体系id" +val);
dataIndex: 'status', dataIndex: 'status',
key: 'status', key: 'status',
elipsis: true, align: "center", elipsis: true, align: "center",
width: 100, width: 120,
customRender: (value) => { customRender: (value) => {
return ( return (
<div> <div>
@@ -853,7 +860,7 @@ console.log( "讲师体系id" +val);
dataIndex: 'operation', dataIndex: 'operation',
key: 'operation', key: 'operation',
elipsis: true, elipsis: true,
width: 400, width: 200,
align: "right", align: "right",
scopedSlots: { customRender: "action" }, scopedSlots: { customRender: "action" },
}, },
@@ -927,46 +934,38 @@ console.log( "讲师体系id" +val);
}; };
// 新增讲师 // 新增讲师
const addTeacher = () => { const addTeacher = () => {
cancel()
state.teacherdialog = true; state.teacherdialog = true;
state.teacherdialogtitle = '新增讲师' state.teacherdialogtitle = '新增讲师'
state.formParam.vf=true
} }
//修改讲师信息弹窗 //修改讲师信息弹窗
const handleModify = (record) => { const handleModify = (record) => {
state.teacherdialog = true; state.teacherdialog = true;
state.teacherdialogtitle = '修改信息' state.teacherdialogtitle = '修改信息'
state.id = record.id state.id = record.id
state.formParam.vf=false
TeacherSystem() TeacherSystem()
} }
//保存 //保存
const createTeacherDialog = () => { const createTeacherDialog = () => {
console.log(state.formParam); console.log(state.formParam);
if (state.formParam.userNo != undefined) { console.log(state.formParam.vf)
updateInTeacher(state.formParam).then(response => { // if (state.formParam.vf == false) {
message.success("修改成功"); // updateInTeacher(state.formParam).then(response => {
}); // message.success("修改成功");
} // });
// let objA = {...state.formParam}; // }
// state.formParam ={ // let a =
// name:'新增测试', // {"kid":"6B049FAF-C314-7CCF-0D28-0D23F4C42531","id":"965342027497607168","photo":"/2022/12/1057603184561385472.jpg","name":"李玉冰","systemId":null,"defaultteachingTime":"11","teaching":"420","levelId":null,"levelName":null,"certStatus":1,"description":"京东方大学学习平台管理员","workExperience":"<p>卫健委因无法准确掌握实际数量即日起不再公布无症状感染者数据。2、官方在感染高风险人群、60岁以上老年人群等开展第二剂次加强免疫接种</p>","courses":null,"expertise":null,"teacherType":null,"certifyBy":null,"certifyAt":null,"certification":null,"userNo":"00004409","orgName":null,"salaryId":null,"salaryName":null,"waitStatus":"0","status":1,"mobile":null,"email":null,"remark":null,"sysupdateBy":null,"tsystemName":"D事业群"}
// userNo:'12315', // else {
// departId:'8465784657', // insertTeacher(state.formParam)
// defaultTeachingTime:50, // .then((res) => {
// leveId:1, // message.success("保存成功");
// systemid:249, // }).catch((err) => {
// certStatus:1, // console.log(err);
// description:'测试13.00', // });
// workExperience:'测试13.00',
// courses:'测试13.00',
// } // }
else {
insertTeacher(state.formParam)
.then((res) => {
message.success("保存成功");
}).catch((err) => {
console.log(err);
});
}
state.teacherdialog = false; state.teacherdialog = false;
getTableDate(); getTableDate();
}; };
@@ -1031,7 +1030,7 @@ console.log( "讲师体系id" +val);
// userNo:null, // userNo:null,
departId: null, departId: null,
tlevelId: null, tlevelId: null,
defaultTeachingTime: 0, defaultteachingTime: 0,
// levelName:null, // levelName:null,
// leveName:null, // leveName:null,
tsystemId: null, tsystemId: null,
@@ -1041,13 +1040,14 @@ console.log( "讲师体系id" +val);
workExperience:null, workExperience:null,
courses:null, courses:null,
} }
} }
const rules = { const rules = {
name: [{ required: true, message: '讲师不能为空' }], name: [{ required: true, message: '讲师不能为空' }],
departId: [{ required: true, message: '组织不能为空' }], departId: [{ required: true, message: '组织不能为空' }],
tlevelId: [{ required: true, message: '讲师级别不能为空' }], tlevelId: [{ required: true, message: '讲师级别不能为空' }],
tsystemId: [{ required: true, message: '讲师体系不能为空' }], tsystemId: [{ required: true, message: '讲师体系不能为空' }],
defaultTeachingTime: [{ required: true, message: '授课时长不能为空' }], defaultteachingTime: [{ required: true, message: '授课时长不能为空' }],
certStatus: [{ required: true, message: '认证状态不能为空' }], certStatus: [{ required: true, message: '认证状态不能为空' }],
} }
@@ -1137,6 +1137,7 @@ console.log( "讲师体系id" +val);
infoteacherList, infoteacherList,
getinfoteacher, getinfoteacher,
addContentData, addContentData,
isupload,
AddContentList, AddContentList,
beforeUpload2, beforeUpload2,
} }

View File

@@ -652,7 +652,7 @@ export default {
dataIndex: 'feeCreated', dataIndex: 'feeCreated',
key: 'feeCreated', key: 'feeCreated',
elipsis: true, align: "center", elipsis: true, align: "center",
width: 120, width: 150,
customRender: (value) => { customRender: (value) => {
return ( return (
<div> <div>
@@ -733,7 +733,7 @@ export default {
let objA = { ...state.searchParam }; let objA = { ...state.searchParam };
objA.startDate = state.searchParam.startDate !== null ? dayjs(new Date(state.searchParam.startDate).getTime()).format("YYYY-MM-DD") : "", objA.startDate = state.searchParam.startDate !== null ? dayjs(new Date(state.searchParam.startDate).getTime()).format("YYYY-MM-DD") : "",
objA.endDate = state.searchParam.endDate !== null ? dayjs(new Date(state.searchParam.endDate).getTime()).format("YYYY-MM-DD") : "", objA.endDate = state.searchParam.endDate !== null ? dayjs(new Date(state.searchParam.endDate).getTime()).format("YYYY-MM-DD") : "",
getNewInTeacherCourseList(objA) getTeacherCourseList(objA)
.then((res) => { .then((res) => {
tableData.value = res.data.data.records tableData.value = res.data.data.records
state.tableDataTotal = Number(res.data.data.total); state.tableDataTotal = Number(res.data.data.total);

View File

@@ -9,13 +9,13 @@
:options="PlaceOfPayList"> :options="PlaceOfPayList">
</a-select> </a-select>
</a-form-item> </a-form-item>
<!-- <a-form-item class="select " > <a-form-item class="select " >
<a-range-picker style="width: 260px; height: 40px; border-radius: 8px" v-model:value="searchdate" separator="" <a-date-picker style="width: 260px; height: 40px; border-radius: 8px" v-model:value="searchdate"
:placeholder="['重新汇总上月周期']" @change="searchTimeChange" /> :placeholder="['重新汇总上月周期']" @change="searchTimeChange" />
</a-form-item> --> </a-form-item>
<a-form-item class="select"> <!-- <a-form-item class="select">
<a-month-picker placeholder="重新汇总上月周期" @change="onChange" style="width: 260px; height: 40px; border-radius: 8px" v-model:value="searchdate" /> <a-month-picker placeholder="重新汇总上月周期" @change="onChange" style="width: 260px; height: 40px; border-radius: 8px" v-model:value="searchdate" />
</a-form-item> </a-form-item> -->
<div style="display: flex; margin-bottom: 20px"> <div style="display: flex; margin-bottom: 20px">
<a-button @click="searchSubmit()" type="primary" class="resetbtn">查询 </a-button> <a-button @click="searchSubmit()" type="primary" class="resetbtn">查询 </a-button>
<!-- <div class="btn btn1" @click="searchReset" style="background:rgba(64, 158, 255, 0);" > --> <!-- <div class="btn btn1" @click="searchReset" style="background:rgba(64, 158, 255, 0);" > -->
@@ -201,14 +201,15 @@ export default {
teacherdialog: false, teacherdialog: false,
teacherdialoga: false, teacherdialoga: false,
teacherdialogtitle: null, teacherdialogtitle: null,
searchdate: null, //选择时间 // searchdate: null, //选择时间
startTime: null, //开始时间 startTime: null, //开始时间
endTime: null, //结束时间 endTime: null, //结束时间
searchParam: { searchParam: {
pageNo: "1", pageNo: "1",
pageSize: "10", pageSize: "10",
startDate: null, searchdate: null, //选择时间
endDate: null, // startDate: null,
// endDate: null,
}, },
queryFeeMonthly: { queryFeeMonthly: {
teacherNo: null, teacherNo: null,
@@ -290,16 +291,10 @@ export default {
}; };
//修改时间 //修改时间
const searchTimeChange = (e, date) => { const searchTimeChange = (e, date) => {
let startTime = date[0] + " 00:00:00"; console.log(date);
let endTime = date[1] + " 23:59:59"; console.log(state.searchdate );
state.startTime = new Date(startTime).getTime(); state.searchdate =date;
state.endTime = new Date(endTime).getTime() ; // console.log(date, state.searchParam.startDate, state.searchParam.endDate);
// state.searchParam.startDate = new Date(startDate).getTime() ;
// state.searchParam.endDate = new Date(endDate).getTime() ;
state.searchParam.startDate = state.startTime? state.startTime:null,
state.searchParam.endDate = state.endTime? state.endTime:null,
console.log( state.searchParam.startDate ? '111' :'222')
console.log(date, state.searchParam.startDate, state.searchParam.endDate);
}; };
//二级页面搜索 //二级页面搜索
const searchFeeMonthlya = () => { const searchFeeMonthlya = () => {
@@ -309,10 +304,8 @@ export default {
const getTableDate = (obj) => { const getTableDate = (obj) => {
state.tableLoading = true state.tableLoading = true
let objA = { ...state.searchParam }; let objA = { ...state.searchParam };
// let objA = {"pageNo":"1","pageSize":"10","startDate":'2024-06-01',"endDate":'2024-06-30'}; objA.searchdate=state.searchdate!==null? state.searchdate: "",
console.log(objA)
objA.startDate= state.searchParam.startDate!==null? dayjs(new Date(state.searchParam.startDate).getTime()).format("YYYY-MM-DD"): "",
objA.endDate=state.searchParam.endDate!==null? dayjs(new Date(state.searchParam.endDate).getTime()).format("YYYY-MM-DD"): "",
queryTeacherFeeTotalList(objA) queryTeacherFeeTotalList(objA)
.then((res) => { .then((res) => {
tableData.value = res.data.data.records tableData.value = res.data.data.records