This commit is contained in:
NiSen
2023-06-13 15:28:37 +08:00
parent 7a0cb0216d
commit 932f0e9031
158 changed files with 53308 additions and 37 deletions

67
.drone.yml Normal file
View File

@@ -0,0 +1,67 @@
kind: pipeline
name: fe-str
steps:
- name: restore-cache
image: drillster/drone-volume-cache
settings:
restore: true
mount:
- ./.npm-cache
- ./node_modules
volumes:
- name: cache
path: /cache
- name: npm-install
image: node:16.13.1-alpine
commands:
- npm config set cache ./.npm-cache --global
- npm config set registry http://registry.npm.taobao.org/
- npm install && npm run build
- name: rebuild-cache
image: drillster/drone-volume-cache
settings:
rebuild: true
mount:
- ./.npm-cache
- ./node_modules
volumes:
- name: cache
path: /cache
- name: build-fe-stu
image: plugins/docker
privileged: true
volumes:
- name: registry-auth
path: /root/.docker
- name: dockersock
path: /var/run/docker.sock
settings:
registry: swr.cn-south-1.myhuaweicloud.com
repo: swr.cn-south-1.myhuaweicloud.com/yp/fe-stu
tags: latest
- name: release
image: docker:dind
volumes:
- name: dockersock
path: /var/run/docker.sock
- name: registry-auth
path: /root/.docker
commands:
- docker stack deploy -c docker-compose.yml fe-stu --with-registry-auth
volumes:
- name: cache
host:
path: /tmp/cache
- name: dockersock
host:
path: /var/run/docker.sock
- name: registry-auth
host:
path: /root/.docker

21
.env Normal file
View File

@@ -0,0 +1,21 @@
VITE_BASE=/fe-student
VITE_BASE_H5=/fe-student-h5
VITE_BASE_API=
VITE_OUTPUT_DIR=./dist
VITE_FILE_PATH=/upload/
VITE_BASE_LOGIN_URL=//u-pre.boe.com/web/
VITE_PROXY_URL=http://43.143.139.204/manageApi
VITE_BOE_ONLINE_CLASS_URL=//u-pre.boe.com/pc/course/studyindex?id=
VITE_BOE_CASS_DETAIL_URL=//u-pre.boe.com/pc/case/detail?id=
VITE_BOE_TEST_DETAIL_URL=//u-pre.boe.com/web/quizsummary?detailId=
VITE_BOE_TEST_OUT_DETAIL_URL=//u-pre.boe.com/api/b1/tale/do-quiz?quizKid=
VITE_BOE_EXAM_DETAIL_URL=//u-pre.boe.com/pc/exam/test?id=
VITE_BOE_PATH_DETAIL_URL=//u-pre.boe.com/pc/forward?to=/fe-student
VITE_BOE_API_URL=https://u-pre.boe.com
#用户头像
VITE_AVATAR_PATH=/upload/
VITE_TASK_WHITE_TYPE=-22-

10
.env.boe Normal file
View File

@@ -0,0 +1,10 @@
VITE_BASE=/fe-student
VITE_BASE_API=/manageApi
VITE_BOE_ONLINE_CLASS_URL=//u-pre.boe.com/pc/course/studyindex?id=
VITE_BOE_CASS_DETAIL_URL=//u-pre.boe.com/pc/case/detail?id=
VITE_BOE_TEST_DETAIL_URL=//u-pre.boe.com/web/quizsummary?detailId=
VITE_BOE_TEST_OUT_DETAIL_URL=//u-pre.boe.com/api/b1/tale/do-quiz?quizKid=
VITE_BOE_EXAM_DETAIL_URL=//u-pre.boe.com/pc/exam/test?id=
VITE_BOE_API_URL=https://u-pre.boe.com

17
.env.prod Normal file
View File

