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

237 lines
6.4 KiB
Vue
Raw Normal View History

2024-07-30 15:07:56 +08:00
<template>
2024-10-24 15:58:24 +08:00
<div class="container_">
2024-10-24 22:28:38 +08:00
<div class="top-list">
2024-10-25 18:19:03 +08:00
<div class="list-box" v-for="(item, index) in serviceList.slice(0, 4)" :key="item.id" :span="4">
<div @click="goRoute(item.id)">
<img :src="index === 0 ? 'https://th.bing.com/th/id/OIP.Y9YEwiwLwTdvQDkLlA3JbQHaE8?w=251&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7' :
index === 1 ? 'https://th.bing.com/th/id/OIP.a8bAOOXWZ_G0POGjCXPYbgHaFj?w=206&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7' :
index === 2 ? 'https://th.bing.com/th/id/OIP.9vxxtCP1lmu43fYus2SZ5gHaE7?w=284&h=189&c=7&r=0&o=5&dpr=1.5&pid=1.7' :
'https://th.bing.com/th/id/OIP.MwxN9-_jrMRNiVLJ9Q7WRQHaE8?w=265&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7'"
style="width: 300px; height: 300px;">
<div style="font-weight: bold;text-align: center;font-size: 28px">{{ item.name }}</div>
2024-10-23 23:26:01 +08:00
</div>
2024-10-24 22:28:38 +08:00
</div>
</div>
2024-10-24 15:58:24 +08:00
2024-10-25 18:19:03 +08:00
2024-10-24 15:58:24 +08:00
<div class="container-box">
<div class="flex-box">
<div style=" font-size: 30px;margin-bottom: 30px">临期提醒</div>
2024-10-23 16:16:22 +08:00
<el-table
:data="warnList"
stripe
style="width: 100%">
<el-table-column
2024-10-23 23:26:01 +08:00
prop="title"
label="标题"
2024-10-23 16:16:22 +08:00
width="180">
</el-table-column>
<el-table-column
2024-10-23 23:26:01 +08:00
prop="content"
label="内容"
2024-10-23 16:16:22 +08:00
width="180">
</el-table-column>
<el-table-column
2024-10-23 23:26:01 +08:00
prop="warnTime"
label="提醒时间">
2024-10-23 16:16:22 +08:00
</el-table-column>
</el-table>
<!-- 分页组件 -->
2024-10-23 23:26:01 +08:00
<pagination v-show="warnTotal > 0" :total="warnTotal" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getWarnList"
2024-10-23 16:16:22 +08:00
/>
2024-10-24 15:58:24 +08:00
</div>
<div class="flex-box">
<div style="font-size: 30px;margin-bottom: 30px">消息通知</div>
<el-table
:data="messageList"
stripe
style="width: 100%">
<el-table-column
prop="templateNickname"
label="发送人"
width="120">
</el-table-column>
<el-table-column label="发送时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="类型" align="center" prop="templateType" width="80">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE" :value="scope.row.templateType" />
</template>
</el-table-column>
<el-table-column
prop="templateContent"
label="内容">
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="messageTotal > 0" :total="messageTotal" :page.sync="messageQueryParams.pageNo"
:limit.sync="messageQueryParams.pageSize"
@pagination="getNotifyMessage"
/>
</div>
2024-10-23 16:16:22 +08:00
</div>
2024-10-23 15:18:19 +08:00
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-10-23 23:26:01 +08:00
import {warnList,getMyNotifyMessagePage} from "@/api/system/notify/message";
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-24 22:28:38 +08:00
imgUrl:'',
2024-10-23 15:18:19 +08:00
lineChartData: lineChartData.newVisitis,
2024-10-23 16:16:22 +08:00
serviceList: [],
warnList: [],
messageList: [],
queryParams: {
pageNo: 1,
pageSize: 10
},
messageQueryParams: {
pageNo: 1,
pageSize: 10
},
2024-10-23 23:26:01 +08:00
messageTotal: 0,
warnTotal: 0
2024-07-30 15:07:56 +08:00
}
},
2024-10-23 15:18:19 +08:00
created() {
this.getServiceList()
2024-10-23 16:16:22 +08:00
this.getNotifyMessage()
2024-10-23 23:26:01 +08:00
this.getWarnList()
2024-10-24 22:28:38 +08:00
this.imgUrl = process.env.VUE_APP_IMAGE_URL
console.log( this.imgUrl + '1111111' )
2024-10-23 15:18:19 +08:00
},
2024-07-30 15:07:56 +08:00
methods: {
handleSetLineChartData(type) {
this.lineChartData = lineChartData[type]
2024-10-23 15:18:19 +08:00
},
2024-10-23 23:26:01 +08:00
goRoute(code){
console.log(window.location.host,150)
window.open(window.location.origin+"/index?routeCode="+code)
},
2024-10-23 16:16:22 +08:00
getNotifyMessage() {
// 执行查询
getMyNotifyMessagePage(this.messageQueryParams).then(response => {
2024-10-23 23:26:01 +08:00
2024-10-23 16:16:22 +08:00
this.messageList = response.data.list;
this.messageTotal = response.data.total;
});
},
2024-10-23 23:26:01 +08:00
getWarnList() {
// 执行查询
warnList(this.queryParams).then(response => {
console.log(response,149)
this.warnList = response.data.records;
this.warnTotal = response.data.total;
});
},
2024-10-23 16:16:22 +08:00
getServiceList() {
2024-10-23 15:18:19 +08:00
getServicePackageList(this.queryParams).then(response => {
this.serviceList = response.data;
});
2024-07-30 15:07:56 +08:00
}
}
}
</script>
<style lang="scss" scoped>
2024-10-24 15:58:24 +08:00
.container_{
background-color: rgb(240, 242, 245);
box-sizing: border-box;
padding: 15px;
}
2024-10-24 22:28:38 +08:00
.top-list{
width: 100%;
display: flex;
justify-content: space-between;
margin-bottom: 25px;
2024-10-25 18:19:03 +08:00
flex-wrap: wrap;
2024-10-24 22:28:38 +08:00
}
.list-box{
background: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
border-radius: 4px;
box-sizing: border-box;
padding: 15px;
border-radius: 8px;
}
2024-10-24 15:58:24 +08:00
.container-box{
width: 100%;
display: flex;
justify-content: space-between;
}
.flex-box{
width: 49%;
background: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
border-radius: 4px;
box-sizing: border-box;
padding: 15px;
border-radius: 8px;
}
2024-07-30 15:07:56 +08:00
.dashboard-editor-container {
padding: 32px;
background-color: rgb(240, 242, 245);
position: relative;
.chart-wrapper {
background: #fff;
padding: 16px 16px 0;
margin-bottom: 32px;
}
}
2024-10-23 16:16:22 +08:00
@media (max-width: 1024px) {
2024-07-30 15:07:56 +08:00
.chart-wrapper {
padding: 8px;
}
}
</style>