Przeglądaj źródła

feat: 完成数据看板,页面

million 1 rok temu
rodzic
commit
d8d62c3b4a

+ 1 - 0
front/admin-front/package.json

@@ -18,6 +18,7 @@
     "compression-webpack-plugin": "^5.0.2",
     "core-js": "3.6.5",
     "crypto-js": "^4.1.1",
+    "echarts": "^5.4.2",
     "element-ui": "2.13.2",
     "file-saver": "^2.0.5",
     "js-cookie": "2.2.0",

Plik diff jest za duży
+ 1 - 0
front/admin-front/src/assets/dashboard/Vector-1.svg


Plik diff jest za duży
+ 1 - 0
front/admin-front/src/assets/dashboard/Vector-2.svg


+ 3 - 0
front/admin-front/src/assets/dashboard/Vector-3.svg

@@ -0,0 +1,3 @@
+<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M33.8452 16.5912C32.1974 14.5997 29.8169 14.2528 26.9255 15.4834C25.0264 16.2966 23.078 16.9953 21.0868 17.7693C21.9313 20.1551 20.617 22.0107 18.4911 23.935C20.2851 25.0444 21.7752 26.2324 23.4657 26.9589C27.4545 28.6689 31.3136 27.5317 33.7861 24.1739C35.7164 21.546 35.7394 18.8755 33.8452 16.5912ZM15.5882 15.4588C13.6579 15.3688 12.1579 16.7024 12.0512 18.594C11.9526 20.43 13.3851 22.0467 15.2169 22.153C17.0339 22.261 18.6488 20.808 18.7507 18.9671C18.8575 17.0837 17.4693 15.5423 15.5882 15.4572M9.41931 18.8313C7.39203 19.9653 5.6309 20.7049 4.16219 21.8258C0.731917 24.4161 -0.168365 28.6902 1.71763 32.4357C3.02534 35.0441 5.4699 36.3744 8.09353 35.908C10.5939 35.4662 12.1317 33.4241 12.4586 30.3789C12.6804 28.3826 13.1009 26.4026 13.4558 24.2688C11.2297 23.7452 9.95652 21.9387 9.41931 18.828M7.53003 10.9082C8.9396 11.8965 10.1635 13.1467 11.0934 13.9534C13.3868 13.5263 15.0116 12.2434 18.2036 12.6394C18.271 12.1485 18.4763 11.0604 18.5716 9.96237C18.9528 5.61791 16.4934 1.64817 12.7099 0.44383C9.11374 -0.696693 5.92661 0.401286 4.52033 3.27305C3.16169 6.05481 4.22462 8.59113 7.53167 10.9098" fill="#F2C94C"/>
+</svg>

Plik diff jest za duży
+ 1 - 0
front/admin-front/src/assets/dashboard/Vector.svg


Plik diff jest za duży
+ 6 - 0
front/admin-front/src/assets/dashboard/image.svg


+ 8 - 0
front/admin-front/src/assets/dashboard/upload.svg

@@ -0,0 +1,8 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<mask id="mask0_392_613" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="20" height="20">
+<rect width="20" height="20" fill="#D9D9D9"/>
+</mask>
+<g mask="url(#mask0_392_613)">
+<path d="M5.00004 16.6666C4.54171 16.6666 4.14935 16.5035 3.82296 16.1771C3.49657 15.8507 3.33337 15.4583 3.33337 15V12.5H5.00004V15H15V12.5H16.6667V15C16.6667 15.4583 16.5035 15.8507 16.1771 16.1771C15.8507 16.5035 15.4584 16.6666 15 16.6666H5.00004ZM9.16671 13.3333V6.54165L7.00004 8.70831L5.83337 7.49998L10 3.33331L14.1667 7.49998L13 8.70831L10.8334 6.54165V13.3333H9.16671Z" fill="#2980FF"/>
+</g>
+</svg>

+ 779 - 19
front/admin-front/src/views/dashboard/index.vue

@@ -1,44 +1,804 @@
 <template>
   <div class="dashboard-container">
-    <div class="dashboard-text">
-      name:
-      {{
-        this.nickname ? this.nickname : this.email ? this.email : this.username
-      }}
+    <div class="head">
+      <div class="left">
+        <div class="item">
+          <div class="number">
+            85
+          </div>
+          <div class="title">
+            支出/气体
+          </div>
+        </div>
+        <div class="verticalLine"/>
+        <div class="item">
+          <div class="number">
+            8.811k
+          </div>
+          <div class="title">
+            剩余本金
+          </div>
+        </div>
+        <div class="verticalLine"/>
+        <div class="item">
+          <div class="number">
+            85
+          </div>
+          <div class="title">
+            预计支出总费用
+          </div>
+        </div>
+        <div class="verticalLine"/>
+        <div class="item">
+          <div class="number">
+            88222
+          </div>
+          <div class="title">
+            预计空投价值
+          </div>
+        </div>
+      </div>
+      <div class="right">
+        <img src="../../assets/dashboard/upload.svg" alt="upload">
+        导出财务报表
+      </div>
+    </div>
+    <div class="main">
+      <div class="left">
+        <div class="expenseAndInput">
+          <div class="expense">
+            <div class="head">
+              <div class="title">
+                支出趋势
+              </div>
+              <div style="width: 300px;display: flex;justify-content: space-between;z-index: 10">
+                <div @click='changeActive(index)' :class='isActive === index ? "myWallet-text2" : "myWallet-text3"'
+                     v-for="(item,index) in day">
+                  {{ item }}
+                </div>
+                <el-popover placement="right" trigger="click">
+                  <div slot="reference" class="myWallet-text4">
+                    Custom
+                  </div>
+                  <el-date-picker
+                    v-model="datePicker"
+                    type="daterange"
+                    align="center"
+                    range-separator="To"
+                    start-placeholder="开始时间"
+                    end-placeholder="结束时间"
+                    :disabled-date="disabledDate"
+                    @change="datePickerChange"
+                  />
+                </el-popover>
+              </div>
+
+            </div>
+            <div class="emissionBonus" id="expense">
+
+            </div>
+          </div>
+          <div class="input">
+            <div class="title">
+              预计投入/USDT
+            </div>
+            <div class="emissionBonus" id="input">
+
+            </div>
+            <div class="expected">
+              <div class="text">
+                预期投入
+              </div>
+              <div class="amount">
+                888232
+              </div>
+            </div>
+            <div class="info">
+              共7项
+            </div>
+            <div class="info">
+              总支出:234112
+            </div>
+            <div class="progress">
+              <div class="progress">
+
+              </div>
+            </div>
+          </div>
+        </div>
+        <div class="missionAndAddress">
+          <div class="mission">
+            <div class="title">
+              交互任务进度
+            </div>
+            <div class="progressBox">
+              <div class="item" v-for="(item,index) in progressData">
+                <div class="name">
+                  {{ item.name }}
+                </div>
+                <div class="progress">
+                  <div class="progress" :style="{width:item.progress}"></div>
+                </div>
+              </div>
+            </div>
+          </div>
+          <div class="address">
+            <div class="title">
+              地址统计
+            </div>
+            <div class="emissionBonus" id="address">
+
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="right">
+        <div class="title">
+          燃气报价(单位:元)
+        </div>
+        <div class="base">
+          当前基数:38基于以太坊交易内存池预测
+        </div>
+        <div class="gasBox">
+          <div class="top">
+            <div class="item">
+              <img src="../../assets/dashboard/Vector.svg" alt="Vector">
+              <div class="info">
+                <div class="speed">
+                  Top 40
+                </div>
+                <div class="price">
+                  $1.57 | for 15 seconds
+                </div>
+              </div>
+            </div>
+          </div>
+          <div class="high">
+            <div class="item">
+              <img src="../../assets/dashboard/Vector-1.svg" alt="Vector">
+              <div class="info">
+                <div class="speed">
+                  High speed 40
+                </div>
+                <div class="price">
+                  $1.53 | 1 minute
+                </div>
+              </div>
+            </div>
+          </div>
+          <div class="general">
+            <div class="item">
+              <img src="../../assets/dashboard/Vector-2.svg" alt="Vector">
+              <div class="info">
+                <div class="speed">
+                  General 40
+                </div>
+                <div class="price">
+                  $1.49 | 3 minutes
+                </div>
+              </div>
+            </div>
+          </div>
+          <div class="slow">
+            <div class="item">
+              <img src="../../assets/dashboard/Vector-3.svg" alt="Vector">
+              <div class="info">
+                <div class="speed">
+                  Slow 40
+                </div>
+                <div class="price">
+                  $1.49 | > 10 minutes
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+        <div class="logo">
+          <img src="../../assets/dashboard/image.svg" alt="image">
+        </div>
+      </div>
     </div>
   </div>
 </template>
 
 <script>
