Explorar el Código

背景图优化

dsy hace 1 día
padre
commit
6e40d06982

+ 1 - 1
.env

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

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "eep_page",
-  "version": "2026.03.25",
+  "version": "2026.03.26",
   "private": true,
   "main": "main.js",
   "description": "智慧梧桐数字教材编辑器",

+ 15 - 1
src/views/book/courseware/create/components/CreateCanvas.vue

@@ -67,7 +67,7 @@
                   :border-color="computedBorderColor(row.row_id)"
                   :style="computedGridStyle(grid, row.row_id)"
                   :component-move="componentMove(i, j, k)"
-                  @deleteComponent="deleteComponent"
+                  @deleteComponent="deleteComponentConfirm"
                   @showSetting="showSetting"
                   @copyComponent="copyComponent"
                   @changeData="changeData"
@@ -759,6 +759,20 @@ export default {
       });
       col.grid_template_columns = grid_template_columns;
     },
+    async deleteComponentConfirm(id) {
+      try {
+        await this.$confirm('确定要删除该组件吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        });
+        this.deleteComponent(id);
+      } catch (err) {
+        if (err === 'cancel') {
+          this.$message.info('已取消删除');
+        }
+      }
+    },
     /**
      * 删除组件
      * @param {String} id 组件 id

+ 1 - 1
src/views/book/courseware/create/components/PreviewEdit.vue

@@ -36,7 +36,7 @@
                 :style="{
                   gridArea: 'preview',
                   height: grid.height,
-                  overflow: 'hidden',
+                  overflow: 'auto',
                 }"
               />
             </div>

+ 3 - 1
src/views/book/courseware/create/components/SetBackground.vue

@@ -639,7 +639,7 @@ export default {
         .then(({ file_info_list }) => {
           this.$refs.upload.clearFiles();
           if (file_info_list.length > 0) {
-            const fileUrl = file_info_list[0].file_url;
+            const fileUrl = file_info_list[0].file_url_open;
             const img = new Image();
             img.src = fileUrl;
             img.onload = () => {
@@ -688,6 +688,8 @@ export default {
           height: (this.imgData.height / this.maxHeight) * 100,
           top: (this.imgData.top / this.maxHeight) * 100,
           left: (this.imgData.left / this.maxWidth) * 100,
+          imgX: (this.imgData.left / (this.maxWidth - this.imgData.width)) * 100,
+          imgY: (this.imgData.top / (this.maxHeight - this.imgData.height)) * 100,
         },
         this.background,
       );

+ 19 - 2
src/views/book/courseware/create/components/question/input/InputSetting.vue

@@ -93,12 +93,29 @@ export default {
   },
   computed: {
     filterFontList() {
-      if (this.property.font === fontList[0].value) {
-        return this.fontList.filter(({ isPinyin }) => isPinyin);
+      if (this.property.model === modelList[0].value) {
+        return this.fontList.filter(({ type }) => type === modelList[0].value);
+      }
+      if (this.property.model === modelList[1].value) {
+        return this.fontList.filter(({ type }) => type === modelList[1].value);
+      }
+      if (this.property.model === modelList[2].value) {
+        return this.fontList.filter(({ type }) => type === modelList[2].value);
       }
       return this.fontList;
     },
   },
+  watch: {
+    'property.model'(newVal) {
+      if (newVal === modelList[0].value) {
+        this.property.font = fontList.find(({ type }) => type === modelList[0].value).value;
+      } else if (newVal === modelList[1].value) {
+        this.property.font = fontList.find(({ type }) => type === modelList[1].value).value;
+      } else if (newVal === modelList[2].value) {
+        this.property.font = fontList.find(({ type }) => type === modelList[2].value).value;
+      }
+    },
+  },
   methods: {},
 };
 </script>

+ 9 - 9
src/views/book/courseware/data/input.js

@@ -35,27 +35,27 @@ export const fontList = [
   {
     value: 'arial, helvetica, sans-serif',
     label: 'Arial',
-    isPinyin: false,
+    type: 'english',
   },
   {
     value: 'League',
-    label: '拼音=League',
-    isPinyin: true,
+    label: '拼音',
+    type: 'pinyin',
   },
   {
     value: '楷体,微软雅黑',
-    label: '楷体=楷体,微软雅黑',
-    isPinyin: false,
+    label: '楷体',
+    type: 'chinese',
   },
   {
     value: '黑体,微软雅黑',
-    label: '黑体=黑体,微软雅黑;',
-    isPinyin: false,
+    label: '黑体',
+    type: 'chinese',
   },
   {
     value: '宋体,微软雅黑',
-    label: '宋体=宋体,微软雅黑;',
-    isPinyin: false,
+    label: '宋体',
+    type: 'chinese',
   },
 ];
 

+ 5 - 0
src/views/book/courseware/preview/CoursewarePreview.vue

@@ -559,6 +559,7 @@ export default {
         if (back.imageMode === 'fill') {
           canvasStyle['backgroundRepeat'] = 'repeat';
           canvasStyle['backgroundSize'] = '';
+          canvasStyle['backgroundPosition'] = '';
         } else {
           canvasStyle['backgroundRepeat'] = 'no-repeat';
         }
@@ -571,6 +572,10 @@ export default {
           canvasStyle['backgroundSize'] = 'contain';
         }
 
+        if (back.imageMode === 'auto') {
+          canvasStyle['backgroundPosition'] = `${pos.imgX}% ${pos.imgY}%`;
+        }
+
         if (back.mode === 'color') {
           canvasStyle['backgroundColor'] = back.color;
           canvasStyle['backgroundImage'] = '';

+ 0 - 1
src/views/book/courseware/preview/components/voice_matrix/VoiceMatrixPreview.vue

@@ -666,7 +666,6 @@ $border-color: #e6e6e6;
     .voice-matrix-container {
       font-size: 16px;
       word-break: break-word;
-      background-color: #f5f5f5;
       border-right: 1px solid $border-color;
       border-bottom: 1px solid $border-color;
       border-left: 1px solid $border-color;