diff --git a/public/js/apps/vbform/presets.js b/public/js/apps/vbform/presets.js
new file mode 100644
index 000000000..2a1b87987
--- /dev/null
+++ b/public/js/apps/vbform/presets.js
@@ -0,0 +1,222 @@
+import uuid from '../../helpers/vbform/uuid.js';
+
+export default [
+ {
+ type: 'preset',
+ guioptions: {
+ id: 'leer',
+ label: 'Leer',
+ description: 'keine vordefinierten Vertrags- und Gehaltsbestandteile. Alles kann/muss manuell angelegt werden.'
+ },
+ vbs: []
+ },
+ {
+ type: 'preset',
+ guioptions: {
+ id: 'neustd',
+ label: 'Neuanlage Standard DV',
+ description: 'Standard Dienstvertrag Vorlage'
+ },
+ vbs: [
+ {
+ type: 'vertragsbestandteilstunden',
+ guioptions: {
+ id: uuid.get_uuid(),
+ removable: false
+ },
+ gbs: [
+ {
+ type: 'gehaltsbestandteil',
+ guioptions: {
+ id: uuid.get_uuid(),
+ removable: false
+ },
+ data: {
+ gehaltstyp: 'basis',
+ valorisierung: true
+ }
+ }
+ ]
+ },
+ {
+ type: 'vertragsbestandteilzeitaufzeichnung',
+ guioptions: {
+ id: uuid.get_uuid(),
+ removable: false
+ },
+ data: {
+ zeitaufzeichnung: true,
+ azgrelevant: true,
+ homeoffice: true
+ }
+ },
+ {
+ type: 'vertragsbestandteilfunktion',
+ guioptions: {
+ id: uuid.get_uuid(),
+ removable: false
+ }
+ }
+ ]
+ },
+ {
+ type: 'preset',
+ guioptions: {
+ id: 'allin',
+ label: 'AllIn',
+ description: 'AllIn Vertrag'
+ },
+ vbs: [
+ {
+ type: 'vertragsbestandteilstunden',
+ guioptions: {
+ id: uuid.get_uuid(),
+ removable: false
+ },
+ gbs: [
+ {
+ type: 'gehaltsbestandteil',
+ guioptions: {
+ id: uuid.get_uuid(),
+ removable: false
+ },
+ data: {
+ gehaltstyp: 'grund',
+ valorisierung: true
+ }
+ }
+ ]
+ },
+ {
+ type: 'vertragsbestandteilzeitaufzeichnung',
+ guioptions: {
+ id: uuid.get_uuid(),
+ removable: false
+ },
+ data: {
+ zeitaufzeichnung: true,
+ azgrelevant: false,
+ homeoffice: true
+ }
+ },
+ {
+ type: 'vertragsbestandteilfreitext',
+ guioptions: {
+ id: uuid.get_uuid(),
+ removable: false,
+ },
+ data: {
+ freitexttyp: 'allin',
+ titel: 'AllIn Vereinbarung',
+ freitext: 'Es wird AllIn vereinbart.'
+ },
+ gbs: [
+ {
+ type: 'gehaltsbestandteil',
+ guioptions: {
+ id: uuid.get_uuid(),
+ removable: false
+ },
+ data: {
+ gehaltstyp: 'zulage',
+ valorisierung: false
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "preset",
+ "guioptions": {
+ "id": "savedallin",
+ "label": "Test Zwischenspeichern",
+ "description": "generiertes JSON aus ausgeflltem Formular als POC für das Zwischenspeichern"
+ },
+ "vbs": [
+ {
+ "type": "vertragsbestandteilstunden",
+ "guioptions": {
+ "id": "44c4d3bc-ee1f-4edf-8b2a-82736e09d287",
+ "removable": false
+ },
+ "data": {
+ "stunden": "38,5",
+ "gueltigkeit": {
+ "gueltig_ab": "01.03.2023",
+ "gueltig_bis": ""
+ }
+ },
+ "gbs": [
+ {
+ "type": "gehaltsbestandteil",
+ "guioptions": {
+ "id": "cc38c689-5c79-4a82-899a-000fd77ed582",
+ "removable": false
+ },
+ "data": {
+ "gehaltstyp": "grund",
+ "betrag": "3500",
+ "gueltigkeit": {
+ "gueltig_ab": "01.03.2023",
+ "gueltig_bis": ""
+ },
+ "valorisierung": true
+ }
+ }
+ ]
+ },
+ {
+ "type": "vertragsbestandteilzeitaufzeichnung",
+ "guioptions": {
+ "id": "b55a558e-458c-4ea5-bebf-dd9cbe247ca6",
+ "removable": false
+ },
+ "data": {
+ "zeitaufzeichnung": true,
+ "azgrelevant": false,
+ "homeoffice": true,
+ "gueltigkeit": {
+ "gueltig_ab": "01.03.2023",
+ "gueltig_bis": ""
+ }
+ }
+ },
+ {
+ "type": "vertragsbestandteilfreitext",
+ "guioptions": {
+ "id": "6f5756d9-2128-48b8-8954-408f96816b22",
+ "removable": false
+ },
+ "data": {
+ "freitexttyp": "allin",
+ "titel": "AllIn Vereinbarung",
+ "freitext": "Es wird AllIn vereinbart.",
+ "kuendigungsrelevant": "",
+ "gueltigkeit": {
+ "gueltig_ab": "01.03.2023",
+ "gueltig_bis": ""
+ }
+ },
+ "gbs": [
+ {
+ "type": "gehaltsbestandteil",
+ "guioptions": {
+ "id": "d0c8946f-1c64-4981-9c15-e09ac5c9ba0a",
+ "removable": false
+ },
+ "data": {
+ "gehaltstyp": "zulage",
+ "betrag": "500",
+ "gueltigkeit": {
+ "gueltig_ab": "01.03.2023",
+ "gueltig_bis": ""
+ },
+ "valorisierung": false
+ }
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/public/js/apps/vbform/vbform.js b/public/js/apps/vbform/vbform.js
index 2ca309ba8..992a0db85 100644
--- a/public/js/apps/vbform/vbform.js
+++ b/public/js/apps/vbform/vbform.js
@@ -1,22 +1,26 @@
-import vertragsbestandteilhelper from '../../components/vbform/vertragsbestandteilhelper.js';
+import presets_chooser from '../../components/vbform/presets_chooser.js';
+import presets from './presets.js';
Vue.createApp({
template: `
`,
data: function() {
return {
"title": "Vertragsbestandteil Form",
+ presets: presets
};
},
components: {
- 'vertragsbestandteilhelper': vertragsbestandteilhelper
+ 'presets_chooser': presets_chooser
},
created: function() {
},
methods: {
+ },
+ computed: {
}
}).mount('#main');
diff --git a/public/js/components/vbform/debug_viewer.js b/public/js/components/vbform/debug_viewer.js
new file mode 100644
index 000000000..baf2fa37a
--- /dev/null
+++ b/public/js/components/vbform/debug_viewer.js
@@ -0,0 +1,12 @@
+export default {
+ template: `
+
+ `,
+ props: [
+ "text"
+ ]
+}
diff --git a/public/js/components/vbform/gehaltsbestandteil.js b/public/js/components/vbform/gehaltsbestandteil.js
index ac4d726c5..125ec6e40 100644
--- a/public/js/components/vbform/gehaltsbestandteil.js
+++ b/public/js/components/vbform/gehaltsbestandteil.js
@@ -1,9 +1,35 @@
import gueltigkeit from './gueltigkeit.js';
+import configurable from '../../mixins/vbform/configurable.js';
export default {
- props: [
- 'id'
- ],
+ template: `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `,
data: function() {
return {
gehaltstyp : '',
@@ -13,44 +39,44 @@ export default {
valorisierung: ''
}
},
- template: `
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- `,
components: {
'gueltigkeit': gueltigkeit
},
+ mixins: [
+ configurable
+ ],
+ created: function() {
+ this.setDataFromConfig();
+ },
methods: {
+ setDataFromConfig: function() {
+ if( typeof this.config.data === 'undefined' ) {
+ return;
+ }
+
+ if( typeof this.config.data.gehaltstyp !== 'undefined' ) {
+ this.gehaltstyp = this.config.data.gehaltstyp;
+ }
+ if( typeof this.config.data.betrag !== 'undefined' ) {
+ this.betrag = this.config.data.betrag;
+ }
+ if( typeof this.config.data.valorisierung !== 'undefined' ) {
+ this.valorisierung = this.config.data.valorisierung;
+ }
+ },
removeGB: function() {
- this.$emit('removeGB', {id: this.id});
+ this.$emit('removeGB', {id: this.config.guioptions.id});
},
getPayload: function() {
return {
- gehaltstyp: this.gehaltstyp,
- betrag: this.betrag,
- gueltigkeit: this.$refs.gueltigkeit.getPayload(),
- valorisierung: this.valorisierung
+ type: this.config.type,
+ guioptions: this.config.guioptions,
+ data: {
+ gehaltstyp: this.gehaltstyp,
+ betrag: this.betrag,
+ gueltigkeit: this.$refs.gueltigkeit.getPayload(),
+ valorisierung: this.valorisierung
+ }
};
}
}
diff --git a/public/js/components/vbform/gehaltsbestandteilhelper.js b/public/js/components/vbform/gehaltsbestandteilhelper.js
index fc0bf74f4..f1bfdb5d2 100644
--- a/public/js/components/vbform/gehaltsbestandteilhelper.js
+++ b/public/js/components/vbform/gehaltsbestandteilhelper.js
@@ -1,50 +1,58 @@
-import gehaltsbestandteil from './gehaltsbestandteil.js';
+import gehaltsbestandteil from './gehaltsbestandteil';
+import presetable from '../../mixins/vbform/presetable.js';
+import uuid from '../../helpers/vbform/uuid.js';
export default {
template: `
`,
data: function() {
return {
- payload: [],
- gbs: [],
+ payload: []
};
},
components: {
'gehaltsbestandteil': gehaltsbestandteil,
},
+ mixins: [
+ presetable
+ ],
methods: {
addGB: function(e) {
e.preventDefault();
e.stopPropagation();
- var gbid = 'testgb' + (this.gbs.length + 1);
- this.gbs.push({
- id: gbid
+ this.children.unshift({
+ type: 'gehaltsbestandteil',
+ guioptions: {
+ id: uuid.get_uuid(),
+ removeable: true
+ }
});
},
removeGB: function(payload) {
- var gbs = this.gbs.filter(function(gb) {
- return gb.id !== payload.id;
+ var children = this.children.filter(function(gb) {
+ return gb.guioptions.id !== payload.id;
});
- this.gbs = gbs;
+ this.children = children;
},
getPayload: function() {
- var gbs = this.gbs;
+ var children = this.children;
var that = this;
this.payload = [];
- gbs.forEach(function(gb) {
- that.payload.push(that.$refs[gb.id][0].getPayload());
+ children.forEach(function(gb) {
+ that.payload.push(that.$refs[gb.guioptions.id][0].getPayload());
});
return this.payload;
diff --git a/public/js/components/vbform/presets_chooser.js b/public/js/components/vbform/presets_chooser.js
new file mode 100644
index 000000000..ef13ca014
--- /dev/null
+++ b/public/js/components/vbform/presets_chooser.js
@@ -0,0 +1,58 @@
+import vertragsbestandteilhelper from './vertragsbestandteilhelper.js';
+import debug_viewer from './debug_viewer.js';
+
+export default {
+ template: `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `,
+ props:[
+ 'presets'
+ ],
+ data: function() {
+ return {
+ selectedpresetidx: 0,
+ selectedpreset: [],
+ vbhjson: ''
+ }
+ },
+ components: {
+ 'vertragsbestandteilhelper': vertragsbestandteilhelper,
+ 'debug_viewer': debug_viewer
+ },
+ methods: {
+ selectpreset: function(idx) {
+ if( typeof this.presets[idx] !== 'undefined' ) {
+ this.seletedpresetidx = idx;
+ this.selectedpreset = this.presets[idx].vbs;
+ }
+ },
+ isactive: function(idx) {
+ return (idx === this.selectedpresetidx) ? 'active' : '';
+ },
+ process_json: function(payload) {
+ this.vbhjson = payload;
+ }
+ },
+ computed: {
+ }
+}
diff --git a/public/js/components/vbform/vertragsbestandteil_freitext.js b/public/js/components/vbform/vertragsbestandteil_freitext.js
index 03dc41be6..031c4030b 100644
--- a/public/js/components/vbform/vertragsbestandteil_freitext.js
+++ b/public/js/components/vbform/vertragsbestandteil_freitext.js
@@ -1,9 +1,46 @@
import gehaltsbestandteilhelper from './gehaltsbestandteilhelper.js';
import gueltigkeit from './gueltigkeit.js';
+import configurable from '../../mixins/vbform/configurable.js';
export default {
- props: [
- 'id'
+ template: `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `,
+ components: {
+ 'gehaltsbestandteilhelper': gehaltsbestandteilhelper,
+ 'gueltigkeit': gueltigkeit
+ },
+ mixins: [
+ configurable
],
emits: {
removeVB: null
@@ -16,56 +53,40 @@ export default {
kuendigungsrelevant: ''
}
},
- template: `
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- `,
- components: {
- 'gehaltsbestandteilhelper': gehaltsbestandteilhelper,
- 'gueltigkeit': gueltigkeit
+ created: function() {
+ this.setDataFromConfig();
},
methods: {
+ setDataFromConfig: function() {
+ if( typeof this.config.data === 'undefined' ) {
+ return;
+ }
+
+ if( typeof this.config.data.freitexttyp !== 'undefined' ) {
+ this.freitexttyp = this.config.data.freitexttyp;
+ }
+ if( typeof this.config.data.titel !== 'undefined' ) {
+ this.titel = this.config.data.titel;
+ }
+ if( typeof this.config.data.freitexttyp !== 'undefined' ) {
+ this.freitext = this.config.data.freitext
+ }
+ },
removeVB: function() {
- this.$emit('removeVB', {id: this.id});
+ this.$emit('removeVB', {id: this.config.guioptions.id});
},
getPayload: function() {
return {
- freitexttyp: this.freitexttyp,
- titel: this.titel,
- freitext: this.freitext,
- kuendigungsrelevant: this.kuendigungsrelevant,
- gueltigkeit: this.$refs.gueltigkeit.getPayload(),
- gehaltsbestandteile: this.$refs.gbh.getPayload()
+ type: 'vertragsbestandteilfreitext',
+ guioptions: this.config.guioptions,
+ data: {
+ freitexttyp: this.freitexttyp,
+ titel: this.titel,
+ freitext: this.freitext,
+ kuendigungsrelevant: this.kuendigungsrelevant,
+ gueltigkeit: this.$refs.gueltigkeit.getPayload()
+ },
+ gbs: this.$refs.gbh.getPayload()
};
}
}
diff --git a/public/js/components/vbform/vertragsbestandteil_funktion.js b/public/js/components/vbform/vertragsbestandteil_funktion.js
index 8c14a6ddf..6f3194eea 100644
--- a/public/js/components/vbform/vertragsbestandteil_funktion.js
+++ b/public/js/components/vbform/vertragsbestandteil_funktion.js
@@ -1,9 +1,31 @@
import gehaltsbestandteilhelper from './gehaltsbestandteilhelper.js'
import gueltigkeit from './gueltigkeit.js';
+import configurable from '../../mixins/vbform/configurable.js';
export default {
- props: [
- 'id'
+ template: `
+
+ `,
+ components: {
+ 'gehaltsbestandteilhelper': gehaltsbestandteilhelper,
+ 'gueltigkeit': gueltigkeit
+ },
+ mixins: [
+ configurable
],
emits: {
removeVB: null
@@ -16,39 +38,32 @@ export default {
gueltig_bis: ''
}
},
- template: `
-
- `,
- components: {
- 'gehaltsbestandteilhelper': gehaltsbestandteilhelper,
- 'gueltigkeit': gueltigkeit
+ created: function() {
+ this.setDataFromConfig();
},
methods: {
+ setDataFromConfig: function() {
+ if( typeof this.config.data === 'undefined' ) {
+ return;
+ }
+
+ if( typeof this.config.data.funktion !== 'undefined' ) {
+ this.funktion = this.config.data.funktion;
+ }
+ },
removeVB: function() {
- this.$emit('removeVB', {id: this.id});
+ this.$emit('removeVB', {id: this.config.guioptions.id});
},
getPayload: function() {
return {
- funktion: this.funktion,
- orget: this.orget,
- gueltigkeit: this.$refs.gueltigkeit.getPayload(),
- gehaltsbestandteile: this.$refs.gbh.getPayload()
+ type: this.config.type,
+ guioptions: this.config.guioptions,
+ data: {
+ funktion: this.funktion,
+ orget: this.orget,
+ gueltigkeit: this.$refs.gueltigkeit.getPayload()
+ },
+ gbs: this.$refs.gbh.getPayload()
};
}
}
diff --git a/public/js/components/vbform/vertragsbestandteil_stunden.js b/public/js/components/vbform/vertragsbestandteil_stunden.js
index 4cdfafe0d..410a586b5 100644
--- a/public/js/components/vbform/vertragsbestandteil_stunden.js
+++ b/public/js/components/vbform/vertragsbestandteil_stunden.js
@@ -1,9 +1,32 @@
import gehaltsbestandteilhelper from './gehaltsbestandteilhelper.js';
import gueltigkeit from './gueltigkeit.js';
+import configurable from '../../mixins/vbform/configurable.js';
export default {
- props: [
- 'id'
+ template: `
+
+ `,
+ components: {
+ 'gehaltsbestandteilhelper': gehaltsbestandteilhelper,
+ 'gueltigkeit': gueltigkeit
+ },
+ mixins: [
+ configurable
],
emits: {
removeVB: null
@@ -13,35 +36,31 @@ export default {
stunden: ''
}
},
- "template": `
-
- `,
- components: {
- 'gehaltsbestandteilhelper': gehaltsbestandteilhelper,
- 'gueltigkeit': gueltigkeit
+ created: function() {
+ this.setDataFromConfig();
},
methods: {
+ setDataFromConfig: function() {
+ if( typeof this.config.data === 'undefined' ) {
+ return;
+ }
+
+ if( typeof this.config.data.stunden !== 'undefined' ) {
+ this.stunden = this.config.data.stunden;
+ }
+ },
removeVB: function() {
- this.$emit('removeVB', {id: this.id});
+ this.$emit('removeVB', {id: this.config.guioptions.id});
},
getPayload: function() {
return {
- stunden: this.stunden,
- gueltigkeit: this.$refs.gueltigkeit.getPayload(),
- gehaltsbestandteile: this.$refs.gbh.getPayload()
+ type: this.config.type,
+ guioptions: this.config.guioptions,
+ data: {
+ stunden: this.stunden,
+ gueltigkeit: this.$refs.gueltigkeit.getPayload()
+ },
+ gbs: this.$refs.gbh.getPayload()
};
}
}
diff --git a/public/js/components/vbform/vertragsbestandteil_zeitaufzeichnung.js b/public/js/components/vbform/vertragsbestandteil_zeitaufzeichnung.js
index f16555d2d..9a26ca3f8 100644
--- a/public/js/components/vbform/vertragsbestandteil_zeitaufzeichnung.js
+++ b/public/js/components/vbform/vertragsbestandteil_zeitaufzeichnung.js
@@ -1,28 +1,9 @@
import gueltigkeit from './gueltigkeit.js';
+import configurable from '../../mixins/vbform/configurable.js';
export default {
- props: [
- 'id'
- ],
- emits: {
- removeVB: null
- },
- data: function () {
- return {
- zeitaufzeichnung: '',
- azgrelevant: '',
- homeoffice: '',
- gueltig_ab: '',
- gueltig_bis: ''
- }
- },
template: `
-
-
+
@@ -42,23 +23,64 @@ export default {
Home-Office
+
+
+
+
`,
components: {
'gueltigkeit': gueltigkeit
},
+ mixins: [
+ configurable
+ ],
+ emits: {
+ removeVB: null
+ },
+ data: function () {
+ return {
+ zeitaufzeichnung: '',
+ azgrelevant: '',
+ homeoffice: '',
+ gueltig_ab: '',
+ gueltig_bis: ''
+ }
+ },
+ created: function() {
+ this.setDataFromConfig();
+ },
methods: {
+ setDataFromConfig: function() {
+ if( typeof this.config.data === 'undefined' ) {
+ return;
+ }
+
+ if( typeof this.config.data.zeitaufzeichnung !== 'undefined' ) {
+ this.zeitaufzeichnung = this.config.data.zeitaufzeichnung;
+ }
+ if( typeof this.config.data.azgrelevant !== 'undefined' ) {
+ this.azgrelevant = this.config.data.azgrelevant;
+ }
+ if( typeof this.config.data.homeoffice !== 'undefined' ) {
+ this.homeoffice = this.config.data.homeoffice
+ }
+ },
removeVB: function() {
- this.$emit('removeVB', {id: this.id});
+ this.$emit('removeVB', {id: this.config.guioptions.id});
},
getPayload: function() {
return {
- zeitaufzeichnung: this.zeitaufzeichnung,
- azgrelevant: this.azgrelevant,
- homeoffice: this.homeoffice,
- gueltigkeit: this.$refs.gueltigkeit.getPayload(),
+ type: this.config.type,
+ guioptions: this.config.guioptions,
+ data: {
+ zeitaufzeichnung: this.zeitaufzeichnung,
+ azgrelevant: this.azgrelevant,
+ homeoffice: this.homeoffice,
+ gueltigkeit: this.$refs.gueltigkeit.getPayload()
+ }
};
}
}
diff --git a/public/js/components/vbform/vertragsbestandteilhelper.js b/public/js/components/vbform/vertragsbestandteilhelper.js
index 0a3707664..42c0e7e22 100644
--- a/public/js/components/vbform/vertragsbestandteilhelper.js
+++ b/public/js/components/vbform/vertragsbestandteilhelper.js
@@ -2,15 +2,16 @@ import vertragsbestandteilstunden from './vertragsbestandteil_stunden.js';
import vertragsbestandteilzeitaufzeichnung from './vertragsbestandteil_zeitaufzeichnung.js';
import vertragsbestandteilfunktion from './vertragsbestandteil_funktion.js';
import vertragsbestandteilfreitext from './vertragsbestandteil_freitext.js';
+import presetable from '../../mixins/vbform/presetable.js';
+import uuid from '../../helpers/vbform/uuid.js';
export default {
template: `
-
-
`,
data: function() {
return {
- vertragsbestandteiltyp: 'vertragsbestandteil',
+ vertragsbestandteiltyp: '',
payload: {
+ type: 'formdata',
vbs: []
- },
- vbs: [
- {
- type: 'vertragsbestandteilstunden',
- id: 'test1'
- },
- {
- type: 'vertragsbestandteilzeitaufzeichnung',
- id: 'test2'
- }
- ],
+ }
};
},
components: {
@@ -58,41 +44,51 @@ export default {
'vertragsbestandteilfunktion': vertragsbestandteilfunktion,
'vertragsbestandteilfreitext': vertragsbestandteilfreitext,
},
+ mixins: [
+ presetable
+ ],
+ emits: {
+ vbhjsonready: null
+ },
methods: {
addVB: function(e) {
e.preventDefault();
e.stopPropagation();
- var vbid = 'test' + (this.vbs.length + 1);
- this.vbs.push({
+ if( this.vertragsbestandteiltyp === '') {
+ return;
+ }
+
+ this.children.unshift({
type: this.vertragsbestandteiltyp,
- id: vbid
+ guioptions: {
+ id: uuid.get_uuid(),
+ removeable: true
+ }
});
},
removeVB: function(payload) {
- var vbs = this.vbs.filter(function(vb) {
- return vb.id !== payload.id;
+ var children = this.children.filter(function(vb) {
+ return vb.guioptions.id !== payload.id;
});
- this.vbs = vbs;
+ this.children = children;
},
getJSON: function(e) {
e.preventDefault();
e.stopPropagation();
- var vbs = this.vbs;
+ var children = this.children;
var that = this;
this.payload = {
+ type: 'formdata',
vbs: []
};
- vbs.forEach(function(vb) {
- that.payload.vbs.push(that.$refs[vb.id][0].getPayload());
+ children.forEach(function(vb) {
+ that.payload.vbs.push(that.$refs[vb.guioptions.id][0].getPayload());
});
- }
- },
- computed: {
- resjson: function() {
- return JSON.stringify(this.payload, null, 2);
+
+ this.$emit('vbhjsonready', JSON.stringify(this.payload, null, 2));
}
}
}
diff --git a/public/js/helpers/vbform/uuid.js b/public/js/helpers/vbform/uuid.js
new file mode 100644
index 000000000..d8df0c103
--- /dev/null
+++ b/public/js/helpers/vbform/uuid.js
@@ -0,0 +1,14 @@
+export default {
+ get_uuid: function() {
+ var uuidValue = "", k, randomValue;
+ for (k = 0; k < 32; k++) {
+ randomValue = Math.random() * 16 | 0;
+
+ if (k == 8 || k == 12 || k == 16 || k == 20) {
+ uuidValue += "-"
+ }
+ uuidValue += (k == 12 ? 4 : (k == 16 ? (randomValue & 3 | 8) : randomValue)).toString(16);
+ }
+ return uuidValue;
+ }
+}
diff --git a/public/js/mixins/vbform/configurable.js b/public/js/mixins/vbform/configurable.js
new file mode 100644
index 000000000..d8885defb
--- /dev/null
+++ b/public/js/mixins/vbform/configurable.js
@@ -0,0 +1,14 @@
+export default {
+ props: [
+ 'config'
+ ],
+ computed: {
+ isremoveable: function() {
+ return (typeof this.config.guioptions.removeable === 'undefined')
+ ? false : this.config.guioptions.removeable;
+ },
+ getgehaltsbestandteile: function() {
+ return (typeof this.config.gbs !== 'undefined') ? this.config.gbs : [];
+ }
+ }
+}
diff --git a/public/js/mixins/vbform/presetable.js b/public/js/mixins/vbform/presetable.js
new file mode 100644
index 000000000..01612f09b
--- /dev/null
+++ b/public/js/mixins/vbform/presetable.js
@@ -0,0 +1,21 @@
+export default {
+ props: [
+ 'preset'
+ ],
+ data: function() {
+ return {
+ children: []
+ }
+ },
+ created: function() {
+ this.children = JSON.parse(JSON.stringify(this.preset));
+ },
+ watch: {
+ preset: function() {
+ this.children = [];
+ this.$nextTick(function() {
+ this.children = JSON.parse(JSON.stringify(this.preset));
+ });
+ }
+ }
+}