Sfoglia il codice sorgente

1、流程控制 2、简繁体切换放到设置栏3、填空题输入框默认宽度

dsy 2 giorni fa
parent
commit
f696ab5e34

+ 22 - 0
src/api/book.js

@@ -491,3 +491,25 @@ export function SaveCoursewareBackground(data) {
 export function GetCoursewareBackground(data) {
   return http.post(`${process.env.VUE_APP_EepServer}?MethodName=book_content_manager-GetCoursewareBackground`, data);
 }
+
+/**
+ * @description 设置课件可进行改错
+ * @param {object} data
+ * @param {string} data.id - 课件ID
+ * @param {'true' | 'false'} data.is_can_gc - 是否可改错
+ */
+export function SetCoursewareCanGC(data) {
+  return http.post(`${process.env.VUE_APP_EepServer}?MethodName=book_chapter_manager-SetCoursewareCanGC`, data);
+}
+
+/**
+ * @description 提交章节下所有课件到审核流程
+ * @param {object} data
+ * @param {string} data.id - 章节ID
+ */
+export function SubmitChapterAllCoursewareToAuditFlow(data) {
+  return http.post(
+    `${process.env.VUE_APP_EepServer}?MethodName=book_audit_manager-SubmitChapterAllCoursewareToAuditFlow`,
+    data,
+  );
+}

+ 85 - 20
src/components/CommonPreview.vue

@@ -35,9 +35,6 @@
           "
           >显示分组</span
         >
-        <span class="link">
-          <el-checkbox v-model="chinese" true-label="zh-Hant" false-label="zh-Hans">繁体</el-checkbox>
-        </span>
         <span v-if="false" class="link">
           <el-checkbox v-model="showPinYin" true-label="true" false-label="false">拼音</el-checkbox>
         </span>
@@ -71,7 +68,16 @@
         <!-- 教材章节树 -->
         <div class="courseware-tree">
           <div
-            v-for="{ id: nodeId, name, status, status_name, deep, is_leaf_chapter, is_my_edit_task } in node_list"
+            v-for="{
+              id: nodeId,
+              name,
+              status,
+              status_name,
+              deep,
+              is_leaf_chapter,
+              is_my_edit_task,
+              is_show_submit_audit_button,
+            } in node_list"
             :key="nodeId"
             :class="['menu-item', { active: curSelectId === nodeId }, { courseware: isTrue(is_leaf_chapter) }]"
             :style="computedNameStyle(deep, isTrue(is_leaf_chapter))"
@@ -85,6 +91,9 @@
               {{ name }}
             </span>
             <span v-if="['audit', 'edit_preview'].includes(type)" class="status">{{ status_name }}</span>
+            <template v-if="!isTrue(is_leaf_chapter) && isTrue(is_show_submit_audit_button)">
+              <span class="link" @click="submitChapterAllCoursewareToAuditFlow(nodeId)">提交审核</span>
+            </template>
           </div>
         </div>
       </aside>
@@ -337,6 +346,7 @@
               </li>
             </ul>
           </div>
+
           <div v-if="curToolbarIcon === 'note'" class="resource_box">
             <h5>{{ drawerTitle }}</h5>
             <div style="height: 40px"></div>
@@ -356,6 +366,7 @@
               </li>
             </ul>
           </div>
+
           <div v-if="curToolbarIcon === 'translate'" class="resource_box">
             <h5>{{ drawerTitle }}</h5>
             <div style="height: 40px"></div>
@@ -365,6 +376,7 @@
               </el-select>
             </div>
           </div>
+
           <template v-if="curToolbarIcon === 'audit'">
             <AuditRemark
               :remark-list="remark_list"
@@ -373,6 +385,19 @@
               @handleLocationRemarks="handleLocationRemarks"
             />
           </template>
+          <!-- 设置 -->
+          <div v-if="curToolbarIcon === 'setting'" class="setting">
+            <h5>{{ drawerTitle }}</h5>
+            <div class="setting-content">
+              <el-switch
+                v-model="chinese"
+                active-value="zh-Hant"
+                active-text="繁体"
+                inactive-value="zh-Hans"
+                inactive-text="简体"
+              />
+            </div>
+          </div>
         </div>
 
         <div class="back-top" @click="backTop">
@@ -473,6 +498,7 @@ import {
   DeleteMyCollect,
   SearchBookContentText,
   SetBookResourceHide,
+  SubmitChapterAllCoursewareToAuditFlow,
 } from '@/api/book';
 import { toggleFullScreen } from '@/utils/common';
 import * as OpenCC from 'opencc-js';
