diff --git a/.env b/.env index 336ea0dd..409b9fb6 100644 --- a/.env +++ b/.env @@ -4,10 +4,14 @@ VUE_APP_BASE=/manage VUE_APP_BASE_API=/manageApi # systemApi VUE_APP_SYS_API=/systemapi +# 教师节上传图片文件夹id +VUE_APP_PIC_FOLDERID=1147577187794841600 +# 教师节上传zip文件夹id +VUE_APP_TOOL_FOLDERID=1147577145918910464 #文件路径 VUE_APP_FILE_PATH=/upload/ # 代理url 本地调试,不可以用在其他地方 -VUE_APP_PROXY_URL=//43.143.139.204/manageApi +VUE_APP_PROXY_URL=//u-pre.boe.com/manageApi # 登录url VUE_APP_LOGIN_URL=//u-pre.boe.com/web?returnUrl= # boe域名 diff --git a/.env.boe b/.env.boe index a6bbf443..aa7b463c 100644 --- a/.env.boe +++ b/.env.boe @@ -1,7 +1,10 @@ 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 diff --git a/src/api/configPublic.js b/src/api/configPublic.js new file mode 100644 index 00000000..82159f4b --- /dev/null +++ b/src/api/configPublic.js @@ -0,0 +1,63 @@ + +import { message } from "ant-design-vue"; +import axios from "axios"; +import router from "@/router"; +import Cookies from 'vue-cookies' + +axios.defaults.withCredentials = true; +const http = axios.create({ + timeout: 1000 * 15, + headers: { "Content-Type": "application/json", }, +}); + +http.interceptors.request.use( + (config) => { + const token = Cookies.get("token") + if (token) { + config.headers.token = token; //测试1111 + } else { + message.error('未获取到登录信息,请先登录') + } + return config; + }, + (err) => { + console.log("登陆前拦截", err); + return Promise.reject(err); + } +); + +http.interceptors.response.use( + (response) => { + // console.log('response', response) + const { + data: { code }, + } = response; + if (code === 0 || code === 200) { + return response.data ? response.data : response; + } + if (code == 500) { + return message.error('请求失败'); + } + if (code == 601) { + message.error('token过期请重新登陆'); + } + if (code === 1000) { + (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'alpine') ? router.push({ path: 'login' }) : (window.location.href = process.env.VUE_APP_LOGIN_URL) + return Promise.reject(response); + } + // show && message.error(msg); + // console.log("api %o", msg); + // return Promise.reject(response); + return response + }, + function (error) { + if (error.message == "timeout of 1ms exceeded") { + message.destroy(); + message.error("请求超时"); + } + console.log("api error %o", error); + return message.error(error.message); + } +); + +export default http; diff --git a/src/api/grateful.js b/src/api/grateful.js new file mode 100644 index 00000000..ea1341d4 --- /dev/null +++ b/src/api/grateful.js @@ -0,0 +1,113 @@ +import http from './configPublic' +const ACTIVITYAPI = '/activityApi' +/** + * 通知 + */ +//通知列表 +const noticeList = (data = {}) => http.post(`${ACTIVITYAPI}/xboe/m/boe/notice/list`, data); +//通知新增或修改 +const noticeAddAndUpdate = (data = {}) => http.post(`${ACTIVITYAPI}/xboe/m/boe/notice/save`, data); +//通知删除 +const noticeDelete = (params) => http.delete(`${ACTIVITYAPI}/xboe/m/boe/notice/delete`, { params }); +//通知根据id查询 +const noticeDataById = (params) => http.get(`${ACTIVITYAPI}/xboe/m/boe/notice/getDataById`, { params }); + + +/** + * 轮播图 + */ +//轮播图列表 +const carouselList = `${ACTIVITYAPI}/xboe/m/boe/rotation/list` +//轮播图新增或修改 +const carouseAddAndUpdate = (data = {}) => http.post(`${ACTIVITYAPI}/xboe/m/boe/rotation/save`, data); +//轮播图删除 +const carouseDelete = (params) => http.delete(`${ACTIVITYAPI}/xboe/m/boe/rotation/delete`, { params }); +//轮播图删除 +const getCarouseById = (params) => http.get(`${ACTIVITYAPI}/xboe/m/boe/rotation/getDataById`, { params }); + + +/** + * 教师赋能 + */ +//教师赋能列表 +const courselList = `${ACTIVITYAPI}/xboe/m/boe/course/list` +//添加赋能选择课程接口 +const addCourselList = (data = {}) => http.post(`${process.env.VUE_APP_SYS_API}/xboe/m/course/fulltext/search`, data, { + headers: { "Content-Type": "application/x-www-form-urlencoded" }, +}); +//取消赋能 +const courseDelete = (params) => http.delete(`${ACTIVITYAPI}/xboe/m/boe/course/disEnabled`, { params }); +//获取已有课程id集合 +const courseIds = (params) => http.get(`${ACTIVITYAPI}/xboe/m/boe/course/ids`, { params }); +//批量增加课程 +const saveCourseList = (data = {}) => http.post(`${ACTIVITYAPI}/xboe/m/boe/course/saveList`, data); + + +/** + * 工具 + */ +//工具列表 +const toolList = (data = {}) => http.post(`${ACTIVITYAPI}/xboe/m/boe/tools/list`, data); +//新增工具 +const saveTool = (data = {}) => http.post(`${ACTIVITYAPI}/xboe/m/boe/tools/save`, data); +//工具删除 +const toolDelete = (params) => http.delete(`${ACTIVITYAPI}/xboe/m/boe/tools/delete`, { params }); +//工具下载 +const toolDown = (params) => http.get(`/systemapi/xboe/sys/xuploader/url/download`, { params }); + + +/** + * 师资大全 + */ +//师资大全列表 +const teachersList = `${ACTIVITYAPI}/xboe/m/boe/teachers/list` +//师资大全列表添加和编辑接口 +const teachersAddAndUpdate = (data = {}) => http.post(`${ACTIVITYAPI}/xboe/m/boe/teachers/save`, data); +//教师删除 +const teachersDelete = (params) => http.delete(`${ACTIVITYAPI}/xboe/m/boe/teachers/delete`, { params }); + + +/** + * 意见 + */ +//意见列表 +const opinionList = `${ACTIVITYAPI}/xboe/m/boe/opinion/list` +//意见删除 +const opinionDelete = (params) => http.delete(`${ACTIVITYAPI}/xboe/m/boe/opinion/delete`, { params }); + +//查看当前协议 +//type 查看的类型 +const query = (type) => http.get('/systemapi/xboe/m/assistance/protocol/query?type=' + type); + + + + + + +const RECOMMEND_PAGE = "/systemapi/xboe/m/boe/cases/recommend/page"; +export { + RECOMMEND_PAGE, + noticeList, + noticeDelete, + noticeAddAndUpdate, + noticeDataById, + carouselList, + carouseAddAndUpdate, + carouseDelete, + getCarouseById, + courselList, + courseIds, + saveCourseList, + addCourselList, + courseDelete, + toolList, + saveTool, + toolDelete, + toolDown, + teachersList, + teachersAddAndUpdate, + teachersDelete, + opinionList, + opinionDelete, + query +} \ No newline at end of file diff --git a/src/assets/images/navleft/grateful.png b/src/assets/images/navleft/grateful.png new file mode 100644 index 00000000..1c07ddee Binary files /dev/null and b/src/assets/images/navleft/grateful.png differ diff --git a/src/components/BreadCrumb.vue b/src/components/BreadCrumb.vue index 20246bd7..c2e1535d 100644 --- a/src/components/BreadCrumb.vue +++ b/src/components/BreadCrumb.vue @@ -4,9 +4,9 @@ {{ value.name }}{{ value.name }} {{ value.name @@ -17,613 +17,687 @@ diff --git a/src/components/Grateful/AddTeacherInfo.vue b/src/components/Grateful/AddTeacherInfo.vue new file mode 100644 index 00000000..e5df0230 --- /dev/null +++ b/src/components/Grateful/AddTeacherInfo.vue @@ -0,0 +1,396 @@ + + + + \ No newline at end of file diff --git a/src/components/Grateful/Agreement.vue b/src/components/Grateful/Agreement.vue new file mode 100644 index 00000000..11792ebf --- /dev/null +++ b/src/components/Grateful/Agreement.vue @@ -0,0 +1,35 @@ + + + + diff --git a/src/components/Grateful/CarouselDialog.vue b/src/components/Grateful/CarouselDialog.vue new file mode 100644 index 00000000..fe13d989 --- /dev/null +++ b/src/components/Grateful/CarouselDialog.vue @@ -0,0 +1,160 @@ + + + diff --git a/src/components/Grateful/EmpowerDialog.vue b/src/components/Grateful/EmpowerDialog.vue new file mode 100644 index 00000000..df66970a --- /dev/null +++ b/src/components/Grateful/EmpowerDialog.vue @@ -0,0 +1,313 @@ + + + diff --git a/src/components/Grateful/ImportTeacher.vue b/src/components/Grateful/ImportTeacher.vue new file mode 100644 index 00000000..69904d0c --- /dev/null +++ b/src/components/Grateful/ImportTeacher.vue @@ -0,0 +1,443 @@ + + + + + diff --git a/src/components/Grateful/PublishNotice.vue b/src/components/Grateful/PublishNotice.vue new file mode 100644 index 00000000..6fd2780e --- /dev/null +++ b/src/components/Grateful/PublishNotice.vue @@ -0,0 +1,180 @@ + + + diff --git a/src/components/Grateful/ToolUpload.vue b/src/components/Grateful/ToolUpload.vue new file mode 100644 index 00000000..4a2fd7ac --- /dev/null +++ b/src/components/Grateful/ToolUpload.vue @@ -0,0 +1,87 @@ + + + \ No newline at end of file diff --git a/src/components/Grateful/UploadDragger.vue b/src/components/Grateful/UploadDragger.vue new file mode 100644 index 00000000..d25c78ce --- /dev/null +++ b/src/components/Grateful/UploadDragger.vue @@ -0,0 +1,227 @@ + + + diff --git a/src/components/NavLeft.vue b/src/components/NavLeft.vue index e2970d63..c3ecceb8 100644 --- a/src/components/NavLeft.vue +++ b/src/components/NavLeft.vue @@ -1,46 +1,46 @@
评估管理 @@ -197,8 +197,8 @@
受众管理 @@ -255,15 +255,15 @@ --> - + 案例推荐 - - + + + + + + + 通知 + + + + 轮播图 + + + + 教师赋能 + + + + 师资大全 + + + + 工具下载 + + + + 意见 + +
文章管理 @@ -343,8 +407,8 @@
问答管理 @@ -352,26 +416,26 @@
下载中心
- +
旧版管理员界面
- +
业务支援读书会管理 @@ -495,8 +559,8 @@
字典管理 @@ -506,17 +570,17 @@
审核 @@ -562,6 +626,9 @@ 案例 + + 感恩教师 + 文章 @@ -572,7 +639,7 @@ 问答 - 旧版 + 旧版 业务 @@ -587,386 +654,400 @@ diff --git a/src/components/Pagination.vue b/src/components/Pagination.vue new file mode 100644 index 00000000..8983e914 --- /dev/null +++ b/src/components/Pagination.vue @@ -0,0 +1,50 @@ + + + diff --git a/src/components/common/BaseTable.vue b/src/components/common/BaseTable.vue index e044d8ed..b4d82313 100644 --- a/src/components/common/BaseTable.vue +++ b/src/components/common/BaseTable.vue @@ -1,140 +1,165 @@ diff --git a/src/components/index.js b/src/components/index.js new file mode 100644 index 00000000..97dfeb28 --- /dev/null +++ b/src/components/index.js @@ -0,0 +1,14 @@ +import Pagination from './Pagination.vue' +import Table from './common/BaseTable.vue' + +const globalComponents = { + Pagination, + Table +} +export default { + install(app) { + Object.keys(globalComponents).forEach(key => { + app.component(key, globalComponents[key]) + }) + } +} \ No newline at end of file diff --git a/src/hooks/useRequest.js b/src/hooks/useRequest.js new file mode 100644 index 00000000..3c284468 --- /dev/null +++ b/src/hooks/useRequest.js @@ -0,0 +1,46 @@ +import { isRef, reactive, ref, toRefs, unref, watch, watchEffect } from "vue"; +import http from '@/api/configPublic' + +const useTotalPage = (_url, params, config = {}) => { + const s = _url.split(" "); + const url = s[0]; + let methods = 'post' + if (s[1]) methods = 'get' + const state = reactive({ + data: [], + total: 1, + current: 1, + pages: 1, + pageNo: 1, + pageSize: 10, + loading: false + }); + + if (isRef(_url)) { + watchEffect(fetch); + } + + function reset() { + state.data = []; + state.loading = false; + } + + function fetch() { + state.loading = true; + return http[methods](unref(url), !s[1] ? unref(params) : { params: unref(params) }, { ...config }).then(r => { + state.data = r.data?.records || 0; + state.total = r.data?.total || 0; + state.loading = false; + }) + } + + return { + ...toRefs(state), + fetch, + reset, + }; +} + +export { + useTotalPage +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index 75cac4a1..45c9952a 100644 --- a/src/main.js +++ b/src/main.js @@ -20,10 +20,13 @@ import {request} from "@/api/request"; import {USER_INFO, USER_PERMISSION, VALIDATE_TOKEN} from "@/api/apis"; import * as api1 from "@/api/index1"; import {getCookieForName} from "@/api/method"; +import components from './components' // import axios from 'axios' // axios.defaults.withCredentials = true; // import zhCN from 'ant-design-vue/es/locale/zh_CN'; const app = createApp(App) +//全局注册 +app.use(components) // 清理控制台warn信息 app.config.warnHandler = () => null; // app.use(ElementPlus, { diff --git a/src/views/gratefulteacher/GratefulCarousel.vue b/src/views/gratefulteacher/GratefulCarousel.vue new file mode 100644 index 00000000..fee58201 --- /dev/null +++ b/src/views/gratefulteacher/GratefulCarousel.vue @@ -0,0 +1,340 @@ + + + + diff --git a/src/views/gratefulteacher/GratefulNotice.vue b/src/views/gratefulteacher/GratefulNotice.vue new file mode 100644 index 00000000..bc76cdab --- /dev/null +++ b/src/views/gratefulteacher/GratefulNotice.vue @@ -0,0 +1,371 @@ + + + + diff --git a/src/views/gratefulteacher/TeacherEmpowerment.vue b/src/views/gratefulteacher/TeacherEmpowerment.vue new file mode 100644 index 00000000..68e42e2b --- /dev/null +++ b/src/views/gratefulteacher/TeacherEmpowerment.vue @@ -0,0 +1,361 @@ + + + + + \ No newline at end of file diff --git a/src/views/gratefulteacher/TeacherOpinion.vue b/src/views/gratefulteacher/TeacherOpinion.vue new file mode 100644 index 00000000..8fd32863 --- /dev/null +++ b/src/views/gratefulteacher/TeacherOpinion.vue @@ -0,0 +1,236 @@ + + + + diff --git a/src/views/gratefulteacher/TeacherTopic.vue b/src/views/gratefulteacher/TeacherTopic.vue new file mode 100644 index 00000000..e25e313c --- /dev/null +++ b/src/views/gratefulteacher/TeacherTopic.vue @@ -0,0 +1,383 @@ + + + + + \ No newline at end of file diff --git a/src/views/gratefulteacher/ToolDown.vue b/src/views/gratefulteacher/ToolDown.vue new file mode 100644 index 00000000..86db5ffc --- /dev/null +++ b/src/views/gratefulteacher/ToolDown.vue @@ -0,0 +1,403 @@ + + + diff --git a/vue.config.js b/vue.config.js index b2cce88c..1a86ede4 100644 --- a/vue.config.js +++ b/vue.config.js @@ -40,6 +40,10 @@ module.exports = defineConfig({ // "^/manageApi": "", }, }, + "/activityApi": { + target:'https:'+ process.env.VUE_APP_BOE_API_URL, + changeOrigin: true, + }, }, }, });