fujunling
2023-06-15 bf241556867635a57f5849ba19cd0135e90e8e81
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<template>
  <toolbar class="toolbar">
    <template>
      <toolbar-button command="undo" text="撤销" />
      <toolbar-button command="redo" text="重做" />
      <toolbar-button command="copy" text="复制" />
      <toolbar-button command="paste" text="粘贴" />
      <div class="split"></div>
    </template>
    <toolbar-button command="zoomIn" icon="zoom-in" text="放大" />
    <toolbar-button command="zoomOut" icon="zoom-out" text="缩小" />
    <toolbar-button command="autoZoom" icon="fit" text="自适应" />
    <toolbar-button command="resetZoom" icon="actual-size" text="实际尺寸" />
    <template>
      <div class="split"></div>
      <!-- <toolbar-button command="toBack" icon="to-back" text="向下一层" /> -->
      <!-- <toolbar-button command="toFront" icon="to-front" text="向上一层" /> -->
      <!-- <toolbar-button command="addGroup" icon="group" text="编组" /> -->
      <!-- <toolbar-button command="unGroup" icon="ungroup" text="取消编组" /> -->
      <toolbar-button command="selectAll" icon="select-all" text="全选" />
      <toolbar-button command="multiSelect" icon="select" text="框选" />
      <div class="split"></div>
      <toolbar-button command="delete" text="删除"/>
      <toolbar-button command="clear" icon="clear" text="清空画布" />
    </template>
    <template>
      <div class="split"></div>
      <toolbar-button
        command="downloadImage"
        icon="image"
        text="下载图像"
      />
    </template>
    <!-- right toolbar button -->
    <!-- <div class="pull-right">
      <toolbar-button
        command="generateData"
        icon="save"
        text="生成数据"
        label="保存数据"
      />
    </div> -->
  </toolbar>
</template>
 
<script>
import { Toolbar } from 'vue-flowchart-editor'
import ToolbarButton from './ToolbarButton'
 
export default {
  name: 'FlowToolbar',
 
  components: {
    Toolbar,
    ToolbarButton,
  },
 
  props: ['chartData', 'toggleReadOnly'],
 
  methods: {
  },
}
</script>
 
<style lang="scss" scoped>
.toolbar {
  display: flex;
  align-items: center;
  height: 27px;
 
  .split {
    width: 10px;
    height: 100%;
    border-right: 1px solid #eee;
    margin-right: 10px;
  }
 
  .pull-right {
    display: flex;
    align-items: center;
    margin-left: auto;
  }
 
  .command {
    margin-right: 15px;
    display: flex;
    color: #333;
 
    i {
      display: block;
      width: 27px;
      height: 27px;
      margin: 0 6px;
      padding-top: 10px;
      text-align: center;
      border: 1px solid #fff;
      cursor: pointer;
    }
 
    span {
      display: block;
      font-size: 12px;
      padding-top: 10px;
      margin-left: -6px;
      padding-right: 6px;
      line-height: 20px;
      cursor: pointer;
    }
 
    &:hover {
      color: #1890ff;
    }
  }
 
  .disable {
    color: rgba(0, 0, 0, 0.25);
    i {
      cursor: not-allowed;
    }
 
    span {
      cursor: not-allowed;
    }
 
    &:hover {
      color: rgba(0, 0, 0, 0.25);
    }
  }
}
</style>