|
|
@@ -1,75 +1,209 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <nav class="breadcrumb" aria-label="breadcrumbs">
|
|
|
- <ul>
|
|
|
- <li><router-link :to="{ name: 'HOME' }">所有课程</router-link></li>
|
|
|
- <li>
|
|
|
- <router-link :to="`/course-teacher/${course.id}/dashboard`">{{
|
|
|
- course.name
|
|
|
- }}</router-link>
|
|
|
- </li>
|
|
|
-
|
|
|
- <!--TBM-->
|
|
|
- <li class="is-active">
|
|
|
- <router-link :to="`/student-course/${course.id}/question`"
|
|
|
- >查看题目</router-link
|
|
|
+ <page-header :routes="[{ name: '代码作业', path: 'code' }]">
|
|
|
+ <template slot="title">
|
|
|
+ 代码作业列表
|
|
|
+ </template>
|
|
|
+ <template slot="content">
|
|
|
+ Here might be a page title
|
|
|
+ </template>
|
|
|
+ <template slot="action">
|
|
|
+ <b-field>
|
|
|
+ <a class="button is-link" @click="isCardModalActive = true"
|
|
|
+ >新建代码作业</a
|
|
|
>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- </nav>
|
|
|
+ </b-field>
|
|
|
+ </template>
|
|
|
+ </page-header>
|
|
|
+ <page-body>
|
|
|
+ <div>
|
|
|
+ <b-table
|
|
|
+ :data="codeData"
|
|
|
+ paginated
|
|
|
+ per-page="5"
|
|
|
+ detailed
|
|
|
+ detail-key="id"
|
|
|
+ >
|
|
|
+ <template slot-scope="props">
|
|
|
+ <b-table-column field="id" label="题目ID" numeric sortable centered>
|
|
|
+ {{ props.row.id }}
|
|
|
+ </b-table-column>
|
|
|
+
|
|
|
+ <b-table-column label="题目名称" centered>
|
|
|
+ <router-link :to="`/course-teacher/:courseId/code/detail`">
|
|
|
+ {{ props.row.name }}</router-link
|
|
|
+ >
|
|
|
+ </b-table-column>
|
|
|
+
|
|
|
+ <b-table-column label="开始时间" centered>
|
|
|
+ {{ props.row.startAt }}
|
|
|
+ </b-table-column>
|
|
|
+
|
|
|
+ <b-table-column label="结束时间" centered>
|
|
|
+ {{ props.row.endAt }}
|
|
|
+ </b-table-column>
|
|
|
+
|
|
|
+ <b-table-column label="修改" centered> </b-table-column>
|
|
|
+ <b-table-column label="删除" centered> </b-table-column>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template slot="detail">
|
|
|
+ <article class="media">
|
|
|
+ <div class="media-content">
|
|
|
+ <div class="content">
|
|
|
+ <p>
|
|
|
+ <strong>成绩详情</strong>
|
|
|
+ <small>这里可以放具体的作业成绩,前面可以放总评啥的</small>
|
|
|
+ <br />
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </article>
|
|
|
+ </template>
|
|
|
+ </b-table>
|
|
|
+ </div>
|
|
|
+ </page-body>
|
|
|
+
|
|
|
+ <!--新建文档作业模态框-->
|
|
|
+ <b-modal :active.sync="isCardModalActive" :width="640" scroll="keep">
|
|
|
+ <div class="card">
|
|
|
+ <div class="title">新建代码作业</div>
|
|
|
+ <div class="content">
|
|
|
+ <b-field label="作业名称">
|
|
|
+ <b-input v-model="docAssignment.name"></b-input>
|
|
|
+ </b-field>
|
|
|
+ <b-field label="作业描述">
|
|
|
+ <b-input v-model="docAssignment.description"></b-input>
|
|
|
+ </b-field>
|
|
|
+ <b-field label="开始时间">
|
|
|
+ <b-datepicker
|
|
|
+ v-model="docAssignment.startAt"
|
|
|
+ placeholder="Click to select..."
|
|
|
+ :min-date="minDate"
|
|
|
+ :max-date="maxDate"
|
|
|
+ >
|
|
|
+ <button class="button is-primary" @click="date = new Date()">
|
|
|
+ <b-icon icon="calendar-today"></b-icon>
|
|
|
+ <span>Today</span>
|
|
|
+ </button>
|
|
|
+
|
|
|
+ <button class="button is-danger" @click="date = null">
|
|
|
+ <b-icon icon="close"></b-icon>
|
|
|
+ <span>Clear</span>
|
|
|
+ </button>
|
|
|
+ </b-datepicker>
|
|
|
+ </b-field>
|
|
|
+ <b-field label="结束时间">
|
|
|
+ <b-datepicker
|
|
|
+ v-model="docAssignment.endAt"
|
|
|
+ placeholder="Click to select..."
|
|
|
+ :min-date="minDate"
|
|
|
+ :max-date="maxDate"
|
|
|
+ >
|
|
|
+ <button class="button is-primary" @click="date = new Date()">
|
|
|
+ <b-icon icon="calendar-today"></b-icon>
|
|
|
+ <span>Today</span>
|
|
|
+ </button>
|
|
|
+
|
|
|
+ <button class="button is-danger" @click="date = null">
|
|
|
+ <b-icon icon="close"></b-icon>
|
|
|
+ <span>Clear</span>
|
|
|
+ </button>
|
|
|
+ </b-datepicker>
|
|
|
+ </b-field>
|
|
|
+ <a class="button is-link" @click="createDocAssignment">确认创建</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </b-modal>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { mapState } from "vuex";
|
|
|
-
|
|
|
+import PageHeader from "@/components/PageHeader";
|
|
|
+import PageBody from "@/components/PageBody/index";
|
|
|
+const codeData = [
|
|
|
+ {
|
|
|
+ id: 1,
|
|
|
+ name: "购物车web项目",
|
|
|
+ startAt: "2019-1-1",
|
|
|
+ endAt: "2019-6-1"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 2,
|
|
|
+ name: "软件需求规格说明书",
|
|
|
+ startAt: "2019-1-1",
|
|
|
+ endAt: "2019-6-1"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 3,
|
|
|
+ name: "软件需求规格说明书",
|
|
|
+ startAt: "2019-1-1",
|
|
|
+ endAt: "2019-6-1"
|
|
|
+ }
|
|
|
+];
|
|
|
export default {
|
|
|
- name: "index",
|
|
|
- components: {},
|
|
|
- computed: {
|
|
|
- ...mapState({
|
|
|
- course: state => state.course.currentCourse
|
|
|
- })
|
|
|
+ components: {
|
|
|
+ PageBody,
|
|
|
+ PageHeader
|
|
|
},
|
|
|
data() {
|
|
|
+ const today = new Date();
|
|
|
return {
|
|
|
- courses: [],
|
|
|
- review: [],
|
|
|
- questionType: [
|
|
|
- { id: 1, title: "文档作业题目" },
|
|
|
- { id: 2, title: "代码作业题目" }
|
|
|
- ],
|
|
|
- data: []
|
|
|
+ minDate: new Date(
|
|
|
+ today.getFullYear(),
|
|
|
+ today.getMonth(),
|
|
|
+ today.getDate() - 5
|
|
|
+ ),
|
|
|
+ maxDate: new Date(
|
|
|
+ today.getFullYear(),
|
|
|
+ today.getMonth(),
|
|
|
+ today.getDate() + 5
|
|
|
+ ),
|
|
|
+ codeData,
|
|
|
+ docAssignment: {
|
|
|
+ name: "",
|
|
|
+ description: "",
|
|
|
+ startAt: new Date(),
|
|
|
+ endAt: new Date()
|
|
|
+ },
|
|
|
+ isCardModalActive: false
|
|
|
};
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ createDocAssignment() {
|
|
|
+ this.isCardModalActive = false;
|
|
|
+ console.log(
|
|
|
+ this.docAssignment.name,
|
|
|
+ this.docAssignment.description,
|
|
|
+ this.docAssignment.startAt,
|
|
|
+ this.docAssignment.endAt
|
|
|
+ );
|
|
|
+ this.data.push({
|
|
|
+ id: 4,
|
|
|
+ name: this.docAssignment.name,
|
|
|
+ startAt: "2019-1-1",
|
|
|
+ endAt: "2019-6-1"
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
-.breadcrumb a {
|
|
|
- /*color: #7957d5;*/
|
|
|
- font-weight: bold;
|
|
|
-}
|
|
|
-.data-table {
|
|
|
- width: 100%;
|
|
|
+<style lang="scss" scoped>
|
|
|
+.card {
|
|
|
padding: 30px;
|
|
|
- min-height: 80vh;
|
|
|
- background-color: #ffffff;
|
|
|
-}
|
|
|
-.question-list {
|
|
|
- margin-top: 30px;
|
|
|
-}
|
|
|
-.form-group {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
-}
|
|
|
-.description {
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- -webkit-box-orient: vertical;
|
|
|
- -webkit-line-clamp: 1;
|
|
|
- word-wrap: break-word;
|
|
|
- word-break: break-all;
|
|
|
- display: -webkit-box;
|
|
|
+ .title {
|
|
|
+ font-size: 1.25rem;
|
|
|
+ small {
|
|
|
+ color: gray;
|
|
|
+ font-size: 1rem;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .content {
|
|
|
+ a {
|
|
|
+ margin-top: 30px;
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|