Browse Source

Merge branch 'beta' of https://git.cocorobo.cn/jack/PPT into beta

lsc 3 days ago
parent
commit
f6da1d5082

+ 6 - 4
src/hooks/useImport.ts

@@ -49,9 +49,9 @@ const getStyle = (htmlString: string) => {
   // 2. 解析 HTML 字符串为文档对象
   const doc = parser.parseFromString(htmlString, 'text/html')
   // 3. 获取 p 元素
-  const p = doc.querySelector('p')
-  // 4. 读取 style 属性(内联样式字符串)
-  const styleAttr = p?.getAttribute('allstyle')
+  const firstElem = doc.querySelector('p, ul, ol, table');
+  // 读取该元素的 allstyle 属性
+  const styleAttr = firstElem?.getAttribute('allstyle');
   console.log(styleAttr) // 输出完整的 style 字符串
   return styleAttr || ''
 
@@ -1988,7 +1988,7 @@ export default () => {
                   gradient,
                   pattern,
                   fixedRatio: false,
-                  rotate: el.rotate,
+                  rotate: 0,
                   pathBBox: el.pathBBox,
                   outline: {
                     color: el.borderColor,
@@ -2019,6 +2019,7 @@ export default () => {
                   const { maxX, maxY } = getSvgPathRange(el.path)
                   element.path = el.path
                   element.viewBox = poriginWidth ? [maxX, maxY] : [originWidth, originHeight]
+                  /*
                   if (shape.pathFormula) {
                     element.pathFormula = shape.pathFormula
                     element.viewBox = [el.width, el.height]
@@ -2032,6 +2033,7 @@ export default () => {
                       element.path = pathFormula.formula(el.width, el.height)
                     }
                   }
+                  */
                 }
                 else if (el.path && el.path.indexOf('NaN') === -1) {
                   const { maxX, maxY } = getSvgPathRange(el.path)

+ 4 - 5
src/views/Student/components/choiceQuestionDetailDialog.vue

@@ -111,7 +111,7 @@
           </div>
         </div>
 
-        <div class="aiAnalysis" style="margin-top:1rem ;" v-if="processedWorkArray.length > 0">
+        <div class="aiAnalysis" style="margin-top:1rem ;" v-if="processedWorkArray.length > 0 && lookWorkData===null && workDetail.type === '15'">
           <div class="ai_header">
             <div class="ai_title">
               <svg viewBox="0 0 1024 1024" width="200" height="200">
@@ -171,7 +171,7 @@
           </div>
         </div>
 
-        <div class="aiAnalysis" style="margin-top:1rem ;" v-show="!lookWorkData" v-if="processedWorkArray.length > 0">
+        <div class="aiAnalysis" style="margin-top:1rem ;" v-if="processedWorkArray.length > 0 && lookWorkData===null && props.showData.toolType === 72">
           <div class="ai_header">
             <div class="ai_title">
               <svg viewBox="0 0 1024 1024" width="200" height="200">
@@ -638,7 +638,7 @@ const setEchartsArea1 = () => {
           name: '',
           type: 'bar',
           data: [],
-          barWidth: '50%', // 柱体宽度缩小40%
+          barMaxWidth: 80, // 柱体最宽80px,数量多则自适应
           itemStyle: {
             color: 'rgba(252, 207, 0, 1)',
           },
@@ -1217,8 +1217,7 @@ onUnmounted(() => {
         gap: .4rem;
 
         &>div {
-          max-width: calc(100% - 200px);
-
+          max-width: calc(100%);
         }
 
         &>span {

+ 1 - 0
src/views/components/element/ShapeElement/BaseShapeElement.vue

@@ -120,6 +120,7 @@ const text = computed<ShapeText>(() => {
   height: 100%;
 }
 .element-content {
+  font-family: Kaiti, "Kaiti SC", "Kaiti TC", Roboto, "Noto Sans SC", "Noto Sans TC", "Noto Sans KR", "Noto Sans JP", "Roboto", Roboto, "Noto Sans SC", "Noto Sans TC", "Noto Sans KR", "Noto Sans JP";
   width: 100%;
   height: 100%;
   position: relative;

+ 2 - 1
src/views/components/element/ShapeElement/index.vue

@@ -21,7 +21,7 @@
         :style="{
           opacity: elementInfo.opacity,
           filter: shadowStyle ? `drop-shadow(${shadowStyle})` : '',
-          transform: flipStyle,
+          //transform: flipStyle,
           color: text.defaultColor,
           fontFamily: text.defaultFontName,
         }"
@@ -236,6 +236,7 @@ const startEdit = () => {
   height: 100%;
 }
 .element-content {
+  font-family: Kaiti, "Kaiti SC", "Kaiti TC", Roboto, "Noto Sans SC", "Noto Sans TC", "Noto Sans KR", "Noto Sans JP", "Roboto", Roboto, "Noto Sans SC", "Noto Sans TC", "Noto Sans KR", "Noto Sans JP";
   width: 100%;
   height: 100%;
   position: relative;

+ 1 - 1
src/views/components/element/TextElement/BaseTextElement.vue

@@ -79,7 +79,7 @@ const { shadowStyle } = useElementShadow(shadow)
   padding: 10px;
   line-height: 1.5;
   word-break: break-word;
-
+  font-family: Kaiti, "Kaiti SC", "Kaiti TC", Roboto, "Noto Sans SC", "Noto Sans TC", "Noto Sans KR", "Noto Sans JP", "Roboto", Roboto, "Noto Sans SC", "Noto Sans TC", "Noto Sans KR", "Noto Sans JP";
   .text {
     position: relative;
 

+ 1 - 1
src/views/components/element/TextElement/index.vue

@@ -198,7 +198,7 @@ watch(isHandleElement, () => {
   line-height: 1.5;
   word-break: break-word;
   cursor: move;
-
+  font-family: Kaiti, "Kaiti SC", "Kaiti TC", Roboto, "Noto Sans SC", "Noto Sans TC", "Noto Sans KR", "Noto Sans JP", "Roboto", Roboto, "Noto Sans SC", "Noto Sans TC", "Noto Sans KR", "Noto Sans JP";
   .text {
     position: relative;
   }