lanan-system-vue/src/views/index.vue

122 lines
2.6 KiB
Vue
Raw Normal View History

2024-07-30 15:07:56 +08:00
<template>
2024-10-23 15:18:19 +08:00
<div >
<el-row>
<el-col v-for="item in serviceList" :span="4">
<image-preview :width="300" :height="300" :src="item.coverImg"></image-preview>
{{item.name}}
2024-07-30 15:07:56 +08:00
</el-col>
</el-row>
2024-10-23 15:18:19 +08:00
<el-table
:data="warnList"
stripe
style="width: 100%">
<el-table-column
prop="date"
label="日期"
width="180">
</el-table-column>
<el-table-column
prop="name"
label="姓名"
width="180">
</el-table-column>
<el-table-column
prop="address"
label="地址">
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"
/>
2024-07-30 15:07:56 +08:00
</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'
2024-10-23 15:18:19 +08:00
import {getServicePackageList} from "@/api/system/servicePackage";
2024-07-30 15:07:56 +08:00
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() {
return {
2024-10-23 15:18:19 +08:00
lineChartData: lineChartData.newVisitis,
serviceList:[],
warnList:[],
messageList:[],
queryParams:{
pageNo:1,
pageSize:10
}
2024-07-30 15:07:56 +08:00
}
},
2024-10-23 15:18:19 +08:00
created() {
this.getServiceList()
},
2024-07-30 15:07:56 +08:00
methods: {
handleSetLineChartData(type) {
this.lineChartData = lineChartData[type]
2024-10-23 15:18:19 +08:00
},
getServiceList(){
getServicePackageList(this.queryParams).then(response => {
this.serviceList = response.data;
});
2024-07-30 15:07:56 +08:00
}
}
}
</script>
<style lang="scss" scoped>
.dashboard-editor-container {
padding: 32px;
background-color: rgb(240, 242, 245);
position: relative;
.chart-wrapper {
background: #fff;
padding: 16px 16px 0;
margin-bottom: 32px;
}
}
@media (max-width:1024px) {
.chart-wrapper {
padding: 8px;
}
}
</style>