Преглед изворни кода

Merge branch 'feature/assignment-zhangyasen' into feature/result-zhouweilu

soleil пре 7 година
родитељ
комит
95df7e77e1

+ 1 - 0
src/layouts/HomeLayout/HomeHeader/index.vue

@@ -25,6 +25,7 @@ export default {
     DefaultHeader,
     UserDropdown
   },
+
   computed: {
     ...mapState({
       profile: state => state.user.profile

+ 0 - 8
src/layouts/TeacherMainLayout.vue

@@ -1,8 +0,0 @@
-<template>
-  <div>
-    <div></div>
-    <router-view></router-view>
-  </div>
-</template>
-
-<style lang="scss"></style>

+ 26 - 5
src/router/routes.js

@@ -72,6 +72,27 @@ export default [
         path: "result",
         component: () => import("@/views/teacher/Result")
       },
+      {
+        path: "code",
+        component: () => import("@/views/teacher/Code/index")
+      },
+      {
+        path: "code/detail",
+        component: () => import("@/views/teacher/Code/detail")
+      },
+      {
+        path: "code/detail/test",
+        component: () => import("@/views/teacher/Code/test")
+      },
+
+      {
+        path: "document",
+        component: () => import("@/views/teacher/Document/index")
+      },
+      {
+        path: "document/detail",
+        component: () => import("@/views/teacher/Document/detail")
+      },
       {
         path: "review",
         component: () => import("@/views/teacher/Review/assignmentList")
@@ -79,10 +100,6 @@ export default [
       {
         path: "review/:id",
         component: () => import("@/views/teacher/Review/assignment")
-      },
-      {
-        path: "code",
-        component: () => import("@/views/teacher/Code")
       }
     ]
   },
@@ -98,7 +115,11 @@ export default [
       },
       {
         path: "code",
-        component: () => import("@/views/student/Code")
+        component: () => import("@/views/student/Code/index")
+      },
+      {
+        path: "code/detail",
+        component: () => import("@/views/student/Code/detail")
       },
       {
         path: "document",

+ 51 - 0
src/views/student/Code/detail.vue

@@ -0,0 +1,51 @@
+<template>
+  <div>
+    <page-header
+      :routes="[
+        { name: '代码作业', path: 'code' },
+        { name: '购物车web项目', path: 'code/detail' }
+      ]"
+    >
+      <template slot="title">
+        Here might be a page title
+      </template>
+      <template slot="content">
+        Here might be a page title
+      </template>
+    </page-header>
+    <page-body> </page-body>
+  </div>
+</template>
+
+<script>
+import PageHeader from "@/components/PageHeader";
+import PageBody from "@/components/PageBody/index";
+const codeAssignmentDetail = {
+  id: 1,
+  name: "软件需求规格说明书",
+  description: "这里是描述这里是描述这里是描述这里是描述这里是描述",
+  state: "未开始",
+  startAt: "2019-1-1",
+  endAt: "2019-6-1"
+};
+const codeAssignmentProjects = {
+  codeId: 1,
+  url: "https://www.github.com/adsf/adsfa",
+  name: "电影票web项目",
+  buildList: []
+};
+export default {
+  components: {
+    PageBody,
+    PageHeader
+  },
+  data() {
+    return {
+      codeAssignmentDetail,
+      codeAssignmentProjects
+    };
+  }
+};
+</script>
+
+<style scoped></style>

+ 124 - 1
src/views/student/Code/index.vue

@@ -1,3 +1,126 @@
 <template>
-  <div></div>
+  <div>
+    <page-header :routes="[{ name: '代码作业', path: 'code' }]">
+      <template slot="title">
+        代码作业列表
+      </template>
+      <template slot="content">
+        Here might be a page title
+      </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-student/:courseId/code/detail`">
+                {{ props.row.name }}</router-link
+              >
+            </b-table-column>
+            <b-table-column label="状态" centered>
+              {{ props.row.state }}
+            </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>
+          </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>
+  </div>
 </template>
+
+<script>
+import PageHeader from "@/components/PageHeader";
+import PageBody from "@/components/PageBody/index";
+const codeData = [
+  {
+    id: 1,
+    name: "购物车web项目",
+    state: "未开始",
+    startAt: "2019-1-1",
+    endAt: "2019-6-1"
+  },
+  {
+    id: 2,
+    name: "购物车web项目",
+    state: "已结束",
+    startAt: "2019-1-1",
+    endAt: "2019-6-1"
+  },
+  {
+    id: 3,
+    name: "购物车web项目",
+    state: "正在进行",
+    startAt: "2019-1-1",
+    endAt: "2019-6-1"
+  }
+];
+export default {
+  components: {
+    PageBody,
+    PageHeader
+  },
+  data() {
+    return {
+      codeData,
+      docAssignment: {
+        name: "",
+        description: "",
+        startAt: new Date(),
+        endAt: new Date()
+      },
+      isCardModalActive: false
+    };
+  },
+  methods: {}
+};
+</script>
+
+<style lang="scss" scoped>
+.card {
+  padding: 30px;
+  .title {
+    font-size: 1.25rem;
+    small {
+      color: gray;
+      font-size: 1rem;
+    }
+  }
+  .content {
+    a {
+      margin-top: 30px;
+      width: 100%;
+    }
+  }
+}
+</style>

+ 259 - 0
src/views/teacher/Code/detail.vue

@@ -0,0 +1,259 @@
+<template>
+  <div>
+    <page-header
+      :routes="[
+        { name: '代码作业', path: 'code' },
+        { name: `${assignmentInfo.name}`, path: 'code/detail' }
+      ]"
+    >
+      <template slot="title">
+        {{ assignmentInfo.name }}
+      </template>
+      <template slot="content">
+        作业描述信息作业描述信息作业描述信息作业描述信息作业描述信息作业描述信息作业描述信息
+      </template>
+    </page-header>
+
+    <page-body>
+      <div class="data-table">
+        <!--下拉框&搜索框-->
+        <div class="form-group">
+          <!--搜索框-->
+          <b-field>
+            <b-input
+              placeholder="输入关键字查找小组"
+              type="search"
+              icon="magnify"
+            >
+            </b-input>
+          </b-field>
+        </div>
+
+        <b-tabs>
+          <b-tab-item :label="submitInfo.yes">
+            <div class="submitted-list">
+              <b-table :data="showResult" paginated per-page="5">
+                <template slot-scope="props">
+                  <b-table-column
+                    field="id"
+                    label="小组ID"
+                    width="120"
+                    numeric
+                    sortable
+                    centered
+                  >
+                    {{ props.row.id }}
+                  </b-table-column>
+                  <b-table-column label="构建" centered>
+                    <span :class="props.row.buildTag">{{
+                      props.row.buildStatus
+                    }}</span>
+                  </b-table-column>
+
+                  <b-table-column label="部署" centered>
+                    <span :class="props.row.deployTag">{{
+                      props.row.deployStatus
+                    }}</span>
+                  </b-table-column>
+                  <b-table-column label="测试">
+                    <span :class="props.row.testTag">{{
+                      props.row.testStatus
+                    }}</span>
+                  </b-table-column>
+                  <b-table-column label="详情">
+                    <router-link
+                      :to="{
+                        path: `/course-teacher/:courseId/code/detail/test`,
+                        query: { assignmentInfo: props.row }
+                      }"
+                      >查看详情</router-link
+                    >
+                  </b-table-column>
+                </template>
+              </b-table>
+            </div>
+          </b-tab-item>
+
+          <b-tab-item :label="submitInfo.no">
+            <b-table
+              :data="unsubmited.data"
+              :columns="unsubmited.columns"
+            ></b-table>
+          </b-tab-item>
+        </b-tabs>
+      </div>
+    </page-body>
+  </div>
+</template>
+
+<script>
+import PageHeader from "@/components/PageHeader";
+import PageBody from "@/components/PageBody/index";
+
+const unsubmited = {
+  data: [
+    {
+      id: 1,
+      PM: "Jesse",
+      members: "Simmons\tClarence\tTina\tJohn"
+    },
+    {
+      id: 2,
+      PM: "Jesse",
+      members: "Simmons Clarence Tina John"
+    },
+    {
+      id: 3,
+      PM: "Jesse",
+      members: "Simmons Clarence Tina John"
+    }
+  ],
+  columns: [
+    {
+      field: "id",
+      label: "小组ID",
+      numeric: true,
+      centered: true
+    },
+    {
+      field: "PM",
+      label: "组长"
+    },
+    {
+      field: "members",
+      label: "组员"
+    }
+  ]
+};
+const info = [
+  {
+    id: 1,
+    stage: "测试",
+    PM: "Jesse",
+    members: "Simmons\tClarence\tTina\tJohn",
+    build: 0,
+    deploy: 0,
+    test: -1,
+    pass: 0,
+    testNum: 10
+  },
+  {
+    id: 2,
+    stage: "测试",
+    build: 1,
+    deploy: 1,
+    test: 0,
+    pass: 0,
+    testNum: 10
+  },
+  {
+    id: 3,
+    stage: "测试",
+    build: 1,
+    deploy: 1,
+    test: 1,
+    pass: 10,
+    testNum: 10
+  }
+];
+const showResult = [];
+const assignmentInfo = {
+  id: 0,
+  name: "",
+  description: "",
+  startAt: 0,
+  endAt: 0
+};
+
+const tag = {
+  success: "tag is-success",
+  failed: "tag is-danger",
+  blank: "tag is-dark"
+};
+
+const status = {
+  success: "SUCCESS",
+  failed: "FAILED",
+  blank: "BLANK"
+};
+
+const submitCount = {
+  yes: 19,
+  no: 8
+};
+const submitInfo = {
+  yes: "已提交:" + submitCount.yes,
+  no: "未提交:" + submitCount.no
+};
+
+export default {
+  components: {
+    PageBody,
+    PageHeader
+  },
+  mounted() {
+    this.assignmentInfo = this.$route.query.assignmentInfo;
+    for (var item of info) {
+      showResult.push({
+        id: item.id,
+        buildStatus: item.build === 1 ? status.success : status.failed,
+        buildTag: item.build === 1 ? tag.success : tag.failed,
+        deployStatus: item.deploy === 1 ? status.success : status.failed,
+        deployTag: item.deploy === 1 ? tag.success : tag.failed,
+        testStatus: item.test === 1 ? status.success : status.failed,
+        testTag: item.test === 1 ? tag.success : tag.failed
+      });
+    }
+  },
+  data() {
+    return {
+      info,
+      unsubmited,
+      assignmentInfo,
+      tag,
+      status,
+      showResult,
+      submitInfo
+    };
+  }
+};
+</script>
+
+<style scoped>
+.breadcrumb a {
+  /*color: #7957d5;*/
+  font-weight: bold;
+}
+.data-table {
+  width: 100%;
+  padding: 30px;
+  min-height: 80vh;
+  background-color: #ffffff;
+}
+.submitted-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;
+}
+.process-bar {
+  width: 50%;
+  margin-right: 10px;
+}
+.submit-state {
+  display: flex;
+  margin-top: 20px;
+  align-items: center;
+  margin-bottom: 20px;
+}
+</style>

+ 248 - 1
src/views/teacher/Code/index.vue

@@ -1,3 +1,250 @@
 <template>
-  <div></div>
+  <div>
+    <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="updateInfo(-1)">新建代码作业</a>
+        </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="{
+                  path: `/course-teacher/:courseId/code/detail`,
+                  query: { assignmentInfo: props.row }
+                }"
+              >
+                {{ props.row.name }}
+              </router-link>
+            </b-table-column>
+
+            <b-table-column label="开始时间" centered>
+              {{ new Date(props.row.startAt).getFullYear() }}-{{
+                new Date(props.row.startAt).getMonth() + 1
+              }}-{{ new Date(props.row.startAt).getDate() }}
+            </b-table-column>
+
+            <b-table-column label="结束时间" centered>
+              {{ new Date(props.row.endAt).getFullYear() }}-{{
+                new Date(props.row.endAt).getMonth() + 1
+              }}-{{ new Date(props.row.endAt).getDate() }}
+            </b-table-column>
+
+            <b-table-column label="修改" centered>
+              <a @click="updateInfo(props.row.id)">修改</a>
+            </b-table-column>
+            <b-table-column label="删除" centered>
+              <a style="color:#b34141" @click="confirmDelete(props.row.id)"
+                >删除</a
+              >
+            </b-table-column>
+          </template>
+
+          <template slot="detail" slot-scope="props">
+            <article class="media">
+              <div class="media-content">
+                <div class="content">
+                  <p>
+                    <strong>作业描述:</strong>
+                    <small>{{ props.row.description }}</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">{{ modal.title }}</div>
+        <div class="content">
+          <b-field label="作业名称">
+            <b-input v-model="codeAssignment.name"></b-input>
+          </b-field>
+          <b-field label="作业描述">
+            <b-input v-model="codeAssignment.description"></b-input>
+          </b-field>
+          <b-field label="开始时间">
+            <b-datepicker
+              v-model="codeAssignment.startAt"
+              placeholder="Click to select..."
+              icon="calendar-today"
+            >
+            </b-datepicker>
+          </b-field>
+          <b-field label="结束时间">
+            <b-datepicker
+              v-model="codeAssignment.endAt"
+              placeholder="Click to select..."
+              icon="calendar-today"
+            >
+            </b-datepicker>
+          </b-field>
+          <a class="button is-link" @click="createCodeAssignment">{{
+            modal.submit
+          }}</a>
+        </div>
+      </div>
+    </b-modal>
+  </div>
 </template>
+
+<script>
+import PageHeader from "@/components/PageHeader";
+import PageBody from "@/components/PageBody/index";
+const codeData = [
+  {
+    id: 1,
+    name: "购物车web项目",
+    description: "1111111111111这里是文档描述",
+    startAt: 1547107174000,
+    endAt: 1547971174000
+  },
+  {
+    id: 2,
+    name: "电影票web项目",
+    description: "222222222222这里是文档描述",
+    startAt: 1547107174000,
+    endAt: 1547971174000
+  },
+  {
+    id: 3,
+    name: "SEECweb项目",
+    description: "3333333333333333这里是文档描述",
+    startAt: 1547107174000,
+    endAt: 1547971174000
+  }
+];
+export default {
+  components: {
+    PageBody,
+    PageHeader
+  },
+  data() {
+    return {
+      codeData,
+      codeAssignment: {
+        id: -1,
+        name: "",
+        description: "",
+        startAt: new Date(),
+        endAt: new Date()
+      },
+      isCardModalActive: false,
+      modal: {
+        title: "新建文档作业",
+        submit: "确认创建"
+      }
+    };
+  },
+  methods: {
+    confirmDelete(id) {
+      this.$dialog.confirm({
+        message: "确认删除?",
+        confirmText: "删除",
+        type: "is-danger",
+        onConfirm: () => {
+          for (var item of this.codeData) {
+            if (item.id === id) {
+              this.codeData.pop(item);
+            }
+          }
+          this.$toast.open("删除成功");
+        }
+      });
+    },
+    updateInfo(id) {
+      this.isCardModalActive = true;
+      if (id !== -1) {
+        this.modal.submit = "确认修改";
+        this.modal.title = "修改文档作业";
+        console.log(this.modal.submit);
+        console.log(this.modal.submit);
+        for (let item of this.codeData) {
+          if (item.id === id) {
+            this.codeAssignment.id = id;
+            this.codeAssignment.name = item.name;
+            this.codeAssignment.description = item.description;
+            this.codeAssignment.startAt = new Date(item.startAt);
+            this.codeAssignment.endAt = new Date(item.endAt);
+            break;
+          }
+        }
+      } else {
+        this.modal.title = "新建文档作业";
+        this.modal.submit = "确认创建";
+        this.codeAssignment.id = -1;
+        this.codeAssignment.name = "";
+        this.codeAssignment.description = "";
+        this.codeAssignment.startAt = new Date();
+        this.codeAssignment.endAt = new Date();
+      }
+    },
+    createCodeAssignment() {
+      this.isCardModalActive = false;
+      if (this.codeAssignment.id === -1) {
+        var itemsCount = this.codeData.length;
+        this.codeData.push({
+          id: itemsCount + 1,
+          name: this.codeAssignment.name,
+          description: this.codeAssignment.description,
+          startAt: this.codeAssignment.startAt.getTime(),
+          endAt: this.codeAssignment.endAt.getTime()
+        });
+      } else {
+        for (var item of this.codeData) {
+          if (item.id === this.codeAssignment.id) {
+            item.name = this.codeAssignment.name;
+            item.description = this.codeAssignment.description;
+            item.startAt = this.codeAssignment.startAt.getTime();
+            item.endAt = this.codeAssignment.endAt.getTime();
+            break;
+          }
+        }
+      }
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.card {
+  padding: 30px;
+  .title {
+    font-size: 1.25rem;
+    small {
+      color: gray;
+      font-size: 1rem;
+    }
+  }
+  .content {
+    a {
+      margin-top: 30px;
+      width: 100%;
+    }
+  }
+}
+</style>

+ 114 - 0
src/views/teacher/Code/test.vue

@@ -0,0 +1,114 @@
+<template>
+  <div>
+    <page-header
+      :routes="[
+        { name: '代码作业', path: 'code' },
+        { name: '购物车web项目', path: 'code/detail' },
+        { name: '测试信息', path: 'code/detail/test' }
+      ]"
+    >
+      <template slot="title">
+        测试信息
+      </template>
+      <template slot="content">
+        可查看最近五条测试数据
+      </template>
+    </page-header>
+
+    <page-body>
+      <b-collapse
+        :open="false"
+        class="collapseeeeeee"
+        v-for="item in testResult"
+        :key="item.id"
+      >
+        <button class="button is-primary " slot="trigger">
+          测试时间:2019-1-18 23:02{{ item.id }}
+        </button>
+        <div class="notification card">
+          <div class="content">
+            <h3>Build Info</h3>
+            <p>{{ item.buildResult }}</p>
+            <h3>Deploy Info</h3>
+            <p>{{ item.deployResult }}</p>
+            <h3>Unit Test Info</h3>
+            <p>{{ item.unitTestResult }}</p>
+            <h3>Functional Test Info</h3>
+            <p>{{ item.functionTestResult }}</p>
+          </div>
+        </div>
+      </b-collapse>
+    </page-body>
+  </div>
+</template>
+
+<script>
+import PageHeader from "@/components/PageHeader";
+import PageBody from "@/components/PageBody/index";
+
+const testResult = [
+  {
+    id: "1547130528000",
+    buildResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS",
+    deployResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS",
+    unitTestResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS",
+    functionTestResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS"
+  },
+  {
+    id: "1547130722000",
+    buildResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS",
+    deployResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS",
+    unitTestResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS",
+    functionTestResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS"
+  },
+  {
+    id: "1547123230722000",
+    buildResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS",
+    deployResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS",
+    unitTestResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS",
+    functionTestResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS"
+  },
+  {
+    id: "154712320722000",
+    buildResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS",
+    deployResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS",
+    unitTestResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS",
+    functionTestResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS"
+  },
+  {
+    id: "1547130434722000",
+    buildResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS",
+    deployResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS",
+    unitTestResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS",
+    functionTestResult: "SUCCESSSUCCESSSUCCESSSUCCESSSUCCESSSUCCESS"
+  }
+];
+const showResult = [];
+
+export default {
+  components: {
+    PageBody,
+    PageHeader
+  },
+  mounted() {
+    this.assignmentInfo = this.$route.query.assignmentInfo;
+  },
+  data() {
+    return {
+      assignmentInfo: {},
+      showResult,
+      testResult
+    };
+  }
+};
+</script>
+
+<style scoped>
+.breadcrumb a {
+  /*color: #7957d5;*/
+  font-weight: bold;
+}
+.collapseeeeeee {
+  margin-bottom: 10px;
+}
+</style>

+ 249 - 0
src/views/teacher/Document/detail.vue

@@ -0,0 +1,249 @@
+<template>
+  <div>
+    <page-header
+      :routes="[
+        { name: '文档作业', path: 'document' },
+        { name: `${assignmentInfo.name}`, path: 'document/detail' }
+      ]"
+    >
+      <template slot="title">
+        {{ assignmentInfo.name }}
+      </template>
+      <template slot="content">
+        Here might be a page title
+      </template>
+    </page-header>
+
+    <page-body>
+      <div class="data-table">
+        <!--下拉框&搜索框-->
+        <div class="form-group">
+          <!--搜索框-->
+          <b-field>
+            <b-input
+              placeholder="输入关键字查找小组"
+              type="search"
+              icon="magnify"
+            >
+            </b-input>
+          </b-field>
+        </div>
+
+        <b-tabs>
+          <b-tab-item :label="submitInfo.yes">
+            <div class="submitted-list">
+              <b-table
+                :data="data"
+                paginated
+                per-page="5"
+                detailed
+                detail-key="id"
+              >
+                <template slot-scope="props">
+                  <b-table-column
+                    field="id"
+                    label="小组ID"
+                    width="120"
+                    numeric
+                    sortable
+                    centered
+                  >
+                    {{ props.row.id }}
+                  </b-table-column>
+
+                  <b-table-column label="阶段" centered>
+                    {{ props.row.stage }}
+                  </b-table-column>
+
+                  <b-table-column label="互评负责组" centered>
+                    {{ props.row.charge }}
+                  </b-table-column>
+
+                  <b-table-column label="分数" centered>
+                    {{ props.row.score }}
+                  </b-table-column>
+                  <b-table-column field="difficulty" label="详情" centered>
+                    {{ props.row.detail }}
+                  </b-table-column>
+                </template>
+
+                <template slot="detail">
+                  <article class="media">
+                    <div class="media-content">
+                      <div class="content">
+                        <p>
+                          <strong>小组成员</strong><br />
+                          <small>组长:小明&emsp;组员:小黄 小兰</small> <br />
+                        </p>
+                      </div>
+                    </div>
+                  </article>
+                </template>
+              </b-table>
+            </div>
+          </b-tab-item>
+
+          <b-tab-item :label="submitInfo.no">
+            <b-table
+              :data="unsubmited.data"
+              :columns="unsubmited.columns"
+            ></b-table>
+          </b-tab-item>
+        </b-tabs>
+      </div>
+    </page-body>
+  </div>
+</template>
+
+<script>
+import PageHeader from "@/components/PageHeader";
+import PageBody from "@/components/PageBody/index";
+
+const unsubmited = {
+  data: [
+    {
+      id: 1,
+      PM: "Jesse",
+      members: "Simmons\tClarence\tTina\tJohn"
+    },
+    {
+      id: 2,
+      PM: "Jesse",
+      members: "Simmons Clarence Tina John"
+    },
+    {
+      id: 3,
+      PM: "Jesse",
+      members: "Simmons Clarence Tina John"
+    }
+  ],
+  columns: [
+    {
+      field: "id",
+      label: "小组ID",
+      // width: "80",
+      numeric: true,
+      centered: true
+    },
+    {
+      field: "PM",
+      label: "组长"
+    },
+    {
+      field: "members",
+      label: "组员"
+    }
+  ]
+};
+const submitCount = {
+  yes: 19,
+  no: 8
+};
+const submitInfo = {
+  yes: "已提交:" + submitCount.yes,
+  no: "未提交:" + submitCount.no
+};
+const data = [
+  {
+    id: 1,
+    stage: "互评完成",
+    charge: 2,
+    score: 80,
+    detail: "查看详情"
+  },
+  {
+    id: 2,
+    stage: "正在互评",
+    charge: 2,
+    score: 80,
+    detail: "查看详情"
+  },
+  {
+    id: 3,
+    stage: "互评完成",
+    charge: 2,
+    score: 80,
+    detail: "查看详情"
+  },
+  {
+    id: 4,
+    stage: "互评完成",
+    charge: 2,
+    score: 80,
+    detail: "查看详情"
+  }
+];
+
+const assignmentInfo = {
+  id: 0,
+  name: "",
+  description: "",
+  startAt: 0,
+  endAt: 0
+};
+
+export default {
+  components: {
+    PageBody,
+    PageHeader
+  },
+  mounted() {
+    this.assignmentInfo = this.$route.query.assignmentInfo;
+    console.log(this.assignmentInfo.name);
+    console.log(this.assignmentInfo.description);
+  },
+  data() {
+    return {
+      courses: [],
+      review: [],
+      questionType: [
+        { id: 1, title: "文档作业题目" },
+        { id: 2, title: "代码作业题目" }
+      ],
+      data,
+      unsubmited,
+      assignmentInfo,
+      submitInfo
+    };
+  }
+};
+</script>
+
+<style scoped>
+.breadcrumb a {
+  /*color: #7957d5;*/
+  font-weight: bold;
+}
+.data-table {
+  width: 100%;
+  padding: 30px;
+  min-height: 80vh;
+  background-color: #ffffff;
+}
+.submitted-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;
+}
+.process-bar {
+  width: 50%;
+  margin-right: 10px;
+}
+.submit-state {
+  display: flex;
+  margin-top: 20px;
+  align-items: center;
+  margin-bottom: 20px;
+}
+</style>

+ 242 - 0
src/views/teacher/Document/index.vue

@@ -0,0 +1,242 @@
+<template>
+  <div>
+    <page-header :routes="[{ name: '文档作业', path: 'document' }]">
+      <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="updateInfo(-1)">新建文档作业</a>
+        </b-field>
+      </template>
+    </page-header>
+
+    <page-body>
+      <div>
+        <b-table :data="data" 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="{
+                  path: `/course-teacher/:courseId/document/detail`,
+                  query: { assignmentInfo: props.row }
+                }"
+              >
+                {{ props.row.name }}
+              </router-link>
+            </b-table-column>
+
+            <b-table-column label="开始时间" centered>
+              {{ new Date(props.row.startAt).getFullYear() }}-{{
+                new Date(props.row.startAt).getMonth() + 1
+              }}-{{ new Date(props.row.startAt).getDate() }}
+            </b-table-column>
+
+            <b-table-column label="结束时间" centered>
+              {{ new Date(props.row.endAt).getFullYear() }}-{{
+                new Date(props.row.endAt).getMonth() + 1
+              }}-{{ new Date(props.row.endAt).getDate() }}
+            </b-table-column>
+            <b-table-column label="修改" centered>
+              <a @click="updateInfo(props.row.id)">修改</a>
+            </b-table-column>
+            <b-table-column label="删除" centered>
+              <a style="color:#b34141" @click="confirmDelete(props.row.id)"
+                >删除</a
+              >
+            </b-table-column>
+          </template>
+
+          <template slot="detail" slot-scope="props">
+            <article class="media">
+              <div class="media-content">
+                <div class="content">
+                  <p>
+                    <strong>作业描述:</strong><br />
+                    <small>{{ props.row.description }}</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">{{ modal.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..."
+              icon="calendar-today"
+            >
+            </b-datepicker>
+          </b-field>
+          <b-field label="结束时间">
+            <b-datepicker
+              v-model="docAssignment.endAt"
+              placeholder="Click to select..."
+              icon="calendar-today"
+            >
+            </b-datepicker>
+          </b-field>
+          <a class="button is-link" @click="createDocAssignment()">{{
+            modal.submit
+          }}</a>
+        </div>
+      </div>
+    </b-modal>
+  </div>
+</template>
+
+<script>
+import PageHeader from "@/components/PageHeader";
+import PageBody from "@/components/PageBody/index";
+const docData = [
+  {
+    id: 1,
+    name: "软件需求规格说明书",
+    description: "1111111111111这里是文档描述",
+    startAt: 1547107174000,
+    endAt: 1547971174000
+  },
+  {
+    id: 2,
+    name: "用户需求列表",
+    description: "222222222222222222这里是文档描述",
+    startAt: 1547107174000,
+    endAt: 1547971174000
+  },
+  {
+    id: 3,
+    name: "面谈报告",
+    description: "333333333333333这里是文档描述",
+    startAt: 1547107174000,
+    endAt: 1547971174000
+  }
+];
+export default {
+  components: {
+    PageBody,
+    PageHeader
+  },
+  data() {
+    return {
+      data: docData,
+      docAssignment: {
+        id: -1,
+        name: "",
+        description: "",
+        startAt: new Date(),
+        endAt: new Date()
+      },
+      isCardModalActive: false,
+      modal: {
+        title: "新建文档作业",
+        submit: "确认创建"
+      }
+    };
+  },
+  methods: {
+    confirmDelete(id) {
+      this.$dialog.confirm({
+        message: "确认删除?",
+        confirmText: "删除",
+        type: "is-danger",
+        onConfirm: () => {
+          for (var item of this.data) {
+            if (item.id === id) {
+              this.data.pop(item);
+            }
+          }
+          this.$toast.open("删除成功");
+        }
+      });
+    },
+    updateInfo(id) {
+      this.isCardModalActive = true;
+      if (id !== -1) {
+        this.modal.title = "修改文档作业";
+        this.modal.submit = "确认修改";
+        for (let item of this.data) {
+          if (item.id === id) {
+            this.docAssignment.id = id;
+            this.docAssignment.name = item.name;
+            this.docAssignment.description = item.description;
+            this.docAssignment.startAt = new Date(item.startAt);
+            this.docAssignment.endAt = new Date(item.endAt);
+            break;
+          }
+        }
+      } else {
+        this.modal.title = "新建文档作业";
+        this.modal.submit = "确认创建";
+        this.docAssignment.id = -1;
+        this.docAssignment.name = "";
+        this.docAssignment.description = "";
+        this.docAssignment.startAt = new Date();
+        this.docAssignment.endAt = new Date();
+      }
+    },
+    createDocAssignment() {
+      this.isCardModalActive = false;
+      if (this.docAssignment.id === -1) {
+        var itemsCount = this.data.length;
+        this.data.push({
+          id: itemsCount + 1,
+          name: this.docAssignment.name,
+          description: this.docAssignment.description,
+          startAt: this.docAssignment.startAt.getTime(),
+          endAt: this.docAssignment.endAt.getTime()
+        });
+      } else {
+        for (var item of this.data) {
+          if (item.id === this.docAssignment.id) {
+            item.name = this.docAssignment.name;
+            item.description = this.docAssignment.description;
+            item.startAt = this.docAssignment.startAt.getTime();
+            item.endAt = this.docAssignment.endAt.getTime();
+            break;
+          }
+        }
+      }
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.card {
+  padding: 30px;
+  .title {
+    font-size: 1.25rem;
+    small {
+      color: gray;
+      font-size: 1rem;
+    }
+  }
+  .content {
+    a {
+      margin-top: 30px;
+      width: 100%;
+    }
+  }
+}
+</style>

+ 0 - 27
src/views/teacher/Question/index.vue

@@ -119,33 +119,6 @@ import { getTeacherQuestions } from "@/api/question";
 import PageHeader from "@/components/PageHeader";
 import PageBody from "@/components/PageBody/index";
 
-// const data = [
-//   {
-//     id: 1,
-//     name: "第一题",
-//     description: "这题xxxxxxxx",
-//     difficulty: "easy",
-//     expectTime: 20,
-//     assignmentType: "文档作业"
-//   },
-//   {
-//     id: 2,
-//     name: "第一题",
-//     description: "这题xxxxxxxx",
-//     difficulty: "easy",
-//     expectTime: 25,
-//     assignmentType: "文档作业"
-//   },
-//   {
-//     id: 3,
-//     name: "第一题",
-//     description: "这题xxxxxxxx",
-//     difficulty: "easy",
-//     expectTime: 35,
-//     assignmentType: "文档作业"
-//   }
-// ];
-
 export default {
   components: {
     PageHeader,

+ 12 - 10
src/views/teacher/Result/index.vue

@@ -172,14 +172,14 @@ const data = [
         result: 99
       }
     ],
-    reviewHomeworkResult: [
+    charge: [
       {
         id: 1,
         name: "第一次作业",
         result: 80
       }
     ],
-    codeHomeworkResult: [
+    score: [
       {
         id: 1,
         name: "第一次作业",
@@ -191,7 +191,7 @@ const data = [
         result: 85
       }
     ],
-    finalResult: 99
+    detail: 99
   },
   {
     id: 2,
@@ -213,14 +213,14 @@ const data = [
         result: 99
       }
     ],
-    reviewHomeworkResult: [
+    charge: [
       {
         id: 1,
         name: "第一次作业",
         result: 80
       }
     ],
-    codeHomeworkResult: [
+    score: [
       {
         id: 1,
         name: "第一次作业",
@@ -232,6 +232,7 @@ const data = [
         result: 85
       }
     ],
+
     finalResult: 79
   },
   {
@@ -254,14 +255,14 @@ const data = [
         result: 99
       }
     ],
-    reviewHomeworkResult: [
+    charge: [
       {
         id: 1,
         name: "第一次作业",
         result: 80
       }
     ],
-    codeHomeworkResult: [
+    score: [
       {
         id: 1,
         name: "第一次作业",
@@ -295,14 +296,14 @@ const data = [
         result: 99
       }
     ],
-    reviewHomeworkResult: [
+    charge: [
       {
         id: 1,
         name: "第一次作业",
         result: 80
       }
     ],
-    codeHomeworkResult: [
+    score: [
       {
         id: 1,
         name: "第一次作业",
@@ -314,7 +315,7 @@ const data = [
         result: 85
       }
     ],
-    finalResult: 99
+    detail: 99
   }
 ];
 
@@ -331,6 +332,7 @@ export default {
   },
   data() {
     return {
+      name: "",
       courses: [],
       review: [],
       questionType: [

+ 1 - 0
yarn.lock

@@ -9325,6 +9325,7 @@ vue-loader@^15.4.2:
 vue-markdown@^2.2.4:
   version "2.2.4"
   resolved "http://registry.npm.taobao.org/vue-markdown/download/vue-markdown-2.2.4.tgz#db0f774178f3bc91ee18c626d86a3a0d2de22746"
+  integrity sha1-2w93QXjzvJHuGMYm2Go6DS3iJ0Y=
   dependencies:
     highlight.js "^9.12.0"
     markdown-it "^6.0.1"