重新开始弹框

master
yujialong 6 months ago
parent cf67d8a099
commit e0f0ed0092
  1. 6
      src/api/http.js
  2. 24
      src/components/TestPanel.vue
  3. 53
      src/components/breadcrumb/index.vue
  4. 7
      src/components/codemirror.vue
  5. 2
      src/config/index.js

@ -30,6 +30,7 @@ service.interceptors.request.use(config => {
return Promise.reject(err);
})
let logouted = 0;
// 响应拦截器
service.interceptors.response.use(
response => {
@ -49,11 +50,14 @@ service.interceptors.response.use(
switch (error.response.status) {
// 401: 未登录
case 401:
if (!logouted) {
Message.error('登录过期,请重新登录')
setTimeout(() => {
history.back()
}, 1500)
break;
logouted = 1
}
break;
default:
// Message.error(error.response.data.message)
Promise.reject(error.response);

@ -51,7 +51,7 @@
<el-button @click="toReport"
v-if="isSubmit && !competitionId">查看实验报告</el-button>
<el-button class="reload"
@click="reload"
@click="reloadConfirm"
v-show="projectPermissions == 0">重新开始</el-button>
<el-button type="primary"
class="submit btn"
@ -821,7 +821,6 @@ export default {
location.href = href
}
},
//
async reload () {
this.reloadCount()
this.grade = '00'
@ -843,6 +842,24 @@ export default {
this.clearReport()
this.entryTime = await this.getNow()
},
//
async reloadConfirm () {
//
if (this.isSubmit) {
this.reload()
} else {
try {
await this.$confirm('<p style="color: #f56c6c;">点击重新开始,之前操作会清空。</p><p>确定重新开始吗?</p>', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false,
dangerouslyUseHTMLString: true,
})
this.reload()
} catch (e) { }
}
},
//
ready (i) {
if (this.$refs['codemirror' + i]) {
@ -1583,4 +1600,7 @@ export default {
}
}
}
.text-danger {
color: #f56c6c;
}
</style>

@ -3,15 +3,12 @@
<div class="breadcrumb">
<el-breadcrumb separator=">">
<template v-for="(item, index) in pages">
<el-breadcrumb-item
v-if="index != pages.length - 1"
:key="index"
>
<el-breadcrumb-item v-if="index != pages.length - 1"
:key="index">
<span @click="toPath">{{item}}</span>
</el-breadcrumb-item>
<el-breadcrumb-item
v-else
:key="index">
<el-breadcrumb-item v-else
:key="index">
{{item}}
</el-breadcrumb-item>
</template>
@ -21,33 +18,25 @@
<script>
export default {
props: {
data: {
type: String,
required: true
},
route: {
type: String,
default: '/'
},
query: {
type: Object
}
props: {
data: {
type: String,
required: true
},
data() {
return {
pages: this.data.split('/')
};
},
data () {
return {
pages: this.data.split('/')
};
},
methods: {
update (data) {
this.pages = data.split('/')
},
methods: {
update(data){
this.pages = data.split('/')
},
toPath() {
console.log(33)
this.$router.back()
}
toPath () {
this.$router.back()
}
}
};
</script>
<style lang="scss" scoped>
@ -63,7 +52,7 @@ export default {
}
&:last-child {
.is-link {
color: #0B1D30;
color: #0b1d30;
}
}
}

@ -591,8 +591,11 @@ export default {
//
async stopRunCode () {
this.isStopRunCode = 1
if (this.pid) await this.$post(`${this.api.endRunningProcess}?pid=${this.pid}`)
this.pid = ''
if (this.pid) {
const { pid } = this
this.pid = ''
await this.$post(`${this.api.endRunningProcess}?pid=${pid}`)
}
if (this.loadIns) this.loadIns.close()
},
inputRunCode (data) {

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

Loading…
Cancel
Save