YaolongHan 4 年之前
父节点
当前提交
4cb8cbf481

+ 2 - 2
src/components/editClass/big-edit/items/SBaseTextEdit.ts

@@ -97,8 +97,8 @@ export class SBaseTextEdit extends STextEdit {
         this.data.Style.Default.Zorder = this.zOrder;
         this.data.Style.Default.Text = this.text;
         this.data.Style.Default.Color = this.color.value;
-        this.data.Style.Default.Font = this.font.size
-        this.data.Style.Default.BackgroundColor = this.backgroundColor
+        this.data.Style.Default.Font = this.font.size;
+        this.data.Style.Default.BackgroundColor = this.backgroundColor.value;
         return this.data
     }
 }

+ 4 - 4
src/components/editview/baseTopoEditer.vue

@@ -123,10 +123,10 @@ export default {
             ],
           },
         };
-        // Object.assign(obj, {
-        //   GraphId: "6500f7d6db5a40d4be4313ea654b1373",
-        //   Id: "d6c1926ee74b438d87c6b06fec9806c6",
-        // });
+        Object.assign(obj, {
+          GraphId: "cd8ca79c337644d48c58c447cf21b757",
+          Id: "f15506fa5dcc4ce79064e459e5497748",
+        });
         console.log(obj);
         saveGroup(obj).then((res) => {
           console.log("res", res);

+ 11 - 2
src/components/editview/rightPropertyBar/baseTextPro.vue

@@ -15,7 +15,7 @@
           <div class="line-width">
             <el-input-number
               style="width:80px"
-              v-model="linewidth"
+              v-model="fontSize"
               controls-position="right"
               @change="changeFontSize"
               size="mini"
@@ -38,13 +38,22 @@
           </div>
         </div>
       </li>
+      <li>
+        <el-input
+          type="textarea"
+          @input="changeText"
+          :autosize="{ minRows: 2, maxRows: 4}"
+          v-model="text"
+        ></el-input>
+        <span>文本</span>
+      </li>
     </ul>
   </div>
 </template>
 <script>
 import bus from "@/bus/bus";
 export default {
-  props: ["strokeColor", "lineStyle", "lineWidth"],
+  props: ["strokeColor", "fontSize", "backgroundColor", "textMsg"],
   data() {
     return {
       size: 0, //font-size

+ 6 - 4
src/components/editview/rightPropertyBar/property.vue

@@ -14,13 +14,13 @@
       :lineStyle="lineStyle"
       :lineWidth="lineWidth"
     ></baseLinePro>
-    <BaseExplainPro
+    <!-- <BaseExplainPro
       :strokeColor="strokeColor"
       :fontSize="fontSize"
       :text="text"
       :backgroundColor="backgroundColor"
       v-show="itemType == 'BaseExplain'"
-    ></BaseExplainPro>
+    ></BaseExplainPro>-->
     <BaseImagePro v-show="itemType == 'BaseImage'"></BaseImagePro>
   </div>
 </template>
@@ -47,7 +47,8 @@ export default {
       lineStyle: "solid", //线条样式
       lineWidth: 1, //线宽
       fontSize: 12, //字体大小
-      textMsg: "",
+      textMsg: "", // 文本
+      backgroundColor: "", // 背景色
     };
   },
   mounted() {
@@ -72,9 +73,10 @@ export default {
         this.strokeColor = item.strokeColor.toRgba();
         this.lineStyle = lineStyle[item.lineStyle];
         this.lineWidth = item.lineWidth;
-      } else if (this.itemType == "baseText") {
+      } else if (this.itemType == "BaseText") {
         this.strokeColor = item.strokeColor.toRgba();
         this.backgroundColor = item.backgroundColor.toRgba();
+        console.log("text", item.font.size);
         this.textMsg = item.text;
         this.fontSize = item.font.size;
       }