| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734 |
- <!-- -->
- <template>
- <div class="mainDiv" style="background: rgb(243, 243, 246);height: 100%;padding:1vh">
- <el-row :gutter="5" class="left" style="margin-left:0;margin-right:0;">
- <el-col class="left_user" style="" :span="5">
- <Systemstatus
- :usersNum="usersNum"
- :grounpNum="grounpNum"
- ></Systemstatus>
- </el-col>
- <el-col class="middle" style="height:100%;" :span="14">
- <div class="middle_button">
- <HomeViewBar
- @barsType="barTypeChangeHandler"
- @globalTime="globalTimeHandler"
- :dczNum="dczStatisticsData.total"
- :dcyrNum="dcryStatisticsData.total"
- :dcdxNum="dcdxStatisticsData.total"
- :fxwtNum="fxwtStatisticsData.total"
- ></HomeViewBar>
- </div>
- </el-col>
- <el-col class="right" style="height:100%;" :span="5">
- <div class="right_qus">
- <QuestionCount
- @rightQustionTimeLimit="rightQustionTimeLimit"
- :qustionsCountNums="qustionsCountNums"
- ></QuestionCount>
- </div>
- </el-col>
- </el-row>
- <el-row :gutter="5" style="margin-left:0;margin-right:0;margin-top:5px;height:85vh;">
- <el-col style="height:100%;" :span="5">
- <el-row class="left" style="margin:0 0 0 0;">
- <div class="left_qusLineChart">
- <PublicSentiment></PublicSentiment>
- </div>
- </el-row>
- <el-row class="left" style="margin:5px 0 0 0;">
- <div class="left_notices">
- <Notices @showAnnouncement="showAnnouncementHandler"></Notices>
- </div>
- </el-row>
- </el-col>
- <el-col class="middle" style="height:100%;" :span="14">
- <div class="middle_map">
- <CenterMap
- @OrgListsEventToMainView="OrgListsEventToMainViewEvent"
- @DctypeListsEventToMainView="DctypeListsEventToMainViewEvent"
- @mapClick="mapClickHandler"
- :barsChooseType="barsChooseType"
- :barsChooseUnit="barsChooseUnit"
- :dczLists="dczLists"
- :transferUseLists="transferUseLists"
- :mapData="GlobalCenterMapUseData"
- :requestEntmTime="requestEntmTime"
- :requestOrgId="requestOrgId"
- :requestObjectType="requestObjectType"
- :requestSttmTime="requestSttmTime"
- :mapTitleFocusName="mapTitleFocusName"
- :mapPointColor="mapPointColor"
- >
- </CenterMap>
- </div>
- </el-col>
- <el-col style="height:100%;" :span="5">
- <el-row class="right" style="margin:0 0 0 0;">
- <div class="right_line" >
- <QuestionLineChart
- @trendLineChartType="trendLineChartTypeHandler"
- :GlobalSttmTime="GlobalSttmTime"
- :GlobalEntmTime="GlobalEntmTime"
- :xData="xData"
- :yData="yData"
- ></QuestionLineChart>
- </div>
- </el-row>
- <el-row class="right" style="margin:5px 0 0 0;">
- <div class="right_pie_dcdx">
- <FinishRate
- :finishNumber="finishRateData.finishedCount"
- :unfinishNumber="finishRateData.unfinishedCount"></FinishRate>
- </div>
- </el-row>
- <el-row class="right" style="margin:5px 0 0 0;">
- <div class="right_pie_wtfb">
- <ProblemPieChart
- :levelone="problemLevelStatisticsData.levelOne"
- :leveltwo="problemLevelStatisticsData.levelTwo"
- :levelthree="problemLevelStatisticsData.levelThree"
- levelfour="0"></ProblemPieChart>
- </div>
- </el-row>
- </el-col>
- </el-row>
- <!--督查组dialog-->
- <el-dialog :title="dcdxTitle + '督查组'" :visible.sync="dczVisible" :close-on-click-modal="false" width="40%">
- <DczDetails
- v-if="dczVisible"
- :adCode="dcdxAdcode"
- :requestEntmTime="requestEntmTime"
- :requestOrgId="requestOrgId"
- :requestSttmTime="requestSttmTime"
- :requestObjectType="requestObjectType"></DczDetails>
- </el-dialog>
- <!--督查人员dialog-->
- <el-dialog :title="dcdxTitle + '督查人员'" :visible.sync="dcryVisible" :close-on-click-modal="false" width="40%">
- <DcryDetails
- v-if="dcryVisible"
- :adCode="dcdxAdcode"
- :requestEntmTime="requestEntmTime"
- :requestOrgId="requestOrgId"
- :requestSttmTime="requestSttmTime"
- :requestObjectType="requestObjectType"></DcryDetails>
- </el-dialog>
- <!--督查对象dialog-->
- <el-dialog :title="dcdxTitle + '督查对象'" :visible.sync="dcdxVisible" :close-on-click-modal="false" width="40%">
- <DcdxDetails
- v-if="dcdxVisible"
- :adCode="dcdxAdcode"
- :requestEntmTime="requestEntmTime"
- :requestOrgId="requestOrgId"
- :requestSttmTime="requestSttmTime"
- :requestObjectType="requestObjectType"></DcdxDetails>
- </el-dialog>
- <!--发现问题dialog-->
- <el-dialog :title="dcdxTitle + '问题详情'" :visible.sync="fxwtVisible" :close-on-click-modal="false" width="40%">
- <FxwtDetails
- v-if="fxwtVisible"
- :adCode="dcdxAdcode"
- :requestEntmTime="requestEntmTime"
- :requestOrgId="requestOrgId"
- :requestSttmTime="requestSttmTime"
- :requestObjectType="requestObjectType">
- </FxwtDetails>
- </el-dialog>
- <el-dialog title="公告" :visible.sync="showAnnouncement" :close-on-click-modal="false" width="40%">
- <div style="display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;min-height:200px;">
- <div style="display:flex;flex-direction:row;justify-content:center;align-items:center">
- <h1>{{announcementItem.title}}</h1>
- </div>
- <div style="display:flex;flex-direction:row;justify-content:center;align-items:center;color:gray;margin-top:20px;">
- <p>{{announcementItem.persNm}}</p>
- <p style="margin-left:10px;">{{announcementItem.orgNm}}</p>
- <p style="margin-left:10px;">{{showStrDate(announcementItem.pubTm)}}</p>
- </div>
- <div style="display:flex;flex-direction:row;justify-content:flex-start;align-items:stretch;padding:15px;">
- <p v-html="announcementItem.content"></p>
- </div>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
- //例如:import 《组件名称》 from '《组件路径》';
- import echarts from "echarts";
- import axios from 'axios' //引入axios
- //左侧组件
- import Systemstatus from "./Systemstatus"; //左侧用户和组现在情况
- import Notices from "./Notices"; //左侧公告
- import PublicSentiment from "./PublicSentiment"; //舆情信息
- //中部组件
- import HomeViewBar from "./HomeViewBar"; //地图上方按钮
- import CenterMap from "./CenterMap"; //地图上方按钮
- //右侧组件
- import QuestionCount from "./QuestionCount"; //右侧日周月问题统计
- import QuestionLineChart from "./QuestionLineChart"; //右侧趋势
- import FinishRate from "./FinishRate"; //右侧督查对象
- import ProblemPieChart from "./ProblemPieChart"; //右侧问题分布
- import DcdxDetails from "./DcdxDetails";//督查对象地图详情
- import FxwtDetails from "./FxwtDetails";//发现问题地图详情
- import DczDetails from "./DczDetails";//督查组地图详情
- import DcryDetails from "./DcryDetails";//督查人员地图详情
- //方法引用脚本
- import request from "@util/gw_ajax_request.js";
- import {dateFormat} from "@util/gw_date.js"
- import {
- BarsDczNums,
- BarsDcyrNums,
- BarsDcdxNums,
- BarsFxwtNums,
- userAndGroup,//获取指定条件全部督查对象计数
- getcountPlan,//获取指定条件全部督查对象计数
- getProblemCountByProAndLevel,
- getAddvCountGroup,
- getAddvCountPerson,
- getAddvCountObject,
- getAddvCountProblem,
- getTrendLineData,
- getQustionCountData,
- } from "../../api/homeMainView.js";
- export default {
- //import引入的组件需要注入到对象中才能使用
- components: {
- Systemstatus,
- QuestionCount,
- QuestionLineChart,
- Notices,
- HomeViewBar,
- CenterMap,
- PublicSentiment,
- FinishRate,
- ProblemPieChart,
- DcdxDetails,
- FxwtDetails,
- DczDetails,
- DcryDetails
- },
- props: [],
- data() {
- //这里存放数据
- return {
- transformScale:1,
- showAnnouncement:false,
- announcementItem:{
- "id": "c2219c04336a46bd92163bf0463a773e",
- "type": null,
- "title": "测试",
- "content": "<p>测试</p>",
- "url": null,
- "note": null,
- "persId": "89E69B31FE1344A98316A0153BA7386C",
- "persNm": "王晓辰",
- "orgId": "041",
- "orgNm": "北京金水公司",
- "pubState": "0",
- "pubTm": null,
- "intm": 1561363050000,
- "uptm": 1561363050000
- },
- dczStatisticsData:{//督查组相关统计数据,包括总数、类别分异、行政区分异
- total:0,
- byObjectType:[],
- byAddv:[],
- },
- dcryStatisticsData:{//督查人力相关统计数据,包括总数、类别分异、行政区分异
- total:0,
- byObjectType:[],
- byAddv:[],
- },
- dcdxStatisticsData:{//督查对象相关统计数据,包括总数、类别分异、行政区分异
- total:0,
- byObjectType:[],
- byAddv:[],
- },
- fxwtStatisticsData:{//问题相关统计数据,包括总数、类别分异、行政区分异
- total:0,
- byObjectType:[],
- byAddv:[],
- },
- finishRateData:{//督查完成率
- total:0,
- finishedCount:0,
- unfinishedCount:0,
- },
- problemLevelStatisticsData:{
- levelOne:0,
- levelTwo:0,
- levelThree:0,
- total:0,
- },
- rightTimeLimit: '',//趋势线图点选的是日、月、周
- qustionsCountNums: '',//右侧问题统计数据
- pblmStateForLine:'',//趋势线是增量、累计
- yData:[],//右侧趋势图用Y轴数据
- xData:[],//右侧趋势图用X轴数据
- GlobalSttmTime: '',//用于响应用户时间筛选,记录用户的开始时间
- GlobalEntmTime: '',//用于响应用户时间筛选,记录用户的结束时间
- GlobalOrgIds:[],//用于响应并记录用户所点选的筛选机构id
- GlobalObjectType:[],//用于响应并记录用户所点选的督查类型
- GlobalAdCode:'',//用于响应并记录用户点选行政区,进行下钻所使用的行政区划代码
- GlobalFocusType:'dcz',//用于响应用户切换关注点,督查组 督查人员 督查对象 发现问题 默认是督查组。
- mapTitleFocusName:'督查组',//用于地图关注焦点的点选title名称
- mapPointColor:'#51afea',//用于地图关注焦点数字气泡颜色
- barsChooseUnit:'组',
- GlobalCenterMapUseData:[],
- barsChooseType:'',
- dczLists:[],
- usersNum:0,
- grounpNum:0,
- transferUseLists:[],//传递地图左侧督查对象列表数据至CenterMap组件
- dcdxTitle: '',
- dcdxVisible: false,
- dcdxAdcode: '',
- fxwtTitle: '',
- fxwtVisible: false,
- dczVisible: false,
- dcryVisible:false
- };
- },
- //监听属性 类似于data概念
- computed: {
- requestAdCode:function(){
- if(this.GlobalAdCode){
- console.log("首页computed变化监听:查询行政区划代码为:"+this.GlobalAdCode);
- return this.GlobalAdCode;
- }else{
- return '';
- }
- },
- requestSttmTime:function(){//全局请求使用的开始时间参数,逻辑为用户未填写按照当年1月1日开始,填写后使用填写值
- if(this.GlobalSttmTime){
- console.log("首页computed变化监听:查询开始时间为:"+this.GlobalSttmTime);
- return this.GlobalSttmTime;
- }else{
- console.log("首页computed变化监听:查询开始时间为:"+dateFormat(new Date(),'yyyy-01-01'));
- return dateFormat(new Date(),'yyyy-01-01');
- }
- },
- requestEntmTime:function(){//全局请求使用的结束时间参数,逻辑为用户未填写按照当当天当时,填写后使用填写值
- if(this.GlobalEntmTime){
- console.log("首页computed变化监听:查询开始时间为:"+this.GlobalEntmTime);
- return this.GlobalEntmTime;
- }else{
- console.log("首页computed变化监听:查询开始时间为:"+dateFormat(new Date(),'yyyy-MM-dd'));
- return dateFormat(new Date(),'yyyy-MM-dd');
- }
- },
- requestOrgId:function(){//全局请求使用的多机构查询字符串,默认为''代表全选
- // 判断是否有选中的机构id,如果没有默认一个查询条件(目前为'')
- if(this.GlobalOrgIds&&this.GlobalOrgIds.length>0){
- return this.GlobalOrgIds.join(',');
- }else{
- return '';
- }
- },
- requestObjectType:function(){//全局请求使用的多督查对象类型查询字符串,默认为''代表全选
- if(this.GlobalObjectType&&this.GlobalObjectType.length>0){
- return this.GlobalObjectType.join(',');
- }else{
- return '';
- }
- },
- lineUseSttmTime:function(){//问题趋势折线使用的查询开始时间
- return this.GlobalSttmTime;
- },
- lineUseEntmTime:function(){//问题趋势折线使用的查询结束时间
- return this.GlobalEntmTime;
- },
- },
- //监控data中的数据变化
- watch: {
- rightTimeLimit(newValue,oldValue){
- this.rightTimeLimit = newValue;
- this.rightQustionLine();
- },
- pblmStateForLine(newValue,oldValue){
- this.pblmStateForLine = newValue;
- this.rightQustionLine();
- },
- requestSttmTime:function(){// 查询时间变化基本影响全局数据变化
- this.getDynamicDataRefresh();
- this.getLeftMap();
- },
- requestEntmTime:function(){// 查询时间变化基本影响全局数据变化
- this.getDynamicDataRefresh();
- this.getLeftMap();
- },
- requestOrgId:function(){// 查询机构变化基本影响全局数据变化
- this.getDynamicDataRefresh();
- this.getLeftMap();
- this.rightQustionLine();
- },
- requestObjectType:function(){// 查询对象变化基本影响全局数据变化
- this.getDynamicDataRefresh();
- this.getLeftMap();
- this.rightQustionLine();
- },
- GlobalFocusType(newValue,oldValue){//关注点变化主要影响 按类型分异的数据、单位 还有中央的行政区分布图
- this.GlobalFocusType = newValue;
- this.getDynamicDataRefresh();
- this.getLeftMap();
- this.getAddVcdCountByType();//切换行政区划分布数据
- },
- lineUseSttmTime:function(){//全局开始时间对趋势图影响
- this.rightQustionLine();
- },
- lineUseEntmTime:function(){//全局结束时间对趋势图影响
- this.rightQustionLine();
- },
- },
- //方法集合
- methods: {
- showStrDate:function(pubTm){
- let d = new Date(pubTm);
- return dateFormat(d,'yyyy-MM-dd');
- },
- showAnnouncementHandler:function(params){
- this.showAnnouncement = true;
- this.announcementItem = params.announcement.item;
- },
- getLeftMap(){
- var _self = this;
- let searchParmas = {
- endTime: this.requestEntmTime,
- orgIds: this.requestOrgId,
- startTime: this.requestSttmTime
- };
- axios.all([BarsDczNums(searchParmas),BarsDcyrNums(searchParmas),BarsDcdxNums(searchParmas),BarsFxwtNums(searchParmas)]).then(
- axios.spread(function (dcz,dcry,dcdx,fxwt) {
- _self.dczStatisticsData.byObjectType = dcz.data;
- _self.dcryStatisticsData.byObjectType = dcry.data;
- _self.dcdxStatisticsData.byObjectType = dcdx.data;
- _self.fxwtStatisticsData.byObjectType = fxwt.data;
- if(_self.GlobalFocusType === 'dcz'){
- _self.transferUseLists = _self.dczStatisticsData.byObjectType;
- }else if(_self.GlobalFocusType === 'dcry'){
- _self.transferUseLists = _self.dcryStatisticsData.byObjectType;
- }else if(_self.GlobalFocusType === 'dcdx'){
- _self.transferUseLists = _self.dcdxStatisticsData.byObjectType;
- }else{
- _self.transferUseLists = _self.fxwtStatisticsData.byObjectType;
- }
- }));
- },
- getBarsDczNum() { //四个按钮数据请求
- var _self = this;
- let searchParmas = {
- endTime: this.requestEntmTime,
- orgIds: this.requestOrgId,
- pTypes: this.requestObjectType,
- startTime: this.requestSttmTime
- };
- axios.all([BarsDczNums(searchParmas),BarsDcyrNums(searchParmas),BarsDcdxNums(searchParmas),BarsFxwtNums(searchParmas)]).then(
- axios.spread(function (dcz,dcry,dcdx,fxwt) {
- // 四个请求现在都执行完成
- //存储对象类别分异原始结果
- _self.dczStatisticsData.byObjectType = dcz.data;
- _self.dcryStatisticsData.byObjectType = dcry.data;
- _self.dcdxStatisticsData.byObjectType = dcdx.data;
- _self.fxwtStatisticsData.byObjectType = fxwt.data;
- // if(_self.GlobalFocusType === 'dcz'){
- // _self.transferUseLists = _self.dczStatisticsData.byObjectType;
- // }else if(_self.GlobalFocusType === 'dcry'){
- // _self.transferUseLists = _self.dcryStatisticsData.byObjectType;
- // }else if(_self.GlobalFocusType === 'dcdx'){
- // _self.transferUseLists = _self.dcdxStatisticsData.byObjectType;
- // }else{
- // _self.transferUseLists = _self.fxwtStatisticsData.byObjectType;
- // }
- //计算总数统计 供给抬头显示
- _self.dczStatisticsData.total = _self.countSum(_self.dczStatisticsData.byObjectType,'total');
- _self.dcryStatisticsData.total = _self.countSum(_self.dcryStatisticsData.byObjectType,'total');
- _self.dcdxStatisticsData.total = _self.countSum(_self.dcdxStatisticsData.byObjectType,'total');
- _self.fxwtStatisticsData.total = _self.countSum(_self.fxwtStatisticsData.byObjectType,'total');
- //赋值并计算督查对象完成率相关
- _self.finishRateData.finishedCount = _self.dcdxStatisticsData.total ;
- _self.finishRateData.unfinishedCount = _self.finishRateData.total - _self.finishRateData.finishedCount;
- }));
- //督查组
- },
- //获取在线人数及所在督查组
- getUsersAndGroup() {
- var _this = this;
- userAndGroup({}).then(res => {
- _this.usersNum = res.data.countPers;
- _this.grounpNum = res.data.countGroup;
- });
- },
- // upDateDynamicDataByStep:function(){
- // // let _self = this;
- // // function *generatorUpdate(){
- // // yield console.log('更新头部');
- // // yield console.log('更新地图');
- // // yield console.log('更新折线');
- // // yield console.log('更新饼状图1');
- // // yield console.log('更新饼状图2');
- // // };
- // // let gu = generatorUpdate();
- // // setInterval(function(){
- // // gu.next();
- // // },5000);
- // },
- getDynamicDataRefresh:function(){
- // 时间、机构、对象类别的变化不影响系统状态与公告。所以单独抽出动态数据的请求。
- let _self = this;
- function *generatorGetTheData(){
- console.log('头部数据跟项分类');
- _self.getHeaderBarsDataAndObjectTypeCount();//头部数据跟项分类
- yield console.log('督查对象总数'); _self.getPlanCount();//督查对象总数
- yield console.log('问题严重程度分布'); _self.getProblemLevelCount();//问题严重程度分布
- yield console.log('问题线图'); _self.rightQustionLine();//问题线图
- yield console.log('问题累计图'); _self.rightQustionCount();//问题累计图
- yield _self.getAddVcdCountByType();//行政区划分布
- }
- let gu = generatorGetTheData();
- setInterval(function(){
- gu.next();
- },500);
- },
- getAllDataRefresh:function(){
- this.getLeftMap();
- this.getUsersAndGroup();
- this.getDynamicDataRefresh();
- },
- getPlanCount:function(){//获取计划督查对象总数 并计算完成率
- let _self = this;
- _self.finishRateData.total = 0;
- getcountPlan(this.requestEntmTime,this.requestOrgId,this.requestObjectType,this.requestSttmTime).then((res)=>{
- if(res.data&&res.data.length>0){
- let result = 0;
- res.data.forEach((item)=>{
- result += Number(item['total']);
- });
- _self.finishRateData.total = result;
- _self.finishRateData.unfinishedCount = _self.finishRateData.total - _self.finishRateData.finishedCount;
- }
- });
- },
- getProblemLevelCount:function(){//获取问题严重程度分异数据
- let _self = this;
- _self.problemLevelStatisticsData.levelOne = 0;
- _self.problemLevelStatisticsData.levelTwo = 0;
- _self.problemLevelStatisticsData.levelThree = 0;
- getProblemCountByProAndLevel(this.requestEntmTime,this.requestOrgId,this.requestObjectType,this.requestSttmTime).then((res)=>{
- let addvData = [];
- if(res.data&&res.data.length>0){
- res.data.forEach((item)=>{
- let singleAddvData = {
- 'adName':item.name,
- 'total':0,
- 'eachLevelData':[],
- };
- item.pblmDtoList.forEach((inspPblm)=>{
- singleAddvData.total += inspPblm.total;
- singleAddvData.eachLevelData.push({'level':inspPblm.inspPblmCate,'count':inspPblm.total});
- switch(inspPblm.inspPblmCate){
- case '0':_self.problemLevelStatisticsData.levelOne += inspPblm.total;break;
- case '1':_self.problemLevelStatisticsData.levelTwo += inspPblm.total;break;
- case '2':_self.problemLevelStatisticsData.levelThree += inspPblm.total;break;
- }
- });
- });
- }
- });
- },
- getAddVcdCountByType:function(){
- let _self = this;
- if(this.GlobalFocusType=='dcz'){//督查组
- getAddvCountGroup(this.requestEntmTime,this.requestOrgId,this.requestObjectType,this.requestSttmTime).then((res)=>{
- console.log(res);
- _self.dczStatisticsData.byAddv = res.data;
- _self.GlobalCenterMapUseData = _self.dczStatisticsData.byAddv;
- });
- }else if(this.GlobalFocusType=='dcry'){//督查人员
- getAddvCountPerson(this.requestEntmTime,this.requestOrgId,this.requestObjectType,this.requestSttmTime).then((res)=>{
- console.log(res);
- _self.dcryStatisticsData.byAddv = res.data;
- _self.GlobalCenterMapUseData = _self.dcryStatisticsData.byAddv;
- });
- }else if(this.GlobalFocusType=='dcdx'){//督查对象
- getAddvCountObject(this.requestEntmTime,this.requestOrgId,this.requestObjectType,this.requestSttmTime).then((res)=>{
- console.log(res);
- _self.dcdxStatisticsData.byAddv = res.data;
- _self.GlobalCenterMapUseData = _self.dcdxStatisticsData.byAddv;
- });
- }else{//发现问题
- getAddvCountProblem(this.requestEntmTime,this.requestOrgId,this.requestObjectType,this.requestSttmTime).then((res)=>{
- console.log(res);
- _self.fxwtStatisticsData.byAddv = res.data;
- _self.GlobalCenterMapUseData = _self.fxwtStatisticsData.byAddv;
- });
- }
- },
- getHeaderBarsDataAndObjectTypeCount:function(){
- this.getBarsDczNum();
- },
- updateByOrder:function(){},
- //获取右侧QuestionLineChart组件数据
- getRightLineData(){
- var _this = this;
- let searchParmas = {
- adCode: this.requestEntmTime,
- orgIds: this.requestOrgId,
- pTypes: this.requestObjectType,
- startTime: this.requestSttmTime
- };
- },
- //获取HomeViewBar组件上传的督查类别
- barTypeChangeHandler(item) {
- this.GlobalFocusType = item.id;
- this.barsChooseUnit = item.unit;
- this.mapTitleFocusName = item.spanName;//地图title用的,选中的四个bar中的其一名称
- this.mapPointColor = item.mapPointColor;//地图上的圆形小标记数字颜色
- },
- //获取HomeViewBar组件上传的全局查询时间
- globalTimeHandler(item) {
- this.GlobalSttmTime = item.sttm;
- this.GlobalEntmTime = item.entm;
- },
- //获取右侧QuestionCount组件点击后时间范围
- rightQustionTimeLimit(item){
- this.rightTimeLimit = item;
- },
- //获取右侧QuestionCount组件点选图标类型
- trendLineChartTypeHandler(item){
- this.pblmStateForLine = item;
- },
- //获取右侧QuestionLineChart数据
- rightQustionLine(){
- let _self = this;
- getTrendLineData('',this.rightTimeLimit,this.requestOrgId,this.pblmStateForLine,this.lineUseSttmTime,this.lineUseEntmTime,this.requestObjectType).then((res)=>{
- var dataList = res.data;
- var exData = [];
- var eyData = [];
- if(this.rightTimeLimit == 'day'){
- dataList.forEach(element => {
- exData.push(element.name + '日');
- eyData.push(element.value);
- })
- }else if(this.rightTimeLimit == 'week'){
- dataList.forEach(element => {
- exData.push(element.name);
- eyData.push(element.value);
- })
- }else{
- dataList.forEach(element => {
- exData.push(element.name + '月');
- eyData.push(element.value);
- })
- }
- _self.xData = exData;
- _self.yData = eyData;
- });
- },
- //获取右侧QuestionCount数据
- rightQustionCount(){
- let _self = this;
- getQustionCountData().then((res)=>{
- this.qustionsCountNums = res.data;
- });
- },
- //接收CenterMap的流域机构id
- OrgListsEventToMainViewEvent(item){
- //alert('这是mainView接收到的' + item);
- this.GlobalOrgIds = item;
- },
- DctypeListsEventToMainViewEvent(item){
- //alert('这是mainView接收到的' + item);
- this.GlobalObjectType = item;
- },
- countSum:function(arr,valueNameToSum){//根据arr中元素指定属性()求和 后续抽离到util中
- let result = 0;
- if(arr&&arr.length>0){
- if(valueNameToSum&&valueNameToSum!=''){//如果不传递valueNameToSum考虑数组arr中都是基本字面量
- // 数组是基本字面量
- arr.forEach(item=>{
- result += Number(item[valueNameToSum]);
- });
- }else{
- // 数组是基本字面量
- arr.forEach(item=>{
- result += Number(item);
- });
- }
- }else{
- result = 0;
- }
- return result;
- },
- mapClickHandler:function(params){
- console.log(params);
- console.log('homeMainView监听mapClick'+params.onClickAdCode);
- this.dcdxAdcode = params.onClickAdCode;
- this.dcdxTitle = params.onClickAdName
- var _self = this;
- if(_self.GlobalFocusType == 'dcz'){
- _self.dczVisible = true;
- }else if(_self.GlobalFocusType == 'dcry'){
- _self.dcryVisible = true;
- }else if(_self.GlobalFocusType == 'dcdx'){
- _self.dcdxVisible = true;
- }else{
- _self.fxwtVisible = true;
- }
- },
- autoSetScale() {
- let zoom = (window.innerHeight / 1080).toFixed(3)
- this.transformScale = `scale(${zoom})`
- this.width = `${(window.innerWidth * zoom).toFixed(2)}px`
- }
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- created() {},
- //生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {
- this.getAllDataRefresh();
- // alert(window.innerWidth);
- // alert(window.innerHeight);
- // this.upDateDynamicDataByStep();
- // this.getTrend();
- },
- beforeCreate() {}, //生命周期 - 创建之前
- beforeMount() {}, //生命周期 - 挂载之前
- beforeUpdate() {}, //生命周期 - 更新之前
- updated() {}, //生命周期 - 更新之后
- beforeDestroy() {}, //生命周期 - 销毁之前
- destroyed() {}, //生命周期 - 销毁完成
- activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
- };
- </script>
- <style lang="scss">
- @import "@scss/homeForPad";
- </style>
|