init 初始化

This commit is contained in:
yuping
2022-11-28 11:33:26 +08:00
parent 6424a4857b
commit 89c47f7a60
14 changed files with 636 additions and 30 deletions

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>

View File

@@ -1,31 +1,41 @@
{
"name": "stu_h5",
"name": "jdfstudy",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
"dev": "vite",
"server": "vite build && vite preview",
"build": "vite build"
},
"dependencies": {
"core-js": "^3.8.3",
"element-plus": "^2.2.17",
"vue": "^3.2.13",
"vue-router": "^4.0.3",
"vuex": "^4.0.0"
"axios": "^1.1.3",
"core-js": "^3.26.0",
"dayjs": "^1.11.6",
"element-plus": "^2.2.20",
"vue": "^3.2.45",
"vue-router": "^4.1.6",
"vuex": "^4.1.0"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-vuex": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"sass": "^1.32.7",
"sass-loader": "^12.0.0"
"@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"
},
"eslintConfig": {
"root": true,

View File

@@ -1,6 +1,6 @@
<template>
<div id="container">
<!-- <div id="nav">
<div id="nav">
<router-link
v-for="item in routes"
:key="item.path"
@@ -12,7 +12,7 @@
>
{{ item.name }}
</router-link>
</div> -->
</div>
<main>
<router-view />
</main>

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

@@ -0,0 +1,20 @@
export const BASE = 'http://localhost:3000'
export const FILE_UPLOAD = '/file/upload'
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 ROUTER_UNCOMPLETE_LIST = '/stu/router/unCompleteTaskList'
export const TAS_ACTIVITY_DETAIL = '/stu/task/activity/detail'
export const TASK_ACTIVITY_SIGN = '/stu/task/activity/sign'
export const TASK_BROADCAST_COMMIT = '/stu/task/broadcast/commit'
export const TASK_BROADCAST_DETAIL = '/stu/task/broadcast/detail'
export const TASK_BROADCAST_SIGN = '/stu/task/broadcast/sign'
export const TASK_VOTE_COMMIT = '/stu/task/vote/commit'
export const TASK_VOTE_DETAIL = '/stu/task/vote/detail'
export const TASK_WORK_COMMIT = '/stu/task/work/commit'
export const TASK_WORK_DETAIL = '/stu/task/work/detail'
export const STU_OFFCOURSE_DETAIL = '/stu/offcourse/detail'
export const WORK_QUERYWORKDETAILBYID = '/work/queryWorkDetailById'
export const EXAMINATION_QUERYEXAMINATIONDETAILBYID = '/examination/queryExaminationDetailById'
export const DISCUSS_COLLECTION = '/discussSubmit/clickDiscussCollectionCountOr POST'
export const DISCUSS_LIKE = '/discussSubmit/clickDiscussLikeCountOr POST'

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

@@ -0,0 +1,75 @@
import router from "@/router";
import {ref, watch} from "vue";
import axios from 'axios';
export function useRequest(_url, params = {}) {
const data = ref({})
const loading = ref(false)
watch(params, () => {
fetchData()
})
function fetchData() {
loading.value = true
request(_url, params).then(r => {
data.value = r.data
loading.value = false
})
}
fetchData()
return {
data,
loading,
fetchData,
};
}
export async function request(_url, params) {
const s = _url.split(' ')
let url = s[0]
const method = s[1] || '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: {
'X-Token': localStorage.getItem('token'),
...method !== 'get' ? {'Content-Type': 'application/json'} : {}
},
baseURL: '',
...method !== 'get' ? {data: JSON.stringify(body)} : {}
}).then(resp=>resp.data).then(response => {
if (response.code !== 200 && response.code !== 0) {
if (response.code === 3 || response.code === 4 || response.code === 100) {
// router.push({path: '/login'})
return
} else {
// response.showMsg && notification.open({
// message: response.showMsg,
// duration: 2,
// });
return
}
}
return response
}).catch(e => {
console.log(2222)
console.log(e)
// router.push({path: '/login'})
})
}

12
src/mock/index.js Normal file
View File

@@ -0,0 +1,12 @@
import {createProdMockServer} from 'vite-plugin-mock/es/createProdMockServer'
const context = import.meta.glob("./mocks/*.js", {eager: true})
const API = await import("../api/api")
const array = Object.keys(context).map(path =>
Object.keys(context[path].default).map(url => ({
url: API[url].split(' ')[0],
method: API[url].split(' ').length > 1 ? API[url].split(' ')[1] : 'get',
response: context[path].default[url]
}))).reduce((r, m) => [...r, ...m])
console.log(array)
createProdMockServer([...array])

97
src/mock/mocks/ballot.js Normal file
View File

