dusenyao 2 роки тому
батько
коміт
1f7f9e72fb

+ 3 - 13
.vscode/launch.json

@@ -9,25 +9,15 @@
       "request": "launch",
       "name": "vuejs: chrome",
       "url": "http://localhost:7878",
-      "webRoot": "${workspaceFolder}/src",
-      "sourceMapPathOverrides": {
-        // 对应浏览器 sources下 webpack:/// 的 .目录 和 src目录
-        "webpack://gcls_sys_learn_web/src/*": "${webRoot}/*",
-        "webpack://gcls_sys_learn_web/./src/*.js": "${webRoot}/*.js"
-      }
+      "webRoot": "${workspaceFolder}"
     },
     {
       "name": "vuejs: attach chrome",
       "type": "chrome",
       "request": "attach",
       "port": 9222,
-      "webRoot": "${workspaceFolder}/src",
-      "url": "http://localhost:7878",
-      "sourceMapPathOverrides": {
-        // 对应浏览器 sources下 webpack:/// 的 .目录 和 src目录
-        "webpack://gcls_sys_learn_web/src/*": "${webRoot}/*",
-        "webpack://gcls_sys_learn_web/./src/*.js": "${webRoot}/*.js"
-      }
+      "webRoot": "${workspaceFolder}",
+      "url": "http://localhost:7878"
     }
   ]
 }

Різницю між файлами не показано, бо вона завелика
+ 1 - 22262
package-lock.json


+ 12 - 12
package.json

@@ -17,10 +17,10 @@
     "ailp-book-question-ui": "file:../ailp-book-question-ui-0.1.1.tgz",
     "awe-dnd": "^0.3.4",
     "axios": "^0.27.2",
-    "book-ui": "file:../book-ui-0.3.15.tgz",
-    "core-js": "^3.26.0",
+    "book-ui": "file:../book-ui-0.3.18.tgz",
+    "core-js": "^3.26.1",
     "dayjs": "^1.11.6",
-    "element-ui": "^2.15.10",
+    "element-ui": "^2.15.12",
     "gcls-book-question-ui": "file:../gcls-book-question-ui-0.1.0.tgz",
     "jquery": "^3.6.1",
     "js-base64": "^3.7.2",
@@ -29,8 +29,8 @@
     "md5": "^2.3.0",
     "normalize.css": "^8.0.1",
     "nprogress": "^0.2.0",
-    "tinymce": "^5.10.5",
-    "vue": "^2.7.13",
+    "tinymce": "^5.10.6",
+    "vue": "^2.7.14",
     "vue-i18n": "^8.28.2",
     "vue-pdf": "^4.3.0",
     "vue-router": "^3.6.5",