@@ -553,7 +579,7 @@ export default {
       { icon: 'collect', title: '收藏', handle: 'getCollect', param: { type: '11' } },
       { icon: 'note', title: '笔记', handle: 'getNote', param: { type: '12' } },
       { icon: 'translate', title: '多语言', handle: 'openTranslate', param: { type: '21' } },
-      { icon: 'setting', title: '设置', handle: '', param: {} },
+      { icon: 'setting', title: '设置', handle: 'openSetting', param: { type: 6 } },
     ];
 
     if (this.isShowAudit) {
@@ -618,6 +644,17 @@ export default {
       isChildDataLoad: false,
       mindMapJsonData: {}, // 思维导图json数据
       drawerType: '', // 抽屉类型
+      titleMap: {
+        0: '图片资源',
+        1: '音频资源',
+        2: '视频资源',
+        5: '文本资源',
+        6: '设置',
+        11: '收藏列表',
+        12: '笔记列表',
+        13: '搜索结果',
+        21: '多语言',
+      },
       page_capacity: 10,
       cur_page: 1,
       file_list: [],
@@ -678,17 +715,7 @@ export default {
       return result;
     },
     drawerTitle() {
-      const titleMap = {
-        0: '图片资源',
-        1: '音频资源',
-        2: '视频资源',
-        5: '文本资源',
-        11: '收藏列表',
-        12: '笔记列表',
-        13: '搜索结果',
-        21: '多语言',
-      };
-      return titleMap[this.drawerType] || '资源列表';
+      return this.titleMap[this.drawerType] || '资源列表';
     },
     shouldMediaShowItem() {
       return (chapter, item) => {
@@ -1051,6 +1078,9 @@ export default {
     openTranslate(params) {
       if (params && params.type) this.drawerType = Number(params.type);
     },
+    openSetting({ type }) {
+      this.drawerType = type;
+    },
     /**
      * 打开抽屉并初始化加载
      * @param {Object} param - 抽屉参数
@@ -1267,19 +1297,24 @@ export default {
       if (!isTrue(is_leaf_chapter)) {
         return '';
       }
-      // 如果当前选中节点且不可编辑,显示默认色
-      if (is_my_edit_task === 'false') {
-        return '';
-      }
+
       // 当前选中节点,显示高亮蓝色
       if (this.curSelectId === nodeId) {
         return '#4095e5';
       }
+
       // 审核通过显示绿色,其他显示默认蓝色
       let color = '#74b9ff';
       if (status === 2) {
         color = '#27ae60';
+        return color;
+      }
+
+      // 如果当前节点不可编辑,显示默认色
+      if (is_my_edit_task === 'false') {
+        return '';
       }
+
       return color;
     },
     /**
@@ -1598,6 +1633,22 @@ export default {
         this.inputActiveIndex = this.data.input_list.length - 1;
       }
     },
+    async submitChapterAllCoursewareToAuditFlow(chapter_id) {
+      try {
+        await this.$confirm('确定要提交审核吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        });
+        await SubmitChapterAllCoursewareToAuditFlow({ chapter_id });
+        this.getBookChapterStructExpandList();
+        this.$message.success('提交成功');
+      } catch (e) {
+        if (e === 'cancel') {
+          this.$message.error('已取消');
+        }
+      }
+    },
   },
 };
 </script>
@@ -2118,6 +2169,20 @@ $total-width: $courseware-width + $courseware-left-margin + $courseware-right-ma
             text-align: center;
           }
         }
+
+        .setting {
+          h5 {
+            padding: 0 5px;
+            margin: 0;
+            font-size: 18px;
+            line-height: 40px;
+            background: #f2f3f5;
+          }
+
+          &-content {
+            padding: 10px;
+          }
+        }
       }
 
       .back-top {

+ 5 - 0
src/views/book/courseware/create/components/question/fill/FillSetting.vue

@@ -58,6 +58,11 @@
           <el-option v-for="{ value, label } in fillFontList" :key="value" :label="label" :value="value" />
         </el-select>
       </el-form-item>
+      <el-form-item label="输入框初始宽度">
+        <el-input v-model="property.input_default_width" type="number" placeholder="请输入">
+          <template slot="append">px</template>
+        </el-input>
+      </el-form-item>
       <el-divider />
       <el-form-item label="语音作答">
         <el-radio-group v-model="property.is_enable_voice_answer">

+ 1 - 0
src/views/book/courseware/data/fill.js

@@ -68,6 +68,7 @@ export function getFillProperty() {
     voice_type: '', // 音色
     emotion: '', // 风格,情感
     speed_ratio: '', // 语速
+    input_default_width: 80, // 输入框默认宽度
     ...commonComponentProperty,
   };
 }

+ 3 - 3
src/views/book/courseware/preview/components/fill/FillPreview.vue

@@ -31,7 +31,7 @@
                   v-model="li.content"
                   :disabled="disabled"
                   :class="[data.property.fill_font, ...computedAnswerClass(li.mark)]"
-                  :style="[{ width: Math.max(80, li.content.length * 21.3) + 'px' }]"
+                  :style="[{ width: Math.max(data.property.input_default_width, li.content.length * 21.3) + 'px' }]"
                 />
               </template>
 
@@ -54,7 +54,7 @@
                     :readonly="true"
                     :class="[data.property.fill_font, ...computedAnswerClass(li.mark)]"
                     class="pinyin"
-                    :style="[{ width: Math.max(80, li.content.length * 21.3) + 'px' }]"
+                    :style="[{ width: Math.max(data.property.input_default_width, li.content.length * 21.3) + 'px' }]"
                   />
                 </el-popover>
               </template>
@@ -443,7 +443,7 @@ export default {
       display: inline-flex;
       align-items: center;
       width: 120px;
-      margin: 0 2px;
+      margin: 0 10px;
       vertical-align: bottom;
 
       &.pinyin :deep input.el-input__inner {

+ 36 - 9
src/views/personal_workbench/project/ProductionEditorialManage.vue

@@ -49,6 +49,8 @@
               last_editor_name,
               last_edit_time,
               edit_end_date,
+              is_show_gc_button,
+              status,
             },
             i
           ) in node_list"
@@ -56,12 +58,8 @@
           :class="['catalogue', { active: curSelectId === id }]"
           @click="selectActiveChapter(id, is_leaf_chapter === 'true')"
         >
-          <div
-            :class="['chapter-title', { courseware: isEnable(is_leaf_chapter) }]"
-            :style="computedNameStyle(deep)"
-            :title="name"
-          >
-            <span class="nowrap-ellipsis">{{ name }}</span>
+          <div :class="['chapter-title', { courseware: isEnable(is_leaf_chapter) }]" :style="computedNameStyle(deep)">
+            <span class="nowrap-ellipsis" :title="name">{{ name }}</span>
             <el-dropdown v-if="!isEnable(is_leaf_chapter)" trigger="click">
               <span class="el-dropdown-link" style="cursor: pointer"><i class="el-icon-plus"></i> </span>
               <el-dropdown-menu slot="dropdown">
@@ -73,23 +71,28 @@
                 </el-dropdown-item>
               </el-dropdown-menu>
             </el-dropdown>
+
+            <div v-if="isEnable(is_leaf_chapter) && isEnable(is_show_gc_button)">
+              <span v-if="status === 4" class="link" @click="setCoursewareCanGC(id, 'true')">开始改错</span>
+              <span v-if="status === 2" class="link" @click="setCoursewareCanGC(id, 'false')">取消改错</span>
+            </div>
           </div>
           <div
             class="producer nowrap-ellipsis"
-            :style="{ color: !isEnable(is_root) && isEnable(is_inherited_producer) ? '#ff4757' : 'default' }"
+            :style="{ color: !isEnable(is_root) && isEnable(is_inherited_producer) ? '#ff4757' : '' }"
             :title="producer_list.map((producer) => producer.name).join(';')"
           >
             <span>{{ producer_list.map((producer) => producer.name).join(';') }}</span>
           </div>
           <div
             class="edit-end-date"
-            :style="{ color: !isEnable(is_root) && isEnable(is_inherited_producer) ? '#ff4757' : 'default' }"
+            :style="{ color: !isEnable(is_root) && isEnable(is_inherited_producer) ? '#ff4757' : '' }"
           >
             {{ edit_end_date }}
           </div>
           <div
             class="audit nowrap-ellipsis"
-            :style="{ color: !isEnable(is_root) && isEnable(is_inherited_auditor) ? '#ff4757' : 'default' }"
+            :style="{ color: !isEnable(is_root) && isEnable(is_inherited_auditor) ? '#ff4757' : '' }"
             :title="auditor_desc"
           >
             {{ auditor_desc }}
@@ -189,6 +192,7 @@ import {
   ChapterUpdateCoursewareName,
   ChapterMoveTreeNode,
   CheckChapterIsExistChildNode,
+  SetCoursewareCanGC,
 } from '@/api/book';
 import { isEnable } from '@/views/book/courseware/data/common';
 
@@ -543,6 +547,29 @@ export default {
         this.$message.success('章节移动成功');
       });
     },
+    /**
+     * 设置课件改错状态
+     * @param {string} id - 课件ID
+     * @param {'true' | 'false'} is_can_gc - 是否可以改错
+     */
+    setCoursewareCanGC(id, is_can_gc) {
+      this.$confirm(is_can_gc === 'true' ? '是否确认开始改错?' : '是否确认取消改错?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          SetCoursewareCanGC({ id, is_can_gc })
+            .then(() => {
+              this.getBookChapterStructExpandList();
+              this.$message.success(is_can_gc === 'true' ? '已开始改错' : '已取消改错');
+            })
+            .catch(() => {});
+        })
+        .catch(() => {
+          // 忽略用户取消确认的情况
+        });
+    },
   },
 };
 </script>

+ 4 - 8
src/views/project_manage/org/project/index.vue

@@ -32,14 +32,10 @@
               >查看信息</span
             >
             <span class="link" @click="previewProject(row.id)">预览项目</span>
-            <span
-              v-if="isTrue(row.is_can_audit)"
-              class="link"
-              @click="projectAuditOperate(row.id, 'true', row.request_status)"
-            >
-              审核通过
-            </span>
-            <span v-else class="link" @click="projectAuditOperate(row.id, 'false', row.request_status)">审核拒绝</span>
+            <template v-if="isTrue(row.is_can_audit)">
+              <span class="link" @click="projectAuditOperate(row.id, 'true', row.request_status)"> 审核通过 </span>
+              <span class="link" @click="projectAuditOperate(row.id, 'false', row.request_status)">审核拒绝</span>
+            </template>
           </template>
         </el-table-column>
       </el-table>