@tripup-company/element-ui-extended 0.0.2 → 0.0.7
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 +150 -0
- package/dist/element-ui-extended.common.js +859 -681
- package/dist/element-ui-extended.common.js.map +1 -1
- package/dist/element-ui-extended.umd.js +859 -681
- package/dist/element-ui-extended.umd.js.map +1 -1
- package/dist/element-ui-extended.umd.min.js +1 -1
- package/dist/element-ui-extended.umd.min.js.map +1 -1
- package/package.json +23 -4
- package/src/App.vue +31 -2
- package/src/components/CompositeTable/index.vue +219 -0
- package/src/components/{GenericTable → GenericFilters}/FilterRow.vue +9 -2
- package/src/components/{GenericTable → GenericFilters}/FilterTopRow.vue +1 -1
- package/src/components/{GenericTable → GenericFilters}/GenericTopFilter.vue +22 -9
- package/src/components/{GenericTable/GenericFilter.vue → GenericFilters/index.vue} +23 -9
- package/src/components/GenericPaginator/index.vue +53 -0
- package/src/components/GenericTable/index.vue +23 -153
- package/src/filters-top.js +8 -0
- package/src/filters.js +64 -0
- package/src/lang/en.js +167 -0
- package/src/lang/index.js +35 -0
- package/src/lang/vi.js +166 -0
- package/src/lang/zh.js +164 -0
- package/src/models/base-model.ts +10 -0
- package/src/models/contact-model.ts +23 -0
- package/src/models/meta-model.ts +13 -0
- package/src/services/list-query-service.ts +39 -0
- package/src/services/local-storage-service.ts +27 -0
- package/src/services/resolutions.js +21 -0
- package/src/test/unit/components/TestComponent.vue +15 -0
- package/src/types/article.js +6 -0
- package/src/types/article.js.map +1 -0
- package/src/types/axiosInterface.ts +54 -0
- package/src/types/collection.ts +6 -0
- package/src/types/error.ts +3 -0
- package/src/types/icontact.ts +17 -0
- package/src/types/meta.ts +7 -0
- package/src/types/pagination.ts +8 -0
- package/src/components/GenericTable/GenericPaginator.vue +0 -37
- package/src/components/GenericTable/GenericRows.vue +0 -27
|
@@ -1,67 +1,32 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<generic-filter ref="genericFilter" />
|
|
18
|
-
</el-col>
|
|
19
|
-
</el-row>
|
|
20
|
-
</slot>
|
|
2
|
+
<div>
|
|
3
|
+
<el-table :data="data" border @sort-change="sortChange">
|
|
4
|
+
<template v-for="field in fields">
|
|
5
|
+
<template v-if="field.callback">
|
|
6
|
+
<el-table-column :key="field.prop" v-slot="context" :prop="field.prop" :label="field.label" :width="field.width ? field.width : null" sortable="custom">
|
|
7
|
+
<el-link @click="field.callback(field.prop, context.$index, context.row)">
|
|
8
|
+
{{ typeof field.formatter === 'function' ? field.formatter(context.row) : context.row[field.prop] }}
|
|
9
|
+
</el-link>
|
|
10
|
+
</el-table-column>
|
|
11
|
+
</template>
|
|
12
|
+
<template v-else>
|
|
13
|
+
<el-table-column :formatter="typeof field.formatter === 'function' ? field.formatter : null" :key="field.prop" :prop="field.prop" :label="field.label" :width="field.width ? field.width : null" sortable="custom" />
|
|
14
|
+
</template>
|
|
15
|
+
</template>
|
|
16
|
+
</el-table>
|
|
21
17
|
</div>
|
|
22
18
|
</template>
|
|
19
|
+
|
|
23
20
|
<script>
|
|
24
|
-
|
|
25
|
-
import GenericFilter from "./GenericFilter";
|
|
26
|
-
import GenericTopFilter from "./GenericTopFilter";
|
|
27
|
-
import GenericRows from "./GenericRows";
|
|
28
|
-
import MetaModel from "../../models/meta-model.ts";
|
|
29
|
-
import ListQueryService from "../../services/list-query-service.ts";
|
|
30
|
-
import FilterConverter from "./filter-convertor.ts";
|
|
21
|
+
|
|
31
22
|
export default {
|
|
32
23
|
name: "GenericTable",
|
|
33
|
-
components: {
|
|
34
|
-
GenericRows,
|
|
35
|
-
GenericFilter,
|
|
36
|
-
GenericPaginator,
|
|
37
|
-
GenericTopFilter,
|
|
38
|
-
},
|
|
39
|
-
provide() {
|
|
40
|
-
const data = {};
|
|
41
|
-
["items", "fields", "filters", "loading", "meta"].forEach((key) => {
|
|
42
|
-
Object.defineProperty(data, key, {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: () => this[key],
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
return {
|
|
48
|
-
data,
|
|
49
|
-
search: this.search,
|
|
50
|
-
actions: {
|
|
51
|
-
handleSizeChange: this.handleSizeChange,
|
|
52
|
-
handleCurrentChange: this.handleCurrentChange,
|
|
53
|
-
handleFilterChange: this.handleFilterChange,
|
|
54
|
-
handleApplyFilter: this.handleApplyFilter,
|
|
55
|
-
handleResetFilter: this.handleResetFilter,
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
},
|
|
59
24
|
props: {
|
|
60
|
-
|
|
25
|
+
data: {
|
|
61
26
|
default() {
|
|
62
27
|
return {};
|
|
63
28
|
},
|
|
64
|
-
type:
|
|
29
|
+
type: Array,
|
|
65
30
|
},
|
|
66
31
|
title: {
|
|
67
32
|
default: "",
|
|
@@ -71,111 +36,16 @@ export default {
|
|
|
71
36
|
default: () => [],
|
|
72
37
|
type: Array,
|
|
73
38
|
},
|
|
74
|
-
filters: {
|
|
75
|
-
default: () => [],
|
|
76
|
-
type: Array,
|
|
77
|
-
},
|
|
78
39
|
},
|
|
79
40
|
data: function () {
|
|
80
|
-
let search = {};
|
|
81
|
-
const filterConvertor = new FilterConverter();
|
|
82
|
-
const listQueryService = new ListQueryService(
|
|
83
|
-
this.$route.name,
|
|
84
|
-
this.$services.localStorage()
|
|
85
|
-
);
|
|
86
|
-
for (const column of this.filters) {
|
|
87
|
-
search[column.name] = {
|
|
88
|
-
operator: "",
|
|
89
|
-
value: "",
|
|
90
|
-
position: column.position ? column.position : null,
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
search = Object.assign(search, listQueryService.getListQuery().search);
|
|
94
41
|
return {
|
|
95
42
|
loading: false,
|
|
96
|
-
filter: {},
|
|
97
|
-
items: [],
|
|
98
|
-
search: search,
|
|
99
|
-
meta: new MetaModel(),
|
|
100
|
-
filterConvertor: filterConvertor,
|
|
101
|
-
listQueryService: listQueryService,
|
|
102
43
|
};
|
|
103
44
|
},
|
|
104
|
-
computed: {
|
|
105
|
-
showTopFilter() {
|
|
106
|
-
if (this.filters.filter((e) => e.position === "top").length > 0) {
|
|
107
|
-
return true;
|
|
108
|
-
}
|
|
109
|
-
return false;
|
|
110
|
-
},
|
|
111
|
-
queryFilter() {
|
|
112
|
-
const meta = this.listQueryService.getListQuery().meta;
|
|
113
|
-
const query = {
|
|
114
|
-
page: this.meta?.pagination?.current_page
|
|
115
|
-
? this.meta.pagination.current_page
|
|
116
|
-
: meta.page,
|
|
117
|
-
limit: this.meta?.pagination?.per_page
|
|
118
|
-
? this.meta.pagination.per_page
|
|
119
|
-
: meta.limit,
|
|
120
|
-
};
|
|
121
|
-
return { ...query, ...this.filter };
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
mounted() {
|
|
125
|
-
this.filter = this.$refs.genericFilter.getFilter();
|
|
126
|
-
this.fetch();
|
|
127
|
-
},
|
|
128
45
|
methods: {
|
|
129
|
-
|
|
130
|
-
this
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
this.items = response.data;
|
|
134
|
-
this.meta = response.meta;
|
|
135
|
-
} catch (e) {
|
|
136
|
-
this.$message.error(e.message);
|
|
137
|
-
}
|
|
138
|
-
this.loading = false;
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
handleSizeChange(val) {
|
|
142
|
-
this.listQueryService.updateListQuery({ meta: { limit: val } });
|
|
143
|
-
this.meta.pagination.per_page = val;
|
|
144
|
-
this.fetch();
|
|
145
|
-
},
|
|
146
|
-
handleCurrentChange(val) {
|
|
147
|
-
this.listQueryService.updateListQuery({ meta: { page: val } });
|
|
148
|
-
this.meta.pagination.current_page = val;
|
|
149
|
-
this.fetch();
|
|
150
|
-
},
|
|
151
|
-
handleFilterChange(val) {
|
|
152
|
-
this.filter = val;
|
|
153
|
-
this.meta.pagination.current_page = 1;
|
|
154
|
-
this.fetch();
|
|
155
|
-
},
|
|
156
|
-
handleApplyFilter() {
|
|
157
|
-
this.listQueryService.updateListQuery({ search: this.search });
|
|
158
|
-
this.handleFilterChange(this.filterConvertor.applyFilter(this.search));
|
|
159
|
-
},
|
|
160
|
-
handleResetFilter() {
|
|
161
|
-
console.log(this.search);
|
|
162
|
-
for (const column in this.search) {
|
|
163
|
-
if (this.search[column].position === "top") {
|
|
164
|
-
this.search[column] = Object.assign(this.search[column], {
|
|
165
|
-
value: "",
|
|
166
|
-
});
|
|
167
|
-
} else {
|
|
168
|
-
this.search[column] = Object.assign(this.search[column], {
|
|
169
|
-
operator: "",
|
|
170
|
-
value: "",
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
this.listQueryService.updateListQuery({ search: this.search });
|
|
175
|
-
this.handleFilterChange({});
|
|
176
|
-
},
|
|
177
|
-
},
|
|
46
|
+
sortChange(data) {
|
|
47
|
+
this.$emit('sort:change', data);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
178
50
|
};
|
|
179
51
|
</script>
|
|
180
|
-
|
|
181
|
-
<style scoped></style>
|
package/src/filters.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
name: 'title',
|
|
4
|
+
label: 'Title',
|
|
5
|
+
type: 'string',
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
name: 'first_name',
|
|
9
|
+
label: 'First Name',
|
|
10
|
+
type: 'string',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: 'last_name',
|
|
14
|
+
label: 'Last Name',
|
|
15
|
+
type: 'string',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'email',
|
|
19
|
+
label: 'Email',
|
|
20
|
+
type: 'string',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'phone',
|
|
24
|
+
label: 'Phone',
|
|
25
|
+
type: 'string',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'mobile',
|
|
29
|
+
label: 'Mobile',
|
|
30
|
+
type: 'string',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'position',
|
|
34
|
+
label: 'Position',
|
|
35
|
+
type: 'string',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'street',
|
|
39
|
+
label: 'Street',
|
|
40
|
+
type: 'string',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'zip_code',
|
|
44
|
+
label: 'Zip Code',
|
|
45
|
+
type: 'string',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'city',
|
|
49
|
+
label: 'City',
|
|
50
|
+
type: 'string',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'state',
|
|
54
|
+
label: 'State',
|
|
55
|
+
type: 'string',
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
{
|
|
59
|
+
name: 'created_at',
|
|
60
|
+
label: 'Created at',
|
|
61
|
+
type: 'date',
|
|
62
|
+
operator: 'between_date',
|
|
63
|
+
},
|
|
64
|
+
];
|
package/src/lang/en.js
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
common: {
|
|
3
|
+
back: 'Back',
|
|
4
|
+
return: 'Return',
|
|
5
|
+
},
|
|
6
|
+
route: {
|
|
7
|
+
dashboard: 'Dashboard',
|
|
8
|
+
introduction: 'Introduction',
|
|
9
|
+
documentation: 'Documentation',
|
|
10
|
+
guide: 'Guide',
|
|
11
|
+
permission: 'Permission',
|
|
12
|
+
pagePermission: 'Page Permission',
|
|
13
|
+
directivePermission: 'Directive Permission',
|
|
14
|
+
icons: 'Icons',
|
|
15
|
+
components: 'Components',
|
|
16
|
+
componentIndex: 'Introduction',
|
|
17
|
+
tinymce: 'Tinymce',
|
|
18
|
+
markdown: 'Markdown',
|
|
19
|
+
jsonEditor: 'JSON Editor',
|
|
20
|
+
dndList: 'Dnd List',
|
|
21
|
+
splitPane: 'SplitPane',
|
|
22
|
+
avatarUpload: 'Avatar Upload',
|
|
23
|
+
dropzone: 'Dropzone',
|
|
24
|
+
sticky: 'Sticky',
|
|
25
|
+
countTo: 'CountTo',
|
|
26
|
+
componentMixin: 'Mixin',
|
|
27
|
+
backToTop: 'BackToTop',
|
|
28
|
+
dragDialog: 'Drag Dialog',
|
|
29
|
+
dragSelect: 'Drag Select',
|
|
30
|
+
dragKanban: 'Drag Kanban',
|
|
31
|
+
charts: 'Charts',
|
|
32
|
+
keyboardChart: 'Keyboard Chart',
|
|
33
|
+
lineChart: 'Line Chart',
|
|
34
|
+
mixChart: 'Mix Chart',
|
|
35
|
+
example: 'Example',
|
|
36
|
+
nested: 'Nested Routes',
|
|
37
|
+
menu1: 'Menu 1',
|
|
38
|
+
'menu1-1': 'Menu 1-1',
|
|
39
|
+
'menu1-2': 'Menu 1-2',
|
|
40
|
+
'menu1-2-1': 'Menu 1-2-1',
|
|
41
|
+
'menu1-2-2': 'Menu 1-2-2',
|
|
42
|
+
'menu1-3': 'Menu 1-3',
|
|
43
|
+
menu2: 'Menu 2',
|
|
44
|
+
Table: 'Table',
|
|
45
|
+
dynamicTable: 'Dynamic Table',
|
|
46
|
+
dragTable: 'Drag Table',
|
|
47
|
+
inlineEditTable: 'Inline Edit',
|
|
48
|
+
complexTable: 'Complex Table',
|
|
49
|
+
treeTable: 'Tree Table',
|
|
50
|
+
customTreeTable: 'Custom TreeTable',
|
|
51
|
+
tab: 'Tab',
|
|
52
|
+
form: 'Form',
|
|
53
|
+
createArticle: 'Create Article',
|
|
54
|
+
editArticle: 'Edit Article',
|
|
55
|
+
articleList: 'Article List',
|
|
56
|
+
errorPages: 'Error Pages',
|
|
57
|
+
page401: '401',
|
|
58
|
+
page404: '404',
|
|
59
|
+
errorLog: 'Error Log',
|
|
60
|
+
excel: 'Excel',
|
|
61
|
+
exportExcel: 'Export Excel',
|
|
62
|
+
selectExcel: 'Export Selected',
|
|
63
|
+
uploadExcel: 'Upload Excel',
|
|
64
|
+
zip: 'Zip',
|
|
65
|
+
exportZip: 'Export Zip',
|
|
66
|
+
theme: 'Theme',
|
|
67
|
+
clipboardDemo: 'Clipboard',
|
|
68
|
+
i18n: 'I18n',
|
|
69
|
+
externalLink: 'External Link',
|
|
70
|
+
},
|
|
71
|
+
navbar: {
|
|
72
|
+
logOut: 'Log Out',
|
|
73
|
+
dashboard: 'Dashboard',
|
|
74
|
+
github: 'Github',
|
|
75
|
+
screenfull: 'Screenfull',
|
|
76
|
+
theme: 'Theme',
|
|
77
|
+
size: 'Global Size',
|
|
78
|
+
},
|
|
79
|
+
login: {
|
|
80
|
+
title: 'Laravel Vue Admin',
|
|
81
|
+
logIn: 'Log in',
|
|
82
|
+
username: 'Username',
|
|
83
|
+
email: 'Email',
|
|
84
|
+
password: 'Password',
|
|
85
|
+
any: 'any',
|
|
86
|
+
thirdparty: 'Or connect with',
|
|
87
|
+
thirdpartyTips: 'Can not be simulated on local, so please combine you own business simulation! ! !',
|
|
88
|
+
},
|
|
89
|
+
documentation: {
|
|
90
|
+
documentation: 'Documentation',
|
|
91
|
+
github: 'Github Repository',
|
|
92
|
+
laravel: 'Laravel',
|
|
93
|
+
},
|
|
94
|
+
permission: {
|
|
95
|
+
roles: 'Your roles',
|
|
96
|
+
switchRoles: 'Switch roles',
|
|
97
|
+
tips: 'In some cases it is not suitable to use v-permission, such as element Tab component or el-table-column and other asynchronous rendering dom cases which can only be achieved by manually setting the v-if.',
|
|
98
|
+
pageDescription: 'This place is accessible for admin only. Switching to non-admin role will redirect to 404 page',
|
|
99
|
+
},
|
|
100
|
+
guide: {
|
|
101
|
+
description: 'The guide page is useful for some people who entered the project for the first time. You can briefly introduce the features of the project. Demo is based on ',
|
|
102
|
+
button: 'Show Guide',
|
|
103
|
+
},
|
|
104
|
+
components: {
|
|
105
|
+
documentation: 'Documentation',
|
|
106
|
+
tinymceTips: 'Rich text editor is a core part of management system, but at the same time is a place with lots of problems. In the process of selecting rich texts, I also walked a lot of detours. The common rich text editors in the market are basically used, and the finally chose Tinymce. See documentation for more detailed rich text editor comparisons and introductions.',
|
|
107
|
+
dropzoneTips: 'Because my business has special needs, and has to upload images to qiniu, so instead of a third party, I chose encapsulate it by myself. It is very simple, you can see the detail code in @/components/Dropzone.',
|
|
108
|
+
stickyTips: 'When the page is scrolled to the preset position will be sticky on the top.',
|
|
109
|
+
backToTopTips1: 'When the page is scrolled to the specified position, the Back to Top button appears in the lower right corner',
|
|
110
|
+
backToTopTips2: 'You can customize the style of the button, show / hide, height of appearance, height of the return. If you need a text prompt, you can use element-ui el-tooltip elements externally',
|
|
111
|
+
imageUploadTips: 'Since I was using only the vue@1 version, and it is not compatible with mockjs at the moment, I modified it myself, and if you are going to use it, it is better to use official version.',
|
|
112
|
+
},
|
|
113
|
+
table: {
|
|
114
|
+
dynamicTips1: 'Fixed header, sorted by header order',
|
|
115
|
+
dynamicTips2: 'Not fixed header, sorted by click order',
|
|
116
|
+
dragTips1: 'The default order',
|
|
117
|
+
dragTips2: 'The after dragging order',
|
|
118
|
+
title: 'Title',
|
|
119
|
+
importance: 'Imp',
|
|
120
|
+
type: 'Type',
|
|
121
|
+
remark: 'Remark',
|
|
122
|
+
search: 'Search',
|
|
123
|
+
add: 'Add',
|
|
124
|
+
export: 'Export',
|
|
125
|
+
reviewer: 'reviewer',
|
|
126
|
+
id: 'ID',
|
|
127
|
+
date: 'Date',
|
|
128
|
+
author: 'Author',
|
|
129
|
+
readings: 'Readings',
|
|
130
|
+
status: 'Status',
|
|
131
|
+
actions: 'Actions',
|
|
132
|
+
edit: 'Edit',
|
|
133
|
+
publish: 'Publish',
|
|
134
|
+
draft: 'Draft',
|
|
135
|
+
delete: 'Delete',
|
|
136
|
+
cancel: 'Cancel',
|
|
137
|
+
confirm: 'Confirm',
|
|
138
|
+
},
|
|
139
|
+
errorLog: {
|
|
140
|
+
tips: 'Please click the bug icon in the upper right corner',
|
|
141
|
+
description: 'Now the management system are basically the form of the spa, it enhances the user experience, but it also increases the possibility of page problems, a small negligence may lead to the entire page deadlock. Fortunately Vue provides a way to catch handling exceptions, where you can handle errors or report exceptions.',
|
|
142
|
+
documentation: 'Document introduction',
|
|
143
|
+
},
|
|
144
|
+
excel: {
|
|
145
|
+
export: 'Export',
|
|
146
|
+
selectedExport: 'Export Selected Items',
|
|
147
|
+
placeholder: 'Please enter the file name(default excel-list)',
|
|
148
|
+
},
|
|
149
|
+
zip: {
|
|
150
|
+
export: 'Export',
|
|
151
|
+
placeholder: 'Please enter the file name(default file)',
|
|
152
|
+
},
|
|
153
|
+
pdf: {
|
|
154
|
+
tips: 'Here we use window.print() to implement the feature of downloading pdf.',
|
|
155
|
+
},
|
|
156
|
+
theme: {
|
|
157
|
+
change: 'Change Theme',
|
|
158
|
+
documentation: 'Theme documentation',
|
|
159
|
+
tips: 'Tips: It is different from the theme-pick on the navbar is two different skinning methods, each with different application scenarios. Refer to the documentation for details.',
|
|
160
|
+
},
|
|
161
|
+
tagsView: {
|
|
162
|
+
refresh: 'Refresh',
|
|
163
|
+
close: 'Close',
|
|
164
|
+
closeOthers: 'Close Others',
|
|
165
|
+
closeAll: 'Close All',
|
|
166
|
+
},
|
|
167
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import Vue from 'vue';
|
|
2
|
+
import VueI18n from 'vue-i18n';
|
|
3
|
+
import elementEnLocale from 'element-ui/lib/locale/lang/en'; // element-ui lang
|
|
4
|
+
import elementZhLocale from 'element-ui/lib/locale/lang/zh-CN';// element-ui lang
|
|
5
|
+
import elementViLocale from 'element-ui/lib/locale/lang/vi';// element-ui lang
|
|
6
|
+
import enLocale from './en';
|
|
7
|
+
import zhLocale from './zh';
|
|
8
|
+
import viLocale from './vi';
|
|
9
|
+
|
|
10
|
+
Vue.use(VueI18n);
|
|
11
|
+
|
|
12
|
+
const messages = {
|
|
13
|
+
en: {
|
|
14
|
+
...enLocale,
|
|
15
|
+
...elementEnLocale,
|
|
16
|
+
},
|
|
17
|
+
zh: {
|
|
18
|
+
...zhLocale,
|
|
19
|
+
...elementZhLocale,
|
|
20
|
+
},
|
|
21
|
+
vi: {
|
|
22
|
+
...viLocale,
|
|
23
|
+
...elementViLocale,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const i18n = new VueI18n({
|
|
28
|
+
// set locale
|
|
29
|
+
// options: en | zh | vi
|
|
30
|
+
locale: 'en',
|
|
31
|
+
// set locale messages
|
|
32
|
+
messages,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export default i18n;
|
package/src/lang/vi.js
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
common: {
|
|
3
|
+
back: 'Quay lại',
|
|
4
|
+
return: 'Trở về',
|
|
5
|
+
},
|
|
6
|
+
route: {
|
|
7
|
+
dashboard: 'Dashboard',
|
|
8
|
+
introduction: 'Giới thiệu',
|
|
9
|
+
documentation: 'Tài liệu',
|
|
10
|
+
guide: 'Hướng dẫn',
|
|
11
|
+
permission: 'Quyền truy cập',
|
|
12
|
+
pagePermission: 'Trang giới hạn truy cập',
|
|
13
|
+
directivePermission: 'Thuộc tính truy cập',
|
|
14
|
+
icons: 'Ký hiệu',
|
|
15
|
+
components: 'Thành phần',
|
|
16
|
+
componentIndex: 'Giới thiệu',
|
|
17
|
+
tinymce: 'Tinymce',
|
|
18
|
+
markdown: 'Markdown',
|
|
19
|
+
jsonEditor: 'Soạn thảo JSON',
|
|
20
|
+
dndList: 'Danh sách Dnd',
|
|
21
|
+
splitPane: 'SplitPane',
|
|
22
|
+
avatarUpload: 'Tải hình đại diện',
|
|
23
|
+
dropzone: 'Dropzone',
|
|
24
|
+
sticky: 'Sticky',
|
|
25
|
+
countTo: 'CountTo',
|
|
26
|
+
componentMixin: 'Mixin',
|
|
27
|
+
backToTop: 'BackToTop',
|
|
28
|
+
dragDialog: 'Drag Dialog',
|
|
29
|
+
dragSelect: 'Drag Select',
|
|
30
|
+
dragKanban: 'Drag Kanban',
|
|
31
|
+
charts: 'Biểu đồ',
|
|
32
|
+
keyboardChart: 'Biểu đồ bàn phím',
|
|
33
|
+
lineChart: 'Biểu đồ đường',
|
|
34
|
+
mixChart: 'Biểu đồ đa dạng',
|
|
35
|
+
example: 'Ví dụ',
|
|
36
|
+
nested: 'Danh mục con',
|
|
37
|
+
menu1: 'Danh mục 1',
|
|
38
|
+
'menu1-1': 'Danh mục 1-1',
|
|
39
|
+
'menu1-2': 'Danh mục 1-2',
|
|
40
|
+
'menu1-2-1': 'Danh mục 1-2-1',
|
|
41
|
+
'menu1-2-2': 'Danh mục 1-2-2',
|
|
42
|
+
'menu1-3': 'Danh mục 1-3',
|
|
43
|
+
menu2: 'Danh mục 2',
|
|
44
|
+
Table: 'Bảng',
|
|
45
|
+
dynamicTable: 'Bảng động',
|
|
46
|
+
dragTable: 'Bảng kéo thả',
|
|
47
|
+
inlineEditTable: 'Chỉnh sửa trực tiếp',
|
|
48
|
+
complexTable: 'Bảng phức tạp',
|
|
49
|
+
treeTable: 'Bảng dạng cây',
|
|
50
|
+
customTreeTable: 'Bảng dạng cây tùy biến',
|
|
51
|
+
tab: 'Tab',
|
|
52
|
+
form: 'Form',
|
|
53
|
+
createArticle: 'Viết bài',
|
|
54
|
+
editArticle: 'Chỉnh sửa',
|
|
55
|
+
articleList: 'Danh sách',
|
|
56
|
+
errorPages: 'Trang lỗi',
|
|
57
|
+
page401: '401',
|
|
58
|
+
page404: '404',
|
|
59
|
+
errorLog: 'Lỗi',
|
|
60
|
+
excel: 'Excel',
|
|
61
|
+
exportExcel: 'Export Excel',
|
|
62
|
+
selectExcel: 'Export Selected',
|
|
63
|
+
uploadExcel: 'Upload Excel',
|
|
64
|
+
zip: 'Zip',
|
|
65
|
+
exportZip: 'Export Zip',
|
|
66
|
+
theme: 'Theme',
|
|
67
|
+
clipboardDemo: 'Clipboard',
|
|
68
|
+
i18n: 'I18n',
|
|
69
|
+
externalLink: 'Liên kết ngoài',
|
|
70
|
+
},
|
|
71
|
+
navbar: {
|
|
72
|
+
logOut: 'Đăng xuất',
|
|
73
|
+
dashboard: 'Dashboard',
|
|
74
|
+
github: 'Github',
|
|
75
|
+
screenfull: 'Toàn màn hình',
|
|
76
|
+
theme: 'Theme',
|
|
77
|
+
size: 'Global Size',
|
|
78
|
+
},
|
|
79
|
+
login: {
|
|
80
|
+
title: 'Đăng nhập',
|
|
81
|
+
logIn: 'Đăng nhập',
|
|
82
|
+
username: 'Username',
|
|
83
|
+
email: 'Email',
|
|
84
|
+
password: 'Mật khẩu',
|
|
85
|
+
any: 'any',
|
|
86
|
+
thirdparty: 'Hoặc đăng nhập với',
|
|
87
|
+
thirdpartyTips: 'Không thể giả lập, xi vui lòng áp dụng tùy theo tình huống nghiệp vụ của bạn! ! !',
|
|
88
|
+
},
|
|
89
|
+
documentation: {
|
|
90
|
+
documentation: 'Tài liệu',
|
|
91
|
+
github: 'Github Repository',
|
|
92
|
+
laravel: 'Laravel',
|
|
93
|
+
},
|
|
94
|
+
permission: {
|
|
95
|
+
roles: 'Nhóm của bạn',
|
|
96
|
+
switchRoles: 'Đổi nhóm',
|
|
97
|
+
tips: 'Trong vài trường hợp sẽ không thích hợp để dùng v-permission, như là thành phần Tab hay el-table-column và các trường hợp render DOM không đồng bộ, khi đó chỉ có thể xử lý bằng tay với v-if.',
|
|
98
|
+
},
|
|
99
|
+
guide: {
|
|
100
|
+
description: 'Trang hướng dẫn sẽ có ích cho những người mới vào website lần đầu. Bạn có thể giới thiệu sơ lược các chức năng của website. Kiểm tra demo',
|
|
101
|
+
button: 'Hiện hướng dẫn',
|
|
102
|
+
},
|
|
103
|
+
components: {
|
|
104
|
+
documentation: 'Tài liệu',
|
|
105
|
+
tinymceTips: 'Rich text editor is a core part of management system, but at the same time is a place with lots of problems. In the process of selecting rich texts, I also walked a lot of detours. The common rich text editors in the market are basically used, and the finally chose Tinymce. See documentation for more detailed rich text editor comparisons and introductions.',
|
|
106
|
+
dropzoneTips: 'Because my business has special needs, and has to upload images to qiniu, so instead of a third party, I chose encapsulate it by myself. It is very simple, you can see the detail code in @/components/Dropzone.',
|
|
107
|
+
stickyTips: 'When the page is scrolled to the preset position will be sticky on the top.',
|
|
108
|
+
backToTopTips1: 'When the page is scrolled to the specified position, the Back to Top button appears in the lower right corner',
|
|
109
|
+
backToTopTips2: 'You can customize the style of the button, show / hide, height of appearance, height of the return. If you need a text prompt, you can use element-ui el-tooltip elements externally',
|
|
110
|
+
imageUploadTips: 'Since I was using only the vue@1 version, and it is not compatible with mockjs at the moment, I modified it myself, and if you are going to use it, it is better to use official version.',
|
|
111
|
+
},
|
|
112
|
+
table: {
|
|
113
|
+
dynamicTips1: 'Fixed header, sorted by header order',
|
|
114
|
+
dynamicTips2: 'Not fixed header, sorted by click order',
|
|
115
|
+
dragTips1: 'The default order',
|
|
116
|
+
dragTips2: 'The after dragging order',
|
|
117
|
+
title: 'Tiêu đề',
|
|
118
|
+
importance: 'IMP',
|
|
119
|
+
type: 'Thể loại',
|
|
120
|
+
remark: 'Remark',
|
|
121
|
+
search: 'Tìm kiếm',
|
|
122
|
+
add: 'Thêm',
|
|
123
|
+
export: 'Export',
|
|
124
|
+
reviewer: 'reviewer',
|
|
125
|
+
id: 'ID',
|
|
126
|
+
date: 'Ngày',
|
|
127
|
+
author: 'Tác giả',
|
|
128
|
+
readings: 'Số lần đọc',
|
|
129
|
+
status: 'Status',
|
|
130
|
+
actions: 'Actions',
|
|
131
|
+
edit: 'Edit',
|
|
132
|
+
publish: 'Publish',
|
|
133
|
+
draft: 'Draft',
|
|
134
|
+
delete: 'Delete',
|
|
135
|
+
cancel: 'Cancel',
|
|
136
|
+
confirm: 'Confirm',
|
|
137
|
+
},
|
|
138
|
+
errorLog: {
|
|
139
|
+
tips: 'Please click the bug icon in the upper right corner',
|
|
140
|
+
description: 'Now the management system are basically the form of the spa, it enhances the user experience, but it also increases the possibility of page problems, a small negligence may lead to the entire page deadlock. Fortunately Vue provides a way to catch handling exceptions, where you can handle errors or report exceptions.',
|
|
141
|
+
documentation: 'Document introduction',
|
|
142
|
+
},
|
|
143
|
+
excel: {
|
|
144
|
+
export: 'Export',
|
|
145
|
+
selectedExport: 'Export Selected Items',
|
|
146
|
+
placeholder: 'Please enter the file name(default excel-list)',
|
|
147
|
+
},
|
|
148
|
+
zip: {
|
|
149
|
+
export: 'Export',
|
|
150
|
+
placeholder: 'Please enter the file name(default file)',
|
|
151
|
+
},
|
|
152
|
+
pdf: {
|
|
153
|
+
tips: 'Here we use window.print() to implement the feature of downloading pdf.',
|
|
154
|
+
},
|
|
155
|
+
theme: {
|
|
156
|
+
change: 'Change Theme',
|
|
157
|
+
documentation: 'Theme documentation',
|
|
158
|
+
tips: 'Tips: It is different from the theme-pick on the navbar is two different skinning methods, each with different application scenarios. Refer to the documentation for details.',
|
|
159
|
+
},
|
|
160
|
+
tagsView: {
|
|
161
|
+
refresh: 'Refresh',
|
|
162
|
+
close: 'Close',
|
|
163
|
+
closeOthers: 'Close Others',
|
|
164
|
+
closeAll: 'Close All',
|
|
165
|
+
},
|
|
166
|
+
};
|