Переглянути джерело

1. 首页统计:样式修改;
2. 信息统计查询二级菜单修改;

chengbeibei 9 місяців тому
батько
коміт
ffef31d5fe

+ 46 - 35
src/components/ChartCard.vue

@@ -1,26 +1,28 @@
 <template>
   <a-card class="cardContent" :loading="loading" :body-style="{ padding: '15px 24px 8px' }" :bordered="false">
     <div class="chart-card-header">
-      <div class="meta">
-        <span class="chart-card-title">{{ title }}</span>
-        <div>
-          <img v-if="icon == 'green'" src="@/assets/indexChart/green.png">
-          <img v-else-if="icon == 'blue'" src="@/assets/indexChart/blue.png">
-          <img v-else-if="icon == 'purple'" src="@/assets/indexChart/purple.png">
-          <img v-else src="@/assets/indexChart/red.png">
+      <div class="chart-card-title">{{ title }}</div>
+      <div class="chart-card-header-content">
+        <div class="meta">
+          <div>
+            <img v-if="icon == 'green'" src="@/assets/indexChart/green.png">
+            <img v-else-if="icon == 'blue'" src="@/assets/indexChart/blue.png">
+            <img v-else-if="icon == 'purple'" src="@/assets/indexChart/purple.png">
+            <img v-else src="@/assets/indexChart/red.png">
+          </div>
+          <span class="chart-card-action">
+            <slot name="action"></slot>
+          </span>
         </div>
-        <span class="chart-card-action">
-          <slot name="action"></slot>
-        </span>
-      </div>
-      <div class="total">
-        <div>{{ number }}</div>
-        <div class="content-title">地块数量</div>
-      </div>
-      <div class="total">
-        <div v-if="area != ''">
-          <div>{{ area }}</div>
-          <div class="content-title">地块面积</div>
+        <div class="total">
+          <div>{{ number }}</div>
+          <div class="content-title">地块数量</div>
+        </div>
+        <div class="total">
+          <div v-if="area != ''">
+            <div>{{ area }}</div>
+            <div class="content-title">地块面积</div>
+          </div>
         </div>
       </div>
     </div>
@@ -66,36 +68,45 @@
 </script>
 
 <style lang="less" scoped>
-.cardContent /deep/ .chart-card-header{
-  display: flex;
-  justify-content: space-between;
-  //height: fit-content;
-  width: 95%;
-}
+  .cardContent /deep/ .chart-card-header-content{
+    display: flex;
+    justify-content: space-between;
+    //height: fit-content;
+    width: 95%;
+  }
+
+  .chart-card-title {
+    color: white;
+    font-size: 20px;
+    font-weight:bold;
+    text-align: left;
+  }
+
   .chart-card-header {
     //position: relative;
     overflow: hidden;
     width: 100%;
 
     .meta {
+      color: white;
+      font-size: 20px;
+      font-weight:bold;
       //position: relative;
       overflow: hidden;
       //width: 100%;
-      color: white;
-      font-size: 20px;
       //line-height: 50px;
-      font-weight:bold;
-      max-width: 35%;
+      max-width: 20%;
     }
   }
+  // 图标样式
   .chart-card-header .meta > div {
     text-align: left;
-    margin-top: 5px;
+    margin-top: 25px;
   }
   .chart-card-action {
     cursor: pointer;
     position: absolute;
-    top: 0;
+    top: 15px;
     right: 15px;
   }
 
@@ -136,16 +147,16 @@
     word-break: break-all;
     white-space: nowrap;
     color: white;
-    margin-top: 35px;
-    margin-bottom: 0;
     font-size: 26px;
