杨磊
25 分钟以前 ee213bf458d3961a0560ce3b68a3ad38322ece97
src/views/classManage/teachingPlan.vue
@@ -305,19 +305,19 @@
  selectChapter: '',
  referenceMaterial: '',
  explain: '',
  uploadResources: ''
  uploadResources: '',
})
let pages = reactive({
  page: 1,
  pageSize: 13,
  count: 0,
  loading: false
  loading: false,
})
onMounted(() => {
  const list = [{ key: 1, parentVal: '', childVal: '' }]
  dynamicList.value = list
  const userCache: any = localStorage.getItem('jesk-userInfo')
  const userCache: any = localStorage.getItem(config.userInfoKey)
  if (userCache) {
    userInfo.value = JSON.parse(userCache)
  }
@@ -373,7 +373,7 @@
    order: 0,
    beginDate: '2024-09-09T03:38:07.167Z',
    endDate: '2024-09-09T03:38:07.167Z',
    duration: 0
    duration: 0,
  }
  MG.edu
    .newTask(data)
@@ -392,11 +392,11 @@
      {
        value: config.taskType.teachingPlan,
        field: 'Type',
        subFilters: []
      }
        subFilters: [],
      },
    ],
    searchList: [],
    groupId: classInfo?.id
    groupId: classInfo?.id,
  }
  MG.edu
    .getTaskList(data)
@@ -423,13 +423,14 @@
const toRead = (item: any) => {
  // config.textReaderUrl
  // 'http://192.168.3.132:8005/#/home'
  return ElMessage.warning('正在建设中...')
  if (classInfo.bookRefCode) {
    const url =
      config.textReaderUrl +
      '?bookId=' +
      classInfo?.bookRefCode +
      '&token=' +
      localStorage.getItem('jsek-token') +
      localStorage.getItem(config.tokenKey) +
      '&chapter=' +
      item.parentVal +
      '&startPage=' +
@@ -491,7 +492,7 @@
              linkProtectType: 'Public',
              fileName: FileName,
              extension: Extension,
              url: config.requestCtx + `​/file​/api​/ApiDownload?md5=` + e
              url: config.requestCtx + `​/file​/api​/ApiDownload?md5=` + e,
            })
          })
        } else {
@@ -554,7 +555,7 @@
const getTypeByCode = () => {
  MG.resource
    .getCmsTypeByRefCode({
      refCodes: [config.refCodes.teachingPlan]
      refCodes: [config.refCode.teachingPlan],
    })
    .then((res: any) => {
      const data = res[0]?.cmsTypeLinks[0]?.children
@@ -578,14 +579,14 @@
          {
            keywords: searchKey.value,
            field: 'Name',
            compareType: 'Contains'
          }
            compareType: 'Contains',
          },
        ]
      : [],
    taskId: classInfo?.taskId,
    path: String(classInfo?.rootTaskCmsId),
    type: '*',
    keys: ['referenceMaterial', 'Name', 'selectChapter', 'uploadResources', 'explain']
    keys: ['referenceMaterial', 'Name', 'selectChapter', 'uploadResources', 'explain'],
  }
  MG.edu
    .getTaskCmsItem(data)
@@ -621,12 +622,12 @@
                          chapterList.value.find((sitem: any) => sitem.chapter == citem.parentVal)
                            ?.label +
                          '---' +
                          dataS?.label
                          dataS?.label,
                      }
                    } else {
                      return {
                        ...citem,
                        parentName: citem.parentVal + '---' + citem.childVal
                        parentName: citem.parentVal + '---' + citem.childVal,
                      }
                    }
                  })
@@ -646,7 +647,7 @@
    .catch((e: any) => {
      ElMessage({
        message: '列表获取失败',
        type: 'error'
        type: 'error',
      })
      console.log(e)
    })
@@ -659,9 +660,9 @@
    requests: [
      {
        cmsItemId: item.id,
        path: String(classInfo?.rootTaskCmsId)
      }
    ]
        path: String(classInfo?.rootTaskCmsId),
      },
    ],
  }
  MG.edu
    .removeTaskCmsItemList(data)
@@ -669,7 +670,7 @@
      if (res) {
        ElMessage({
          message: '删除成功',
          type: 'success'
          type: 'success',
        })
        getTaskCmsList()
      }
@@ -677,7 +678,7 @@
    .catch((e: any) => {
      ElMessage({
        message: '删除失败',
        type: 'error'
        type: 'error',
      })
    })
}
@@ -689,7 +690,7 @@
  if (!taskItem.title) {
    ElMessage({
      message: '请填写教学名称',
      type: 'warning'
      type: 'warning',
    })
    newLoading.value = false
    return false
@@ -697,7 +698,7 @@
  if (dynamicList.value[0]?.parentVal == '') {
    ElMessage({
      message: '请选择教学章节',
      type: 'warning'
      type: 'warning',
    })
    newLoading.value = false
    return false
@@ -705,7 +706,7 @@
  if (fileList.value.length == 0) {
    ElMessage({
      message: '请上传教学文件',
      type: 'warning'
      type: 'warning',
    })
    newLoading.value = false
    return false
@@ -719,21 +720,21 @@
        name: taskItem.title,
        description: '',
        icon: '',
        type: config.refCodes.teachingPlan,
        type: config.refCode.teachingPlan,
        state: 'Normal',
        order: 0,
        newDataListRequest: tool.worksDataBytool(classItem.value, taskItem, fileList.value),
        newCmsItemAndFileLinkListRequest: [],
        newChildrenListRequest: []
      }
    ]
        newChildrenListRequest: [],
      },
    ],
  }
  MG.edu.newTaskCmsItem(data).then((res: any) => {
    newLoading.value = false
    if (res) {
      ElMessage({
        message: '新建成功',
        type: 'success'
        type: 'success',
      })
      visible.value = false
      getTaskCmsList()
@@ -802,7 +803,7 @@
      }
    }
    .linkTitle {
      color: #ff6c00;
      color: #019e58;
      cursor: pointer;
    }
    .linkTitle:hover {