File tree Expand file tree Collapse file tree 11 files changed +150
-26
lines changed Expand file tree Collapse file tree 11 files changed +150
-26
lines changed Original file line number Diff line number Diff line change 44 {
55 "label" : " Home" ,
66 "path" : " /home"
7- },
8- {
9- "label" : " Data Report" ,
10- "path" : " /data-report"
117 }
128 ]
139}
Original file line number Diff line number Diff line change 1+ {
2+ "status" : 0 ,
3+ "data" : {
4+ "carouselData" : [
5+ " Welcome to Configurable Platform" ,
6+ " Power and Fasten Platform Developing"
7+ ],
8+ "hotTemplates" : [
9+ {
10+ "title" : " Data Report" ,
11+ "description" : " A comfigurable data report template, support searching and data visualization!"
12+ },
13+ {
14+ "title" : " Authority Management" ,
15+ "description" : " A comfigurable authority management template, based on BRAC model"
16+ },
17+ {
18+ "title" : " Editable Table" ,
19+ "description" : " Modify data inside the table, really convenient!"
20+ }
21+ ]
22+ }
23+ }
Original file line number Diff line number Diff line change 11export function computeBreadCrumbList ( currentPath = "" , menuList = [ ] ) {
2- console . log ( currentPath , menuList ) ;
32 let breadCrumbList = [ ] ;
43 menuList . forEach ( item => {
54 if ( item . submenu ) {
Original file line number Diff line number Diff line change 11import Vue from "vue" ;
22import iView from "iview" ;
33import VueRouter from "vue-router" ;
4- import FormGenerator from "form-generator-iview/src/index" ;
5- import DataVis from "data-vis-iview" ;
4+ // import FormGenerator from "form-generator-iview/src/index";
5+ // import DataVis from "data-vis-iview";
66
77import App from "./App.vue" ;
88import router from "./router" ;
99import store from "./store" ;
1010
1111import "iview/dist/styles/iview.css" ;
12- import "form-generator-iview/src/style/index.less" ;
13- import "data-vis-iview/src/style/index.less" ;
12+ // import "form-generator-iview/src/style/index.less";
13+ // import "data-vis-iview/src/style/index.less";
1414
1515Vue . use ( VueRouter ) ;
1616Vue . use ( iView ) ;
17- Vue . use ( FormGenerator ) ;
18- Vue . use ( DataVis ) ;
17+ // Vue.use(FormGenerator);
18+ // Vue.use(DataVis);
1919
2020// 开启debug模式
2121Vue . config . debug = true ;
Original file line number Diff line number Diff line change 11<template >
2- <div >Home</div >
2+ <div class =" page-home" >
3+ <Carousel v-model =" current" loop >
4+ <CarouselItem v-for =" (item, index) in carouselData" :key =" index" >
5+ <div class =" page-home-carousel-content" >{{ item }}</div >
6+ </CarouselItem >
7+ </Carousel >
8+ <div class =" page-home-hot-templates" >
9+ <h1 class =" page-home-hot-templates-header" >Hot Templates</h1 >
10+ <div class =" page-home-hot-templates-cards" >
11+ <Card
12+ v-for =" (item, index) in hotTemplates"
13+ :key =" index"
14+ class =" page-home-hot-templates-card"
15+ >
16+ <p slot =" title" >{{ item.title }}</p >
17+ <p >
18+ {{ item.description }}
19+ </p >
20+ </Card >
21+ </div >
22+ </div >
23+ </div >
324</template >
25+ <script >
26+ import service from " @/service" ;
27+ export default {
28+ data () {
29+ return {
30+ current: 0 ,
31+ carouselData: [],
32+ hotTemplates: []
33+ };
34+ },
35+ mounted () {
36+ service .getHomeData ().then (res => {
37+ console .log ();
38+ const { carouselData , hotTemplates } = res .data ;
39+ this .carouselData = carouselData;
40+ this .hotTemplates = hotTemplates;
41+ });
42+ }
43+ };
44+ </script >
45+ <style lang="less">
46+ .page-home {
47+ &-carousel-content {
48+ border-radius : 4px ;
49+ height : 300px ;
50+ font-size : 24px ;
51+ display : flex ;
52+ align-items : center ;
53+ justify-content : center ;
54+ background : #506b9e ;
55+ color : #fff ;
56+ }
57+
58+ &-hot-templates {
59+ margin-top : 30px ;
60+ &-header {
61+ text-align : center ;
62+ }
63+
64+ &-cards {
65+ display : flex ;
66+ align-items : center ;
67+ justify-content : space-around ;
68+ }
69+ &-card {
70+ width : 30% ;
71+ display : inline-block ;
72+ margin : 20px ;
73+ height : 120px ;
74+ }
75+ }
76+ }
77+ </style >
Original file line number Diff line number Diff line change 1+ export default {
2+ path : "/home" ,
3+ component : ( ) => import ( /* webpackChunkName: "home" */ "./index" )
4+ } ;
Original file line number Diff line number Diff line change 1+ const getHomeData = ( params = { } ) => {
2+ return {
3+ url : "/api/home/home-data" ,
4+ method : "get" ,
5+ params
6+ } ;
7+ } ;
8+
9+ export default {
10+ getHomeData
11+ } ;
Original file line number Diff line number Diff line change 44 */
55
66import Main from "../components/layout/default" ;
7- import dataReportRouter from "../page/data-report/router" ;
7+
8+ const routersContext = require . context ( "../page/" , true , / r o u t e r \. j s $ / ) ;
9+ const routers = routersContext . keys ( ) . map ( key => {
10+ return routersContext ( key ) . default ;
11+ } ) ;
12+
813export default [
914 {
1015 path : "/" ,
1116 redirect : "/home" ,
1217 component : Main ,
13- children : [
14- {
15- path : "/home" ,
16- component : ( ) => import ( /* webpackChunkName: "home" */ "../page/home" )
17- } ,
18- ...dataReportRouter
19- ]
18+ children : [ ...routers ]
2019 }
2120 // {
2221 // path: '/401',
Original file line number Diff line number Diff line change 11import axios from "../libs/api.request" ;
22
3- import * as appServices from "./module/app" ;
4- import * as userServices from "./module/user" ;
3+ import appServices from "./module/app" ;
4+ import userServices from "./module/user" ;
55
6- import * as dataReportServices from "../page/data-report/service" ;
6+ const templateServiceContext = require . context ( "../page" , true , / s e r v i c e \. j s $ / ) ;
7+ const templateServices = { } ;
8+
9+ templateServiceContext . keys ( ) . map ( key => {
10+ const contextObj = templateServiceContext ( key ) . default ;
11+ Object . keys ( contextObj ) . forEach ( service => {
12+ templateServices [ service ] = contextObj [ service ] ;
13+ } ) ;
14+ } ) ;
715
816const servicesConfig = {
917 ...appServices ,
1018 ...userServices ,
11- ...dataReportServices
19+ ...templateServices
1220} ;
1321
22+ console . log ( servicesConfig ) ;
1423let services = { } ;
24+
1525Object . keys ( servicesConfig ) . forEach ( service => {
1626 services [ service ] = ( params = { } ) => {
1727 return axios . request ( servicesConfig [ service ] ( params ) ) ;
Original file line number Diff line number Diff line change 1- export const getMenuList = ( params = { } ) => {
1+ const getMenuList = ( params = { } ) => {
22 return {
33 url : "/api/app/menu-list" ,
44 method : "get" ,
55 params
66 } ;
77} ;
8+
9+ export default {
10+ getMenuList
11+ } ;
You can’t perform that action at this time.
0 commit comments