@@ -0,0 +1,97 @@
export default {
//路径图展开列表
ROUTER_CHAPTER_LIST: () => ({
"code": 200,
"msg": "请求成功!",
"data": {
"rows": [
{
"chapterId": 0,
"name": ""
}
]
},
//学员路径图列表
}),
ROUTER_LIST: () => ({
"code": 0,
"data": {
"pageNo": 0,
"pageSize": 0,
"pages": 0,
"rows": [
{
"name": "asdffad",
"picUrl": "asdfasdf",
"remark": "sdfasf",
"routerId": 0,
"status": 0,
"target": "adfsf "
}
],
"total": 0
},
"msg": "",
"success": true
}),
//学员路径图进度明细
ROUTER_PROCESS: () => ({
"code": 0,
"data": {
"certCnt": 0,
"chapterProcessList": [
{
"chapterId": 0,
"chapterName": "序:产品经理从初级到中级",
"taskProcessList": [
{
"currentRatio": 63,
"flag": true,
"name": "趣味课前小测 - MBTI测试你适合做哪个方向",
"routerTaskId": 0,
"status": 1,
"type": 0
}
],
"status": 1,
}
],
"currentChapterCnt": 20,
"currentReqCnt": 0,
"name": "",
"routerId": 0,
"totalChapterCnt": 70,
"totalReqCnt": 0,
"userInfoBo": {
"deptName": "",
"jobName": "教师是学生的镜子,学生是老师的影子",
"userId": 0,
"userName": "王星天"
}
},
"msg": "",
"success": true
}),
//未完成任务列表
ROUTER_UNCOMPLETE_LIST: () => ({
"code": 0,
"data": {
"pageNo": 0,
"pageSize": 0,
"pages": 0,
"rows": [
{
"chapterId": 0,
"chapterName": "",
"name": "",
"routerId": 0,
"routerTaskId": 0,
"routerTaskName": ""
}
],
"total": 0
},
"msg": "",
"success": true
})
}

3
src/mock/mocks/debate.js Normal file
View File

@@ -0,0 +1,3 @@
export default {
}

76
src/mock/mocks/face.js Normal file
View File

@@ -0,0 +1,76 @@
export default {
STU_OFFCOURSE_DETAIL: () => ({
"code": 0,
"data": {
"applyFlag": 0,
"evalFlag": 0,
"evalItem": {
"courseId": 0,
"name": ""
},
"examFlag": 0,
"examItem": {
"courseId": 0,
"name": "模块化产品展示相关案例与展示:如何自由组合你的思考?"
},
"offCourseInfo": {
"attach": "",
"auditStatus": 0,
"categoryId": 0,
"createId": 0,
"createName": "",
"createTime": "",
"intro": `
通过对各级人员的软件平台培训,使其能够了解如何运用乾元坤和智能信息管理系统来提升企业管理水平,最大限度发挥软件产品在企业中的作用。<br/>
1.使企业不同部门人员掌握便捷、有效的系统平台操作方法;<br/>
2.通过系统平台的培训提高员工对企业的管理理念认识与提升。<br/>
3.通过系统平台培训加强沟通,统一部署,协同工作,提高效率。<br/>
`,
"meaning": "",
"name": "核心项目面授课",
"offcourseId": 0,
"outline": "",
"picUrl": "",
"projectId": 0,
"projectName": "",
"publishStatus": 0,
"publishTime": "",
"sceneId": 0,
"score": 0,
"status": 0,
"targetUser": "",
"teacher": "",
"teacherId": 0,
"tips": "",
"updateTime": ""
},
"offCoursePlanInfo": {
"address": "大族广场",
"applyFlag": 0,
"attach": "附件1.pdf,附件2.excel",
"beginTime": '2022-07-20 20:00-21:00',
"completeType": 0,
"createTime": 0,
"endTime": 0,
"evalFlag": 1,
"name": "",
"offcourseId": 0,
"offcoursePlanId": 0,
"score": 0,
"signFlag": 0,
"signWordFlag": 0,
"studentCnt": 0,
"teacher": "",
"teacherId": 0
},
"stuFlag": 0,
"workFlag": 0,
"workItem": {
"courseId": 0,
"name": "社交产品如何做好模块化处理?"
}
},
"msg": "",
"success": true
}),
}

254
src/mock/mocks/task.js Normal file
View File

