ソースを参照

1、课程暂停试题,仅限视频课配置
2、修复blockly配置路由跳转问题
3、修复blockly配置矩阵背景图问题

liyanbo 5 ヶ月 前
コミット
b9b860a7c4

+ 0 - 20
src/router/modules/remaining.ts

@@ -387,26 +387,6 @@ const remainingRouter: AppRouteRecordRaw[] = [
       }
     ]
   },
-  {
-    path: '/blockly',
-    component: Layout,
-    name: 'Blockly',
-    meta: {
-      hidden: true
-    },
-    children: [
-      {
-        path: 'blockly/config',
-        component: () => import('@/views/blockly/blocklyConfig/index.vue'),
-        name: 'blocklyConfig',
-        meta: {
-          title: 'Blockly 配置',
-          icon: 'ep:setting',
-          noCache: false
-        }
-      }
-    ]
-  },
 ]
 
 export default remainingRouter

+ 13 - 2
src/types/auto-components.d.ts

@@ -10,8 +10,6 @@ declare module 'vue' {
     AppLinkInput: typeof import('./../components/AppLinkInput/index.vue')['default']
     AppLinkSelectDialog: typeof import('./../components/AppLinkInput/AppLinkSelectDialog.vue')['default']
     Backtop: typeof import('./../components/Backtop/src/Backtop.vue')['default']
-    BlocklyConfig: typeof import('./../views/blockly/blocklyConfig/index.vue')['default']
-    BlocklyConfigForm: typeof import('./../views/blockly/blocklyConfig/BlocklyConfigForm.vue')['default']
     BoundaryEventTimer: typeof import('./../components/bpmnProcessDesigner/package/penal/custom-config/components/BoundaryEventTimer.vue')['default']
     CallActivity: typeof import('./../components/bpmnProcessDesigner/package/penal/task/task-components/CallActivity.vue')['default']
     CardTitle: typeof import('./../components/Card/src/CardTitle.vue')['default']
@@ -47,6 +45,7 @@ declare module 'vue' {
     Draggable: typeof import('./../components/Draggable/index.vue')['default']
     Echart: typeof import('./../components/Echart/src/Echart.vue')['default']
     Editor: typeof import('./../components/Editor/src/Editor.vue')['default']
+    ElAside: typeof import('element-plus/es')['ElAside']
     ElAutoResizer: typeof import('element-plus/es')['ElAutoResizer']
     ElAvatar: typeof import('element-plus/es')['ElAvatar']
     ElBadge: typeof import('element-plus/es')['ElBadge']
@@ -55,6 +54,9 @@ declare module 'vue' {
     ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
     ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
     ElCol: typeof import('element-plus/es')['ElCol']
+    ElCollapseTransition: typeof import('element-plus/es')['ElCollapseTransition']
+    ElContainer: typeof import('element-plus/es')['ElContainer']
+    ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
     ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
     ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
     ElDialog: typeof import('element-plus/es')['ElDialog']
@@ -72,14 +74,17 @@ declare module 'vue' {
     ElementProperties: typeof import('./../components/bpmnProcessDesigner/package/penal/properties/ElementProperties.vue')['default']
     ElementTask: typeof import('./../components/bpmnProcessDesigner/package/penal/task/ElementTask.vue')['default']
     ElEmpty: typeof import('element-plus/es')['ElEmpty']
+    ElFooter: typeof import('element-plus/es')['ElFooter']
     ElForm: typeof import('element-plus/es')['ElForm']
     ElFormItem: typeof import('element-plus/es')['ElFormItem']
+    ElHeader: typeof import('element-plus/es')['ElHeader']
     ElIcon: typeof import('element-plus/es')['ElIcon']
     ElImage: typeof import('element-plus/es')['ElImage']
     ElImageViewer: typeof import('element-plus/es')['ElImageViewer']
     ElInput: typeof import('element-plus/es')['ElInput']
     ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
     ElLink: typeof import('element-plus/es')['ElLink']
+    ElMain: typeof import('element-plus/es')['ElMain']
     ElOption: typeof import('element-plus/es')['ElOption']
     ElPagination: typeof import('element-plus/es')['ElPagination']
     ElPopover: typeof import('element-plus/es')['ElPopover']
@@ -92,6 +97,8 @@ declare module 'vue' {
     ElSegmented: typeof import('element-plus/es')['ElSegmented']
     ElSelect: typeof import('element-plus/es')['ElSelect']
     ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
+    ElSlider: typeof import('element-plus/es')['ElSlider']
+    ElSpace: typeof import('element-plus/es')['ElSpace']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
     ElTable: typeof import('element-plus/es')['ElTable']
     ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
@@ -99,7 +106,11 @@ declare module 'vue' {
     ElTabPane: typeof import('element-plus/es')['ElTabPane']
     ElTabs: typeof import('element-plus/es')['ElTabs']
     ElTag: typeof import('element-plus/es')['ElTag']
+    ElText: typeof import('element-plus/es')['ElText']
+    ElTimeline: typeof import('element-plus/es')['ElTimeline']
+    ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
     ElTooltip: typeof import('element-plus/es')['ElTooltip']
+    ElTree: typeof import('element-plus/es')['ElTree']
     ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
     ElUpload: typeof import('element-plus/es')['ElUpload']
     EndEventNode: typeof import('./../components/SimpleProcessDesignerV2/src/nodes/EndEventNode.vue')['default']

+ 2 - 0
src/types/auto-imports.d.ts

@@ -7,6 +7,8 @@ export {}
 declare global {
   const DICT_TYPE: typeof import('@/utils/dict')['DICT_TYPE']
   const EffectScope: typeof import('vue')['EffectScope']
+  const ElMessage: typeof import('element-plus/es')['ElMessage']
+  const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
   const computed: typeof import('vue')['computed']
   const createApp: typeof import('vue')['createApp']
   const customRef: typeof import('vue')['customRef']

+ 2 - 0
src/views/bjdx/course/index.vue

@@ -203,6 +203,8 @@
           <el-button
             link
             type="success"
+            :disabled="scope.row.courseContentType !== 'video'"
+            title="仅视频课程可配置"
             @click="handleConfig(scope.row.id,scope.row.courseName,scope.row.tenantId)"
           >
             配置

+ 1 - 1
src/views/bjdx/courseconfig/CourseConfigForm.vue

@@ -165,7 +165,7 @@
 <script setup lang="ts">
 import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
 import { CourseConfigApi, CourseConfigVO} from '@/api/bjdx/courseconfig'
-import { CourseQuestionApi} from '@/api/bjdx/coursequestion' // 新增试题API引入
+import { CourseQuestionApi} from '@/api/bjdx/coursequestion'
 
 /** 合并后的课程配置与试题选择表单 */
 defineOptions({ name: 'CourseConfigWithQuestionForm' })

+ 7 - 4
src/views/blockly/blockly/BlocklyForm.vue

@@ -252,10 +252,13 @@
             <div class="map-grid-container">
               <div
                 class="map-grid"
-                :style="{ gridTemplateColumns: `repeat(${blocklyTileX || 5}, 1fr)`,
-                   gridTemplateRows: `repeat(${blocklyTileY || 5}, 1fr)` ,
-                   backgroundImage: formData.blocklyBackground ? `url(${formData.blocklyBackground})` : 'none', backgroundSize: 'cover',
-                   backgroundPosition: 'center' }"
+                :style="{
+                  gridTemplateColumns: `repeat(${blocklyTileX || 5}, 1fr)`,
+                  gridTemplateRows: `repeat(${blocklyTileY || 5}, 1fr)`,
+                  backgroundImage: formData.blocklyBackground ? `url('${formData.blocklyBackground}')` : 'none',
+                  backgroundSize: 'cover',
+                  backgroundPosition: 'center'
+                }"
               >
                 <div
                   v-for="(cell, index) in blocklyGridCells"

+ 4 - 7
src/views/blockly/blockly/index.vue

@@ -161,6 +161,8 @@
           <el-button
             link
             type="success"
+            :disabled="scope.row.bcContentType !== 'video'"
+            title="仅视频课程可配置"
             @click="handleConfig(scope.row.id,scope.row.bcName,scope.row.tenantId)"
           >
             配置
@@ -284,14 +286,9 @@ const handleDelete = async (id: number) => {
 /** 配置按钮操作 */
 const router = useRouter()
 const handleConfig = (id: number,bcName: string,tenantId: number) => {
-  // router.push({
-  //   name: 'blocklyConfig',
-  //   query: { bcId: id , bcName: bcName,tenantId: tenantId}
-  // })
-
   router.push({
-    name: 'courseConfig',
-    query: { courseId: id , courseName: bcName,tenantId: tenantId}
+    path: '/blockly/blockly-config',
+    query: { bcId: id , bcName: bcName, tenantId: tenantId}
   })
 }
 

+ 9 - 7
src/views/blockly/blocklyConfig/BlocklyConfigForm.vue

@@ -164,10 +164,12 @@
 
 <script setup lang="ts">
 import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
-import { CourseQuestionApi} from '@/api/bjdx/coursequestion' // 新增试题API引入
+import { BlocklyConfigApi, BlocklyConfigVO} from '@/api/blockly/blocklyConfig'
+import { CourseQuestionApi} from '@/api/bjdx/coursequestion'
+
 
 /** 合并后的课程配置与试题选择表单 */
-defineOptions({ name: 'CourseConfigWithQuestionForm' })
+defineOptions({ name: 'BlocklyConfigWithQuestionForm' })
 
 const { t } = useI18n()
 const message = useMessage()
@@ -218,7 +220,7 @@ const open = async (type: string, id?: number, courseId?: number, courseName?: s
   if (id) {
     formLoading.value = true
     try {
-      formData.value = await CourseConfigApi.getCourseConfig(id)
+      formData.value = await BlocklyConfigApi.getCourseConfig(id)
     } finally {
       formLoading.value = false
     }
@@ -248,7 +250,7 @@ const questQueryParams = reactive({
 const loadQuestionList = async () => {
   questionLoading.value = true
   try {
-    const res = await CourseQuestionApi.getCourseQuestionPage(questQueryParams)
+    const res = await BlocklyQuestionApi.getCourseQuestionPage(questQueryParams)
     questionList.value = res.list
     questionTotal.value = res.total // 更新总条数
   } finally {
@@ -277,12 +279,12 @@ const submitForm = async () => {
   // 提交请求
   formLoading.value = true
   try {
-    const data = formData.value as unknown as CourseConfigVO
+    const data = formData.value as unknown as BlocklyConfigVO
     if (formType.value === 'create') {
-      await CourseConfigApi.createCourseConfig(data)
+      await BlocklyConfigApi.createCourseConfig(data)
       message.success(t('common.createSuccess'))
     } else {
-      await CourseConfigApi.updateCourseConfig(data)
+      await BlocklyConfigApi.updateCourseConfig(data)
       message.success(t('common.updateSuccess'))
     }
     dialogVisible.value = false

+ 8 - 7
src/views/blockly/blocklyConfig/index.vue

@@ -59,7 +59,7 @@
           plain
           v-if="tenantId == getTenantId()"
           @click="openForm('create', null, queryParams.ccCourseId, queryParams.courseName)"
-          v-hasPermi="['bjdx:course-config:create']"
+          v-hasPermi="['blockly:course-config:create']"
         >
           <Icon icon="ep:plus" class="mr-5px" /> 新增
         </el-button>
@@ -68,7 +68,7 @@
           plain
           @click="handleExport"
           :loading="exportLoading"
-          v-hasPermi="['bjdx:course-config:export']"
+          v-hasPermi="['blockly:course-config:export']"
         >
           <Icon icon="ep:download" class="mr-5px" /> 导出
         </el-button>
@@ -79,10 +79,10 @@
   <!-- 列表 -->
   <ContentWrap>
     <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
-<!--      <el-table-column label="课程配置id" align="center" prop="id" />-->
+      <!--      <el-table-column label="课程配置id" align="center" prop="id" />-->
       <el-table-column label="课程名称" align="center" prop="courseName" />
       <el-table-column label="课程暂停时长" align="center" prop="ccTime" />
-      <el-table-column label="暂停类型" align="center" prop="ccQuestSource" >
+      <el-table-column label="暂停类型" align="center" prop="ccQuestSource">
         <template #default="scope">
           <dict-tag :type="DICT_TYPE.COURSE_QUEST_SHOW_TYPE" :value="scope.row.ccQuestSource" />
         </template>
@@ -107,7 +107,7 @@
             type="primary"
             v-if="scope.row.tenantId == getTenantId()"
             @click="openForm('update', scope.row.id, queryParams.ccCourseId, queryParams.courseName)"
-            v-hasPermi="['bjdx:course-config:update']"
+            v-hasPermi="['blockly:course-config:update']"
           >
             编辑
           </el-button>
@@ -116,7 +116,7 @@
             type="danger"
             v-if="scope.row.tenantId == getTenantId()"
             @click="handleDelete(scope.row.id)"
-            v-hasPermi="['bjdx:course-config:delete']"
+            v-hasPermi="['blockly:course-config:delete']"
           >
             删除
           </el-button>
@@ -137,7 +137,8 @@
 </template>
 
 <script setup lang="ts">
-import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
+import { onMounted, ref } from 'vue'
+import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
 import download from '@/utils/download'
 import { useRoute } from 'vue-router'
 import { BlocklyConfigApi, CourseConfigVO } from '@/api/blockly/blocklyConfig'