Skip to content

Commit

Permalink
surveyjs integration
Browse files Browse the repository at this point in the history
  • Loading branch information
dragos-eu committed Dec 13, 2024
1 parent 67f78a0 commit 781f4f1
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 5 deletions.
7 changes: 2 additions & 5 deletions excelator.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@

/*
*
* NodeJS application to check UUID duplicated in Excel for ESPD v3.3.0
* NodeJS application to handle Excel Code Lists and Model
* tranform them to JSON and save the structure in corresponding folders
*
*/

var XLSX = require("xlsx")
var chalk = require('chalk');
var fs = require("fs")
const { readFileSync } = require('fs');
const axios = require("axios")
const { HttpsProxyAgent } = require("https-proxy-agent")

const { program } = require("@caporal/core");
const path = require("path");
const { type } = require("os");

var in_excel_we_trust = [
//"ESPD-CodeLists_v3.0.0.xlsx",
Expand Down
112 changes: 112 additions & 0 deletions surveyjs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="en">

<head>
<title>Forms with SurveyJS</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

<!-- Required Stylesheets -->
<link type="text/css" rel="stylesheet" href="https://unpkg.com/[email protected]/dist/css/bootstrap.min.css" />
<link type="text/css" rel="stylesheet" href="https://unpkg.com/[email protected]/dist/bootstrap-vue.css" />

<!-- Load polyfills to support older browsers -->
<!-- Blocked by Edge so getting rid of it
<script src="https://polyfill.io/v3/polyfill.min.js?features=es2015%2CIntersectionObserver"></script>
-->

<!-- Required scripts -->
<script src="https://unpkg.com/[email protected]/dist/vue.min.js"></script>

<script src="https://unpkg.com/[email protected]/dist/bootstrap-vue.js"></script>
<!-- Load the following for BootstrapVueIcons support -->
<script src="https://unpkg.com/[email protected]/dist/bootstrap-vue-icons.min.js"></script>

<!-- Extra libraries needed by BootstrapVue -->
<script src="https://unpkg.com/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/portal-vue.umd.min.js"></script>

<!-- ... -->
<link href="https://unpkg.com/survey-core/defaultV2.min.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/survey-core/survey.core.min.js"></script>
<!-- <script type="text/javascript" src="https://unpkg.com/survey-js-ui/survey-js-ui.min.js"></script> -->
<script type="text/javascript" src="https://unpkg.com/survey-vue-ui/survey-vue-ui.min.js"></script>

<!-- ... -->


</head>

<body>
<div id="app">
<template>
<Survey :survey="survey" />
</template>
</div>

<script>
const surveyJson = new SurveyVue.Model(
{
"logoPosition": "right",
"pages": [
{
"name": "page1",
"elements": [
{
"type": "boolean",
"name": "question3",
"title": "Your answer:",
"isRequired": true
},
{
"type": "paneldynamic",
"name": "question2",
"visibleIf": "{question3} = true",
"templateElements": [
{
"type": "multipletext",
"name": "question1",
"title": "QSG",
"isRequired": true,
"items": [
{
"name": "text1",
"title": "some question"
},
{
"name": "text2",
"title": "another question"
}
]
}
],
"panelCount": 1,
"minPanelCount": 1
}
]
}
]
}
);

surveyJson.onComplete.add(function (sender, options) {
// Display the "Saving..." message (pass a string value to display a custom message)
console.log(JSON.stringify(sender.data))
options.showSaveInProgress();
options.showSaveSuccess();
});

// 1. Create a vue root instance
window.app = new Vue({
el: '#app',
data: {
survey: surveyJson
}
})


</script>
</body>

</html>

0 comments on commit 781f4f1

Please sign in to comment.