-import Cookies from "js-cookie";
+import * as echarts from 'echarts';
 
 export default {
   name: "Dashboard",
   data() {
     return {
-      email: undefined,
-      username: undefined,
-      nickname: undefined,
+      progressData: [
+        {
+          name: '任务名称',
+          progress: '30%',
+        },
+        {
+          name: '任务名称',
+          progress: '20%',
+        },
+        {
+          name: '任务名称',
+          progress: '0',
+        },
+        {
+          name: '任务名称',
+          progress: '0',
+        },
+        {
+          name: '任务名称',
+          progress: '0',
+        },
+      ],
+      isActive: 0,
+      day: ['7D', '30D', 'All'],
+      visible: false,
+      datePicker: []
     };
   },
-  created() {
-    this.getCookie();
+  mounted() {
+    this.initEchartsAddress()
+    this.initEchartsInput()
+    this.initEchartsExpense()
   },
   methods: {
-    getCookie() {
-      this.email = Cookies.get("email");
-      this.username = Cookies.get("username");
-      this.nickname = Cookies.get("nickname");
+    initEchartsAddress() {
+      let chartDom = document.getElementById('address');
+      let myChart = echarts.init(chartDom, undefined, {
+        renderer: 'svg'
+      });
+      let option;
+      option = {
+        textStyle: {
+          fontFamily: 'Quicksand'
+        },
+        tooltip: {
+          trigger: 'axis',
+
+        },
+        xAxis: {
+          offset: 20,
+          type: 'category',
+          data: ['钱包名称', '钱包名称', '钱包名称', '钱包名称', '钱包名称', '钱包名称'],
+          axisLabel: {
+            color: '#ABABAB'
+          },
+          axisTick: {
+            show: false
+          },
+          axisPointer: {
+            type: 'shadow'
+          }
+        },
+        yAxis: {
+          offset: 20,
+          type: 'value',
+          axisLabel: {
+            color: '#ABABAB'
+          },
+        },
+        dataZoom: [
+          {
+            type: 'inside'
+          }
+        ],
+        series: [
+          {
+            data: [30, 25, 18, 40, 26, 40],
+            type: 'bar',
+            barWidth: '15%',
+            itemStyle: {
+              color: '#27AE60',
+              borderRadius: [30, 30, 0, 0]
+            }
+          }
+        ]
+      };
+      option && myChart.setOption(option);
+    },
+    initEchartsInput() {
+      let chartDom = document.getElementById('input');
+      let myChart = echarts.init(chartDom, undefined, {
+        renderer: 'svg'
+      });
+      let option;
+      option = {
+        tooltip: {
+          trigger: 'item'
+        },
+        series: [
+          {
+            name: 'Access From',
+            type: 'pie',
+            radius: ['40%', '70%'],
+            avoidLabelOverlap: false,
+            label: {
+              show: false,
+              position: 'center'
+            },
+            labelLine: {
+              show: false
+            },
+            data: [
+              {value: 1048, name: '1'},
+              {value: 735, name: '2'},
+              {value: 580, name: '3'},
+              {value: 484, name: '4'},
+              {value: 300, name: '5'},
+              {value: 300, name: '6'},
+              {value: 300, name: '7'},
+            ]
+          }
+        ]
+      };
+      option && myChart.setOption(option);
     },
+    initEchartsExpense(){
+      let chartDom = document.getElementById('expense');
+      let myChart = echarts.init(chartDom, undefined, {
+        renderer: 'svg'
+      });
+      let option;
+      option = {
+        dataZoom: [
+          {
+            type: 'inside'
+          }
+        ],
+        tooltip: {
+          trigger: 'axis',
+          axisPointer: {
+            type: 'cross',
+            label: {
+              backgroundColor: '#6a7985'
+            }
+          }
+        },
+        legend: {
+          icon: 'circle',
+        },
+        xAxis: [
+          {
+            offset: 10,
+            type: 'category',
+            axisLabel: {
+              color: '#ABABAB',
+              fontWeight: 500
+            },
+            axisTick: {
+              show: false
+            },
+            data: ['08-05','08-06','08-07','08-08','08-09','08-10']
+          }
+        ],
+        yAxis: [
+          {
+            offset: 10,
+            axisLabel: {
+              color: '#181818',
+              fontWeight: 700
+            },
+            type: 'value'
+          }
+        ],
+        series: [
+          {
+            name: 'Gas',
+            type: 'bar',
+            stack: 'Total',
+            color: '#2980FF',
+            emphasis: {
+              focus: 'series'
+            },
+            data: [12,9,6,12,10,12]
+          },
+          {
+            name: '本金',
+            type: 'bar',
+            stack: 'Total',
+            color: '#FFD428',
+            barWidth: '25%',
+            itemStyle: {
+              borderRadius: [100, 100, 0, 0]
+            },
+            emphasis: {
+              focus: 'series'
+            },
+            data: [12,9,6,12,10,12]
+          },
+        ]
+      };
+      option && myChart.setOption(option);
+    },
+
+    changeActive(index) {
+      this.isActive = index
+    },
+    changeInitCalendarPage() {
+      let element = document.querySelector(".el-picker-panel__icon-btn.arrow-left");
+      if (element) {
+        element.click()
+      }
+    },
+    disabledDate(time) {
+      return time.getTime() > Date.now()
+    },
+    datePickerChange() {
+      this.visible = false
+      if (this.datePicker) {
+        console.log(this.datePicker);
+      } else {
+        // changeActive(0)
+      }
+    }
   },
 };
 </script>
 
 <style lang="scss" scoped>
-.dashboard {
-  &-text {
-    font-size: 30px;
-    line-height: 46px;
+.dashboard-container {
+  .title {
+    font-weight: 700;
+    font-size: 21px;
+    line-height: 26px;
+    color: #181818;
+  }
+
+  .head {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+
+    .left {
+      display: flex;
+      gap: 60px;
+
+      .item {
+        display: flex;
+        flex-direction: column;
+        gap: 8px;
+
+        .number {
+          font-weight: 700;
+          font-size: 21px;
+          line-height: 28px;
+          color: #181818;
+        }
+
+        .title {
+          font-weight: 700;
+          font-size: 12px;
+          line-height: 16px;
+          color: #8e8f91;
+        }
+      }
+
+      .verticalLine {
+        width: 1px;
+        height: 50px;
+        border-right: 1px solid #e4e6ea;
+      }
+    }
+
+    .right {
+      width: 178px;
+      height: 52px;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      gap: 4px;
+      border: 1px solid #2980FF;
+      border-radius: 10px;
+      font-weight: 700;
+      font-size: 15px;
+      line-height: 20px;
+      color: #2980FF;
+    }
+  }
+
+  .main {
+    display: flex;
+    justify-content: space-between;
+    margin-top: 40px;
+
+    .left {
+      display: flex;
+      flex-direction: column;
+      gap: 40px;
+
+      .expenseAndInput {
+        display: flex;
+        gap: 28px;
+
+        .expense {
+          width: 736px;
+          height: 342px;
+          background: #fcfdff;
+          border: 1px solid #F1F2F6;
+          border-radius: 10px;
+          padding: 36px;
+
+          .head {
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+
+            .myWallet-text2 {
+              width: 50px;
+              height: 34px;
+              background: #F1F1F1;
+              border: 1px solid #F1F1F1;
+              border-radius: 36px;
+              font-weight: 700;
+              font-size: 14px;
+              line-height: 18px;
+              color: #2A2E39;
+              display: flex;
+              justify-content: center;
+              align-items: center;
+              cursor: pointer;
+            }
+
+            .myWallet-text3 {
+              width: 50px;
+              height: 34px;
+              color: #8F9297;
+              border-radius: 36px;
+              font-weight: 500;
+              font-size: 14px;
+              line-height: 18px;
+              display: flex;
+              justify-content: center;
+              align-items: center;
+              cursor: pointer;
+            }
+
+            .myWallet-text4 {
+              width: 84px;
+              height: 34px;
+              background: linear-gradient(135deg, #FEF380 0%, #E8FFC7 100%);
+              border-radius: 36px;
+              font-weight: 700;
+              font-size: 14px;
+              line-height: 18px;
+              color: #2A2E39;
+              display: flex;
+              justify-content: center;
+              align-items: center;
+              cursor: pointer;
+            }
+          }
+          .emissionBonus{
+            margin-top: 20px;
+            width: 100%;
+            height: 260px;
+          }
+        }
+
+        .input {
+          width: 300px;
+          height: 342px;
+          background: #fcfdff;
+          border: 1px solid #F1F2F6;
+          border-radius: 10px;
+          padding: 36px;
+          text-align: center;
+          position: relative;
+
+          .emissionBonus {
+            width: 100%;
+            height: 180px;
+          }
+
+          .expected {
+            display: flex;
+            flex-direction: column;
+            position: absolute;
+            top: 136px;
+            left: 0;
+            right: 0;
+            margin: 0 auto;
+
+            .text {
+              font-weight: 500;
+              font-size: 13px;
+              line-height: 16px;
+              color: #7e7f80;
+            }
+
+            .amount {
+              font-weight: 700;
+              font-size: 16px;
+              line-height: 20px;
+              color: #000000;
+            }
+          }
+
+          .info {
+            text-align: center;
+            font-weight: 400;
+            font-size: 14px;
+            line-height: 18px;
+            color: #222222;
+          }
+
+          .progress {
+            width: 100%;
+            height: 6px;
+            background: #d2e4ff;
+            border-radius: 10px;
+            margin-top: 8px;
+
+            .progress {
+              width: 70%;
+              height: 6px;
+              background: #6FCF97;
+              border-radius: 10px;
+            }
+          }
+        }
+      }
+
+      .missionAndAddress {
+        display: flex;
+        gap: 40px;
+
+        .mission {
+          width: 335px;
+          height: 338px;
+          background: #fcfdff;
+          border: 1px solid #F1F2F6;
+          border-radius: 10px;
+          padding: 36px;
+
+          .progressBox {
+            margin-top: 28px;
+            display: flex;
+            flex-direction: column;
+            gap: 24px;
+
+            .item {
+              display: flex;
+              justify-content: space-between;
+              align-items: center;
+
+              .name {
+                font-weight: 700;
+                font-size: 11px;
+                line-height: 14px;
+                color: #181818;
+              }
+
+              .progress {
+                width: 180px;
+                height: 20px;
+                background: #222222;
+                border-radius: 0 20px 20px 0;
+
+                .progress {
+                  height: 20px;
+                  background: #6FCF97;
+                  border-radius: 0 20px 20px 0;
+                }
+              }
+            }
+          }
+        }
+
+        .address {
+          width: 689px;
+          height: 338px;
+          background: #fcfdff;
+          border: 1px solid #F1F2F6;
+          border-radius: 10px;
+          padding: 36px;
+
+          .emissionBonus {
+            width: 689px;
+            height: 280px
+          }
+        }
+      }
+    }
+
+    .right {
+      width: 348px;
+      height: 720px;
+      background: #FFFFFF;
+      border-radius: 10px;
+      padding: 28px;
+
+      .base {
+        font-weight: 400;
+        font-size: 12px;
+        line-height: 16px;
+        color: #ABABAB;
+        margin-top: 8px;
+        margin-bottom: 20px;
+      }
+
+      .gasBox {
+        display: flex;
+        flex-direction: column;
+        gap: 28px;
+
+        .item {
+          display: flex;
+          align-items: center;
+          gap: 24px;
+
+          .info {
+            display: flex;
+            flex-direction: column;
+            gap: 8px;
+
+            .speed {
+              font-weight: 700;
+              font-size: 17px;
+              line-height: 22px;
+              color: #181818;
+            }
+
+            .price {
+              font-weight: 400;
+              font-size: 14px;
+              line-height: 18px;
+              color: #919191;
+            }
+          }
+        }
+
+        .top {
+          width: 100%;
+          height: 104px;
+          background: #FFFFFF;
+          border: 1px solid #EB5757;
+          border-radius: 10px;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+
+        .high {
+          width: 100%;
+          height: 104px;
+          background: #FFFFFF;
+          border: 1px solid #2980FF;
+          border-radius: 10px;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+
+        .general {
+          width: 100%;
+          height: 104px;
+          background: #6FCF97;
+          border: 1px solid #6FCF97;
+          border-radius: 10px;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+
+        .slow {
+          width: 100%;
+          height: 104px;
+          background: #FFFFFF;
+          border: 1px solid #F2C94C;
+          border-radius: 10px;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+      }
+
+      .logo {
+        margin-top: 72px;
+        display: flex;
+        justify-content: center;
+      }
+    }
   }
 }
 </style>

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików