|
@@ -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;
|