Commit 6d96045f by weijiguang

1

parent 9699ea47
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title> <title>TSU车辆管理系统</title>
</head> </head>
<body> <body>
<noscript> <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> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
......
<template> <template>
<div id="app"> <div id="app" >
<router-view/> <router-view />
</div> </div>
</template> </template>
......
...@@ -54,12 +54,16 @@ import { ...@@ -54,12 +54,16 @@ import {
getContract, getContract,
getDriver, getDriver,
getVehicle, getVehicle,
getDashboardData,
} from "./request_methods"; } from "./request_methods";
export default { export default {
namespaced: true, namespaced: true,
state: {}, state: {},
actions: { actions: {
asyncGetDashboardData(_, payload) {
return getDashboardData(payload)
},
asyncUploadFile(_, payload) { asyncUploadFile(_, payload) {
return uploadFile(payload) return uploadFile(payload)
}, },
......
...@@ -120,4 +120,7 @@ export const getContract = data => axios.post(`${proxy}/contract/get/${data}`); ...@@ -120,4 +120,7 @@ export const getContract = data => axios.post(`${proxy}/contract/get/${data}`);
// 司机 / 根据id获取司机信息 // 司机 / 根据id获取司机信息
export const getDriver = data => axios.post(`${proxy}/driver/get/${data}`); export const getDriver = data => axios.post(`${proxy}/driver/get/${data}`);
// 车辆 / 根据id获取车辆信息 // 车辆 / 根据id获取车辆信息
export const getVehicle = data => axios.post(`${proxy}/vehicle/get/${data}`); export const getVehicle = data => axios.post(`${proxy}/vehicle/get/${data}`);
\ No newline at end of file
// 仪表盘 / 获取数据
export const getDashboardData = data => axios.post(`${proxy}/analytics/dashboard`);
\ No newline at end of file
@import "~iview/src/styles/index.less"; @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 [ ...@@ -11,7 +11,7 @@ export default [
{ {
path: '/main', path: '/main',
key: 'main', key: 'main',
icon: 'logo-xbox', icon: 'md-home',
title: '首页', title: '首页',
visable: false, visable: false,
component: () => import("@/view/main/index.vue") component: () => import("@/view/main/index.vue")
...@@ -19,7 +19,7 @@ export default [ ...@@ -19,7 +19,7 @@ export default [
{ {
path: '/home', path: '/home',
key: 'home', key: 'home',
icon: 'logo-xbox', icon: 'ios-speedometer-outline',
title: '首页', title: '首页',
visable: false, visable: false,
component: () => import("@/view/home/index.vue") component: () => import("@/view/home/index.vue")
...@@ -27,30 +27,20 @@ export default [ ...@@ -27,30 +27,20 @@ export default [
{ {
path: '/company', path: '/company',
key: 'company', key: 'company',
icon: 'logo-xbox', icon: 'ios-globe-outline',
title: '企业管理', title: '企业管理',
visable: false, visable: false,
children: [ children: [
{ {
path: '/company/companys', path: '/company/companys',
key: 'companys', key: 'companys',
icon: 'logo-xbox',
title: '企业列表', title: '企业列表',
visable: false, visable: false,
component: () => import("@/view/company/companys/index.vue") 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', path: '/company/info',
key: 'info', key: 'info',
icon: 'logo-xbox',
title: '企业信息', title: '企业信息',
visable: false, visable: false,
component: () => import("@/view/company/info/index.vue") component: () => import("@/view/company/info/index.vue")
...@@ -58,7 +48,6 @@ export default [ ...@@ -58,7 +48,6 @@ export default [
{ {
path: '/company/accounts', path: '/company/accounts',
key: 'accounts', key: 'accounts',
icon: 'logo-xbox',
title: '帐号列表', title: '帐号列表',
visable: false, visable: false,
component: () => import("@/view/company/accounts/index.vue") component: () => import("@/view/company/accounts/index.vue")
...@@ -68,14 +57,13 @@ export default [ ...@@ -68,14 +57,13 @@ export default [
{ {
path: '/data', path: '/data',
key: 'data', key: 'data',
icon: 'logo-xbox', icon: 'ios-folder-outline',
title: '基础数据', title: '基础数据',
visable: false, visable: false,
children: [ children: [
{ {
path: '/data/source', path: '/data/source',
key: 'source', key: 'source',
icon: 'logo-xbox',
title: '车源管理', title: '车源管理',
visable: false, visable: false,
component: () => import("@/view/data/source/index.vue") component: () => import("@/view/data/source/index.vue")
...@@ -83,7 +71,6 @@ export default [ ...@@ -83,7 +71,6 @@ export default [
{ {
path: '/data/model', path: '/data/model',
key: 'model', key: 'model',
icon: 'logo-xbox',
title: '品牌型号', title: '品牌型号',
visable: false, visable: false,
component: () => import("@/view/data/model/index.vue") component: () => import("@/view/data/model/index.vue")
...@@ -91,7 +78,6 @@ export default [ ...@@ -91,7 +78,6 @@ export default [
{ {
path: '/data/fee', path: '/data/fee',
key: 'fee', key: 'fee',
icon: 'logo-xbox',
title: '费用项', title: '费用项',
visable: false, visable: false,
component: () => import("@/view/data/fee/index.vue") component: () => import("@/view/data/fee/index.vue")
...@@ -101,14 +87,13 @@ export default [ ...@@ -101,14 +87,13 @@ export default [
{ {
path: '/vehicle', path: '/vehicle',
key: 'vehicle', key: 'vehicle',
icon: 'logo-xbox', icon: 'ios-car-outline',
title: '车辆管理', title: '车辆管理',
visable: false, visable: false,
children: [ children: [
{ {
path: '/vehicle/list', path: '/vehicle/list',
key: 'vehicle_list', key: 'vehicle_list',
icon: 'logo-xbox',
title: '车辆查询', title: '车辆查询',
visable: false, visable: false,
component: () => import("@/view/vehicle/list/index.vue") component: () => import("@/view/vehicle/list/index.vue")
...@@ -118,14 +103,13 @@ export default [ ...@@ -118,14 +103,13 @@ export default [
{ {
path: '/source_contract', path: '/source_contract',
key: 'source_contract', key: 'source_contract',
icon: 'logo-xbox', icon: 'ios-document-outline',
title: '车源合同', title: '车源合同',
visable: false, visable: false,
children: [ children: [
{ {
path: '/source_contract/list', path: '/source_contract/list',
key: 'source_contract_list', key: 'source_contract_list',
icon: 'logo-xbox',
title: '合同查询', title: '合同查询',
visable: false, visable: false,
component: () => import("@/view/source_contract/list/index.vue") component: () => import("@/view/source_contract/list/index.vue")
...@@ -135,14 +119,13 @@ export default [ ...@@ -135,14 +119,13 @@ export default [
{ {
path: '/driver', path: '/driver',
key: 'driver', key: 'driver',
icon: 'logo-xbox', icon: 'ios-people-outline',
title: '司机管理', title: '司机管理',
visable: false, visable: false,
children: [ children: [
{ {
path: '/driver/list', path: '/driver/list',
key: 'list', key: 'list',
icon: 'logo-xbox',
title: '司机查询', title: '司机查询',
visable: false, visable: false,
component: () => import("@/view/driver/list/index.vue") component: () => import("@/view/driver/list/index.vue")
...@@ -152,14 +135,13 @@ export default [ ...@@ -152,14 +135,13 @@ export default [
{ {
path: '/driver_contract', path: '/driver_contract',
key: 'driver_contract', key: 'driver_contract',
icon: 'logo-xbox', icon: 'ios-document-outline',
title: '司机合同', title: '司机合同',
visable: false, visable: false,
children: [ children: [
{ {
path: '/driver_contract/list', path: '/driver_contract/list',
key: 'driver_contract_list', key: 'driver_contract_list',
icon: 'logo-xbox',
title: '合同查询', title: '合同查询',
visable: false, visable: false,
component: () => import("@/view/driver_contract/list/index.vue") component: () => import("@/view/driver_contract/list/index.vue")
...@@ -167,7 +149,6 @@ export default [ ...@@ -167,7 +149,6 @@ export default [
{ {
path: '/driver_contract/receivables', path: '/driver_contract/receivables',
key: 'driver_receivables', key: 'driver_receivables',
icon: 'logo-xbox',
title: '应收帐款', title: '应收帐款',
visable: false, visable: false,
component: () => import("@/view/driver_contract/receivables/index.vue") component: () => import("@/view/driver_contract/receivables/index.vue")
...@@ -175,7 +156,6 @@ export default [ ...@@ -175,7 +156,6 @@ export default [
{ {
path: '/driver_contract/bill_logs', path: '/driver_contract/bill_logs',
key: 'driver_bill_logs', key: 'driver_bill_logs',
icon: 'logo-xbox',
title: '帐款日志', title: '帐款日志',
visable: false, visable: false,
component: () => import("@/view/driver_contract/bill_logs/index.vue") 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> <template>
<div> <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> </div>
</template> </template>
<script src="./index.js"></script>
<style>
.item_card {
width: 33%;
}
</style>
\ No newline at end of file
<template> <template>
<div> <Layout class="layout">
<div class="Title"></div> <Header class="header">TSU车辆管理系统</Header>
<div class="LoginCard"> <Content>
<Card :bordered="true"> <Card class="login_card" :bordered="true">
<p slot="title">系统登录</p> <p slot="title">系统登录</p>
<Form ref="loginForm" :model="loginForm" :rules="loginRule"> <Form ref="loginForm" :model="loginForm" :rules="loginRule">
<Row> <Row>
<Col span="24"> <Col span="24">
<FormItem prop="username"> <FormItem prop="username">
<Input type="text" v-model="loginForm.username" placeholder="帐号"> <Input type="text" v-model="loginForm.username" placeholder="帐号">
<Icon type="ios-person-outline" slot="prepend"></Icon> <Icon type="ios-person-outline" slot="prepend"></Icon>
</Input> </Input>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span="24"> <Col span="24">
<FormItem prop="password"> <FormItem prop="password">
<Input type="password" v-model="loginForm.password" placeholder="密码"> <Input type="password" v-model="loginForm.password" placeholder="密码">
<Icon type="ios-lock-outline" slot="prepend"></Icon> <Icon type="ios-lock-outline" slot="prepend"></Icon>
</Input> </Input>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span="24"> <Col span="24">
<FormItem> <FormItem>
<Button type="primary" @click="login('loginForm')" style="width:100%;">确认</Button> <Button type="primary" @click="login('loginForm')" style="width:100%;">确认</Button>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
</Form> </Form>
</Card> </Card>
</div> </Content>
</div> <Footer class="footer">Copyright © 2020 北京金数云科技有限公司 | 京ICP备16010358号-2</Footer>
</Layout>
</template> </template>
<script src="./index.js"></script> <script src="./index.js"></script>
<style> <style>
.Title { .layout {
background-color: cadetblue; width: 100%;
font-size: 24px; height: 100%;
}
.footer {
text-align: center;
/* color: #FFF; */
/* letter-spacing: 5px;
font-size: 22px; */
}
.header {
text-align: center; text-align: center;
padding: 10px; color: #FFF;
color: black; letter-spacing: 5px;
font-size: 22px;
} }
.LoginCard { .login_card {
width: 350px; width: 350px;
margin: 0 auto; margin: 0 auto;
margin-top: 50px; margin-top: 50px;
......
...@@ -69,11 +69,20 @@ export default { ...@@ -69,11 +69,20 @@ export default {
onMenuSelect(name) { onMenuSelect(name) {
var router = this.getMenuFromRouter(name); var router = this.getMenuFromRouter(name);
this.currentView = router.component; 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; this.maps = router.maps;
} }
}, },
mounted() { mounted() {
this.setMenus(); this.setMenus();
this.onMenuSelect("home");
} }
}; };
\ No newline at end of file
\ No newline at end of file
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
<Layout> <Layout>
<Header> <Header>
<Menu mode="horizontal" theme="dark" active-name="1"> <Menu mode="horizontal" theme="dark" active-name="1">
<div class="layout-logo"></div> <div class="layout-logo">TSU车辆管理系统</div>
<div class="layout-nav"> <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="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>
<div class="layout-avatar"> <div class="layout-avatar">
<AvatarView></AvatarView> <AvatarView></AvatarView>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</Menu> </Menu>
</Header> </Header>
<Layout style="position:absolute; top:64px; bottom:0px; left:0px; right:0px;"> <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> <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-for='(item, index) in routers' v-bind:key='index'>
<div v-if='item.visable && !item.children'> <div v-if='item.visable && !item.children'>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</Menu> </Menu>
</Sider> </Sider>
<Layout :style="{padding: '0 24px 24px'}"> <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> <BreadcrumbItem v-for="(item, index) in maps" v-bind:key="index">{{item}}</BreadcrumbItem>
</Breadcrumb> </Breadcrumb>
<component :is="currentView"></component> <component :is="currentView"></component>
...@@ -55,13 +55,12 @@ ...@@ -55,13 +55,12 @@
height: 100%; height: 100%;
} }
.layout-logo{ .layout-logo{
width: 100px; color: #FFF;
height: 30px; letter-spacing: 5px;
background: #990000; font-size: 22px;
border-radius: 3px; border-radius: 3px;
float: left; float: left;
position: relative; position: relative;
top: 15px;
} }
.layout-nav { .layout-nav {
// width: 420px; // 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