|
|
@@ -4,9 +4,16 @@
|
|
|
|
|
|
<script>
|
|
|
import Konva from "konva";
|
|
|
+import {mapGetters} from 'vuex'
|
|
|
|
|
|
export default {
|
|
|
name: "KonvaExample",
|
|
|
+ props: {
|
|
|
+ points: {
|
|
|
+ type: Object,
|
|
|
+ default: null
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
stage: null,
|
|
|
@@ -19,6 +26,8 @@ export default {
|
|
|
redtexts:[],//白色text合集
|
|
|
};
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
mounted() {
|
|
|
this.initKonva();
|
|
|
},
|
|
|
@@ -100,27 +109,31 @@ export default {
|
|
|
this.redtexts = {};
|
|
|
this.selectedText = [];
|
|
|
|
|
|
- const positions = [
|
|
|
- { row: 2, col: 9 }, // E-1
|
|
|
- { row: 2, col: 11 }, // E-2
|
|
|
- { row: 2, col: 13 }, // E-3
|
|
|
- { row: 4, col: 9 }, // E-4
|
|
|
- { row: 4, col: 11 }, // E-5
|
|
|
- { row: 4, col: 13 }, // E-6
|
|
|
- { row: 6, col: 9 }, // E-7
|
|
|
- { row: 6, col: 11 }, // E-8
|
|
|
- { row: 6, col: 13 }, // E-9
|
|
|
- { row: 8, col: 9 }, // E-10
|
|
|
- { row: 8, col: 11 }, // E-11
|
|
|
- { row: 8, col: 13 }, // E-12
|
|
|
- { row: 10, col: 9 }, // E-13
|
|
|
- { row: 10, col: 11 }, // E-14
|
|
|
- { row: 10, col: 13 }, // E-15
|
|
|
- { row: 12, col: 9 }, // E-16
|
|
|
- { row: 12, col: 11 }, // E-17
|
|
|
- { row: 12, col: 13 }, // E-18
|
|
|
- ];
|
|
|
-
|
|
|
+ const positions=JSON.parse(this.points.map)
|
|
|
+ console.log(positions,'this.points')
|
|
|
+ // const positions = [
|
|
|
+ // { row: 2, col: 9 },
|
|
|
+ // { row: 2, col: 11 },
|
|
|
+ // { row: 2, col: 13 },
|
|
|
+ // { row: 4, col: 9 },
|
|
|
+ // { row: 4, col: 11 },
|
|
|
+ // { row: 4, col: 13 },
|
|
|
+ // { row: 6, col: 9 },
|
|
|
+ // { row: 6, col: 11 },
|
|
|
+ // { row: 6, col: 13 },
|
|
|
+ // { row: 8, col: 9 },
|
|
|
+ // { row: 8, col: 11 },
|
|
|
+ // { row: 8, col: 13 },
|
|
|
+ // { row: 10, col: 9 },
|
|
|
+ // { row: 10, col: 11 },
|
|
|
+ // { row: 10, col: 13 },
|
|
|
+ // { row: 12, col: 9 },
|
|
|
+ // { row: 12, col: 11 },
|
|
|
+ // { row: 12, col: 13 },
|
|
|
+ // ];
|
|
|
+ // const positionsJson = JSON.stringify(positions);
|
|
|
+
|
|
|
+ // console.log(positionsJson,'json');
|
|
|
positions.forEach((pos, index) => {
|
|
|
const x = pos.col * 50; // 每个单元格宽度为50
|
|
|
const y = pos.row * 50; // 每个单元格高度为50
|