Skip to content

Commit 5877eeb

Browse files
committed
item elements, refresh token, poprawki w tabeli
1 parent a120e3b commit 5877eeb

File tree

19 files changed

+527
-174
lines changed

19 files changed

+527
-174
lines changed

src/components/DataTable.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@
103103
<!-- table fields -->
104104
<td v-if="key != 'active'" v-for="(field, key) in props.item" class="text-xs-center" v-html="field"></td>
105105
</template>
106-
<template slot="pageText" slot-scope="{ pageStart, pageStop }">
107-
{{ $t('from') }} {{ pageStart }} {{ $t('to') }} {{ pageStop }}
106+
<template slot="pageText" slot-scope="{ pageStart, pageStop, itemsLength }">
107+
{{ $t('records') }} {{ pageStart }} - {{ pageStop }} {{ $t('from') }} {{ itemsLength }}
108108
</template>
109109
</v-data-table>
110110
</v-card>
@@ -292,7 +292,6 @@
292292
obj
293293
])
294294
this.getItemElements()
295-
this.editItemElementsDialog()
296295
}
297296
},
298297
i18n: {
@@ -312,8 +311,8 @@
312311
noMatchingResults: "Nie znaleziono pasujących rekordów",
313312
noDataAvailable: "Brak danych",
314313
rowsPerPageText: "Rekordów na stronę:",
315-
from: "od",
316-
to: "do",
314+
records: "Rekordy",
315+
from: "z",
317316
add: "Dodaj",
318317
all: "Wszystko",
319318
buttons: {
@@ -341,8 +340,8 @@
341340
noMatchingResults: "No matching records found",
342341
noDataAvailable: "No data available",
343342
rowsPerPageText: "Rows per page:",
343+
records: "Records",
344344
from: "from",
345-
to: "to",
346345
add: "Add",
347346
all: "All",
348347
buttons: {

src/components/ItemDetails.vue

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<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;">
33
<v-card>
44
<v-card-title class="headline">{{ title }}</v-card-title>
55
<v-form v-model="details.formValid">
@@ -26,15 +26,32 @@
2626
:item-value="field.list.value" :label="field.text" bottom autocomplete></v-select>
2727

2828
<!-- 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>
3350

3451
<!-- rich text editor -->
3552
<template v-else-if="field.type == 'richTextBox'">
3653
<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>
3855
<br>
3956
</template>
4057

@@ -52,7 +69,9 @@
5269
</template>
5370
<script>
5471
import Vue from 'vue'
55-
import { VueEditor } from 'vue2-editor'
72+
import {
73+
VueEditor
74+
} from 'vue2-editor'
5675
import {
5776
mapState,
5877
mapGetters,
@@ -62,7 +81,7 @@
6281
6382
export default {
6483
components: {
65-
VueEditor
84+
VueEditor
6685
},
6786
props: [
6887
'title',
@@ -98,9 +117,6 @@
98117
}
99118
})
100119
}
101-
else if (field.type == 'datePicker') {
102-
//field.value = ''
103-
}
104120
}
105121
},
106122
computed: {
@@ -112,8 +128,12 @@
112128
let result = this.fieldsInfo.map(field => {
113129
let rField = field
114130
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+
}
117137
}
118138
return rField
119139
})

0 commit comments

Comments
 (0)