@@ -0,0 +1,17 @@
VITE_BASE=/fe-student
VITE_BASE_API=/manageApi
VITE_BASE_LOGIN_URL=//u.boe.com/web/
VITE_FILE_PATH=/upload/boe/file/
VITE_BOE_ONLINE_CLASS_URL=//u.boe.com/pc/course/studyindex?id=
VITE_BOE_CASS_DETAIL_URL=//u.boe.com/pc/case/detail?id=
VITE_BOE_TEST_DETAIL_URL=//u.boe.com/web/quizsummary?detailId=
VITE_BOE_TEST_OUT_DETAIL_URL=//u.boe.com/api/b1/tale/do-quiz?quizKid=
VITE_BOE_EXAM_DETAIL_URL=//u.boe.com/pc/exam/test?id=
VITE_BOE_PATH_DETAIL_URL=//u.boe.com/pc/forward?to=/fe-student
VITE_BOE_API_URL=https://u.boe.com
#用户头像
VITE_AVATAR_PATH=/upload/
VITE_TASK_WHITE_TYPE==-22-

15
.env.release Normal file
View File

@@ -0,0 +1,15 @@
VITE_BASE=/fe-student-release
VITE_BASE_API=/manageApi-release
VITE_BASE_LOGIN_URL=//u.boe.com/web/
VITE_BOE_ONLINE_CLASS_URL=//u.boe.com/pc-release/course/studyindex?id=
VITE_BOE_CASS_DETAIL_URL=//u.boe.com/pc-release/case/detail?id=
VITE_BOE_TEST_DETAIL_URL=//u.boe.com/web/quizsummary?detailId=
VITE_BOE_TEST_OUT_DETAIL_URL=//u.boe.com/api/b1/tale/do-quiz?quizKid=
VITE_BOE_EXAM_DETAIL_URL=//u.boe.com/pc-release/exam/test?id=
VITE_BOE_PATH_DETAIL_URL=//u.boe.com/pc-release/forward?to=/fe-student-release
#用户头像
VITE_AVATAR_PATH=/upload/
VITE_BOE_API_URL=https://u.boe.com

0
.fleet/settings.json Normal file
View File

24
.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
.DS_Store
node_modules
/dist
# local env files
.env.test
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
/webstorm.config.js

6
Dockerfile Normal file
View File

@@ -0,0 +1,6 @@
FROM devforth/spa-to-http:latest
WORKDIR /
ADD ./dist .
EXPOSE 8080

View File

