|
@@ -2,14 +2,9 @@
|
|
|
<div class="tasks">
|
|
|
<div class="tasks-left">
|
|
|
<!-- 菜单 -->
|
|
|
- <main-menu cur-tab="TaskList" />
|
|
|
+ <MainMenu cur-tab="TaskList" />
|
|
|
<!-- 日历 -->
|
|
|
- <monthly-calendar
|
|
|
- ref="calendar"
|
|
|
- :date-stamp="dateStamp"
|
|
|
- @changeTimeUnit="changeTimeUnit"
|
|
|
- @changeDate="changeDate"
|
|
|
- />
|
|
|
+ <MonthlyCalendar ref="calendar" :date-stamp="dateStamp" @changeTimeUnit="init" @changeDate="init" />
|
|
|
<!-- 通知 -->
|
|
|
<div class="notice">
|
|
|
<div class="notice-title">
|
|
@@ -68,248 +63,65 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="task-container">
|
|
|
- <ul v-for="({ task_list, date_stamp }, i) in task_group_list" :key="i" class="task-list">
|
|
|
- <li v-if="time_unit === 'MONTH'" class="date-stamp">
|
|
|
- {{ date_stamp }}
|
|
|
- </li>
|
|
|
- <li
|
|
|
- v-for="{
|
|
|
- id,
|
|
|
- cs_item_name,
|
|
|
- time_type,
|
|
|
- course_id: cid,
|
|
|
- course_name,
|
|
|
- teaching_type,
|
|
|
- time_space_view_txt,
|
|
|
- name
|
|
|
- } in task_list"
|
|
|
- :key="id"
|
|
|
- class="task-item"
|
|
|
- :style="getItemStyle(cid)"
|
|
|
- @click="taskLink_outside(id)"
|
|
|
- >
|
|
|
- <div class="task-item-top">
|
|
|
- <svg-icon icon-class="arrival" :style="getItemIconStyle(cid)" />
|
|
|
- <span class="cs-item-name">
|
|
|
- {{ cs_item_name }} - {{ name }}
|
|
|
- <span v-if="teaching_type === 10" class="enter-live" @click.stop="taskLink(teaching_type, id)">
|
|
|
- {{ $t('Key616') }} >
|
|
|
- </span>
|
|
|
- </span>
|
|
|
- <span
|
|
|
- class="task-button"
|
|
|
- :style="{ 'background-color': buttonColorList.get(time_type) }"
|
|
|
- @click.stop="taskLink(teaching_type, id)"
|
|
|
- >
|
|
|
- {{ $t(getTimeTypeName(time_type)) }}{{ $t('Key289') }}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <div class="task-item-bottom">
|
|
|
- <div>
|
|
|
- {{ course_name }}
|
|
|
- </div>
|
|
|
- <div class="time-txt">
|
|
|
- {{ time_space_view_txt }}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
+ <OldTaskList v-if="task_mode === taskModeList[0]" :task-group-list="task_group_list" :time-unit="time_unit" />
|
|
|
+ <TaskList v-else-if="task_mode === taskModeList[1]" :task-group-list="task_group_list" :time-unit="time_unit" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import MainMenu from './components/MainMenu.vue';
|
|
|
-import { PageQueryMyMessageList, GetMyTaskList } from '@/api/table';
|
|
|
-import { CreateEnterLiveRoomSession } from '@/api/live';
|
|
|
-import { ReadMyMessage, GetMyBookBuyStatus_CurTaskCoursewareBook } from '@/api/user';
|
|
|
-import { colorMatching, buttonColorList } from './data';
|
|
|
-import { taskTimeList } from '@/common/data';
|
|
|
-import { GetMyCourseList_TaskBelong } from '@/api/list';
|
|
|
-import MonthlyCalendar from './components/MonthlyCalendar.vue';
|
|
|
-
|
|
|
export default {
|
|
|
- name: 'TaskList',
|
|
|
- components: {
|
|
|
- MonthlyCalendar,
|
|
|
- MainMenu
|
|
|
- },
|
|
|
- data() {
|
|
|
- const date = this.$route.query.dateStamp;
|
|
|
- return {
|
|
|
- dateStamp: date ? new Date(date) : undefined,
|
|
|
- colorMatching,
|
|
|
- buttonColorList,
|
|
|
- taskTimeList,
|
|
|
- course_id: '',
|
|
|
- selected: '',
|
|
|
- timeType: -1,
|
|
|
- task_group_list: [],
|
|
|
- message_list: [],
|
|
|
- course_list: [],
|
|
|
- // 课程 id 列表,用于颜色显示
|
|
|
- courseIdList: []
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {
|
|
|
- time_unit() {
|
|
|
- return this.$refs.calendar.time_unit;
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
- PageQueryMyMessageList({
|
|
|
- read_status: -1,
|
|
|
- message_type: -1,
|
|
|
- page_capacity: 5,
|
|
|
- cur_page: 1
|
|
|
- }).then(({ message_list }) => {
|
|
|
- this.message_list = message_list;
|
|
|
- });
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.init();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- getTimeTypeName(type) {
|
|
|
- if (type === 0) return 'Key292';
|
|
|
- if (type === 1) return 'Key293';
|
|
|
- if (type === 2) return 'Key294';
|
|
|
- return '';
|
|
|
- },
|
|
|
-
|
|
|
- getMyCourseList_TaskBelong() {
|
|
|
- const { curYear, curMonth, focusDate } = this.$refs.calendar;
|
|
|
- GetMyCourseList_TaskBelong({
|
|
|
- time_unit: this.time_unit,
|
|
|
- date_stamp: `${curYear}-${curMonth}-${focusDate}`,
|
|
|
- month_stamp: `${curYear}-${curMonth}`
|
|
|
- }).then(({ course_list }) => {
|
|
|
- this.course_list = course_list;
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- getMyTaskList() {
|
|
|
- const { curYear, curMonth, focusDate } = this.$refs.calendar;
|
|
|
- GetMyTaskList({
|
|
|
- time_unit: this.time_unit,
|
|
|
- date_stamp: `${curYear}-${curMonth}-${focusDate}`,
|
|
|
- month_stamp: `${curYear}-${curMonth}`,
|
|
|
- time_type: this.timeType,
|
|
|
- course_id: this.course_id
|
|
|
- }).then(({ task_group_list }) => {
|
|
|
- this.task_group_list = task_group_list;
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- // 改变任务时间类型
|
|
|
- changeTaskTime(constant) {
|
|
|
- this.timeType = constant;
|
|
|
- this.getMyTaskList();
|
|
|
- },
|
|
|
-
|
|
|
- changeTimeUnit() {
|
|
|
- this.init();
|
|
|
- },
|
|
|
-
|
|
|
- changeDate() {
|
|
|
- this.init();
|
|
|
- },
|
|
|
-
|
|
|
- init() {
|
|
|
- this.course_id = '';
|
|
|
- this.getMyTaskList();
|
|
|
- this.getMyCourseList_TaskBelong();
|
|
|
- },
|
|
|
-
|
|
|
- changeCourse() {
|
|
|
- this.getMyTaskList();
|
|
|
- },
|
|
|
-
|
|
|
- taskLink(type, task_id) {
|
|
|
- const userType = this.$store.state.user.user_type;
|
|
|
- GetMyBookBuyStatus_CurTaskCoursewareBook({ task_id }).then(({ is_buy_all }) => {
|
|
|
- if (is_buy_all === 'false' && userType === 'STUDENT') {
|
|
|
- return this.$message.warning(this.$i18n.t('Key635'));
|
|
|
- }
|
|
|
+ name: 'TaskList'
|
|
|
+};
|
|
|
+</script>
|
|
|
|
|
|
- if (type === 10) {
|
|
|
- CreateEnterLiveRoomSession({
|
|
|
- task_id
|
|
|
- }).then(
|
|
|
- ({
|
|
|
- live_room_sys_user_id,
|
|
|
- room_id,
|
|
|
- session_id,
|
|
|
- room_user_id,
|
|
|
- is_remind_quota_lave_online,
|
|
|
- quota_lave_online
|
|
|
- }) => {
|
|
|
- if (is_remind_quota_lave_online === 'true') {
|
|
|
- this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: `直播配额还剩余${quota_lave_online}小时`,
|
|
|
- duration: 5000
|
|
|
- });
|
|
|
- }
|
|
|
- this.$router.push({
|
|
|
- path: `/live/${userType === 'TEACHER' ? 'teacher' : 'student'}`,
|
|
|
- query: { live_room_sys_user_id, room_id, session_id, task_id, room_user_id }
|
|
|
- });
|
|
|
- }
|
|
|
- );
|
|
|
- } else {
|
|
|
- this.$router.push(`/task_detail/${userType === 'STUDENT' ? 'student' : 'teacher'}/${task_id}`);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- taskLink_outside(task_id) {
|
|
|
- GetMyBookBuyStatus_CurTaskCoursewareBook({ task_id }).then(({ is_buy_all }) => {
|
|
|
- const userType = this.$store.state.user.user_type;
|
|
|
- if (is_buy_all === 'false' && userType === 'STUDENT') {
|
|
|
- return this.$message.warning(this.$i18n.t('Key635'));
|
|
|
- }
|
|
|
- this.$router.push(`/task_detail/${userType === 'STUDENT' ? 'student' : 'teacher'}/${task_id}`);
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- readMyMessage(id, source_entity_id, message_type) {
|
|
|
- if (message_type === 201) return;
|
|
|
- ReadMyMessage({ id }).then(() => {
|
|
|
- this.taskLink_outside(source_entity_id);
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- getItemStyle(id) {
|
|
|
- if (!this.courseIdList.includes(id)) {
|
|
|
- this.courseIdList.push(id);
|
|
|
- }
|
|
|
- const i = this.courseIdList.indexOf(id) % 7;
|
|
|
-
|
|
|
- return {
|
|
|
- 'background-color': colorMatching[i].background,
|
|
|
- color: colorMatching[i].main,
|
|
|
- border: `1px solid ${colorMatching[i].border}`
|
|
|
- };
|
|
|
- },
|
|
|
-
|
|
|
- getItemIconStyle(id) {
|
|
|
- if (!this.courseIdList.includes(id)) {
|
|
|
- this.courseIdList.push(id);
|
|
|
- }
|
|
|
- const i = this.courseIdList.indexOf(id) % 7;
|
|
|
+<script setup>
|
|
|
+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 { taskModeList } from '@/store/data';
|
|
|
+import { useTaskList, useTaskLink } from './components/TaskList';
|
|
|
|
|
|
- return {
|
|
|
- color: colorMatching[i].main
|
|
|
- };
|
|
|
- },
|
|
|
+import MainMenu from './components/MainMenu.vue';
|
|
|
+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({
|
|
|
+ read_status: -1,
|
|
|
+ message_type: -1,
|
|
|
+ page_capacity: 5,
|
|
|
+ cur_page: 1
|
|
|
+}).then(({ message_list: list }) => {
|
|
|
+ message_list.value = list;
|
|
|
+});
|
|
|
+
|
|
|
+let calendar = ref();
|
|
|
+let { task_group_list, task_mode, time_unit, course_id, timeType, course_list, changeTaskTime, changeCourse, init } =
|
|
|
+ useTaskList(calendar);
|
|
|
+
|
|
|
+const $t = inject('$t');
|
|
|
+const router = useRouter();
|
|
|
+let { taskLink_outside } = useTaskLink(router);
|
|
|
+function readMyMessage(id, source_entity_id, message_type) {
|
|
|
+ if (message_type === 201) return;
|
|
|
+ ReadMyMessage({ id }).then(() => {
|
|
|
+ taskLink_outside(source_entity_id);
|
|
|
+ });
|
|
|
+}
|
|
|
|
|
|
- goPersonal() {
|
|
|
- window.location.href = `/GCLS-Personal/#/EnterSys`;
|
|
|
- }
|
|
|
- }
|
|
|
-};
|
|
|
+function goPersonal() {
|
|
|
+ window.location.href = `/GCLS-Personal/#/EnterSys`;
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -458,65 +270,15 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .task-container {
|
|
|
- min-height: calc(100% - 50px);
|
|
|
-
|
|
|
- .task-list {
|
|
|
- li.date-stamp {
|
|
|
- margin-top: 16px;
|
|
|
- margin-bottom: -8px;
|
|
|
- font-weight: 700;
|
|
|
- }
|
|
|
-
|
|
|
- .task-item {
|
|
|
- padding: 16px 24px;
|
|
|
- margin-top: 16px;
|
|
|
- cursor: pointer;
|
|
|
- border-radius: 8px;
|
|
|
-
|
|
|
- &-top {
|
|
|
- display: flex;
|
|
|
- margin-bottom: 8px;
|
|
|
-
|
|
|
- .cs-item-name {
|
|
|
- flex: 1;
|
|
|
- margin-left: 10px;
|
|
|
-
|
|
|
- .enter-live {
|
|
|
- margin-left: 12px;
|
|
|
- color: #808080;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .task-button {
|
|
|
- padding: 4px 8px;
|
|
|
- color: #fff;
|
|
|
- border-radius: 8px;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- &-bottom {
|
|
|
- font-size: 14px;
|
|
|
- color: #808080;
|
|
|
-
|
|
|
- .time-txt {
|
|
|
- margin-top: 8px;
|
|
|
- color: #000;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ :deep .select-course {
|
|
|
+ .el-input__inner {
|
|
|
+ border-top-left-radius: 0;
|
|
|
+ border-bottom-left-radius: 0;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|
|
|
|
|
|
-<style lang="scss">
|
|
|
-.tasks {
|
|
|
- .el-select.select-course {
|
|
|
- .el-input__inner {
|
|
|
- border-top-left-radius: 0;
|
|
|
- border-bottom-left-radius: 0;
|
|
|
+ .task-container {
|
|
|
+ min-height: calc(100% - 50px);
|
|
|
}
|
|
|
}
|
|
|
}
|