|
@@ -79,7 +79,21 @@
|
|
|
</span>
|
|
|
</ToolItem>
|
|
|
<!-- 文本行高 暂定-->
|
|
|
- <!-- 文本对齐 暂定-->
|
|
|
+ <!-- 文本对齐 -->
|
|
|
+ <ToolItem tooltip="文本对齐" toolkey="textAligh">
|
|
|
+ <el-dropdown @command="changeTextStyle" trigger="click" class="tool-item">
|
|
|
+ <span class="el-dropdown-link tool-item">
|
|
|
+ <img :src="require(`@/assets/icons/chartFrame/textAlign.svg`)"
|
|
|
+ :class="{'img-disabled':!isSelectNode,'actived':isSelectNode}">
|
|
|
+ <i class="el-icon-caret-bottom"></i>
|
|
|
+ </span>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item v-for="item in textAnchorOptions"
|
|
|
+ :key="item.label" :command="{attr:'label/textAligh',value:item.options}">{{item.label}}</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ <span class="disabled" v-if="!isSelectNode"></span>
|
|
|
+ </el-dropdown>
|
|
|
+ </ToolItem>
|
|
|
<!-- 节点颜色填充 -->
|
|
|
<ToolItem tooltip="填充颜色" toolkey="fillColor">
|
|
|
<span class="tool-item">
|
|
@@ -186,7 +200,7 @@
|
|
|
<script>
|
|
|
import '@/assets/icons/iconfont.css';
|
|
|
import ToolItem from './toolItem.vue';
|
|
|
-import {sizeOptions,stokeWidthOptions} from '../common/config';
|
|
|
+import {sizeOptions,stokeWidthOptions,lineHeightOptions,textAnchorOptions} from '../common/config';
|
|
|
export default {
|
|
|
components: { ToolItem },
|
|
|
props:{
|
|
@@ -214,6 +228,8 @@ export default {
|
|
|
data() {
|
|
|
this.sizeOptions=sizeOptions
|
|
|
this.stokeWidthOptions=stokeWidthOptions
|
|
|
+ this.lineHeightOptions=lineHeightOptions
|
|
|
+ this.textAnchorOptions=textAnchorOptions
|
|
|
return {
|
|
|
nodeStyle:{ //回显用的
|
|
|
fontSize:14,
|
|
@@ -303,6 +319,11 @@ export default {
|
|
|
changeCellStyle({attr,value}){
|
|
|
this.valueChange({target:{id:attr,value}})
|
|
|
},
|
|
|
+ changeTextStyle({attr,value}){
|
|
|
+ for(const key in value){
|
|
|
+ this.currentCell.attr('label/'+key,value[key])
|
|
|
+ }
|
|
|
+ },
|
|
|
//撤销/恢复
|
|
|
handleGraphHistory(type){
|
|
|
this.graph.history[type]()
|