@@ -0,0 +1,254 @@
export default {
//路径图展开列表
TAS_ACTIVITY_DETAIL: () => ({
"code": 0,
"data": {
"detail": {
"createTime": "2022-07-20 20:00-21:00",
"createUser": 0,
"submitEndTime": "",
"submitStartTime": "",
"updateTime": "",
"updateUser": 0,
"workEnclosureAddress": "大族广场",
"workFlag": "",
"workId": 0,
"workName": "【其他活动】管理者进阶腾飞班 - 专属线下活动",
"workRequirement": `写字楼介绍 <br />
大族广场写字楼采用国际顶级硬件设施美国OTIS电梯、麦克维尔中央空调、高端安防系统等商务空间新标准匹配项目在亦庄地标综合体的形象。写字楼空间设计由亚洲著名的
室内空间设计大师之一梁景华设计,写字楼群由六栋(T1—T6)呈舰队排列的5A写字楼构成形成独特的舰队造型。
<br />
购物中心介绍 <br />
大族广场Mall&More位于北京经济技术开发区核心商圈荣华路由荷兰鹿特丹缤纷市场设计师HANS
VAN DALEN
主持设计,秉持自然与未来和谐共生理念,倡导乐活、有机、绿色环保的生活方式,传递生活美学。
<br />
大族广场Mall&More汇集众多知名优质品牌,7FRESH生鲜超市、CGV星聚汇影城、中信书店、源力悦体等,集购物、餐饮、娱乐、文化于一体,丰富的业态品类为消费者提供城市
生活的第三空间感受。<br />
大族广场Mall&More以人为本,不断提升服务水平,升级消费购物体验,致力于营造更加舒适的购物环境与空间,打造有温度的品牌。同时根据春夏秋冬四季策划丰富多样的大型主题
活动;为会员设置专属的沙龙活动,打造专属会员日等,与顾客近距离产生情感上的互动与链接,为城市人们提供自由、放松、愉悦的社交空间与精神的栖息地。<br />`,
"workTag": ""
},
"signFlag": 0
},
"msg": "",
"success": true
}),
TASK_ACTIVITY_SIGN: () => ({
"code": 0,
"data": {},
"msg": "",
"success": true
}),
TASK_BROADCAST_COMMIT: () => ({
"code": 0,
"data": {},
"msg": "",
"success": true
}),
TASK_BROADCAST_DETAIL: () => ({
"code": 0,
"data": {"assessmentsubmitvo": {
"assessmentId": 0,
"assessmentName": "",
"assessment_submit_id": 0,
"createTime": "",
"createUser": 0,
"essayQuestionSubmitDtoList": [
{
"assessmentSubmitId": 0,
"assessment_submit_id": 0,
"createTime": "",
"createUser": 0,
"qaSubmitId": 0,
"qaSubmitStemAnswer": "",
"qaSubmitStemId": 0,
"qaSubmitStemName": 0,
"questionType": "",
"updateTime": "",
"updateUser": 0
}
],
"multipleSubmitChoiceDtoList": [
{
"assessmentSubmitId": 0,
"createTime": "",
"createUser": 0,
"multipleSubmitId": 0,
"multipleSubmitOptionDtoList": [
{
"answerOptionId": 0,
"answerOptionName": "",
"createTime": "",
"createUser": 0,
"multipleId": 0,
"multipleSubmitId": 0,
"updateTime": "",
"updateUser": 0
}
],
"questionType": "",
"stemName": "",
"updateTime": "",
"updateUser": 0
}
],
"scoringQuestionSubmitDtoList": [
{
"assessmentSubmitId": 0,
"assessment_submit_id": 0,
"createTime": "",
"createUser": 0,
"questionType": "",
"scSubmitId": 0,
"scSubmitScore": 0,
"scSubmitStemId": 0,
"scSubmitStemTitle": 0,
"updateTime": "",
"updateUser": 0
}
],
"singleChoiceSubmitDtoList": [
{
"answerOptionId": 0,
"answerOptionName": 0,
"assessmentSubmitId": 0,
"createTime": "",
"createUser": 0,
"questionType": "",
"singleSubmitId": 0,
"stemName": "",
"updateTime": "",
"updateUser": 0
}
],
"stuId": "",
"stuName": "",
"updateTime": "",
"updateUser": 0
},
"detail": {
"afterSignIn": "",
"assessmentId": 0,
"beforeSignIn": "",
"createTime": "",
"createUser": 0,
"isEvaluate": "",
"liveCover": "",
"liveDuration": 0,
"liveEndTime": "",
"liveExplain": `当你走进这直播间,我和毛不易老师@毛不易就已
经在直播间等你们了!今晚20点30不见不散!<br/>`,
"liveFlag": "",
"liveId": 0,
"liveLink": "",
"liveName": "管理者进阶腾飞班 - 毕业典礼",
"livePlayback": "",
"livePlaybackLink": "",
"liveStartTime": "2022-07-20 20:00-21:00",
"liveTag": "",
"liveTeacherId": 0,
"otherSettings": "",
"signOutTime": "",
"standardSettings": "",
"updateTime": "",
"updateUser": 0
},
"evalFlag": 0,
"signFlag": 0,
"submitVo": {
"assessmentSubmitId": "",
"createTime": "",
"createUser": 0,
"liveId": "",
"liveSubmitId": 0,
"signInTime": "",
"stuId": "",
"stuName": "",
"updateTime": "",
"updateUser": 0
}
},
"msg": "",
"success": true
}),
TASK_BROADCAST_SIGN: () => ({
"code": 0,
"data": {},
"msg": "",
"success": true
}),
TASK_VOTE_COMMIT: () => ({
"code": 0,
"data": {},
"msg": "",
"success": true
}),
TASK_VOTE_DETAIL: () => ({
"code": 0,
"data": {
"accessCnt": 20,
"detail": {
"ballotId": 0,
"baseVote": "",
"createTime": "",
"createUser": 0,
"updateTime": "",
"updateUser": 0,
"voteEndTime": "2022-11-22 00:00:00",
"voteExplain": "为提高核心项目讲解体验,现向广大学员征集较为接受的授课方式,每位学员可投票2个选项我们将选取最高选项的两个做后续讲解。",
"voteFlag": "",
"voteId": 0,
"voteName": "",
"voteStartTime": "2022-11-14 00:00:00",
"voteTag": ""
},
"viewCnt": 10,
"voteCnt": 10,
"voteFlag": 0
},
"msg": "",
"success": true
}),
TASK_WORK_COMMIT: () => ({
"code": 0,
"data": {},
"msg": "",
"success": true
}),
TASK_WORK_DETAIL: () => ({
"code": 0,
"data": {
"detail": {
"createTime": "",
"createUser": 0,
"submitEndTime": "2022-12-22 00:00:00",
"submitStartTime": "2022-11-22 00:00:00",
"updateTime": "",
"updateUser": 0,
"workEnclosureAddress": "",
"workFlag": "",
"workId": 0,
"workName": "管理者进阶腾飞班 - 第一次作业 - 沙盘实验",
"workRequirement": `1、阅读文章做名校题库翻译文言文整体文化常识和<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;文言知识`,
"workTag": ""
},
"workSubmitList": [
{
"createTime": "2022-7-20 00:00",
"createUser": 0,
"stuId": "",
"stuName": "",
"updateTime": "",
"updateUser": 0,
"workId": 0,
"workSubmitId": 0,
"workUploadAddress": "",
"workUploadContent": "大唐之音鉴赏 - 2022/7/20.zip"
}
]
},
"msg": "",
"success": true
}),
}

