Przeglądaj źródła

排序题支持空格分割完整句子

dsy 4 dni temu
rodzic
commit
6d010df946

+ 1 - 1
.env

@@ -11,4 +11,4 @@ VUE_APP_BookWebSI = '/GCLSBookWebSI/ServiceInterface'
 VUE_APP_EepServer = '/EEPServer/SI'
 VUE_APP_EepServer = '/EEPServer/SI'
 
 
 #version
 #version
-VUE_APP_VERSION = '2026.05.22'
+VUE_APP_VERSION = '2026.05.25'

+ 8 - 3
src/views/book/courseware/create/components/question/fill/Fill.vue

@@ -459,8 +459,13 @@ export default {
 }
 }
 
 
 .pinyin-text-list {
 .pinyin-text-list {
-  display: flex;
-  flex-wrap: wrap;
-  align-items: center;
+  :deep .pinyin-area {
+    display: inline;
+  }
+
+  :deep .pinyin-area .rich-text-container,
+  :deep .pinyin-area .pinyin-paragraph {
+    display: inline;
+  }
 }
 }
 </style>
 </style>

+ 29 - 0
src/views/book/courseware/create/components/question/sort/Sort.vue

@@ -1,6 +1,15 @@
 <template>
 <template>
   <ModuleBase ref="base" :type="data.type">
   <ModuleBase ref="base" :type="data.type">
     <template #content>
     <template #content>
+      <el-input
+        v-model="data.content"
+        type="textarea"
+        placeholder="你 喜欢 喝 茶 还是 咖啡 ?"
+        :autosize="{ minRows: 2, maxRows: 6 }"
+        resize="none"
+        @change="handleContentChange"
+      />
+
       <div class="sort-wrapper" :style="getSortWrapperStyle()">
       <div class="sort-wrapper" :style="getSortWrapperStyle()">
         <template v-for="(item, i) in data.option_list">
         <template v-for="(item, i) in data.option_list">
           <div
           <div
