This commit is contained in:
@@ -54,7 +54,8 @@ export default {
|
|||||||
"Print",
|
"Print",
|
||||||
"WikiPage",
|
"WikiPage",
|
||||||
"Duplicate",
|
"Duplicate",
|
||||||
"RecordHistory"
|
"RecordHistory",
|
||||||
|
"ErrorFieldLengthExceeded"
|
||||||
],
|
],
|
||||||
decimalValidate(required) {
|
decimalValidate(required) {
|
||||||
return { required: required, decimal: [2, this.formats.decimalSeparator] };
|
return { required: required, decimal: [2, this.formats.decimalSeparator] };
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import dayjs from "dayjs";
|
|||||||
import lodash from "./libs/lodash.min.js";
|
import lodash from "./libs/lodash.min.js";
|
||||||
import locale from "./api/locale";
|
import locale from "./api/locale";
|
||||||
import gzapi from "./api/apiutil";
|
import gzapi from "./api/apiutil";
|
||||||
|
import gzvalidate from "./api/gzvalidate";
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
// LIBS AND GLOBAL ITEMS
|
// LIBS AND GLOBAL ITEMS
|
||||||
@@ -25,6 +26,7 @@ Object.defineProperty(Vue.prototype, "$dayjs", { value: dayjs });
|
|||||||
Object.defineProperty(Vue.prototype, "$_", { value: lodash });
|
Object.defineProperty(Vue.prototype, "$_", { value: lodash });
|
||||||
Object.defineProperty(Vue.prototype, "$gzlocale", { value: locale });
|
Object.defineProperty(Vue.prototype, "$gzlocale", { value: locale });
|
||||||
Object.defineProperty(Vue.prototype, "$gzapi", { value: gzapi });
|
Object.defineProperty(Vue.prototype, "$gzapi", { value: gzapi });
|
||||||
|
Object.defineProperty(Vue.prototype, "$gzv", { value: gzvalidate });
|
||||||
Object.defineProperty(Vue.prototype, "$gzerror", {
|
Object.defineProperty(Vue.prototype, "$gzerror", {
|
||||||
value: errorHandler.handleFormError
|
value: errorHandler.handleFormError
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-layout>
|
<v-layout v-if="this.formReady">
|
||||||
<v-flex>
|
<v-flex>
|
||||||
<form>
|
<form>
|
||||||
<v-layout align-center justify-left row wrap>
|
<v-layout align-center justify-left row wrap>
|
||||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="obj.name"
|
v-model="obj.name"
|
||||||
:counter="255"
|
:counter="255"
|
||||||
:label="this.$gzlocale.get('WidgetName')"
|
:label="this.$gzlocale.get('WidgetName')"
|
||||||
name="name"
|
name="name"
|
||||||
required
|
required
|
||||||
@@ -14,17 +14,18 @@
|
|||||||
</v-flex>
|
</v-flex>
|
||||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="obj.serial"
|
v-model="obj.serial"
|
||||||
:counter="10"
|
:counter="10"
|
||||||
:label="this.$gzlocale.get('WidgetSerial')"
|
:label="this.$gzlocale.get('WidgetSerial')"
|
||||||
|
:rules="[this.$gzv.MaxLength('WidgetSerial',obj.serial,10)]"
|
||||||
name="serial"
|
name="serial"
|
||||||
required
|
required
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="obj.count"
|
v-model="obj.count"
|
||||||
:counter="10"
|
:counter="10"
|
||||||
:label="this.$gzlocale.get('WidgetCount')"
|
:label="this.$gzlocale.get('WidgetCount')"
|
||||||
name="count"
|
name="count"
|
||||||
required
|
required
|
||||||
@@ -34,7 +35,7 @@
|
|||||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="obj.dollarAmount"
|
v-model="obj.dollarAmount"
|
||||||
:prefix="this.$gzlocale.formats.currencySymbol"
|
:prefix="this.$gzlocale.formats.currencySymbol"
|
||||||
:label="this.$gzlocale.get('WidgetDollarAmount')"
|
:label="this.$gzlocale.get('WidgetDollarAmount')"
|
||||||
name="dollarAmount"
|
name="dollarAmount"
|
||||||
required
|
required
|
||||||
@@ -70,7 +71,7 @@
|
|||||||
<gz-date-time-picker
|
<gz-date-time-picker
|
||||||
:label="this.$gzlocale.get('WidgetStartDate')"
|
:label="this.$gzlocale.get('WidgetStartDate')"
|
||||||
v-model="obj.startDate"
|
v-model="obj.startDate"
|
||||||
name="startDate"
|
name="startDate"
|
||||||
></gz-date-time-picker>
|
></gz-date-time-picker>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
|
|
||||||
@@ -78,19 +79,18 @@
|
|||||||
<gz-date-time-picker
|
<gz-date-time-picker
|
||||||
:label="this.$gzlocale.get('WidgetEndDate')"
|
:label="this.$gzlocale.get('WidgetEndDate')"
|
||||||
v-model="obj.endDate"
|
v-model="obj.endDate"
|
||||||
name="endDate"
|
name="endDate"
|
||||||
></gz-date-time-picker>
|
></gz-date-time-picker>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||||
<v-checkbox
|
<v-checkbox
|
||||||
v-model="obj.active"
|
v-model="obj.active"
|
||||||
value="1"
|
value="1"
|
||||||
:label="this.$gzlocale.get('Active')"
|
:label="this.$gzlocale.get('Active')"
|
||||||
name="checkbox"
|
name="checkbox"
|
||||||
required
|
required
|
||||||
></v-checkbox>
|
></v-checkbox>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
|
|
||||||
</v-layout>
|
</v-layout>
|
||||||
|
|
||||||
<v-layout align-center justify-space-around row wrap mt-5>
|
<v-layout align-center justify-space-around row wrap mt-5>
|
||||||
@@ -142,7 +142,13 @@ export default {
|
|||||||
"WidgetCustom15",
|
"WidgetCustom15",
|
||||||
"WidgetCustom16"
|
"WidgetCustom16"
|
||||||
].concat(this.$gzlocale.commonKeysEditForm);
|
].concat(this.$gzlocale.commonKeysEditForm);
|
||||||
this.$gzlocale.fetch(ltKeysRequired);
|
this.$gzlocale
|
||||||
|
.fetch(ltKeysRequired)
|
||||||
|
.then(() => (this.formReady = true))
|
||||||
|
.catch(err => {
|
||||||
|
this.formReady = true;
|
||||||
|
this.$gzerror(err);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getDataFromApi();
|
this.getDataFromApi();
|
||||||
@@ -151,6 +157,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
obj: {},
|
obj: {},
|
||||||
|
formReady: false,
|
||||||
theDate: new Date(),
|
theDate: new Date(),
|
||||||
date: new Date().toISOString().substr(0, 10),
|
date: new Date().toISOString().substr(0, 10),
|
||||||
menu: false,
|
menu: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user