panhui 4 лет назад
Родитель
Сommit
55f0f7293b

BIN
src/main/vue/public/favicon.ico


BIN
src/main/vue/public/fonts/OSP-DIN.ttf


+ 25 - 15
src/main/vue/public/index.html

@@ -1,18 +1,28 @@
 <!DOCTYPE html>
 <html lang="zh-Hans">
-  <head>
-    <meta charset="utf-8">
-    <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">
-    <script src="<%= BASE_URL %>fontawesome-v5.13.0.js"></script>
-    <title>管理后台</title>
-  </head>
-  <body>
-    <noscript>
-      <strong>We're sorry but vue doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
-    </noscript>
-    <div id="app"></div>
-    <!-- built files will be auto injected -->
-  </body>
+    <head>
+        <meta charset="utf-8" />
+        <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" />
+        <script src="<%= BASE_URL %>fontawesome-v5.13.0.js"></script>
+        <link rel="stylesheet" href="https://at.alicdn.com/t/font_2428217_x5heb96sw9.css" />
+        <title>管理后台</title>
+        <style>
+            @font-face {
+                font-family: 'OSP';
+                src: url('<%= BASE_URL %>fonts/OSP-DIN.ttf');
+            }
+        </style>
+    </head>
+    <body>
+        <noscript>
+            <strong
+                >We're sorry but vue doesn't work properly without JavaScript enabled. Please enable it to
+                continue.</strong
+            >
+        </noscript>
+        <div id="app"></div>
+        <!-- built files will be auto injected -->
+    </body>
 </html>

+ 18 - 0
src/main/vue/src/assets/img_defaultphoto.svg

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>img_defaultphoto</title>
+    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="01-国内申请" transform="translate(-1541.000000, -18.000000)">
+            <g id="路径" transform="translate(1541.000000, 18.000000)">
+                <path d="M0,12 C0,18.627417 5.372583,24 12,24 C18.627417,24 24,18.627417 24,12 C24,5.372583 18.627417,0 12,0 C5.372583,0 0,5.372583 0,12 Z" fill="#F2F4F5"></path>
+                <path d="M15.1515789,9.75 C17.4015789,6.69078947 16.9673684,11.7631579 14.8752632,11.9605263 C11.5792105,13.0460526 15.151579,9.75 15.1515789,9.75 Z" fill="#FBEBE8" fill-rule="nonzero"></path>
+                <path d="M9.11286939,9.73863135 C11.3628694,6.67942082 10.9286589,11.7517892 8.83655362,11.9491577 C5.54050098,13.034684 9.11286941,9.73863135 9.11286939,9.73863135 Z" fill="#FBEBE8" fill-rule="nonzero" transform="translate(9.026916, 10.464264) scale(-1, 1) translate(-9.026916, -10.464264) "></path>
+                <path d="M9.07894737,12.0592105 C9.20493328,12.9723699 9.42775452,14.6894016 7.87559821,16.344478 C6.32344189,17.9995543 12.0394737,20.0921053 12.0394737,20.0921053 C12.0394737,20.0921053 16.8562256,18.2992584 17.1325414,17.4505742 C18.8299098,16.0097847 14.2154712,17.4505742 15.2171053,12.2171053 C13.006579,10.8157895 9.07894737,12.0592105 9.07894737,12.0592105 Z" fill="#FFF0ED" fill-rule="nonzero"></path>
+                <path d="M9.32692869,12.8806632 C9.5759509,13.6533919 12.9948251,16.8740481 16.1168778,16.0845745 C14.8627627,14.8177668 15.0087027,13.3708194 15.375,11.9605263 C15.5906842,11.4868421 13.5746604,11.7935544 9.32692869,12.8806632 Z" fill="#F3E6E4" fill-rule="nonzero"></path>
+                <path d="M12,24 C16.3689474,24 20.1915789,21.6645789 22.2901579,18.1746316 C22.2898421,18.1691053 22.2898421,18.1629474 22.2893684,18.1578947 C21.6841579,17.2368947 17.5261579,15.8420526 15.8946316,15.8420526 C12.5410829,20.8736278 8.25753067,16.9509223 8.25753067,15.8420526 C6.02249057,15.7518137 3.38368423,17.3718947 1.872,18.4327895 C4.0016842,21.7784211 7.7401579,24 12,24 Z" fill="#D7AB41"></path>
+                <path d="M12.1942105,3.94736843 C13.4771053,4.18421053 15.2731579,4.30263159 15.51,6.0986842 C18.0165789,16.5592105 6.80605263,18.0197368 8.2468421,7.04605263 C8.97710527,3.15789473 12.1942105,3.94736843 12.1942105,3.94736843 Z" fill="#FFF4F4"></path>
+                <path d="M9.36789473,5.36842106 C10.0627895,5.84210527 11.4656842,7.39468423 14.8670526,6.63157894 C15.1582105,7.76321051 15.0126316,7.76321051 15.8000526,8.9605263 C16.3757368,9.15789473 18.0434211,3.49342104 13.1595789,2.7236842 C7.44221053,1.8355263 6.69094737,6.95557918 8.16,8.77136865 C8.5173158,8.39636865 8.2561579,6.25657896 9.36789473,5.36842106 Z" fill="#705A48"></path>
+            </g>
+        </g>
+    </g>
+</svg>

