pui9-datatables 1.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/dist/demo.html +10 -0
- package/dist/pui9-datatables.common.js +89206 -0
- package/dist/pui9-datatables.common.js.map +1 -0
- package/dist/pui9-datatables.css +5 -0
- package/dist/pui9-datatables.umd.js +89216 -0
- package/dist/pui9-datatables.umd.js.map +1 -0
- package/dist/pui9-datatables.umd.min.js +55 -0
- package/dist/pui9-datatables.umd.min.js.map +1 -0
- package/package-lock.json +15982 -0
- package/package.json +89 -0
- package/src/App.vue +37 -0
- package/src/components/desktop/PuiDatatable.vue +709 -0
- package/src/components/desktop/PuiQuickEditionDatatable.vue +548 -0
- package/src/components/desktop/PuiSimpleDatatable.vue +1498 -0
- package/src/components/desktop/datatables.net-plugins/pagination/input.js +213 -0
- package/src/components/desktop/footer/PuiDatatableFooter.vue +65 -0
- package/src/components/desktop/footer/PuiGridActionFooter.vue +132 -0
- package/src/components/desktop/quickedition/PuiQuickEditionExportBtn.vue +138 -0
- package/src/components/desktop/quickedition/PuiQuickEditionForm.vue +60 -0
- package/src/components/desktop/quickedition/PuiQuickEditionToolbar.vue +144 -0
- package/src/components/desktop/row/PuiGridRowActions.vue +112 -0
- package/src/components/desktop/subdialogs/PuiDatatableColumnMenu.vue +186 -0
- package/src/components/desktop/toolbar/PuiGridToolbar.vue +310 -0
- package/src/components/desktop/toolbar/actions/PuiGridActionListItem.vue +34 -0
- package/src/components/desktop/toolbar/actions/PuiGridActionsBtn.vue +56 -0
- package/src/components/desktop/toolbar/actions/PuiGridActionsDialog.vue +66 -0
- package/src/components/desktop/toolbar/actions/audit/PuiAuditDialog.vue +92 -0
- package/src/components/desktop/toolbar/actions/docgen/PuiDocgenTemplateMatchingsDialog.vue +139 -0
- package/src/components/desktop/toolbar/actions/docgen/PuiDocgenTemplateParametersDialog.vue +317 -0
- package/src/components/desktop/toolbar/actions/importexport/PuiGridExportDialog.vue +187 -0
- package/src/components/desktop/toolbar/actions/importexport/PuiGridImportDialog.vue +421 -0
- package/src/components/desktop/toolbar/export/PuiGridExportBtn.vue +175 -0
- package/src/components/desktop/toolbar/filtercombo/PuiGridFilterCombo.vue +237 -0
- package/src/components/desktop/toolbar/filtering/PuiGridFilterBtns.vue +163 -0
- package/src/components/desktop/toolbar/filtering/PuiGridFilterDialog.vue +434 -0
- package/src/components/desktop/toolbar/filtering/PuiGridFilterGroup.vue +313 -0
- package/src/components/desktop/toolbar/filtering/PuiGridFilterListBtn.vue +85 -0
- package/src/components/desktop/toolbar/filtering/PuiGridFilterListDialog.vue +254 -0
- package/src/components/desktop/toolbar/filtering/PuiGridFilterListItem.vue +192 -0
- package/src/components/desktop/toolbar/filtering/PuiGridFilterRule.vue +517 -0
- package/src/components/desktop/toolbar/grid-configuration/PuiGridConfBtns.vue +99 -0
- package/src/components/desktop/toolbar/grid-configuration/PuiGridConfDialog.vue +640 -0
- package/src/components/desktop/toolbar/grid-configuration/PuiSaveConfigDialog.vue +154 -0
- package/src/components/desktop/toolbar/row/PuiGridCreateBtn.vue +39 -0
- package/src/components/desktop/toolbar/row/PuiGridDeleteBtn.vue +86 -0
- package/src/components/desktop/toolbar/row/PuiGridRefreshBtn.vue +39 -0
- package/src/components/desktop/toolbar/row/PuiGridUpdateBtn.vue +56 -0
- package/src/components/desktop/toolbar/searching/PuiGridSearcher.vue +67 -0
- package/src/components/desktop/toolbar/searching/PuiGridSearcherColumnsList.vue +43 -0
- package/src/components/desktop/toolbar/sorting/PuiGridSortBtn.vue +44 -0
- package/src/components/desktop/toolbar/sorting/PuiGridSortDialog.vue +113 -0
- package/src/components/mobile/PuiDatalist.vue +477 -0
- package/src/components/mobile/PuiSimpleDatalist.vue +313 -0
- package/src/components/mobile/actions/PuiListActionListItem.vue +34 -0
- package/src/components/mobile/actions/PuiListActionsBtn.vue +38 -0
- package/src/components/mobile/actions/PuiListActionsDialog.vue +66 -0
- package/src/components/mobile/footer/PuiListActionFooter.vue +56 -0
- package/src/components/mobile/toolbar/PuiListToolbar.vue +60 -0
- package/src/components/mobile/toolbar/searching/PuiListSearcher.vue +53 -0
- package/src/components/mobile/toolbar/searching/PuiListSearcherColumnsList.vue +43 -0
- package/src/components/mobile/toolbar/sorting/PuiListSortBtn.vue +46 -0
- package/src/components/mobile/toolbar/sorting/PuiListSortDialog.vue +140 -0
- package/src/components/puiaudit/PuiAuditForm.vue +107 -0
- package/src/generalActions.js +135 -0
- package/src/index.js +31 -0
- package/src/main.js +67 -0
- package/src/mixins/PuiActionsBtnMixin.js +287 -0
- package/src/mixins/PuiActionsDialogMixin.js +161 -0
- package/src/mixins/PuiActionsListItemMixin.js +62 -0
- package/src/mixins/PuiDatatablesKeepPage.js +15 -0
- package/src/mixins/PuiGridFormMethodsMixin.js +133 -0
- package/src/mixins/PuiModelConfigurationMixin.js +15 -0
- package/src/mixins/PuiSearcherColumnsListMixin.js +108 -0
- package/src/mixins/PuiSearcherMixin.js +192 -0
- package/src/mixins/PuiSortBtnMixin.js +54 -0
- package/src/mixins/PuiSortDialogMixin.js +256 -0
- package/src/mixins/PuiToolbarBtnMixin.js +66 -0
- package/src/mixins/PuiToolbarDialogMixin.js +12 -0
- package/src/router.js +18 -0
- package/src/tests/PuiContainer.vue +139 -0
- package/src/tests/PuiProfileTestSimpleDatatable.vue +66 -0
- package/src/tests/PuiUserTestCompleteDatatable.vue +126 -0
- package/src/tests/PuiVariableTestQuickEditionDatatable.vue +39 -0
- package/src/tests/PuiVariableTestQuickEditionForm.vue +18 -0
- package/src/tests/modelConfigurations.json +3516 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="configColumns" :class="toolbarCompClass" v-resize="onResize">
|
|
3
|
+
<v-layout class="pui-toolbar" :class="compClass" style="margin-bottom: 1px" ref="secondaryToolbar" v-show="separateToolbar">
|
|
4
|
+
<v-spacer v-if="!isMobile"></v-spacer>
|
|
5
|
+
</v-layout>
|
|
6
|
+
<v-layout class="pui-toolbar" :class="compClass" ref="primaryToolbar">
|
|
7
|
+
<pui-grid-actions-btn v-if="showActionsBtn" :modelName="modelName" :actions="actions"></pui-grid-actions-btn>
|
|
8
|
+
<pui-grid-export-btn v-if="showPuiGridExportBtn" :modelName="modelName"></pui-grid-export-btn>
|
|
9
|
+
<pui-grid-create-btn v-if="showPuiGridCreateBtn" :modelName="modelName"></pui-grid-create-btn>
|
|
10
|
+
<pui-grid-update-btn v-if="showPuiGridUpdateBtn" :modelName="modelName"></pui-grid-update-btn>
|
|
11
|
+
<pui-grid-delete-btn v-if="showPuiGridDeleteBtn" :modelName="modelName"></pui-grid-delete-btn>
|
|
12
|
+
<pui-grid-refresh-btn v-if="showRefreshBtn && !isMobile" :modelName="modelName"></pui-grid-refresh-btn>
|
|
13
|
+
<v-spacer></v-spacer>
|
|
14
|
+
<pui-grid-filter-combo
|
|
15
|
+
v-show="!isMobile"
|
|
16
|
+
v-if="showFilterComboInToolbar()"
|
|
17
|
+
:modelName="modelName"
|
|
18
|
+
:filterCombo="filterCombo"
|
|
19
|
+
></pui-grid-filter-combo>
|
|
20
|
+
<pui-grid-filter-list-btn
|
|
21
|
+
ref="filterListBtn"
|
|
22
|
+
v-if="showOptionInToolbar(showFilterListBtn, showMasterDetailFilterListBtn)"
|
|
23
|
+
:modelName="modelName"
|
|
24
|
+
></pui-grid-filter-list-btn>
|
|
25
|
+
<pui-grid-filter-btns
|
|
26
|
+
ref="filterBtns"
|
|
27
|
+
v-if="showOptionInToolbar(showFilterBtn, showMasterDetailFilterBtn)"
|
|
28
|
+
:columns="configColumns"
|
|
29
|
+
:modelName="modelName"
|
|
30
|
+
></pui-grid-filter-btns>
|
|
31
|
+
<pui-grid-sort-btn
|
|
32
|
+
ref="sortBtn"
|
|
33
|
+
v-if="showOptionInToolbar(showSortBtn, showMasterDetailSortBtn)"
|
|
34
|
+
:columns="configColumns"
|
|
35
|
+
:modelName="modelName"
|
|
36
|
+
:groupedColumn="groupedColumn"
|
|
37
|
+
></pui-grid-sort-btn>
|
|
38
|
+
<pui-grid-conf-btns
|
|
39
|
+
ref="confBtns"
|
|
40
|
+
v-if="showOptionInToolbar(showConfBtn, showMasterDetailConfBtn)"
|
|
41
|
+
:columns="columns"
|
|
42
|
+
:configColumns="configColumns"
|
|
43
|
+
:modelName="modelName"
|
|
44
|
+
:modelNameSuffix="modelNameSuffix"
|
|
45
|
+
></pui-grid-conf-btns>
|
|
46
|
+
<pui-grid-searcher
|
|
47
|
+
ref="searchBtn"
|
|
48
|
+
v-if="showSearcher"
|
|
49
|
+
:columns="configColumns"
|
|
50
|
+
:modelName="modelName"
|
|
51
|
+
:showOnlyVisibleColumns="searcherShowOnlyVisibleColumns"
|
|
52
|
+
></pui-grid-searcher>
|
|
53
|
+
</v-layout>
|
|
54
|
+
<v-flex xs12 sm6 ref="topToolbar">
|
|
55
|
+
<v-layout wrap class="pui-toolbar pt-4" :class="compClass" v-show="!isMobile" v-if="showFilterComboTopToolbar()">
|
|
56
|
+
<v-spacer></v-spacer>
|
|
57
|
+
<pui-grid-filter-combo :modelName="modelName" :filterCombo="filterCombo"></pui-grid-filter-combo>
|
|
58
|
+
</v-layout>
|
|
59
|
+
</v-flex>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<script>
|
|
64
|
+
import PuiGridActionsBtn from './actions/PuiGridActionsBtn';
|
|
65
|
+
import PuiGridExportBtn from './export/PuiGridExportBtn';
|
|
66
|
+
import PuiGridCreateBtn from './row/PuiGridCreateBtn';
|
|
67
|
+
import PuiGridUpdateBtn from './row/PuiGridUpdateBtn';
|
|
68
|
+
import PuiGridDeleteBtn from './row/PuiGridDeleteBtn';
|
|
69
|
+
import PuiGridRefreshBtn from './row/PuiGridRefreshBtn';
|
|
70
|
+
import PuiGridFilterListBtn from './filtering/PuiGridFilterListBtn';
|
|
71
|
+
import PuiGridFilterBtns from './filtering/PuiGridFilterBtns';
|
|
72
|
+
import PuiGridSortBtn from './sorting/PuiGridSortBtn';
|
|
73
|
+
import PuiGridSearcher from './searching/PuiGridSearcher';
|
|
74
|
+
import PuiGridConfBtns from './grid-configuration/PuiGridConfBtns';
|
|
75
|
+
import PuiGridFilterCombo from './filtercombo/PuiGridFilterCombo';
|
|
76
|
+
import $ from 'jquery';
|
|
77
|
+
|
|
78
|
+
export default {
|
|
79
|
+
name: 'PuiGridToolbar',
|
|
80
|
+
components: {
|
|
81
|
+
PuiGridActionsBtn,
|
|
82
|
+
PuiGridExportBtn,
|
|
83
|
+
PuiGridCreateBtn,
|
|
84
|
+
PuiGridUpdateBtn,
|
|
85
|
+
PuiGridDeleteBtn,
|
|
86
|
+
PuiGridRefreshBtn,
|
|
87
|
+
PuiGridFilterListBtn,
|
|
88
|
+
PuiGridFilterBtns,
|
|
89
|
+
PuiGridSortBtn,
|
|
90
|
+
PuiGridSearcher,
|
|
91
|
+
PuiGridConfBtns,
|
|
92
|
+
PuiGridFilterCombo
|
|
93
|
+
},
|
|
94
|
+
props: {
|
|
95
|
+
columns: {
|
|
96
|
+
type: Array,
|
|
97
|
+
required: true
|
|
98
|
+
},
|
|
99
|
+
modelName: {
|
|
100
|
+
type: String,
|
|
101
|
+
required: true
|
|
102
|
+
},
|
|
103
|
+
modelNameSuffix: {
|
|
104
|
+
type: String,
|
|
105
|
+
default: ''
|
|
106
|
+
},
|
|
107
|
+
actions: {
|
|
108
|
+
type: [Array],
|
|
109
|
+
default: () => {
|
|
110
|
+
return [];
|
|
111
|
+
},
|
|
112
|
+
required: false
|
|
113
|
+
},
|
|
114
|
+
searcherShowOnlyVisibleColumns: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: true
|
|
117
|
+
},
|
|
118
|
+
groupedColumn: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: false
|
|
121
|
+
},
|
|
122
|
+
masterDetail: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: false
|
|
125
|
+
},
|
|
126
|
+
readOnly: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: false
|
|
129
|
+
},
|
|
130
|
+
showActionsBtn: {
|
|
131
|
+
type: Boolean,
|
|
132
|
+
default: true
|
|
133
|
+
},
|
|
134
|
+
showExportsBtn: {
|
|
135
|
+
type: Boolean,
|
|
136
|
+
default: true
|
|
137
|
+
},
|
|
138
|
+
showCreateBtn: {
|
|
139
|
+
type: Boolean,
|
|
140
|
+
default: true
|
|
141
|
+
},
|
|
142
|
+
showUpdateBtn: {
|
|
143
|
+
type: Boolean,
|
|
144
|
+
default: true
|
|
145
|
+
},
|
|
146
|
+
showDeleteBtn: {
|
|
147
|
+
type: Boolean,
|
|
148
|
+
default: true
|
|
149
|
+
},
|
|
150
|
+
showRefreshBtn: {
|
|
151
|
+
type: Boolean,
|
|
152
|
+
default: true
|
|
153
|
+
},
|
|
154
|
+
showFilterListBtn: {
|
|
155
|
+
type: Boolean,
|
|
156
|
+
default: true
|
|
157
|
+
},
|
|
158
|
+
showFilterBtn: {
|
|
159
|
+
type: Boolean,
|
|
160
|
+
default: true
|
|
161
|
+
},
|
|
162
|
+
showSortBtn: {
|
|
163
|
+
type: Boolean,
|
|
164
|
+
default: true
|
|
165
|
+
},
|
|
166
|
+
showConfBtn: {
|
|
167
|
+
type: Boolean,
|
|
168
|
+
default: true
|
|
169
|
+
},
|
|
170
|
+
showSearcher: {
|
|
171
|
+
type: Boolean,
|
|
172
|
+
default: true
|
|
173
|
+
},
|
|
174
|
+
showMasterDetailFilterListBtn: {
|
|
175
|
+
type: Boolean,
|
|
176
|
+
default: false
|
|
177
|
+
},
|
|
178
|
+
showMasterDetailFilterBtn: {
|
|
179
|
+
type: Boolean,
|
|
180
|
+
default: false
|
|
181
|
+
},
|
|
182
|
+
showMasterDetailSortBtn: {
|
|
183
|
+
type: Boolean,
|
|
184
|
+
default: false
|
|
185
|
+
},
|
|
186
|
+
showMasterDetailConfBtn: {
|
|
187
|
+
type: Boolean,
|
|
188
|
+
default: false
|
|
189
|
+
},
|
|
190
|
+
showFilterComboSelect: {
|
|
191
|
+
type: Boolean,
|
|
192
|
+
default: true
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
data() {
|
|
196
|
+
return {
|
|
197
|
+
isMobile: false,
|
|
198
|
+
configColumns: null,
|
|
199
|
+
showPuiGridExportBtn: false,
|
|
200
|
+
showPuiGridCreateBtn: false,
|
|
201
|
+
showPuiGridUpdateBtn: false,
|
|
202
|
+
showPuiGridDeleteBtn: false,
|
|
203
|
+
filterCombo: null,
|
|
204
|
+
windowWidth: window.innerWidth
|
|
205
|
+
};
|
|
206
|
+
},
|
|
207
|
+
computed: {
|
|
208
|
+
toolbarCompClass() {
|
|
209
|
+
return this.windowWidth < 1600 ? 'pt-1 pb-1' : 'pt-3 pb-3';
|
|
210
|
+
},
|
|
211
|
+
compClass() {
|
|
212
|
+
return this.isMobile ? 'pui-toolbar--mobile' : 'pui-toolbar--desktop';
|
|
213
|
+
},
|
|
214
|
+
separateToolbar() {
|
|
215
|
+
return this.windowWidth < 1600;
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
created() {
|
|
219
|
+
this.isMobile = this.$store.getters.isMobile;
|
|
220
|
+
this.splitColumns();
|
|
221
|
+
const model = this.$store.getters.getModelByName(this.modelName);
|
|
222
|
+
if (model) {
|
|
223
|
+
this.showPuiGridExportBtn = this.showExportsBtn && model.url && model.url.export && !this.isMobile;
|
|
224
|
+
if (model.functionalities) {
|
|
225
|
+
this.showPuiGridCreateBtn =
|
|
226
|
+
this.showCreateBtn && this.$store.getters.hasFunctionality(model.functionalities.insert) && this.readOnly === false;
|
|
227
|
+
this.showPuiGridUpdateBtn =
|
|
228
|
+
this.showUpdateBtn &&
|
|
229
|
+
this.$store.getters.hasFunctionality(model.functionalities.update) &&
|
|
230
|
+
this.readOnly === false &&
|
|
231
|
+
this.isMobile;
|
|
232
|
+
this.showPuiGridDeleteBtn =
|
|
233
|
+
this.showDeleteBtn && this.$store.getters.hasFunctionality(model.functionalities.delete) && this.readOnly === false;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const defaultModelConfig = this.$store.getters.getGridConfiguration(this.modelName, -1);
|
|
238
|
+
this.filterCombo = defaultModelConfig && defaultModelConfig.configuration && defaultModelConfig.configuration.filterCombo;
|
|
239
|
+
|
|
240
|
+
if (this.showFilterComboTopToolbar()) {
|
|
241
|
+
this.$store.commit('setContainerActionHeader', false);
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
mounted() {
|
|
245
|
+
if (this.showFilterComboTopToolbar()) {
|
|
246
|
+
$(this.$parent.$parent.$parent.$parent.$refs['pui-container__header']).append(this.$refs.topToolbar);
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
beforeDestroy() {
|
|
250
|
+
$(this.$refs.topToolbar).remove();
|
|
251
|
+
this.$store.commit('setContainerActionHeader', true);
|
|
252
|
+
},
|
|
253
|
+
methods: {
|
|
254
|
+
onResize() {
|
|
255
|
+
this.windowWidth = window.innerWidth;
|
|
256
|
+
if (this.windowWidth < 1600) {
|
|
257
|
+
// move filters/sort/config buttons to secondary toolbar
|
|
258
|
+
this.$refs.filterListBtn && this.$refs.secondaryToolbar.appendChild(this.$refs.filterListBtn.$el);
|
|
259
|
+
this.$refs.filterBtns && this.$refs.secondaryToolbar.appendChild(this.$refs.filterBtns.$el);
|
|
260
|
+
this.$refs.sortBtn && this.$refs.secondaryToolbar.appendChild(this.$refs.sortBtn.$el);
|
|
261
|
+
this.$refs.confBtns && this.$refs.secondaryToolbar.appendChild(this.$refs.confBtns.$el);
|
|
262
|
+
} else {
|
|
263
|
+
// move filters/sort/config buttons to primary toolbar
|
|
264
|
+
this.$refs.filterListBtn && this.$refs.primaryToolbar.appendChild(this.$refs.filterListBtn.$el);
|
|
265
|
+
this.$refs.filterBtns && this.$refs.primaryToolbar.appendChild(this.$refs.filterBtns.$el);
|
|
266
|
+
this.$refs.sortBtn && this.$refs.primaryToolbar.appendChild(this.$refs.sortBtn.$el);
|
|
267
|
+
this.$refs.confBtns && this.$refs.primaryToolbar.appendChild(this.$refs.confBtns.$el);
|
|
268
|
+
this.$refs.searchBtn && this.$refs.primaryToolbar.appendChild(this.$refs.searchBtn.$el);
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
splitColumns() {
|
|
272
|
+
//las columnas que se pueden ver, y por tanto son configurables
|
|
273
|
+
this.configColumns = this.columns
|
|
274
|
+
.filter((column) => {
|
|
275
|
+
return column.completelyhidden !== true;
|
|
276
|
+
})
|
|
277
|
+
.sort(function (a, b) {
|
|
278
|
+
if (a.name > b.name) {
|
|
279
|
+
return 1;
|
|
280
|
+
}
|
|
281
|
+
if (a.name < b.name) {
|
|
282
|
+
return -1;
|
|
283
|
+
}
|
|
284
|
+
return 0;
|
|
285
|
+
});
|
|
286
|
+
},
|
|
287
|
+
showFilterComboInToolbar() {
|
|
288
|
+
if (this.showFilterComboSelect && this.filterCombo && this.masterDetail) {
|
|
289
|
+
return true;
|
|
290
|
+
}
|
|
291
|
+
return false;
|
|
292
|
+
},
|
|
293
|
+
showFilterComboTopToolbar() {
|
|
294
|
+
if (this.showFilterComboSelect && this.filterCombo && !this.masterDetail) {
|
|
295
|
+
return true;
|
|
296
|
+
}
|
|
297
|
+
return false;
|
|
298
|
+
},
|
|
299
|
+
showOptionInToolbar(option, masterDetailOption) {
|
|
300
|
+
if (this.isMobile) {
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
if (this.masterDetail) {
|
|
304
|
+
return masterDetailOption;
|
|
305
|
+
}
|
|
306
|
+
return option;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
</script>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-layout :id="getUniqueID" ref="theItem" wrap class="puiGridActionListItem mb-1 mt-1" :class="getCompClass" @click="selectItem()">
|
|
3
|
+
<v-flex xs12>
|
|
4
|
+
<span class="puiGridActionListItem__titleicon" v-if="isSingleAction">
|
|
5
|
+
<v-icon class="puiGridActionListItem__icon">far fa-bolt</v-icon>
|
|
6
|
+
</span>
|
|
7
|
+
<span class="puiGridActionListItem__titleicon" v-if="isMultipleAction">
|
|
8
|
+
<v-icon class="puiGridActionListItem__icon">fas fa-bolt</v-icon>
|
|
9
|
+
</span>
|
|
10
|
+
<span class="puiGridActionListItem__titleicon" v-if="isGeneralAction">
|
|
11
|
+
<v-icon class="puiGridActionListItem__icon">far fa-asterisk</v-icon>
|
|
12
|
+
</span>
|
|
13
|
+
<span class="puiGridActionListItem__title">{{ getTranslatedLabel }}</span>
|
|
14
|
+
<span class="puiGridActionListItem__titleicon__favorite" v-if="isFavoriteAction" @click.stop="unsetFavorite()">
|
|
15
|
+
<v-icon class="puiGridActionListItem__icon">fas fa-star</v-icon>
|
|
16
|
+
</span>
|
|
17
|
+
<span class="puiGridActionListItem__titleicon__nofavorite" v-else @click.stop="setFavorite()">
|
|
18
|
+
<v-icon class="puiGridActionListItem__icon">far fa-star</v-icon>
|
|
19
|
+
</span>
|
|
20
|
+
<span class="puiGridActionListItem__titleicon__lock" v-show="isLockedAction">
|
|
21
|
+
<v-icon class="puiGridActionListItem__icon">fas fa-lock</v-icon>
|
|
22
|
+
</span>
|
|
23
|
+
</v-flex>
|
|
24
|
+
</v-layout>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
import PuiActionsListItemMixin from '../../../../mixins/PuiActionsListItemMixin';
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
name: 'PuiGridActionListItem',
|
|
32
|
+
mixins: [PuiActionsListItemMixin]
|
|
33
|
+
};
|
|
34
|
+
</script>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pui-gridActionsBtn">
|
|
3
|
+
<v-btn :id="`gridbtn-actions-${modelName}`" class="elevation-0 pui-toolbar__btn ml-0" :class="compClass" @click.native.stop="showSubPanel">
|
|
4
|
+
<span>{{ $t('puidatatables.actions') }}</span>
|
|
5
|
+
<span class="ml-2">
|
|
6
|
+
<v-icon v-if="!states.active" small>fa fa-angle-down</v-icon>
|
|
7
|
+
<v-icon v-else small>fa fa-angle-up</v-icon>
|
|
8
|
+
</span>
|
|
9
|
+
</v-btn>
|
|
10
|
+
<label v-if="label">{{ label }}</label>
|
|
11
|
+
<pui-grid-actions-dialog
|
|
12
|
+
:modelName="modelName"
|
|
13
|
+
:actions="internalActions"
|
|
14
|
+
:position="panel.position"
|
|
15
|
+
v-show="states.active"
|
|
16
|
+
:visibility="states.active"
|
|
17
|
+
:insideForm="insideForm"
|
|
18
|
+
></pui-grid-actions-dialog>
|
|
19
|
+
<pui-grid-import-dialog
|
|
20
|
+
v-if="showPuiImportExportAction"
|
|
21
|
+
:modelName="modelName"
|
|
22
|
+
:importExportModelName="importExportModelName"
|
|
23
|
+
></pui-grid-import-dialog>
|
|
24
|
+
<pui-grid-export-dialog
|
|
25
|
+
v-if="showPuiImportExportAction"
|
|
26
|
+
:modelName="modelName"
|
|
27
|
+
:importExportModelName="importExportModelName"
|
|
28
|
+
></pui-grid-export-dialog>
|
|
29
|
+
<pui-docgen-template-matchings-dialog v-if="showPuiDocgenAction" :modelName="modelName"></pui-docgen-template-matchings-dialog>
|
|
30
|
+
<pui-docgen-template-parameters-dialog v-if="showPuiDocgenAction" :parentModelName="modelName"></pui-docgen-template-parameters-dialog>
|
|
31
|
+
<pui-audit-dialog :modelName="modelName"></pui-audit-dialog>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script>
|
|
36
|
+
import PuiActionsBtnMixin from '../../../../mixins/PuiActionsBtnMixin';
|
|
37
|
+
import PuiGridActionsDialog from './PuiGridActionsDialog';
|
|
38
|
+
import PuiGridImportDialog from './importexport/PuiGridImportDialog';
|
|
39
|
+
import PuiGridExportDialog from './importexport/PuiGridExportDialog';
|
|
40
|
+
import PuiDocgenTemplateMatchingsDialog from './docgen/PuiDocgenTemplateMatchingsDialog';
|
|
41
|
+
import PuiDocgenTemplateParametersDialog from './docgen/PuiDocgenTemplateParametersDialog';
|
|
42
|
+
import PuiAuditDialog from './audit/PuiAuditDialog';
|
|
43
|
+
|
|
44
|
+
export default {
|
|
45
|
+
name: 'PuiGridActionsBtn',
|
|
46
|
+
mixins: [PuiActionsBtnMixin],
|
|
47
|
+
components: {
|
|
48
|
+
PuiGridActionsDialog,
|
|
49
|
+
PuiGridImportDialog,
|
|
50
|
+
PuiGridExportDialog,
|
|
51
|
+
PuiDocgenTemplateMatchingsDialog,
|
|
52
|
+
PuiDocgenTemplateParametersDialog,
|
|
53
|
+
PuiAuditDialog
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
</script>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pui-gridActionsDialog elevation-5" :class="{ 'pui-gridActionsDialog--insideForm': insideForm }" :ref="'dialog'" @click.stop>
|
|
3
|
+
<v-layout wrap class="mb-1">
|
|
4
|
+
<v-tabs centered grow v-model="tabActive" slider-color="primary" ref="tabs">
|
|
5
|
+
<v-tab href="#tab1" ref="tab1">{{ $t('puidatatables.all') }}</v-tab>
|
|
6
|
+
<v-tab href="#tab2" ref="tab2">{{ $t('puidatatables.favorites') }}</v-tab>
|
|
7
|
+
|
|
8
|
+
<v-tab-item value="tab1" class="mt-2">
|
|
9
|
+
<pui-text-field
|
|
10
|
+
id="searchFilter1"
|
|
11
|
+
class="ma-1 mr-2 ml-2"
|
|
12
|
+
:placeholder="getPlaceholder"
|
|
13
|
+
v-model="searchAll"
|
|
14
|
+
clearable
|
|
15
|
+
prepend-inner-icon="far fa-search"
|
|
16
|
+
noeditable
|
|
17
|
+
realtime
|
|
18
|
+
></pui-text-field>
|
|
19
|
+
<div class="pui-gridActionsDialog__list">
|
|
20
|
+
<pui-grid-action-list-item
|
|
21
|
+
v-for="action in filteredActionsAll"
|
|
22
|
+
:key="action.id"
|
|
23
|
+
:action="action"
|
|
24
|
+
:modelName="modelName"
|
|
25
|
+
:ref="`simple-${action.id}`"
|
|
26
|
+
></pui-grid-action-list-item>
|
|
27
|
+
</div>
|
|
28
|
+
</v-tab-item>
|
|
29
|
+
<v-tab-item value="tab2" class="mt-2">
|
|
30
|
+
<pui-text-field
|
|
31
|
+
id="searchFilter2"
|
|
32
|
+
class="ma-1 mr-2 ml-2"
|
|
33
|
+
:placeholder="getPlaceholder"
|
|
34
|
+
v-model="searchFav"
|
|
35
|
+
clearable
|
|
36
|
+
prepend-inner-icon="far fa-search"
|
|
37
|
+
noeditable
|
|
38
|
+
realtime
|
|
39
|
+
></pui-text-field>
|
|
40
|
+
<div class="pui-gridActionsDialog__list">
|
|
41
|
+
<pui-grid-action-list-item
|
|
42
|
+
v-for="action in filteredActionsFavorites"
|
|
43
|
+
:key="action.id"
|
|
44
|
+
:action="action"
|
|
45
|
+
:modelName="modelName"
|
|
46
|
+
:ref="`favorites-${action.id}`"
|
|
47
|
+
></pui-grid-action-list-item>
|
|
48
|
+
</div>
|
|
49
|
+
</v-tab-item>
|
|
50
|
+
</v-tabs>
|
|
51
|
+
</v-layout>
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script>
|
|
56
|
+
import PuiActionsDialogMixin from '../../../../mixins/PuiActionsDialogMixin';
|
|
57
|
+
import PuiGridActionListItem from './PuiGridActionListItem';
|
|
58
|
+
|
|
59
|
+
export default {
|
|
60
|
+
name: 'PuiGridActionsDialog',
|
|
61
|
+
mixins: [PuiActionsDialogMixin],
|
|
62
|
+
components: {
|
|
63
|
+
PuiGridActionListItem
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
</script>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<pui-modal-dialog
|
|
3
|
+
v-if="showDialog"
|
|
4
|
+
:overflow="false"
|
|
5
|
+
:titleText="$t('puiaudit.title')"
|
|
6
|
+
messageText
|
|
7
|
+
:okText="$t('form.close')"
|
|
8
|
+
:dialogName="dialogName"
|
|
9
|
+
:widthDialog="widthDialog"
|
|
10
|
+
>
|
|
11
|
+
<template slot="message">
|
|
12
|
+
<v-layout wrap>
|
|
13
|
+
<v-flex xs12>
|
|
14
|
+
<pui-quick-edition-datatable
|
|
15
|
+
modelName="puiaudit"
|
|
16
|
+
formPosition="right"
|
|
17
|
+
formComponentName="PuiAuditForm"
|
|
18
|
+
:formModelTemplate="formModelTemplate"
|
|
19
|
+
:disabled="true"
|
|
20
|
+
:quickEditionExternalFilter="externalFilter"
|
|
21
|
+
:modelColumnDefs="modelColumnDefs"
|
|
22
|
+
></pui-quick-edition-datatable>
|
|
23
|
+
</v-flex>
|
|
24
|
+
</v-layout>
|
|
25
|
+
</template>
|
|
26
|
+
</pui-modal-dialog>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
export default {
|
|
31
|
+
name: 'PuiAuditDialog',
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
dialogName: 'puiaudit',
|
|
35
|
+
showDialog: false,
|
|
36
|
+
widthDialog: window.innerWidth - 50,
|
|
37
|
+
formModelTemplate: {
|
|
38
|
+
type: null,
|
|
39
|
+
content: null
|
|
40
|
+
},
|
|
41
|
+
modelColumnDefs: {
|
|
42
|
+
id: { visible: false },
|
|
43
|
+
datetime: { visible: true },
|
|
44
|
+
usr: { visible: true },
|
|
45
|
+
client: { visible: false },
|
|
46
|
+
ip: { visible: false },
|
|
47
|
+
type: { visible: true },
|
|
48
|
+
model: { visible: false },
|
|
49
|
+
pk: { visible: false },
|
|
50
|
+
content: { visible: false }
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
props: {
|
|
55
|
+
modelName: {
|
|
56
|
+
type: String,
|
|
57
|
+
required: true
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
computed: {
|
|
61
|
+
externalFilter() {
|
|
62
|
+
const filter = {
|
|
63
|
+
groupOp: 'and',
|
|
64
|
+
rules: [
|
|
65
|
+
{ field: 'model', op: 'eq', data: this.$store.state.puiaudit.tableName },
|
|
66
|
+
{ field: 'pk', op: 'eq', data: this.$store.state.puiaudit.tablePk }
|
|
67
|
+
],
|
|
68
|
+
groups: [
|
|
69
|
+
{
|
|
70
|
+
groupOp: 'or',
|
|
71
|
+
rules: [{ field: 'type', op: 'in', data: 'insert,update,delete' }]
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
};
|
|
75
|
+
return filter;
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
mounted() {
|
|
79
|
+
this.$puiEvents.$on(`pui-modalDialog-${this.dialogName}-show`, () => {
|
|
80
|
+
this.showDialog = true;
|
|
81
|
+
});
|
|
82
|
+
this.$puiEvents.$on(`pui-modalDialog-${this.dialogName}-ok`, () => {
|
|
83
|
+
this.$puiEvents.$emit(`onPui-action-running-ended-${this.modelName}`);
|
|
84
|
+
this.showDialog = false;
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
destroyed() {
|
|
88
|
+
this.$puiEvents.$off(`pui-modalDialog-${this.dialogName}-show`);
|
|
89
|
+
this.$puiEvents.$off(`pui-modalDialog-${this.dialogName}-ok`);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
</script>
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<pui-modal-dialog-form
|
|
3
|
+
:overflow="false"
|
|
4
|
+
:titleText="$t('puidocgentemplate.selectTemplate.title')"
|
|
5
|
+
:modelName="modelName"
|
|
6
|
+
:dialogName="dialogNamePuiDocgenTemplateMatching"
|
|
7
|
+
v-model="dialogData"
|
|
8
|
+
:widthDialog="800"
|
|
9
|
+
:showDialogProp="showDialogPuiDocgenTemplateMatching"
|
|
10
|
+
:onOk="onOkGetMatchingTemplates"
|
|
11
|
+
>
|
|
12
|
+
<template slot="message">
|
|
13
|
+
<v-layout wrap class="pui-form-layout">
|
|
14
|
+
<v-flex xs12>
|
|
15
|
+
<v-select
|
|
16
|
+
class="pr-2"
|
|
17
|
+
append-icon="fa fa-angle-down"
|
|
18
|
+
solo
|
|
19
|
+
flat
|
|
20
|
+
hide-details
|
|
21
|
+
required
|
|
22
|
+
:items="templates"
|
|
23
|
+
item-value="id"
|
|
24
|
+
item-text="name"
|
|
25
|
+
v-model="model.template"
|
|
26
|
+
return-object
|
|
27
|
+
@input="changeDescription"
|
|
28
|
+
></v-select>
|
|
29
|
+
</v-flex>
|
|
30
|
+
<v-flex xs12>
|
|
31
|
+
<v-text-field
|
|
32
|
+
class="pr-2 inputFilterText"
|
|
33
|
+
type="text"
|
|
34
|
+
solo
|
|
35
|
+
flat
|
|
36
|
+
outlined
|
|
37
|
+
hide-details
|
|
38
|
+
disabled
|
|
39
|
+
readonly
|
|
40
|
+
v-model="description"
|
|
41
|
+
></v-text-field>
|
|
42
|
+
</v-flex>
|
|
43
|
+
</v-layout>
|
|
44
|
+
</template>
|
|
45
|
+
</pui-modal-dialog-form>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script>
|
|
49
|
+
export default {
|
|
50
|
+
name: 'PuiDocgenTemplateMatchingsDialog',
|
|
51
|
+
data() {
|
|
52
|
+
return {
|
|
53
|
+
docgenTemplateModelName: 'puidocgentemplate',
|
|
54
|
+
model: {},
|
|
55
|
+
dialogData: {},
|
|
56
|
+
templates: [],
|
|
57
|
+
description: '',
|
|
58
|
+
dialogNamePuiDocgenTemplateMatching: 'puiDocgenTemplateMatching',
|
|
59
|
+
showDialogPuiDocgenTemplateMatching: false
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
props: {
|
|
63
|
+
modelName: {
|
|
64
|
+
type: String,
|
|
65
|
+
required: true
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
watch: {
|
|
69
|
+
dialogData: {
|
|
70
|
+
handler(newValue) {
|
|
71
|
+
if (newValue.isAction && newValue.model && (newValue.registries || newValue.parameters)) {
|
|
72
|
+
this.getMatchingTemplates(newValue);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
deep: true
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
methods: {
|
|
79
|
+
getRules() {
|
|
80
|
+
return [(value) => !!value || 'Required'];
|
|
81
|
+
},
|
|
82
|
+
changeDescription() {
|
|
83
|
+
if (this.model.template.description) {
|
|
84
|
+
this.description = this.model.template.description;
|
|
85
|
+
} else {
|
|
86
|
+
this.description = '';
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
getMatchingTemplates(data) {
|
|
90
|
+
this.docgenTemplateModel = this.$store.getters.getModelByName(this.docgenTemplateModelName);
|
|
91
|
+
this.docgenTemplateRegistries = data.registries;
|
|
92
|
+
this.docgenTemplateParameters = data.parameters;
|
|
93
|
+
|
|
94
|
+
const params = { model: data.model.name };
|
|
95
|
+
|
|
96
|
+
this.$puiRequests.getRequest(
|
|
97
|
+
this.docgenTemplateModel.url.getMatchingTemplates,
|
|
98
|
+
params,
|
|
99
|
+
(response) => {
|
|
100
|
+
this.model.template = null;
|
|
101
|
+
for (let i = 0, templatesLength = response.data.length; i < templatesLength; i++) {
|
|
102
|
+
this.templates.push(response.data[i]);
|
|
103
|
+
if (i === 0) {
|
|
104
|
+
this.model.template = response.data[i];
|
|
105
|
+
this.changeDescription();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
this.showDialogPuiDocgenTemplateMatching = true;
|
|
110
|
+
},
|
|
111
|
+
(error) => {
|
|
112
|
+
const title = this.$puiI18n.t('puiaction.notifyTitle') + ' > ' + this.$t('puiaction.docgen.getMatchingTemplates');
|
|
113
|
+
let message = this.$puiI18n.t('puiaction.notifyError');
|
|
114
|
+
if (error.response && error.response.data) {
|
|
115
|
+
message = error.response.data.message;
|
|
116
|
+
}
|
|
117
|
+
this.$puiEvents.$emit(`onPui-action-running-ended-${this.modelName}`);
|
|
118
|
+
this.$puiNotify.error(message, title);
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
},
|
|
122
|
+
onOkGetMatchingTemplates(modalData) {
|
|
123
|
+
modalData.isAction = false;
|
|
124
|
+
// end action and close current dialog
|
|
125
|
+
this.$puiEvents.$emit(`onPui-action-running-ended-${this.modelName}`);
|
|
126
|
+
this.showDialogPuiDocgenTemplateMatching = false;
|
|
127
|
+
// open template parameters dialog
|
|
128
|
+
const data = {
|
|
129
|
+
isAction: true,
|
|
130
|
+
model: this.docgenTemplateModel,
|
|
131
|
+
registry: this.model.template,
|
|
132
|
+
registries: this.docgenTemplateRegistries,
|
|
133
|
+
parameters: this.docgenTemplateParameters
|
|
134
|
+
};
|
|
135
|
+
this.$puiEvents.$emit(`pui-modalDialogForm-puiDocgenTemplateParameters-${this.docgenTemplateModelName}-show`, data);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
</script>
|