Commit 87e32af2 authored by Jean Rabreau's avatar Jean Rabreau
Browse files

馃毀 plug /rtir route to remote data

parent bdb068e2
......@@ -8512,6 +8512,11 @@
"pify": "^4.0.1"
}
},
"hammerjs": {
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/hammerjs/-/hammerjs-2.0.8.tgz",
"integrity": "sha1-BO93hiz/K7edMPdpIJWTAiK/YPE="
},
"handle-thing": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz",
......
......@@ -59,7 +59,7 @@ var relight = new RelightViewer('.relight',
minzoom: 100,
pos: { x:0, y:0, z:0, a:0 },
rotation: 0,
pagemap: { /*thumb: 'thumb.jpg', */size:200, autohide:1000 },
// pagemap: { /*thumb: 'thumb.jpg', */size:200, autohide:1000 },
scale: 1.0,
background: [0.7, 0.7, 0.7, 1]
// fit: true,
......
<template>
<div id="relight__container" class="d-flex">
<v-navigation-drawer
v-model="toolAccess"
absolute
:mini-variant="!help"
>
<v-list dense>
<v-list-item @click="toolAccess = !toolAccess">
<v-icon >mdi-chevron-left</v-icon>
<v-subheader>{{ $t('hop.close') }}</v-subheader>
</v-list-item>
<v-list-item @click="reset">
<v-icon>mdi-home</v-icon>
<v-subheader>{{ $t('hop.reset') }}</v-subheader>
</v-list-item>
<!-- <v-list-item @click="">-->
<!-- <v-icon>{{ fullscreen.icon }}</v-icon>-->
<!-- <v-subheader>{{ fullscreen.help }}</v-subheader>-->
<!-- </v-list-item>-->
<ZoomButton @zoom="zoomIn" opp="plus"/>
<ZoomButton @zoom="zoomOut" opp="minus"/>
<!-- <v-list-item @click="cameraType.switch">-->
<!-- <v-icon>mdi-camera-flip-outline</v-icon>-->
<!-- <v-subheader>{{ cameraType.nextType }}</v-subheader>-->
<!-- </v-list-item>-->
</v-list>
</v-navigation-drawer>
<transition name="slide">
<v-list-item
v-if="!toolAccess"
id="toolbar"
@click="toolAccess = !toolAccess"
dense
shaped
>
<v-icon>mdi-tools</v-icon><v-icon>mdi-chevron-right</v-icon>
</v-list-item>
</transition>
<div class="relight">
</div>
</div>
<v-row class="d-flex fill-height">
<v-col cols="10">
<div id="relight__container">
<v-navigation-drawer
v-model="toolAccess"
absolute
:mini-variant="!help"
>
<v-list dense>
<v-list-item @click="toolAccess = !toolAccess">
<v-icon >mdi-chevron-left</v-icon>
<v-subheader>{{ $t('hop.close') }}</v-subheader>
</v-list-item>
<v-list-item @click="reset">
<v-icon>mdi-home</v-icon>
<v-subheader>{{ $t('hop.reset') }}</v-subheader>
</v-list-item>
<!-- <v-list-item @click="">-->
<!-- <v-icon>{{ fullscreen.icon }}</v-icon>-->
<!-- <v-subheader>{{ fullscreen.help }}</v-subheader>-->
<!-- </v-list-item>-->
<ZoomButton @zoom="zoomIn" opp="plus"/>
<ZoomButton @zoom="zoomOut" opp="minus"/>
<!-- <v-list-item @click="cameraType.switch">-->
<!-- <v-icon>mdi-camera-flip-outline</v-icon>-->
<!-- <v-subheader>{{ cameraType.nextType }}</v-subheader>-->
<!-- </v-list-item>-->
</v-list>
</v-navigation-drawer>
<transition name="slide">
<v-list-item
v-if="!toolAccess"
id="toolbar"
@click="toolAccess = !toolAccess"
dense
shaped
>
<v-icon>mdi-tools</v-icon><v-icon>mdi-chevron-right</v-icon>
</v-list-item>
</transition>
<div class="relight">
</div>
</div>
</v-col>
</v-row>
</template>
<script>
import RelightViewer from '@/assets/relight/relight-interface'
import ZoomButton from '@/components/renderer/file/model/ZoomButton'
// import ZoomButton from '@/components/renderer/file/model/ZoomButton'
export default {
name: "RtiRelight",
components: {
ZoomButton
// ZoomButton
},
data() {
return {
......@@ -64,12 +69,25 @@ export default {
},
},
mounted() {
const url1 = 'test/bilinear18';
//var url2 = 'test/12563_front';
// const url1 = 'test/bilinear18';
const url2 = 'items/c950b2d5-d748-467c-bb69-8f4c7bf5eda6/mediafiles/get_rti';
this.relightViewer = new RelightViewer('.relight',
{
url:url1,
layout:"image",
layers: [{
url:`${process.env.VUE_APP_AXIOS_BASE_URL}${url2}`,
layout:"image",
}],
fit: true,
bounded: false,
zbounded: false,
maxzoom: -4,
minzoom: 100,
pos: { x:0, y:0, z:0, a:0 },
rotation: 0,
// pagemap: { /*thumb: 'thumb.jpg', */size:200, autohide:1000 },
scale: 1.0,
background: [0.7, 0.7, 0.7, 1]
}
);
},
......@@ -93,97 +111,108 @@ export default {
#relight__container {
width:100%; height:100%; position: relative;
}
.relight { position:relative; touch-action: none; width:100%; height:100%; }
.relight canvas { width:100%; height:100%; display:block; }
.relight-toolbox { position: absolute; top:0px; left:56px; padding:5px; }
.relight-toolbox > div { background-size:cover; cursor:pointer; margin:5px; opacity:0.7 }
.relight-toolbox > div:hover { opacity:0.9; }
.relight {
position:relative;
}
.relight { position:relative; touch-action: none; width:100%; height:100%; }
.relight canvas { width:100%; height:100%; display:block; }
.relight-toolbox { position: absolute; top:0px; left:0px; padding:5px; }
.relight-toolbox > div { background-size:cover; cursor:pointer; margin:5px; opacity:0.7 }
.relight-toolbox > div:hover { opacity:0.9; }
.relight-home { background-image: url(/static/skins/dark/home.png); }
.relight-zoomin { background-image: url(/static/skins/dark/zoomin.png); }
.relight-zoomout { background-image: url(/static/skins/dark/zoomout.png); }
.relight-rotate { background-image: url(/static/skins/dark/rotate.png); }
.relight-light { background-image: url(/static/skins/dark/light.png); }
.relight-light_on { background-image: url(/static/skins/dark/light_on.png); }
.relight-normals { background-image: url(/static/skins/dark/normals.png); }
.relight-normals_on { background-image: url(/static/skins/dark/normals_on.png); }
.relight-full { background-image: url(/static/skins/dark/full.png); }
.relight-full_on { background-image: url(/static/skins/dark/full_on.png); }
.relight-info { background-image: url(/static/skins/dark/help.png); }
.relight-info-dialog {
display:none;
position:absolute;
top:0px;
left:0px;
width:100%;
height:100%;
background-color:rgba(0, 0, 0, 0.5);
}
.relight-info-content {
display:none;
background-color:white;
padding:20px;
max-height: calc(100% - 100px);
width: 80%;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 5px;
}
.relight {
position:relative;
}
.relight-scale {
position:absolute;
bottom:10px;
right:10px;
padding:20px 10px;
width:5%;
text-align:center;
z-index:1000;
background-color:rgba(0, 0, 0, 0.5);
color:#eee;
transition: opacity 1s ease;
opacity:1.0;
}
.relight-info-dialog {
display:none;
position:absolute;
top:0px;
left:0px;
width:100%;
height:100%;
background-color:rgb(0, 0, 0, 0.5);
}
.relight-info-content {
display:none;
background-color:white;
padding:20px;
max-height: calc(100% - 100px);
width: 80%;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 5px;
}
.relight-pagemap {
position:absolute;
top:10px;
right:10px;
background-color:rgba(255, 255, 255, 0.1);
transition: opacity 1s ease;
opacity:1.0;
}
.relight-scale {
position:absolute;
bottom:10px;
right:10px;
padding:20px 10px;
width:5%;
text-align:center;
z-index:1000;
background-color:rgba(0, 0, 0, 0.5);
color:#eee;
transition: opacity 1s ease;
opacity:1.0;
}
.relight-pagemap[style]:hover {
opacity:1.0 !important;
.relight-pagemap {
position:absolute;
top:10px;
right:10px;
background-color:rgb(255, 255, 255, 0.1);
transition: opacity 1s ease;
opacity:1.0;
}
}
.relight-pagemap[style]:hover {
opacity:1.0 !important;
.relight-pagemap-area {
position:absolute;
top:0px; left:0px;
border: 1px solid white;
box-shadow: 0 0 0 1px #ccc;
opacity:0.5;
}
}
@media screen and (max-width: 576px) {
.relight-toolbox > div { width: 9vmin; height: 9vmin; }
.relight-pagemap { display:none; }
.relight-scale { width:15%; }
}
@media screen and (min-width: 576px) {
.relight-toolbox > div {width: 9vmin; height: 9vmin; }
.relight-pagemap { display:none; }
.relight-scale { width:10%; }
}
@media screen and (min-width: 768px) {
.relight-toolbox > div {width: 7vmin; height: 7vmin; }
.relight-pagemap { display:block; width:200px; }
.relight-scale { width:7%; }
}
@media screen and (min-width: 992px) {
.relight-toolbox > div {width: 6vmin; height: 6vmin; }
.relight-pagemap { display:block; width:200px; }
.relight-scale { width:5%; }
}
.relight-pagemap-area {
position:absolute;
top:0px; left:0px;
border: 1px solid white;
box-shadow: 0 0 0 1px #ccc;
opacity:0.5;
}
@media screen and (max-width: 576px) {
.relight-toolbox > div { width: 9vmin; height: 9vmin; }
.relight-pagemap { display:none; }
.relight-scale { width:15%; }
}
@media screen and (min-width: 576px) {
.relight-toolbox > div {width: 9vmin; height: 9vmin; }
.relight-pagemap { display:none; }
.relight-scale { width:10%; }
}
@media screen and (min-width: 768px) {
.relight-toolbox > div {width: 7vmin; height: 7vmin; }
.relight-pagemap { display:block; width:200px; }
.relight-scale { width:7%; }
}
@media screen and (min-width: 992px) {
.relight-toolbox > div {width: 6vmin; height: 6vmin; }
.relight-pagemap { display:block; width:200px; }
.relight-scale { width:5%; }
}
#toolbar {
#toolbar {
position:absolute;
top:8px;
left: 0px;
......
......@@ -192,6 +192,18 @@ const Item = {
}
})
},
rtiUpload({getters}, file) {
const itemId = getters['itemId']
const formData = new FormData()
formData.append("Content-Type", file.type)
formData.append("file", file)
// request pre-signed post url
return authority.post(
`items/${itemId}/mediafiles/rti/`,
formData
)
}
,
/**
*
* @param context
......
......@@ -43,6 +43,12 @@
{{ $t('file.upload.button') }}
</v-btn>
</v-col>
<v-col cols="12">
<v-checkbox
v-model="isRTIUpload"
label="Envoi d'un ZIP RTI"
/>
</v-col>
</v-row>
</v-form>
<v-switch
......@@ -89,6 +95,7 @@ export default {
},
data() {
return {
isRTIUpload: false,
isValid: false,
requiredRule: [file => !!file || "un fichier est requis"],
loading: false,
......@@ -130,7 +137,7 @@ export default {
},
},
methods: {
...mapActions('item', ['itemLoad', 'itemUpdate', 'fileUpload', 'fileDelete']),
...mapActions('item', ['itemLoad', 'itemUpdate', 'fileUpload', 'fileDelete', 'rtiUpload']),
onSetFileView(selection) {
const newViewerSetting = {
...selection.length
......@@ -161,14 +168,25 @@ export default {
onUploadFile() {
if (this.$refs.form.validate()) {
this.loading = true
this.fileUpload(this.currentFile)
.then(progress => {
this.progress = progress
})
.finally(() => {
this.loading = false
this.$refs.form.reset()
})
if (this.isRTIUpload) {
this.rtiUpload(this.currentFile)
.then(progress => {
this.progress = progress
})
.finally(() => {
this.loading = false
this.$refs.form.reset()
})
} else {
this.fileUpload(this.currentFile)
.then(progress => {
this.progress = progress
})
.finally(() => {
this.loading = false
this.$refs.form.reset()
})
}
}
},
downloadUpdate() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment