Skip to content

Commit

Permalink
save ZIP files enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
dragos-eu committed Oct 25, 2024
1 parent 035cf6d commit 7c84848
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 38 deletions.
40 changes: 15 additions & 25 deletions ESPD/examples/startComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ Vue.component("startComponent", {
return {
raw_data: null,
versions: [{ value: null, text: 'Select an option' }],
espd_version: null,
role: null,
country: null,
exp: {
espd_version: null,
role: null,
country: null
},
role_opt: [
{ value: 'ca', text: 'Contracting authority - ESPD Request' },
{ value: 'eo', text: 'Economic operator - ESPD Response' }
Expand All @@ -17,22 +19,10 @@ Vue.component("startComponent", {
}
},

watch: {
espd_version: function (oldV, newV) {
window.espd_doc.espd_version = oldV
},
country: function (oldV, newV) {
window.espd_doc.country = oldV
},
role: function (oldV, newV) {
window.espd_doc.role = oldV
}
},

methods: {
selectVersion(event){
this.espd_version = event
window.espd_doc.espd_version = this.espd_version
this.exp.espd_version = event
window.espd_doc.espd_version = this.exp.espd_version

const getData = async () => {
try {
Expand All @@ -51,7 +41,7 @@ Vue.component("startComponent", {
},

beforeDestroy(){
console.log(this.espd_version);
console.log(this.exp);

},

Expand All @@ -68,12 +58,12 @@ Vue.component("startComponent", {
for (const key in window.raw_data) {
if (Object.hasOwn(window.raw_data, key)) {
this.versions.push(key)
this.espd_version = this.versions[0]
window.espd_doc.espd_version = this.espd_version
this.exp.espd_version = this.versions[0]
window.espd_doc.espd_version = this.exp.espd_version
}
}
this.role = 'ca'
this.country = 'EUR'
this.exp.role = 'ca'
this.exp.country = 'EUR'

//load the model too
thecall = await fetch(`${window.raw_data[window.espd_doc.espd_version].model.source}`)
Expand Down Expand Up @@ -111,15 +101,15 @@ Vue.component("startComponent", {
<b-collapse id="accordion-st1" visible accordion="my-accordion" role="tabpanel">
<b-card-body>
<b-form-group id="fieldset-espd" label-cols-sm="4" label-cols-lg="3" description="Select ESPD version" label="ESPD version" label-for="sel-espd">
<b-form-select id="sel-espd" v-model="espd_version" :options="versions" @change="selectVersion($event)"></b-form-select>
<b-form-select id="sel-espd" v-model="exp.espd_version" :options="versions" @change="selectVersion($event)"></b-form-select>
</b-form-group>
<b-form-group id="fieldset-role" label-cols-sm="4" label-cols-lg="3" description="Select your role" label="Select your role" label-for="sel-role">
<b-form-select id="sel-role" v-model="role" :options="role_opt"></b-form-select>
<b-form-select id="sel-role" v-model="exp.role" :options="role_opt"></b-form-select>
</b-form-group>
<b-form-group id="fieldset-country" label-cols-sm="4" label-cols-lg="3" description="Select your country" label="Country" label-for="sel-country">
<b-form-select id="sel-country" v-model="country" :options="country_list"></b-form-select>
<b-form-select id="sel-country" v-model="exp.country" :options="country_list"></b-form-select>
</b-form-group>
</b-card-body>
</b-collapse>
Expand Down
18 changes: 5 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,12 @@
<link rel="stylesheet" href="src/css/footer.css" />

<!-- PDFMake framework -->
<!--
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"
integrity="sha512-a9NgEEK7tsCvABL7KqtUTQjl69z7091EVPpw5KxPlZ93T141ffe1woLtbXTX+r2/8TtTvRX/v4zTL2UlMUPgwg=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.min.js"
integrity="sha512-P0bOMePRS378NwmPDVPU455C/TuxDS+8QwJozdc7PGgN8kLqR4ems0U/3DeJkmiE31749vYWHvBOtR+37qDCZQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.12/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.12/vfs_fonts.min.js"></script>

<!-- Handlebars famework -->
<!--
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.7.7/handlebars.min.js"
integrity="sha512-RNLkV3d+aLtfcpEyFG8jRbnWHxUqVZozacROI4J2F1sTaDqo1dPQYs01OMi1t1w9Y2FdbSCDSQ2ZVdAC8bzgAg=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.7.8/handlebars.min.js"></script>

<!-- SheetJS framework -->
<script src="https://cdn.sheetjs.com/xlsx-0.20.3/package/dist/xlsx.full.min.js"></script>

Expand Down
8 changes: 8 additions & 0 deletions src/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -753,3 +753,11 @@ function deleteHTML(part) {
console.log(part);
window.app.$children[6].$refs['procedureComponent'].$refs['v4.0.0-C61'][0]._data[`html_${stringToProperty(part)}`]=''
}


/**
* Save global state for ESPD Example
*/
function saveData(data){

}

0 comments on commit 7c84848

Please sign in to comment.