Skip to content

Commit

Permalink
refactor order list component and update
Browse files Browse the repository at this point in the history
  • Loading branch information
harryho committed Apr 11, 2018
1 parent e6abe3d commit 8c4a386
Show file tree
Hide file tree
Showing 23 changed files with 948 additions and 456 deletions.
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"editor.formatOnSave": false,
"prettier.eslintIntegration": false,
"prettier.printWidth": 100,
"prettier.trailingComma": "es5",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
}
17 changes: 5 additions & 12 deletions db/db.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@
}
],
"amount": 89.99,
"orderDate": "2017-01-01",
"shippedDate": "2017-01-01",
"orderDate": "2017-01-12",
"shippedDate": "2017-01-10",
"shipAddress": {
"address": "Gran Vía, 0123",
"city": "Madrid",
Expand Down Expand Up @@ -616,13 +616,6 @@
"unitInStock": null,
"unitPrice": 4.5
},
{
"categoryId": 3,
"productName": "aaa",
"unitPrice": 22,
"unitInStock": 2323,
"id": 25
},
{
"categoryId": 3,
"productName": "Product ABCD",
Expand All @@ -632,10 +625,10 @@
},
{
"id": 27,
"productName": "sasasasd",
"productName": "asdasd",
"categoryId": 3,
"unitInStock": "23",
"unitPrice": "222"
"unitInStock": "22",
"unitPrice": "234"
}
],
"categories": [
Expand Down
3 changes: 1 addition & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue2crm",
"version": "1.5.4",
"version": "1.6.1",
"description": "Simle reusalbe CRM starter built on Vue 2 PWA template and Vuetify UI",
"author": "harryho",
"private": true,
Expand All @@ -18,6 +18,7 @@
"dependencies": {
"axios": "^0.16.2",
"chart.js": "^2.7.2",
"lodash": "^4.17.5",
"vue": "^2.5.15",
"vue-chartjs": "^2.6.5",
"vue-progressbar": "^0.7.4",
Expand Down
66 changes: 33 additions & 33 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@
</v-layout>
</v-container>
</v-content>
<canvas id="canvas"></canvas>
<!-- <canvas id="canvas"></canvas> -->
<v-footer :inset="true" style="justify-content:center; text-align: center" app>
<span >&copy; Vue-CRM 2018</span>
</v-footer>
</template>
<v-dialog v-model="dialog" persistent max-width="290">
</template>
<!-- <v-dialog v-model="dialog" persistent max-width="290">
<v-card>
<v-card-title>{{dialogTitle}}</v-card-title>
<v-card-text>{{dialogText}}</v-card-text>
Expand All @@ -87,7 +87,7 @@
<v-btn class="orange--text darken-1" flat="flat" @click.native="onCancel">Cancel</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-dialog> -->
</v-app>

</template>
Expand Down Expand Up @@ -204,35 +204,35 @@ export default {
name: item.title
});
},
openDialog (
dialogText,
dialogTitle,
confirmCallback,
canelCallbak
) {
this.dialog = true;
this.dialogText = dialogText;
this.dialogTitle = dialogTitle;
if (confirmCallback) this.confirmCallback = confirmCallback;
if (canelCallbak) this.cancelCallback = canelCallbak;
},
confirmCallback () {},
cancelCallback () {},
onConfirm () {
this.dialog = false;
this.dialogText = "";
this.dialogTitle = "";
this.confirmCallback();
this.confirmCallback = () => {};
},
onCancel () {
this.dialog = false;
this.dialogText = "";
this.dialogTitle = "";
this.cancelCallback();
this.cancelCallback = () => {};
console.log("Cancelled");
}
// openDialog (
// dialogText,
// dialogTitle,
// confirmCallback,
// canelCallbak
// ) {
// this.dialog = true;
// this.dialogText = dialogText;
// this.dialogTitle = dialogTitle;
// if (confirmCallback) this.confirmCallback = confirmCallback;
// if (canelCallbak) this.cancelCallback = canelCallbak;
// },
// confirmCallback () {},
// cancelCallback () {},
// onConfirm () {
// this.dialog = false;
// this.dialogText = "";
// this.dialogTitle = "";
// this.confirmCallback();
// this.confirmCallback = () => {};
// },
// onCancel () {
// this.dialog = false;
// this.dialogText = "";
// this.dialogTitle = "";
// this.cancelCallback();
// this.cancelCallback = () => {};
// console.log("Cancelled");
// }
},
mounted () {
this.$Progress.finish();
Expand Down
15 changes: 7 additions & 8 deletions src/components/Login.vue
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
<template>
<v-container fill-height justify-center align-center >
<!-- <v-layout row > -->
<v-flex xs12 sm3>
<!-- <h1> &nbsp;</h1> -->
<v-flex xs12 sm5 md4 lg3>
<v-card class="mt-0 pt-0">
<v-card-title class="blue darken-1">
<h4 style="color:white">Vue-CRM</h4>
</v-card-title>
<v-card-text>
<form @submit.prevent="login">
<v-layout row>
<v-flex xs4>
<v-layout row wrap>
<v-flex xs12 md4 >
<v-subheader>User ID</v-subheader>
</v-flex>
<v-flex xs8>
<v-flex xs12 md8>
<v-text-field class="input-group--focused" name="email" v-model="email" label="email" value="Input text"></v-text-field>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs4>
<v-layout row wrap>
<v-flex xs12 md4>
<v-subheader>Password</v-subheader>
</v-flex>
<v-flex xs8>
<v-flex xs12 md8>
<v-text-field class="input-group--focused" name="password" type="password" v-model="pass" label="password" value="Input text"></v-text-field>
</v-flex>
</v-layout>
Expand Down
8 changes: 4 additions & 4 deletions src/components/SearchPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<v-navigation-drawer right v-model="rightDrawer" :disable-resize-watcher="true" fixed>
<v-list>
<v-list-tile-title>&nbsp;</v-list-tile-title>
<v-list-tile>
<v-list-tile-title class="title">Search Panel</v-list-tile-title>
<!-- <v-list-tile-title>&nbsp;</v-list-tile-title> -->
<v-list-tile class="my-2">
<v-list-tile-title class="title">Advanced Search</v-list-tile-title>
</v-list-tile>
<v-list-tile-title>&nbsp;</v-list-tile-title>
<!-- <v-list-tile-title>&nbsp;</v-list-tile-title> -->
<slot></slot>

<v-layout class="pl-1 pt-3 ml-1" row>
Expand Down
23 changes: 10 additions & 13 deletions src/components/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,19 @@

<template slot="headers" slot-scope="props">
<tr>
<th v-for="header in props.headers" :key="header.text"
:class="['column', 'subheading' , 'text-xs-left']">
<th v-for="(header, index) in props.headers" :key="header.text"
:class="['column', 'subheading' , index === 0? 'text-xs-left': 'text-xs-center']">
{{ header.text }}
</th>
<th>
<v-text-field append-icon="search" label="Quick Search" single-line hide-details v-model="search"></v-text-field>
</th>
<th>
</th>
</tr>
</template>

<template class="body-2" slot="items" slot-scope="props">
<td class="text-xs-left body-2" v-for="(header, index) in headers" :key="index" v-if="header.value!==''">
<td v-for="(header, index) in headers" :key="index" :class="[ index === 0? 'text-xs-left': 'text-xs-center', 'body-2']" v-if="header.value!==''">
{{renderData(props.item, header)}}
</td>

<td class="text-xs-right">
<v-btn class="teal" fab small dark @click.native="$emit('edit', props.item)">
<v-icon>edit</v-icon>
Expand All @@ -34,7 +32,7 @@
</span>
</template>
</v-data-table>
<div class="text-xs-center pt-2">
<div class="text-xs-center pt-2" v-if="isNotEmpty">
<v-pagination v-model="pagination.page" :length="pagination.pages" :total-visible="5" circle></v-pagination>
</div>
</div>
Expand All @@ -48,7 +46,7 @@ export default {
},
data () {
return {
search: "",
search: ""
}
},
methods: {
Expand All @@ -62,10 +60,9 @@ export default {
}
},
computed: {
},
mounted () {
// this.$nextTick(() => {
// })
isNotEmpty () {
return this.items && this.items.length > 0;
}
}
}
</script>
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions src/models/Order.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export class Order {
constructor () {
this.id = "";
this.reference = "";
this.customerId = "";
this.customer = "";
this.products = [];
this.amount = 0;
this.orderDate = null;
this.shippedDate = null;
this.shipAddress = {
address: "",
city: "",
zipcode: "",
country: ""
}
}
}
File renamed without changes.
7 changes: 4 additions & 3 deletions src/models/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from './customer'
export * from './product'
export * from './category'
export * from './Customer'
export * from "./Product";
export * from './Category'
export * from './Order'
// export * from './user'

Empty file removed src/models/order.js
Empty file.
6 changes: 3 additions & 3 deletions src/pages/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<v-container id="dashboard" fluid grid-list-lg class="mx-0 pa-0">
<v-layout row wrap>
<v-flex md3 sm6 xs12 v-for="(stat, key) in stats.monthlyStats" :key="key">
<v-card :class="stat.bgColor" light>
<v-container fluid grid-list-sm light>
<v-card :class="stat.bgColor" dark>
<v-container fluid grid-list-sm dark>
<v-layout class="mt-0 mb-0" row wrap>
<v-flex d-flex xs3>
<v-icon class="mx-0" x-large light>{{stat.icon}}</v-icon>
<v-icon class="mx-0" x-large dark>{{stat.icon}}</v-icon>
</v-flex>
<v-flex d-flex xs9 >
<v-layout class="mt-2 mb-0 pa-0" row wrap>
Expand Down
Loading

0 comments on commit 8c4a386

Please sign in to comment.