@abi-software/scaffoldvuer 1.2.1-beta.0 → 1.3.0-beta.0

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.
@@ -12,7 +12,7 @@
12
12
  :zincObject="zincObject"
13
13
  ref="opacityControls" />
14
14
  </el-collapse-item>
15
- <el-collapse-item title="Transformation" name="trControls">
15
+ <el-collapse-item v-show="!isEditable" title="Transformation" name="trControls">
16
16
  <transformation-controls
17
17
  class="transformation-controls"
18
18
  ref="transformationControls" />
@@ -25,13 +25,17 @@
25
25
  <el-collapse-item v-show="isPointset" title="Points" name="pControls">
26
26
  <points-controls
27
27
  class="pointset-controls"
28
- ref="pointsetControls" />
28
+ ref="pointsetControls"
29
+ @primitivesUpdated="$emit('primitivesUpdated', $event)"
30
+ />
29
31
  </el-collapse-item>
30
32
  <el-collapse-item v-show="isLines" title="Lines" name="lControls">
31
33
  <lines-controls
32
34
  class="lines-controls"
33
35
  ref="linesControls"
34
- :createData="createData" />
36
+ :createData="createData"
37
+ @primitivesUpdated="$emit('primitivesUpdated', $event)"
38
+ />
35
39
  </el-collapse-item>
36
40
  </el-collapse>
37
41
  </div>
@@ -91,6 +95,7 @@ export default {
91
95
  isLines: false,
92
96
  drawerOpen: true,
93
97
  zincObject: undefined,
98
+ isEditable: false,
94
99
  };
95
100
  },
96
101
  methods: {
@@ -107,10 +112,11 @@ export default {
107
112
  } else {
108
113
  this.zincObject = undefined;
109
114
  }
115
+ this.isEditable = this.zincObject?.isEditable ? true : false;
110
116
  this.isPointset = false;
111
117
  this.isTextureSlides = false;
112
118
  this.isLines = false;
113
- this.activeName = "oControls";
119
+ this.activeName = "trControls";
114
120
  if (object) {
115
121
  if (object.isTextureSlides) {
116
122
  this.isTextureSlides = true;
@@ -19,7 +19,7 @@
19
19
  :createData="createData"
20
20
  @confirm-create="$emit('confirm-create', $event)"
21
21
  @cancel-create="$emit('cancel-create')"
22
- />
22
+ />
23
23
  <Tooltip
24
24
  class="p-tooltip"
25
25
  v-show="annotationDisplay && !createData.toBeConfirmed"
@@ -27,14 +27,45 @@
27
27
  :annotationDisplay="true"
28
28
  :annotationEntry="annotationEntry"
29
29
  />
30
+ <div v-if="createData.toBeDeleted" class="delete-container">
31
+ <el-row>
32
+ <el-col :span="10">Delete this feature?</el-col>
33
+ <el-col :span="7">
34
+ <el-button
35
+ class="delete-button"
36
+ :icon="ElIconDelete"
37
+ @click="$emit('confirm-delete')"
38
+ >
39
+ Delete
40
+ </el-button>
41
+ </el-col>
42
+ <el-col :span="6">
43
+ <el-button
44
+ class="delete-button"
45
+ @click="$emit('cancel-create')"
46
+ >
47
+ Dismiss
48
+ </el-button>
49
+ </el-col>
50
+ </el-row>
51
+ </div>
30
52
  </template>
31
53
  </el-popover>
32
54
  </div>
33
55
  </template>
34
56
 
35
57
  <script>
58
+ import { shallowRef } from 'vue';
36
59
  /* eslint-disable no-alert, no-console */
37
- import { ElPopover as Popover } from "element-plus";
60
+ import {
61
+ ElCol as Col,
62
+ ElIcon as Icon,
63
+ ElPopover as Popover,
64
+ ElRow as Row,
65
+ } from "element-plus";
66
+ import {
67
+ Delete as ElIconDelete,
68
+ } from '@element-plus/icons-vue'
38
69
  import CreateTooltiipContent from "./CreateTooltipContent.vue";
39
70
  import { mapState } from 'pinia';
40
71
  import { useMainStore } from "@/store/index";
@@ -47,8 +78,12 @@ import '@abi-software/map-utilities/dist/style.css'
47
78
  export default {
48
79
  name: "ScaffoldTooltip",
49
80
  components: {
81
+ Col,
50
82
  CreateTooltiipContent,
83
+ ElIconDelete,
84
+ Icon,
51
85
  Popover,
86
+ Row,
52
87
  Tooltip,
53
88
  },
54
89
  props: {
@@ -96,7 +131,8 @@ export default {
96
131
  data: function () {
97
132
  return {
98
133
  display: false,
99
- annotationEntry: { }
134
+ annotationEntry: { },
135
+ ElIconDelete: shallowRef(ElIconDelete),
100
136
  };
101
137
  },
102
138
  computed: {
@@ -206,5 +242,23 @@ export default {
206
242
  display:none;
207
243
  }
208
244
  }
245
+
246
+ .delete-container {
247
+ margin-top: 12px;
248
+ margin-bottom: 12px;
249
+ font-size: 14px;
250
+ .delete-button {
251
+ pointer-events: auto;
252
+ cursor: pointer;
253
+ margin-left:8px;
254
+ padding-left: 8px;
255
+ padding-right: 8px;
256
+ height: 24px !important;
257
+ color: $app-primary-color;
258
+ &:hover {
259
+ background-color: var(--el-color-primary-light-9);
260
+ }
261
+ }
262
+ }
209
263
  }
210
264
  </style>
@@ -175,6 +175,23 @@ export default {
175
175
  }
176
176
  }
177
177
  },
178
+ zincObjectRemoved: function(zincObject) {
179
+ const group = zincObject.groupName;
180
+ const objects = zincObject.region.findObjectsWithGroupName(group, false);
181
+ if (objects.length === 0) {
182
+ const paths = zincObject.region.getFullSeparatedPath();
183
+ const regionData = this.findOrCreateRegion(this.treeData[0], paths, "");
184
+ if (regionData.children) {
185
+ for (let i = 0; i < regionData.children.length; i++) {
186
+ if (regionData.children[i].label === group) {
187
+ regionData.children.splice(i, 1);
188
+ this.__nodeNumbers--;
189
+ return;
190
+ }
191
+ }
192
+ }
193
+ }
194
+ },
178
195
  checkChanged: function (node, data) {
179
196
  const isRegion = node.isRegion;
180
197
  const isPrimitives = node.isPrimitives;
@@ -325,6 +342,7 @@ export default {
325
342
  this.zincObjectAdded(zincObject);
326
343
  });
327
344
  this.$module.addOrganPartAddedCallback(this.zincObjectAdded);
345
+ this.$module.addOrganPartRemovedCallback(this.zincObjectRemoved);
328
346
  },
329
347
  setColourField: function (treeData, nodeData = undefined) {
330
348
  treeData