+ 2 - 1
src/main/vue/src/components/SysMenu.vue

@@ -1,6 +1,7 @@
 <template>
     <el-menu-item v-if="isLeaf" :index="'' + menu.id" :route="{ path: menu.path }">
-        <i class="fa-fw" :class="menu.icon" v-if="menu.icon"></i><span slot="title">{{ menu.name }}</span>
+        <i class="fa-fw " :class="menu.icon" v-if="menu.icon"></i>
+        <span slot="title">{{ menu.name }}</span>
     </el-menu-item>
     <el-submenu v-else :index="'' + menu.id">
         <template slot="title">

+ 1 - 1
src/main/vue/src/main.js

@@ -14,8 +14,8 @@ import RichText from '@/components/RichText';
 import CropUpload from '@/components/CropUpload';
 import DistrictChoose from '@/components/DistrictChoose';
 import Formatters from '@/mixins/formatters';
-import 'normalize.css/normalize.css';
 import './styles/element_theme/index.css';
+import 'normalize.css/normalize.css';
 
 // import VueAMap from "vue-amap";
 // Vue.use(VueAMap);

+ 11 - 1
src/main/vue/src/store.js

@@ -7,7 +7,8 @@ export default new Vuex.Store({
     state: {
         tableHeight: 0,
         fetchingData: false,
-        userInfo: null
+        userInfo: null,
+        headerHeight: 146
     },
     mutations: {
         updateTableHeight(state, height) {
@@ -18,6 +19,15 @@ export default new Vuex.Store({
         },
         updateUserInfo(state, userInfo) {
             state.userInfo = userInfo;
+        },
+        updateHeaderHeight(state, type) {
+            if (type === 'home') {
+                state.headerHeight = 60;
+            } else if (type === 'more') {
+                state.headerHeight = 196;
+            } else {
+                state.headerHeight = 146;
+            }
         }
     },
     actions: {}

+ 9 - 6
src/main/vue/src/styles/app.less

@@ -57,8 +57,11 @@ li {
 //}
 
 .el-menu-item.is-active {
-    background: #1f2d3d !important;
-    border-left: 2px solid #D7AB41;
+    background: #d7ab41 !important;
+}
+.el-menu-item {
+    height: 66px !important;
+    line-height: 66px !important;
 }
 
 .el-menu {
@@ -67,7 +70,7 @@ li {
     }
 
     .svg-inline--fa {
-        margin-right: 6px;
+        margin-right: 13px;
     }
 }
 
@@ -127,7 +130,7 @@ li {
 
 .table-column-filter {
     cursor: pointer;
-    color: #D7AB41;
+    color: #d7ab41;
     float: right;
     height: 36px;
     margin-bottom: 10px;
@@ -185,14 +188,14 @@ li {
             border-bottom-color: #c0c4cc;
             top: 6px;
             &.active {
-                border-bottom-color: #D7AB41;
+                border-bottom-color: #d7ab41;
             }
         }
         &.desc {
             border-top-color: #c0c4cc;
             bottom: 6px;
             &.active {
-                border-top-color: #D7AB41;
+                border-top-color: #d7ab41;
             }
         }
     }

+ 19 - 10
src/main/vue/src/views/Admin.vue

@@ -9,8 +9,8 @@
             <el-menu
                 :collapse="collapse"
                 background-color="#333230"
-                text-color="#BFCBD9"
-                active-text-color="#20A0FF"
+                text-color="#fff"
+                active-text-color="#fff"
                 :unique-opened="true"
                 :router="true"
                 :default-active="activeMenu"
@@ -21,7 +21,7 @@
             </el-menu>
         </el-aside>
         <el-container>
-            <el-header class="header" height="146px">
+            <el-header class="header" :height="headerHeight + 'px'">
                 <div class="header-top">
                     <div class="header-btn" @click="collapse = !collapse">
                         <div :style="{ transform: collapse ? 'rotate(90deg)' : '' }">
@@ -41,15 +41,24 @@
                         </div>
                     </el-tooltip>
 
-                    <el-dropdown @command="onCommand" style="margin-left: 20px;" trigger="click">
-                        <img :src="userInfo ? userInfo.avatar || '' : ''" class="avatar" />
+                    <div class="header-btn">
+                        <i class="iconfont icon-message2" style="font-size: 20px;"></i>
+                    </div>
+
+                    <el-dropdown @command="onCommand" trigger="hover">
+                        <div class="header-btn">
+                            <el-avatar :src="userInfo ? userInfo.avatar || '' : ''" size="small">
+                                <img src="../assets/img_defaultphoto.svg" />
+                            </el-avatar>
+                        </div>
+
                         <el-dropdown-menu slot="dropdown">
                             <el-dropdown-item command="pwd" style="word-break:keep-all">修改密码 </el-dropdown-item>
                             <el-dropdown-item command="logout">退出登录 </el-dropdown-item>
                         </el-dropdown-menu>
                     </el-dropdown>
                 </div>
-                <div class="head-page">
+                <div class="head-page" v-if="$route.name !== 'dashboard'">
                     <div class="head-title">
                         <div class="head-name">{{ $route.meta.title || $route.name }}</div>
                         <el-breadcrumb separator="/">
@@ -170,7 +179,7 @@ export default {
         };
     },
     computed: {
-        ...mapState(['userInfo'])
+        ...mapState(['userInfo', 'headerHeight'])
     },
     methods: {
         findActiveMenu() {
@@ -347,9 +356,9 @@ export default {
         }
     }
     .avatar {
-        width: 40px;
-        height: 40px;
-        border-radius: 50%;
+        // width: 40px;
+        // height: 40px;
+        // border-radius: 50%;
     }
     a {
         &:visited {

+ 23 - 12
src/main/vue/src/views/Dashboard.vue

@@ -1,7 +1,7 @@
 <template>
     <div>
         <grid-layout
-            style="margin: 0 -10px;"
+            style="margin:  -10px;"
             :layout="layout"
             :col-num="12"
             :row-height="30"
@@ -25,32 +25,41 @@
                 <component :is="item.name"></component>
             </grid-item>
         </grid-layout>
-        <el-button v-if="editable" @click="save">保存</el-button>
-        <el-button v-else @click="editable = true">编辑</el-button>
+        <!-- <el-button v-if="editable" @click="save">保存</el-button>
+        <el-button v-else @click="editable = true">编辑</el-button> -->
     </div>
 </template>
 
 <script>
 import { GridLayout, GridItem } from 'vue-grid-layout';
-import UserWidget from '../widgets/UserWidget';
+import MenusWidget from '../widgets/MenusWidget';
+import WaitWidget from '../widgets/WaitWidget';
+import DoingWidget from '../widgets/DoingWidget';
 import LineChartWidget from '../widgets/LineChartWidget';
 import BarChartWidget from '../widgets/BarChartWidget';
 import PieChartWidget from '../widgets/PieChartWidget';
 
 export default {
-    created() {},
     data() {
         return {
             layout: [
-                { x: 0, y: 0, w: 6, h: 4, i: '0', name: 'UserWidget' },
-                { x: 6, y: 0, w: 6, h: 4, i: '1', name: 'UserWidget' },
-                { x: 0, y: 4, w: 6, h: 6, i: '2', name: 'BarChartWidget' },
-                { x: 0, y: 10, w: 6, h: 6, i: '3', name: 'LineChartWidget' },
-                { x: 6, y: 4, w: 6, h: 12, i: '4', name: 'PieChartWidget' }
+                { x: 0, y: 0, w: 12, h: 4, i: '0', name: 'MenusWidget' },
+                { x: 0, y: 4, w: 6, h: 10, i: '1', name: 'WaitWidget' },
+                { x: 0, y: 10, w: 6, h: 10, i: '2', name: 'LineChartWidget' },
+                { x: 6, y: 4, w: 6, h: 20, i: '3', name: 'DoingWidget' }
             ],
             editable: false
         };
     },
+    beforeRouteEnter(to, from, next) {
+        next(vm => {
+            vm.$store.commit('updateHeaderHeight', 'home');
+        });
+    },
+    beforeRouteLeave(to, from, next) {
+        this.$store.commit('updateHeaderHeight');
+        next();
+    },
     methods: {
         save() {
             console.log(JSON.stringify(this.layout));
@@ -60,10 +69,12 @@ export default {
     components: {
         GridLayout,
         GridItem,
-        UserWidget,
+        MenusWidget,
         LineChartWidget,
         BarChartWidget,
-        PieChartWidget
+        PieChartWidget,
+        WaitWidget,
+        DoingWidget
     }
 };
 </script>

+ 39 - 0
src/main/vue/src/widgets/DoingWidget.vue

@@ -0,0 +1,39 @@
+<template>
+    <widget-card :bodyStyle="bodyStyle">
+        <template #header>
+            进行中案件
+        </template>
+    </widget-card>
+</template>
+<script>
+import WidgetCard from './WidgetCard';
+
+export default {
+    data() {
+        return {
+            bodyStyle: {
+                display: 'flex',
+                alignItems: 'center'
+            }
+        };
+    },
+    components: {
+        WidgetCard
+    }
+};
+</script>
+<style lang="less" scoped>
+.info {
+    flex-grow: 1;
+    text-align: right;
+    .text {
+        color: #999;
+        font-size: 16px;
+        margin-bottom: 12px;
+    }
+    .num {
+        font-size: 20px;
+        color: #333;
+    }
+}
+</style>

+ 27 - 20
src/main/vue/src/widgets/LineChartWidget.vue

@@ -1,5 +1,8 @@
 <template>
     <widget-card :bodyStyle="bodyStyle" ref="container">
+        <template #header>
+            数据统计
+        </template>
         <canvas ref="chart" class="chart"></canvas>
     </widget-card>
 </template>
@@ -18,27 +21,31 @@ export default {
         };
     },
     mounted() {
-        this.$refs.chart.width = this.$refs.container.$el.offsetWidth - 20;
-        this.$refs.chart.height = this.$refs.container.$el.offsetHeight - 20;
-        var gradient = this.$refs.chart.getContext('2d').createLinearGradient(0, 0, 0, 200);
+        this.$nextTick(() => {
+            this.$refs.chart.width = this.$refs.container.$el.offsetWidth - 20;
+            this.$refs.chart.height = this.$refs.container.$el.offsetHeight - 90;
+            var gradient = this.$refs.chart
+                .getContext('2d')
+                .createLinearGradient(0, 0, 0, this.$refs.container.$el.offsetHeight - 100);
 
-        gradient.addColorStop(0, 'rgba(32,160,255,0.7)');
-        gradient.addColorStop(1, 'rgba(32,160,255,0)');
-        this.myChart = new Chart(this.$refs.chart.getContext('2d'), {
-            type: 'line',
-            data: {
-                labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
-                datasets: [
-                    {
-                        label: 'Data One',
-                        backgroundColor: gradient,
-                        borderColor: '#20a0ff',
-                        borderWidth: '1px',
-                        data: [40, 39, 10, 40, 39, 80, 40]
-                    }
-                ]
-            },
-            options: { responsive: true, maintainAspectRatio: false }
+            gradient.addColorStop(0, 'rgba(32,160,255,0.7)');
+            gradient.addColorStop(1, 'rgba(32,160,255,0)');
+            this.myChart = new Chart(this.$refs.chart.getContext('2d'), {
+                type: 'line',
+                data: {
+                    labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
+                    datasets: [
+                        {
+                            label: 'Data One',
+                            backgroundColor: gradient,
+                            borderColor: '#20a0ff',
+                            borderWidth: '1px',
+                            data: [40, 39, 10, 40, 39, 80, 40]
+                        }
+                    ]
+                },
+                options: { responsive: true, maintainAspectRatio: false }
+            });
         });
     },
     components: {

+ 86 - 0
src/main/vue/src/widgets/MenusWidget.vue

@@ -0,0 +1,86 @@
+<template>
+    <widget-card :bodyStyle="bodyStyle">
+        <el-row :gutter="20">
+            <el-col :span="6" :offset="0">
+                <el-avatar icon="el-icon-picture-outline" shape="square" size="large"></el-avatar>
+                <div class="info">
+                    <div class="num">4,258</div>
+                    <div class="text">案件数量</div>
+                </div>
+            </el-col>
+            <el-col :span="6" :offset="0">
+                <el-avatar icon="el-icon-picture-outline" shape="square" size="large"></el-avatar>
+                <div class="info">
+                    <div class="num">4,258</div>
+                    <div class="text">案件数量</div>
+                </div>
+            </el-col>
+            <el-col :span="6" :offset="0">
+                <el-avatar icon="el-icon-picture-outline" shape="square" size="large"></el-avatar>
+                <div class="info">
+                    <div class="num">4,258</div>
+                    <div class="text">案件数量</div>
+                </div>
+            </el-col>
+            <el-col :span="6" :offset="0">
+                <el-avatar icon="el-icon-picture-outline" shape="square" size="large"></el-avatar>
+
+                <div class="info">
+                    <div class="num">4,258</div>
+                    <div class="text">案件数量</div>
+                </div>
+            </el-col>
+        </el-row>
+    </widget-card>
+</template>
+<script>
+import WidgetCard from './WidgetCard';
+
+export default {
+    data() {
+        return {
+            bodyStyle: {
+                display: 'flex',
+                alignItems: 'center'
+            }
+        };
+    },
+    components: {
+        WidgetCard
+    }
+};
+</script>
+<style lang="less" scoped>
+.el-row {
+    flex-grow: 1;
+}
+.el-col {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+
+    .el-avatar {
+        width: 62px;
+        height: 62px;
+        font-size: 50px;
+        line-height: 62px;
+    }
+}
+.info {
+    text-align: left;
+    margin-left: 12px;
+    .text {
+        font-size: 12px;
+        color: #000000;
+        line-height: 17px;
+        margin-top: 5px;
+    }
+    .num {
+        font-size: 48px;
+        font-family: OSP-DIN, OSP;
+        font-weight: normal;
+        color: #000000;
+        line-height: 55px;
+    }
+}
+</style>

+ 39 - 0
src/main/vue/src/widgets/WaitWidget.vue

@@ -0,0 +1,39 @@
+<template>
+    <widget-card :bodyStyle="bodyStyle">
+        <template #header>
+            待办案件
+        </template>
+    </widget-card>
+</template>
+<script>
+import WidgetCard from './WidgetCard';
+
+export default {
+    data() {
+        return {
+            bodyStyle: {
+                display: 'flex',
+                alignItems: 'center'
+            }
+        };
+    },
+    components: {
+        WidgetCard
+    }
+};
+</script>
+<style lang="less" scoped>
+.info {
+    flex-grow: 1;
+    text-align: right;
+    .text {
+        color: #999;
+        font-size: 16px;
+        margin-bottom: 12px;
+    }
+    .num {
+        font-size: 20px;
+        color: #333;
+    }
+}
+</style>

+ 9 - 3
src/main/vue/src/widgets/WidgetCard.vue

@@ -1,8 +1,7 @@
 <template>
     <el-card shadow="hover" :body-style="[mBodyStyle, bodyStyle]" class="dashboard-widget-card">
-        <template slot="header">
-            <slot name="header"></slot>
-        </template>
+        <div class="header" slot="header"><slot name="header"></slot></div>
+
         <template :class="className">
             <slot></slot>
         </template>
@@ -25,4 +24,11 @@ export default {
     display: flex;
     flex-direction: column;
 }
+
+.header {
+    font-size: 14px;
+    font-weight: bold;
+    color: #000000;
+    line-height: 24px;
+}
 </style>