@@ -38,7 +38,7 @@
     "vuex": "^3.6.2"
   },
   "devDependencies": {
-    "@babel/core": "^7.19.6",
+    "@babel/core": "^7.20.2",
     "@babel/eslint-parser": "^7.19.1",
     "@rushstack/eslint-patch": "^1.2.0",
     "@vue/cli-plugin-babel": "~5.0.8",
@@ -57,23 +57,23 @@
     "eslint-plugin-prettier": "^4.2.1",
     "eslint-plugin-vue": "^9.7.0",
     "html-webpack-plugin": "^5.5.0",
-    "postcss": "^8.4.18",
+    "postcss": "^8.4.19",
     "postcss-html": "^1.5.0",
     "prettier": "2.7.1",
-    "sass": "^1.56.0",
+    "sass": "^1.56.1",
     "sass-loader": "^10.3.1",
     "script-ext-html-webpack-plugin": "^2.1.5",
-    "stylelint": "^14.14.1",
-    "stylelint-config-prettier": "^9.0.3",
+    "stylelint": "^14.15.0",
+    "stylelint-config-prettier": "^9.0.4",
     "stylelint-config-recess-order": "^3.0.0",
     "stylelint-config-recommended-vue": "^1.4.0",
-    "stylelint-config-standard-scss": "^6.0.0",
+    "stylelint-config-standard-scss": "^6.1.0",
     "stylelint-declaration-block-no-ignored-properties": "^2.6.0",
     "stylelint-webpack-plugin": "^3.3.0",
     "svg-sprite-loader": "^6.0.11",
     "svgo": "^2.8.0",
     "vue-loader": "^15.10.0",
-    "vue-template-compiler": "^2.7.13",
+    "vue-template-compiler": "^2.7.14",
     "vue-demi": "^0.13.11"
   },
   "browserslist": [

+ 8 - 2
src/common/data.js

@@ -1,4 +1,8 @@
-const taskTimeList = [
+import store from '@/store';
+
+const user_type = store.state.user.user_type;
+
+export const taskTimeList = [
   {
     constant: -1,
     name: 'Key110'
@@ -17,4 +21,6 @@ const taskTimeList = [
   }
 ];
 
-export { taskTimeList };
+export const userTypeList = ['TEACHER', 'STUDENT'];
+
+export const isTeacher = user_type === userTypeList[0]; // 用户类型是否教师

+ 0 - 0
src/views/OrderPaySuccess.vue → src/components/payment/OrderPaySuccess.vue


+ 5 - 10
src/components/select/SelectCourse.vue

@@ -138,16 +138,11 @@ function confirm() {
   currentCourse.value = '';
 }
 
-function getCourseBookListByCSItemID() {
-  GetCourseBookListByCSItemID({ cs_item_id: unref(cs_item_id) }).then(({ book_list: list }) => {
-    book_list.value = list;
-    if (book_list.value.length > 0) {
-      curBook.value = book_list.value[0];
-    }
-  });
-}
-watch(cs_item_id, () => {
-  getCourseBookListByCSItemID();
+GetCourseBookListByCSItemID({ cs_item_id: unref(cs_item_id) }).then(({ book_list: list }) => {
+  book_list.value = list;
+  if (book_list.value.length > 0) {
+    curBook.value = book_list.value[0];
+  }
 });
 
 function curCourse(val, is_courseware) {

+ 14 - 3
src/router/index.js

@@ -48,7 +48,7 @@ const routes = [
       {
         path: '/main',
         name: 'Main',
-        component: () => import('@/views/main')
+        component: () => import('@/views/main/index.vue')
       }
     ]
   },
@@ -61,7 +61,7 @@ const routes = [
     children: [
       {
         path: '/create_course/index',
-        component: () => import(/* webpackChunkName: 'create_course'*/ '@/views/teacher/create_course/index'),
+        component: () => import(/* webpackChunkName: 'create_course'*/ '@/views/teacher/create_course/index.vue'),
         meta: { title: 'Key285' }
       }
     ]
@@ -126,6 +126,17 @@ const routes = [
       }
     ]
   },
+  // 新查看任务
+  {
+    path: '/task_view',
+    component: Layout,
+    children: [
+      {
+        path: '/task_view/:id',
+        component: () => import('@/views/new_task_view/index.vue')
+      }
+    ]
+  },
   // 0元付款成功
   {
     path: '/OrderPaySuccess',
@@ -134,7 +145,7 @@ const routes = [
     children: [
       {
         path: '/OrderPaySuccess/index',
-        component: () => import('@/views/OrderPaySuccess.vue')
+        component: () => import('@/components/payment/OrderPaySuccess.vue')
       }
     ]
   },

+ 2 - 6
src/views/main/TaskList.vue

@@ -4,7 +4,7 @@
       <!-- 菜单 -->
       <MainMenu cur-tab="TaskList" />
       <!-- 日历 -->
-      <MonthlyCalendar ref="calendar" :date-stamp="dateStamp" @changeTimeUnit="init" @changeDate="init" />
+      <MonthlyCalendar ref="calendar" @changeTimeUnit="init" @changeDate="init" />
       <!-- 通知 -->
       <div class="notice">
         <div class="notice-title">
@@ -81,7 +81,7 @@ import { ref, inject } from 'vue';
 import { PageQueryMyMessageList } from '@/api/table';
 import { ReadMyMessage } from '@/api/user';
 import { taskTimeList } from '@/common/data';
-import { useRoute, useRouter } from 'vue-router/composables';
+import { useRouter } from 'vue-router/composables';
 import { taskModeList } from '@/store/data';
 import { useTaskList, useTaskLink } from './components/TaskList';
 
@@ -90,10 +90,6 @@ import MonthlyCalendar from './components/MonthlyCalendar.vue';
 import OldTaskList from './components/OldTaskList.vue';
 import TaskList from './components/TaskList.vue';
 
-const route = useRoute();
-const date = route.query.dateStamp;
-let dateStamp = date ? new Date(date) : undefined;
-
 // 分页查询消息列表
 let message_list = ref([]);
 PageQueryMyMessageList({

+ 2 - 22
src/views/main/components/MainMenu.vue

@@ -20,8 +20,8 @@ export default {
 </script>
 
 <script setup>
-import { ref, inject } from 'vue';
-import store from '@/store';
+import { inject } from 'vue';
+import { menuList } from '../index';
 
 const changeTab = inject('changeTab');
 
@@ -31,26 +31,6 @@ defineProps({
     type: String
   }
 });
-
-const popedom_code_list = store.state.user.popedom_code_list;
-const isStudent = store.state.user.user_type === 'STUDENT';
-let menuList = ref([
-  {
-    name: 'Key289',
-    tab: 'TaskList',
-    isShow: isStudent || popedom_code_list.includes(2000001)
-  },
-  {
-    name: 'Key215',
-    tab: 'CurriculaList',
-    isShow: isStudent || popedom_code_list.includes(2000001)
-  },
-  {
-    name: 'Key290',
-    tab: 'TemplateList',
-    isShow: !isStudent && popedom_code_list.includes(2000002)
-  }
-]);
 </script>
 
 <style lang="scss" scoped>

+ 25 - 13
src/views/main/components/MonthlyCalendar.js

@@ -1,4 +1,6 @@
 import { GetMyTaskDailyDistribution } from '@/api/user';
+
+import { useRoute } from 'vue-router/composables';
 import { ref, watchEffect, nextTick } from 'vue';
 
 import dayjs from 'dayjs';
@@ -85,6 +87,7 @@ export const monthList = [
   }
 ];
 
+// 日历显示模式
 export const modeList = [
   {
     type: 'DAY',
@@ -101,32 +104,38 @@ export const modeList = [
  * @param {Date} dateStamp
  * @param {Emits} emits
  */
-export function useMonthlyCalendar(dateStamp, emits) {
+export function useMonthlyCalendar(emits) {
+  const route = useRoute();
+  const dateSta = route.query.dateStamp;
+  let dateStamp = dateSta ? new Date(dateSta) : new Date();
+
   let focusDate = ref(dateStamp.getDate());
   let focusMonth = ref(0);
   let curYear = ref(dateStamp.getFullYear());
   let curMonth = ref(dateStamp.getMonth() + 1);
-  let calendarStyle = ref('');
 
   const DAY = modeList[0].type;
   const MONTH = modeList[1].type;
+  let time_unit = ref(modeList[0].type); // 当前日历模式
 
-  let time_unit = ref(modeList[0].type);
-  let dateArr = ref([]);
+  let calendar = ref([]); // 日历数组
+
+  // 根据日历模式切换样式
+  let calendarStyle = ref(''); // 日历样式
   watchEffect(() => {
     if (time_unit.value === DAY) {
-      return (calendarStyle.value = `40px repeat(${dateArr.value.length > 35 ? 6 : 5}, 1fr) / repeat(7, 1fr)`);
+      return (calendarStyle.value = `40px repeat(${calendar.value.length > 35 ? 6 : 5}, 1fr) / repeat(7, 1fr)`);
     }
     if (time_unit.value === MONTH) return (calendarStyle.value = `repeat(4, 1fr) / repeat(3, 1fr)`);
   });
 
+  // 得到当前日历任务每日分布
   let date = ref(`${dateStamp.getFullYear()}-${dateStamp.getMonth() + 1}`);
   let taskDailyDistribution = ref({}); // 任务每日分布
   watchEffect(() => {
-    const arr = date.value.split('-').map((item) => Number(item));
-    curYear.value = arr[0];
-    curMonth.value = arr[1];
-    focusMonth.value = arr[1] - 1;
+    curYear.value = dayjs(date.value).year();
+    curMonth.value = dayjs(date.value).month() + 1;
+    focusMonth.value = dayjs(date.value).month();
     GetMyTaskDailyDistribution({ month_stamp: date.value }).then(({ status, ...data }) => {
       if (status !== 1) return;
       const taskDailyArr = {};
@@ -170,7 +179,7 @@ export function useMonthlyCalendar(dateStamp, emits) {
         isToday: j === curDate && isThisMonth
       };
     }
-    if (arr.length === 35) return (dateArr.value = arr);
+    if (arr.length === 35) return (calendar.value = arr);
     // 下月
     let next = (arr.length < 35 ? 35 : 42) - dayOfWeek - daysInMonth;
     for (let k = 1; k <= next; k++) {
@@ -182,7 +191,7 @@ export function useMonthlyCalendar(dateStamp, emits) {
         isToday: false
       });
     }
-    dateArr.value = arr;
+    calendar.value = arr;
   }
   getDateArr();
 
@@ -196,7 +205,7 @@ export function useMonthlyCalendar(dateStamp, emits) {
     getDateArr();
   }
 
-  // 修改月份
+  // 月份向前或向后
   function changeMonth(type) {
     const curMonth = dayjs(date.value).month();
     const curYear = dayjs(date.value).year();
@@ -227,6 +236,7 @@ export function useMonthlyCalendar(dateStamp, emits) {
     emits('changeTimeUnit');
   }
 
+  // 日模式 -> 选择日期
   function selectDate(number, isCurMonth) {
     if (time_unit.value === DAY) {
       focusDate.value = number;
@@ -237,12 +247,14 @@ export function useMonthlyCalendar(dateStamp, emits) {
     emits('changeDate');
   }
 
+  // 月模式 -> 选择月份
   function selectMonth(number) {
     date.value = `${curYear.value}-${number + 1}`;
     focusMonth.value = number;
     nextTick(() => {
       emits('changeDate');
     });
+    getDateArr();
   }
 
   return {
@@ -253,7 +265,7 @@ export function useMonthlyCalendar(dateStamp, emits) {
     curMonth,
     focusDate,
     calendarStyle,
-    dateArr,
+    calendar,
     taskDailyDistribution,
     focusMonth,
     backToday,

+ 12 - 19
src/views/main/components/MonthlyCalendar.vue

@@ -19,7 +19,7 @@
           {{ name }}
         </div>
         <div
-          v-for="{ month, day, isCurMonth, key, isToday } in dateArr"
+          v-for="{ month, day, isCurMonth, key, isToday } in calendar"
           :key="key"
           :style="{ color: isCurMonth ? '' : '#A5A5A5' }"
           class="date"
@@ -27,14 +27,10 @@
           <div
             :class="[
               'date-wrapper',
-              isToday ? 'today' : '',
-              isCurMonth ? 'cur-month' : '',
-              isCurMonth && focusDate === day ? 'active' : '',
-              `${month < 10 ? '0' : ''}${month}-${day < 10 ? '0' : ''}${day}` in taskDailyDistribution
-                ? taskDailyClass.get(
-                    taskDailyDistribution[`${month < 10 ? '0' : ''}${month}-${day < 10 ? '0' : ''}${day}`]
-                  )
-                : ''
+              { today: isToday },
+              { 'cur-month': isCurMonth },
+              { active: isCurMonth && focusDate === day },
+              getTaskDailyClass(month, day)
             ]"
             @click="selectDate(day, isCurMonth)"
           >
@@ -85,14 +81,6 @@ export default {
 <script setup>
 import { useMonthlyCalendar, weekList, monthList, modeList } from './MonthlyCalendar';
 
-const props = defineProps({
-  dateStamp: {
-    type: Date,
-    default: () => {
-      return new Date();
-    }
-  }
-});
 const emits = defineEmits(['changeDate', 'changeTimeUnit']);
 
 const taskDailyClass = new Map([
@@ -101,6 +89,11 @@ const taskDailyClass = new Map([
   [2, 'task-completed']
 ]);
 
+function getTaskDailyClass(month, day) {
+  const date = `${month < 10 ? '0' : ''}${month}-${day < 10 ? '0' : ''}${day}`;
+  return date in taskDailyDistribution.value ? taskDailyClass.get(taskDailyDistribution.value[date]) : '';
+}
+
 let {
   DAY,
   MONTH,
@@ -109,7 +102,7 @@ let {
   curMonth,
   focusDate,
   calendarStyle,
-  dateArr,
+  calendar,
   taskDailyDistribution,
   focusMonth,
   backToday,
@@ -117,7 +110,7 @@ let {
   changeMenu,
   selectDate,
   selectMonth
-} = useMonthlyCalendar(props.dateStamp, emits);
+} = useMonthlyCalendar(emits);
 
 defineExpose({ time_unit, curYear, curMonth, focusDate });
 </script>

+ 9 - 8
src/views/main/components/TaskList.js

@@ -57,13 +57,14 @@ export const buttonColorList = new Map([
  * @param {ref} calendar
  */
 export function useTaskList(calendar) {
-  let task_group_list = ref([]);
   const task_mode = store.state.app.config.task_mode;
-  let course_id = ref('');
+
   let timeType = ref(-1);
   let time_unit = computed(() => calendar.value?.time_unit);
-  let course_list = ref([]);
 
+  // 得到我的任务列表
+  let course_id = ref('');
+  let task_group_list = ref([]);
   function getMyTaskList() {
     const { curYear, curMonth, focusDate } = calendar.value;
     const data = {
@@ -80,6 +81,8 @@ export function useTaskList(calendar) {
     );
   }
 
+  // 得到我的任务所属课程列表
+  let course_list = ref([]);
   function getMyCourseList_TaskBelong() {
     const { curYear, curMonth, focusDate } = calendar.value;
     GetMyCourseList_TaskBelong({
@@ -159,17 +162,15 @@ export function useTaskItem() {
 export function useTaskLink(router) {
   const $t = inject('$t');
 
-  function taskLink(type, task_id) {
+  function taskLink(teaching_type, task_id) {
     const userType = store.state.user.user_type;
     GetMyBookBuyStatus_CurTaskCoursewareBook({ task_id }).then(({ is_buy_all }) => {
       if (is_buy_all === 'false' && userType === 'STUDENT') {
         return Message.warning($t('Key635'));
       }
 
-      if (type === 10) {
-        CreateEnterLiveRoomSession({
-          task_id
-        }).then(
+      if (teaching_type === 10) {
+        CreateEnterLiveRoomSession({ task_id }).then(
           ({
             live_room_sys_user_id,
             room_id,

+ 20 - 14
src/views/main/components/TaskList.vue

@@ -2,34 +2,36 @@
   <div>
     <ul class="task-list">
       <li
-        v-for="({ task_list, cs_item_id, cs_item_name, course_id, course_name, task_time_type }, i) in taskGroupList"
+        v-for="(
+          { task_list, cs_item_id, cs_item_name, course_id, course_name, task_time_type, is_live_task_group }, i
+        ) in taskGroupList"
         :key="i"
         class="task-item"
       >
         <div class="task-item-top">
           <svg-icon icon-class="arrival" class-name="arrival" :style="getItemIconStyle(course_id)" />
           <span class="cs-item-name">
-            {{ cs_item_name }}
-          </span>
-          <!-- <span v-if="teaching_type === 10" class="enter-live" @click.stop="taskLink(teaching_type, id)">
+            <span @click="$router.push(`/task_view/${cs_item_id}`)">{{ cs_item_name }}</span>
+            <span
+              v-if="is_live_task_group === 'true'"
+              class="enter-live"
+              @click.stop="taskLink(task_list[0].teaching_type, task_list[0].id)"
+            >
               {{ $t('Key616') }} >
-            </span> -->
-          <span
-            class="task-button"
-            :style="{ 'background-color': buttonColorList.get(task_time_type) }"
-            @click.stop="taskLink(teaching_type, id)"
-          >
+            </span>
+          </span>
+          <span class="task-button" :style="{ 'background-color': buttonColorList.get(task_time_type) }">
             {{ $t(getTimeTypeName(task_time_type)) }}{{ $t('Key289') }}
           </span>
         </div>
         <div class="task-item-bottom">
-          <div class="course-name">
+          <div class="course-name" @click="changeTab(menuList[1].tab, course_id)">
             {{ course_name }}
           </div>
-          <ul>
+          <ul v-if="is_live_task_group === 'false'">
             <li v-for="({ id, name }, j) in task_list" :key="id">{{ j + 1 }}. {{ name }}</li>
           </ul>
-          <!-- <div class="time-txt">时间 {{ time_space_view_txt }}</div> -->
+          <div v-if="is_live_task_group === 'true'" class="time-txt">时间 {{ task_list[0].time_space_view_txt }}</div>
         </div>
       </li>
     </ul>
@@ -43,7 +45,9 @@ export default {
 </script>
 
 <script setup>
+import { inject } from 'vue';
 import { useRouter } from 'vue-router/composables';
+import { menuList } from '../index';
 import { useTaskLink, useTaskItem, getTimeTypeName, buttonColorList } from './TaskList';
 
 defineProps({
@@ -58,9 +62,11 @@ defineProps({
 });
 
 const router = useRouter();
-let { taskLink, taskLink_outside } = useTaskLink(router);
+let { taskLink } = useTaskLink(router);
 
 let { getItemIconStyle } = useTaskItem();
+
+let changeTab = inject('changeTab');
 </script>
 
 <style lang="scss" scoped>

+ 32 - 17
src/views/main/curricula_list/student.vue

@@ -103,54 +103,69 @@ import { useList } from '@/utils/list';
 
 import MainMenu from '../components/MainMenu.vue';
 
+const props = defineProps({
+  courseId: {
+    type: String,
+    required: true
+  }
+});
+
+const emits = defineEmits(['restoreId']);
+
 // 列表及查询条件
 let { page_capacity, cur_page, total_count, list, changePage, changePageSize } = useList();
 let search = ref('');
 let finish_status = ref(-1);
 let buy_status = ref(-1);
 let teacher_id = ref('');
-function queryMyCourseList() {
+function queryMyCourseList(course_id = '') {
   PageQueryMyJoinCourseList_Student({
     teacher_id: teacher_id.value,
     finish_status: finish_status.value,
     course_name: search.value,
+    course_id: typeof course_id === 'string' ? course_id : '',
     page_capacity: page_capacity.value,
     cur_page: cur_page.value,
     buy_status: buy_status.value
   }).then(({ course_list, total_count: total }) => {
     list.value = course_list;
     total_count.value = total;
+    if (typeof course_id === 'string' && course_id.length > 0) emits('restoreId');
   });
 }
+queryMyCourseList(props.courseId);
 
 let finish_status_list = ref([]); // 完成状态列表
+GetFinishStatusList_Course().then(({ finish_status_list: list }) => {
+  finish_status_list.value = list;
+});
+
 let buy_status_list = ref([]); // 购买状态列表
+GetStudentCourseBuyStatusList().then(({ status_list }) => {
+  buy_status_list.value = status_list;
+});
+
 let teacher_list = ref([]);
-function initData() {
-  GetFinishStatusList_Course().then(({ finish_status_list: list }) => {
-    finish_status_list.value = list;
-  });
-  GetStudentCourseBuyStatusList().then(({ status_list }) => {
-    buy_status_list.value = status_list;
-  });
-  GetMyJoinCourseTeacherList_Student().then(({ teacher_list: list }) => {
-    teacher_list.value = list;
-  });
-  queryMyCourseList();
-}
-initData();
+GetMyJoinCourseTeacherList_Student().then(({ teacher_list: list }) => {
+  teacher_list.value = list;
+});
 
 function statusColor(val) {
+  let color = '';
   switch (val) {
     case 50:
-      return '#FF5050';
+      color = '#FF5050';
+      break;
     case 51:
-      return '#2ECE5B';
+      color = '#2ECE5B';
+      break;
     case 52:
-      return '#68CEFA';
+      color = '#68CEFA';
+      break;
     default:
       break;
   }
+  return color;
 }
 
 function goLearningCenter() {

+ 8 - 5
src/views/main/curricula_list/teacher.vue

@@ -115,12 +115,13 @@ import { Message, MessageBox } from 'element-ui';
 import MainMenu from '../components/MainMenu.vue';
 
 const props = defineProps({
-  ss: {
-    type: Number,
+  courseId: {
+    type: String,
     required: true
   }
 });
-console.log(props.ss);
+
+const emits = defineEmits(['restoreId']);
 
 let finish_status_list = ref([]);
 GetFinishStatusList_Course().then(({ finish_status_list: list }) => {
@@ -131,19 +132,21 @@ GetFinishStatusList_Course().then(({ finish_status_list: list }) => {
 let { page_capacity, cur_page, total_count, list, changePage, changePageSize } = useList();
 let search = ref('');
 let finish_status = ref(-1);
-function queryMyCourseList() {
+function queryMyCourseList(course_id = '') {
   PageQueryMyCourseList({
     finish_status: finish_status.value,
     name: search.value,
     page_capacity: page_capacity.value,
     release_status: -1,
+    course_id: typeof course_id === 'string' ? course_id : '',
     cur_page: cur_page.value
   }).then(({ course_list, total_count: total }) => {
     list.value = course_list;
     total_count.value = total;
+    if (typeof course_id === 'string' && course_id.length > 0) emits('restoreId');
   });
 }
-queryMyCourseList();
+queryMyCourseList(props.courseId);
 
 const router = useRouter();
 function studentList(id) {

+ 22 - 0
src/views/main/index.js

@@ -0,0 +1,22 @@
+import store from '@/store';
+
+const popedom_code_list = store.state.user.popedom_code_list;
+const isStudent = store.state.user.user_type === 'STUDENT';
+
+export const menuList = [
+  {
+    name: 'Key289',
+    tab: 'TaskList',
+    isShow: isStudent || popedom_code_list.includes(2000001)
+  },
+  {
+    name: 'Key215',
+    tab: 'CurriculaList',
+    isShow: isStudent || popedom_code_list.includes(2000001)
+  },
+  {
+    name: 'Key290',
+    tab: 'TemplateList',
+    isShow: !isStudent && popedom_code_list.includes(2000002)
+  }
+];

+ 8 - 2
src/views/main/index.vue

@@ -1,7 +1,7 @@
 <template>
   <main class="main-container">
     <keep-alive>
-      <component :is="currentTabComponent" :ss="1" />
+      <component :is="currentTabComponent" :course-id="course_id" @restoreId="restoreId" />
     </keep-alive>
   </main>
 </template>
@@ -31,11 +31,17 @@ const currentTab = ref(
   route.query.tab || (isStudent || popedom_code_list.includes(2000001) ? 'TaskList' : 'TemplateList')
 );
 
-function changeTab(tab) {
+let course_id = ref('');
+function changeTab(tab, id = '') {
+  course_id.value = id;
   currentTab.value = tab;
 }
 provide('changeTab', changeTab);
 
+function restoreId() {
+  course_id.value = '';
+}
+
 const tabList = {
   TemplateList,
   TaskList,

+ 0 - 0
src/views/new_task_view/components/student/index.vue


+ 0 - 0
src/views/new_task_view/components/teacher/index.vue


+ 0 - 0
src/views/new_task_view/index.js


+ 17 - 0
src/views/new_task_view/index.vue

@@ -0,0 +1,17 @@
+<template>
+  <div></div>
+</template>
+
+<script setup>
+import { useRoute } from 'vue-router/composables';
+
+import { GetCSItemTaskList } from '@/api/course';
+import { isTeacher } from '@/common/data';
+
+const route = useRoute();
+const id = route.params.id;
+
+GetCSItemTaskList().then(() => {});
+</script>
+
+<style lang="scss" scoped></style>

+ 2 - 3
src/views/teacher/create_course/step_table/NewTask.vue

@@ -149,9 +149,8 @@
           <!-- 任务模式 课件 -->
           <div v-else-if="form.teaching_type === 11" class="task-template">
             <el-form :model="courseForm" label-width="100px" label-position="left">
-              <!-- TODO 多语言 等待翻译 -->
-              <el-form-item label="教材任务">
-                <el-button @click="dialogVisible = true"> <i class="el-icon-plus"></i> 添加教材 </el-button>
+              <el-form-item :label="$t('Key312')">
+                <el-button @click="dialogVisible = true"> <i class="el-icon-plus"></i> {{ $t('Key373') }} </el-button>
                 <div>
                   <el-tag
                     v-for="(item, i) in courseForm.coursewareInfo"

+ 1 - 1
src/views/teacher/create_course/step_table/create_task/index.js

@@ -119,7 +119,7 @@ export function useCSItem(content) {
     () => cs_item_id.value,
     (newVal) => {
       if (!newVal) return;
-      GetCSItemTaskList({ cs_item_id: newVal }).then(
+      GetCSItemTaskList({ cs_item_id: newVal, task_time_type: -1, data_use: 'task_edit' }).then(
         ({ pre_task_list, mid_task_list, after_task_list, task_intro, cs_item_id }) => {
           taskData.value.task_intro = task_intro;
           taskData.value.cs_item_id = cs_item_id;

+ 1 - 1
vue.config.js

@@ -12,7 +12,7 @@ const name = defaultSettings.title;
 
 const NODE_ENV = process.env.NODE_ENV;
 
-const port = process.env.port || process.env.npm_config_port || 7878;
+const port = process.env.port || 7878;
 
 let proxy = {};
 

Деякі файли не було показано, через те що забагато файлів було змінено