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,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pui-toolbar__multiBtn ml-2 mr-2" :class="compClass">
|
|
3
|
+
<div ref="btn">
|
|
4
|
+
<v-btn
|
|
5
|
+
class="elevation-0 pui-toolbar__bt pui-toolbar__btn pui-toolbar__miniBtn"
|
|
6
|
+
:class="compClass"
|
|
7
|
+
@click.native="toggleSorting()"
|
|
8
|
+
:title="$t('puidatatables.titleBtnEnableDisableSorting')"
|
|
9
|
+
>
|
|
10
|
+
<v-icon small>fa fa-sort-amount-down</v-icon>
|
|
11
|
+
</v-btn>
|
|
12
|
+
<div class="pui-toolbar__multiBtnSeparator">|</div>
|
|
13
|
+
<v-btn
|
|
14
|
+
:small="$store.getters.isMobile"
|
|
15
|
+
:style="$store.getters.isMobile ? 'padding: 0px 3px' : ''"
|
|
16
|
+
class="elevation-0 pui-toolbar__btn pui-toolbar__superMiniBtn"
|
|
17
|
+
@click.native.stop="states.active = !states.active"
|
|
18
|
+
:class="compClass"
|
|
19
|
+
:title="$t('puidatatables.titleBtnShowHideSorting')"
|
|
20
|
+
>
|
|
21
|
+
<v-icon v-if="!states.active" small>fa fa-angle-down</v-icon>
|
|
22
|
+
<v-icon v-else small>fa fa-angle-up</v-icon>
|
|
23
|
+
</v-btn>
|
|
24
|
+
</div>
|
|
25
|
+
<pui-list-sort-dialog
|
|
26
|
+
:columns="columns"
|
|
27
|
+
:modelName="modelName"
|
|
28
|
+
:position="panel.position"
|
|
29
|
+
:groupedColumn="groupedColumn"
|
|
30
|
+
v-show="states.active"
|
|
31
|
+
></pui-list-sort-dialog>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script>
|
|
36
|
+
import PuiSortBtnMixin from '../../../../mixins/PuiSortBtnMixin';
|
|
37
|
+
import PuiListSortDialog from './PuiListSortDialog';
|
|
38
|
+
|
|
39
|
+
export default {
|
|
40
|
+
name: 'PuiListSortBtn',
|
|
41
|
+
mixins: [PuiSortBtnMixin],
|
|
42
|
+
components: {
|
|
43
|
+
PuiListSortDialog
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
</script>
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pui-dialog pui-dialog--sorting" ref="dialog" @click.stop>
|
|
3
|
+
<v-layout wrap>
|
|
4
|
+
<v-flex xs12>
|
|
5
|
+
<v-card flat>
|
|
6
|
+
<v-card-text class="pt-0 pr-0 pl-0 pb-0">
|
|
7
|
+
<!-- slot1, TODO MAKE SLOTS IN FILTER AND SORTING DIALOGS-->
|
|
8
|
+
<v-list-item>
|
|
9
|
+
<v-list-item-action-text class="pui-dialog__title">{{ $t('puidatatables.sort') }}</v-list-item-action-text>
|
|
10
|
+
</v-list-item>
|
|
11
|
+
<v-flex xs12 class="pui-dialog__ruleContainer mb-1" :style="{ height: heightPanel }">
|
|
12
|
+
<draggable v-model="rules" v-bind="{ group: 'rules' }" @end="removeSelectsFocus">
|
|
13
|
+
<div v-for="(rule, index) in rules" class="pui-dialog__rule" :key="index">
|
|
14
|
+
<v-layout class="rule" wrap align-center>
|
|
15
|
+
<v-flex xs1>
|
|
16
|
+
<v-list-item class="move draggable_point" pl-2 pr-2 v-show="(grouped === true && index === 0) === false">
|
|
17
|
+
<v-icon small>far fa-ellipsis-v</v-icon>
|
|
18
|
+
<v-icon small>far fa-ellipsis-v</v-icon>
|
|
19
|
+
</v-list-item>
|
|
20
|
+
</v-flex>
|
|
21
|
+
<v-flex xs9>
|
|
22
|
+
<v-layout wrap>
|
|
23
|
+
<v-flex xs12>
|
|
24
|
+
<v-autocomplete
|
|
25
|
+
class="font-size-12"
|
|
26
|
+
label="column"
|
|
27
|
+
append-icon="fa fa-angle-down"
|
|
28
|
+
v-model="rule.column"
|
|
29
|
+
:ref="`${index}-column`"
|
|
30
|
+
:disabled="grouped === true && index === 0"
|
|
31
|
+
solo
|
|
32
|
+
flat
|
|
33
|
+
@change="setIndex(index), onRuleNameChanged($event, index)"
|
|
34
|
+
:items="getAvailableColumns(index)"
|
|
35
|
+
item-text="title"
|
|
36
|
+
item-value="name"
|
|
37
|
+
hide-selected
|
|
38
|
+
hide-details
|
|
39
|
+
></v-autocomplete>
|
|
40
|
+
</v-flex>
|
|
41
|
+
</v-layout>
|
|
42
|
+
<v-layout wrap>
|
|
43
|
+
<v-flex xs12>
|
|
44
|
+
<v-select
|
|
45
|
+
append-icon="fa fa-angle-down"
|
|
46
|
+
class="font-size-12"
|
|
47
|
+
v-model="rule.direction"
|
|
48
|
+
:ref="`${index}-sortType`"
|
|
49
|
+
solo
|
|
50
|
+
flat
|
|
51
|
+
:items="sortingTypes"
|
|
52
|
+
:label="$t('puidatatables.ascendent')"
|
|
53
|
+
hide-details
|
|
54
|
+
></v-select>
|
|
55
|
+
</v-flex>
|
|
56
|
+
</v-layout>
|
|
57
|
+
</v-flex>
|
|
58
|
+
<v-flex xs1 class="pointer" @click="removeRule(index)" v-show="(grouped === true && index === 0) === false">
|
|
59
|
+
<v-list-item>
|
|
60
|
+
<v-icon small class="trashIcon" :title="getTitleRemove">fa fa-trash-alt</v-icon>
|
|
61
|
+
</v-list-item>
|
|
62
|
+
</v-flex>
|
|
63
|
+
</v-layout>
|
|
64
|
+
<v-divider />
|
|
65
|
+
</div>
|
|
66
|
+
</draggable>
|
|
67
|
+
</v-flex>
|
|
68
|
+
<v-flex xs12 v-show="showAddBtn">
|
|
69
|
+
<v-btn class="btnAdd elevation-0 mt-0 mb-1" @click="addRule()">
|
|
70
|
+
<v-icon small>far fa-plus</v-icon>
|
|
71
|
+
<span>{{ $t('puidatatables.addRule') }}</span>
|
|
72
|
+
</v-btn>
|
|
73
|
+
</v-flex>
|
|
74
|
+
</v-card-text>
|
|
75
|
+
<!-- slot1-->
|
|
76
|
+
<v-card-actions class="ma-0 pb-1 pr-1 pl-1">
|
|
77
|
+
<v-btn text outlined @click="reset()" class="pui-dialog__button">{{ $t('puidatatables.reset') }}</v-btn>
|
|
78
|
+
<v-spacer></v-spacer>
|
|
79
|
+
<v-btn color="primary" @click="publishSorting()" class="elevation-0">{{ $t('form.apply') }}</v-btn>
|
|
80
|
+
</v-card-actions>
|
|
81
|
+
</v-card>
|
|
82
|
+
</v-flex>
|
|
83
|
+
</v-layout>
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
86
|
+
|
|
87
|
+
<script>
|
|
88
|
+
import PuiSortDialogMixin from '../../../../mixins/PuiSortDialogMixin';
|
|
89
|
+
|
|
90
|
+
export default {
|
|
91
|
+
name: 'PuiListSortDialog',
|
|
92
|
+
mixins: [PuiSortDialogMixin],
|
|
93
|
+
watch: {
|
|
94
|
+
// Override mixin
|
|
95
|
+
rules(val) {
|
|
96
|
+
var size = 100;
|
|
97
|
+
if (val.length > 0) {
|
|
98
|
+
this.height = val.length * size;
|
|
99
|
+
} else {
|
|
100
|
+
this.height = size;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
methods: {
|
|
105
|
+
// Override mixin
|
|
106
|
+
calculatePosition() {
|
|
107
|
+
this.$refs.dialog.style.right = '5px';
|
|
108
|
+
this.$refs.dialog.style.width = `${window.innerWidth - 10}px`;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
</script>
|
|
113
|
+
|
|
114
|
+
<style lang="postcss" scoped>
|
|
115
|
+
.trashIcon {
|
|
116
|
+
top: 10px;
|
|
117
|
+
position: absolute;
|
|
118
|
+
}
|
|
119
|
+
.btnAdd {
|
|
120
|
+
height: 28px !important;
|
|
121
|
+
color: var(--N-500);
|
|
122
|
+
&.v-btn {
|
|
123
|
+
background-color: var(--N-0) !important;
|
|
124
|
+
}
|
|
125
|
+
& span {
|
|
126
|
+
padding-left: 6px;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.draggable_point .v-icon {
|
|
131
|
+
margin-top: -12px;
|
|
132
|
+
color: var(--N-50);
|
|
133
|
+
}
|
|
134
|
+
.draggable_btn {
|
|
135
|
+
width: 20px !important;
|
|
136
|
+
& .v-icon {
|
|
137
|
+
margin-top: -12px;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
</style>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table_wrapper">
|
|
3
|
+
<table>
|
|
4
|
+
<thead>
|
|
5
|
+
<tr>
|
|
6
|
+
<th>{{ $t('puiaudit.attribute') }}</th>
|
|
7
|
+
<th v-if="type === 'update'">{{ $t('puiaudit.oldValue') }}</th>
|
|
8
|
+
<th>{{ $t('puiaudit.newValue') }}</th>
|
|
9
|
+
</tr>
|
|
10
|
+
</thead>
|
|
11
|
+
<tbody>
|
|
12
|
+
<tr v-for="(item, index) in content" :key="index">
|
|
13
|
+
<td>
|
|
14
|
+
<span>{{ item.attribute }}</span>
|
|
15
|
+
</td>
|
|
16
|
+
<td v-if="type === 'update'">
|
|
17
|
+
<table v-if="item.oldValue && Array.isArray(item.oldValue)">
|
|
18
|
+
<tr>
|
|
19
|
+
<th>{{ $t('puiaudit.attribute') }}</th>
|
|
20
|
+
<th>{{ $t('puiaudit.value') }}</th>
|
|
21
|
+
</tr>
|
|
22
|
+
<tr v-for="(internalItem, internalIndex) in item.oldValue" :key="internalIndex">
|
|
23
|
+
<td>
|
|
24
|
+
<span>{{ internalItem[0].attribute }}</span>
|
|
25
|
+
</td>
|
|
26
|
+
<td>
|
|
27
|
+
<span>{{ internalItem[0].value }}</span>
|
|
28
|
+
</td>
|
|
29
|
+
</tr>
|
|
30
|
+
</table>
|
|
31
|
+
|
|
32
|
+
<span v-else>{{ item.oldValue }}</span>
|
|
33
|
+
</td>
|
|
34
|
+
|
|
35
|
+
<td v-if="item.value && Array.isArray(item.value)">
|
|
36
|
+
<table>
|
|
37
|
+
<tr>
|
|
38
|
+
<th>{{ $t('puiaudit.attribute') }}</th>
|
|
39
|
+
<th>{{ $t('puiaudit.value') }}</th>
|
|
40
|
+
</tr>
|
|
41
|
+
<tr v-for="(internalItem, internalIndex) in item.value" :key="internalIndex">
|
|
42
|
+
<td>
|
|
43
|
+
<span>{{ internalItem[0].attribute }}</span>
|
|
44
|
+
</td>
|
|
45
|
+
<td>
|
|
46
|
+
<span>{{ internalItem[0].value }}</span>
|
|
47
|
+
</td>
|
|
48
|
+
</tr>
|
|
49
|
+
</table>
|
|
50
|
+
</td>
|
|
51
|
+
<td v-else>
|
|
52
|
+
<span>{{ item.value }}</span>
|
|
53
|
+
</td>
|
|
54
|
+
</tr>
|
|
55
|
+
</tbody>
|
|
56
|
+
</table>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script>
|
|
61
|
+
export default {
|
|
62
|
+
name: 'PuiAuditForm',
|
|
63
|
+
data() {
|
|
64
|
+
return {
|
|
65
|
+
type: 'insert',
|
|
66
|
+
content: []
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
props: {
|
|
70
|
+
model: {
|
|
71
|
+
type: Object,
|
|
72
|
+
required: true
|
|
73
|
+
},
|
|
74
|
+
formDisabled: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
required: true
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
watch: {
|
|
80
|
+
model(newValue) {
|
|
81
|
+
this.type = newValue.type;
|
|
82
|
+
this.content = JSON.parse(newValue.content);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
</script>
|
|
87
|
+
|
|
88
|
+
<style scoped>
|
|
89
|
+
.table_wrapper {
|
|
90
|
+
height: 600px;
|
|
91
|
+
overflow-y: scroll;
|
|
92
|
+
}
|
|
93
|
+
table {
|
|
94
|
+
width: 100%;
|
|
95
|
+
}
|
|
96
|
+
table,
|
|
97
|
+
th,
|
|
98
|
+
td {
|
|
99
|
+
border: 1px solid #dddddd;
|
|
100
|
+
border-collapse: collapse;
|
|
101
|
+
}
|
|
102
|
+
th,
|
|
103
|
+
td {
|
|
104
|
+
padding: 8px 10px;
|
|
105
|
+
text-align: left;
|
|
106
|
+
}
|
|
107
|
+
</style>
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
const puiGridImport = {
|
|
2
|
+
id: 'puiImportAction',
|
|
3
|
+
selectionType: 'general',
|
|
4
|
+
label: 'puiaction.import',
|
|
5
|
+
functionality: 'EXECUTE_IMPORT_EXPORT',
|
|
6
|
+
showInForm: false,
|
|
7
|
+
checkAvailability: function () {
|
|
8
|
+
return true;
|
|
9
|
+
},
|
|
10
|
+
runAction: function (action, model) {
|
|
11
|
+
const modelName = `${model.name}_importexport`;
|
|
12
|
+
this.$puiEvents.$emit(`pui-show-importDialog-${modelName}`);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const puiGridExport = {
|
|
17
|
+
id: 'puiExportAction',
|
|
18
|
+
selectionType: 'general',
|
|
19
|
+
label: 'puiaction.export',
|
|
20
|
+
functionality: 'EXECUTE_IMPORT_EXPORT',
|
|
21
|
+
showInForm: false,
|
|
22
|
+
checkAvailability: function () {
|
|
23
|
+
return true;
|
|
24
|
+
},
|
|
25
|
+
runAction: function (action, model) {
|
|
26
|
+
const modelName = `${model.name}_importexport`;
|
|
27
|
+
this.$puiEvents.$emit(`pui-show-exportDialog-${modelName}`);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const puiGridCopy = {
|
|
32
|
+
id: 'copyAction',
|
|
33
|
+
selectionType: 'single',
|
|
34
|
+
label: 'puiaction.copy',
|
|
35
|
+
functionality: 'EXECUTE_COPY',
|
|
36
|
+
showInForm: true,
|
|
37
|
+
checkAvailability: function () {
|
|
38
|
+
return true;
|
|
39
|
+
},
|
|
40
|
+
runAction: function (action, model, registries) {
|
|
41
|
+
const copyObjectPk = {};
|
|
42
|
+
|
|
43
|
+
for (var index in model.columns) {
|
|
44
|
+
const column = model.columns[index];
|
|
45
|
+
if (column.isPk) {
|
|
46
|
+
copyObjectPk[column.name] = registries[0][column.name];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const pk = this.$puiUtils.utf8ToB64(JSON.stringify(copyObjectPk));
|
|
51
|
+
|
|
52
|
+
if (this.$router.currentRoute.params.method) {
|
|
53
|
+
// action executed inside form so, replace route
|
|
54
|
+
const params = {
|
|
55
|
+
router: this.$router,
|
|
56
|
+
url: `/${model.name}/copy/${pk}`,
|
|
57
|
+
params: null,
|
|
58
|
+
query: {},
|
|
59
|
+
replace: true
|
|
60
|
+
};
|
|
61
|
+
this.$store.dispatch('puiRouterGoToUrl', params);
|
|
62
|
+
} else {
|
|
63
|
+
// action executed in datatable
|
|
64
|
+
const params = {
|
|
65
|
+
router: this.$router,
|
|
66
|
+
url: `${model.name}/copy/${pk}`,
|
|
67
|
+
params: null,
|
|
68
|
+
query: {}
|
|
69
|
+
};
|
|
70
|
+
this.$store.dispatch('puiRouterGoToUrl', params);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const puiDocgenMatchingTemplates = {
|
|
76
|
+
id: 'puiDocgenAction',
|
|
77
|
+
selectionType: 'multiple',
|
|
78
|
+
label: 'puiaction.docgen.generate',
|
|
79
|
+
functionality: 'GEN_PUI_DOCGEN',
|
|
80
|
+
showInForm: false,
|
|
81
|
+
applicableToCurrentFilter: true,
|
|
82
|
+
checkAvailability: function () {
|
|
83
|
+
return true;
|
|
84
|
+
},
|
|
85
|
+
runAction: function (action, model, registries, parameters) {
|
|
86
|
+
const pkRegistries = [];
|
|
87
|
+
|
|
88
|
+
if (registries) {
|
|
89
|
+
for (let i = 0; i < registries.length; i++) {
|
|
90
|
+
const pkRegistry = {};
|
|
91
|
+
for (var index in model.columns) {
|
|
92
|
+
const column = model.columns[index];
|
|
93
|
+
if (column.isPk) {
|
|
94
|
+
pkRegistry[column.name] = registries[i][column.name];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
pkRegistries.push(pkRegistry);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const data = { isAction: true, model: model, registries: pkRegistries, parameters: parameters };
|
|
102
|
+
this.$puiEvents.$emit(`pui-modalDialogForm-puiDocgenTemplateMatching-${model.name}-show`, data);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const puiAudit = {
|
|
107
|
+
id: 'puiAuditAction',
|
|
108
|
+
selectionType: 'single',
|
|
109
|
+
label: 'puiaction.audit',
|
|
110
|
+
functionality: 'ACTION_PUI_AUDIT',
|
|
111
|
+
showInForm: true,
|
|
112
|
+
checkAvailability: function () {
|
|
113
|
+
return true;
|
|
114
|
+
},
|
|
115
|
+
runAction: function (action, model, registries) {
|
|
116
|
+
let pk = '';
|
|
117
|
+
|
|
118
|
+
for (var index in model.columns) {
|
|
119
|
+
const column = model.columns[index];
|
|
120
|
+
if (column.isPk) {
|
|
121
|
+
pk += registries[0][column.name] + '#';
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
pk = pk.substr(0, pk.length - 1);
|
|
125
|
+
|
|
126
|
+
let tableName = this.$store.getters.getModelByName(model.name).table;
|
|
127
|
+
|
|
128
|
+
this.$store.commit('setPuiAuditData', { tableName: tableName, tablePk: pk });
|
|
129
|
+
this.$puiEvents.$emit('pui-modalDialog-puiaudit-show');
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export default {
|
|
134
|
+
actions: [puiGridImport, puiGridExport, puiGridCopy, puiDocgenMatchingTemplates, puiAudit]
|
|
135
|
+
};
|
package/src/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import PuiDocgenTemplateParametersDialog from './components/desktop/toolbar/actions/docgen/PuiDocgenTemplateParametersDialog';
|
|
2
|
+
import PuiGridActionsBtn from './components/desktop/toolbar/actions/PuiGridActionsBtn';
|
|
3
|
+
import PuiGridFilterDialog from './components/desktop/toolbar/filtering/PuiGridFilterDialog';
|
|
4
|
+
import PuiSimpleDatatable from './components/desktop/PuiSimpleDatatable';
|
|
5
|
+
import PuiDatatable from './components/desktop/PuiDatatable';
|
|
6
|
+
import PuiQuickEditionDatatable from './components/desktop/PuiQuickEditionDatatable';
|
|
7
|
+
import PuiSimpleDatalist from './components/mobile/PuiSimpleDatalist';
|
|
8
|
+
import PuiDatalist from './components/mobile/PuiDatalist';
|
|
9
|
+
import PuiAuditForm from './components/puiaudit/PuiAuditForm';
|
|
10
|
+
import PuiDatatablesKeepPage from './mixins/PuiDatatablesKeepPage';
|
|
11
|
+
|
|
12
|
+
const Components = {
|
|
13
|
+
PuiDocgenTemplateParametersDialog,
|
|
14
|
+
PuiGridActionsBtn,
|
|
15
|
+
PuiGridFilterDialog,
|
|
16
|
+
PuiSimpleDatatable,
|
|
17
|
+
PuiDatatable,
|
|
18
|
+
PuiQuickEditionDatatable,
|
|
19
|
+
PuiSimpleDatalist,
|
|
20
|
+
PuiDatalist,
|
|
21
|
+
PuiAuditForm
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
install(Vue) {
|
|
26
|
+
Object.keys(Components).forEach((name) => {
|
|
27
|
+
Vue.component(name, Components[name]);
|
|
28
|
+
Vue.mixin(PuiDatatablesKeepPage());
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
};
|
package/src/main.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import Vue from 'vue';
|
|
2
|
+
import Vuex from 'vuex';
|
|
3
|
+
import VueRouter from 'vue-router';
|
|
4
|
+
import VueI18n from 'vue-i18n';
|
|
5
|
+
import Vuetify from 'vuetify/lib';
|
|
6
|
+
|
|
7
|
+
import Pui9Basics from 'pui9-components';
|
|
8
|
+
import Pui9Notify from 'pui9-notifications';
|
|
9
|
+
import Pui9Requests from 'pui9-requests';
|
|
10
|
+
import Pui9Utils from 'pui9-utils';
|
|
11
|
+
|
|
12
|
+
import App from './App.vue';
|
|
13
|
+
|
|
14
|
+
import '@fortawesome/fontawesome-pro/css/all.css';
|
|
15
|
+
import 'vuetify/dist/vuetify.min.css';
|
|
16
|
+
import '../../pui9-styles/pui9.css';
|
|
17
|
+
|
|
18
|
+
import colors from 'vuetify/es5/util/colors';
|
|
19
|
+
import es from 'vuetify/es5/locale/es';
|
|
20
|
+
import ca from 'vuetify/es5/locale/ca';
|
|
21
|
+
import en from 'vuetify/es5/locale/en';
|
|
22
|
+
import fr from 'vuetify/es5/locale/fr';
|
|
23
|
+
|
|
24
|
+
import storeObj from '../../pui9-store/store';
|
|
25
|
+
import routerObj from './router';
|
|
26
|
+
|
|
27
|
+
Vue.config.productionTip = false;
|
|
28
|
+
|
|
29
|
+
Vue.use(Vuex);
|
|
30
|
+
Vue.use(VueRouter);
|
|
31
|
+
Vue.use(VueI18n);
|
|
32
|
+
Vue.use(Vuetify, {
|
|
33
|
+
theme: {
|
|
34
|
+
primary: '#166bf2',
|
|
35
|
+
secondary: '#e56208',
|
|
36
|
+
accent: colors.orange.darken1,
|
|
37
|
+
error: colors.red.darken1
|
|
38
|
+
},
|
|
39
|
+
iconfont: 'fa',
|
|
40
|
+
lang: {
|
|
41
|
+
locales: { en, es, ca, fr },
|
|
42
|
+
current: 'es'
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
Vue.use(Pui9Basics, storeObj);
|
|
46
|
+
Vue.use(Pui9Notify);
|
|
47
|
+
Vue.use(Pui9Utils);
|
|
48
|
+
|
|
49
|
+
const bus = new Vue();
|
|
50
|
+
const store = new Vuex.Store(storeObj);
|
|
51
|
+
const router = new VueRouter(routerObj);
|
|
52
|
+
const i18n = new VueI18n({
|
|
53
|
+
locale: 'es',
|
|
54
|
+
messages: { en: {}, es: {} }
|
|
55
|
+
});
|
|
56
|
+
const requests = new Pui9Requests(store);
|
|
57
|
+
|
|
58
|
+
Object.defineProperty(Vue.prototype, '$puiEvents', { value: bus });
|
|
59
|
+
Object.defineProperty(Vue.prototype, '$puiI18n', { value: i18n });
|
|
60
|
+
Object.defineProperty(Vue.prototype, '$puiRequests', { value: requests });
|
|
61
|
+
|
|
62
|
+
new Vue({
|
|
63
|
+
store,
|
|
64
|
+
router,
|
|
65
|
+
i18n,
|
|
66
|
+
render: (h) => h(App)
|
|
67
|
+
}).$mount('#app');
|