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',
getLastCache: 'python/python/getLastCache',
delCache: 'python/python/delCache',
getTheMostRecentlyRunProject: 'python/python/getTheMostRecentlyRunProject',
getDetailById: 'occupationlab/occupationlab/assessment/getDetailById',
pageStuAssessment: 'occupationlab/occupationlab/assessment/pageStuAssessment',
modelClassList: `nakadai/nakadai/model/reference/modelClassList`,

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

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

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

@ -95,7 +95,6 @@ export default {
//
leavePage() {
const list = this.workbench
console.log("🚀 ~ file: Home.vue ~ line 95 ~ leavePage ~ this.workbench", this.workbench)
//
if (!this.$refs.mainindex.isSubmit && list.length) {
const cache = {
@ -164,7 +163,17 @@ export default {
},
// 退
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
setPoints(projectId, systemId, workbench) {

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