feige
2025-04-20 7eb199649939226c3f11fd6f4cda830a389253b8
ruoyi-ui/src/views/index_v1.vue
@@ -1,98 +1,82 @@
<template>
  <div class="dashboard-editor-container">
  <div class="app-container">
    <div class="image-container">
      <img class="bottom-image" src="../assets/images/shouye.png" alt="Bottom Image">
      <div class="notification-box" :class="{ 'has-new-message': hasNewMessage }">
        <div class="left-section">消息通知</div>
        <el-button class="right-section " type="text" @click="handleClick">点击进入</el-button>
        <div class="new-message-dot" v-if="hasNewMessage"></div>
      </div>
    </div>
    <panel-group @handleSetLineChartData="handleSetLineChartData" />
    <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
      <line-chart :chart-data="lineChartData" />
    </el-row>
    <el-row :gutter="32">
      <el-col :xs="24" :sm="24" :lg="8">
        <div class="chart-wrapper">
          <raddar-chart />
        </div>
      </el-col>
      <el-col :xs="24" :sm="24" :lg="8">
        <div class="chart-wrapper">
          <pie-chart />
        </div>
      </el-col>
      <el-col :xs="24" :sm="24" :lg="8">
        <div class="chart-wrapper">
          <bar-chart />
        </div>
      </el-col>
    </el-row>
  </div>
</template>
<script>
import PanelGroup from './dashboard/PanelGroup'
import LineChart from './dashboard/LineChart'
import RaddarChart from './dashboard/RaddarChart'
import PieChart from './dashboard/PieChart'
import BarChart from './dashboard/BarChart'
const lineChartData = {
  newVisitis: {
    expectedData: [100, 120, 161, 134, 105, 160, 165],
    actualData: [120, 82, 91, 154, 162, 140, 145]
  },
  messages: {
    expectedData: [200, 192, 120, 144, 160, 130, 140],
    actualData: [180, 160, 151, 106, 145, 150, 130]
  },
  purchases: {
    expectedData: [80, 100, 121, 104, 105, 90, 100],
    actualData: [120, 90, 100, 138, 142, 130, 130]
  },
  shoppings: {
    expectedData: [130, 140, 141, 142, 145, 150, 160],
    actualData: [120, 82, 91, 154, 162, 140, 130]
  }
}
export default {
  name: 'Index',
  components: {
    PanelGroup,
    LineChart,
    RaddarChart,
    PieChart,
    BarChart
  },
  data() {
  name: "App",
  dicts: ['sys_normal_disable'],
  data(){
    return {
      lineChartData: lineChartData.newVisitis
    }
      hasNewMessage:false,
    };
  },
  methods: {
    handleSetLineChartData(type) {
      this.lineChartData = lineChartData[type]
  created() {},
  methods:{
    handleClick(){
      this.$router.push('/views/index');
    }
  }
}
};
</script>
<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
<style scoped>
.app-container{
   background-color: #FEF7FC;
 }
.image-container {
  position: relative;
  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
  width: 100%;
  height: 100%;
}
.bottom-image {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}
@media (max-width:1024px) {
  .chart-wrapper {
    padding: 8px;
  }
.notification-box {
  position: absolute;
  top: 760px;
  left: 150px;
  display: flex;
  align-items: center;
  width: 20%;
  height: 8%;
  background-color: rgba(227, 219, 219, 0.51);
  padding: 10px;
  /*color: white;*/
  z-index: 2; /* 设置通知框层级为2,比图片高 */
}
.left-section {
  flex-grow: 1;
}
.right-section {
  margin-left: 10px;
}
.new-message-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background-color: red;
  border-radius: 50%;
}
</style>