openf12
yujialong 2 years ago
parent c9c53af150
commit 1d2b7098d1
  1. 1
      README.md
  2. 1
      src/api/index.js
  3. 30
      src/components/TestPanel.vue
  4. 1
      src/components/codemirror.vue
  5. 24
      src/config/index.js
  6. 13
      src/views/Home.vue
  7. 5
      vue.config.js

@ -0,0 +1 @@
# python子系统前端

@ -10,6 +10,7 @@ export default {
saveCache: 'python/python/saveCache', saveCache: 'python/python/saveCache',
getLastCache: 'python/python/getLastCache', getLastCache: 'python/python/getLastCache',
delCache: 'python/python/delCache', delCache: 'python/python/delCache',
getTheMostRecentlyRunProject: 'python/python/getTheMostRecentlyRunProject',
getDetailById: 'occupationlab/occupationlab/assessment/getDetailById', getDetailById: 'occupationlab/occupationlab/assessment/getDetailById',
pageStuAssessment: 'occupationlab/occupationlab/assessment/pageStuAssessment', pageStuAssessment: 'occupationlab/occupationlab/assessment/pageStuAssessment',
modelClassList: `nakadai/nakadai/model/reference/modelClassList`, modelClassList: `nakadai/nakadai/model/reference/modelClassList`,

@ -128,16 +128,19 @@
<script> <script>
import newmain from "../util/newMain"; import newmain from "../util/newMain";
import util from '@/util' import util from '@/util'
import Config from '@/config'
import Cookie from 'js-cookie' import Cookie from 'js-cookie'
export default { export default {
data() { data() {
return { return {
token: Cookie.get('admin-token'),
systemId: Cookie.get('admin-systemId') || 1, systemId: Cookie.get('admin-systemId') || 1,
classId: Cookie.get('admin-classId'), classId: Cookie.get('admin-classId'),
className: Cookie.get('admin-className') ? decodeURI(Cookie.get('admin-className')) : '', className: Cookie.get('admin-className') ? decodeURI(Cookie.get('admin-className')) : '',
courseId: Cookie.get('admin-courseId'), courseId: Cookie.get('admin-courseId'),
projectId: Cookie.get('admin-projectId') ? Number(Cookie.get('admin-projectId')) : '', projectId: Cookie.get('admin-projectId') ? Number(Cookie.get('admin-projectId')) : '',
assessmentId: Cookie.get('admin-assessmentId'), assessmentId: Cookie.get('admin-assessmentId'),
curriculumName: Cookie.get('admin-curriculumName') ? unescape(Cookie.get('admin-curriculumName')) : 'python', //
curSystemId: 1, curSystemId: 1,
projectPermissions: 0, // (0 1 2) projectPermissions: 0, // (0 1 2)
isSubmit: false, // isSubmit: false, //
@ -167,8 +170,8 @@ export default {
}; };
}, },
mounted() { mounted() {
this.projectPermissions = this.projectId ? 1 : 0 // 10 this.projectPermissions = this.assessmentId ? 1 : 0 // 10
if(this.projectId){ // projectId) if(this.assessmentId){ // assessmentId)
this.getAssList() this.getAssList()
}else{ // }else{ //
// //
@ -195,7 +198,7 @@ export default {
this.$get(`${this.api.queryTestProject}`,data).then(res => { this.$get(`${this.api.queryTestProject}`,data).then(res => {
const list = res.projects const list = res.projects
this.projectList = list this.projectList = list
if (!this.projectPermissions) this.projectId = list ? list[0].projectId : 0 // if (!this.projectPermissions && !this.projectId) this.projectId = list ? list[0].projectId : 0 //
this.getProDetail().then(() => { this.getProDetail().then(() => {
resolve() resolve()
}).catch(res => { }).catch(res => {
@ -217,6 +220,10 @@ export default {
const points = res.projectJudgmentVos const points = res.projectJudgmentVos
const project = res.projectManage const project = res.projectManage
const curReq = [] const curReq = []
//
if (project.systemId == 11) {
return location.href = `${Config.bankPath}/#/index/list?curriculumName=${this.curriculumName}&token=${this.token}&cid=${this.courseId}&systemId=${this.systemId}&projectId=${projectId}&assessmentId=&classId=&stopTime=&test=true`
}
if (!points.length) { if (!points.length) {
this.$message.error('该项目没有判分点,请换个项目重试') this.$message.error('该项目没有判分点,请换个项目重试')
this.projectId = this.projectList[0].projectId this.projectId = this.projectList[0].projectId
@ -231,7 +238,7 @@ export default {
}) })
if (this.projectPermissions) { if (this.projectPermissions) {
this.projectList = [{ this.projectList = [{
projectId: projectId, projectId,
projectName: project.projectName projectName: project.projectName
}] }]
} }
@ -302,7 +309,7 @@ export default {
const assessmentId = this.assessmentId const assessmentId = this.assessmentId
const list = this.projectList const list = this.projectList
let points = [] let points = []
if (pId && cache.judgmentIdList) { if (pId && cache.judgmentIdList && !Cookie.get('admin-projectId')) {
cache.judgmentIdList.map(e => { cache.judgmentIdList.map(e => {
points.push({ points.push({
judgmentId: e judgmentId: e
@ -313,12 +320,19 @@ export default {
points = JSON.parse(JSON.stringify(this.points)) points = JSON.parse(JSON.stringify(this.points))
} }
// //
if (cache && cache.empty && list.find(e => e.projectId === projectId)) { if (cache && cache.empty && list.find(e => e.projectId === projectId) && !Cookie.get('admin-projectId')) {
this.projectId = projectId if (Cookie.get('admin-projectId')) {
this.getProDetail() Cookie.remove('admin-projectId')
} else {
this.projectId = projectId
this.getProDetail()
}
this.closeLoad() this.closeLoad()
localStorage.removeItem('codeCache') localStorage.removeItem('codeCache')
} else { } else {
if (Cookie.get('admin-projectId')) {
Cookie.remove('admin-projectId')
}
let newJudgmentId = '' // let newJudgmentId = '' //
const promiseList = [] // promise const promiseList = [] // promise
let hasCache = 0 // let hasCache = 0 //

@ -407,6 +407,7 @@ export default {
}) })
} else { } else {
this.loadIns = Loading.service({ this.loadIns = Loading.service({
text: '代码运行中请稍等几分钟',
background: 'transparent' background: 'transparent'
}) })
// savefig(python),savefig // savefig(python),savefig

@ -1,17 +1,22 @@
import util from '@/util' import Cookie from 'js-cookie'
const url = location.host const url = location.host
const isDev = process.env.NODE_ENV === 'development' //是否本地
const isHh = url.includes('10.196.131.73') //是否是河海版本 const isHh = url.includes('10.196.131.73') //是否是河海版本
const isPro = url.includes('occupationlab.com') //是否职站生产 const isPro = url.includes('occupationlab.com') //是否职站生产
let host = location.origin + '/' let host = location.origin + '/'
let bankPath = `${location.origin}/banksystem` // 银行系统
// 121.37.12.51 | 192.168.31.151 // 121.37.12.51 | 192.168.31.151
if (process.env.NODE_ENV === 'development') { if (isDev) {
host = 'http://192.168.31.151:9000/' host = 'http://192.168.31.151:9000/'
host = 'http://121.37.12.51:9000/'
bankPath = `http://${location.hostname}:8093`
} else if (isPro) { } else if (isPro) {
host = 'https://occupationlab.com/' host = 'https://occupationlab.com/'
bankPath = `https://www.huorantech.cn/banksystem`
} }
const systemId = util.getCookie('systemId') const systemId = Cookie.get('admin-systemId')
/** /**
* python8个系统的id和名称 * python8个系统的id和名称
* id即systemId从cookie里取 * id即systemId从cookie里取
@ -55,18 +60,31 @@ export default {
* @description 域名 * @description 域名
*/ */
host, host,
/**
* @description 是否本地
*/
isDev,
/** /**
* @description 是否是河海版本 * @description 是否是河海版本
*/ */
isHh, isHh,
/**
* @description 是否是职站生产
*/
isPro,
/** /**
* @description 系统主题色 * @description 系统主题色
* 如果有多个systemId则显示系统7的主题色
*/ */
defaultSystem: systemId.includes(',') ? 7 : systemId, defaultSystem: systemId.includes(',') ? 7 : systemId,
/** /**
* python子系统 * python子系统
**/ **/
pythonList, pythonList,
/**
* 银行系统
**/
bankPath,
/** /**
* @description 长时间未操作自动退出登录时间 * @description 长时间未操作自动退出登录时间
*/ */

@ -95,7 +95,6 @@ export default {
// //
leavePage() { leavePage() {
const list = this.workbench const list = this.workbench
console.log("🚀 ~ file: Home.vue ~ line 95 ~ leavePage ~ this.workbench", this.workbench)
// //
if (!this.$refs.mainindex.isSubmit && list.length) { if (!this.$refs.mainindex.isSubmit && list.length) {
const cache = { const cache = {
@ -164,7 +163,17 @@ export default {
}, },
// 退 // 退
back() { back() {
history.back() let href = this.$config.isDev ?
`http://${location.hostname}:8082/#/` :
`${location.origin}${this.$config.isPro ? '' : '/student'}/#/`
//
if (this.assessmentId) {
href += `ass/list`
} else {
//
href += `station/preview?courseId=${this.courseId}&curriculumName=${this.curriculumName}`
}
location.href = href
}, },
// id // id
setPoints(projectId, systemId, workbench) { setPoints(projectId, systemId, workbench) {

@ -2,5 +2,8 @@ module.exports = {
lintOnSave: true, lintOnSave: true,
publicPath: './', publicPath: './',
outputDir: 'dist', outputDir: 'dist',
assetsDir: 'static' assetsDir: 'static',
devServer: {
port: 8085 // 固定端口
}
} }
Loading…
Cancel
Save