Files
UNION_NSI/target/classes/views/platform/jdh/sjkb.html
T
2026-09-08 19:49:21 +08:00

162 lines
5.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-select {
width: 100%;
}
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<el-select v-model="pageForm.jdhid" @change="jdhChange" placeholder="请选择教代会">
<el-option
v-for="item in JdhList"
:key="item.id"
:label="item.jdhallname"
:value="item.id">
</el-option>
</el-select>
</el-card>
<el-row type="flex" class="mt20" :gutter="10">
<el-col :span="18">
<el-card shadow="never">
<vi-title title="代表结构"></vi-title>
<div id="db_plot_box" ref="db_box" :style="{height:db_box_height+'px'}"></div>
</el-card>
</el-col>
<el-col :span="6">
<el-card shadow="never" style="height: 100%">
<vi-title title="代表团"></vi-title>
<el-table ref="dbtTable" :data="dbt" :height="dbtTableHeight" show-summary>
<el-table-column label="代表团" prop="dbtname" show-overflow-tooltip>
<template scope="{row}">
{{row.delegationName}}{{isDisPlayCode?''+row.delegationCode+'':null}}
</template>
</el-table-column>
<el-table-column label="代表人数" prop="num"></el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
</guava>
</div>
<script>
let dbPlot = null
let vue = new Vue({
el: '#app',
data() {
return {
pageForm: {
jdhid: '',
},
JdhList: [],
dbt: [],
hyhdTableData: [],
dbOptions: {
xAxis: {
type: 'category',
data: [],
axisLabel: {
interval: 0
}
},
yAxis: {
type: 'value'
},
series: [{
label: {
normal: {
show: true,
position: 'top'
}
},
data: [],
type: 'bar',
showBackground: true,
itemStyle: {
//通常情况下:
normal: {
//每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
color: function (params) {
var colorList = ['#CE0000', 'rgb(42,170,227)', 'rgb(42,170,227)', 'rgb(42,170,227)', '#FFDCB9', '#FFDCB9', '#FFDCB9', '#FFDCB9', '#FFDCB9', '#FFDCB9'];
return colorList[params.dataIndex];
}
},
}
}]
},
dbtTableHeight: null,
db_box_height: null
}
},
methods: {
async jdhChange(jdhid) {
const resp_data = await $.get(base + '/platform/jdh/sjkb/getData', {jdhid})
this.dbt = resp_data.data.dbt
this.hyhdTableData = resp_data.data.hyhd
const keys = Object.keys(resp_data.data.db)
let dbData = []
keys.map(v => {
dbData.push({name: v, num: resp_data.data.db[v]})
})
if (dbPlot) {
dbPlot.destroy()
}
dbPlot = new G2Plot.Column('db_plot_box', {
data: dbData,
xField: 'name',
yField: 'num',
label: {
position: 'middle',
style: {
fill: '#FFFFFF',
opacity: 0.6,
},
},
xAxis: {
label: {
autoHide: true,
autoRotate: false,
},
},
meta: {
name: {
alias: '类别',
},
num: {
alias: '人数',
}
},
})
dbPlot.render()
}
},
mounted() {
setTimeout(() => {
this.db_box_height = (window.innerHeight - 10) - this.$refs.db_box.getBoundingClientRect().top - 20
this.dbtTableHeight = (window.innerHeight - 20 - 20) - this.$refs.dbtTable.$el.getBoundingClientRect().top
window.onresize = () => {
this.db_box_height = (window.innerHeight - 10) - this.$refs.db_box.getBoundingClientRect().top - 20
this.dbtTableHeight = (window.innerHeight - 20 - 20) - this.$refs.dbtTable.$el.getBoundingClientRect().top
}
}, 100)
},
async created() {
this.JdhList = await proposal.getOpenMeeting()
if (this.JdhList.length > 0) {
this.pageForm.jdhid = this.JdhList[0].id
this.jdhChange(this.pageForm.jdhid)
}
}
})
</script>
<!--#
}
#-->