Parcourir la source

修复blockly课程权限回显bug
blockly课程试题配置时分秒组件

liyanbo il y a 6 mois
Parent
commit
72b1b9b620

+ 11 - 33
src/views/blockly/blocklyConfig/BlocklyConfigForm.vue

@@ -17,39 +17,17 @@
       <el-row>
         <el-col :span="16">
           <el-form-item label="课程暂停时长" required>
-            <el-row :gutter="10">
-              <el-col :span="7">
-                <el-input-number
-                  v-model="formData.ccHours"
-                  :min="0"
-                  :step="1"
-                  step-strictly
-                  placeholder="时"
-                />
-              </el-col>
-              <el-col :span="1" class="flex items-center justify-center">:</el-col>
-              <el-col :span="7">
-                <el-input-number
-                  v-model="formData.ccMinutes"
-                  :min="0"
-                  :max="59"
-                  :step="1"
-                  step-strictly
-                  placeholder="分"
-                />
-              </el-col>
-              <el-col :span="1" class="flex items-center justify-center">:</el-col>
-              <el-col :span="7">
-                <el-input-number
-                  v-model="formData.ccSeconds"
-                  :min="0"
-                  :max="59"
-                  :step="1"
-                  step-strictly
-                  placeholder="秒"
-                />
-              </el-col>
-            </el-row>
+            <div style="display: flex; align-items: center; gap: 10px;">
+              <el-input-number v-model="formData.ccHours" :min="0" :step="1" step-strictly :precision="0" style="width: 140px;">
+                <template #suffix><span>时</span></template>
+              </el-input-number>
+              <el-input-number v-model="formData.ccMinutes" :min="0" :max="59" :step="1" step-strictly :precision="0" style="width: 140px;">
+                <template #suffix><span>分</span></template>
+              </el-input-number>
+              <el-input-number v-model="formData.ccSeconds" :min="0" :max="59" :step="1" step-strictly :precision="0" style="width: 140px;">
+                <template #suffix><span>秒</span></template>
+              </el-input-number>
+            </div>
           </el-form-item>
         </el-col>
         <el-col :span="8">

+ 1 - 3
src/views/system/role/RoleBlocklyPermissionForm.vue

@@ -101,8 +101,6 @@ const open = async (row: RoleApi.RoleVO) => {
   // 确保blockly课程只有子节点
   generalBlocklyOptions.value = filterCoursesByType(allCourses, "blocklyType")
 
-  console.log(allCourses, generalBlocklyOptions.value)
-
   // 设置数据
   formData.id = row.id
   formData.name = row.name
@@ -113,7 +111,7 @@ const open = async (row: RoleApi.RoleVO) => {
   if (row.dataScopeBlocklyIds && row.dataScopeBlocklyIds.length > 0) {
     row.dataScopeBlocklyIds.forEach((courseId: number): void => {
       // 尝试在两个树中都设置选中状态,实际只会在对应树中找到匹配的节点
-      generalTreeRef.value?.setChecked(courseId * 100, true, false)
+      generalTreeRef.value?.setChecked(courseId, true, false)
     })
   }
 }

+ 0 - 2
src/views/system/role/RoleCoursePermissionForm.vue

@@ -226,8 +226,6 @@ const submitForm = async () => {
       dataScopeCourseIds: childNodeKeys
     }
     
-    console.log('所有选中的节点:', allCheckedKeys)
-    console.log('只提交子节点:', childNodeKeys)
     await PermissionApi.assignRoleCourseScope(data)
     message.success(t('common.updateSuccess'))
     dialogVisible.value = false