View File

@@ -1,16 +1,14 @@
const routes = [];
const context = require.context('@/views', true, /\.vue$/, 'lazy');
context.keys().forEach(path => {
// console.log('path', path)
const context =import.meta.glob("../views/*/*.vue")
Object.keys(context).forEach(path => {
const componentName = path.replace(/.*\/([^\\.\\/]*)\.vue$/, '$1');
routes.push({
path: `/${componentName.toLowerCase()}`,
name: componentName,
component: () => context(path),
component: () => import(path/* @vite-ignore */),
meta: {
isLink: true
}
});
});
export default routes;

View File

@@ -156,6 +156,7 @@
<script>
import { reactive, toRefs } from "vue";
// import TitleHead from "@/components/TitleHead.vue";
import px from '@/assets/image/discuss/px.jpg'
export default {
name: "DiscussDetail",
components: {
@@ -168,8 +169,8 @@ export default {
name: "罗宗梅",
time: "2022-09-01",
re: "教师基本功扎实,知识讲解准确,教学设计合理,始终以学生为主体,自主学习,小组交流讨论,上台交流展示等形式,师生配合默契,取得了较好的学习效果。",
head: require("../../assets/image/discuss/px.jpg"),
reimg: require("../../assets/image/discuss/px.jpg"),
head: px,
reimg: px,
},
],
@@ -178,7 +179,7 @@ export default {
name: "赵雪梨",
time: "3天前",
re: "教学重难点突出,板书条理清晰。教学步骤设计合理由浅入深,循序渐进。",
head: require("../../assets/image/discuss/px.jpg"),
head: px,
},
// {
// name: "赵雪梨",

25
vite.config.js Normal file
View File

@@ -0,0 +1,25 @@
import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import legacy from '@vitejs/plugin-legacy'
import {viteMockServe} from 'vite-plugin-mock'
const path = require('path')
export default defineConfig(({command}) =>
({
plugins: [
vue(),
legacy({
targets: ['chrome 52', 'defaults', 'not IE 11']
}),
viteMockServe({
mockPath: './src/mock/mocks',
})
],
resolve: {
alias: [
{find: '@', replacement: path.resolve(__dirname, 'src')}
]
}
})
)

19
webstorm.config.js Normal file
View File

@@ -0,0 +1,19 @@
'use strict'
const path = require('path')
function resolve(dir) {
return path.join(__dirname, '.', dir)
}
module.exports = {
context: path.resolve(__dirname, './'),
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'@': resolve('src')
}
}
}