Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lgl
SmartVillages2
Commits
12fb48eb
Commit
12fb48eb
authored
Nov 03, 2025
by
Matthias Betz
Browse files
platzieren mit geolocation
parent
3e7044fb
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
src/index.js
View file @
12fb48eb
This diff is collapsed.
Click to expand it.
src/objectList.vue
View file @
12fb48eb
This diff is collapsed.
Click to expand it.
src/upload.vue
View file @
12fb48eb
...
...
@@ -9,7 +9,7 @@
</VcsLabel>
</v-col>
<v-col>
<VcsTextField
id=
"fileInput"
type=
"file"
v-model=
"state.files
"
/>
<VcsTextField
id=
"fileInput"
type=
"file"
@
change=
"onFileSelected
"
/>
</v-col>
</v-row>
<v-row
no-gutters
class=
"justify-center"
>
...
...
@@ -39,9 +39,15 @@ import {
import
{
VContainer
,
VRow
,
VForm
,
VCol
}
from
'
vuetify/components
'
;
import
{
name
}
from
'
../package.json
'
;
import
ConverterStatus
from
"
./converterStatus.vue
"
;
import
{
loadModel
}
from
"
./objectList.vue
"
;
export
const
bimOptionsId
=
'
upload_ifc_id
'
;
const
errorMessage
=
"
Ein Fehler ist beim konvertieren aufgetreten, die Konvertierung unterstützt
"
+
"
Dateien im IFC Format IFC2x3 und IFC4 Add2 TC1. Bitte stellen Sie sicher, dass die Datei
"
+
"
die korrekte Version hat und nicht korrupt ist. Falls dies der Fall ist dann ist ein
"
+
"
unbekannter Fehler beim Konvertieren aufgetreten, der nicht behoben werden konnte.
"
export
default
{
name
:
'
IFC Konvertierung
'
,
components
:
{
...
...
@@ -65,19 +71,22 @@ export default {
const
app
=
inject
(
'
vcsApp
'
);
const
{
pluginState
,
config
}
=
app
.
plugins
.
getByKey
(
name
);
const
disable
=
ref
(
false
);
const
onFileSelected
=
(
event
)
=>
{
pluginState
.
file
=
event
.
target
.
files
[
0
];
}
return
{
closeSelf
()
{
emit
(
'
close
'
);
},
onFileSelected
,
convert
()
{
const
fileInput
=
document
.
getElementById
(
"
fileInput
"
);
const
fd
=
new
FormData
();
fd
.
append
(
'
file
'
,
pluginState
.
file
s
);
fd
.
append
(
'
file
'
,
pluginState
.
file
);
const
req
=
fetch
(
config
.
convertLink
,
{
method
:
'
post
'
,
body
:
fd
/* or aFile[0]*/
});
// returns a promise
let
filename
=
pluginState
.
file
s
.
name
.
replace
(
/
\.[^/
.
]
+$/
,
""
)
+
"
.glb
"
;
let
filename
=
pluginState
.
file
.
name
.
replace
(
/
\.[^/
.
]
+$/
,
""
)
+
"
.glb
"
;
disable
.
value
=
true
;
const
convertBtn
=
document
.
getElementById
(
"
convertBtn
"
);
convertBtn
.
innerHTML
=
"
Konvertierung läuft
"
;
...
...
@@ -86,6 +95,11 @@ export default {
disable
.
value
=
false
;
convertBtn
.
innerHTML
=
"
Konvertieren
"
;
emit
(
'
close
'
);
const
geolocationString
=
res
.
headers
.
get
(
'
X-geolocation
'
);
if
(
geolocationString
)
{
const
geolocation
=
JSON
.
parse
(
geolocationString
);
pluginState
.
geolocations
[
filename
]
=
geolocation
;
}
if
(
res
.
ok
)
{
// status code was 200-299
app
.
notifier
.
add
({
...
...
@@ -97,20 +111,14 @@ export default {
}
else
{
app
.
notifier
.
add
({
type
:
NotificationType
.
ERROR
,
message
:
"
Ein Fehler ist beim konvertieren aufgetreten, die Konvertierung unterstützt
"
+
"
Dateien im IFC Format IFC2x3 und IFC4 Add2 TC1. Bitte stellen Sie sicher, dass die Datei
"
+
"
die korrekte Version hat und nicht korrupt ist. Falls dies der Fall ist dann ist ein
"
+
"
unbekannter Fehler beim Konvertieren aufgetreten, der nicht behoben werden konnte.
"
,
message
:
errorMessage
,
});
}
},
function
(
error
)
{
app
.
notifier
.
add
({
type
:
NotificationType
.
ERROR
,
message
:
"
Ein Fehler ist beim konvertieren aufgetreten, die Konvertierung unterstützt
"
+
"
Dateien im IFC Format IFC2x3 und IFC4 Add2 TC1. Bitte stellen Sie sicher, dass die Datei
"
+
"
die korrekte Version hat und nicht korrupt ist. Falls dies der Fall ist dann ist ein
"
+
"
unbekannter Fehler beim Konvertieren aufgetreten, der nicht behoben werden konnte.
"
,
message
:
errorMessage
,
});
}).
then
((
blob
)
=>
{
if
(
blob
!=
null
)
{
...
...
@@ -121,6 +129,7 @@ export default {
document
.
body
.
appendChild
(
a
);
a
.
click
();
a
.
remove
();
loadModel
(
url
,
filename
);
}
})
},
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment