songxy 1 рік тому
батько
коміт
88e5e64484

+ 305 - 0
client/src/views/OaSystem/home/index.scss

@@ -0,0 +1,305 @@
+
+.homeBox {
+  display: flex;
+  height: 100%;
+  $margin-r: 20px;
+  $borderRadius: 10px;
+  padding: 20px 0px;
+  .header {
+    height: 56px;
+    padding: 0px 15px;
+    box-sizing: border-box;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    > .title {
+      display: inline-block;
+      color: #121518;
+      font-weight: bold;
+      font-size: 18px;
+    }
+    .subTitle {
+      font-size: 14px;
+      display: flex;
+      align-items: center;
+    }
+  }
+  .content {
+    height: calc(100% - 56px);
+    padding: 0px 15px;
+    box-sizing: border-box;
+  }
+  .arrowRight {
+    display: inline-block;
+    width: 20px;
+    height: 20px;
+    vertical-align: middle;
+  }
+
+  .numberBox {
+    > .number {
+      font-size: 18px;
+      font-weight: bold;
+    }
+    > .unit {
+      font-size: 14px;
+      margin-left: 3px;
+      font-weight: 500;
+      color: #2d333c;
+    }
+  }
+  > div {
+    &.leftBox {
+      flex: 2;
+      display: flex;
+      flex-direction: column;
+      margin-right: $margin-r;
+      > div {
+        flex: 1;
+        &.topBox {
+          display: flex;
+          margin-bottom: $margin-r;
+          > div {
+            flex: 1;
+            background-color: #fff;
+            border-radius: $borderRadius;
+            &:first-child {
+              margin-right: $margin-r;
+              flex: 1.5;
+              > .header {
+                > ul {
+                  user-select: none;
+                  > li {
+                    display: inline-block;
+                    padding: 5px 18px;
+                    color: #8b969c;
+                    font-weight: bold;
+                    font-size: 18px;
+                    cursor: pointer;
+                    &:first-child {
+                      padding-left: 0px;
+                    }
+                    &.active,&:hover {
+                      color: #121518;
+                    }
+                    position: relative;
+                    >.corner {
+                      display: inline-block;
+                      position: absolute;
+                      right: -4px;
+                      top: 0px;
+                      padding: 0px 8px;
+                      border-radius: 10px;
+                      background-color: #f00;
+                      color: #fff;
+                      font-size: 12px;
+                      font-style: normal;
+                      font-weight: 500;
+                    }
+                  }
+                }
+              }
+              > .content {
+                > ul {
+                  height: 100%;
+                  display: flex;
+                  > li {
+                    flex: 1;
+                    display: flex;
+                    flex-direction: column;
+                    padding-bottom: 20px;
+                    &:first-child {
+                      margin-right: $margin-r;
+                    }
+                    > img {
+                      background-color: #ccc;
+                      width: 100%;
+                      flex: 1;
+                      border-radius: 10px;
+                    }
+                    > p {
+                      padding: 3px 0px;
+                    }
+                    > .title {
+                      margin-top: 5px;
+                      font-size: 16px;
+                      font-weight: bold;
+                    }
+                    > .time {
+                      font-size: 14px;
+                      color: #8b969c;
+                    }
+                    > .desc {
+                      font-size: 14px;
+                      color: #626b70;
+                    }
+                  }
+                }
+              }
+            }
+            &:last-child {
+              > .content {
+                > ul {
+                  height: 100%;
+                  padding: 40px 20px;
+                  display: grid;
+                  grid-template-columns: repeat(4, 60px);
+                  align-content: space-between;
+                  justify-content: space-between;
+                  > li {
+                    > img {
+                      background-color: #fff;
+                      width: 60px;
+                      height: 60px;
+                    }
+                    > .title {
+                      margin-top: 8px;
+                      font-size: 14px;
+                      text-align: center;
+                      color: #121518;
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+        &.bottomBox {
+          background-color: #fff;
+          border-radius: $borderRadius;
+          display: flex;
+          > div {
+            flex: 1;
+            height: 100%;
+            &:first-child {
+              padding: 30px 20px;
+              > ul {
+                height: 100%;
+                display: grid;
+                grid-template-columns: repeat(2, 50%);
+                justify-content: space-between;
+                align-content: space-between;
+                > li {
+                  padding: 10px 20px;
+                  border-radius: 4px;
+                  border: 2px solid transparent;
+                  cursor: pointer;
+                  &:hover {
+                    border-color: #498bef;
+                    background: linear-gradient(270deg, #eaf4ff 0%, #f9fcff 100%);
+                  }
+                  &:nth-child(2n + 1) {
+                    margin-right: 15px;
+                  }
+                  display: flex;
+                  > .circle {
+                    display: block;
+                    width: 46px;
+                    height: 46px;
+                    line-height: 46px;
+                    border-radius: 50%;
+                    background-color: #498bef;
+                    color: #fff;
+                    font-size: 18px;
+                    text-align: center;
+                    margin-right: 5px;
+                  }
+                  &:nth-child(3),
+                  &:nth-child(4) {
+                    > .circle {
+                      background-color: #05ce9e;
+                    }
+                    &:hover {
+                      border-color: #05ce9e;
+                    }
+                  }
+                  &:nth-child(5),
+                  &:nth-child(6) {
+                    > .circle {
+                      background-color: #f9a527;
+                    }
+                    &:hover {
+                      border-color: #f9a527;
+                    }
+                  }
+                  > div {
+                    > .title {
+                      color: #2d333c;
+                      font-size: 15px;
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+    &.rightBox {
+      flex: 1;
+      display: flex;
+      flex-direction: column;
+      > div {
+        background-color: #fff;
+        border-radius: $borderRadius;
+        margin-bottom: $margin-r;
+        &:last-child {
+          margin-bottom: 0px;
+          > .content {
+            display: flex;
+            flex-direction: column;
+            padding-bottom: 15px;
+            > ul {
+              height: 0;
+              flex-grow: 1;
+              overflow-y: scroll;
+              > li {
+                display: flex;
+                padding: 10px;
+                border-bottom: 1px solid #e3e3e3;
+                font-size: 15px;
+                > div {
+                  flex: 1;
+                  color: #2d333c;
+                }
+                > span {
+                  color: #8a94a4;
+                }
+              }
+            }
+          }
+        }
+        &:not(:nth-child(2)) {
+          flex: 1;
+        }
+        &:nth-child(2) {
+          height: 100px;
+          > ul {
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            height: 100%;
+            > li {
+              flex: 1;
+              text-align: center;
+              border-right: 1px solid #cfd9de;
+              &:last-child {
+                border-right: 0px;
+              }
+              > .number {
+                color: #121518;
+                font-size: 24px;
+                font-weight: bold;
+              }
+              > .title {
+                color: #2d333c;
+                margin-top: 4px;
+                font-size: 15px;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}

+ 222 - 33
client/src/views/OaSystem/home/index.vue

@@ -1,44 +1,233 @@
 <template>
-  <div class="_home">
-    <ul>
-      <li v-for="(item, index) in reactiveData.routes" :key="index" @click="routeMenuClick(item)">
-        <p>{{ item.name }}</p>
-      </li>
-    </ul>
+  <div class="homeBox">
+    <div class="leftBox">
+      <div class="topBox">
+        <div>
+          <div class="header">
+            <ul>
+              <li class="active">公司动态<i class="corner">4</i></li>
+              <li>通知公告</li>
+              <li>学习中心</li>
+            </ul>
+            <span class="subTitle">
+              <span>更多</span>
+              <i class="arrowRight"><ArrowRightBold /> </i>
+            </span>
+          </div>
+          <div class="content">
+            <ul>
+              <li>
+                <img src="" />
+                <p class="title">万维空间17个项目获土地利用优秀成...</p>
+                <p class="time">2023-10-30</p>
+                <p class="desc">
+                  近日,浙江省土地学会发布《关于开展2023年土地利用优秀成果奖评选的通知》...
+                </p>
+              </li>
+              <li>
+                <img src="" />
+                <p class="title">万维空间17个项目获土地利用优秀成...</p>
+                <p class="time">2023-10-30</p>
+                <p class="desc">
+                  近日,浙江省土地学会发布《关于开展2023年土地利用优秀成果奖评选的通知》...
+                </p>
+              </li>
+            </ul>
+          </div>
+        </div>
+        <div>
+          <div class="header">
+            <span class="title">常用功能</span>
+          </div>
+          <div class="content">
+            <ul>
+              <li v-for="(item, index) in functions" :key="index">
+                <img src="" />
+                <p class="title">{{ item['title'] }}</p>
+              </li>
+            </ul>
+          </div>
+        </div>
+      </div>
+      <div class="bottomBox">
+        <div>
+          <ul>
+            <li v-for="(item, index) in signs" :key="index">
+              <span class="circle">{{ item['icon'] }}</span>
+              <div>
+                <p class="title">{{ item['title'] }}</p>
+                <div class="numberBox">
+                  <span class="number">{{ item['value'] }}</span>
+                  <span class="unit">{{ item['unit'] }}</span>
+                </div>
+              </div>
+            </li>
+          </ul>
+        </div>
+        <div>
+          <div class="header">
+            <span class="title" style="font-size: 17px">近五年签约历史趋势</span>
+          </div>
+          <div class="content" ref="echartRef"></div>
+        </div>
+      </div>
+    </div>
+    <div class="rightBox">
+      <div></div>
+      <div>
+        <ul>
+          <li>
+            <p class="number" style="color: #f83535">8</p>
+            <p class="title">待办</p>
+          </li>
+          <li>
+            <p class="number">8</p>
+            <p class="title">已办</p>
+          </li>
+          <li>
+            <p class="number">8</p>
+            <p class="title">草稿</p>
+          </li>
+        </ul>
+      </div>
+      <div>
+        <div class="header">
+          <span class="title">回款信息</span>
+          <span class="subTitle">
+            <span>更多</span>
+            <i class="arrowRight"><ArrowRightBold /> </i>
+          </span>
+        </div>
+        <div class="content">
+          <ul>
+            <li v-for="(v, i) in 20" :key="i">
+              <div>
+                <span>已回款:</span>
+                <span>¥6200</span>
+                <span>生态修复行动方案</span>
+              </div>
+              <span>10/28</span>
+            </li>
+          </ul>
+        </div></div
+      >
+    </div>
   </div>
 </template>
 <script setup lang="ts">
-import { useRouter } from 'vue-router'
+import * as echarts from 'echarts'
+
 defineOptions({ name: 'Home' })
+onMounted(() => {})
 
-//routes除去首页外的路由
-const reactiveData: any = reactive({
-  routes: []
-})
-const router = useRouter()
-const initMenus = async () => {
-  let locals: any = localStorage.getItem('roleRouters')
-  let roleRouters = JSON.parse(JSON.parse(locals).v)[0].children
-  roleRouters = JSON.parse(JSON.stringify(roleRouters))
-  reactiveData.routes = roleRouters.slice(1, roleRouters.length)
+const functions = ref<
+  {
+    title: string
+    icon: any
+    key: string
+  }[]
+>([
+  { title: '驾驶舱', icon: '', key: '' },
+  { title: '差旅报销', icon: '', key: '' },
+  { title: '普通报销', icon: '', key: '' },
+  { title: '用款申请', icon: '', key: '' },
+  { title: '合同签订', icon: '', key: '' },
+  { title: '开票申请', icon: '', key: '' },
+  { title: '添加功能', icon: '', key: '' }
+])
+const signs = ref<
+  {
+    icon: string
+    title: string
+    value: number
+    unit: string
+  }[]
+>([
+  { icon: '签', title: '2023年度签约', value: 15005.65, unit: '万元' },
+  { icon: '回', title: '2023年度回款', value: 15005.65, unit: '万元' },
+  { icon: '净', title: '2023年度净合同额', value: 15005.65, unit: '万元' },
+  { icon: '拓', title: '2023年度新开拓', value: 15005.65, unit: '万元' },
+  { icon: '应', title: '总应收款', value: 15005.65, unit: '万元' },
+  { icon: '余', title: '总合同余额', value: 15005.65, unit: '万元' }
+])
+
+const category: number[] = []
+const barData: number[] = []
+const dottedBase: Date = new Date()
+
+for (var i = 0; i < 10; i++) {
+  category.push(dottedBase.getFullYear() - 1)
+  var b = Math.random() * 200
+  barData.push(b)
 }
-const routeMenuClick = async (item: any) => {
-  //跳转路由
-  let c = {}
-  if (item.children) {
-    c = router.resolve({
-      path: item.path + '/' + item.children[0].path
-    })
-  } else {
-    c = router.resolve({
-      path: item.path
-    })
-  }
-  router.push(c.href)
-  // window.open(c.href, '_blank')
+
+// option
+const echartOption: echarts.EChartsOption = {
+  title: [
+    {
+      show: true,
+      subtext: '单位:万元',
+      subtextStyle: {
+        color: '#8B969C',
+        lineHeight: 20
+      },
+      right: 20,
+      top: 5
+    }
+  ],
+  grid: {
+    left: '10%',
+    right: '5%',
+    bottom: '16%'
+  },
+  xAxis: {
+    data: category,
+    axisLine: {
+      show: false
+    },
+    axisTick: {
+      show: false
+    }
+  },
+  yAxis: {
+    splitLine: {
+      show: true,
+      lineStyle: {
+        type: 'dashed',
+        color: '#E3E3E3'
+      }
+    },
+    axisLine: {
+      lineStyle: {
+        color: '#666'
+      }
+    }
+  },
+  series: [
+    {
+      name: 'bar',
+      type: 'bar',
+      barWidth: 20,
+      itemStyle: {
+        normal: {
+          barBorderRadius: 10,
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+            { offset: 0, color: '#7BB5FA' },
+            { offset: 1, color: '#448ADC' }
+          ])
+        }
+      },
+      data: barData
+    }
+  ]
 }
-/** 初始化 **/
+const echartRef = ref(null)
 onMounted(() => {
-  initMenus()
+  const myChart = echarts.init(echartRef.value)
+  myChart.setOption(echartOption)
 })
 </script>
+
+<style lang="scss" scoped>
+@import './index.scss';
+</style>