|
|
@@ -0,0 +1,169 @@
|
|
|
+<template>
|
|
|
+ <div class="container">
|
|
|
+ <div class="header">
|
|
|
+ <div class="title">{{coder_item.name}}</div>
|
|
|
+ <div :class="['state', color_type]">{{coder_item.state}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="info">
|
|
|
+ <div class="basic-info">
|
|
|
+ <div class="info1"><span style="color: #999999">所属课程: </span>{{coder_item.course}}</div>
|
|
|
+ <div><span style="color: #999999">归类: {{coder_item.type}}</span></div>
|
|
|
+ </div>
|
|
|
+ <div class="info-operation">
|
|
|
+ <div><span style="color: #999999">起止时间: </span>{{coder_item.start_time}}至{{coder_item.end_time}}</div>
|
|
|
+ <div class="button-position">
|
|
|
+ <el-button type="primary" :class="background_color">{{further_operation}}</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: "CoderCard",
|
|
|
+ props: {
|
|
|
+ coder_item: Object
|
|
|
+ },
|
|
|
+ data(){
|
|
|
+ return {
|
|
|
+ test: {
|
|
|
+ name: "软件工程测试题",
|
|
|
+ state: "正在进行",
|
|
|
+ course: "软件工程与计算",
|
|
|
+ creator: "kenny67NJU",
|
|
|
+ type: "Coder",
|
|
|
+ start_time: "2022/2/23 13:45",
|
|
|
+ end_time: "2022/2/24 13:45",
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ further_operation(){
|
|
|
+ if (this.coder_item.state === "正在进行"){
|
|
|
+ return "继续测试";
|
|
|
+ }else if (this.coder_item.state === "未参加"){
|
|
|
+ return "添加测试";
|
|
|
+ } else if (this.coder_item.state === "已结束"){
|
|
|
+ return "查看详情";
|
|
|
+ } else if (this.coder_item.state === "已完成"){
|
|
|
+ return "结果报告";
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ },
|
|
|
+ color_type(){
|
|
|
+ if (this.coder_item.state === "正在进行"){
|
|
|
+ return "color_blue";
|
|
|
+ }else if (this.coder_item.state === "已结束"){
|
|
|
+ return "color_red";
|
|
|
+ } else if (this.coder_item.state === "未参加"){
|
|
|
+ return "color_orange";
|
|
|
+ } else if (this.coder_item.state === "已完成"){
|
|
|
+ return "color_green";
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ },
|
|
|
+ background_color(){
|
|
|
+ if (this.coder_item.state === "正在进行"){
|
|
|
+ return "background_blue";
|
|
|
+ }else if (this.coder_item.state === "已结束"){
|
|
|
+ return "background_red";
|
|
|
+ } else if (this.coder_item.state === "未参加"){
|
|
|
+ return "background_orange";
|
|
|
+ } else if (this.coder_item.state === "已完成"){
|
|
|
+ return "background_green";
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.container {
|
|
|
+ width: 670px;
|
|
|
+ height: 120px;
|
|
|
+ background: #F8F9FB;
|
|
|
+ border-radius: 20px;
|
|
|
+ padding: 20px 16px;
|
|
|
+
|
|
|
+ .header {
|
|
|
+ position: relative;
|
|
|
+ height: 36px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 20px;
|
|
|
+ }
|
|
|
+ .state {
|
|
|
+ position: absolute;
|
|
|
+ right: 45px;
|
|
|
+ top: 0px;
|
|
|
+ font-size: 22px;
|
|
|
+ line-height: 36px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .info {
|
|
|
+ font-size: 20px;
|
|
|
+
|
|
|
+ .basic-info {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: nowrap;
|
|
|
+
|
|
|
+
|
|
|
+ .info1 {
|
|
|
+ margin-right: 20px;
|
|
|
+ margin-bottom: 8px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .info-operation {
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ .button-position {
|
|
|
+ position: absolute;
|
|
|
+ right: 30px;
|
|
|
+ bottom: 0px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .color_blue{
|
|
|
+ color: #1989FA;
|
|
|
+ }
|
|
|
+ .color_red{
|
|
|
+ color: #F56C6C;
|
|
|
+ }
|
|
|
+ .color_orange{
|
|
|
+ color: #E38800;
|
|
|
+ }
|
|
|
+ .color_green{
|
|
|
+ color: #67C23A;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-button--primary.background_blue{
|
|
|
+ background: #1989FA;
|
|
|
+ border-color: #1989FA;
|
|
|
+ }
|
|
|
+ .el-button--primary.background_red{
|
|
|
+ background: #F56C6C;
|
|
|
+ border-color: #F56C6C;
|
|
|
+ }
|
|
|
+ .el-button--primary.background_orange{
|
|
|
+ background: #E38800;
|
|
|
+ border-color: #E38800;
|
|
|
+ }
|
|
|
+ .el-button--primary.background_green{
|
|
|
+ background: #67C23A;
|
|
|
+ border-color: #67C23A;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|