Files
2026-09-08 19:49:21 +08:00

207 lines
7.6 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<title></title>
<link rel="stylesheet" href="/assets/platform/css/datav/activity.css">
<link rel="stylesheet" href="${base!}/assets/platform/plugins/element-ui/lib/theme-chalk/index.css">
<script src="${base!}/assets/platform/plugins/vue/vue.min.js"></script>
<script src="${base!}/assets/platform/plugins/element-ui/lib/index.js"></script>
<script src="${base!}/assets/platform/plugins/element-ui/lib/i18n/${lang,escape}.js"></script>
<script src="${base!}/assets/platform/plugins/datav/datav.map.vue.js"></script>
<script src="${base!}/assets/platform/plugins/jquery/jquery-1.11.1.min.js"></script>
<script src="${base!}/assets/platform/plugins/vue-loader/httpVueLoader.js"></script>
<script src="https://cdn.staticfile.org/g2plot/2.4.31/g2plot.min.js"></script>
<script src="https://cdn.staticfile.org/echarts/5.2.2/echarts.js"></script>
<script src="https://cdn.staticfile.org/echarts/5.2.2/i18n/langZH.js"></script>
</head>
<body>
<div id="app">
<div id="data-view">
<div id="top-header">
<dv-decoration-8 class="header-left-decoration"></dv-decoration-8>
<dv-decoration-11 class="header-center-decoration">活动</dv-decoration-11>
<dv-decoration-8 class="header-right-decoration" reverse></dv-decoration-8>
</div>
<div id="main-content">
<div class="box box1">
<h4 class="box-title">活动举办数量</h4>
<dv-capsule-chart :config="configType" style="width:90%;height: calc(100% - 60px)"/>
</div>
<div class="box box2">
<h4 class="box-title" style="position: relative">
活动参与人数
<dv-decoration-11 style="width:200px;height:7vh;position: absolute;right: 10px;line-height: 5vh">
<el-select v-model="activityCode" style="width: 120px;height: 5vh" @change="getTakePartUser">
<el-option v-for="item in activityCodes" :key="item.code" :value="item.code"
:label="item.name">
</el-option>
</el-select>
</dv-decoration-11>
</h4>
<dv-conical-column-chart :config="box2Config" style="width:100%;height:calc(100% - 13vh);"/>
</div>
<div class="box box5">
<h4 class="box-title">分工会举办活动</h4>
<div style="height: calc(100% - 6vh);display: flex;">
<div id="unionChart" style="width: 100%;height: calc(100 - 6vh)"></div>
</div>
</div>
<div class="box box6">
<h4 class="box-title">每月举办活动信息</h4>
<div id="dateChart" style="height: calc(100% - 6vh);display: flex;">
</div>
</div>
</div>
</div>
</div>
<script>
var app = new Vue({
el: '#app',
data() {
return {
userNum: {},
unionMember: [],
medicalData: {},
configType: {
data: [],
showValue: true
},
box2Config: {
data: [
{
name: '周口',
value: 55
},
{
name: '南阳',
value: 120
},
{
name: '西峡',
value: 71
}
]
},
activityCodes: [],
activityCode: null
}
},
methods: {
async getActivityCode() {
const {data} = await $.get('/platform/activity/basic/basic/settings/getActivityTwoLevelType', {code: '50000'})
this.activityCodes = data
this.activityCode = this.activityCodes[0].code
},
async getTypeNum() {
const {data} = await $.get('/platform/datav/activity/typeNum')
this.configType = {
data,
showValue: true
}
},
async getTakePartUser() {
const {data} = await $.get('/platform/datav/activity/takePartUser', {activityCode: this.activityCode})
this.box2Config = {
data
}
},
async getUnionActivity(){
const {data} = await $.get('/platform/datav/activity/unionActivity')
const chart = new G2Plot.Column('unionChart', {
data,
padding: 50,
xField: 'name',
yField: 'value',
forceFit: true,
columnStyle: {
radius: [20, 20, 0, 0],
},
xAxis: {
label: {
autoRotate: true,
autoHide: true,
autoEllipsis: true,
style: {
fill: '#fff', // 文字颜色:红色
}
},
},
yAxis: {
label: {
style: {
fill: '#fff',
},
},
},
legend: {
position: 'right', // 图例位置:下边
offsetX: -10,
itemName: {
style: {
fill: '#fff', // 文字颜色:红色
},
},
},
});
chart.render();
},
async getDateActivity(){
const {data} = await $.get('/platform/datav/activity/dateActivity')
const column = new G2Plot.Column('dateChart', {
data,
xField: 'type',
yField: 'value',
xAxis: {
label: {
autoRotate: false,
autoHide: true,
autoEllipsis: true,
style: {
fill: '#fff', // 文字颜色:红色
}
},
},
yAxis: {
label: {
style: {
fill: '#fff',
},
},
},
scrollbar: {
type: 'horizontal',
},
columnStyle: {
radius: [20, 20, 0, 0],
},
});
column.render();
}
},
created() {
setTimeout(async () => {
this.getTypeNum()
this.getUnionActivity()
this.getDateActivity()
await this.getActivityCode()
await this.getTakePartUser()
})
}
})
</script>
</body>
</html>