<!--工业经济专题分析--> <template> <div class="full-box ztfx"> <div class="" style="width: 100%;height:100%;"> <div class="top-tip-box t-title">当前位置:专题分析 > 工业经济专题分析</div> <div class="ztfx-info-box"> <div class="left-search-box"> <div class="lsb-top">数据截止时间:{{$Util.isEmpty(totalData.latestDate)?lastTime:totalData.latestDate}}</div> <div class="lsb-search"> <div class="lsb-search-box"> <div class="sl-row"> <div class="sl-row-label">行业</div> <el-select v-model="filter.industryCode" clearable placeholder="请选择" @change="industryChange"> <el-option label="全部" value=""></el-option> <el-option v-for="item in locations" :key="item.value" :label="item.name" :value="item.value"></el-option> </el-select> </div> <div class="sl-row"> <div class="sl-row-label">时间</div> <el-date-picker type="month" :picker-options="beginDate(filter.endDate)" v-model="filter.startDate" placeholder="开始日期" value-format="yyyy-MM" style="width:calc(100% - 40px);float: left;"> </el-date-picker> </div> <div class="sl-row"> <div class="sl-row-label">至</div> <el-date-picker type="month" :picker-options="processDate(filter.startDate)" v-model="filter.endDate" placeholder="结束日期" value-format="yyyy-MM" style="width:calc(100% - 40px);float: left;"> </el-date-picker> </div> </div> <div class="lsb-search-border"> <div class="lsbb-top"></div> <div class="lsbb-role"></div> <div class="lsbb-bottom"></div> </div> </div> <div class="lsb-info"> <div class="lsb-title"><span class="dot"></span><span v-if="!$Util.isEmpty(industryName)">{{industryName}} - </span>年度信息汇总</div> <div class="item-chart"> <div class="chart-group"> <div class="chart-pie"> <div class="pie-box"> <div class="circle"><div class="circle2"><div class="circle3">{{totalData.total}}</div></div></div> </div> <div class="pie-title">累计规上工业总产值</div> </div> <div class="chart-pie"> <div class="pie-box"> <div class="circle7"><div class="circle8"><div class="circle9">{{totalData.totalTb}}%</div></div></div> </div> <div class="pie-title">同比</div> </div> </div> <div class="chart-group"> <div class="chart-pie"> <div class="pie-box"> <div class="circle4"><div class="circle5"><div class="circle6">{{totalData.current}}</div></div></div> </div> <div class="pie-title">当月规上工业总产值</div> </div> <div class="chart-pie"> <div class="pie-box"> <div class="circle10"><div class="circle11"><div class="circle12">{{totalData.currentTb}}%</div></div></div> </div> <div class="pie-title">同比</div> </div> </div> </div> </div> </div> <div class="right-info-box"> <div class="right-left-border"> <div class="rlb-top"></div> <div class="rlb-role"></div> <div class="rlb-bottom"></div> </div> <div class="ri-box"> <div class="ztfx-tab-box"> <div class="tab-item" :class="{active :filter.type == 'cz'}" @click="initChartsByType('cz')">产值</div> <div class="tab-item" :class="{active :filter.type == 'sr'}" @click="initChartsByType('sr')">收入</div> <div class="tab-item" :class="{active :filter.type == 'ls'}" @click="initChartsByType('ls')">利税</div> <div class="tab-item" :class="{active :filter.type == 'lr'}" @click="initChartsByType('lr')">利润</div> </div> <div class="ztfx-charts-box"> <div class="ztfx-chart-item"> <div class="roles-one"></div><div class="roles-two"></div> <div class="roles-three"></div><div class="roles-four"></div> <div class="ztfx-chart-title"><span class="dot"></span>工业{{typeName}}行业分布</div> <div class="ztfx-chart-info" id="chartOne"></div> </div> <div class="ztfx-chart-item"> <div class="roles-one"></div><div class="roles-two"></div> <div class="roles-three"></div><div class="roles-four"></div> <div class="ztfx-chart-title"><span class="dot"></span>工业{{typeName}}时间趋势分布</div> <div class="ztfx-chart-info" id="chartTwo"></div> </div> <div class="ztfx-chart-item"> <div class="roles-one"></div><div class="roles-two"></div> <div class="roles-three"></div><div class="roles-four"></div> <div class="ztfx-chart-title"><span class="dot"></span>主导产业工业{{typeName}}占比</div> <div class="ztfx-chart-info" id="chartThree"></div> </div> <div class="ztfx-chart-item" style='position: relative'> <div class="roles-one"></div><div class="roles-two"></div> <div class="roles-three"></div><div class="roles-four"></div> <div class="ztfx-chart-title"><span class="dot"></span>规上工业{{typeName}}排名</div> <div class="more-table-detail" @click="moreDataClick()">更多>></div> <div class="ztfx-chart-info result-table"> <div class="table-container-style" id="chartFour"> <el-table :data="chartTable" :height="200"> <el-table-column align="center" label="企业名称" > <template slot-scope="scope"> <el-tooltip class="item" effect="dark" :content="scope.row.name" placement="left"> <div class="ellipsis" style="width:100%;cursor: pointer;" @click="jumpToDetail(scope.row)">{{scope.row.name}}</div> </el-tooltip> </template> </el-table-column> <el-table-column prop="value" align="center" :label="'总'+unitTable" width="130"></el-table-column> <el-table-column prop="valueTb" align="center" label="同比" width="100"></el-table-column> </el-table> </div> </div> </div> </div> </div> </div> </div> </div> <!--pop列表--> <el-dialog :title="'规上工业'+typeName+'排名'" :visible.sync="dialogVisible" width="800px" :close-on-click-modal=false top="40px"> <el-table :data="moreData.list" highlight-current-row style="width: 100%"> <el-table-column align="center" label="企业名称" > <template slot-scope="scope"> <el-tooltip class="item" effect="dark" :content="scope.row.name" placement="left"> <div class="ellipsis" style="width:100%;cursor: pointer;" @click="jumpToDetail(scope.row)">{{scope.row.name}}</div> </el-tooltip> </template> </el-table-column> <el-table-column prop="value" align="center" :label="'总'+unitTable" width=""></el-table-column> <el-table-column prop="valueTb" align="center" label="同比" width="100"></el-table-column> </el-table> <el-pagination @current-change="morePageChange" background layout="prev, pager, next" :page-size="moreData.pageSize" :current-page="moreData.pageNum" :total="moreData.total" style="text-align: right;"></el-pagination> <div slot="footer" class="dialog-footer"> <el-button @click="dialogVisible = false">关闭</el-button> </div> </el-dialog> </div> </template> <script> const currentDate = new Date('2020/12/1') let month = currentDate.getMonth()+1; let year = month<10?currentDate .getFullYear()+"-0"+month :currentDate .getFullYear()+"-"+month; export default { name: 'jjyx', data () { return { dialogVisible:false, moreData:{list:[], pageNum:1, pageSize:10, total:0}, showCondition:false, year:new Date(year).format("yyyy"), lastTime:new Date(year).format("yyyy-MM"), locations: [], industryName:'', unit:'产值(亿元)', unitTable:'产值(亿元)', typeName:'产值', filter:{ industryCode:"", type:'cz', startDate: new Date(year).format("yyyy-")+"01", endDate:new Date(year).format("yyyy-MM") }, totalData:{total: 0,current: 0,currentTb: 0,year: 2017,latestDate:'2019-04',totalTb: 0}, chartTable:[], defaultOp:{ title: { show: false }, legend:{show:false,height:"0"}, grid:{top:30,bottom:30}, tooltip: { trigger: 'axis', axisPointer: { type: 'cross', label: { backgroundColor: '#777' }, crossStyle: { color: 'rgba(255,255,255,.8)', } } }, xAxis: { axisLabel:{color:'rgba(255,255,255,.9)'/*,interval:0*/}, axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, splitLine:{lineStyle:{color:'rgba(255,255,255,.1)'}} } }, } }, mounted (){ this.GLOBAL.app.getDictList(resp => { this.locations = resp["行业列表"]; }) this.getTotalData(); this.loadTabCharts(); }, watch:{ "filter.startDate":function(){ let vm = this vm.loadTabCharts() }, "filter.endDate":function(){ let vm = this vm.loadTabCharts() }, "filter.industryCode":function () { let vm = this; vm.loadTabCharts() } }, methods:{ initChartsByType (type){ let vm = this vm.unit = type=='cz' ? '产值(亿元)': type=='sr' ? '收入(亿元)' :type=='ls' ? '利税(亿元)' :type=='lr' ? '利润(亿元)' :''; vm.unitTable = type=='cz' ? '产值(亿元)': type=='sr' ? '收入(千元)' :type=='ls' ? '利税(千元)' :type=='lr' ? '利润(千元)' :''; vm.typeName = type=='cz' ? '产值': type=='sr' ? '收入' :type=='ls' ? '利税' :type=='lr' ? '利润' :''; vm.filter.type = type vm.loadTabCharts(); }, industryChange(val){ let obj = {}; obj = this.locations.find((item)=>{ return item.value === val; }); this.industryName = this.$Util.isEmpty(obj) ? '' : obj.name; }, searchResult(){ let _this = this _this.showCondition = false; _this.loadTabCharts(); }, loadTabCharts(){ /*this.drawLineOne('chartOne',['投产运营','工业企业','规上工业','上市公司','高新技术'],[12,334,344,333,787],[122,223,440,22,678],[2,22,34,45,88]); this.drawLine('chartTwo',['投产运营','工业企业','规上工业','上市公司','高新技术'],[12,334,344,333,787],[122,223,440,22,678],[2,22,34,45,88]); let t = [{name: "工业投资", value: 122},{name: "技术改造投资", value: 233},{name: "基础设施投资", value: 453}]; let legend=[]; t.forEach(function (item) { legend.push(item.name) }) this.drawPie("chartThree",t,legend)*/ let vm = this; let timeStart = !vm.$Util.isEmpty(vm.filter.startDate) ? vm.filter.startDate.split("-")[0] : null, timeEnd = !vm.$Util.isEmpty(vm.filter.endDate) ? vm.filter.endDate.split("-")[0] : null; if(timeStart == null || timeEnd== null || timeStart > timeEnd || timeStart <timeEnd){ let dataText = timeStart == null ? '请选择开始时间':timeEnd ==null ? '请选择结算时间':'支持查询同一年数据,请选择起止时间为同一年后查询!'; vm.$message({ showClose: true, message:dataText, type: 'warning' }); return; } vm.getTotalData(); vm.getOneData(); vm.getTwoData(); vm.getThreeData(); vm.getTableData(); }, getTotalData(){ let vm = this; vm.$http.get('/dx-economy-api/subject/gyjj/total',{params:{year:vm.year,industryCode:vm.filter.industryCode}}).then(function (resp) { let _data = resp.data; if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) { let t = resp.data.data vm.totalData = t; } }) }, getOneData(){ let vm = this; vm.$http.get('/dx-economy-api/subject/gyjj/industry',{params:vm.filter}).then(function (resp) { let _data = resp.data; if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) { let t = resp.data.data if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } vm.drawLineOne('chartOne', t.xAxis, t.value, t.value2); } }) }, getTwoData(){ let vm = this; vm.$http.get('/dx-economy-api/subject/gyjj/times',{params:vm.filter}).then(function (resp) { let _data = resp.data; if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) { let t = resp.data.data if(vm.filter.type=='ls'){ t.value = t.value.map(item=>{return (item*10).toFixed(2)}) } t.xAxis = t.xAxis.map(item=>item.split('-')[1].replace(/\b(0+)/gi,"")+'月') vm.drawLineOne('chartTwo', t.xAxis, t.value, t.value2); } }) }, getThreeData(){ let vm = this; vm.$http.get('/dx-economy-api/subject/gyjj/zdcyzb',{params:vm.filter}).then(function (resp) { let _data = resp.data; if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) { let t = resp.data.data let legend = []; t.forEach(function (item) { legend.push(item.name) }) vm.drawPie("chartThree", t, legend) } }) }, getTableData(){ let vm = this; vm.$http.get('/dx-economy-api/subject/gyjj/companyList',{params:$.extend({pageNum:1,pageSize:5},vm.filter)}).then(function (resp) { let _data = resp.data; if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) { let t = resp.data.data t.list.forEach(function (i, k) { i.valueTb = i.valueTb + '%'; }); vm.chartTable = t.list; } }) }, jumpToDetail(data){}, /*pop-table*/ morePageChange(currentPage){ this.getMoreTableData(currentPage) }, moreDataClick(){ this.getMoreTableData(1); this.dialogVisible = true }, getMoreTableData(pageNum){ let vm = this; let pageNums = vm.$Util.isEmpty(pageNum) ? vm.moreData.pageNum : pageNum; vm.$http.get('/dx-economy-api/subject/gyjj/companyList',{params:$.extend({pageSize:10,pageNum:pageNums},vm.filter)}).then(function (resp) { let _data = resp.data; if(_data.code === 200 && !vm.$Util.isEmpty(_data.data)) { let temp = resp.data.data; temp.list.forEach(function (i, k) { i.valueTb = i.valueTb + '%'; }); vm.moreData.list = temp.list; vm.moreData.pageNum = temp.pageNum; vm.moreData.total = temp.total; } }) }, /*pop-table -- end*/ drawLine(container,cate,d1,d2,d3){ let vm = this let myChart = vm.$echarts.init(document.getElementById(container)) let op = { xAxis: { type:"category", data: cate, axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}} }, yAxis:[ { type: 'value', name:'工业产值(万元)', minInterval: 10, nameTextStyle:{color:'rgba(255,255,255,.8)'}, axisLabel:{ color:'rgba(255,255,255,.8)', formatter: function (value) { let texts = []; if(value<1000){ texts.push(value) }else if(Math.ceil(value/1000)>=1&&Math.ceil(value/1000)<10){ texts.push(Math.ceil(value/1000) + "千") }else if(Math.ceil(value/10000)>=1&&Math.ceil(value/10000)<100){ texts.push(Math.ceil(value/10000) + "万") }else if(Math.ceil(value/1000000)>=1){ texts.push(Math.ceil(value/1000000) + "百万") } return value }}, axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, splitLine:{lineStyle:{color:'rgba(255,255,255,.1)'}} }, { type: 'value', name: '同比', minInterval: 100, nameTextStyle:{color:'rgba(255,255,255,.8)'}, axisLabel:{color:'rgba(255,255,255,.8)'}, axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, splitLine:{show:false} } ], series: [ { name: '工业产值', type: 'bar', color:"#6ee988", barMaxWidth:'20', data: d1,//[100,200,33,56,188,123,143,23,99],//res.zcz itemStyle: { color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: '#6ee988' // 0% 处的颜色 }, { offset: 1, color: '#6ee988' // 100% 处的颜色 }] } } }, { name: '工业产值', type: 'bar', color:"#16e1ff", barMaxWidth:'20', data: d2,//[100,200,33,56,188,123,143,23,99],//res.zcz itemStyle: { color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: '#16e1ff' // 0% 处的颜色 }, { offset: 1, color: '#16e1ff' // 100% 处的颜色 }] } } }, { name: '同比', type: 'line', yAxisIndex: 1, color:"#e0e63d", data: d3,//[10,20,30,44,77,55,66,22,100],//res.tb areaStyle: { color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: '#e0e63d' // 0% 处的颜色 }, { offset: 1, color: 'rgba(255,255,255,0)' // 100% 处的颜色 }] } } }] } myChart.setOption($.extend(true,op,vm.defaultOp)); if(container == "gytz") { myChart.on('click', function (param) { let _start = "",_end = ""; if(!vm.$Util.isEmpty(vm.timeFilter)){ if(vm.timeFilter.length === 1){ _start = vm.timeFilter[0]; }else if(vm.timeFilter.length === 2){ _start = vm.timeFilter[0]; _end = vm.timeFilter[1]; } } vm.$router.push({name: "gytz", params: {sDate: _start, eDate: _end}}) }) } }, drawLineOne(container,cate,d1,d2){ let vm = this let myChart = vm.$echarts.init(document.getElementById(container)) let op = { xAxis: { type:"category", data: cate, axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, axisLabel: { interval: 0, // 坐标轴刻度标签的显示间隔 // rotate: cate.length>5?40:0, // 标签倾斜的角度 } }, yAxis:[ { type: 'value', name:'总'+vm.unit, /*minInterval: 1,*/ nameTextStyle:{color:'rgba(255,255,255,.8)'}, axisLabel:{ color:'rgba(255,255,255,.8)', formatter: function (value) { let texts = []; if(value<1000){ texts.push(value) }else if(Math.ceil(value/1000)>=1&&Math.ceil(value/1000)<10){ texts.push(Math.ceil(value/1000) + "千") }else if(Math.ceil(value/10000)>=1&&Math.ceil(value/10000)<100){ texts.push(Math.ceil(value/10000) + "万") }else if(Math.ceil(value/1000000)>=1){ texts.push(Math.ceil(value/1000000) + "百万") } return value }}, axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, splitLine:{lineStyle:{color:'rgba(255,255,255,.1)'}} }, { type: 'value', name: '同比', /*minInterval: 1,*/ nameTextStyle:{color:'rgba(255,255,255,.8)'}, axisLabel:{color:'rgba(255,255,255,.8)'}, axisLine:{lineStyle:{color:'rgba(255,255,255,.3)'}}, splitLine:{show:false} } ], series: [ { name:'总'+vm.unit, type: 'bar', color:"#6ee988", barMaxWidth:'20', data: d1,//[100,200,33,56,188,123,143,23,99],//res.zcz itemStyle: { color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: '#6ee988' // 0% 处的颜色 }, { offset: 1, color: '#6ee988' // 100% 处的颜色 }] } } }, { name: '同比', type: 'line', yAxisIndex: 1, color:"#e0e63d", data: d2,//[10,20,30,44,77,55,66,22,100],//res.tb areaStyle: { color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: '#e0e63d' // 0% 处的颜色 }, { offset: 1, color: 'rgba(255,255,255,0)' // 100% 处的颜色 }] } } }] } myChart.setOption($.extend(true,op,vm.defaultOp)); /*if(container == "gytz") { myChart.on('click', function (param) { let _start = "",_end = ""; if(!vm.$Util.isEmpty(vm.timeFilter)){ if(vm.timeFilter.length === 1){ _start = vm.timeFilter[0]; }else if(vm.timeFilter.length === 2){ _start = vm.timeFilter[0]; _end = vm.timeFilter[1]; } } vm.$router.push({name: "gytz", params: {sDate: _start, eDate: _end}}) }) }*/ }, drawPie(container,data,legend){ let vm = this let myChart = vm.$echarts.init(document.getElementById(container)) let op = { tooltip: { trigger: 'item', formatter: "{a} <br/>{b}: {c} ({d}%)" }, color:['rgba(22,225,255,1)','rgba(22,225,255,0.4)','rgba(22,225,255,0.2)'], legend: { type: 'scroll', orient: 'vertical', x:"right", data:legend, textStyle:{color:"rgba(255,255,255,.8)"} }, series: [ { name:'主导产业工业'+vm.typeName+'占比', type:'pie', radius:['55%', '80%'], // minAngle: 30, center:['40%', '50%'], avoidLabelOverlap: false, label: {normal:{show:false}}, data:data } ] } myChart.setOption(op) /*myChart.on('click', function (param) { let _start = "",_end = ""; if(!vm.$Util.isEmpty(vm.timeFilter)){ if(vm.timeFilter.length === 1){ _start = vm.timeFilter[0]; }else if(vm.timeFilter.length === 2){ _start = vm.timeFilter[0]; _end = vm.timeFilter[1]; } } vm.$router.push({name:"jjyx",params:{sDate:_start,eDate:_end,bk:'',industry:param.name}}) })*/ }, } } </script> <style> .search-row-condition .el-date-editor .el-range-input{width:35%!important;} </style> <style scoped> </style>