diff --git a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/+ b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/+ new file mode 100644 index 000000000..ad958838f --- /dev/null +++ b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/+ @@ -0,0 +1,64 @@ +import {v4 as uuidv4} from 'uuid' +import Dependency from './Dependency.ts' + +export default class Border { + uuid: string = ""; + formula: string = ""; + calcValue: string = ""; + calcValue1: string = ""; + calcValue2: string = ""; + calcValue3: string = ""; + calcValue4: string = ""; + calcValue5: string = ""; + calcValue6: string = ""; + calcValue7: string = ""; + calcValue8: string = ""; + calcValue9: string = ""; + calcValue10: string = ""; + flatRate: string = ""; + value: string = ""; + dependencys: Dependency[] = []; + + constructor() { + this.uuid = uuidv4(); + } + + addDependency(dep: Dependeny) + { + this.dependencys.push(dep) + } + + toJSON() { + return { + 'formula': this.formula, + 'calcValue': this.calcValue, + 'calcValue1': this.calcValue1, + 'calcValue2': this.calcValue2, + 'calcValue3': this.calcValue3, + 'calcValue4': this.calcValue4, + 'calcValue5': this.calcValue5, + 'calcValue6': this.calcValue6, + 'calcValue7': this.calcValue7, + 'calcValue8': this.calcValue8, + 'calcValue9': this.calcValue9, + 'calcValue10': this.calcValue10, + 'flatRate': this.flatRate, + 'value': this.value, + 'dependencys': this.dependencys.reduce((result, dep) => { + result.push(dep.toJSON()) + return result + }, []) + } + } + fromJSON(obj) { + this.formula = obj.formula + this.value = obj.value + this.flatRate = obj.flatRate + this.calcValue = obj.calcValue + obj.dependencys.map((d) => { + const dep = new Dependency() + dep.fromJSON(d) + this.dependencys.push(dep) + }) + } +} diff --git a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/components/app/elements/HeadlineElementForm.vue b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/components/app/elements/HeadlineElementForm.vue index 5101ac4c5..a93b116ce 100644 --- a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/components/app/elements/HeadlineElementForm.vue +++ b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/components/app/elements/HeadlineElementForm.vue @@ -2,7 +2,6 @@ import HeadlineElement from '@/model/HeadlineElement'; import { computed } from 'vue'; import { Input } from '@/components/ui/input' -import { SquareDot } from 'lucide-vue-next'; const props = defineProps({ modelValue: HeadlineElement @@ -17,10 +16,8 @@ const theModel = computed({ -