Created
June 27, 2019 22:54
-
-
Save wilcorrea/a628e281d916106c6e42b1c5ca81c5e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Schema from 'src/app/Agnostic/Schema' | |
| import MovieService from 'src/domains/Example/Movie/MovieService' | |
| import { moviePath } from 'src/domains/Example/Movie/routeFile' | |
| /** | |
| */ | |
| export default class MovieSchema extends Schema { | |
| /** | |
| * @type {string} | |
| */ | |
| static path = moviePath | |
| /** | |
| * @type {string} | |
| */ | |
| static domain = 'example.movie' | |
| /** | |
| * @type {Http} | |
| */ | |
| service = MovieService | |
| /** | |
| */ | |
| construct () { | |
| this.fieldAsPrimaryKey() | |
| this.addField('name') | |
| .fieldTableShow() | |
| .fieldFormWidth(100) | |
| .fieldFormAutofocus() | |
| .fieldOn('input', function () { | |
| // console.log('~> arguments', arguments) | |
| }) | |
| this.addField('description') | |
| .fieldIsText(5) | |
| .fieldTableShow() | |
| .fieldFormWidth(100) | |
| .fieldOn('input', function () { | |
| // console.log('~> arguments', arguments) | |
| }) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Rest from 'src/app/Services/Rest' | |
| /** | |
| */ | |
| export default class MovieService extends Rest { | |
| /** | |
| * @type {String} | |
| */ | |
| resource = '/example/movie' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // import { primaryKey } from 'src/settings/schema' | |
| /** | |
| */ | |
| export default { | |
| form: { | |
| title: '' | |
| }, | |
| table: { | |
| title: '' | |
| }, | |
| sections: { | |
| }, | |
| fields: { | |
| // [primaryKey]: 'Id', | |
| name: 'Nome', | |
| description: 'Descrição' | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { RouteConfig, VueRouter } from 'vue-router/types/router' | |
| import { crud, group } from 'src/app/Util/routing' | |
| /** @type {string} */ | |
| export const moviePath = '/dashboard/example/movie' | |
| /** | |
| * @param {VueRouter} router | |
| * @returns Array<RouteConfig> | |
| */ | |
| export default (router: VueRouter): Array<RouteConfig> => { | |
| // index | |
| const index = () => import('src/layouts/Group.vue') | |
| // table | |
| const table = () => import('src/pages/dashboard/example/movie/MovieTable.vue') | |
| // form | |
| const form = () => import('src/pages/dashboard/example/movie/MovieForm.vue') | |
| return [ | |
| group( | |
| moviePath, | |
| index, | |
| crud('example.movie', moviePath, table, form) | |
| ) | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment