dsy 5 дней назад
Родитель
Сommit
99f4fada32

+ 4 - 0
src/enterPage.vue

@@ -5,6 +5,7 @@
 <script>
 import { CheckBookPreviewIdentityCode } from '@/api/app';
 import { setToken, setLocalStore } from '@/utils/auth';
+import { updateBaseURL } from '@/utils/http';
 
 export default {
   name: 'EnterPage',
@@ -19,6 +20,9 @@ export default {
     };
   },
   created() {
+    if (process.env.NODE_ENV === 'production') {
+      updateBaseURL(`${window.location.origin}/`);
+    }
     this.checkIdentityCode();
   },
   methods: {

+ 3 - 2
src/mobile_preview/index.vue

@@ -2,7 +2,7 @@
   <div class="common-preview">
     <div class="common-preview__header">
       <div class="menu-container">
-        <MenuPopover :node-list="node_list" :book-name="courseware_info.book_name" @selectNode="selectNode" />
+        {{ courseware_info.book_name }}
       </div>
       <!-- <div class="courseware">
         <span class="name-path">{{ courseware_info.name_path }}</span>
@@ -29,7 +29,7 @@
       <div ref="previewMain" class="main-container">
         <main :class="['preview-main']">
           <span class="title" :style="{ backgroundColor: unified_attrib?.topic_color }">
-            <SvgIcon icon-class="menu-2" size="24" />
+            <MenuPopover :node-list="node_list" @selectNode="selectNode" />
             <span>{{ courseware_info.name_path }}</span>
           </span>
           <MobileCoursewarePreview
@@ -80,6 +80,7 @@ export default {
       getChinese: () => this.chinese,
       getLangList: () => this.langList,
       convertText: this.convertText,
+      getSelectId: () => this.select_node,
     };
   },
   data() {

+ 3 - 2
src/utils/http.js

@@ -141,7 +141,8 @@ export const http = {
 
 /**
  * 更新axios的baseURL
+ * @param {string} url 基础地址
  */
-export function updateBaseURL() {
-  service.defaults.baseURL = getLocalStore('server_address') || process.env.VUE_APP_EEP;
+export function updateBaseURL(url) {
+  service.defaults.baseURL = url || getLocalStore('server_address') || process.env.VUE_APP_EEP;
 }

+ 16 - 2
src/views/book/courseware/preview/components/matching/MatchingPreview.vue

@@ -330,7 +330,7 @@ export default {
       let svg = document.createElementNS(svgNS, 'svg');
       svg.setAttribute(
         'style',
-        `position:absolute; width: 62px; height: ${Math.max(8, height)}px; top: ${top}px; left: ${left}px;`,
+        `position:absolute; width: 74px; height: ${Math.max(8, height)}px; top: ${top}px; left: ${left}px;overflow: visible;`,
       );
       svg.classList.add('connection-line', `svg-${mark}-${curMark}`); // 添加类名
       // 向SVG元素添加 path 元素
@@ -338,6 +338,20 @@ export default {
       path.setAttribute('d', `M ${size ? 0 : width} 0 L ${size ? width : 0} ${height}`); // 设置路径数据
       this.setPathAttr(path);
       svg.appendChild(path);
+      // 在 svg 元素中的 path 元素上两端添加圆形标记
+      let circleStart = document.createElementNS(svgNS, 'circle');
+      circleStart.setAttribute('cx', size ? '0' : width); // 设置圆心的 x 坐标
+      circleStart.setAttribute('cy', '0'); // 设置圆心的 y 坐标
+      circleStart.setAttribute('r', '4'); // 设置半径
+      const assistColor = this.data?.unified_attrib?.topic_color || '#306eff';
+      circleStart.setAttribute('fill', assistColor); // 设置填充颜色
+      svg.appendChild(circleStart);
+      let circleEnd = document.createElementNS(svgNS, 'circle');
+      circleEnd.setAttribute('cx', size ? width : '0'); // 设置圆心的 x 坐标
+      circleEnd.setAttribute('cy', height); // 设置圆心的 y 坐标
+      circleEnd.setAttribute('r', '4'); // 设置半径
+      circleEnd.setAttribute('fill', assistColor); // 设置填充颜色
+      svg.appendChild(circleEnd);
       this.$refs[isShowRightAnswer ? 'answerList' : 'list'].appendChild(svg); // 将SVG元素插入到文档中
 
       // 清除当前连线点
@@ -525,7 +539,7 @@ export default {
         border-radius: 4px;
 
         &:not(:last-child, .isMobile) {
-          margin-right: 52px;
+          margin-right: 64px;
         }
 
         &.focus {

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

@@ -199,7 +199,7 @@ export default {
     .group {
       display: flex;
       flex-wrap: wrap;
-      gap: 8px;
+      gap: 16px;
 
       .drag-item {
         min-height: 40px;

+ 1 - 1
src/views/personal_workbench/common/MenuPopover.vue

@@ -19,7 +19,7 @@
         </span>
       </div>
     </div>
-    <el-button slot="reference">{{ bookName }}</el-button>
+    <div slot="reference"><SvgIcon icon-class="menu-2" size="24" /></div>
   </el-popover>
 </template>
 

+ 1 - 1
vue.config.js

@@ -35,7 +35,7 @@ module.exports = defineConfig({
   publicPath: NODE_ENV === 'development' ? '/' : './',
   outputDir: 'dist',
   assetsDir: 'static',
-  lintOnSave: NODE_ENV === 'development',
+  lintOnSave: false,
   runtimeCompiler: true,
   productionSourceMap: false,
   devServer: {