123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- <template>
- <div class="task-detail-top">
- <div class="title">
- <span class="title-name">{{ itemInfo.course_name }}</span>
- <span class="title-time">{{ itemInfo.cs_item_time }}</span>
- </div>
- <div class="cs_item_name">
- {{ itemInfo.cs_item_name }}
- </div>
- <div class="courseware-list">
- <template v-if="type === 'teacher'">
- <div class="task-name">{{ itemInfo.name }}</div>
- <div class="task-time">{{ itemInfo.time_space_view_txt }}</div>
- <div class="task-content">
- <span>任务说明</span>
- <!-- eslint-disable-next-line vue/no-v-html -->
- <span v-html="contentUrl"></span>
- </div>
- </template>
- <div class="courseware-list-title">
- {{ $t('Key309') }}
- </div>
- <el-tag
- v-for="item in itemInfo.courseware_list"
- :key="item.courseware_id"
- color="#fff"
- :title="item.courseware_name"
- >
- <div class="courseware">
- <svg-icon icon-class="courseware" />
- <router-link
- target="_blank"
- :to="{
- path: `/task_detail/show_courseware/${item.courseware_id}?group_id_selected_info=${
- item.group_id_selected_info ? item.group_id_selected_info : '[]'
- }`
- }"
- class="courseware_name nowrap-ellipsis"
- >
- {{ item.courseware_name }}
- </router-link>
- </div>
- </el-tag>
- </div>
- <div class="learning-material">
- <div class="learning-material-title">
- {{ $t('Key274') }}
- </div>
- <el-tag
- v-for="item in itemInfo.cs_item_learning_material_list"
- :key="item.file_id"
- color="#fff"
- :title="item.file_name"
- >
- <span @click="emitViewFile(item.file_name, item.file_id)">{{ item.file_name }}</span>
- </el-tag>
- </div>
- </div>
- </template>
- <script>
- export default {
- props: {
- itemInfo: {
- type: Object,
- required: true
- },
- type: {
- type: String,
- required: true
- }
- },
- computed: {
- contentUrl() {
- const content = this.itemInfo.content;
- if (!content) return '';
- return content.replace(
- new RegExp(/(https?:\/\/[\w-]+\.[\w-]+\.[\w-,@?^=%&:/~\\+#]+)/, 'g'),
- '<a href="$1" target="_blank">$1</a>'
- );
- }
- },
- methods: {
- emitViewFile(fileName, fileId) {
- this.$emit('viewFile', fileName, fileId);
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .task-detail-top {
- padding: 24px 32px;
- background-color: #fff;
- border-radius: 8px;
- .title {
- display: flex;
- align-items: center;
- justify-content: space-between;
- &-name {
- font-size: 24px;
- font-weight: 700;
- }
- &-time {
- color: #737373;
- }
- }
- .cs_item_name {
- margin: 8px 0 24px;
- }
- .learning-material {
- margin-bottom: 16px;
- &-title {
- margin-bottom: 16px;
- font-size: 18px;
- }
- }
- .courseware-list {
- padding-top: 24px;
- margin-bottom: 16px;
- border-top: 1px solid #d9d9d9;
- .task-name {
- margin-bottom: 16px;
- font-size: 20px;
- font-weight: bold;
- }
- .task-time {
- margin-bottom: 16px;
- color: #969696;
- }
- .task-content {
- display: flex;
- column-gap: 40px;
- margin-bottom: 16px;
- white-space: pre-wrap;
- ::v-deep a {
- color: #18a0fb;
- }
- :first-child {
- min-width: 70px;
- }
- :last-child {
- word-break: break-all;
- }
- }
- &-title {
- margin-bottom: 16px;
- font-size: 18px;
- }
- .el-tag {
- cursor: pointer;
- .courseware {
- .svg-icon {
- margin-right: 12px;
- font-size: 18px;
- vertical-align: super;
- }
- &_name {
- display: inline-block;
- max-width: 120px;
- }
- }
- }
- }
- }
- </style>
|