yujialong 8 months ago
parent 3caf9aaaa9
commit b7ed849f54
  1. 1
      src/api/index.js
  2. 20
      src/components/TestPanel.vue
  3. 21
      src/components/codemirror.vue
  4. 4
      src/config/index.js
  5. 19
      src/views/Home.vue

@ -43,4 +43,5 @@ export default {
removeImport: `occupationlab/occupationlab/experimentalReport/removeImport`, removeImport: `occupationlab/occupationlab/experimentalReport/removeImport`,
getStartTime: `python/python/getStartTime`, getStartTime: `python/python/getStartTime`,
getProductSystemTheme: `nakadai/mall/getProductSystemTheme`, getProductSystemTheme: `nakadai/mall/getProductSystemTheme`,
heartbeatDetection : `nakadai/message/heartbeatDetection`,
} }

@ -439,6 +439,7 @@ export default {
} }
this.competitionId && this.getCompetitionStatus() // this.competitionId && this.getCompetitionStatus() //
this.getUserDetail() this.getUserDetail()
this.heartbeatDetection()
this.drag() this.drag()
this.tableHeight = window.innerHeight - 360 this.tableHeight = window.innerHeight - 360
}, },
@ -815,6 +816,8 @@ export default {
const points = this.points const points = this.points
// codecodeId, // codecodeId,
points.map(e => { points.map(e => {
e.finalCode = ''
e.photoUrl = ''
e.code = '' e.code = ''
e.codeId = '' e.codeId = ''
e.answer = '' e.answer = ''
@ -922,7 +925,7 @@ export default {
const attributesReqList = [] const attributesReqList = []
pointList.map(e => { pointList.map(e => {
attributesReqList.push({ attributesReqList.push({
code: e.code, code: e.finalCode,
codeId: e.codeId, codeId: e.codeId,
bcId: e.judgmentId, bcId: e.judgmentId,
isSubmit: e.codeId ? 1 : 0, isSubmit: e.codeId ? 1 : 0,
@ -979,7 +982,10 @@ export default {
this.submiting = false this.submiting = false
// //
if (this.competitionId) { if (this.competitionId) {
this.$alert(`提交成功!${this.resultAnnouncementTime != 0 ? '成绩将在' + this.resultAnnouncementTime + '小时后发布,请去参赛信息模块查看' : ''}`, '提示', { const time = this.resultAnnouncementTime
const msg =
time === '0' ? '提交成功!成绩将在比赛结束后公布,请前往参赛信息模块查看' : time > 0 ? `提交成功!成绩将在比赛结束后${time}小时公布,请前往参赛信息模块查看` : '提交成功';
this.$alert(msg, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
callback: action => { callback: action => {
this.$parent.back() this.$parent.back()
@ -1170,9 +1176,9 @@ export default {
console.log(JSON.parse(msg.data)); console.log(JSON.parse(msg.data));
const { content } = JSON.parse(msg.data) const { content } = JSON.parse(msg.data)
// 1234-id // 1234-id
if (content == 1) { if (content == 1 && this.projectPermissions === 2) {
this.getCompetitionStatus() this.getCompetitionStatus()
} else if (content === '3-' + this.assessmentId) { // 3-id } else if ((content === '3-' + this.assessmentId) && this.projectPermissions === 1) { // 3-id
this.getAssStatus() this.getAssStatus()
} }
}, },
@ -1192,6 +1198,12 @@ export default {
// socket // socket
this.socket.onmessage = this.getMessage; this.socket.onmessage = this.getMessage;
}, },
//
heartbeatDetection () {
setInterval(async () => {
await this.$get(this.api.heartbeatDetection)
}, 58 * 1000)
},
// //
getUserDetail () { getUserDetail () {
this.$get(this.api.queryUserInfoDetails).then(res => { this.$get(this.api.queryUserInfoDetails).then(res => {

@ -201,7 +201,7 @@
<el-button type="text" <el-button type="text"
@click="showCode(scope.row)">查看代码</el-button> @click="showCode(scope.row)">查看代码</el-button>
<el-button type="text" <el-button type="text"
@click="importCode(scope.row)">入代码</el-button> @click="importCode(scope.row)">入代码</el-button>
<el-button type="text" <el-button type="text"
@click="del(scope.row)">删除</el-button> @click="del(scope.row)">删除</el-button>
</template> </template>
@ -222,7 +222,7 @@
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="查看代码" <el-dialog :title="curRow.judgmentName"
:visible.sync="showVisible" :visible.sync="showVisible"
width="700px" width="700px"
:close-on-click-modal="false" :close-on-click-modal="false"
@ -239,7 +239,7 @@
name="result"> name="result">
<div style="position: relative"> <div style="position: relative">
<div class="result" <div class="result"
v-html="curResult"></div> v-html="curRow.runResults"></div>
<div v-if="curPhotoUrl.length" <div v-if="curPhotoUrl.length"
class="pics"> class="pics">
<div class="pic-item" <div class="pic-item"
@ -258,7 +258,7 @@
class="dialog-footer"> class="dialog-footer">
<el-button size="small" <el-button size="small"
type="primary" type="primary"
@click="showSubmit">入代码</el-button> @click="showSubmit">入代码</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -314,7 +314,7 @@ import config from '@/config'
import { saveAs } from 'file-saver' import { saveAs } from 'file-saver'
const CANCEL_TOKEN = axios.CancelToken // input const CANCEL_TOKEN = axios.CancelToken // input
export default { export default {
props: ['judgmentId', 'code', 'codeId', 'projectId', 'systemId', 'retResult', 'modelIsShow', 'photoUrl', 'answer'], props: ['judgmentId', 'code', 'finalCode', 'codeId', 'projectId', 'systemId', 'retResult', 'modelIsShow', 'photoUrl', 'answer'],
data () { data () {
return { return {
token: Cookie.get('admin-token'), token: Cookie.get('admin-token'),
@ -417,8 +417,8 @@ export default {
showVisible: false, showVisible: false,
showActive: 'code', showActive: 'code',
curRow: {},
curCode: '', curCode: '',
curResult: '',
curPhotoUrl: [], curPhotoUrl: [],
}; };
}, },
@ -471,12 +471,15 @@ export default {
}, },
// //
clearCode () { clearCode () {
this.picSrcList = []
this.codeVal = '' this.codeVal = ''
this.isError = '' this.isError = ''
this.runResult = '' this.runResult = ''
this.$emit('update:finalCode', '')
this.$emit('update:codeId', '') // coddeId this.$emit('update:codeId', '') // coddeId
this.$emit('update:answer', '') // this.$emit('update:answer', '') //
this.$emit('update:retResult', '') // this.$emit('update:retResult', '') //
this.$emit('update:photoUrl', '') //
}, },
// //
importModel () { importModel () {
@ -608,6 +611,7 @@ export default {
this.isError = 1 this.isError = 1
this.runResult += result this.runResult += result
} }
this.$emit('update:finalCode', this.sourceCode)
this.$emit('update:codeId', res.codeId) // coddeId this.$emit('update:codeId', res.codeId) // coddeId
this.$emit('update:answer', this.runResult) // this.$emit('update:answer', this.runResult) //
this.$emit('update:retResult', data.retResult) // this.$emit('update:retResult', data.retResult) //
@ -674,6 +678,7 @@ export default {
this.isError = 1 this.isError = 1
this.confirmInput(result) this.confirmInput(result)
} }
this.$emit('update:finalCode', code)
this.$emit('update:codeId', res.codeId) // coddeId this.$emit('update:codeId', res.codeId) // coddeId
this.$emit('update:answer', this.runResult) // this.$emit('update:answer', this.runResult) //
this.$emit('update:retResult', data.retResult) // this.$emit('update:retResult', data.retResult) //
@ -710,6 +715,7 @@ export default {
this.picSrcList = photo.split(',') this.picSrcList = photo.split(',')
this.$emit('update:photoUrl', photo) this.$emit('update:photoUrl', photo)
} }
this.$emit('update:finalCode', code)
this.$emit('update:codeId', res.codeId) // coddeId this.$emit('update:codeId', res.codeId) // coddeId
this.$emit('update:answer', result) // this.$emit('update:answer', result) //
this.$emit('update:retResult', data.retResult) // this.$emit('update:retResult', data.retResult) //
@ -864,9 +870,10 @@ export default {
}, },
// //
showCode (row) { showCode (row) {
this.curRow = row
this.curCode = row.runCode this.curCode = row.runCode
this.curResult = row.runResults
this.curPhotoUrl = row.photoUrl ? row.photoUrl.split(',') : [] this.curPhotoUrl = row.photoUrl ? row.photoUrl.split(',') : []
this.showActive = 'code'
this.showVisible = true this.showVisible = true
}, },
// //

@ -13,9 +13,9 @@ let host = location.origin + '/'
let bankPath = `${location.origin}/banksystem` // 银行系统 let bankPath = `${location.origin}/banksystem` // 银行系统
// 121.37.12.51 | 192.168.31.151 // 121.37.12.51 | 192.168.31.151
if (isDev) { if (isDev) {
host = 'http://192.168.31.217:9000/' // host = 'http://192.168.31.217:9000/'
// host = 'http://121.37.12.51:9000/' // host = 'http://121.37.12.51:9000/'
// host = 'https://occupationlab.com/' host = 'https://occupationlab.com/'
bankPath = `http://${location.hostname}:8093` bankPath = `http://${location.hostname}:8093`
} else if (isPro) { } else if (isPro) {
host = 'https://occupationlab.com/' host = 'https://occupationlab.com/'

@ -60,6 +60,7 @@
:projectId.sync="projectId" :projectId.sync="projectId"
:systemId.sync="systemId" :systemId.sync="systemId"
:code.sync="item.code" :code.sync="item.code"
:finalCode.sync="item.finalCode"
:judgmentId="item.judgmentId" :judgmentId="item.judgmentId"
:codeId.sync="item.codeId" :codeId.sync="item.codeId"
:answer.sync="item.answer" :answer.sync="item.answer"
@ -82,10 +83,14 @@
ref="mainindex" ref="mainindex"
:workbench.sync="workbench"></testPanel> :workbench.sync="workbench"></testPanel>
</div> </div>
<div v-if="isSubmit"
class="mask"></div>
</div> </div>
</template> </template>
<script> <script>
import newmain from "../util/newMain";
import testPanel from "../components/TestPanel"; import testPanel from "../components/TestPanel";
import codemirror from "../components/codemirror"; import codemirror from "../components/codemirror";
import Cookie from 'js-cookie' import Cookie from 'js-cookie'
@ -95,6 +100,7 @@ export default {
data () { data () {
return { return {
Config, Config,
isSubmit: Cookie.get('admin-isSubmit') == 'true' ? true : false, //
loaded: false, // loaded: false, //
loadIns: null, // loading loadIns: null, // loading
competitionId: Cookie.get('admin-competitionId'), competitionId: Cookie.get('admin-competitionId'),
@ -140,6 +146,10 @@ export default {
this.loadIns = Loading.service({ this.loadIns = Loading.service({
background: 'rgba(255, 255, 255, .1)' background: 'rgba(255, 255, 255, .1)'
}) })
//
newmain.$on("isSubmit", isSubmit => {
this.isSubmit = isSubmit
})
this.autoLogout() this.autoLogout()
// //
window.onbeforeunload = () => { window.onbeforeunload = () => {
@ -359,4 +369,13 @@ export default {
opacity: 0.9; opacity: 0.9;
} }
} }
.mask {
z-index: 999;
position: absolute;
top: 58px;
left: 0;
bottom: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.3);
}
</style> </style>
Loading…
Cancel
Save