├── src
├── store
│ ├── getters.js
│ ├── state.js
│ ├── actions_type.js
│ ├── mutations_type.js
│ ├── index.js
│ ├── mutations.js
│ └── actions.js
├── assets
│ ├── rowBar.png
│ ├── areaPie.png
│ ├── circlePie.png
│ ├── columnBar.png
│ ├── doubleLine.png
│ └── singleLine.png
├── nets
│ ├── api.js
│ └── index.js
├── main.js
├── App.vue
├── router.js
├── utils
│ ├── index.js
│ ├── dataInfor.js
│ └── chartview.js
├── components
│ ├── editChart.vue
│ ├── selectColor.vue
│ ├── LineSimple.vue
│ └── NavMenu.vue
├── views
│ └── Home.vue
└── mock
│ └── index.js
├── babel.config.js
├── public
├── favicon.ico
└── index.html
├── vue.config.js
├── README.md
└── package.json
/src/store/getters.js:
--------------------------------------------------------------------------------
1 | export default {
2 |
3 | }
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ["@vue/app"]
3 | };
4 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzhewd/datavisualization/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/src/assets/rowBar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzhewd/datavisualization/HEAD/src/assets/rowBar.png
--------------------------------------------------------------------------------
/src/assets/areaPie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzhewd/datavisualization/HEAD/src/assets/areaPie.png
--------------------------------------------------------------------------------
/src/assets/circlePie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzhewd/datavisualization/HEAD/src/assets/circlePie.png
--------------------------------------------------------------------------------
/src/assets/columnBar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzhewd/datavisualization/HEAD/src/assets/columnBar.png
--------------------------------------------------------------------------------
/src/assets/doubleLine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzhewd/datavisualization/HEAD/src/assets/doubleLine.png
--------------------------------------------------------------------------------
/src/assets/singleLine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzhewd/datavisualization/HEAD/src/assets/singleLine.png
--------------------------------------------------------------------------------
/vue.config.js:
--------------------------------------------------------------------------------
1 | // vue.config.js
2 | module.exports = {
3 | publicPath: process.env.NODE_ENV === 'production'
4 | ? './'
5 | : '/'
6 |
7 | };
8 |
--------------------------------------------------------------------------------
/src/store/state.js:
--------------------------------------------------------------------------------
1 | export const initVal = {
2 | firCharInfo: [],
3 | delText: -1,
4 | lineChart: [],
5 | editChartInfo: {}
6 | };
7 |
8 | export default {
9 | ...initVal
10 | };
--------------------------------------------------------------------------------
/src/nets/api.js:
--------------------------------------------------------------------------------
1 | const PREFIX =
2 | process.env.NODE_ENV === "production"
3 | ? ""
4 | : "";
5 | export const FIRSTCHART = `${PREFIX}/data/firstchart`;
6 | export const GETLINECHART = `${PREFIX}/data/lineChart`;
7 |
--------------------------------------------------------------------------------
/src/store/actions_type.js:
--------------------------------------------------------------------------------
1 | export const GET_ALL_CHART_INFO = "GET_ALL_CHART_INFO";
2 | export const PUSH_DEL_WHICH_ONE = "PUSH_DEL_WHICH_ONE";
3 | export const GET_LINE_CHART_INFO = 'GET_LINE_CHART_INFO';
4 | export const SET_EIDT_CHART_INFO = 'SET_EIDT_CHART_INFO';
--------------------------------------------------------------------------------
/src/store/mutations_type.js:
--------------------------------------------------------------------------------
1 | export const MUTATE_FIRST_CHART_INFO = "MUTATE_FIRST_CHART_INFO";
2 | export const MUTATE_DEL_WHICH_ONE = " MUTATE_DEL_WHICH_ONE";
3 | export const MUTATE_LINE_CHART = 'MUTATE_LINE_CHART';
4 | export const MUTATE_EDIT_CHART = 'MUTATE_EDIT_CHART';
--------------------------------------------------------------------------------
/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import Vuex from "vuex";
3 | import state from "./state";
4 | import actions from "./actions";
5 | import mutations from "./mutations";
6 | import getters from "./getters";
7 |
8 | Vue.use(Vuex);
9 |
10 | export default new Vuex.Store({
11 | state,
12 | mutations,
13 | actions,
14 | getters
15 | });
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import App from "./App.vue";
3 | import router from "./router";
4 | import store from "./store";
5 | import ElementUI from "element-ui";
6 | import "element-ui/lib/theme-chalk/index.css";
7 | require('./mock')
8 | Vue.config.productionTip = false;
9 | Vue.use(ElementUI);
10 |
11 | new Vue({
12 | router,
13 | store,
14 | render: h => h(App)
15 | }).$mount("#app");
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # datavisualization
2 |
3 | ## Project setup
4 | ```
5 | npm install
6 | ```
7 |
8 | ### Compiles and hot-reloads for development
9 | ```
10 | npm run serve
11 | ```
12 |
13 | ### Compiles and minifies for production
14 | ```
15 | npm run build
16 | ```
17 |
18 | ### Run your tests
19 | ```
20 | npm run test
21 | ```
22 |
23 | ### Lints and fixes files
24 | ```
25 | npm run lint
26 | ```
27 |
28 | ### Customize configuration
29 | See [Configuration Reference](https://cli.vuejs.org/config/).
30 |
--------------------------------------------------------------------------------
/src/nets/index.js:
--------------------------------------------------------------------------------
1 | import * as api from './api';
2 | import http from 'axios';
3 | import qs from 'qs';
4 |
5 | import {
6 | ajaxToPromise
7 | } from '../utils';
8 |
9 | const axios = http.create({
10 | timeout: 15000,
11 | // withCredentials: true //跨域请求携带cookie
12 | });
13 |
14 | export function getchartlist (payload) {
15 | return ajaxToPromise(axios.get(api.FIRSTCHART));
16 | }
17 | export function getlinechart (payload) {
18 | return ajaxToPromise(axios.post(api.GETLINECHART, payload));
19 | }
20 |
--------------------------------------------------------------------------------
/src/store/mutations.js:
--------------------------------------------------------------------------------
1 | import * as types from "./mutations_type";
2 |
3 | export default {
4 | [types.MUTATE_FIRST_CHART_INFO](state, payLoad) {
5 | state.firCharInfo.push(payLoad);
6 | },
7 | [types.MUTATE_DEL_WHICH_ONE](state, payLoad) {
8 | state.delText = payLoad;
9 | },
10 | [types.MUTATE_LINE_CHART](state, payLoad) {
11 | state.lineChart.push(payLoad)
12 | },
13 | [types.MUTATE_EDIT_CHART](state, payLoad) {
14 | state.editChartInfo = payLoad
15 | }
16 | };
17 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
{{linechartItem.chartTit}}
7 | 8 | 9 |