|  | @@ -5,6 +5,7 @@ import {
 | 
	
		
			
				|  |  |    NDialog,
 | 
	
		
			
				|  |  |    NDrawer,
 | 
	
		
			
				|  |  |    NDrawerContent,
 | 
	
		
			
				|  |  | +  NDropdown,
 | 
	
		
			
				|  |  |    NEmpty,
 | 
	
		
			
				|  |  |    NForm,
 | 
	
		
			
				|  |  |    NFormItem,
 | 
	
	
		
			
				|  | @@ -15,7 +16,10 @@ import {
 | 
	
		
			
				|  |  |    NModal,
 | 
	
		
			
				|  |  |    NSelect,
 | 
	
		
			
				|  |  |    NSpace,
 | 
	
		
			
				|  |  | +  NSpin,
 | 
	
		
			
				|  |  |    NTooltip,
 | 
	
		
			
				|  |  | +  NUpload,
 | 
	
		
			
				|  |  | +  UploadCustomRequestOptions,
 | 
	
		
			
				|  |  |    useDialog,
 | 
	
		
			
				|  |  |    useMessage
 | 
	
		
			
				|  |  |  } from 'naive-ui'
 | 
	
	
		
			
				|  | @@ -28,7 +32,8 @@ import {
 | 
	
		
			
				|  |  |    lessonTrainingPage,
 | 
	
		
			
				|  |  |    lessonCoursewareDetailRemove,
 | 
	
		
			
				|  |  |    lessonCoursewareExaminationMapperQueryAll,
 | 
	
		
			
				|  |  | -  lessonCoursewareDetailLock
 | 
	
		
			
				|  |  | +  lessonCoursewareDetailLock,
 | 
	
		
			
				|  |  | +  api_openFileImportInfoSave
 | 
	
		
			
				|  |  |  } from '../../api'
 | 
	
		
			
				|  |  |  import styles from '../index.module.less'
 | 
	
		
			
				|  |  |  import { EditFilled, DeleteFilled, LockFilled, UnlockFilled } from '@vicons/antd'
 | 
	
	
		
			
				|  | @@ -36,6 +41,7 @@ import CourseKnowledgePoint from '../model/CourseKnowledgePoint'
 | 
	
		
			
				|  |  |  import SelectAfterClassTraining from '../model/selectAfterClassTraining'
 | 
	
		
			
				|  |  |  import AddUnitTest from '../model/AddUnitTest'
 | 
	
		
			
				|  |  |  import TheLink from '@/components/TheLink'
 | 
	
		
			
				|  |  | +import { api_uploadFile } from '@/plugins/uploadFile'
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  export default defineComponent({
 | 
	
		
			
				|  |  |    name: 'courseConfiguration',
 | 
	
	
		
			
				|  | @@ -56,7 +62,8 @@ export default defineComponent({
 | 
	
		
			
				|  |  |        name: '', //课时名称
 | 
	
		
			
				|  |  |        lessonTargetDesc: '', //课时名称
 | 
	
		
			
				|  |  |        lessonTrainingId: '', //课后作业
 | 
	
		
			
				|  |  | -      lockEnable: 'true'
 | 
	
		
			
				|  |  | +      lockEnable: 'true',
 | 
	
		
			
				|  |  | +      accessScope: 0
 | 
	
		
			
				|  |  |      })
 | 
	
		
			
				|  |  |      // 课件添加课程
 | 
	
		
			
				|  |  |      const addCourseware = () => {
 | 
	
	
		
			
				|  | @@ -66,7 +73,8 @@ export default defineComponent({
 | 
	
		
			
				|  |  |              lessonCoursewareId: route.query.id,
 | 
	
		
			
				|  |  |              name: addForm.name,
 | 
	
		
			
				|  |  |              lessonTargetDesc: addForm.lessonTargetDesc,
 | 
	
		
			
				|  |  | -            lockEnable: addForm.lockEnable
 | 
	
		
			
				|  |  | +            lockEnable: addForm.lockEnable,
 | 
	
		
			
				|  |  | +            accessScope: addForm.accessScope
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |            let res: any
 | 
	
		
			
				|  |  |            if (addForm.id) {
 | 
	
	
		
			
				|  | @@ -194,235 +202,364 @@ export default defineComponent({
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    const customRequest_importData = reactive({
 | 
	
		
			
				|  |  | +      loading: false,
 | 
	
		
			
				|  |  | +      dataType: 'EXAMINATION',
 | 
	
		
			
				|  |  | +      importRef: null as any
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  | +    const customRequest_importFile = async (data: UploadCustomRequestOptions) => {
 | 
	
		
			
				|  |  | +      console.log(data.file)
 | 
	
		
			
				|  |  | +      const msg = message.loading('正在上传文件', { duration: 0 })
 | 
	
		
			
				|  |  | +      customRequest_importData.loading = true
 | 
	
		
			
				|  |  | +      const fileUrl = await api_uploadFile(data.file.file, () => {})
 | 
	
		
			
				|  |  | +      const res = await api_openFileImportInfoSave({
 | 
	
		
			
				|  |  | +        dataType: customRequest_importData.dataType,
 | 
	
		
			
				|  |  | +        fileName: data.file.name,
 | 
	
		
			
				|  |  | +        importUrl: fileUrl,
 | 
	
		
			
				|  |  | +        lessonId: route.query.id
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +      console.log('🚀 ~ res:', res)
 | 
	
		
			
				|  |  | +      customRequest_importData.loading = false
 | 
	
		
			
				|  |  | +      if (res.data) {
 | 
	
		
			
				|  |  | +        msg.destroy()
 | 
	
		
			
				|  |  | +        // 空表格
 | 
	
		
			
				|  |  | +        if (res.data.insertRow === 0 && res.data.invalidRow === 0) {
 | 
	
		
			
				|  |  | +          message.error('导入失败,表格为空')
 | 
	
		
			
				|  |  | +          return
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if (res.data.respUrl) {
 | 
	
		
			
				|  |  | +          dialog.error({
 | 
	
		
			
				|  |  | +            title: '信息',
 | 
	
		
			
				|  |  | +            content: () => (
 | 
	
		
			
				|  |  | +              <NSpace>
 | 
	
		
			
				|  |  | +                <div>导入失败,点击下载错误信息</div>
 | 
	
		
			
				|  |  | +                <a href={res.data.respUrl} download>
 | 
	
		
			
				|  |  | +                  下载
 | 
	
		
			
				|  |  | +                </a>
 | 
	
		
			
				|  |  | +              </NSpace>
 | 
	
		
			
				|  |  | +            )
 | 
	
		
			
				|  |  | +          })
 | 
	
		
			
				|  |  | +          return
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        getDetail()
 | 
	
		
			
				|  |  | +        message.success('导入成功')
 | 
	
		
			
				|  |  | +      } else {
 | 
	
		
			
				|  |  | +        message.error('请下载模板后,填写数据再导入')
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |      return () => (
 | 
	
		
			
				|  |  |        <div class={styles.courseConfiguration}>
 | 
	
		
			
				|  |  | -        <NSpace>
 | 
	
		
			
				|  |  | -          <NButton
 | 
	
		
			
				|  |  | -            disabled={route.query.isLook ? true : false}
 | 
	
		
			
				|  |  | -            type="primary"
 | 
	
		
			
				|  |  | -            onClick={() => {
 | 
	
		
			
				|  |  | -              addForm.name = ''
 | 
	
		
			
				|  |  | -              addForm.lessonTargetDesc = ''
 | 
	
		
			
				|  |  | -              addForm.lessonTrainingId = ''
 | 
	
		
			
				|  |  | -              addForm.id = ''
 | 
	
		
			
				|  |  | -              addForm.lockEnable = ''
 | 
	
		
			
				|  |  | -              addForm.open = true
 | 
	
		
			
				|  |  | -            }}
 | 
	
		
			
				|  |  | -          >
 | 
	
		
			
				|  |  | -            添加课程
 | 
	
		
			
				|  |  | -          </NButton>
 | 
	
		
			
				|  |  | -          <NButton
 | 
	
		
			
				|  |  | -            type="primary"
 | 
	
		
			
				|  |  | -            disabled={route.query.isLook ? true : false}
 | 
	
		
			
				|  |  | -            onClick={() => {
 | 
	
		
			
				|  |  | -              unitData.open = true
 | 
	
		
			
				|  |  | -              unitData.model = {}
 | 
	
		
			
				|  |  | -            }}
 | 
	
		
			
				|  |  | -          >
 | 
	
		
			
				|  |  | -            添加阶段自测
 | 
	
		
			
				|  |  | -          </NButton>
 | 
	
		
			
				|  |  | -        </NSpace>
 | 
	
		
			
				|  |  | -        <NAlert class={styles.title} title="教学内容" />
 | 
	
		
			
				|  |  | -        <NGrid xGap={12} yGap={8} cols={3}>
 | 
	
		
			
				|  |  | -          {state.dataList.map((item: any) => {
 | 
	
		
			
				|  |  | -            const mapper = state.mapperList.find((n: any) => n.parentCoursewareDetailId == item.id)
 | 
	
		
			
				|  |  | -            return (
 | 
	
		
			
				|  |  | -              <>
 | 
	
		
			
				|  |  | -                <NGi>
 | 
	
		
			
				|  |  | -                  <NCard
 | 
	
		
			
				|  |  | -                    title={item.name}
 | 
	
		
			
				|  |  | -                    style={{
 | 
	
		
			
				|  |  | -                      '--n-padding-top': '5px',
 | 
	
		
			
				|  |  | -                      '--n-padding-bottom': '5px',
 | 
	
		
			
				|  |  | -                      height: '100%'
 | 
	
		
			
				|  |  | +        <NSpin show={customRequest_importData.loading}>
 | 
	
		
			
				|  |  | +          <NSpace justify="space-between">
 | 
	
		
			
				|  |  | +            <NSpace>
 | 
	
		
			
				|  |  | +              <NButton
 | 
	
		
			
				|  |  | +                disabled={route.query.isLook ? true : false}
 | 
	
		
			
				|  |  | +                type="primary"
 | 
	
		
			
				|  |  | +                onClick={() => {
 | 
	
		
			
				|  |  | +                  addForm.name = ''
 | 
	
		
			
				|  |  | +                  addForm.lessonTargetDesc = ''
 | 
	
		
			
				|  |  | +                  addForm.lessonTrainingId = ''
 | 
	
		
			
				|  |  | +                  addForm.id = ''
 | 
	
		
			
				|  |  | +                  addForm.lockEnable = ''
 | 
	
		
			
				|  |  | +                  addForm.accessScope = 0
 | 
	
		
			
				|  |  | +                  addForm.open = true
 | 
	
		
			
				|  |  | +                }}
 | 
	
		
			
				|  |  | +              >
 | 
	
		
			
				|  |  | +                添加课程
 | 
	
		
			
				|  |  | +              </NButton>
 | 
	
		
			
				|  |  | +              <NButton
 | 
	
		
			
				|  |  | +                type="primary"
 | 
	
		
			
				|  |  | +                disabled={route.query.isLook ? true : false}
 | 
	
		
			
				|  |  | +                onClick={() => {
 | 
	
		
			
				|  |  | +                  unitData.open = true
 | 
	
		
			
				|  |  | +                  unitData.model = {}
 | 
	
		
			
				|  |  | +                }}
 | 
	
		
			
				|  |  | +              >
 | 
	
		
			
				|  |  | +                添加阶段自测
 | 
	
		
			
				|  |  | +              </NButton>
 | 
	
		
			
				|  |  | +            </NSpace>
 | 
	
		
			
				|  |  | +            <NSpace style={{ marginLeft: 'auto' }}>
 | 
	
		
			
				|  |  | +              <NDropdown
 | 
	
		
			
				|  |  | +                size="huge"
 | 
	
		
			
				|  |  | +                trigger="hover"
 | 
	
		
			
				|  |  | +                options={[
 | 
	
		
			
				|  |  | +                  {
 | 
	
		
			
				|  |  | +                    key: '3',
 | 
	
		
			
				|  |  | +                    type: 'render',
 | 
	
		
			
				|  |  | +                    render: () => (
 | 
	
		
			
				|  |  | +                      <NButton
 | 
	
		
			
				|  |  | +                        size="large"
 | 
	
		
			
				|  |  | +                        quaternary
 | 
	
		
			
				|  |  | +                        tag="a"
 | 
	
		
			
				|  |  | +                        //@ts-ignore
 | 
	
		
			
				|  |  | +                        href="https://oss.dayaedu.com/daya-docs/%E5%8D%95%E5%85%83%E6%B5%8B%E9%AA%8C%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx"
 | 
	
		
			
				|  |  | +                        download
 | 
	
		
			
				|  |  | +                      >
 | 
	
		
			
				|  |  | +                        单元测验模板
 | 
	
		
			
				|  |  | +                      </NButton>
 | 
	
		
			
				|  |  | +                    )
 | 
	
		
			
				|  |  | +                  },
 | 
	
		
			
				|  |  | +                  {
 | 
	
		
			
				|  |  | +                    key: '1',
 | 
	
		
			
				|  |  | +                    type: 'render',
 | 
	
		
			
				|  |  | +                    render: () => (
 | 
	
		
			
				|  |  | +                      <NButton
 | 
	
		
			
				|  |  | +                        v-auth="downloadAfter-schoolTraining1702252098317451265"
 | 
	
		
			
				|  |  | +                        size="large"
 | 
	
		
			
				|  |  | +                        quaternary
 | 
	
		
			
				|  |  | +                        tag="a"
 | 
	
		
			
				|  |  | +                        //@ts-ignore
 | 
	
		
			
				|  |  | +                        href="https://oss.dayaedu.com/daya-docs/%E8%AF%BE%E5%90%8E%E8%AE%AD%E7%BB%83%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx"
 | 
	
		
			
				|  |  | +                        download
 | 
	
		
			
				|  |  | +                      >
 | 
	
		
			
				|  |  | +                        课后训练模板
 | 
	
		
			
				|  |  | +                      </NButton>
 | 
	
		
			
				|  |  | +                    )
 | 
	
		
			
				|  |  | +                  }
 | 
	
		
			
				|  |  | +                ]}
 | 
	
		
			
				|  |  | +              >
 | 
	
		
			
				|  |  | +                <NButton type="primary" v-auth="downloadUnitQuiz1702251742292344833">
 | 
	
		
			
				|  |  | +                  下载模板
 | 
	
		
			
				|  |  | +                </NButton>
 | 
	
		
			
				|  |  | +              </NDropdown>
 | 
	
		
			
				|  |  | +              <div v-auth="importCourseDate1702252535879827458">
 | 
	
		
			
				|  |  | +                <NUpload
 | 
	
		
			
				|  |  | +                  multiple={false}
 | 
	
		
			
				|  |  | +                  ref={(el: any) => (customRequest_importData.importRef = el)}
 | 
	
		
			
				|  |  | +                  showFileList={false}
 | 
	
		
			
				|  |  | +                  accept=".xlsx"
 | 
	
		
			
				|  |  | +                  customRequest={customRequest_importFile}
 | 
	
		
			
				|  |  | +                >
 | 
	
		
			
				|  |  | +                  <NDropdown
 | 
	
		
			
				|  |  | +                    size="huge"
 | 
	
		
			
				|  |  | +                    trigger="hover"
 | 
	
		
			
				|  |  | +                    options={[
 | 
	
		
			
				|  |  | +                      { label: '课件', key: 'COURSEWARE' },
 | 
	
		
			
				|  |  | +                      { label: '单元测验', key: 'EXAMINATION' },
 | 
	
		
			
				|  |  | +                      { label: '课后训练', key: 'HOMEWORK' }
 | 
	
		
			
				|  |  | +                    ]}
 | 
	
		
			
				|  |  | +                    onSelect={(key: string) => {
 | 
	
		
			
				|  |  | +                      customRequest_importData.dataType = key
 | 
	
		
			
				|  |  | +                      console.log(customRequest_importData.importRef)
 | 
	
		
			
				|  |  | +                      customRequest_importData.importRef?.clear()
 | 
	
		
			
				|  |  | +                      customRequest_importData.importRef?.openOpenFileDialog()
 | 
	
		
			
				|  |  |                      }}
 | 
	
		
			
				|  |  |                    >
 | 
	
		
			
				|  |  | -                    {{
 | 
	
		
			
				|  |  | -                      default: () => (
 | 
	
		
			
				|  |  | -                        <div>
 | 
	
		
			
				|  |  | -                          <div style={{ paddingBottom: '12px' }}>{item.lessonTargetDesc}</div>
 | 
	
		
			
				|  |  | -                          <table style={{ width: '100%' }}>
 | 
	
		
			
				|  |  | -                            <tr>
 | 
	
		
			
				|  |  | -                              <td>建议学习时长</td>
 | 
	
		
			
				|  |  | -                              <td style={{ 'text-align': 'right' }}>
 | 
	
		
			
				|  |  | -                                {item.lessonDurationSecond || '0'}s
 | 
	
		
			
				|  |  | -                              </td>
 | 
	
		
			
				|  |  | -                            </tr>
 | 
	
		
			
				|  |  | -                            <tr>
 | 
	
		
			
				|  |  | -                              <td>知识点</td>
 | 
	
		
			
				|  |  | -                              <td style={{ 'text-align': 'right' }}>
 | 
	
		
			
				|  |  | -                                {item.knowledgePointIds?.split(',').filter(Boolean).length || 0}个
 | 
	
		
			
				|  |  | -                              </td>
 | 
	
		
			
				|  |  | -                            </tr>
 | 
	
		
			
				|  |  | -                            <tr>
 | 
	
		
			
				|  |  | -                              <td>课后作业</td>
 | 
	
		
			
				|  |  | -                              <td style={{ 'text-align': 'right' }}>
 | 
	
		
			
				|  |  | -                                {item.lessonTrainingId ? (
 | 
	
		
			
				|  |  | -                                  <TheLink
 | 
	
		
			
				|  |  | -                                    // to={`/#/afterClassTrainingDetail?id=${item.lessonTrainingId}&name=${item.lessonTrainingName}&courseTypeCode=TRUMPET_SINGLE`}
 | 
	
		
			
				|  |  | -                                    to={{
 | 
	
		
			
				|  |  | -                                      path: '/afterClassTrainingManage',
 | 
	
		
			
				|  |  | -                                      query: { id: item.lessonTrainingId }
 | 
	
		
			
				|  |  | -                                    }}
 | 
	
		
			
				|  |  | -                                  >
 | 
	
		
			
				|  |  | -                                    {item.lessonTrainingName}
 | 
	
		
			
				|  |  | -                                  </TheLink>
 | 
	
		
			
				|  |  | -                                ) : (
 | 
	
		
			
				|  |  | -                                  '无'
 | 
	
		
			
				|  |  | -                                )}
 | 
	
		
			
				|  |  | -                              </td>
 | 
	
		
			
				|  |  | -                            </tr>
 | 
	
		
			
				|  |  | -                          </table>
 | 
	
		
			
				|  |  | -                        </div>
 | 
	
		
			
				|  |  | -                      ),
 | 
	
		
			
				|  |  | -                      'header-extra': () => (
 | 
	
		
			
				|  |  | -                        <>
 | 
	
		
			
				|  |  | -                          <NTooltip>
 | 
	
		
			
				|  |  | -                            {{
 | 
	
		
			
				|  |  | -                              default: () => (item.lockFlag ? '解锁' : '锁定'),
 | 
	
		
			
				|  |  | -                              trigger: () => (
 | 
	
		
			
				|  |  | -                                <NButton
 | 
	
		
			
				|  |  | -                                  disabled={route.query.isLook ? true : false}
 | 
	
		
			
				|  |  | -                                  quaternary
 | 
	
		
			
				|  |  | -                                  circle
 | 
	
		
			
				|  |  | -                                  onClick={() => toggleLock(item)}
 | 
	
		
			
				|  |  | -                                >
 | 
	
		
			
				|  |  | -                                  <NIcon
 | 
	
		
			
				|  |  | -                                    component={item.lockFlag ? <LockFilled /> : <UnlockFilled />}
 | 
	
		
			
				|  |  | -                                  />
 | 
	
		
			
				|  |  | -                                </NButton>
 | 
	
		
			
				|  |  | -                              )
 | 
	
		
			
				|  |  | -                            }}
 | 
	
		
			
				|  |  | -                          </NTooltip>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                          <NTooltip>
 | 
	
		
			
				|  |  | -                            {{
 | 
	
		
			
				|  |  | -                              default: () => '编辑',
 | 
	
		
			
				|  |  | -                              trigger: () => (
 | 
	
		
			
				|  |  | -                                <NButton
 | 
	
		
			
				|  |  | -                                  disabled={route.query.isLook ? true : false}
 | 
	
		
			
				|  |  | -                                  quaternary
 | 
	
		
			
				|  |  | -                                  circle
 | 
	
		
			
				|  |  | -                                  onClick={() => {
 | 
	
		
			
				|  |  | -                                    addForm.name = item.name
 | 
	
		
			
				|  |  | -                                    addForm.lessonTargetDesc = item.lessonTargetDesc
 | 
	
		
			
				|  |  | -                                    addForm.id = item.id
 | 
	
		
			
				|  |  | -                                    addForm.lockEnable = item.lockEnable + ''
 | 
	
		
			
				|  |  | -                                    addForm.open = true
 | 
	
		
			
				|  |  | -                                  }}
 | 
	
		
			
				|  |  | -                                >
 | 
	
		
			
				|  |  | -                                  <NIcon component={<EditFilled />} />
 | 
	
		
			
				|  |  | -                                </NButton>
 | 
	
		
			
				|  |  | -                              )
 | 
	
		
			
				|  |  | -                            }}
 | 
	
		
			
				|  |  | -                          </NTooltip>
 | 
	
		
			
				|  |  | -                          <NTooltip>
 | 
	
		
			
				|  |  | -                            {{
 | 
	
		
			
				|  |  | -                              default: () => '删除',
 | 
	
		
			
				|  |  | -                              trigger: () => (
 | 
	
		
			
				|  |  | -                                <NButton
 | 
	
		
			
				|  |  | -                                  disabled={route.query.isLook ? true : false}
 | 
	
		
			
				|  |  | -                                  quaternary
 | 
	
		
			
				|  |  | -                                  circle
 | 
	
		
			
				|  |  | -                                  onClick={() => hanldeDelete(item)}
 | 
	
		
			
				|  |  | -                                >
 | 
	
		
			
				|  |  | -                                  <NIcon component={<DeleteFilled />} />
 | 
	
		
			
				|  |  | -                                </NButton>
 | 
	
		
			
				|  |  | -                              )
 | 
	
		
			
				|  |  | -                            }}
 | 
	
		
			
				|  |  | -                          </NTooltip>
 | 
	
		
			
				|  |  | -                        </>
 | 
	
		
			
				|  |  | -                      ),
 | 
	
		
			
				|  |  | -                      action: () => (
 | 
	
		
			
				|  |  | -                        <NSpace justify="space-around">
 | 
	
		
			
				|  |  | -                          <NButton
 | 
	
		
			
				|  |  | -                            text
 | 
	
		
			
				|  |  | -                            disabled={route.query.isLook ? true : false}
 | 
	
		
			
				|  |  | -                            onClick={() => {
 | 
	
		
			
				|  |  | -                              courseData.title = item.name
 | 
	
		
			
				|  |  | -                              courseData.open = true
 | 
	
		
			
				|  |  | -                              courseData.item = item
 | 
	
		
			
				|  |  | -                            }}
 | 
	
		
			
				|  |  | -                          >
 | 
	
		
			
				|  |  | -                            选择知识点
 | 
	
		
			
				|  |  | -                          </NButton>
 | 
	
		
			
				|  |  | -                          <NButton
 | 
	
		
			
				|  |  | -                            text
 | 
	
		
			
				|  |  | -                            disabled={route.query.isLook ? true : false}
 | 
	
		
			
				|  |  | -                            onClick={() => {
 | 
	
		
			
				|  |  | -                              addForm.id = item.id
 | 
	
		
			
				|  |  | -                              addForm.lessonTargetDesc = item.lessonTargetDesc
 | 
	
		
			
				|  |  | -                              addForm.name = item.name
 | 
	
		
			
				|  |  | -                              afterTrain.open = true
 | 
	
		
			
				|  |  | -                            }}
 | 
	
		
			
				|  |  | -                          >
 | 
	
		
			
				|  |  | -                            选择课后作业
 | 
	
		
			
				|  |  | -                          </NButton>
 | 
	
		
			
				|  |  | -                        </NSpace>
 | 
	
		
			
				|  |  | -                      )
 | 
	
		
			
				|  |  | -                    }}
 | 
	
		
			
				|  |  | -                  </NCard>
 | 
	
		
			
				|  |  | -                </NGi>
 | 
	
		
			
				|  |  | -                {mapper && (
 | 
	
		
			
				|  |  | +                    <NButton type="primary" onClick={(e: Event) => e.stopPropagation()}>
 | 
	
		
			
				|  |  | +                      导入数据
 | 
	
		
			
				|  |  | +                    </NButton>
 | 
	
		
			
				|  |  | +                  </NDropdown>
 | 
	
		
			
				|  |  | +                </NUpload>
 | 
	
		
			
				|  |  | +              </div>
 | 
	
		
			
				|  |  | +            </NSpace>
 | 
	
		
			
				|  |  | +          </NSpace>
 | 
	
		
			
				|  |  | +          <NAlert class={styles.title} title="教学内容" />
 | 
	
		
			
				|  |  | +          <NGrid xGap={12} yGap={8} cols={3}>
 | 
	
		
			
				|  |  | +            {state.dataList.map((item: any) => {
 | 
	
		
			
				|  |  | +              const mapper = state.mapperList.find(
 | 
	
		
			
				|  |  | +                (n: any) => n.parentCoursewareDetailId == item.id
 | 
	
		
			
				|  |  | +              )
 | 
	
		
			
				|  |  | +              return (
 | 
	
		
			
				|  |  | +                <>
 | 
	
		
			
				|  |  |                    <NGi>
 | 
	
		
			
				|  |  |                      <NCard
 | 
	
		
			
				|  |  | -                      title={mapper.name}
 | 
	
		
			
				|  |  | +                      title={item.name}
 | 
	
		
			
				|  |  |                        style={{
 | 
	
		
			
				|  |  |                          '--n-padding-top': '5px',
 | 
	
		
			
				|  |  |                          '--n-padding-bottom': '5px',
 | 
	
		
			
				|  |  | -                        '--n-color': 'rgba(238,243,254,1)',
 | 
	
		
			
				|  |  | -                        '--n-action-color': 'rgba(238,243,254,1)',
 | 
	
		
			
				|  |  |                          height: '100%'
 | 
	
		
			
				|  |  |                        }}
 | 
	
		
			
				|  |  |                      >
 | 
	
		
			
				|  |  |                        {{
 | 
	
		
			
				|  |  |                          default: () => (
 | 
	
		
			
				|  |  |                            <div>
 | 
	
		
			
				|  |  | -                            <div style={{ paddingBottom: '12px' }}>{mapper.desc}</div>
 | 
	
		
			
				|  |  | +                            <div style={{ paddingBottom: '12px' }}>{item.lessonTargetDesc}</div>
 | 
	
		
			
				|  |  |                              <table style={{ width: '100%' }}>
 | 
	
		
			
				|  |  |                                <tr>
 | 
	
		
			
				|  |  | -                                <td>单团学生</td>
 | 
	
		
			
				|  |  | +                                <td>建议学习时长</td>
 | 
	
		
			
				|  |  |                                  <td style={{ 'text-align': 'right' }}>
 | 
	
		
			
				|  |  | -                                  {mapper?.details?.[0]?.unitExaminationName || '无'}
 | 
	
		
			
				|  |  | +                                  {item.lessonDurationSecond || '0'}s
 | 
	
		
			
				|  |  |                                  </td>
 | 
	
		
			
				|  |  |                                </tr>
 | 
	
		
			
				|  |  |                                <tr>
 | 
	
		
			
				|  |  | -                                <td>双团学生</td>
 | 
	
		
			
				|  |  | +                                <td>知识点</td>
 | 
	
		
			
				|  |  |                                  <td style={{ 'text-align': 'right' }}>
 | 
	
		
			
				|  |  | -                                  {mapper?.details?.[1]?.unitExaminationName || '无'}
 | 
	
		
			
				|  |  | +                                  {item.knowledgePointIds?.split(',').filter(Boolean).length || 0}个
 | 
	
		
			
				|  |  |                                  </td>
 | 
	
		
			
				|  |  |                                </tr>
 | 
	
		
			
				|  |  |                                <tr>
 | 
	
		
			
				|  |  | -                                <td>多团学生</td>
 | 
	
		
			
				|  |  | +                                <td>课后作业</td>
 | 
	
		
			
				|  |  |                                  <td style={{ 'text-align': 'right' }}>
 | 
	
		
			
				|  |  | -                                  {mapper?.details?.[2]?.unitExaminationName || '无'}
 | 
	
		
			
				|  |  | +                                  {item.lessonTrainingId ? (
 | 
	
		
			
				|  |  | +                                    <TheLink
 | 
	
		
			
				|  |  | +                                      // to={`/#/afterClassTrainingDetail?id=${item.lessonTrainingId}&name=${item.lessonTrainingName}&courseTypeCode=TRUMPET_SINGLE`}
 | 
	
		
			
				|  |  | +                                      authLink="afterClassTrainingManage1599968711187746818"
 | 
	
		
			
				|  |  | +                                      to={{
 | 
	
		
			
				|  |  | +                                        path: '/afterClassTrainingManage',
 | 
	
		
			
				|  |  | +                                        query: { id: item.lessonTrainingId }
 | 
	
		
			
				|  |  | +                                      }}
 | 
	
		
			
				|  |  | +                                    >
 | 
	
		
			
				|  |  | +                                      {item.lessonTrainingName}
 | 
	
		
			
				|  |  | +                                    </TheLink>
 | 
	
		
			
				|  |  | +                                  ) : (
 | 
	
		
			
				|  |  | +                                    '无'
 | 
	
		
			
				|  |  | +                                  )}
 | 
	
		
			
				|  |  |                                  </td>
 | 
	
		
			
				|  |  |                                </tr>
 | 
	
		
			
				|  |  |                              </table>
 | 
	
		
			
				|  |  |                            </div>
 | 
	
		
			
				|  |  |                          ),
 | 
	
		
			
				|  |  | +                        'header-extra': () => (
 | 
	
		
			
				|  |  | +                          <>
 | 
	
		
			
				|  |  | +                            <NTooltip>
 | 
	
		
			
				|  |  | +                              {{
 | 
	
		
			
				|  |  | +                                default: () => (item.lockFlag ? '解锁' : '锁定'),
 | 
	
		
			
				|  |  | +                                trigger: () => (
 | 
	
		
			
				|  |  | +                                  <NButton
 | 
	
		
			
				|  |  | +                                    disabled={route.query.isLook ? true : false}
 | 
	
		
			
				|  |  | +                                    quaternary
 | 
	
		
			
				|  |  | +                                    circle
 | 
	
		
			
				|  |  | +                                    onClick={() => toggleLock(item)}
 | 
	
		
			
				|  |  | +                                  >
 | 
	
		
			
				|  |  | +                                    <NIcon
 | 
	
		
			
				|  |  | +                                      component={item.lockFlag ? <LockFilled /> : <UnlockFilled />}
 | 
	
		
			
				|  |  | +                                    />
 | 
	
		
			
				|  |  | +                                  </NButton>
 | 
	
		
			
				|  |  | +                                )
 | 
	
		
			
				|  |  | +                              }}
 | 
	
		
			
				|  |  | +                            </NTooltip>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                            <NTooltip>
 | 
	
		
			
				|  |  | +                              {{
 | 
	
		
			
				|  |  | +                                default: () => '编辑',
 | 
	
		
			
				|  |  | +                                trigger: () => (
 | 
	
		
			
				|  |  | +                                  <NButton
 | 
	
		
			
				|  |  | +                                    disabled={route.query.isLook ? true : false}
 | 
	
		
			
				|  |  | +                                    quaternary
 | 
	
		
			
				|  |  | +                                    circle
 | 
	
		
			
				|  |  | +                                    onClick={() => {
 | 
	
		
			
				|  |  | +                                      addForm.name = item.name
 | 
	
		
			
				|  |  | +                                      addForm.lessonTargetDesc = item.lessonTargetDesc
 | 
	
		
			
				|  |  | +                                      addForm.id = item.id
 | 
	
		
			
				|  |  | +                                      addForm.lockEnable = item.lockEnable + ''
 | 
	
		
			
				|  |  | +                                      addForm.accessScope = item.accessScope ?? 0
 | 
	
		
			
				|  |  | +                                      addForm.open = true
 | 
	
		
			
				|  |  | +                                    }}
 | 
	
		
			
				|  |  | +                                  >
 | 
	
		
			
				|  |  | +                                    <NIcon component={<EditFilled />} />
 | 
	
		
			
				|  |  | +                                  </NButton>
 | 
	
		
			
				|  |  | +                                )
 | 
	
		
			
				|  |  | +                              }}
 | 
	
		
			
				|  |  | +                            </NTooltip>
 | 
	
		
			
				|  |  | +                            <NTooltip>
 | 
	
		
			
				|  |  | +                              {{
 | 
	
		
			
				|  |  | +                                default: () => '删除',
 | 
	
		
			
				|  |  | +                                trigger: () => (
 | 
	
		
			
				|  |  | +                                  <NButton
 | 
	
		
			
				|  |  | +                                    disabled={route.query.isLook ? true : false}
 | 
	
		
			
				|  |  | +                                    quaternary
 | 
	
		
			
				|  |  | +                                    circle
 | 
	
		
			
				|  |  | +                                    onClick={() => hanldeDelete(item)}
 | 
	
		
			
				|  |  | +                                  >
 | 
	
		
			
				|  |  | +                                    <NIcon component={<DeleteFilled />} />
 | 
	
		
			
				|  |  | +                                  </NButton>
 | 
	
		
			
				|  |  | +                                )
 | 
	
		
			
				|  |  | +                              }}
 | 
	
		
			
				|  |  | +                            </NTooltip>
 | 
	
		
			
				|  |  | +                          </>
 | 
	
		
			
				|  |  | +                        ),
 | 
	
		
			
				|  |  |                          action: () => (
 | 
	
		
			
				|  |  |                            <NSpace justify="space-around">
 | 
	
		
			
				|  |  |                              <NButton
 | 
	
		
			
				|  |  |                                text
 | 
	
		
			
				|  |  |                                disabled={route.query.isLook ? true : false}
 | 
	
		
			
				|  |  |                                onClick={() => {
 | 
	
		
			
				|  |  | -                                unitData.open = true
 | 
	
		
			
				|  |  | -                                unitData.model = mapper
 | 
	
		
			
				|  |  | +                                courseData.title = item.name
 | 
	
		
			
				|  |  | +                                courseData.open = true
 | 
	
		
			
				|  |  | +                                courseData.item = item
 | 
	
		
			
				|  |  |                                }}
 | 
	
		
			
				|  |  |                              >
 | 
	
		
			
				|  |  | -                              编辑阶段自测
 | 
	
		
			
				|  |  | +                              选择知识点
 | 
	
		
			
				|  |  | +                            </NButton>
 | 
	
		
			
				|  |  | +                            <NButton
 | 
	
		
			
				|  |  | +                              text
 | 
	
		
			
				|  |  | +                              disabled={route.query.isLook ? true : false}
 | 
	
		
			
				|  |  | +                              onClick={() => {
 | 
	
		
			
				|  |  | +                                addForm.id = item.id
 | 
	
		
			
				|  |  | +                                addForm.lessonTargetDesc = item.lessonTargetDesc
 | 
	
		
			
				|  |  | +                                addForm.name = item.name
 | 
	
		
			
				|  |  | +                                afterTrain.open = true
 | 
	
		
			
				|  |  | +                              }}
 | 
	
		
			
				|  |  | +                            >
 | 
	
		
			
				|  |  | +                              选择课后作业
 | 
	
		
			
				|  |  |                              </NButton>
 | 
	
		
			
				|  |  |                            </NSpace>
 | 
	
		
			
				|  |  |                          )
 | 
	
		
			
				|  |  |                        }}
 | 
	
		
			
				|  |  |                      </NCard>
 | 
	
		
			
				|  |  |                    </NGi>
 | 
	
		
			
				|  |  | -                )}
 | 
	
		
			
				|  |  | -              </>
 | 
	
		
			
				|  |  | -            )
 | 
	
		
			
				|  |  | -          })}
 | 
	
		
			
				|  |  | -        </NGrid>
 | 
	
		
			
				|  |  | +                  {mapper && (
 | 
	
		
			
				|  |  | +                    <NGi>
 | 
	
		
			
				|  |  | +                      <NCard
 | 
	
		
			
				|  |  | +                        title={mapper.name}
 | 
	
		
			
				|  |  | +                        style={{
 | 
	
		
			
				|  |  | +                          '--n-padding-top': '5px',
 | 
	
		
			
				|  |  | +                          '--n-padding-bottom': '5px',
 | 
	
		
			
				|  |  | +                          '--n-color': 'rgba(238,243,254,1)',
 | 
	
		
			
				|  |  | +                          '--n-action-color': 'rgba(238,243,254,1)',
 | 
	
		
			
				|  |  | +                          height: '100%'
 | 
	
		
			
				|  |  | +                        }}
 | 
	
		
			
				|  |  | +                      >
 | 
	
		
			
				|  |  | +                        {{
 | 
	
		
			
				|  |  | +                          default: () => (
 | 
	
		
			
				|  |  | +                            <div>
 | 
	
		
			
				|  |  | +                              <div style={{ paddingBottom: '12px' }}>{mapper.desc}</div>
 | 
	
		
			
				|  |  | +                              <table style={{ width: '100%' }}>
 | 
	
		
			
				|  |  | +                                <tr>
 | 
	
		
			
				|  |  | +                                  <td>单团学生</td>
 | 
	
		
			
				|  |  | +                                  <td style={{ 'text-align': 'right' }}>
 | 
	
		
			
				|  |  | +                                    {mapper?.details?.[0]?.unitExaminationName || '无'}
 | 
	
		
			
				|  |  | +                                  </td>
 | 
	
		
			
				|  |  | +                                </tr>
 | 
	
		
			
				|  |  | +                                <tr>
 | 
	
		
			
				|  |  | +                                  <td>双团学生</td>
 | 
	
		
			
				|  |  | +                                  <td style={{ 'text-align': 'right' }}>
 | 
	
		
			
				|  |  | +                                    {mapper?.details?.[1]?.unitExaminationName || '无'}
 | 
	
		
			
				|  |  | +                                  </td>
 | 
	
		
			
				|  |  | +                                </tr>
 | 
	
		
			
				|  |  | +                                <tr>
 | 
	
		
			
				|  |  | +                                  <td>多团学生</td>
 | 
	
		
			
				|  |  | +                                  <td style={{ 'text-align': 'right' }}>
 | 
	
		
			
				|  |  | +                                    {mapper?.details?.[2]?.unitExaminationName || '无'}
 | 
	
		
			
				|  |  | +                                  </td>
 | 
	
		
			
				|  |  | +                                </tr>
 | 
	
		
			
				|  |  | +                              </table>
 | 
	
		
			
				|  |  | +                            </div>
 | 
	
		
			
				|  |  | +                          ),
 | 
	
		
			
				|  |  | +                          action: () => (
 | 
	
		
			
				|  |  | +                            <NSpace justify="space-around">
 | 
	
		
			
				|  |  | +                              <NButton
 | 
	
		
			
				|  |  | +                                text
 | 
	
		
			
				|  |  | +                                disabled={route.query.isLook ? true : false}
 | 
	
		
			
				|  |  | +                                onClick={() => {
 | 
	
		
			
				|  |  | +                                  unitData.open = true
 | 
	
		
			
				|  |  | +                                  unitData.model = mapper
 | 
	
		
			
				|  |  | +                                }}
 | 
	
		
			
				|  |  | +                              >
 | 
	
		
			
				|  |  | +                                编辑阶段自测
 | 
	
		
			
				|  |  | +                              </NButton>
 | 
	
		
			
				|  |  | +                            </NSpace>
 | 
	
		
			
				|  |  | +                          )
 | 
	
		
			
				|  |  | +                        }}
 | 
	
		
			
				|  |  | +                      </NCard>
 | 
	
		
			
				|  |  | +                    </NGi>
 | 
	
		
			
				|  |  | +                  )}
 | 
	
		
			
				|  |  | +                </>
 | 
	
		
			
				|  |  | +              )
 | 
	
		
			
				|  |  | +            })}
 | 
	
		
			
				|  |  | +          </NGrid>
 | 
	
		
			
				|  |  | +        </NSpin>
 | 
	
		
			
				|  |  |          {state.dataList.length ? null : <NEmpty />}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          {/* 课程编辑 */}
 | 
	
	
		
			
				|  | @@ -465,6 +602,36 @@ export default defineComponent({
 | 
	
		
			
				|  |  |                ></NSelect>
 | 
	
		
			
				|  |  |              </NFormItem>
 | 
	
		
			
				|  |  |              <NFormItem
 | 
	
		
			
				|  |  | +              label="是否免费"
 | 
	
		
			
				|  |  | +              required
 | 
	
		
			
				|  |  | +              path="accessScope"
 | 
	
		
			
				|  |  | +              rule={[
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                  type: 'number',
 | 
	
		
			
				|  |  | +                  required: true,
 | 
	
		
			
				|  |  | +                  message: '设置是否免费',
 | 
	
		
			
				|  |  | +                  trigger: ['blur', 'change']
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +              ]}
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  | +              <NSelect
 | 
	
		
			
				|  |  | +                v-model:value={addForm.accessScope}
 | 
	
		
			
				|  |  | +                options={
 | 
	
		
			
				|  |  | +                  [
 | 
	
		
			
				|  |  | +                    {
 | 
	
		
			
				|  |  | +                      label: '是',
 | 
	
		
			
				|  |  | +                      value: 0
 | 
	
		
			
				|  |  | +                    },
 | 
	
		
			
				|  |  | +                    {
 | 
	
		
			
				|  |  | +                      label: '否',
 | 
	
		
			
				|  |  | +                      value: 1
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                  ] as any
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                clearable
 | 
	
		
			
				|  |  | +              ></NSelect>
 | 
	
		
			
				|  |  | +            </NFormItem>
 | 
	
		
			
				|  |  | +            <NFormItem
 | 
	
		
			
				|  |  |                label="教学目标"
 | 
	
		
			
				|  |  |                required
 | 
	
		
			
				|  |  |                path="lessonTargetDesc"
 |