Commit 6d96045f by weijiguang

1

parent 9699ea47
......@@ -5,11 +5,11 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<title>TSU车辆管理系统</title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<strong>We're sorry but iview-admin doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
......
<template>
<div id="app">
<router-view/>
<div id="app" >
<router-view />
</div>
</template>
......
......@@ -54,12 +54,16 @@ import {
getContract,
getDriver,
getVehicle,
getDashboardData,
} from "./request_methods";
export default {
namespaced: true,
state: {},
actions: {
asyncGetDashboardData(_, payload) {
return getDashboardData(payload)
},
asyncUploadFile(_, payload) {
return uploadFile(payload)
},
......
......@@ -121,3 +121,6 @@ export const getContract = data => axios.post(`${proxy}/contract/get/${data}`);
export const getDriver = data => axios.post(`${proxy}/driver/get/${data}`);
// 车辆 / 根据id获取车辆信息
export const getVehicle = data => axios.post(`${proxy}/vehicle/get/${data}`);
// 仪表盘 / 获取数据
export const getDashboardData = data => axios.post(`${proxy}/analytics/dashboard`);
\ No newline at end of file
@import "~iview/src/styles/index.less";
html,body,#app {
width: 100%;
height: 100%;
}
\ No newline at end of file
......@@ -11,7 +11,7 @@ export default [
{
path: '/main',
key: 'main',
icon: 'logo-xbox',
icon: 'md-home',
title: '首页',
visable: false,
component: () => import("@/view/main/index.vue")
......@@ -19,7 +19,7 @@ export default [
{
path: '/home',
key: 'home',
icon: 'logo-xbox',
icon: 'ios-speedometer-outline',
title: '首页',
visable: false,
component: () => import("@/view/home/index.vue")
......@@ -27,30 +27,20 @@ export default [
{
path: '/company',
key: 'company',
icon: 'logo-xbox',
icon: 'ios-globe-outline',
title: '企业管理',
visable: false,
children: [
{
path: '/company/companys',
key: 'companys',
icon: 'logo-xbox',
title: '企业列表',
visable: false,
component: () => import("@/view/company/companys/index.vue")
},
// {
// path: '/company/add',
// key: 'add',
// icon: 'logo-xbox',
// title: '添加企业',
// visable: false,
// component: () => import("@/view/company/add/index.vue")
// },
{
path: '/company/info',
key: 'info',
icon: 'logo-xbox',
title: '企业信息',
visable: false,
component: () => import("@/view/company/info/index.vue")
......@@ -58,7 +48,6 @@ export default [
{
path: '/company/accounts',
key: 'accounts',
icon: 'logo-xbox',
title: '帐号列表',
visable: false,
component: () => import("@/view/company/accounts/index.vue")
......@@ -68,14 +57,13 @@ export default [
{
path: '/data',
key: 'data',
icon: 'logo-xbox',
icon: 'ios-folder-outline',
title: '基础数据',
visable: false,
children: [
{
path: '/data/source',
key: 'source',
icon: 'logo-xbox',
title: '车源管理',
visable: false,
component: () => import("@/view/data/source/index.vue")
......@@ -83,7 +71,6 @@ export default [
{
path: '/data/model',
key: 'model',
icon: 'logo-xbox',
title: '品牌型号',
visable: false,
component: () => import("@/view/data/model/index.vue")
......@@ -91,7 +78,6 @@ export default [
{
path: '/data/fee',
key: 'fee',
icon: 'logo-xbox',
title: '费用项',
visable: false,
component: () => import("@/view/data/fee/index.vue")
......@@ -101,14 +87,13 @@ export default [
{
path: '/vehicle',
key: 'vehicle',
icon: 'logo-xbox',
icon: 'ios-car-outline',
title: '车辆管理',
visable: false,
children: [
{
path: '/vehicle/list',
key: 'vehicle_list',
icon: 'logo-xbox',
title: '车辆查询',
visable: false,
component: () => import("@/view/vehicle/list/index.vue")
......@@ -118,14 +103,13 @@ export default [
{
path: '/source_contract',
key: 'source_contract',
icon: 'logo-xbox',
icon: 'ios-document-outline',
title: '车源合同',
visable: false,
children: [
{
path: '/source_contract/list',
key: 'source_contract_list',
icon: 'logo-xbox',
title: '合同查询',
visable: false,
component: () => import("@/view/source_contract/list/index.vue")
......@@ -135,14 +119,13 @@ export default [
{
path: '/driver',
key: 'driver',
icon: 'logo-xbox',
icon: 'ios-people-outline',
title: '司机管理',
visable: false,
children: [
{
path: '/driver/list',
key: 'list',
icon: 'logo-xbox',
title: '司机查询',
visable: false,
component: () => import("@/view/driver/list/index.vue")
......@@ -152,14 +135,13 @@ export default [
{
path: '/driver_contract',
key: 'driver_contract',
icon: 'logo-xbox',
icon: 'ios-document-outline',
title: '司机合同',
visable: false,
children: [
{
path: '/driver_contract/list',
key: 'driver_contract_list',
icon: 'logo-xbox',
title: '合同查询',
visable: false,
component: () => import("@/view/driver_contract/list/index.vue")
......@@ -167,7 +149,6 @@ export default [
{
path: '/driver_contract/receivables',
key: 'driver_receivables',
icon: 'logo-xbox',
title: '应收帐款',
visable: false,
component: () => import("@/view/driver_contract/receivables/index.vue")
......@@ -175,7 +156,6 @@ export default [
{
path: '/driver_contract/bill_logs',
key: 'driver_bill_logs',
icon: 'logo-xbox',
title: '帐款日志',
visable: false,
component: () => import("@/view/driver_contract/bill_logs/index.vue")
......
import store from "@/store";
const { dispatch } = store;
export default {
components: { },
data() {
return {
loading: false,
data: null,
}
},
methods: {
getData() {
this.loading = true;
dispatch("invoke/asyncGetDashboardData", null).then(response => {
this.loading = false;
this.setData(response.data);
});
},
setData(data) {
this.data = data;
}
},
mounted() {
this.getData();
}
};
\ No newline at end of file
<template>
<div>
home
<Row :gutter="20" style="margin-top:25px">
<Col span="6">
<Card title="本月帐款" >
<Spin size="small" v-if="!data"></Spin>
<div v-else>
应收: {{ data.currentMonthPlanAmount }}
</br>
已收: {{ data.currentMonthActualAmount }}
</div>
</Card>
</Col>
<Col span="6">
<Card title="今日帐款" >
<Spin size="small" v-if="!data"></Spin>
<div v-else>
应收: {{ data.todayPlanAmount }}
</br>
已收: {{ data.todayActualAmount }}
</div>
</Card>
</Col>
<Col span="6">
<Card title="司机数量" >
<Spin size="small" v-if="!data"></Spin>
<div v-else>
全部: {{ data.allDriverCount }}
</br>
签约中: {{ data.signedDriverCount }}
</div>
</Card>
</Col>
<Col span="6">
<Card title="车辆数量" >
<Spin size="small" v-if="!data"></Spin>
<div v-else>
全部: {{ data.allVehicleCount }}
</br>
签约中: {{ data.signedVehicleCount }}
</div>
</Card>
</Col>
</Row>
<Row :gutter="20" style="margin-top:25px">
<Col span="8">
<Card title="合同数量" >
<Spin size="small" v-if="!data"></Spin>
<div v-else>
全部: {{ data.allContract }}
</br>
签约中: {{ data.validContract }}
</div>
</Card>
</Col>
<Col span="8">
<Card title="月租" >
<Spin size="small" v-if="!data"></Spin>
<div v-else>
本月新租: {{ data.currentMonthContract }}
</br>
上月新租: {{ data.lastMonthContract }}
</div>
</Card>
</Col>
<Col span="8">
<Card title="日租" >
<Spin size="small" v-if="!data"></Spin>
<div v-else>
今日新租: {{ data.todayContract }}
</br>
昨日新租: {{ data.yesterdayContract }}
</div>
</Card>
</Col>
</Row>
<Row :gutter="20" style="margin-top:25px">
</Row>
</div>
</template>
<script src="./index.js"></script>
<style>
.item_card {
width: 33%;
}
</style>
\ No newline at end of file
<template>
<div>
<div class="Title"></div>
<div class="LoginCard">
<Card :bordered="true">
<Layout class="layout">
<Header class="header">TSU车辆管理系统</Header>
<Content>
<Card class="login_card" :bordered="true">
<p slot="title">系统登录</p>
<Form ref="loginForm" :model="loginForm" :rules="loginRule">
<Row>
......@@ -32,21 +32,31 @@
</Row>
</Form>
</Card>
</div>
</div>
</Content>
<Footer class="footer">Copyright © 2020 北京金数云科技有限公司 | 京ICP备16010358号-2</Footer>
</Layout>
</template>
<script src="./index.js"></script>
<style>
.Title {
background-color: cadetblue;
font-size: 24px;
.layout {
width: 100%;
height: 100%;
}
.footer {
text-align: center;
/* color: #FFF; */
/* letter-spacing: 5px;
font-size: 22px; */
}
.header {
text-align: center;
padding: 10px;
color: black;
color: #FFF;
letter-spacing: 5px;
font-size: 22px;
}
.LoginCard {
.login_card {
width: 350px;
margin: 0 auto;
margin-top: 50px;
......
......@@ -69,11 +69,20 @@ export default {
onMenuSelect(name) {
var router = this.getMenuFromRouter(name);
this.currentView = router.component;
if(router.maps) {
for(var i=0; i<router.maps.length; i++){
if(router.maps[i] == '首页') {
this.maps = [];
return;
}
}
}
this.maps = router.maps;
}
},
mounted() {
this.setMenus();
this.onMenuSelect("home");
}
};
\ No newline at end of file
\ No newline at end of file
......@@ -3,11 +3,11 @@
<Layout>
<Header>
<Menu mode="horizontal" theme="dark" active-name="1">
<div class="layout-logo"></div>
<div class="layout-logo">TSU车辆管理系统</div>
<div class="layout-nav">
<MenuItem name="1"><Icon type="ios-navigate"></Icon>Item 1</MenuItem>
<!-- <MenuItem name="1"><Icon type="ios-navigate"></Icon>Item 1</MenuItem>
<MenuItem name="2"><Icon type="ios-navigate"></Icon>Item 2</MenuItem>
<MenuItem name="3"><Icon type="ios-navigate"></Icon>Item 3</MenuItem>
<MenuItem name="3"><Icon type="ios-navigate"></Icon>Item 3</MenuItem> -->
</div>
<div class="layout-avatar">
<AvatarView></AvatarView>
......@@ -15,7 +15,7 @@
</Menu>
</Header>
<Layout style="position:absolute; top:64px; bottom:0px; left:0px; right:0px;">
<Sider hide-trigger :style="{background: '#fff'}">
<Sider hide-trigger :style="{background: '#fff'}" width="250">
<Menu theme="light" width="auto" :open-names="['1']" ref="menu" @on-select="onMenuSelect" accordion>
<div v-for='(item, index) in routers' v-bind:key='index'>
<div v-if='item.visable && !item.children'>
......@@ -35,7 +35,7 @@
</Menu>
</Sider>
<Layout :style="{padding: '0 24px 24px'}">
<Breadcrumb :style="{margin: '24px 0'}">
<Breadcrumb :style="{margin: '24px 0'}" v-if="maps && maps.length>0">
<BreadcrumbItem v-for="(item, index) in maps" v-bind:key="index">{{item}}</BreadcrumbItem>
</Breadcrumb>
<component :is="currentView"></component>
......@@ -55,13 +55,12 @@
height: 100%;
}
.layout-logo{
width: 100px;
height: 30px;
background: #990000;
color: #FFF;
letter-spacing: 5px;
font-size: 22px;
border-radius: 3px;
float: left;
position: relative;
top: 15px;
}
.layout-nav {
// width: 420px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment