|
1 | 1 | <template> |
2 | | - <v-dialog v-model="details.show" max-width="480"> |
| 2 | + <v-dialog v-model="details.show" max-width="600" style="position:static !important;"> |
3 | 3 | <v-card> |
4 | 4 | <v-card-title class="headline">{{ title }}</v-card-title> |
5 | 5 | <v-form v-model="details.formValid"> |
|
26 | 26 | :item-value="field.list.value" :label="field.text" bottom autocomplete></v-select> |
27 | 27 |
|
28 | 28 | <!-- date picker --> |
29 | | - <v-dialog v-else-if="field.type == 'datePicker'" v-model="modal" lazy full-width width="290px"> |
30 | | - <v-text-field slot="activator" :label="field.text" v-model="field.value" prepend-icon="event" readonly></v-text-field> |
31 | | - <v-date-picker :first-day-of-week="0" locale="pl" v-model="field.value" scrollable actions autosave></v-date-picker> |
32 | | - </v-dialog> |
| 29 | + |
| 30 | + <v-menu |
| 31 | + v-else-if="field.type == 'datePicker'" |
| 32 | + lazy |
| 33 | + :close-on-content-click="true" |
| 34 | + v-model="field.show" |
| 35 | + transition="scale-transition" |
| 36 | + offset-y |
| 37 | + full-width |
| 38 | + :nudge-right="40" |
| 39 | + min-width="290px" |
| 40 | + :return-value.sync="field.value" |
| 41 | + > |
| 42 | + <v-text-field |
| 43 | + slot="activator" |
| 44 | + :label="field.text" |
| 45 | + v-model="field.value" |
| 46 | + prepend-icon="event" |
| 47 | + ></v-text-field> |
| 48 | + <v-date-picker v-model="field.value" no-title scrollable></v-date-picker> |
| 49 | + </v-menu> |
33 | 50 |
|
34 | 51 | <!-- rich text editor --> |
35 | 52 | <template v-else-if="field.type == 'richTextBox'"> |
36 | 53 | <label>{{field.text}}</label> |
37 | | - <vue-editor v-model="field.value"></vue-editor> |
| 54 | + <vue-editor id="editor" v-model="field.value" :editorOptions="{bounds: '#editor'}"></vue-editor> |
38 | 55 | <br> |
39 | 56 | </template> |
40 | 57 |
|
|
52 | 69 | </template> |
53 | 70 | <script> |
54 | 71 | import Vue from 'vue' |
55 | | - import { VueEditor } from 'vue2-editor' |
| 72 | + import { |
| 73 | + VueEditor |
| 74 | + } from 'vue2-editor' |
56 | 75 | import { |
57 | 76 | mapState, |
58 | 77 | mapGetters, |
|
62 | 81 |
|
63 | 82 | export default { |
64 | 83 | components: { |
65 | | - VueEditor |
| 84 | + VueEditor |
66 | 85 | }, |
67 | 86 | props: [ |
68 | 87 | 'title', |
|
98 | 117 | } |
99 | 118 | }) |
100 | 119 | } |
101 | | - else if (field.type == 'datePicker') { |
102 | | - //field.value = '' |
103 | | - } |
104 | 120 | } |
105 | 121 | }, |
106 | 122 | computed: { |
|
112 | 128 | let result = this.fieldsInfo.map(field => { |
113 | 129 | let rField = field |
114 | 130 | rField.value = this.details.item[field.column] |
115 | | - if (field.type == 'select') { |
116 | | - rField.value = parseInt(this.details.item[field.column]) || 1 |
| 131 | + if (typeof rField.value != 'undefined') { |
| 132 | + if (field.type == 'select') { |
| 133 | + rField.value = parseInt(this.details.item[field.column]) || 1 |
| 134 | + } else if (field.type == 'datePicker') { |
| 135 | + rField.value = this.details.item[field.column].substring(0, 10) |
| 136 | + } |
117 | 137 | } |
118 | 138 | return rField |
119 | 139 | }) |
|
0 commit comments