+    margin-top: 15px;
+    margin-bottom: 0;
     //line-height: 38px;
     //height: 38px;
   }
   // 数量,面积标题样式
   .content-title {
     font-size: 20px;
-    margin-top: 20px;
+    margin-top: 10px;
   }
   //
   @media (max-width: 1920px) {
@@ -154,7 +165,7 @@
     }
 
     .chart-card-header .meta > div {
-      width: 50%;
+      margin-top: 15px;
       img {
         width: 100%;
       }

+ 4 - 2
src/store/menuChild.js

@@ -4,7 +4,6 @@ const menu =  {
   },
   mutations: {
     setMenu(state, data) {
-      console.log("setMenu");
       for (let item of data) {
         let action = item.action.split(':');
         item.value = action[1]
@@ -13,7 +12,10 @@ const menu =  {
         }
         state.menuList[action[0]].push(item);
       }
-      console.log("state.menuList", state.menuList);
+    },
+    setStatisticsMenu(state, item) {
+      state.menuList['statistics'] = item.children;
+
     },
   },
   getter: {

+ 8 - 1
src/utils/util.js

@@ -3,6 +3,7 @@ import * as api from '@/api/api'
 import { isURL } from '@/utils/validate'
 import { ACCESS_TOKEN } from '@/store/mutation-types'
 import onlineCommons from '@jeecg/antd-online-mini'
+import store from '../store'
 
 export function timeFix() {
   const time = new Date()
@@ -164,8 +165,14 @@ function  generateChildRouters (data) {
       menu.alwaysShow = true;
       menu.redirect = menu.path;
     }
-    if (item.children && item.children.length > 0) {
+    /*if (item.children && item.children.length > 0) {
       menu.children = [...generateChildRouters( item.children)];
+    }*/
+    if (item.children && item.children.length > 0) {
+        menu.children = [...generateChildRouters( item.children)];
+      if (item.path.indexOf('hideChildren') > -1) {
+        store.commit('setStatisticsMenu', item);
+      }
     }
     //--update-begin----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
     //判断是否生成路由

+ 89 - 0
src/views/infoSearch/infoStatistics.vue

@@ -0,0 +1,89 @@
+<!--信息查询-->
+<template>
+  <div class="content-div">
+    <a-card class="info-submit" :bordered="false">
+        <a-radio-group v-model="defaultValue" button-style="solid" @change="changeContent">
+          <a-radio-button v-for="(item, index) in menus" :key="item.id" :value="item.meta.url" :name="item.name">
+            {{ item.meta.title }}
+          </a-radio-button>
+        </a-radio-group>
+    </a-card>
+    <a-card :bordered="false">
+      <iframe :src="defaultValue" width="100%" height="600" frameborder="0" allowfullscreen ></iframe>
+
+    </a-card>
+  </div>
+</template>
+
+
+<script>
+
+export default {
+  name: 'landInfo',
+  components: {
+
+
+  },
+  data() {
+    return {
+      defaultValue: '',
+      menus: [],
+    }
+  },
+  created() {
+    debugger
+    this.menus = this.$store.state.menu.menuList['statistics'];
+    this.defaultValue = this.menus.length > 0 ? this.menus[0].value : '';
+  },
+  methods: {
+    changeContent(key) {
+      console.table(key);
+    },
+
+  }
+
+}
+</script>
+
+<style scoped>
+.content-div {
+  height: 100%;
+}
+.ant-card:not(:last-child) {
+  margin-bottom: 10px;
+}
+.ant-card:last-child {
+  height: calc(100% - 70px);
+  overflow-y: auto;
+}
+</style>
+<style lang="less" scoped>
+.info-submit {
+  & ::v-deep > .ant-card-body {
+    padding: 14px 24px;
+  }
+  &::v-deep .ant-radio-button-wrapper {
+    //border: 1px solid ;
+    border-radius: 4px;
+    padding-left: 25px;
+    padding-right: 25px;
+    //border-left: 1px;
+    border: 1px solid @primary-color;
+    margin-left: 15px;
+    color: @primary-color;
+  }
+  & /deep/ .ant-radio-button-wrapper:not(:first-child)::before {
+    width: 0px;
+  }
+  & .ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {
+    color: #fff;
+  }
+}
+.content-div {
+  &::v-deep .ant-card:last-child .ant-card-body {
+    padding: 10px 24px 0;
+  }
+
+}
+
+</style>