mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-06 09:26:44 +08:00
修改
This commit is contained in:
4
.env.boe
4
.env.boe
@@ -1,10 +1,6 @@
|
|||||||
NODE_ENV=boe
|
NODE_ENV=boe
|
||||||
VUE_APP_BASE=/manage
|
VUE_APP_BASE=/manage
|
||||||
VUE_APP_BASE_API=/manageApi
|
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_LOGIN_URL=//u-pre.boe.com/web?returnUrl=
|
||||||
|
|
||||||
VUE_APP_BOE_API_URL=//u-pre.boe.com
|
VUE_APP_BOE_API_URL=//u-pre.boe.com
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
NODE_ENV=prod
|
NODE_ENV=prod
|
||||||
VUE_APP_BASE=/manage
|
VUE_APP_BASE=/manage
|
||||||
VUE_APP_BASE_API=/manageApi
|
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/
|
VUE_APP_PROXY_URL=//u.boe.com/
|
||||||
|
|
||||||
|
|||||||
@@ -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 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,
|
teachersDelete,
|
||||||
opinionList,
|
opinionList,
|
||||||
opinionDelete,
|
opinionDelete,
|
||||||
query
|
query,
|
||||||
|
importPic
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<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">
|
:maskClosable="false">
|
||||||
<div class="cstm_items">
|
<div class="cstm_items">
|
||||||
<div class="signbox">
|
<div class="signbox">
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
style="width: 88%; height: 40px; border-radius: 8px" :maxlength="30" />
|
style="width: 88%; height: 40px; border-radius: 8px" :maxlength="30" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cstm_items">
|
<!-- <div class="cstm_items">
|
||||||
<div class="signbox">
|
<div class="signbox">
|
||||||
<div class="sign">
|
<div class="sign">
|
||||||
<img src="@/assets/images/coursewareManage/asterisk.png" alt="" />
|
<img src="@/assets/images/coursewareManage/asterisk.png" alt="" />
|
||||||
@@ -50,17 +50,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</a-input>
|
</a-input>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="cstm_items">
|
<div class="cstm_items">
|
||||||
<div class="signbox">
|
<div class="signbox">
|
||||||
<span style="margin-right: 3px">教师等级</span>
|
<span style="margin-right: 3px">教师等级</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="b_input">
|
<div class="b_input">
|
||||||
<a-input-number style="width: 88%; height: 40px; line-height: 40px; border-radius: 8px" :min="0"
|
<a-input v-model:value="formData.teacherLevel" maxlength="50"
|
||||||
:max="999999" placeholder="请输入教师等级" :precision="0" v-model:value="formData.teacherLevel">
|
style="width: 88%; height: 40px; border-radius: 8px" placeholder="请输入教师等级" />
|
||||||
</a-input-number>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cstm_items">
|
<div class="cstm_items">
|
||||||
@@ -125,7 +123,7 @@ const formData = useResetRef({
|
|||||||
teacherLevel: "",
|
teacherLevel: "",
|
||||||
teacherName: "",
|
teacherName: "",
|
||||||
teacherNo: "",
|
teacherNo: "",
|
||||||
teacherTime: ""
|
// teacherTime: ""
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['getList'])
|
const emit = defineEmits(['getList'])
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
@@ -142,12 +140,12 @@ const formDataRule = {
|
|||||||
message: "请输入课程名称",
|
message: "请输入课程名称",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
teacherTime: [
|
// teacherTime: [
|
||||||
{
|
// {
|
||||||
required: true,
|
// required: true,
|
||||||
message: "请输入授课时长",
|
// message: "请输入授课时长",
|
||||||
},
|
// },
|
||||||
],
|
// ],
|
||||||
sort: [
|
sort: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ const emit = defineEmits(['change'])
|
|||||||
const submit = () => {
|
const submit = () => {
|
||||||
console.log('提交', files);
|
console.log('提交', files);
|
||||||
if (!params.value.picPath) return message.error('请上传轮播图图片')
|
if (!params.value.picPath) return message.error('请上传轮播图图片')
|
||||||
if (!checked.value) return message.error('请先阅读并遵守平台内容发布要求')
|
// if (!checked.value) return message.error('请先阅读并遵守平台内容发布要求')
|
||||||
carouseAddAndUpdate(params.value).then((result) => {
|
carouseAddAndUpdate(params.value).then((result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
emit('change')
|
emit('change')
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ const props = defineProps({
|
|||||||
fileType: Object,
|
fileType: Object,
|
||||||
data: Object,
|
data: Object,
|
||||||
templateUrl: {
|
templateUrl: {
|
||||||
type:String,
|
type: String,
|
||||||
defalut:'/upload/教师导入模版.xlsx'
|
defalut: '/upload/教师导入模版.xlsx'
|
||||||
},
|
},
|
||||||
template: {
|
template: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -104,12 +104,13 @@ const headers = { token: getCookieForName("token") };
|
|||||||
const uploadUrl = ref(props.url);
|
const uploadUrl = ref(props.url);
|
||||||
const downLoad = () => {
|
const downLoad = () => {
|
||||||
console.log(props.templateUrl);
|
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 }) => {
|
const { start } = useTimeout(async ({ file }) => {
|
||||||
if (file.status == 'done' && file.response.code == 200) {
|
if (file.status == 'done' && file.response.code == 200) {
|
||||||
fileList.value = [...fileList.value];
|
fileList.value = [...fileList.value];
|
||||||
emit("change", "done");
|
|
||||||
message.success("导入成功");
|
message.success("导入成功");
|
||||||
throw Error("查询任务结束");
|
throw Error("查询任务结束");
|
||||||
} else {
|
} else {
|
||||||
@@ -120,6 +121,7 @@ const { start } = useTimeout(async ({ file }) => {
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
const closeDrawer = () => {
|
const closeDrawer = () => {
|
||||||
|
emit("change", "done");
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
fileList.value = [];
|
fileList.value = [];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="b_input">
|
<div class="b_input">
|
||||||
<a-input v-model:value="params.name" placeholder="请输入标题" show-count
|
<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>
|
</div>
|
||||||
<div class="cstm_items">
|
<div class="cstm_items">
|
||||||
@@ -31,8 +31,14 @@
|
|||||||
<span style="margin-right: 3px">正文</span>
|
<span style="margin-right: 3px">正文</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="b_input">
|
<div class="b_input">
|
||||||
<a-textarea v-model:value="params.content" :auto-size="{ minRows: 5 }"
|
<!-- <a-textarea v-model:value="params.content" :auto-size="{ minRows: 5 }"
|
||||||
style="width: 88%; border-radius: 8px" placeholder="请输入具体内容......" />
|
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>
|
</div>
|
||||||
<div class="cstm_items" style="align-items: start;">
|
<div class="cstm_items" style="align-items: start;">
|
||||||
@@ -51,10 +57,59 @@
|
|||||||
</a-modal>
|
</a-modal>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<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 { message } from "ant-design-vue";
|
||||||
import { noticeAddAndUpdate, noticeDataById } from '@/api/grateful'
|
import { noticeAddAndUpdate, noticeDataById, importPic } from '@/api/grateful'
|
||||||
import Agreement from '@/components/Grateful/Agreement'
|
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({
|
const props = defineProps({
|
||||||
visiable: Boolean,
|
visiable: Boolean,
|
||||||
id: String
|
id: String
|
||||||
@@ -78,6 +133,7 @@ onMounted(() => {
|
|||||||
params.value.name = name;
|
params.value.name = name;
|
||||||
timeList.value = [startTime, endTime];
|
timeList.value = [startTime, endTime];
|
||||||
params.value.content = content;
|
params.value.content = content;
|
||||||
|
valueHtml.value = content;
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -87,18 +143,19 @@ const timeChange = (time, timeStr) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const submit = async () => {
|
const submit = async () => {
|
||||||
if (!checked.value) {
|
params.value.content = valueHtml.value
|
||||||
message.error("请勾选平台内容发布要求");
|
// if (!checked.value) {
|
||||||
return
|
// message.error("请勾选平台内容发布要求");
|
||||||
}
|
// return
|
||||||
|
// }
|
||||||
if (!params.value.name) {
|
if (!params.value.name) {
|
||||||
message.error("请输入标题内容");
|
message.error("请输入标题内容");
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!params.value.content) {
|
// if (!params.value.content) {
|
||||||
message.error("请输入正文具体内容");
|
// message.error("请输入正文具体内容");
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
const result = await noticeAddAndUpdate(params.value)
|
const result = await noticeAddAndUpdate(params.value)
|
||||||
if (result.code == 200) {
|
if (result.code == 200) {
|
||||||
if (props.id) {
|
if (props.id) {
|
||||||
@@ -137,8 +194,8 @@ const cancel = () => {
|
|||||||
|
|
||||||
.cstm_items {
|
.cstm_items {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 80%;
|
width: 90%;
|
||||||
margin: auto;
|
// margin: auto;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 23px;
|
margin-bottom: 23px;
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -143,7 +143,7 @@ const handle = ({ id }) => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const handleMsg = {
|
const handleMsg = {
|
||||||
del: "你确定要删除这条意见吗?",
|
del: "你确定要删除这条轮播图吗?",
|
||||||
};
|
};
|
||||||
|
|
||||||
function handleOper(record, type, status = "") {
|
function handleOper(record, type, status = "") {
|
||||||
|
|||||||
@@ -28,16 +28,16 @@
|
|||||||
<div class="btns" style="margin-right: 10px;">
|
<div class="btns" style="margin-right: 10px;">
|
||||||
<div class="btn btn3">
|
<div class="btn btn3">
|
||||||
<div class="search"></div>
|
<div class="search"></div>
|
||||||
<div class="btnText">添加教师</div>
|
<div class="btnText">添加师资</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</AddTeacherInfo>
|
</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">
|
:url="`/activityApi/xboe/m/boe/teachers/import`" name="file">
|
||||||
<div class="btns">
|
<div class="btns">
|
||||||
<div class="btn btn3">
|
<div class="btn btn3">
|
||||||
<div class="search"></div>
|
<div class="search"></div>
|
||||||
<div class="btnText">导入教师</div>
|
<div class="btnText">导入师资</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ImportTeacher>
|
</ImportTeacher>
|
||||||
@@ -98,18 +98,18 @@ const column = ref([
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: "授课时长(H)",
|
// title: "授课时长(H)",
|
||||||
dataIndex: "teacherTime",
|
// dataIndex: "teacherTime",
|
||||||
key: "teacherTime",
|
// key: "teacherTime",
|
||||||
width: 20,
|
// width: 20,
|
||||||
align: "center",
|
// align: "center",
|
||||||
customRender: ({ record }) => {
|
// customRender: ({ record }) => {
|
||||||
return (
|
// return (
|
||||||
<span>{record.teacherTime ? record.teacherTime : '-'}</span>
|
// <span>{record.teacherTime ? record.teacherTime : '-'}</span>
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: "教师等级",
|
title: "教师等级",
|
||||||
dataIndex: "teacherLevel",
|
dataIndex: "teacherLevel",
|
||||||
@@ -118,7 +118,7 @@ const column = ref([
|
|||||||
align: "center",
|
align: "center",
|
||||||
customRender: ({ record }) => {
|
customRender: ({ record }) => {
|
||||||
return (
|
return (
|
||||||
<span>{record.teacherLevel ? record.teacherLevel + '级' : '-'}</span>
|
<span>{record.teacherLevel ? record.teacherLevel : '-'}</span>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -183,7 +183,11 @@ const teacherLevelList = ref([{
|
|||||||
label: "5级",
|
label: "5级",
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
const change = (value) => {
|
||||||
|
if (value === 'done') {
|
||||||
|
searchInfo()
|
||||||
|
}
|
||||||
|
}
|
||||||
const carouselTableRef = ref();
|
const carouselTableRef = ref();
|
||||||
const searchInfo = () => {
|
const searchInfo = () => {
|
||||||
|
|
||||||
|
|||||||
@@ -130,23 +130,24 @@ const reseatDownloadList = () => {
|
|||||||
const downLoadFile = (toolInfo) => {
|
const downLoadFile = (toolInfo) => {
|
||||||
if (!toolInfo.filePath) return;
|
if (!toolInfo.filePath) return;
|
||||||
console.log(toolInfo);
|
console.log(toolInfo);
|
||||||
toolDown({
|
window.open(`/activityApi/xboe/m/boe/tools/url/download?urlStr=https:${process.env.VUE_APP_BOE_API_URL}/upload${toolInfo.filePath}&fileName=${toolInfo.name}`)
|
||||||
urlStr: `https:${process.env.VUE_APP_BOE_API_URL}/upload${toolInfo.filePath}`,
|
// toolDown({
|
||||||
fileName: toolInfo.name
|
// urlStr: `https:${process.env.VUE_APP_BOE_API_URL}/upload${toolInfo.filePath}`,
|
||||||
}).then((result) => {
|
// fileName: toolInfo.name
|
||||||
if (!result.data) {
|
// }).then((result) => {
|
||||||
return
|
// if (!result.data) {
|
||||||
}
|
// return
|
||||||
const link = document.createElement('a');// 创建a标签
|
// }
|
||||||
let blob = new Blob([result.data], { type: '' }); // 设置文件类型
|
// const link = document.createElement('a');// 创建a标签
|
||||||
link.style.display = "none";
|
// let blob = new Blob([result.data], { type: 'application/zip' }); // 设置文件类型
|
||||||
link.href = URL.createObjectURL(blob); // 创建URL
|
// link.style.display = "none";
|
||||||
link.setAttribute("download", `${toolInfo.name}`);
|
// link.href = URL.createObjectURL(blob); // 创建URL
|
||||||
document.body.appendChild(link);
|
// link.setAttribute("download", `${toolInfo.name}`);
|
||||||
link.click();
|
// document.body.appendChild(link);
|
||||||
URL.revokeObjectURL(link.href);
|
// link.click();
|
||||||
document.body.removeChild(link);
|
// URL.revokeObjectURL(link.href);
|
||||||
})
|
// document.body.removeChild(link);
|
||||||
|
// })
|
||||||
};
|
};
|
||||||
|
|
||||||
const handle = ({ id }) => ({
|
const handle = ({ id }) => ({
|
||||||
|
|||||||
Reference in New Issue
Block a user