Skip to content

Commit afa35ae

Browse files
Merge pull request #78 from what-crud/77_add-tree-view
77 add tree view
2 parents ef7e4c3 + 1ba161c commit afa35ae

File tree

98 files changed

+2798
-1864
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2798
-1864
lines changed

Diff for: .eslintrc.js

+23-4
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,40 @@ module.exports = {
22
root: true,
33

44
env: {
5-
node: true
5+
node: true,
66
},
77

88
rules: {
99
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
1010
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
1111
'comma-dangle': ['error', 'always-multiline'],
12+
'array-element-newline': [
13+
'error', {
14+
"multiline": true,
15+
"minItems": 2,
16+
},
17+
],
18+
'array-bracket-newline': [
19+
'error', {
20+
"multiline": true,
21+
"minItems": 2,
22+
},
23+
],
24+
'array-bracket-spacing': ['error', 'never'],
25+
'object-curly-newline': [
26+
'error', {
27+
'consistent': true,
28+
},
29+
],
30+
'object-curly-spacing': ['error', 'always'],
1231
},
1332

1433
parserOptions: {
15-
parser: 'babel-eslint'
34+
parser: 'babel-eslint',
1635
},
1736

1837
extends: [
1938
'plugin:vue/essential',
20-
'@vue/standard'
21-
]
39+
'@vue/standard',
40+
],
2241
}

Diff for: README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<h1 align="center">Vue CRUD</h1>
55
<div align="center">
66
<a><img alt="license" src="https://img.shields.io/badge/license-MIT-brightgreen.svg"></a>
7-
<a><img alt="version" src="https://img.shields.io/badge/version-v0.14.2-yellow.svg"></a>
7+
<a><img alt="version" src="https://img.shields.io/badge/version-v0.15.0-yellow.svg"></a>
88
<a><img alt="build" src="https://travis-ci.org/what-crud/vue-crud.svg?branch=master"></a>
99
<a><img alt="PRs" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg"></a>
1010
</div>
@@ -34,9 +34,12 @@ Vue CRUD provides a set of utilities, from which you can compose your own applic
3434
- Show active/inactive records,
3535
- Search phrase in whole table,
3636
- Search phrase in selected column (exact, like and list mode)
37-
- versions:
38-
- client side (small tables)
37+
- items view versions:
38+
- client side (small tables),
3939
- server side (big tables)
40+
- items view types:
41+
- table,
42+
- **NEW!** tree
4043
- other functions and features:
4144
- datatable mechanism allows selection of the number of records per page, page transition and sorting,
4245
- management of a child table from the parent table module,

Diff for: babel.config.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
module.exports = {
2-
presets: [
3-
'@vue/app',
4-
],
2+
presets: ['@vue/app'],
53
}

Diff for: docs/.vuepress/config.js

+1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ module.exports = {
129129
'/guide/crud/basics',
130130
'/guide/crud/custom-configuration',
131131
'/guide/crud/field-options',
132+
'/guide/crud/items-view',
132133
'/guide/crud/extended-details',
133134
'/guide/crud/item-elements',
134135
]

Diff for: docs/guide/components/crud.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
|watchForCreation|-|`Boolean`|`false`|false|
2626
|primaryKey|-|`String`|`false`|crud.primaryKey || 'id'|
2727
|activeColumnName|-|`String`|`false`|crud.activityColumnName || 'active'|
28-
|mode|-|`String`|`false`|'ClientSide'|
28+
|mode (obsolete)|'ClientSide' or 'ServerSide'|`String`|`false`|'ClientSide'|
29+
|itemsView|[See list of available properties](/guide/crud/items-view.html)|`Object`|`false`|{type: 'table', mode: 'client'}|
2930
|createMode|-|`Boolean`|`false`|crud.createMode === undefined ? true : crud.createMode|
3031
|editMode|-|`Boolean`|`false`|crud.editMode === undefined ? true : crud.editMode|
3132
|mainFilter|-|`Boolean`|`false`|crud.mainFilter === undefined ? true : crud.mainFilter|
@@ -35,6 +36,7 @@
3536
|selectManyMode|-|`Boolean`|`false`|crud.selectManyMode === undefined ? true : crud.selectManyMode|
3637
|updateManyMode|-|`Boolean`|`false`|crud.updateManyMode === undefined ? true : crud.updateManyMode|
3738
|removeManyMode|-|`Boolean`|`false`|crud.removeManyMode === undefined ? true : crud.removeManyMode|
39+
|itemDetailsWidth|-|`Any`|`false`|600|
3840

3941
<!-- @vuese:[name]:props:end -->
4042

