zydx-plus 1.33.325 → 1.33.327

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zydx-plus",
3
- "version": "1.33.325",
3
+ "version": "1.33.327",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -24,7 +24,7 @@
24
24
  "pdfjs-dist": "^2.0.943",
25
25
  "snabbdom": "^3.5.1",
26
26
  "katex": "^0.15.6",
27
- "simple-mind-map": "^0.6.14",
27
+ "simple-mind-map": "^0.9.6",
28
28
  "html2json": "^1.0.2",
29
29
  "@tiptap/extension-image": "^2.0.3",
30
30
  "@tiptap/starter-kit": "^2.0.3",
@@ -385,11 +385,13 @@ export default {
385
385
  const y2 = this.points[i+1]?this.points[i+1].y*this.scales/this.points[i].scale:0
386
386
  const x3 = obj.x
387
387
  const y3 = obj.y
388
- const a = Math.abs((x1-x2)*(y1-y3)-(x1-x3)*(y1-y2))
389
- const b = Math.sqrt(Math.pow(x1-x2,2)+Math.pow(y1-y2,2))
388
+ // const a = Math.abs((x1-x2)*(y1-y3)-(x1-x3)*(y1-y2))
389
+ // const b = Math.sqrt(Math.pow(x1-x2,2)+Math.pow(y1-y2,2))
390
390
  const c = Math.sqrt(Math.pow(x1-x3,2)+Math.pow(y1-y3,2))
391
391
  const d = Math.sqrt(Math.pow(x2-x3,2)+Math.pow(y2-y3,2))
392
- if(a/b <= 5 && c <= b && d <= b) {
392
+ const scope = this.lineWidth/2+15
393
+ // if(a/b <= 5 && c <= b && d <= b) {
394
+ if(c<scope&&d<scope&&this.points[i].id===this.points[i+1].id) {
393
395
  const id = this.points[i].id
394
396
  for(let j=0; j<this.points.length; j++) {
395
397
  if(this.points[j].id === id) {
@@ -399,6 +401,7 @@ export default {
399
401
  j--
400
402
  }
401
403
  }
404
+ return
402
405
  }
403
406
  }
404
407
  // 判断点击的是否是箭头
@@ -993,7 +996,6 @@ export default {
993
996
  }
994
997
  },
995
998
  flipRight(e, v) {
996
- console.log(e)
997
999
  if (e < 1) {
998
1000
  this.pageIndex = 1
999
1001
  return
@@ -1046,16 +1048,16 @@ export default {
1046
1048
  canvas.height = hei * that.sratio
1047
1049
  canvas.style.width = wid + 'px'
1048
1050
  canvas.style.height = hei + 'px'
1049
- canvas2.width = viewport.width * that.sratio
1050
- canvas2.height = viewport.height * that.sratio
1051
+ canvas2.width = wid * that.sratio
1052
+ canvas2.height = hei * that.sratio
1051
1053
  canvas2.style.width = wid + 'px'
1052
1054
  canvas2.style.height = hei + 'px'
1053
1055
  that.canvasStyle = {
1054
- width: viewport.width + 'px',
1055
- height: viewport.height + 'px',
1056
- marginLeft: -(viewport.width / 2) + 'px',
1057
- widthCanvas: viewport.width * that.sratio,
1058
- heightCanvas: viewport.height * that.sratio
1056
+ width: wid + 'px',
1057
+ height: hei + 'px',
1058
+ marginLeft: -(wid / 2) + 'px',
1059
+ widthCanvas: wid * that.sratio,
1060
+ heightCanvas: hei * that.sratio
1059
1061
  }
1060
1062
  let renderContext = {
1061
1063
  canvasContext: ctx2,
@@ -0,0 +1,192 @@
1
+ <template>
2
+ <div class="padding20">
3
+ <div class="fontSize20 height30 lineHeight30">代码示例:</div>
4
+ <div style="border: 1px solid #cccccc; padding: 30px;height: 1500px">
5
+ <zydx-mind :data="datas" :readOnly="readOnly"></zydx-mind>
6
+ </div>
7
+ <div>
8
+ <div>
9
+ <div class="fontSize20 height30 lineHeight30">代码片段:</div>
10
+ <pre class="language-xml" v-html="content"></pre>
11
+ </div>
12
+ </div>
13
+ <div class="margin30_0">
14
+ <div>
15
+ <div class="fontSize20 height30 lineHeight30">参数说明:</div>
16
+ <div>
17
+ <el-table
18
+ :data="paramTableData"
19
+ border
20
+ style="width: 100%">
21
+ <el-table-column
22
+ prop="field_key"
23
+ label="参数字段"
24
+ width="180">
25
+ </el-table-column>
26
+ <el-table-column
27
+ prop="field_title"
28
+ label="参数名称"
29
+ width="180">
30
+ </el-table-column>
31
+ <el-table-column
32
+ prop="field_value"
33
+ label="示例值">
34
+ </el-table-column>
35
+ <el-table-column
36
+ prop="field_type"
37
+ label="类型"
38
+ width="100">
39
+ </el-table-column>
40
+ <el-table-column
41
+ prop="field_default"
42
+ label="默认值"
43
+ width="80">
44
+ </el-table-column>
45
+ <el-table-column
46
+ prop="field_remarks"
47
+ label="备注">
48
+ </el-table-column>
49
+ </el-table>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ <div class="margin30_0">
54
+ <div class="fontSize20 height30 lineHeight30">回调说明:</div>
55
+ <div>
56
+ <el-table
57
+ :data="methodTableData"
58
+ border
59
+ style="width: 100%">
60
+ <el-table-column
61
+ prop="method_key"
62
+ label="回调方法"
63
+ width="180">
64
+ </el-table-column>
65
+ <el-table-column
66
+ prop="method_title"
67
+ label="回调名称"
68
+ width="180">
69
+ </el-table-column>
70
+ <el-table-column
71
+ prop="method_describe"
72
+ label="回调说明"
73
+ width="360">
74
+ </el-table-column>
75
+ <el-table-column
76
+ prop="method_remarks"
77
+ label="备注">
78
+ </el-table-column>
79
+ </el-table>
80
+ </div>
81
+ </div>
82
+ </div>
83
+ </template>
84
+
85
+ <script>
86
+ import zydxMind from "../../components/mind/src/mind.vue";
87
+ export default {
88
+ name: "flip",
89
+ components: {zydxMind},
90
+ mounted() {
91
+ /**
92
+ * 转换高亮显示代码 代码片段用的
93
+ */
94
+ const htmlContent = this.$Prism.highlight(this.content, this.$Prism.languages.xml, 'xml');
95
+ this.content = htmlContent
96
+ setTimeout(() => {
97
+ this.datas2 = {}
98
+ this.datas = {
99
+ "data": {
100
+ "text": "根节点"
101
+ },
102
+ "children": [
103
+ {
104
+ data: {
105
+ expand: true,
106
+ isActive: false,
107
+ richText: undefined,
108
+ text: "二级节点",
109
+ uid: 2
110
+ },
111
+ children: []
112
+ },
113
+ {
114
+ data: {
115
+ expand: true,
116
+ isActive: false,
117
+ richText: undefined,
118
+ text: "二级节点",
119
+ uid: 3
120
+ },
121
+ children: []
122
+ }
123
+ ]
124
+ }
125
+ },2000)
126
+ },
127
+ data() {
128
+ return {
129
+ readOnly: false,
130
+ datas: {
131
+
132
+ },
133
+ // 模拟数据
134
+ content:`<zydx-mind :data="data"></zydx-mind>`,
135
+ // 参数说明
136
+ paramTableData: [{
137
+ field_key: 'data',
138
+ field_title: '数据',
139
+ field_value: `{
140
+ "data": {
141
+ "text": "根节点"
142
+ },
143
+ "children": []
144
+ }`,
145
+ field_type: 'String',
146
+ field_default: '',
147
+ field_remarks: ''
148
+ },{
149
+ field_key: 'readOnly',
150
+ field_title: '是否只读',
151
+ field_value: ``,
152
+ field_type: 'Boolean',
153
+ field_default: 'false',
154
+ field_remarks: ''
155
+ },{
156
+ field_key: 'protectShow',
157
+ field_title: '是否显示保存按钮',
158
+ field_value: ``,
159
+ field_type: 'Boolean',
160
+ field_default: 'true',
161
+ field_remarks: ''
162
+ }],
163
+ methodTableData: [{
164
+ method_key: '@preservation',
165
+ method_title: '保存回调',
166
+ method_describe: '',
167
+ method_remarks: ''
168
+ },{
169
+ method_key: '@dataChange',
170
+ method_title: '实时获取数据',
171
+ method_describe: '',
172
+ method_remarks: ''
173
+ },{
174
+ method_key: 'this.$refs.mind.getContent().then(r => {})',
175
+ method_title: '保存回调',
176
+ method_describe: '',
177
+ method_remarks: ''
178
+ }],
179
+ }
180
+ },
181
+ methods: {
182
+ wan(){
183
+ this.readOnly = !this.readOnly
184
+ }
185
+ }
186
+ }
187
+ </script>
188
+
189
+ <style scoped>
190
+
191
+ </style>
192
+
@@ -114,6 +114,8 @@
114
114
  import Select from '../../select/src/select.vue'
115
115
  import Coloring from '../../coloring/src/coloring.vue'
116
116
  import MindMap from "simple-mind-map";
117
+ import AssociativeLine from 'simple-mind-map/src/plugins/AssociativeLine.js'
118
+ MindMap.usePlugin(AssociativeLine)
117
119
 
118
120
  export default {
119
121
  components: {Select, Coloring},
package/src/index.js CHANGED
@@ -81,7 +81,7 @@ function install(app) {
81
81
  }
82
82
 
83
83
  export default {
84
- version: '1.33.325',
84
+ version: '1.33.327',
85
85
  install,
86
86
  Calendar,
87
87
  Message,