123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592 |
- <template>
- <div class="subjects_box">
- <div class="subjects_title"><p>科目表现对比</p></div>
- <li class="subjects_listbox">
- <div class="top">
- <p class="num">{{list_data[0].score}}</p>
- <p class="datatitle">{{list_data[0].title}}</p>
- </div>
- <div class="center">
- <div id="myChart_one" :style="{width: '100%', height: '150px'}"></div>
- </div>
- <div class="bottom">
- <p class="num">{{list_data[0].belowscore}}<Icon :type="list_data[0].icon_type" :class="list_data[0].icon_color" /></p>
- <p class="datatitle">{{list_data[0].below_title}}</p>
- </div>
- </li>
- <li class="subjects_listbox">
- <div class="top">
- <p class="num">{{list_data[1].score}}</p>
- <p class="datatitle">{{list_data[1].title}}</p>
- </div>
- <div class="center">
- <div id="myChart_two" :style="{width: '100%', height: '150px'}"></div>
- </div>
- <div class="bottom">
- <p class="num">{{list_data[1].belowscore}}<Icon :type="list_data[1].icon_type" :class="list_data[1].icon_color" /></p>
- <p class="datatitle">{{list_data[1].below_title}}</p>
- </div>
- </li>
- <li class="subjects_listbox">
- <div class="top">
- <p class="num">{{list_data[2].score}}</p>
- <p class="datatitle">{{list_data[2].title}}</p>
- </div>
- <div class="center">
- <div id="myChart_three" :style="{width: '100%', height: '150px'}"></div>
- </div>
- <div class="bottom">
- <p class="num">{{list_data[2].belowscore}}<Icon :type="list_data[2].icon_type" :class="list_data[2].icon_color" /></p>
- <p class="datatitle">{{list_data[2].below_title}}</p>
- </div>
- </li>
- <li class="subjects_listbox">
- <div class="top">
- <p class="num">{{list_data[3].score}}</p>
- <p class="datatitle">{{list_data[3].title}}</p>
- </div>
- <div class="center">
- <div id="myChart_four" :style="{width: '100%', height: '150px'}"></div>
- </div>
- <div class="bottom">
- <p class="num">{{list_data[3].belowscore}}<Icon :type="list_data[3].icon_type" :class="list_data[3].icon_color" /></p>
- <p class="datatitle">{{list_data[3].below_title}}</p>
- </div>
- </li>
- <li class="subjects_listbox">
- <div class="top">
- <p class="num">{{list_data[4].score}}</p>
- <p class="datatitle">{{list_data[4].title}}</p>
- </div>
- <div class="center">
- <div id="myChart_five" :style="{width: '100%', height: '150px'}"></div>
- </div>
- <div class="bottom">
- <p class="num">{{list_data[4].belowscore}}<Icon :type="list_data[4].icon_type" :class="list_data[4].icon_color" /></p>
- <p class="datatitle">{{list_data[4].below_title}}</p>
- </div>
- </li>
- <li class="subjects_listbox">
- <div class="top">
- <p class="num">{{list_data[5].score}}</p>
- <p class="datatitle">{{list_data[5].title}}</p>
- </div>
- <div class="center">
- <div id="myChart_six" :style="{width: '100%', height: '150px'}"></div>
- </div>
- <div class="bottom">
- <p class="num">{{list_data[5].belowscore}}<Icon :type="list_data[5].icon_type" :class="list_data[5].icon_color" /></p>
- <p class="datatitle">{{list_data[5].below_title}}</p>
- </div>
- </li>
- </div>
- </template>
- <script>
- export default {
- name: "SubjectsManifestation",
- data(){
- return{
- list_data: [],
- }
- },
- created() {
- this.init();
- },
- mounted() {
- this.init();
- },
- computed:{
- // 命令发布监听
- inquiredata() {
- return this.$store.state.pie
- },
- },
- methods:{
- //图形一
- One(obj) {
- //this.$store.state.pie.mode = false;
- let myChart = this.$echarts.init(document.getElementById('myChart_one'));
- myChart.setOption({
- grid: {
- left: 0,
- top: 0,
- right: 0,
- bottom: 0
- },
- color: obj.color,
- series: [{
- type: 'pie',
- radius: ['80%', '97%'],
- hoverAnimation: false,
- label: {
- normal: {
- position: 'center'
- }
- },
- data: [{
- value: obj.occupy,
- name: '占有率',
- label: {
- normal: {
- rich: {
- a: {
- lineHeight: 10
- }
- },
- formatter: '{d}%',
- textStyle: {
- fontSize: 18,
- fontWeight: 'bold',
- color: '#555',
- height: 25,
- top: 1,
- }
- }
- }
- }, {
- value: obj.surplus,
- name: '不足',
- label: {
- normal: {
- rich: {
- a: {
- lineHeight: 5
- }
- },
- formatter: '\n' + obj.subject,
- textStyle: {
- color: '#555',
- fontSize: 15,
- height: 15,
- }
- }
- },
- tooltip: {
- show: false
- },
- itemStyle: {
- normal: {
- color: '#ddd'
- },
- emphasis: {
- color: '#ddd'
- }
- },
- hoverAnimation: false
- }]
- }]
- })
- },
- Two(obj){
- //this.$store.state.pie.mode = false;
- let myChart = this.$echarts.init(document.getElementById('myChart_two'));
- myChart.setOption({
- grid:{
- left:0,
- top:0,
- right:0,
- bottom:0
- },
- color: obj.color,
- series: [{
- type: 'pie',
- radius: ['80%', '97%'],
- hoverAnimation:false,
- label: {
- normal: {
- position: 'center'
- }
- },
- data: [{
- value: obj.occupy,
- name: '占有率',
- label: {
- normal: {
- rich:{
- a:{
- lineHeight: 10
- }
- },
- formatter: '{d}%',
- textStyle: {
- fontSize: 18,
- fontWeight:'bold',
- color:'#555',
- height:25,
- top:1,
- }
- }
- }
- }, {
- value: obj.surplus,
- name: '不足',
- label: {
- normal: {
- rich:{
- a:{
- lineHeight: 5
- }
- },
- formatter: '\n' + obj.subject,
- textStyle: {
- color: '#555',
- fontSize: 15,
- height:15,
- }
- }
- },
- tooltip: {
- show: false
- },
- itemStyle: {
- normal: {
- color: '#ddd'
- },
- emphasis: {
- color: '#ddd'
- }
- },
- hoverAnimation: false
- }]
- }]
- })
- },
- Three(obj){
- //this.$store.state.pie.mode = false;
- let myChart = this.$echarts.init(document.getElementById('myChart_three'));
- myChart.setOption({
- grid:{
- left:0,
- top:0,
- right:0,
- bottom:0
- },
- color: obj.color,
- series: [{
- type: 'pie',
- radius: ['80%', '97%'],
- hoverAnimation:false,
- label: {
- normal: {
- position: 'center'
- }
- },
- data: [{
- value: obj.occupy,
- name: '占有率',
- label: {
- normal: {
- rich:{
- a:{
- lineHeight: 10
- }
- },
- formatter: '{d}%',
- textStyle: {
- fontSize: 18,
- fontWeight:'bold',
- color:'#555',
- height:25,
- top:1,
- }
- }
- }
- }, {
- value: obj.surplus,
- name: '不足',
- label: {
- normal: {
- rich:{
- a:{
- lineHeight:5
- }
- },
- formatter: '\n' + obj.subject,
- textStyle: {
- color: '#555',
- fontSize: 15,
- height:15,
- }
- }
- },
- tooltip: {
- show: false
- },
- itemStyle: {
- normal: {
- color: '#ddd'
- },
- emphasis: {
- color: '#ddd'
- }
- },
- hoverAnimation: false
- }]
- }]
- })
- },
- Four(obj){
- //this.$store.state.pie.mode = false;
- let myChart = this.$echarts.init(document.getElementById('myChart_four'));
- myChart.setOption({
- grid:{
- left:0,
- top:0,
- right:0,
- bottom:0
- },
- color: obj.color,
- series: [{
- type: 'pie',
- radius: ['80%', '97%'],
- hoverAnimation:false,
- label: {
- normal: {
- position: 'center'
- }
- },
- data: [{
- value: obj.occupy,
- name: '占有率',
- label: {
- normal: {
- rich:{
- a:{
- lineHeight: 10
- }
- },
- formatter: '{d}%',
- textStyle: {
- fontSize: 18,
- fontWeight:'bold',
- color:'#555',
- height:25,
- top:1,
- }
- }
- }
- }, {
- value: obj.surplus,
- name: '不足',
- label: {
- normal: {
- rich:{
- a:{
- lineHeight:5
- }
- },
- formatter: '\n' + obj.subject,
- textStyle: {
- color: '#555',
- fontSize: 15,
- height:15,
- }
- }
- },
- tooltip: {
- show: false
- },
- itemStyle: {
- normal: {
- color: '#ddd'
- },
- emphasis: {
- color: '#ddd'
- }
- },
- hoverAnimation: false
- }]
- }]
- })
- },
- Five(obj){
- //this.$store.state.pie.mode = false;
- let myChart = this.$echarts.init(document.getElementById('myChart_five'));
- myChart.setOption({
- grid:{
- left:0,
- top:0,
- right:0,
- bottom:0
- },
- color:obj.color,
- series: [{
- type: 'pie',
- radius: ['80%', '97%'],
- hoverAnimation:false,
- label: {
- normal: {
- position: 'center'
- }
- },
- data: [{
- value: obj.occupy,
- name: '占有率',
- label: {
- normal: {
- rich:{
- a:{
- lineHeight: 10
- }
- },
- formatter: '{d}%',
- textStyle: {
- fontSize: 18,
- fontWeight:'bold',
- color:'#555',
- height:25,
- top:1,
- }
- }
- }
- }, {
- value: obj.surplus,
- name: '不足',
- label: {
- normal: {
- rich:{
- a:{
- lineHeight: 5
- }
- },
- formatter: '\n'+obj.subject ,
- textStyle: {
- color: '#555',
- fontSize: 15,
- height:15
- }
- }
- },
- tooltip: {
- show: false
- },
- itemStyle: {
- normal: {
- color: '#ddd'
- },
- emphasis: {
- color: '#ddd'
- }
- },
- hoverAnimation: false
- }]
- }]
- })
- },
- Six(obj){
- //this.$store.state.pie.mode = false;
- let myChart = this.$echarts.init(document.getElementById('myChart_six'));
- myChart.setOption({
- grid:{
- left:0,
- top:0,
- right:0,
- bottom:0
- },
- color: obj.color,
- series: [{
- type: 'pie',
- radius: ['80%', '97%'],
- hoverAnimation:false,
- label: {
- normal: {
- position: 'center'
- }
- },
- data: [{
- value: obj.occupy,
- name: '占有率',
- label: {
- normal: {
- rich:{
- a:{
- lineHeight: 10
- }
- },
- formatter: '{d}%',
- textStyle: {
- fontSize: 18,
- fontWeight:'bold',
- color:'#555',
- height:25,
- top:1,
- }
- }
- }
- }, {
- value: obj.surplus,
- name: '不足',
- label: {
- normal: {
- rich:{
- a:{
- lineHeight: 5
- }
- },
- formatter: '\n' + obj.subject,
- textStyle: {
- color: '#555',
- fontSize: 15,
- height:15,
- }
- }
- },
- tooltip: {
- show: false
- },
- itemStyle: {
- normal: {
- color: '#ddd'
- },
- emphasis: {
- color: '#ddd'
- }
- },
- hoverAnimation: false
- }]
- }]
- })
- },
- init() {
- let _this = this;
- this.$api.FindSubjectsManifestation({})
- .then((response) => {
- //console.log(response.result.data, 8888888);
- //this.One(response.result.data);
- _this.$store.state.pie = response.result.data;
- //_this.Two(response.result.data[1]);
- //_this.Three(response.result.data[2]);
- //_this.Four(response.result.data[3]);
- //_this.Five(response.result.data[4]);
- //_this.Six(response.result.data[5]);
- })
- }
- },
- watch:{
- // 监听指令
- inquiredata(value){
- if(value){
- this.list_data = value;
- let dataone= value[0];
- let datatwo = value[1];
- let datathree = value[2];
- let datafour = value[3];
- let datafive = value[4];
- let datasix = value[5];
- this.One(dataone);
- this.Two(datatwo);
- this.Three(datathree);
- this.Four(datafour);
- this.Five(datafive);
- this.Six(datasix);
- }
- },
- }
- }
- </script>
|