Media
This commit is contained in:
parent
9f7ad503ef
commit
5ce737a749
@ -28,4 +28,8 @@ const theModel = computed({
|
|||||||
<Input v-model="theModel!.name"/>
|
<Input v-model="theModel!.name"/>
|
||||||
<Checkbox v-model="theModel!.required"/>
|
<Checkbox v-model="theModel!.required"/>
|
||||||
<label class="form-check-label" for="flexSwitchCheckDefault">Required</label>
|
<label class="form-check-label" for="flexSwitchCheckDefault">Required</label>
|
||||||
|
<label>Min</label>
|
||||||
|
<Input v-model="theModel!.minValue"/>
|
||||||
|
<label>Max</label>
|
||||||
|
<Input v-model="theModel!.maxValue"/>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -6,6 +6,8 @@ export default class InputElement extends BaseElement {
|
|||||||
required: boolean = false
|
required: boolean = false
|
||||||
name: string = ""
|
name: string = ""
|
||||||
xmlType: string = "input"
|
xmlType: string = "input"
|
||||||
|
minValue: int = 0
|
||||||
|
maxValue: int = 0
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
@ -19,6 +21,8 @@ export default class InputElement extends BaseElement {
|
|||||||
'placeHolder': this.placeholder,
|
'placeHolder': this.placeholder,
|
||||||
'default': this.default,
|
'default': this.default,
|
||||||
'name': this.name,
|
'name': this.name,
|
||||||
|
'minValue': this.minValue,
|
||||||
|
'maxValue': this.maxValue,
|
||||||
'required': this.required
|
'required': this.required
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -29,5 +33,7 @@ export default class InputElement extends BaseElement {
|
|||||||
this.default = obj.default
|
this.default = obj.default
|
||||||
this.required = obj.required
|
this.required = obj.required
|
||||||
this.placeHolder = obj.placeHolder
|
this.placeHolder = obj.placeHolder
|
||||||
|
this.minValue = obj.minValue
|
||||||
|
this.maxValue = obj.maxValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,27 @@
|
|||||||
|
import BaseElement from "./BaseElement";
|
||||||
|
|
||||||
|
export default class MediaElement extends BaseElement {
|
||||||
|
default: string = ""
|
||||||
|
name: string = ""
|
||||||
|
xmlType: string = "img"
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.type = 8
|
||||||
|
}
|
||||||
|
|
||||||
|
public toJSON() {
|
||||||
|
return Object.assign(
|
||||||
|
super.toJSON(),
|
||||||
|
{
|
||||||
|
'default': this.default,
|
||||||
|
'name': this.name,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fromJSON(obj) {
|
||||||
|
super.fromJSON(obj)
|
||||||
|
this.name = obj.name
|
||||||
|
this.default = obj.default
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -15,30 +15,30 @@
|
|||||||
}
|
}
|
||||||
echo '$("#upload_mode").val("' . TP_Basket::getBasket()->getTempProduct($this->article->uuid)->getUploadMode() . '");';
|
echo '$("#upload_mode").val("' . TP_Basket::getBasket()->getTempProduct($this->article->uuid)->getUploadMode() . '");';
|
||||||
}
|
}
|
||||||
if($this->layouterSession) {
|
if($this->layouterSession) {
|
||||||
echo '$("#upload_mode").val("' . $this->layouterSession->layouter_modus . '");';
|
echo '$("#upload_mode").val("' . $this->layouterSession->layouter_modus . '");';
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ($this->load || $this->rebuy) {
|
if ($this->load || $this->rebuy) {
|
||||||
echo '$("#upload_mode").val("' . TP_Basket::getBasket()->getTempProduct($this->article->uuid)->getUploadMode() . '");';
|
echo '$("#upload_mode").val("' . TP_Basket::getBasket()->getTempProduct($this->article->uuid)->getUploadMode() . '");';
|
||||||
}
|
}
|
||||||
if($this->layouterSession) {
|
if($this->layouterSession) {
|
||||||
echo '$("#upload_mode").val("' . $this->layouterSession->layouter_modus . '");';
|
echo '$("#upload_mode").val("' . $this->layouterSession->layouter_modus . '");';
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
$('#in_basket').removeClass('disabled');
|
$('#in_basket').removeClass('disabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<div class="md:flex">
|
<div class="md:flex">
|
||||||
<form id="CALCFORM" class="m-2 basis-2/3"></form>
|
<form id="CALCFORM" class="basis-2/3"></form>
|
||||||
<div class="basis-1/3 m-2">
|
<div class="basis-1/3"
|
||||||
<h2 class="text-lg font-lenzFont font-medium">Summe</h2>
|
<h2 class="text-lg font-lenzFont font-medium">Summe</h2>
|
||||||
<table class="table-auto w-full">
|
<table class="table-auto w-full">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@ -66,7 +66,8 @@ $(function(){
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data: JSON.stringify({productUUId: productUUId, values: formArray, count: 1, uploadMode: $('#upload_mode').val(), deliveryDate: delivery_date, deliveryInfo: delivery_info, xmlProduct: xmlProduct }),
|
data: JSON.stringify({productUUId: productUUId, values: formArray, count: 1, uploadMode: $('#upload_mode').val(), deliveryDate: delivery_date, deliveryInfo: delivery_info, xmlProduct: xmlProduct }),
|
||||||
success: function(result){
|
success: function(result){
|
||||||
document.location="/basket";
|
parent.postMessage({action: 'setBasketCount', data: 0}, '*');
|
||||||
|
parent.postMessage({action: 'redirectBasket'}, '*');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
@ -78,7 +79,8 @@ $(function(){
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data: JSON.stringify({productUUId: productUUId, values: formArray, count: 1, uploadMode: $('#upload_mode').val(), deliveryDate: delivery_date, deliveryInfo: delivery_info, xmlProduct: xmlProduct }),
|
data: JSON.stringify({productUUId: productUUId, values: formArray, count: 1, uploadMode: $('#upload_mode').val(), deliveryDate: delivery_date, deliveryInfo: delivery_info, xmlProduct: xmlProduct }),
|
||||||
success: function(result){
|
success: function(result){
|
||||||
document.location="/basket";
|
parent.postMessage({action: 'setBasketCount', data: 0}, '*');
|
||||||
|
parent.postMessage({action: 'redirectBasket'}, '*');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
@ -435,13 +437,13 @@ function buildForm(elements, display_group = "", validElements = []) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$element = $('<div>').addClass("form-controls");
|
$element = $('<div>').addClass("form-controls");
|
||||||
$inputGroup = $('<div class="input-group input-group-sm">');
|
$inputGroup = $('<div class="flex flex-row gap-1">');
|
||||||
$inputGroup.appendTo($element);
|
$inputGroup.appendTo($element);
|
||||||
$obj.appendTo($inputGroup);
|
$obj.appendTo($inputGroup);
|
||||||
|
|
||||||
addOrReplaceFormElement(previousId, element.id, $container, $element, $label, element.valid, display_group);
|
addOrReplaceFormElement(previousId, element.id, $container, $element, $label, element.valid, display_group);
|
||||||
if(element.helpLink) {
|
if(element.helpLink) {
|
||||||
$obj.after('<div class="input-group-append"><a class="btn btn-outline-primary btn-circle" onclick="modalopen(\'' + element.helpLink + '\');return false;" target="_blank" href="' + element.helpLink + '">?</a></div>');
|
$obj.after('<div class="input-group-append"><a class="block w-full transition ease-in-out duration-300 delay-150 hover:bg-white hover:text-black border-slate-200 border bg-highlight text-black p-3 bg-slate-100 " onclick="modalopen(\'' + element.helpLink + '\');return false;" target="_blank" href="' + element.helpLink + '">?</a></div>');
|
||||||
}
|
}
|
||||||
|
|
||||||
previousId = element.id;
|
previousId = element.id;
|
||||||
@ -482,6 +484,5 @@ function addOrReplaceFormElement(previousId, id, $container, $element, $label, v
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function modalopen(href) {
|
function modalopen(href) {
|
||||||
$('.help-modal').load(href,function(){
|
window.open(href);
|
||||||
$('#myModal').modal({show:true});});
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user