added date & time to meta properties

pull/49/head
A1Gard 2 months ago
parent a7cd5420cd
commit a7034eba5c

@ -20,7 +20,7 @@ class Prop extends Model
'datas' 'datas'
]; ];
public static $prop_types = ['text', 'number', 'checkbox', 'color', 'select', 'multi', 'singlemulti']; public static $prop_types = ['text', 'number', 'checkbox', 'color', 'select', 'multi', 'singlemulti', 'date', 'time'];
public function categories() public function categories()
{ {
@ -36,6 +36,7 @@ class Prop extends Model
return $result; return $result;
} }
public function getDatasAttribute() public function getDatasAttribute()
{ {
$result = []; $result = [];

@ -49,6 +49,12 @@
<searchable-multi-select :items="prop.optionList" value-field="value" <searchable-multi-select :items="prop.optionList" value-field="value"
v-model="meta[prop.name]"></searchable-multi-select> v-model="meta[prop.name]"></searchable-multi-select>
</template> </template>
<template v-if="prop.type == 'date'">
<vue-date-time-picker v-model="meta[prop.name]"></vue-date-time-picker>
</template>
<template v-if="prop.type == 'time'">
<vue-time-picker v-model="meta[prop.name]" :am-pm="false"></vue-time-picker>
</template>
</div> </div>
</div> </div>
</div> </div>
@ -105,6 +111,12 @@
<searchable-multi-select xname="" :items="prop.optionList" value-field="value" <searchable-multi-select xname="" :items="prop.optionList" value-field="value"
v-model="q.data[prop.name]"></searchable-multi-select> v-model="q.data[prop.name]"></searchable-multi-select>
</template> </template>
<template v-if="prop.type == 'date'">
<vue-date-time-picker v-model="q.data[prop.name]"></vue-date-time-picker>
</template>
<template v-if="prop.type == 'time'">
<vue-time-picker v-model="q.data[prop.name]" :am-pm="false"></vue-time-picker>
</template>
</div> </div>
</div> </div>
</template> </template>
@ -148,6 +160,8 @@
import {mapState} from "vuex"; import {mapState} from "vuex";
import searchableMultiSelect from "./SearchableMultiSelect.vue"; import searchableMultiSelect from "./SearchableMultiSelect.vue";
import CurrencyInput from "./CurrencyInput.vue"; import CurrencyInput from "./CurrencyInput.vue";
import VueDateTimePicker from "./vueDateTimePicker.vue";
import vueTimePicker from "./vueTimePicker.vue";
function arraysEqual(arr1, arr2) { function arraysEqual(arr1, arr2) {
if (arr1.length !== arr2.length) { if (arr1.length !== arr2.length) {
@ -163,7 +177,9 @@ export default {
name: "meta-input", name: "meta-input",
components: { components: {
searchableMultiSelect, searchableMultiSelect,
CurrencyInput CurrencyInput,
VueDateTimePicker,
vueTimePicker,
}, },
data: () => { data: () => {
return { return {

Loading…
Cancel
Save