|
106 | 106 | </template>
|
107 | 107 | <span>Create a new Submodel from JSON</span>
|
108 | 108 | </v-tooltip>
|
| 109 | + <v-divider></v-divider> |
| 110 | + <!-- Paste Submodel from internal clipboard --> |
| 111 | + <v-tooltip open-delay="600" location="end"> |
| 112 | + <template #activator="{ props }"> |
| 113 | + <v-list-item |
| 114 | + :disabled=" |
| 115 | + !clipboardElementContentType || |
| 116 | + clipboardElementContentType !== 'Submodel' |
| 117 | + " |
| 118 | + slim |
| 119 | + v-bind="props" |
| 120 | + @click="pasteElement"> |
| 121 | + <template #prepend> |
| 122 | + <v-icon size="small">mdi-file-document-multiple-outline</v-icon> |
| 123 | + </template> |
| 124 | + {{ |
| 125 | + `Paste ${!clipboardElementContentType || clipboardElementContentType !== 'Submodel' ? '' : clipboardElementContentType}` |
| 126 | + }} |
| 127 | + </v-list-item> |
| 128 | + </template> |
| 129 | + <span> |
| 130 | + {{ |
| 131 | + `Paste ${!clipboardElementContentType || clipboardElementContentType !== 'Submodel' ? '' : 'copied ' + clipboardElementContentType}` |
| 132 | + }} |
| 133 | + </span> |
| 134 | + </v-tooltip> |
109 | 135 | </v-list>
|
110 | 136 | </v-sheet>
|
111 | 137 | </v-menu>
|
|
243 | 269 | import { useAASHandling } from '@/composables/AAS/AASHandling';
|
244 | 270 | import { useReferableUtils } from '@/composables/AAS/ReferableUtils';
|
245 | 271 | import { useSMHandling } from '@/composables/AAS/SMHandling';
|
| 272 | + import { useClipboardUtil } from '@/composables/ClipboardUtil'; |
246 | 273 | import { useAASStore } from '@/store/AASDataStore';
|
| 274 | + import { useClipboardStore } from '@/store/ClipboardStore'; |
247 | 275 | import { useEnvStore } from '@/store/EnvironmentStore';
|
248 | 276 | import { useNavigationStore } from '@/store/NavigationStore';
|
249 | 277 | import { isEmptyString } from '@/utils/StringUtils';
|
|
255 | 283 | const { fetchAasSmListById } = useAASHandling();
|
256 | 284 | const { fetchSmList } = useSMHandling();
|
257 | 285 | const { nameToDisplay, descriptionToDisplay } = useReferableUtils();
|
| 286 | + const { pasteElement } = useClipboardUtil(); |
258 | 287 |
|
259 | 288 | // Stores
|
260 | 289 | const navigationStore = useNavigationStore();
|
261 | 290 | const aasStore = useAASStore();
|
262 | 291 | const envStore = useEnvStore();
|
| 292 | + const clipboardStore = useClipboardStore(); |
263 | 293 |
|
264 | 294 | // Data
|
265 | 295 | const submodelTree = ref([] as Array<any>) as Ref<Array<any>>; // Submodel Treeview Data
|
|
301 | 331 | const singleAas = computed(() => envStore.getSingleAas); // Get the single AAS state from the Store
|
302 | 332 | const editorMode = computed(() => ['AASEditor', 'SMEditor'].includes(route.name as string));
|
303 | 333 | const triggerTreeviewReload = computed(() => navigationStore.getTriggerTreeviewReload); // Reload the Treeview
|
| 334 | + const clipboardElementContentType = computed(() => clipboardStore.getClipboardElementModelType()); // Get the Clipboard Element Content Type |
304 | 335 |
|
305 | 336 | // Watchers
|
306 | 337 | watch(
|
|
0 commit comments