فهرست منبع

添加了公用的 得到必需的请求参数的函数

dusenyao 4 سال پیش
والد
کامیت
c1e04af06f

+ 19 - 15
src/api/table.js

@@ -1,30 +1,34 @@
-import request from '@/utils/request';
-import store from '@/store';
-import { getSessionID } from '@/utils/auth';
+import { request, getRequestParameter } from '@/utils/request';
 
-// 得到统一的请求参数
-function getRequestParameter() {
-  return {
-    UserCode: store.state.user.user_code,
-    UserType: store.state.user.user_type,
-    SessionID: getSessionID()
+/**
+ * 教师得到自己一天的课次
+ * @param {Object} { date_stamp } 格式化后的时间 yyy-mm-dd
+ */
+export function getMyCsItemsDateTeacher(Parameter) {
+  let requestParameter = getRequestParameter('teaching-cs_item_manager-GetMyCSItems_Date_Teacher');
+  let params = {
+    Parameter
   };
+  params = Object.assign(params, requestParameter);
+
+  return request({
+    method: 'post',
+    params
+  });
 }
 
 /**
- * 教师得到自己一天的课次
- * @param {String} date 格式化后的时间 yyy-mm-dd
+ * 得到课次详情(信息集合)
+ * @param {Object} Parameter {id}
  */
-export function getMyCsItemsDateTeacher(Parameter) {
-  let requestParameter = getRequestParameter();
+export function GetCSItemInfoBox(Parameter) {
+  let requestParameter = getRequestParameter('teaching-cs_item_manager-GetCSItemInfoBox');
   let params = {
-    MethodName: 'teaching-cs_item_manager-GetMyCSItems_Date_Teacher',
     Parameter
   };
   params = Object.assign(params, requestParameter);
 
   return request({
-    url: '/GCLSLearnWebSI/ServiceInterface',
     method: 'post',
     params
   });

+ 1 - 2
src/api/user.js

@@ -1,4 +1,4 @@
-import request from '@/utils/request';
+import { request } from '@/utils/request';
 
 /**
  * 登录
@@ -7,7 +7,6 @@ import request from '@/utils/request';
  */
 export function login(Parameter) {
   return request({
-    url: '/GCLSLearnWebSI/ServiceInterface',
     method: 'post',
     params: {
       MethodName: 'login_control-Login',

+ 18 - 2
src/utils/request.js

@@ -1,5 +1,7 @@
 import axios from 'axios';
 import { Message } from 'element-ui';
+import store from '@/store';
+import { getSessionID } from '@/utils/auth';
 
 axios.defaults.withCredentials = true; // 跨域请求时是否需要使用凭证
 axios.defaults.dataType = 'json';
@@ -8,7 +10,7 @@ axios.defaults.headers['Content-Type'] = 'application/json';
 axios.defaults.headers['X-Requested-With'] = 'XMLHttpRequest';
 
 const service = axios.create({
-  baseURL: process.env.VUE_APP_BASE_API,
+  baseURL: process.env.VUE_APP_BASE_API + '/GCLSLearnWebSI/ServiceInterface',
   // withCredentials: true, // 跨域请求时发送 cookies
   timeout: 5000
 });
@@ -51,4 +53,18 @@ service.interceptors.response.use(
   }
 );
 
-export default service;
+/**
+ * 得到必需的请求参数
+ * @param {String} MethodName 请求方法名
+ * @returns {Object} 返回必需的请求参数
+ * */
+export function getRequestParameter(MethodName) {
+  return {
+    MethodName,
+    UserCode: store.state.user.user_code,
+    UserType: store.state.user.user_type,
+    SessionID: getSessionID()
+  };
+}
+
+export { service as request };

+ 8 - 1
src/views/teacher/cs_item_detail/ClassroomTask.vue

@@ -39,7 +39,14 @@
 <script>
 export default {
   name: 'ClassroomTask',
-  props: {},
+  props: {
+    preTaskList: {
+      type: Array,
+      default: () => {
+        return [];
+      }
+    }
+  },
   created() {}
 };
 </script>

+ 33 - 7
src/views/teacher/cs_item_detail/index.vue

@@ -4,34 +4,60 @@
       <span>讲次详情</span>
       <div class="cs-item-info">
         <el-row>
-          <el-col :span="21">发</el-col>
-          <el-col :span="3" class="col_right">任务未开始</el-col>
+          <el-col :span="21"
+            >{{ CSItemInfoBox.date_stamp }} {{ CSItemInfoBox.minute_space }}</el-col
+          >
+          <el-col :span="3" class="col_right"
+            >任务{{
+              CSItemInfoBox.finish_status === 0
+                ? '未开始'
+                : CSItemInfoBox.finish_status === 1
+                ? '已开始'
+                : '已结束'
+            }}</el-col
+          >
         </el-row>
         <el-row class="cs-item-name">
-          <el-col>把</el-col>
+          <el-col>{{ CSItemInfoBox.name }}</el-col>
         </el-row>
         <el-row class="cs-item-class-name">
-          <el-col>发</el-col>
+          <el-col>{{ CSItemInfoBox.class_name }}</el-col>
         </el-row>
       </div>
     </div>
-    <classroom-task />
+    <classroom-task :pre_task_list="pre_task_list" />
   </div>
 </template>
 
 <script>
+import { GetCSItemInfoBox } from '@/api/table';
 import ClassroomTask from './ClassroomTask';
 
 export default {
   data() {
     return {
-      id: this.$route.params.id
+      id: this.$route.params.id,
+      CSItemInfoBox: {
+        class_name: '',
+        date_stamp: '',
+        finish_status: 0,
+        minute_space: '',
+        name: '',
+        pre_task_list: [],
+        mid_task_list: [],
+        after_task_list: [],
+        learning_material_list: []
+      }
     };
   },
   components: {
     ClassroomTask
   },
-  mounted() {}
+  mounted() {
+    GetCSItemInfoBox({ id: this.id }).then(response => {
+      this.CSItemInfoBox = Object.assign(this.CSItemInfoBox, response);
+    });
+  }
 };
 </script>
 

+ 6 - 6
src/views/teacher/main/TaskKanban.vue

@@ -125,17 +125,17 @@ export default {
 
 $left-item-h: 322px;
 $right-w: 641px;
-// 95px 顶部导航菜单高度
-$container-h: calc(100vh - #{$header-h} - 95px);
+// 99px = 95px 顶部导航菜单高度 + 底部 4px
+$container-h: calc(100vh - #{$header-h} - 99px);
 
 .task-kanban {
-  height: 100%;
+  min-height: $container-h;
   overflow: hidden;
-  padding-top: 40px;
+  padding: 40px 0 4px;
   display: flex;
   .left-container {
     width: 341px;
-    height: $container-h;
+    min-height: $container-h;
     margin-right: 2px;
     .panel {
       height: 100%;
@@ -175,7 +175,7 @@ $container-h: calc(100vh - #{$header-h} - 95px);
     width: $right-w + 18px;
     min-width: $right-w + 18px;
     padding-right: 18px;
-    height: $container-h;
+    min-height: $container-h;
     .cs-item {
       cursor: pointer;
       margin-top: 24px;