@@ -290,11 +292,12 @@ export default {
290292
|---|---|---|---|---|
291293
|title|-|`String`|`false`|-|
292294
|fieldsInfo|-|`Array`|`false`|-|
295+
|createMode|-|`Boolean`|`false`|true|
296+
|editMode|-|`Boolean`|`false`|true|
293297
|deleteMode|-|`String`|`false`|'soft'|
294298
|customHeaderButtons|-|`Array`|`false`||
295299
|customButtons|-|`Array`|`false`||
296300
|itemElements|-|`Object`|`false`|-|
297-
|createButton|-|`Boolean`|`false`|true|
298301
|editButton|-|`Boolean`|`false`|true|
299302
|meta|-|`Array`|`false`||
300303
|primaryKey|-|`String`|`false`|'id'|
@@ -309,7 +312,7 @@ export default {
309312
<!-- @vuese:[name]:mixIns:start -->
310313
|MixIn|
311314
|---|
312-
|ClientSideFilteringMixin|
315+
|ClientModeFilteringMixin|
313316
|HelperMixin|
314317

315318
<!-- @vuese:[name]:mixIns:end -->

Diff for: docs/guide/crud/field-options.md

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ Parameters:
2121
## `grid`
2222
*String*, optional. Vuetify grid used in extended details. This parameter is used to determine the field width on different screens.
2323

24+
## `edit`
25+
*Boolean*, default: **true**. Responsible for displaying the field in the update form.
26+
2427
## `multiedit`
2528
*Boolean*, default: **true**. Responsible for displaying the field in the multiple update form.
2629

Diff for: docs/guide/crud/items-view.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Items view
2+
3+
## `type`
4+
*String*, default: **table**. Available values: **table**, **tree**. Information items view should be displayed as table or tree.
5+
6+
## `mode`
7+
*String*, default: **client**. Available values: **client**, **server**. Information items view should be automatically by Vue CRUD or server side by API.
8+
9+
## `config`
10+
*Object*, optional. Property must be defined if field `type` is **tree**.
11+
12+
Parameters:
13+
- `parentColumnName`: Name of column with parent item id. Default value: **parent_id**
14+
- `unassignedItemParent`: Value of item's parent that means this item is unassigned (root object). Default value: **null**

Diff for: docs/guide/essentials/introduction.md

+35-13
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,12 @@ Vue CRUD provides a set of utilities, from which you can compose your own applic
2727
- Show active/inactive records,
2828
- Search phrase in whole table,
2929
- Search phrase in selected column (exact, like and list mode)
30-
- versions:
31-
- client side (small tables < 2000 records)
32-
- server side (> 2000 records)
30+
- items view versions:
31+
- client side (small tables),
32+
- server side (big tables)
33+
- items view types:
34+
- table,
35+
- **NEW!** tree
3336
- other functions and features:
3437
- datatable mechanism allows selection of the number of records per page, page transition and sorting,
3538
- management of a child table from the parent table module,
@@ -63,21 +66,40 @@ The record creation / editing form supports the following types of fields:
6366
* Decimal
6467
* Textarea,
6568
* Rich Text Box,
66-
* Select (list from related table),
69+
* Select (hardcoded list or obtained from API),
6770
* Datepicker,
6871
* Timepicker,
6972
* Checkbox,
70-
* Files
73+
* Files,
74+
* **NEW!** Dynamic (user can select field type separately for each record)
7175

72-
## Demo
76+
## Support for mobile devices
7377

74-
- **<a href="http://vue-crud-simple.id-a.pl" target="_blank">Simple CRUD demo</a>**
75-
- **<a href="http://vue-crud-crm.id-a.pl" target="_blank">CRM demo</a>**\
76-
Credentials with limited privileges (readonly):\
77-
78-
Pass: ajSGenC0\
79-
To get full user account, contact me (Szczepan Masny) on my
80-
<a href="http://id-a.pl" target="_blank">company site</a>.
78+
### App layout on desktop...
79+
<img
80+
width="auto"
81+
height="400"
82+
src="https://user-images.githubusercontent.com/18534115/68077595-9fed6d00-fdc6-11e9-9e52-37dad9bb4bc1.png"
83+
alt="app layout on desktop"
84+
/>
85+
86+
### ... and on mobile device
87+
<img
88+
width="auto"
89+
height="400"
90+
src="https://user-images.githubusercontent.com/18534115/68077552-3ff6c680-fdc6-11e9-9b8c-3e92dce596c5.png"
91+
alt="app layout on mobile device"
92+
/>
93+
94+
## Demo versions
95+
96+
#### <a href="http://vue-crud-demo.id-a.pl" target="_blank">DEMO / SANDBOX</a>
97+
98+
#### <a href="http://vue-crud-crm.id-a.pl" target="_blank">CRM DEMO</a>
99+
Credentials with limited privileges (readonly):\
100+
101+
Pass: ajSGenC0\
102+
To get full user account, contact me on my <a href="http://id-a.pl" target="_blank">company site</a>.
81103

82104
## License
83105
[MIT](https://opensource.org/licenses/MIT)

Diff for: examples/cms/config/main.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
export default {
22
title: 'YourCMS',
3-
locales: [{
4-
name: 'en',
5-
text: 'English',
6-
},
7-
{
8-
name: 'pl',
9-
text: 'Polski',
10-
},
3+
locales: [
4+
{
5+
name: 'en',
6+
text: 'English',
7+
},
8+
{
9+
name: 'pl',
10+
text: 'Polski',
11+
},
1112
],
1213
defaultLocale: 'en',
1314
iconfont: 'md',

Diff for: examples/cms/locales/en/datatable.js

+4
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,9 @@ export default {
4242
refreshTable: 'Refresh table',
4343
copyToExcel: 'Copy to Excel',
4444
clearFilters: 'Clear filters',
45+
move: 'Move',
46+
insert: 'Insert',
47+
insertUnassigned: 'Insert unassigned',
48+
cancelMove: 'Cancel move',
4549
},
4650
}

Diff for: examples/cms/locales/en/routes.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export default {
66
name: 'CMS',
77
settings: 'Settings',
88
messages: 'Messages',
9+
menuItems: 'Menu items',
910
},
1011
store: {
1112
name: 'Store',

Diff for: examples/cms/locales/pl/datatable.js

+4
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,9 @@ export default {
4242
refreshTable: 'Odswież tabelę',
4343
copyToExcel: 'Kopiuj do Excela',
4444
clearFilters: 'Wyczyść filtry',
45+
move: 'Przenieś',
46+
insert: 'Wstaw',
47+
insertUnassigned: 'Wstaw bez przypisania',
48+
cancelMove: 'Anuluj przenoszenie',
4549
},
4650
}

Diff for: examples/cms/locales/pl/routes.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export default {
66
name: 'CMS',
77
settings: 'Ustawienia',
88
messages: 'Wiadomości',
9+
menuItems: 'Elementy menu',
910
},
1011
store: {
1112
name: 'Sklep',

Diff for: examples/cms/router.js

+25-24
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,32 @@ import store from '@/store/'
88
Vue.use(Router)
99

1010
const router = new Router({
11-
routes: [{
12-
path: '/',
13-
name: 'app',
14-
component: App,
15-
children: appRoutes,
16-
beforeEnter: (to, from, next) => {
17-
var auth = localStorage.getItem('token')
18-
if (!auth) {
19-
store.commit('auth/logout')
20-
next('/login')
21-
} else {
22-
Vue.http.get('auth/user')
23-
.then(response => {
24-
next()
25-
}, response => {
26-
next('/login')
27-
})
28-
}
11+
routes: [
12+
{
13+
path: '/',
14+
name: 'app',
15+
component: App,
16+
children: appRoutes,
17+
beforeEnter: (to, from, next) => {
18+
var auth = localStorage.getItem('token')
19+
if (!auth) {
20+
store.commit('auth/logout')
21+
next('/login')
22+
} else {
23+
Vue.http.get('auth/user')
24+
.then(response => {
25+
next()
26+
}, response => {
27+
next('/login')
28+
})
29+
}
30+
},
31+
},
32+
{
33+
path: '/login',
34+
name: 'login',
35+
component: Login,
2936
},
30-
},
31-
{
32-
path: '/login',
33-
name: 'login',
34-
component: Login,
35-
},
3637
],
3738
})
3839

Diff for: examples/cms/routes/app/Index.vue

+8-1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ export default {
108108
text: 'cms.messages',
109109
route: '/messages',
110110
},
111+
{
112+
text: 'cms.menuItems',
113+
route: '/menu-items',
114+
},
111115
],
112116
},
113117
{
@@ -192,7 +196,10 @@ export default {
192196
],
193197
}),
194198
computed: {
195-
...mapGetters('auth', ['isLogged', 'userInfo']),
199+
...mapGetters('auth', [
200+
'isLogged',
201+
'userInfo',
202+
]),
196203
year () {
197204
let year = new Date()
198205
return year.getFullYear()

Diff for: examples/cms/routes/app/routes/administration/Index.vue

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ export default {
1616
this.setModule('admin.name')
1717
},
1818
methods: {
19-
...mapMutations('app', [
20-
'setModule',
21-
]),
19+
...mapMutations('app', ['setModule']),
2220
},
2321
}
2422

0 commit comments

Comments
 (0)