This commit is contained in:
nisen
2023-09-06 17:48:16 +08:00
parent f543d1ee5b
commit 4709e99cc3
11 changed files with 820 additions and 749 deletions

View File

@@ -1,10 +1,6 @@
NODE_ENV=boe
VUE_APP_BASE=/manage
VUE_APP_BASE_API=/manageApi
# 教师节上传图片文件夹id
VUE_APP_PIC_FOLDERID=1147577187794841600
# 教师节上传zip文件夹id
VUE_APP_TOOL_FOLDERID=1147577145918910464
VUE_APP_LOGIN_URL=//u-pre.boe.com/web?returnUrl=
VUE_APP_BOE_API_URL=//u-pre.boe.com

View File

@@ -1,6 +1,10 @@
NODE_ENV=prod
VUE_APP_BASE=/manage
VUE_APP_BASE_API=/manageApi
# 教师节上传图片文件夹id
VUE_APP_PIC_FOLDERID=1148997110156759040
# 教师节上传zip文件夹id
VUE_APP_TOOL_FOLDERID=1148996610925531136
VUE_APP_PROXY_URL=//u.boe.com/

View File

@@ -80,6 +80,14 @@ const opinionDelete = (params) => http.delete(`${ACTIVITYAPI}/xboe/m/boe/opinion
const query = (type) => http.get('/systemapi/xboe/m/assistance/protocol/query?type=' + type);
// 上传图片接口
const importPic = (data = {}) => http.post(`/systemapi/api/m/xfile/base/file/upload`, data, {
headers: {
'Content-Type': 'multipart/form-data'
}
});
@@ -109,5 +117,6 @@ export {
teachersDelete,
opinionList,
opinionDelete,
query
query,
importPic
}

View File

@@ -1,5 +1,5 @@
<template>
<a-drawer class="recommend" v-model:visible="visible" width="80%" title="添加师" @close="closeDrawer"
<a-drawer class="recommend" v-model:visible="visible" width="80%" title="添加师" @close="closeDrawer"
:maskClosable="false">
<div class="cstm_items">
<div class="signbox">
@@ -34,7 +34,7 @@
style="width: 88%; height: 40px; border-radius: 8px" :maxlength="30" />
</div>
</div>
<div class="cstm_items">
<!-- <div class="cstm_items">
<div class="signbox">
<div class="sign">
<img src="@/assets/images/coursewareManage/asterisk.png" alt="" />
@@ -50,17 +50,15 @@
</div>
</template>
</a-input>
</div>
</div>
</div> -->
<div class="cstm_items">
<div class="signbox">
<span style="margin-right: 3px">教师等级</span>
</div>
<div class="b_input">
<a-input-number style="width: 88%; height: 40px; line-height: 40px; border-radius: 8px" :min="0"
:max="999999" placeholder="请输入教师等级" :precision="0" v-model:value="formData.teacherLevel">
</a-input-number>
<a-input v-model:value="formData.teacherLevel" maxlength="50"
style="width: 88%; height: 40px; border-radius: 8px" placeholder="请输入教师等级" />
</div>
</div>
<div class="cstm_items">
@@ -125,7 +123,7 @@ const formData = useResetRef({
teacherLevel: "",
teacherName: "",
teacherNo: "",
teacherTime: ""
// teacherTime: ""
});
const emit = defineEmits(['getList'])
const visible = ref(false);
@@ -142,12 +140,12 @@ const formDataRule = {
message: "请输入课程名称",
},
],
teacherTime: [
{
required: true,
message: "请输入授课时长",
},
],
// teacherTime: [
// {
// required: true,
// message: "请输入授课时长",
// },
// ],
sort: [
{
required: true,

View File

@@ -122,7 +122,7 @@ const emit = defineEmits(['change'])
const submit = () => {
console.log('提交', files);
if (!params.value.picPath) return message.error('请上传轮播图图片')
if (!checked.value) return message.error('请先阅读并遵守平台内容发布要求')
// if (!checked.value) return message.error('请先阅读并遵守平台内容发布要求')
carouseAddAndUpdate(params.value).then((result) => {
console.log(result);
emit('change')

View File

@@ -104,12 +104,13 @@ const headers = { token: getCookieForName("token") };
const uploadUrl = ref(props.url);
const downLoad = () => {
console.log(props.templateUrl);
window.open(props.templateUrl)
// window.open(`/activityApi/xboe/m/boe/tools/url/download?urlStr=https:${process.env.VUE_APP_BOE_API_URL}${props.templateUrl}&fileName=导入教师模版.xlsx`)
// window.open(`https:${process.env.VUE_APP_BOE_API_URL}${props.templateUrl}`)
window.open(`/upload/导入教师模版.xlsx`)
}
const { start } = useTimeout(async ({ file }) => {
if (file.status == 'done' && file.response.code == 200) {
fileList.value = [...fileList.value];
emit("change", "done");
message.success("导入成功");
throw Error("查询任务结束");
} else {
@@ -120,6 +121,7 @@ const { start } = useTimeout(async ({ file }) => {
}, 1000);
const closeDrawer = () => {
emit("change", "done");
visible.value = false;
fileList.value = [];
};

View File

@@ -10,7 +10,7 @@
</div>
<div class="b_input">
<a-input v-model:value="params.name" placeholder="请输入标题" show-count
style="width: 88%; height: 40px; border-radius: 8px" :maxlength="20" />
style="height: 40px; border-radius: 8px" :maxlength="20" />
</div>
</div>
<div class="cstm_items">
@@ -31,8 +31,14 @@
<span style="margin-right: 3px">正文</span>
</div>
<div class="b_input">
<a-textarea v-model:value="params.content" :auto-size="{ minRows: 5 }"
style="width: 88%; border-radius: 8px" placeholder="请输入具体内容......" />
<!-- <a-textarea v-model:value="params.content" :auto-size="{ minRows: 5 }"
style="width: 88%; border-radius: 8px" placeholder="请输入具体内容......" /> -->
<div style="border: 1px solid #ccc;">
<Toolbar style="border-bottom: 1px solid #ccc" :editor="editorRef" :defaultConfig="toolbarConfig"
:mode="mode" />
<Editor style="height: 300px; overflow-y: hidden" v-model="valueHtml" :defaultConfig="editorConfig"
:mode="mode" @onCreated="handleCreated" @onChange="handleChange"/>
</div>
</div>
</div>
<div class="cstm_items" style="align-items: start;">
@@ -51,10 +57,59 @@
</a-modal>
</template>
<script setup>
import { ref, watchEffect, defineProps, defineEmits, computed, watch, onMounted } from 'vue'
import { ref, watchEffect, defineProps, defineEmits, computed, watch, onMounted, shallowRef } from 'vue'
import { message } from "ant-design-vue";
import { noticeAddAndUpdate, noticeDataById } from '@/api/grateful'
import Agreement from '@/components/Grateful/Agreement'
import { noticeAddAndUpdate, noticeDataById, importPic } from '@/api/grateful'
import "@wangeditor/editor/dist/css/style.css";
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
import { fileUp } from "../../api/indexEval";
const folderId = ref(process.env.VUE_APP_PIC_FOLDERID)
const picPath = ref('')
const path = computed(() => `https:${process.env.VUE_APP_BOE_API_URL}/upload${picPath.value}`)
// 文本编辑器
const mode = "simple"
// 内容 HTML
const valueHtml = ref("");
const editorRef = shallowRef();
const toolbarConfig = { excludeKeys: ["insertVideo", "insertImage"] };
const editorConfig = { placeholder: "请输入内容...", MENU_CONF: {} };
editorConfig.MENU_CONF["uploadImage"] = {
// 自定义上传
async customUpload(file, insertFn) {
const formData = new FormData();
formData.append("file", file);
formData.append("folderId", folderId.value);
importPic(formData).then((res) => {
if (res.status === 200) {
console.log(res);
picPath.value = res.data.result.path
console.log(path.value);
insertFn(path.value,file.name,res.data.result.path);
}
})
// fileUp(formData).then((res) => {
// if (res.data.code === 200) {
// // 最后插入图片 url alt href
// console.log(
// "上传图片结果",
// process.env.VUE_APP_FILE_PATH + res.data.data
// );
// insertFn(
// process.env.VUE_APP_FILE_PATH + res.data.data,
// file.name,
// res.data.data
// );
// }
// });
},
};
const handleChange = (editor) => {
console.log(editor);
}
const handleCreated = (editor) => {
editorRef.value = editor; // 记录 editor 实例,重要!
};
const props = defineProps({
visiable: Boolean,
id: String
@@ -78,6 +133,7 @@ onMounted(() => {
params.value.name = name;
timeList.value = [startTime, endTime];
params.value.content = content;
valueHtml.value = content;
})
})
@@ -87,18 +143,19 @@ const timeChange = (time, timeStr) => {
}
const submit = async () => {
if (!checked.value) {
message.error("请勾选平台内容发布要求");
return
}
params.value.content = valueHtml.value
// if (!checked.value) {
// message.error("请勾选平台内容发布要求");
// return
// }
if (!params.value.name) {
message.error("请输入标题内容");
return
}
if (!params.value.content) {
message.error("请输入正文具体内容");
return
}
// if (!params.value.content) {
// message.error("请输入正文具体内容");
// return
// }
const result = await noticeAddAndUpdate(params.value)
if (result.code == 200) {
if (props.id) {
@@ -137,8 +194,8 @@ const cancel = () => {
.cstm_items {
display: flex;
width: 80%;
margin: auto;
width: 90%;
// margin: auto;
align-items: center;
margin-bottom: 23px;

View File

@@ -329,7 +329,7 @@
<router-link to="/caserecommended">案例推荐</router-link>
</a-menu-item>
</a-sub-menu>
<!-- 感恩教师 -->
<!-- 教师专区 -->
<a-sub-menu key="sub22" @titleClick="titleClick" v-if="checkMenu('gratefulnotice,gratefulcarousel,teacherempowerment,teachertopic,tooldown,teacheropinion')">
<template #icon>
<div class="imgBox">
@@ -339,7 +339,7 @@
/>
</div>
</template>
<template #title>感恩教师</template>
<template #title>教师专区</template>
<a-menu-item key="sub22-1" v-if="checkMenu('gratefulnotice')">
<span
:class="{
@@ -374,7 +374,7 @@
circle: selectedKeys[0] === 'sub22-4' ? false : true,
}"
></span>
<router-link to="/teachertopic">师资大全</router-link>
<router-link to="/teachertopic">认证讲师库2023</router-link>
</a-menu-item>
<a-menu-item key="sub22-5" v-if="checkMenu('tooldown')">
<span
@@ -627,7 +627,7 @@
<router-link to="/casemanage">案例</router-link>
</a-menu-item>
<a-menu-item key="sub22" @titleClick="titleClick">
<router-link to="/tooldown">感恩教师</router-link>
<router-link to="/tooldown">教师专区</router-link>
</a-menu-item>
<a-menu-item key="sub13" @titleClick="titleClick">
<router-link to="/articlemanage">文章</router-link>
@@ -865,7 +865,7 @@
href: "/teachertopic",
openKeys: "sub22",
selectedKeys: "sub22-4",
pagename: "师资大全",
pagename: "认证讲师库2023",
},
{
href: "/tooldown",

View File

@@ -143,7 +143,7 @@ const handle = ({ id }) => ({
});
const handleMsg = {
del: "你确定要删除这条意见吗?",
del: "你确定要删除这条轮播图吗?",
};
function handleOper(record, type, status = "") {

View File

@@ -28,16 +28,16 @@
<div class="btns" style="margin-right: 10px;">
<div class="btn btn3">
<div class="search"></div>
<div class="btnText">添加</div>
<div class="btnText">添加师</div>
</div>
</div>
</AddTeacherInfo>
<ImportTeacher @change="change" title="导入师" :template-url="teacherTemplateUrl" :data="{ type: 3 }"
<ImportTeacher @change="change" title="导入师" :template-url="teacherTemplateUrl" :data="{ type: 3 }"
:url="`/activityApi/xboe/m/boe/teachers/import`" name="file">
<div class="btns">
<div class="btn btn3">
<div class="search"></div>
<div class="btnText">导入</div>
<div class="btnText">导入师</div>
</div>
</div>
</ImportTeacher>
@@ -98,18 +98,18 @@ const column = ref([
);
},
},
{
title: "授课时长(H)",
dataIndex: "teacherTime",
key: "teacherTime",
width: 20,
align: "center",
customRender: ({ record }) => {
return (
<span>{record.teacherTime ? record.teacherTime : '-'}</span>
);
},
},
// {
// title: "授课时长(H)",
// dataIndex: "teacherTime",
// key: "teacherTime",
// width: 20,
// align: "center",
// customRender: ({ record }) => {
// return (
// <span>{record.teacherTime ? record.teacherTime : '-'}</span>
// );
// },
// },
{
title: "教师等级",
dataIndex: "teacherLevel",
@@ -118,7 +118,7 @@ const column = ref([
align: "center",
customRender: ({ record }) => {
return (
<span>{record.teacherLevel ? record.teacherLevel + '级' : '-'}</span>
<span>{record.teacherLevel ? record.teacherLevel : '-'}</span>
);
},
},
@@ -183,7 +183,11 @@ const teacherLevelList = ref([{
label: "5级",
},
])
const change = (value) => {
if (value === 'done') {
searchInfo()
}
}
const carouselTableRef = ref();
const searchInfo = () => {

View File

@@ -130,23 +130,24 @@ const reseatDownloadList = () => {
const downLoadFile = (toolInfo) => {
if (!toolInfo.filePath) return;
console.log(toolInfo);
toolDown({
urlStr: `https:${process.env.VUE_APP_BOE_API_URL}/upload${toolInfo.filePath}`,
fileName: toolInfo.name
}).then((result) => {
if (!result.data) {
return
}
const link = document.createElement('a');// 创建a标签
let blob = new Blob([result.data], { type: '' }); // 设置文件类型
link.style.display = "none";
link.href = URL.createObjectURL(blob); // 创建URL
link.setAttribute("download", `${toolInfo.name}`);
document.body.appendChild(link);
link.click();
URL.revokeObjectURL(link.href);
document.body.removeChild(link);
})
window.open(`/activityApi/xboe/m/boe/tools/url/download?urlStr=https:${process.env.VUE_APP_BOE_API_URL}/upload${toolInfo.filePath}&fileName=${toolInfo.name}`)
// toolDown({
// urlStr: `https:${process.env.VUE_APP_BOE_API_URL}/upload${toolInfo.filePath}`,
// fileName: toolInfo.name
// }).then((result) => {
// if (!result.data) {
// return
// }
// const link = document.createElement('a');// 创建a标签
// let blob = new Blob([result.data], { type: 'application/zip' }); // 设置文件类型
// link.style.display = "none";
// link.href = URL.createObjectURL(blob); // 创建URL
// link.setAttribute("download", `${toolInfo.name}`);
// document.body.appendChild(link);
// link.click();
// URL.revokeObjectURL(link.href);
// document.body.removeChild(link);
// })
};
const handle = ({ id }) => ({