测试点详情
@@ -199,6 +197,8 @@ export default {
submitId: '',
submitTime: '',
pid: '',
+ cid: '',
+ displayPid: '',
status: 0,
time: '',
memory: '',
@@ -246,8 +246,24 @@ export default {
return utils.submissionLengthFormat(length);
},
- getProblemUri(pid) {
- return '/problem/' + pid;
+ getProblemUri(row) {
+ if (row.cid != 0) {
+ // 比赛题目
+ this.$router.push({
+ name: 'ContestProblemDetails',
+ params: {
+ contestID: row.cid,
+ problemID: row.displayPid,
+ },
+ });
+ } else {
+ this.$router.push({
+ name: 'ProblemDetails',
+ params: {
+ problemID: row.displayPid,
+ },
+ });
+ }
},
getStatusColor(status) {
return 'el-tag el-tag--medium status-' + JUDGE_STATUS[status].color;
@@ -280,6 +296,11 @@ export default {
this.isIOProblem = true;
}
}
+ // 如果是比赛 需要显示的是比赛题号
+ console.log(this.$route.params.problemID);
+ if (this.$route.params.problemID && data.submission.cid != 0) {
+ data.submission.displayPid = this.$route.params.problemID;
+ }
this.submission = data.submission;
this.tableData = [data.submission];
if (data.submission.cid != 0) {
diff --git a/hoj-vue/src/views/oj/status/SubmissionList.vue b/hoj-vue/src/views/oj/status/SubmissionList.vue
index e7522b98..f0ee0810 100644
--- a/hoj-vue/src/views/oj/status/SubmissionList.vue
+++ b/hoj-vue/src/views/oj/status/SubmissionList.vue
@@ -576,10 +576,22 @@ export default {
myMessage.warning('请先登录后再查看代码!');
return;
}
- this.$router.push({
- name: 'SubmissionDeatil',
- params: { submitID: row.submitId },
- });
+ if (row.cid != 0) {
+ // 比赛提交详情
+ this.$router.push({
+ name: 'ContestSubmissionDeatil',
+ params: {
+ contestID: this.$route.params.contestID,
+ problemID: row.displayId,
+ submitID: row.submitId,
+ },
+ });
+ } else {
+ this.$router.push({
+ name: 'SubmissionDeatil',
+ params: { submitID: row.submitId },
+ });
+ }
},
getProblemUri(pid, isContest) {
if (isContest) {
diff --git a/sqlAndsetting/README.md b/sqlAndsetting/README.md
index a5d90436..7bc75a41 100644
--- a/sqlAndsetting/README.md
+++ b/sqlAndsetting/README.md
@@ -1,4 +1,4 @@
-# 1. 数据库
+1. 数据库
## 用户资料模块
@@ -544,6 +544,26 @@ file表
| gmt_create | datetime | | 创建时间 |
| gmt_modified | datetime | | 修改时间 |
+## 判题机模块
+
+judge_server表
+
+| 列名 | 实体属性类型 | 键 | 备注 |
+| --------------- | ------------ | ---- | ------------------------- |
+| id | int | 主键 | auto_increment |
+| name | String | | 判题服务名字 |
+| ip | String | | 判题机ip |
+| port | int | | 判题机端口号 |
+| url | String | | ip:port |
+| cpu_core | int | | 判题机所在服务器cpu核心数 |
+| task_number | int | | 当前判题数 |
+| max_task_number | int | | 判题并发最大数 |
+| status | int | | 0可用,1不可用 |
+| version | long | | 版本控制 |
+| is_remote | boolean | | 是否为远程判题vj |
+| gmt_create | datetime | | 创建时间 |
+| gmt_modified | datetime | | 修改时间 |
+
# 2. API(待续)
diff --git a/sqlAndsetting/hoj.sql b/sqlAndsetting/hoj.sql
index 81b12fa8..6973f7e7 100644
--- a/sqlAndsetting/hoj.sql
+++ b/sqlAndsetting/hoj.sql
@@ -188,7 +188,7 @@ CREATE TABLE `contest_record` (
CONSTRAINT `contest_record_ibfk_3` FOREIGN KEY (`pid`) REFERENCES `problem` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE,
CONSTRAINT `contest_record_ibfk_4` FOREIGN KEY (`cpid`) REFERENCES `contest_problem` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE,
CONSTRAINT `contest_record_ibfk_5` FOREIGN KEY (`submit_id`) REFERENCES `judge` (`submit_id`) ON DELETE NO ACTION ON UPDATE CASCADE
-) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
/*Table structure for table `contest_register` */
@@ -279,7 +279,7 @@ CREATE TABLE `judge` (
CONSTRAINT `judge_ibfk_1` FOREIGN KEY (`pid`) REFERENCES `problem` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE,
CONSTRAINT `judge_ibfk_2` FOREIGN KEY (`uid`) REFERENCES `user_info` (`uuid`) ON DELETE NO ACTION ON UPDATE CASCADE,
CONSTRAINT `judge_ibfk_3` FOREIGN KEY (`username`) REFERENCES `user_info` (`username`) ON DELETE NO ACTION ON UPDATE CASCADE
-) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8;
/*Table structure for table `judge_case` */
@@ -309,7 +309,28 @@ CREATE TABLE `judge_case` (
CONSTRAINT `judge_case_ibfk_2` FOREIGN KEY (`pid`) REFERENCES `problem` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `judge_case_ibfk_3` FOREIGN KEY (`submit_id`) REFERENCES `judge` (`submit_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `judge_case_ibfk_4` FOREIGN KEY (`case_id`) REFERENCES `problem_case` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB AUTO_INCREMENT=176 DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB AUTO_INCREMENT=1011 DEFAULT CHARSET=utf8;
+
+/*Table structure for table `judge_server` */
+
+DROP TABLE IF EXISTS `judge_server`;
+
+CREATE TABLE `judge_server` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `name` varchar(255) DEFAULT NULL COMMENT '判题服务名字',
+ `ip` varchar(255) NOT NULL COMMENT '判题机ip',
+ `port` int(11) NOT NULL COMMENT '判题机端口号',
+ `url` varchar(255) DEFAULT NULL COMMENT 'ip:port',
+ `cpu_core` int(11) DEFAULT '0' COMMENT '判题机所在服务器cpu核心数',
+ `task_number` int(11) NOT NULL DEFAULT '0' COMMENT '当前判题数',
+ `max_task_number` int(11) NOT NULL COMMENT '判题并发最大数',
+ `status` int(11) DEFAULT '0' COMMENT '0可用,1不可用',
+ `version` bigint(20) DEFAULT '0' COMMENT '版本控制',
+ `is_remote` tinyint(1) DEFAULT NULL COMMENT '是否为远程判题vj',
+ `gmt_create` datetime DEFAULT CURRENT_TIMESTAMP,
+ `gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
/*Table structure for table `language` */
@@ -327,7 +348,7 @@ CREATE TABLE `language` (
`gmt_create` datetime DEFAULT CURRENT_TIMESTAMP,
`gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8;
/*Table structure for table `problem` */
@@ -422,7 +443,7 @@ CREATE TABLE `problem_language` (
KEY `lid` (`lid`),
CONSTRAINT `problem_language_ibfk_1` FOREIGN KEY (`pid`) REFERENCES `problem` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `problem_language_ibfk_2` FOREIGN KEY (`lid`) REFERENCES `language` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB AUTO_INCREMENT=655 DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB AUTO_INCREMENT=660 DEFAULT CHARSET=utf8;
/*Table structure for table `problem_tag` */
@@ -486,7 +507,7 @@ CREATE TABLE `session` (
PRIMARY KEY (`id`),
KEY `uid` (`uid`),
CONSTRAINT `session_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `user_info` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8;
/*Table structure for table `tag` */
@@ -520,7 +541,7 @@ CREATE TABLE `user_acproblem` (
CONSTRAINT `user_acproblem_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `user_info` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `user_acproblem_ibfk_2` FOREIGN KEY (`pid`) REFERENCES `problem` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `user_acproblem_ibfk_3` FOREIGN KEY (`submit_id`) REFERENCES `judge` (`submit_id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB AUTO_INCREMENT=189 DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB AUTO_INCREMENT=236 DEFAULT CHARSET=utf8;
/*Table structure for table `user_info` */
@@ -565,7 +586,7 @@ CREATE TABLE `user_record` (
PRIMARY KEY (`id`,`uid`),
KEY `uid` (`uid`),
CONSTRAINT `user_record_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `user_info` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB AUTO_INCREMENT=300 DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB AUTO_INCREMENT=301 DEFAULT CHARSET=utf8;
/*Table structure for table `user_role` */
@@ -582,7 +603,7 @@ CREATE TABLE `user_role` (
KEY `role_id` (`role_id`) USING BTREE,
CONSTRAINT `user_role_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `user_info` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `user_role_ibfk_2` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB AUTO_INCREMENT=302 DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB AUTO_INCREMENT=303 DEFAULT CHARSET=utf8;
/* Trigger structure for table `contest` */