Browse Source

编辑图例

YaolongHan 4 years ago
parent
commit
92e2b5080d

+ 13 - 17
docs/.vuepress/components/edit/items/edittext/edittext.vue

@@ -2,16 +2,11 @@
   <div class="edit-line">
     <!-- 所有按钮 -->
     <div class="btn-list">
-      <textarea ref="aaa" autofocus class="text"></textarea>
-      <!-- <el-button @click="create">创建文本</el-button>
-      <el-button @click="undo">删除文本</el-button>
-      <el-button @click="undo">Undo</el-button>
-      <el-button @click="redo">Redo</el-button>
-      <el-button @click="reset">Reset</el-button>-->
     </div>
     <div class="content">
-      <div class="left">
-        <canvas @click="onMouseUp" id="edit_polygon" width="700" height="460" tabindex="0" />
+      <div class="left" id="left">
+        <!-- <textarea name="" class="text" cols="30" rows="10"></textarea> -->
+        <canvas id="edit_polygon" width="700" height="460" tabindex="0" />
       </div>
       <div class="line-property">
         <el-card shadow="always">
@@ -35,7 +30,7 @@
           </div>
           <div class="always-item">
             <span>线颜色:</span>
-            <el-color-picker v-model="lineColor" @change="changeColor" show-alpha></el-color-picker>
+            <el-color-picker v-model="color" @change="changeColor" show-alpha></el-color-picker>
           </div>
         </el-card>
       </div>
@@ -139,7 +134,7 @@ export default {
     handleChangeColor(color) {
       this.scene.updateColor(color);
     },
-    handleChangeSize(size) {
+    updateSize(size) {
       this.scene.updateSize(size);
     },
     undo() {
@@ -160,6 +155,8 @@ export default {
     changeColor(val) {
       this.scene.updateColor(hexify(val));
     },
+    ///////////////////////////////////
+    //// 以下为测试代码,请忽略
     // 设置tooltip位置
     /**
      * raduis 灵敏范围
@@ -251,9 +248,12 @@ export default {
       };
     },
     onMouseUp(event) {
-      const dom = this.$refs.aaa;
-      console.log('eventevent',event)
-      this.toolTipPosition(1, event, dom, 0);
+      const dom = "<textarea autofocus ref='textarea' class='text'></textarea>";
+      let parentDom = document.getElementById("left");
+      parentDom.innerHTML = parentDom.innerHTML + dom;
+      const textareaDom = this.$refs.textarea;
+      // console.log('textareaDom',parentDom.children[0])
+      this.toolTipPosition(1, event, textareaDom, 0);
     }
   },
   watch: {
@@ -266,10 +266,6 @@ export default {
 
 <style scoped lang="less">
 .text {
-  // border: 0px;
-  max-height: 300px;
-  max-height: 100px;
-  min-width: 20px; /*自动适应父布局宽度*/
   overflow: auto;
   word-break: break-all;
   outline: none;

+ 4 - 0
docs/guides/edit/items/editArrowLine.md

@@ -0,0 +1,4 @@
+# 图编辑类 XXX 示例
+::: details 目录
+[[toc]]
+:::

+ 4 - 0
docs/guides/edit/items/editArrowPolyline.md

@@ -0,0 +1,4 @@
+# 图编辑类 XXX 示例
+::: details 目录
+[[toc]]
+:::

+ 1 - 0
docs/guides/edit/items/editCircle.md

@@ -0,0 +1 @@
+# 图编辑类 XXX 示例

+ 4 - 0
docs/guides/edit/items/editEllipse.md

@@ -0,0 +1,4 @@
+# 图编辑类 XXX 示例
+::: details 目录
+[[toc]]
+:::

+ 4 - 0
docs/guides/edit/items/editRect.md

@@ -0,0 +1,4 @@
+# 图编辑类 XXX 示例
+::: details 目录
+[[toc]]
+:::

+ 4 - 0
docs/guides/edit/items/editTriangle.md

@@ -0,0 +1,4 @@
+# 图编辑类 XXX 示例
+::: details 目录
+[[toc]]
+:::

+ 1 - 1
docs/guides/edit/items/src/EditText.ts

@@ -7,7 +7,7 @@ import { STextOrigin } from "@persagy-web/graph/";
 /**
  * 文本item
  *
- * @author  张宇(taohuzy@163.com)
+ * @author  韩耀龙(han_yao_long@163.com)
  */
 export class EditText extends SObjectItem {
     /** 记录painter */

+ 6 - 0
docs/guides/index.js

@@ -83,6 +83,12 @@ const content = [
                     ["/guides/edit/items/editPolyline", "编辑折线"],
                     ["/guides/edit/items/editImage", "编辑图片"],
                     ["/guides/edit/items/editText", "编辑文字"],
+                    ["/guides/edit/items/editCircle", "编辑圆"],
+                    ["/guides/edit/items/editRect", "编辑矩形"],
+                    ["/guides/edit/items/editEllipse", "编辑椭圆"],
+                    ["/guides/edit/items/editArrowLine", "编辑带箭头直线"],
+                    ["/guides/edit/items/editArrowPolyline", "编辑带箭头折线"],
+                    ["/guides/edit/items/editTriangle", "编辑三角形"]
                 ]
             },
             ["/guides/edit/undo/undo", "Undo示例"],