新增signalR连接

This commit is contained in:
不做码农
2022-02-27 21:11:46 +08:00
parent 2a84f7d322
commit 748b9065db
15 changed files with 259 additions and 61 deletions

View File

@@ -7,9 +7,9 @@
</div>
<div class="card-panel-description">
<div class="card-panel-text">
访客
在线用户
</div>
<count-to :start-val="0" :end-val="102400" :duration="2600" class="card-panel-num" />
<count-to :start-val="0" :end-val="onlineUserNum" :duration="2600" class="card-panel-num" />
</div>
</div>
</el-col>
@@ -56,18 +56,21 @@
</template>
<script>
import CountTo from 'vue-count-to'
import CountTo from "vue-count-to";
import { mapGetters } from "vuex";
export default {
components: {
CountTo
CountTo,
},
computed: {
...mapGetters(["onlineUserNum"]),
},
methods: {
handleSetLineChartData(type) {
this.$emit('handleSetLineChartData', type)
}
}
}
this.$emit("handleSetLineChartData", type);
},
},
};
</script>
<style lang="scss" scoped>
@@ -86,8 +89,8 @@ export default {
overflow: hidden;
color: #666;
background: #fff;
box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
border-color: rgba(0, 0, 0, .05);
box-shadow: 4px 4px 40px rgba(0, 0, 0, 0.05);
border-color: rgba(0, 0, 0, 0.05);
&:hover {
.card-panel-icon-wrapper {
@@ -107,7 +110,7 @@ export default {
}
.icon-shopping {
background: #34bfa3
background: #34bfa3;
}
}
@@ -124,7 +127,7 @@ export default {
}
.icon-shopping {
color: #34bfa3
color: #34bfa3;
}
.card-panel-icon-wrapper {
@@ -160,7 +163,7 @@ export default {
}
}
@media (max-width:550px) {
@media (max-width: 550px) {
.card-panel-description {
display: none;
}

View File

@@ -25,56 +25,54 @@
</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'
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]
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]
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]
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]
}
}
actualData: [120, 82, 91, 154, 162, 140, 130],
},
};
export default {
name: 'Index',
name: "Index",
components: {
PanelGroup,
LineChart,
RaddarChart,
PieChart,
BarChart
BarChart,
},
data() {
return {
lineChartData: lineChartData.newVisitis
}
lineChartData: lineChartData.newVisitis,
};
},
methods: {
handleSetLineChartData(type) {
this.lineChartData = lineChartData[type]
}
}
}
this.lineChartData = lineChartData[type];
},
},
};
</script>
<style lang="scss" scoped>
@@ -90,7 +88,7 @@ export default {
}
}
@media (max-width:1024px) {
@media (max-width: 1024px) {
.chart-wrapper {
padding: 8px;
}