diff --git a/package.json b/package.json
index a0409610..bf4e6041 100644
--- a/package.json
+++ b/package.json
@@ -31,7 +31,8 @@
"vue-router": "2.3.0",
"vuedraggable": "2.8.4",
"vuex": "2.2.1",
- "xlsx": "0.8.1"
+ "xlsx": "0.8.1",
+ "vue-count-to":"1.0.5"
},
"devDependencies": {
"autoprefixer": "6.7.2",
diff --git a/src/api/article.js b/src/api/article.js
index a359329d..c062cbb7 100644
--- a/src/api/article.js
+++ b/src/api/article.js
@@ -1,29 +1,8 @@
-import fetch, { tpFetch } from 'utils/fetch';
-import { param } from 'utils';
+import { tpFetch } from 'utils/fetch';
-export function getList(query) {
+export function getList() {
return tpFetch({
url: '/article/list',
method: 'get'
});
}
-export function upload(data) {
- return tpFetch({
- url: 'https://upload.qbox.me',
- method: 'post',
- data
- });
-}
-
-
-/* 外部uri转七牛uri*/
-export function netUpload(token, net_url) {
- const imgData = {
- net_url
- };
- return fetch({
- url: '/qiniu/upload/net/async',
- method: 'post',
- data: imgData
- });
-}
diff --git a/src/components/Charts/barPercent.vue b/src/components/Charts/barPercent.vue
index bdc01874..e82422fe 100644
--- a/src/components/Charts/barPercent.vue
+++ b/src/components/Charts/barPercent.vue
@@ -48,6 +48,7 @@
methods: {
initBar() {
this.chart = echarts.init(document.getElementById(this.id));
+ this.setOptions();
},
setOptions() {
this.chart.setOption({
diff --git a/src/components/Charts/line.vue b/src/components/Charts/line.vue
index 28b22a11..ab416c76 100644
--- a/src/components/Charts/line.vue
+++ b/src/components/Charts/line.vue
@@ -46,6 +46,7 @@
},
mounted() {
this.chart = echarts.init(document.getElementById(this.id));
+ this.setLine(this.listData);
},
methods: {
setLine(dataList) {
diff --git a/src/mock/index.js b/src/mock/index.js
index e2b0edab..9a125c4f 100644
--- a/src/mock/index.js
+++ b/src/mock/index.js
@@ -7,6 +7,7 @@ const articleList = {
'data|20': [{
id: '@id',
title: '@ctitle(10, 20)',
+ 'status|1': ['published', 'draft'],
author: '@cname',
display_time: '@datetime',
pageviews: '@integer(300, 5000)'
diff --git a/src/router/index.js b/src/router/index.js
index 535da322..2bfd0d13 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -19,6 +19,7 @@ import sendPWD from '../views/login/sendpwd';
import reset from '../views/login/reset';
/* components*/
+const componentsIndex = resolve => require(['../views/components/index'], resolve);
const Tinymce = resolve => require(['../views/components/tinymce'], resolve);
const Markdown = resolve => require(['../views/components/markdown'], resolve);
const JsonEditor = resolve => require(['../views/components/jsoneditor'], resolve);
@@ -32,6 +33,7 @@ const Mixin = resolve => require(['../views/components/mixin'], resolve);
/* charts*/
+const chartIndex = resolve => require(['../views/charts/index'], resolve);
const KeyboardChart = resolve => require(['../views/charts/keyboard'], resolve);
const KeyboardChart2 = resolve => require(['../views/charts/keyboard2'], resolve);
const LineMarker = resolve => require(['../views/charts/line'], resolve);
@@ -80,10 +82,11 @@ export default new Router({
{
path: '/components',
component: Layout,
- redirect: 'noredirect',
+ redirect: '/components/index',
name: '组件',
icon: 'zujian',
children: [
+ { path: 'index', component: componentsIndex, name: '介绍' },
{ path: 'tinymce', component: Tinymce, name: '富文本编辑器' },
{ path: 'markdown', component: Markdown, name: 'Markdown' },
{ path: 'jsoneditor', component: JsonEditor, name: 'JSON编辑器' },
@@ -99,10 +102,11 @@ export default new Router({
{
path: '/charts',
component: Layout,
- redirect: 'noredirect',
+ redirect: '/charts/index',
name: '图表',
icon: 'tubiaoleixingzhengchang',
children: [
+ { path: 'index', component: chartIndex, name: '介绍' },
{ path: 'keyboard', component: KeyboardChart, name: '键盘图表' },
{ path: 'keyboard2', component: KeyboardChart2, name: '键盘图表2' },
{ path: 'line', component: LineMarker, name: '折线图' },
diff --git a/src/views/charts/index.vue b/src/views/charts/index.vue
new file mode 100644
index 00000000..af09a352
--- /dev/null
+++ b/src/views/charts/index.vue
@@ -0,0 +1,5 @@
+
+