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`,
getStartTime: `python/python/getStartTime`,
getProductSystemTheme: `nakadai/mall/getProductSystemTheme`,
heartbeatDetection : `nakadai/message/heartbeatDetection`,
}

@ -439,6 +439,7 @@ export default {
}
this.competitionId && this.getCompetitionStatus() //
this.getUserDetail()
this.heartbeatDetection()
this.drag()
this.tableHeight = window.innerHeight - 360
},
@ -815,6 +816,8 @@ export default {
const points = this.points
// codecodeId,
points.map(e => {
e.finalCode = ''
e.photoUrl = ''
e.code = ''
e.codeId = ''
e.answer = ''
@ -922,7 +925,7 @@ export default {
const attributesReqList = []
pointList.map(e => {
attributesReqList.push({
code: e.code,
code: e.finalCode,
codeId: e.codeId,
bcId: e.judgmentId,
isSubmit: e.codeId ? 1 : 0,
@ -979,7 +982,10 @@ export default {
this.submiting = false
//
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: '确定',
callback: action => {
this.$parent.back()
@ -1170,9 +1176,9 @@ export default {
console.log(JSON.parse(msg.data));
const { content } = JSON.parse(msg.data)
// 1234-id
if (content == 1) {
if (content == 1 && this.projectPermissions === 2) {
this.getCompetitionStatus()
} else if (content === '3-' + this.assessmentId) { // 3-id
} else if ((content === '3-' + this.assessmentId) && this.projectPermissions === 1) { // 3-id
this.getAssStatus()
}
},
@ -1192,6 +1198,12 @@ export default {
// socket
this.socket.onmessage = this.getMessage;
},
//
heartbeatDetection () {
setInterval(async () => {
await this.$get(this.api.heartbeatDetection)
}, 58 * 1000)
},
//
getUserDetail () {
this.$get(this.api.queryUserInfoDetails).then(res => {

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

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

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