@@ -181,6 +190,25 @@ export default {
       item.custom_serial_number = item.custom_serial_number.replace(/[^0-9/]/g, '');
       item.custom_serial_number = item.custom_serial_number.replace(/[^0-9/]/g, '');
     },
     },
     /**
     /**
+     * @description 处理内容输入,自动根据空格分隔生成选项内容
+     */
+    handleContentChange() {
+      const words = (this.data.content || '').trim().split(/\s+/).filter(Boolean); // 根据空格分隔输入内容,并过滤掉空字符串
+      const targetCount = Math.max(this.data.option_list.length, words.length);
+
+      while (this.data.option_list.length < targetCount) {
+        this.data.option_list.push(getOption());
+      }
+
+      this.data.option_list.forEach((item, i) => {
+        item.content = words[i] || '';
+      });
+
+      if (this.data.property.option_count !== targetCount) {
+        this.data.property.option_count = targetCount;
+      }
+    },
+    /**
      * @description 处理思维导图数据
      * @description 处理思维导图数据
      */
      */
     handleMindMap() {
     handleMindMap() {
@@ -210,6 +238,7 @@ export default {
 .sort-wrapper {
 .sort-wrapper {
   display: grid;
   display: grid;
   gap: 12px;
   gap: 12px;
+  margin-top: 16px;
 
 
   .sort-rich {
   .sort-rich {
     position: relative;
     position: relative;

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

@@ -57,6 +57,7 @@ export function getSortData() {
     mind_map: {
     mind_map: {
       node_list: [{ name: '3选项横排设定显示排序组件' }],
       node_list: [{ name: '3选项横排设定显示排序组件' }],
     },
     },
+    content: '',
     answer_list: [], // 答案列表
     answer_list: [], // 答案列表
     analysis_list: [], // 解析列表
     analysis_list: [], // 解析列表
   };
   };

+ 4 - 3
src/views/book/courseware/preview/CoursewarePreview.vue

@@ -464,9 +464,10 @@ export default {
 
 
             // 如果有标签类组件,获取对应名称
             // 如果有标签类组件,获取对应名称
             if (findKey) {
             if (findKey) {
-              let item = this.isEdit
-                ? this.findChildComponentByKey(`grid-${findKey}`)
-                : this.$refs.previewEdit.findChildComponentByKey(`preview-${findKey}`);
+              let item = this.$refs.preview.find(
+                (child) => child.$el && child.$el.dataset && child.$el.dataset.id === findKey,
+              );
+
               if (['describe', 'stem'].includes(findType)) {
               if (['describe', 'stem'].includes(findType)) {
                 groupName = item.data.content.replace(/<[^>]+>/g, '');
                 groupName = item.data.content.replace(/<[^>]+>/g, '');
               } else if (findType === 'label') {
               } else if (findType === 'label') {

+ 14 - 10
src/views/book/courseware/preview/components/article/NotesModelChs.vue

@@ -1,6 +1,6 @@
 <!--  -->
 <!--  -->
 <template>
 <template>
-  <div v-if="curQue" class="NNPE-ArticleView" id="notes-model">
+  <div v-if="curQue" id="notes-model" class="NNPE-ArticleView">
     <div
     <div
       v-if="
       v-if="
         ((curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url) ||
         ((curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url) ||
@@ -78,12 +78,12 @@
                   }"
                   }"
                 />
                 />
                 <video
                 <video
+                  v-else
                   :src="item.sourceList[0].file_url_open"
                   :src="item.sourceList[0].file_url_open"
                   width="100%"
                   width="100%"
                   height="400"
                   height="400"
                   controls
                   controls
                   controlsList="nodownload"
                   controlsList="nodownload"
-                  v-else
                 ></video>
                 ></video>
               </template>
               </template>
 
 
@@ -565,12 +565,12 @@
                   }"
                   }"
                 />
                 />
                 <video
                 <video
+                  v-else
                   :src="item.sourceList[0].file_url_open"
                   :src="item.sourceList[0].file_url_open"
                   width="100%"
                   width="100%"
                   height="400"
                   height="400"
                   controls
                   controls
                   controlsList="nodownload"
                   controlsList="nodownload"
-                  v-else
                 ></video>
                 ></video>
               </template>
               </template>
             </div>
             </div>
@@ -1051,6 +1051,7 @@
       </div>
       </div>
     </div>
     </div>
     <el-dialog
     <el-dialog
+      v-if="notesFlag"
       :visible.sync="notesFlag"
       :visible.sync="notesFlag"
       :show-close="true"
       :show-close="true"
       :title="'笔记'"
       :title="'笔记'"
@@ -1058,14 +1059,19 @@
       width="367px"
       width="367px"
       class="notes-dialog"
       class="notes-dialog"
       @close="handleData"
       @close="handleData"
-      v-if="notesFlag"
     >
     >
       <p>{{ notesObj.title }}</p>
       <p>{{ notesObj.title }}</p>
-      <el-input type="textarea" :rows="4" maxlength="200" show-word-limit placeholder="请输入" v-model="notesObj.notes">
-      </el-input>
+      <el-input
+        v-model="notesObj.notes"
+        type="textarea"
+        :rows="4"
+        maxlength="200"
+        show-word-limit
+        placeholder="请输入"
+      />
       <div class="btn-box">
       <div class="btn-box">
-        <el-button type="danger" plain size="small" @click="deleteNotes" v-if="notesObj.id">删除</el-button>
-        <el-button type="primary" @click="handleSave" size="small" :loading="loading">保存</el-button>
+        <el-button v-if="notesObj.id" type="danger" plain size="small" @click="deleteNotes">删除</el-button>
+        <el-button type="primary" size="small" :loading="loading" @click="handleSave">保存</el-button>
       </div>
       </div>
     </el-dialog>
     </el-dialog>
   </div>
   </div>
@@ -1369,7 +1375,6 @@ export default {
           .on('selection:create', ({ sources }) => {
           .on('selection:create', ({ sources }) => {
             // sources = sources.map(hs => ({hs}));
             // sources = sources.map(hs => ({hs}));
             if (sources && sources[0]) {
             if (sources && sources[0]) {
-              console.log(sources[0]);
               _this.notesObj.title = sources[0].text;
               _this.notesObj.title = sources[0].text;
               _this.notesObj.pos = JSON.stringify({
               _this.notesObj.pos = JSON.stringify({
                 sent_id: _this.activeSentObj,
                 sent_id: _this.activeSentObj,
@@ -1532,7 +1537,6 @@ export default {
       // });
       // });
     },
     },
     mouseupClick(obj, index) {
     mouseupClick(obj, index) {
-      console.log(obj);
       this.activeSentObj = index;
       this.activeSentObj = index;
     },
     },
   }, // 如果页面有keep-alive缓存功能,这个函数会触发
   }, // 如果页面有keep-alive缓存功能,这个函数会触发

+ 1 - 0
src/views/book/courseware/preview/components/sort/SortPreview.vue

@@ -210,6 +210,7 @@ export default {
     getNoTextContentData() {
     getNoTextContentData() {
       let noTextContentData = JSON.parse(JSON.stringify(this.data));
       let noTextContentData = JSON.parse(JSON.stringify(this.data));
       const resetFieldMap = {
       const resetFieldMap = {
+        content: '',
         analysis_list: [],
         analysis_list: [],
         answer_list: [],
         answer_list: [],
       };
       };

+ 0 - 1
src/views/personal_workbench/edit_task/preview/index.vue

@@ -149,7 +149,6 @@ export default {
           let courseware_info = {};
           let courseware_info = {};
           if (form.is_select_part_courseware_mode === 'true') {
           if (form.is_select_part_courseware_mode === 'true') {
             courseware_info = this.$refs.preview.computedSelectedGroupCoursewareInfo();
             courseware_info = this.$refs.preview.computedSelectedGroupCoursewareInfo();
-
             if (courseware_info?.component_id_list.length === 0) {
             if (courseware_info?.component_id_list.length === 0) {
               this.$message.warning('请选择要保存的内容');
               this.$message.warning('请选择要保存的内容');
               return;
               return;

+ 0 - 2
src/views/project_manage/org/project/index.vue

@@ -75,8 +75,6 @@ export default {
      * @param {string} request_status 申请状态
      * @param {string} request_status 申请状态
      */
      */
     projectAuditOperate(project_id, is_pass, request_status) {
     projectAuditOperate(project_id, is_pass, request_status) {
-      console.log(request_status);
-
       this.$confirm(`确定要执行${is_pass === 'true' ? '审核通过' : '审核拒绝'}吗?`, '提示', {
       this.$confirm(`确定要执行${is_pass === 'true' ? '审核通过' : '审核拒绝'}吗?`, '提示', {
         confirmButtonText: '确定',
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         cancelButtonText: '取消',