@@ -1,37 +1,29 @@
### 3 分钟了解如何进入开发
欢迎使用 Codeup通过阅读以下内容你可以快速熟悉 Codeup ,并立即开始今天的工作。
### 提交**文件**
首先,你需要了解在 Codeup 中如何提交代码文件,跟着文档「[__提交第一行代码__](https://thoughts.teambition.com/sharespace/5d88b152037db60015203fd3/docs/5dc4f6786b81620014ef7574)」一起操作试试看吧。
### 开启扫描
开发过程中为了更好的管理你的代码资产Codeup 内置了「[__代码规约扫描__](https://thoughts.teambition.com/sharespace/5d88b152037db60015203fd3/docs/5dc4f68b6b81620014ef7588)」和「[__敏感信息检测__](https://thoughts.teambition.com/sharespace/5d88b152037db60015203fd3/docs/5dc4f6886b81620014ef7587)」服务,你可以在代码库设置-集成与服务中一键开启,开启后提交或合并请求的变更将自动触发扫描,并及时提供结果反馈。
![](https://img.alicdn.com/tfs/TB1nRDatoz1gK0jSZLeXXb9kVXa-1122-380.png "")
![](https://img.alicdn.com/tfs/TB1PrPatXY7gK0jSZKzXXaikpXa-1122-709.png "")
### 代码评审
功能开发完毕后,通常你需要发起「[__代码合并和评审__](https://thoughts.teambition.com/sharespace/5d88b152037db60015203fd3/docs/5dc4f6876b81620014ef7585)」Codeup 支持多人协作的代码评审服务,你可以通过「[__保护分支__](https://thoughts.teambition.com/sharespace/5d88b152037db60015203fd3/docs/5dc4f68e6b81620014ef758c)」策略及「[__合并请求设置__](https://thoughts.teambition.com/sharespace/5d88b152037db60015203fd3/docs/5dc4f68f6b81620014ef758d)」对合并过程进行流程化管控,同时提供 WebIDE 在线代码评审及冲突解决能力,让你的评审过程更加流畅。
![](https://img.alicdn.com/tfs/TB1XHrctkP2gK0jSZPxXXacQpXa-1432-887.png "")
![](https://img.alicdn.com/tfs/TB1V3fctoY1gK0jSZFMXXaWcVXa-1432-600.png "")
### 编写文档
项目推进过程中,你的经验和感悟可以直接记录到 Codeup 代码库的「[__文档__](https://thoughts.teambition.com/sharespace/5d88b152037db60015203fd3/docs/5e13107eedac6e001bd84889)」内,让智慧可视化。
![](https://img.alicdn.com/tfs/TB1BN2ateT2gK0jSZFvXXXnFXXa-1432-700.png "")
### 成员协作
是时候邀请成员一起编写卓越的代码工程了,请点击右上角「成员」邀请你的小伙伴开始协作吧!
### 更多
Git 使用教学、高级功能指引等更多说明,参见[__Codeup帮助文档__](https://thoughts.teambition.com/sharespace/5d88b152037db60015203fd3/docs/5dc4f6756b81620014ef7571)。
# fe-stu
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

5
babel.config.js Normal file
View File

@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

13
docker-compose.yml Normal file
View File

@@ -0,0 +1,13 @@
version: "3"
services:
buyer-ui-mro84:
image: swr.cn-south-1.myhuaweicloud.com/yp/fe-stu
networks:
- traefik
deploy:
mode: replicated
replicas: 1
networks:
traefik:
external: true

5
docker/Dockerfile Normal file
View File

@@ -0,0 +1,5 @@
FROM devforth/spa-to-http:latest
WORKDIR /
ADD ./dist/ .
EXPOSE 8080

16
index.html Normal file
View File

@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>京东方</title>
<script>
window.process = {env:{ NODE_ENV:'dev'}}
</script>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

22913
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

69
package.json Normal file
View File

@@ -0,0 +1,69 @@
{
"name": "jdfstudy",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "vite",
"server": "vite build --mode boe && vite preview ",
"build": "vite build --mode release",
"build:boe": "vite build --mode boe",
"build:prod": "vite build --mode prod",
"build:release": "vite build --mode release",
"build:test": "vite build --mode test"
},
"dependencies": {
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^5.1.12",
"ant-design-vue": "^3.2.15",
"axios": "^1.1.3",
"core-js": "^3.26.0",
"dayjs": "^1.11.6",
"element-plus": "^2.2.27",
"json-bigint": "^1.0.0",
"vue": "^3.2.45",
"vue-router": "^4.1.6",
"vuex": "^4.1.0"
},
"devDependencies": {
"@babel/core": "^7.20.2",
"@babel/eslint-parser": "^7.19.1",
"@vitejs/plugin-legacy": "^2.3.1",
"@vitejs/plugin-vue": "^3.2.0",
"@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-plugin-router": "~5.0.8",
"@vue/cli-plugin-vuex": "~5.0.8",
"@vue/cli-service": "~5.0.8",
"ajv": "^8",
"eslint": "^8.27.0",
"eslint-plugin-vue": "^9.7.0",
"mockjs": "^1.1.0",
"sass": "^1.56.1",
"sass-loader": "^13.2.0",
"vite": "^3.2.3",
"vite-plugin-imp": "^2.3.1",
"vite-plugin-mock": "^2.9.6",
"vite-plugin-style-import": "^2.0.0",
"vite-plugin-top-level-await": "^1.2.1"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead",
"not ie 11"
]
}

12620
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

18
public/index.html Normal file
View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- <title><%= htmlWebpackPlugin.options.title %></title> -->
<title>京东方</title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

134
src/App.vue Normal file
View File

@@ -0,0 +1,134 @@
<!--
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2022-11-21 17:28:10
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2022-12-19 17:39:02
* @FilePath: /fe-stu/src/App.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<!--
-->
<div id="container">
<!-- <div id="nav">
<router-link
v-for="item in routes"
:key="item.path"
:to="item.path"
:class="{
link: true,
active: name === item.name,
}"
>
{{ item.name }}
</router-link>
</div> -->
<main style="z-index: 2">
<router-view/>
</main>
</div>
</template>
<script setup>
import {boeRequest, request} from "@/api/request";
import {GET_USER_INFO} from "@/api/ThirdApi";
import {useStore} from "vuex";
import {onMounted} from "vue";
import {useRoute} from "vue-router/dist/vue-router";
import {USER_INFO} from "@/api/api";
import {IsPhone} from "@/api/utils";
console.log("版本3.0.1------------");
const store = useStore();
const { path } = useRoute();
onMounted(() => {
path === "/login" || getUserInfo();
if (IsPhone()) {
if (import.meta.env.MODE === "development") {
window.location.href = window.location.href.replace(import.meta.env.VITE_BASE, import.meta.env.VITE_BASE_H5).replace('5173','5174');
} else {
window.location.href = window.location.href.replace(import.meta.env.VITE_BASE, import.meta.env.VITE_BASE_H5)
}
}
});
function getUserInfo() {
if (import.meta.env.MODE === "development" || import.meta.env.MODE === "test") {
request(USER_INFO, {}).then(res => {
store.commit("SET_USER", res.data);
});
} else {
boeRequest(GET_USER_INFO).then((res) => {
res.result.avatar = res.result.avatar || "/800e23f7-b58c-4192-820d-0c6a2b7544cc.png";
store.commit("SET_USER", res.result);
});
}
}
</script>
<style lang="scss">
#app {
// font-family: MicrosoftYaHei, Microsoft YaHei, Avenir, Helvetica, Arial,
// sans-serif;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB,
Microsoft YaHei, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
height: 100%;
}
.return {
right: 0 !important;
}
.preNext {
right: 115px !important;
margin-top: 4px;
}
#container {
display: flex;
width: 100%;
min-height: 100%;
background-color: rgba(242, 245, 247, 1);
// background-color: #ccc;
#nav {
width: 220px;
height: 100%;
display: flex;
flex-direction: column;
gap: 20px;
padding: 30px 0;
box-sizing: border-box;
background: #f1f1f1;
box-shadow: 0 5px 15px 8px rgba(1, 22, 54, 0.795);
.link {
text-decoration: none;
color: rgb(0, 0, 0);
padding: 10px;
transition: all 0.4s;
text-align: center;
&:hover {
background: rgba(4, 37, 223, 0.274);
color: #f1f1f1;
}
&.active {
color: #f1f1f1;
background: rgba(17, 120, 255, 0.74);
}
}
}
main {
flex: 1;
width: 100%;
// padding: 30px;
box-sizing: border-box;
}
}
</style>

56
src/api/CONST.js Normal file
View File

@@ -0,0 +1,56 @@
export const PROJECT = 1;
export const ROUTER = 2;
export const COURSE = 3;
export const TASK_TYPES = {
typeName: {
1: "在线",
2: "面授",
3: "案例",
4: "作业",
5: "考试",
6: "直播",
7: "外链",
8: "讨论",
9: "活动",
10: "测评",
11: "评估",
12: "投票",
13: "项目",
},
toName: {
1: "去上课",
2: "去上课",
3: "去阅读",
4: "去完成",
5: "去完成",
6: "去观看",
7: "去查看",
8: "去讨论",
9: "去签到",
10: "去完成",
11: "去完成",
12: "去投票",
13: "去完成",
},
path: {
1: ({courseId}) => window.open(window.location.protocol + import.meta.env.VITE_BOE_ONLINE_CLASS_URL + courseId), //在线
2: ({targetId}) => window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${targetId}`, '_top'),
3: ({courseId}) => window.open(window.location.protocol + import.meta.env.VITE_BOE_CASS_DETAIL_URL + courseId), //案例
4: "/homeworkpage",
5: ({examType}) => examType === 2 ? '/externalexamination' : (window.location.protocol + import.meta.env.VITE_BOE_EXAM_DETAIL_URL), //考试
6: "/livebroadcast",
7: '/outerchain', //外联
8: "/discusspage",
9: "/moreactive",
10: ({evaType, targetId}) =>
window.open(
evaType == 0
? window.location.protocol + import.meta.env.VITE_BOE_TEST_DETAIL_URL + targetId
: window.location.protocol + import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL + targetId + `&quizTaskKid=${routerId}&channelCode=learningpath`
, '_top'), //测评
11: "/surveydetail",
12: "/ballotpage",
13: "/projectdetails",
},
}

5
src/api/ThirdApi.js Normal file
View File

@@ -0,0 +1,5 @@
export const BASE = window.location.protocol + '//u-pre.boe.com'
export const GET_USER_LIST = `/userbasic/user/list post`
export const GET_USER_INFO = `/userbasic/user/info post`

133
src/api/api.js Normal file
View File

@@ -0,0 +1,133 @@
/*
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2022-12-11 16:57:58
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-01-29 10:46:54
* @FilePath: /fe-stu/src/api/api.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
export const LOGIN = '/admin/CheckUser/userLogin post'
export const USER_INFO = '/admin/CheckUser/userInfo'
// export const FILE_UPLOAD = 'http://143.143.139.204:30001/file/upload'
export const FILE_UPLOAD = import.meta.env.VITE_BASE_API + '/file/uploadFile'
export const FILE_UPLOAD_ANNEX = import.meta.env.VITE_BASE_API + '/file/uploadunlimit'
export const FILE_UPLOAD_IMG = import.meta.env.VITE_BASE_API + '/file/img'
export const COMMON_TOKEN = 'https://upload-z2.qiniup.com'
export const ROUTER_CHAPTER_LIST = '/stu/router/chapterList'
export const ROUTER_LIST = '/stu/router/list post'
export const ROUTER_PROCESS = '/stu/router/process'
export const LINK_DETAILS = linkId => `/link/getOne?linkId=${linkId} post`
export const PROJECT_PROCESS = '/stu/project/process'
export const ONLINE_PROCESS = '/onlineClasses/queryOnlineClassesStudyDetail post'
export const ROUTER_UNCOMPLETE_LIST = '/stu/router/unCompleteTaskList post'
export const TAS_ACTIVITY_DETAIL = '/activity'
export const TASK_ACTIVITY_SIGN = '/stu/task/activity/sign post'
export const TASK_OFFCOURSE_NOTASK_SIGN = '/stu/task/offcourse/notask/sign post'
export const TASK_OFFCOURSE_SIGN = '/stu/task/offcourse/sign post'
export const TASK_BROADCAST_COMMIT = '/stu/task/broadcast/commit'
export const TASK_BROADCAST_DETAIL = '/liveBroadcast'
export const TASK_BROADCAST_SIGN = '/stu/task/broadcast/sign post'
export const TASK_VOTE_COMMIT = '/stu/task/vote/commit'
export const TASK_VOTE_DETAIL = '/stu/task/vote/detail'
export const TASK_WORK_COMMIT = '/workSubmit/submitStudentWorkDetail post'
export const TASK_WORK_DETAIL = '/workSubmit/getWorkDetailByTaskId'
export const TASK_WORK_SUBMIT_LIST = '/workSubmit/queryWorkSubmitDetailById'
// 查询学员端是否导入了作业成绩
export const WhetherImportHomeWorkScore = '/admin/student/whetherImportHomeWorkScore post'
export const VOTE_DETAIL = '/queryVoteSubmitDetailById'
export const TASK_VOTE_LIST = '/queryVoteSubmitDetailListByTaskId'
export const STU_OFFCOURSE_DETAIL = '/stu/offcourse/detail post'
export const WORK_QUERYWORKDETAILBYID = '/work/queryWorkDetailById'
export const WORK_HISTROY = '/workSubmit/queryWorkDetailListByStuId'
export const EXAMINATION_QUERY = examinationId => `/examination/queryExaminationDetailById?examinationId=${examinationId} post`
export const DISCUSS_LIKE = '/discussSubmit/clickDiscussLikeCountOr post'
export const DISCUSS_LIST = '/discussSubmit/taskList'
export const DISCUSS_DETAIL = '/discussSubmit/detail'
export const DISCUSS_SUBMIT_REVIEW_LIST = '/discussSubmit/queryDiscussSubmitAndReview'
export const COMMENT_LIST = '/comment/list'
export const VOTE_DETAIL2 = `/voteSubmit/queryVoteTaskDetailById post`
export const VOTE_DETAIL3 = voteId => `/vote/queryVoteById?voteId=${voteId}`
// 投票详情接口
export const VOTE_DETAIL_SUBMIT = `/voteSubmit/vote/commit post`
export const COMMENT_ADD = '/comment/add post'
export const COMMENT_PRAISE = '/comment/praise'
export const COMMENT_COLLECTION = '/comment/collection post'
export const ASSESSMENT_SUBMIT_QUERY = assessmentId => `/assessmentSubmit/queryAssessmentSubmitDetailById?assessmentSubmitId=${assessmentId} post`
export const ASSESSMENT_QUERY = assessmentId => `/stu/task/queryAssessmentDetailById`
export const ASSESSMENT_SUBMIT = '/stu/task/evaluate/commit post'
export const ACTIVITY = '/activity'
export const STUDY_RECORD = '/stu/task/thirdTask/submit post'
export const PROJECT_LIST = '/stu/project/list post'
export const FACETEACH_SIGNUP = `/stu/project/stuFaceTeachSignUp`
export const UPDATE_CURRENT_TASK = `/admin/student/updateCurrentTask post`
// 外部考试详情接口
export const EXTERNALEXAM = `/external/exam/queryExternalExam`
// 外链详情接口
export const LINKGETONE = `/link/getOne`
// 讨论模块
// -- 根据讨论的Id查询讨论发表的帖子
export const QueryDiscussSubmitDetailByDiscussId = '/discussSubmit/queryDiscussSubmitDetailByDiscussId post'
// 测评任务去学习
export const EvaluationToLearn = '/evaluation/evaluationToLearn post'
// 个人/小组完成度排行
export const CompletionList = `/stu/project/rank_list/project_rank_list`
// 积分排行榜
export const PointList = `/stu/project/rank_list/point_list`
// 根据ID获取测评信息详情
export const QueryEvaluationDetailById = evaluationId => `/evaluation/queryEvaluationDetailById?evaluationId=${evaluationId} post`
// 外部考试点击去完成调用
export const SubmitExternalExam = `/stu/externalExam/submitExternalExam post`
// 发表帖子
export const PostAdd = `/statement/add post`
// 帖子收藏
export const PostCollection = `/statement/collection post`
// 帖子删除
export const PostDelete = postId => `/statement/delete?id=${postId} post`
// 贴子点赞
export const PostPraise = `/statement/praise`
// 帖子更新
export const PostUpdate = `/statement/update post`
// 帖子详情查询
export const PostDetails = `/statement/info`
// 查询帖子的评论
export const GetComments = `/statement/getComments`
// 查询某个评论下更多的回复
export const GetMoreComments = `/statement/getMoreComments`
// 查询讨论下的帖子
export const PostList = `/statement/list`
// 查询单个测评的状态
export const QueryEvaluationTaskStatusOne = `/evaluation/queryEvaluationTaskStatusOne`
// 投票浏览和参与数目
export const EditVoteInvolvedAndBrowse = `/vote/editVoteInvolvedAndBrowse post`
//查询路径关卡列表
export const ROUTER_DETAIL_CHAPTER_LIST = `/stu/router/chapterPcList`

40
src/api/method.js Normal file
View File

@@ -0,0 +1,40 @@
/*
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2022-12-19 11:35:37
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2022-12-19 11:38:29
* @FilePath: /fe-stu/src/views/project/method.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
// 修改时间格式---------start-----------------------------
function formatNumber(n) {
n = n.toString();
return n[1] ? n : "0" + n;
}
function toDate(number, format) {
var formateArr = ["Y", "M", "D", "h", "m", "s"];
var returnArr = [];
if (number === 0) {
return 0;
} else {
var date = new Date(number * 1000);
}
returnArr.push(date.getFullYear());
returnArr.push(formatNumber(date.getMonth() + 1));
returnArr.push(formatNumber(date.getDate()));
returnArr.push(formatNumber(date.getHours()));
returnArr.push(formatNumber(date.getMinutes()));
returnArr.push(formatNumber(date.getSeconds()));
for (var i in returnArr) {
format = format.replace(formateArr[i], returnArr[i]);
}
return format;
}
// 修改时间格式---------end-----------------------------
export {
toDate
}

161
src/api/request.js Normal file
View File

@@ -0,0 +1,161 @@
import router from "@/router";
import {reactive, ref, toRefs, watch} from "vue";
import axios from 'axios';
import {getCookie} from "@/api/utils";
import JSONBigInt from 'json-bigint';
import {ElMessage} from "element-plus";
const JSONBigIntStr = JSONBigInt({storeAsString: true});
export function usePage(_url, param, callback) {
const state = reactive({
data: {},
loading: false,
total: 0,
size: 10,
current: 1,
params: {pageNo: 1, pageSize: 10, ...param}
})
watch(param, () => {
state.params = {...state.params, ...param}
fetchData()
})
function fetchData() {
state.loading = true
request(_url, state.params).then(r => {
state.params.pageNo === 1 ? (state.data = (r.data.records || r.data.rows)) : (state.data = [...state.data, ...(r.data.records || r.data.rows)])
state.size = r.data.size
state.total = r.data.total
state.current = r.data.current
state.loading = false
callback && callback(r)
})
}
fetchData()
return {
...toRefs(state),
fetchData,
};
}
export function useRequest(_url, params = {}, callback) {
const state = reactive({
data: {},
loading: false,
})
watch(params, () => {
fetchData()
})
function fetchData() {
state.loading = true
request(_url, params).then(r => {
state.data = r.data
state.loading = false
callback&&callback(r)
})
}
fetchData()
return {
...toRefs(state),
fetchData,
};
}
export async function request(_url, params) {
const s = _url.split(' ')
let url = s[0]
const method = s[1]?.toLowerCase() || 'get'
if (method === 'get') {
let paramsArray = [];
//拼接参数
if (params) {
Object.keys(params).forEach(key => paramsArray.push(key + '=' + params[key]))
if (url.search(/\?/) === -1) {
url += '?' + paramsArray.join('&')
} else {
url += '&' + paramsArray.join('&')
}
}
}
const body = method !== 'get' ? params || {} : {}
return axios({
url,
method,
headers: {
'token': getCookie('token'),
...method !== 'get' ? {'Content-Type': 'application/json'} : {}
},
baseURL: import.meta.env.VITE_BASE_API,
...method !== 'get' ? {data: JSON.stringify(body)} : {}
}).then(resp => resp.data).then(response => {
if (response.code !== 200 && response.code !== 0) {
if (response.code === 1000) (import.meta.env.MODE === 'development' || import.meta.env.MODE === 'test') ? router.push({path: '/login'}) : window.open(window.location.protocol + import.meta.env.VITE_BASE_LOGIN_URL, '_top')
else if (response.code === 2001) router.push({path: '/FaceTeachSignUp', query: {courseId: router.currentRoute.value.query.courseId,type:3}})
else if (response.code === 2002) router.push({path: '/FaceTeachNoCommon', query: {courseId: router.currentRoute.value.query.courseId,type:3}})
else if (response.code === 9000) ElMessage.warning("该数据已经被删除或停用,请联系管理员");
// if (import.meta.env.DEV && response.code === 1000) {
// router.push({path: '/login'})
// } else {
// window.open()
// response.showMsg && notification.open({
// message: response.showMsg,
// duration: 2,
// });
// }
}
return response
})
}
export async function boeRequest(_url, params) {
const s = _url.split(' ')
let url = s[0]
const method = s[1]?.toLowerCase() || 'get'
if (method === 'get') {
let paramsArray = [];
//拼接参数
if (params) {
Object.keys(params).forEach(key => paramsArray.push(key + '=' + params[key]))
if (url.search(/\?/) === -1) {
url += '?' + paramsArray.join('&')
} else {
url += '&' + paramsArray.join('&')
}
}
}
const body = method !== 'get' ? params || {} : {}
return fetch(url, {
method,
headers: {
token: getCookie('token'),
...method !== 'get' ? {'Content-Type': 'application/json'} : {}
},
...method !== 'get' ? {body: JSON.stringify(body)} : {}
}).then(res => {
return res.text()
}).then(res => {
return JSONBigIntStr.parse(res)
})
}
const httpupload = axios.create({
baseURL: process.env.VUE_APP_BASE_API,
timeout: 1000 * 15,
headers: { "Content-Type": "multipart/form-data" },
});
export const fileUp = (data) => httpupload.post( import.meta.env.VITE_BASE_API+"/file/upload", data, {
headers: { "Content-Type": "multipart/form-data" },
});

53
src/api/useCommon.js Normal file
View File

@@ -0,0 +1,53 @@
import {useRoute, useRouter} from "vue-router/dist/vue-router";
import {useStore} from "vuex";
import {TASK_TYPES} from "@/api/CONST";
import {computed, watchEffect} from "vue";
export function useTaskPage() {
const router = useRouter()
const {query: {id: taskId, type, infoId}} = useRoute()
const {state, dispatch} = useStore()
const info = computed(() => type == 1 ? state.projectInfo : state.routerInfo)
const taskList = computed(() => type == 1 ? info.value.stageProcessList.flatMap(t => t.taskProcessList.map(s => ({
...s,
stageId: t.id,
stageName: t.name
}))) : info.value.taskBoList)
const index = computed(() => taskList.value?.findIndex(t => t.id == taskId))
const hasPrev = computed(() => index.value - 1 > 0)
const hasNext = computed(() => taskList.value.length > index.value)
type == 1 ? dispatch('getProjectInfo', {projectId: infoId}) : dispatch('getRouterInfo', {routerId: infoId})
function nextPage() {
toPage(taskList.value[index.value + 1])
}
function prevPage() {
toPage(taskList.value[index.value - 1])
}
function toPage(d) {
if (typeof TASK_TYPES.path[d.type] === "string") {
TASK_TYPES.path[d.type] && TASK_TYPES.path[d.type].startsWith("http") && window.open(TASK_TYPES.path[d.type] + d.targetId, '_top');
TASK_TYPES.path[d.type] && TASK_TYPES.path[d.type].startsWith("/") && router.push({
path: TASK_TYPES.path[d.type],
query: {
id: d.id,
type: type,
infoId: info.id,
courseId: d.courseId,
pName: info.name,
sName: d.stageName,
chapterOrStageId: d.stageId,
btype: type
},
});
} else if (typeof TASK_TYPES.path[d.type] === "function") {
TASK_TYPES.path[d.type](d);
}
}
return {hasPrev, hasNext, nextPage, prevPage}
}

36
src/api/utils.js Normal file
View File

@@ -0,0 +1,36 @@
import {watch, ref} from "vue";
import {boeRequest} from "@/api/request";
import {BASE, GET_USER_LIST} from "@/api/ThirdApi";
export function useImage(src) {
return new URL(`../assets/image/${src}`, import.meta.url).href
}
export function setCookie(name, value, perpetual) {
const d = new Date()
d.setDate(perpetual * 24 * 60 * 60 * 1000)
document.cookie = `${name}=${value};expires=${d.toGMTString()};path=/`
}
export function getCookie(name) {
return document.cookie?.split(";").find(e => e.includes(name))?.replace(`${name}=`, '') || ''
}
export function delCookie(name){
setCookie(name, "", -1)
}
export function useUserInfo(id) {
const userInfo = ref({})
watch(id, () => {
id.value && boeRequest(GET_USER_LIST, {id: id.value}).then(res => {
userInfo.value = res.result.userInfoList[0]
userInfo.value.avatar = userInfo.value.avatar?userInfo.value.avatar.includes('upload')?userInfo.value.avatar:'/upload'+userInfo.value.avatar:'/800e23f7-b58c-4192-820d-0c6a2b7544cc.png'
})
})
return userInfo
}
export function IsPhone() {
return /mobile/i.test(navigator.userAgent);
}

BIN
src/assets/image/222_02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
src/assets/image/222_03.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
src/assets/image/222_04.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
src/assets/image/222_05.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
src/assets/image/222_06.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
src/assets/image/VS.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/assets/image/X.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

BIN
src/assets/image/avator.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
src/assets/image/band.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

BIN
src/assets/image/book.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

BIN
src/assets/image/call.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 734 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

BIN
src/assets/image/circle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
src/assets/image/course.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 885 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 638 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 877 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

BIN
src/assets/image/go.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 742 B

BIN
src/assets/image/img.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

BIN
src/assets/image/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/assets/image/next.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

BIN
src/assets/image/notask.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

BIN
src/assets/image/pm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 771 B

BIN
src/assets/image/prev.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 882 B

BIN
src/assets/image/px.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
src/assets/image/rank1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
src/assets/image/rank2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
src/assets/image/rank3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
src/assets/image/rankme.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
src/assets/image/rar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

BIN
src/assets/image/return.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
src/assets/image/select.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 B

BIN
src/assets/image/shalou.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Some files were not shown because too many files have changed in this diff Show More