| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844 |
- <!-- -->
- <template>
- <div class="mainDiv" style="height:100%;" :style="backgroundChangeColor">
- <!-- 左侧组件 -->
- <!-- <el-button type="text" @click="showPicPanel">pic</el-button> -->
- <div class="left">
- <div class="left_user">
- <Systemstatus
- :usersNum="usersNum"
- :grounpNum="grounpNum"
- ></Systemstatus>
- </div>
- <div class="left_qusLineChart">
- <PublicSentiment></PublicSentiment>
- </div>
- <div class="left_notices">
- <Notices @showAnnouncement="showAnnouncementHandler"></Notices>
- </div>
- </div>
- <!-- 中部组件 -->
- <div class="middle">
- <div class="middle_button">
- <!-- homeViewBar为首页上方的四个总和计数块,目前版本负责全局的时间参数、与当前关注数据类型 两个属性的控制 -->
- <HomeViewBar
- @barsType="barTypeChangeHandler"
- @globalTime="globalTimeHandler"
- :dczNum="dczStatisticsData.total"
- :dcyrNum="dcryStatisticsData.total"
- :dcdxNum="dcdxStatisticsData.total"
- :fxwtNum="fxwtStatisticsData.total"
- :jbyywtNum="jbyywtStatisticsData.total"
- ></HomeViewBar>
- </div>
- <div class="middle_map">
- <CenterMap
- @globalTime="globalTimeHandler"
- @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>
- <div class="middle_bar">
- <Centerbar
- :mapTitleFocusName="mapTitleFocusName"
- :barData="GlobalCenterMapUseData"
- :barStartColor="barStartColor"
- :barEndColor="barEndColor"
- :barsChooseUnit="barsChooseUnit">
- </Centerbar>
- </div>
- </div>
- <!-- 右侧组件 -->
- <div class="right">
- <div class="right_qus">
- <QuestionCount
- @rightQustionTimeLimit="rightQustionTimeLimit"
- :qustionsCountNums="qustionsCountNums"
- ></QuestionCount>
- </div>
- <div class="right_line">
- <QuestionLineChart
- @trendLineChartType="trendLineChartTypeHandler"
- :GlobalSttmTime="GlobalSttmTime"
- :GlobalEntmTime="GlobalEntmTime"
- :xData="xData"
- :yData="yData"
- ></QuestionLineChart>
- </div>
- <div class="right_pie_dcdx">
- <FinishRate
- :finishNumber="finishRateData.finishedCount"
- :unfinishNumber="finishRateData.unfinishedCount"></FinishRate>
- </div>
- <div class="right_pie_wtfb">
- <ProblemPieChart
- :levelone="problemLevelStatisticsData.levelOne"
- :leveltwo="problemLevelStatisticsData.levelTwo"
- :levelthree="problemLevelStatisticsData.levelThree"
- levelfour="0"></ProblemPieChart>
- </div>
- </div>
- <!--督查组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 v-html="announcementItem.content" class="ql-editor">
- <!-- <p ></p> -->
- </div>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
- //例如:import 《组件名称》 from '《组件路径》';
- import echarts from "echarts";
- // import theme from '../../store/theme'
- // import theme from '../../store/theme'
- 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 Centerbar from "./Centerbar"; //地图下方柱状图
- //右侧组件
- 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,
- BarsFxwtReportNums,
- userAndGroup,//获取指定条件全部督查对象计数
- getcountPlan,//获取指定条件全部督查对象计数
- getProblemCountByProAndLevel,
- getAddvCountGroup,
- getAddvCountPerson,
- getAddvCountObject,
- getAddvCountProblem,
- getAddvCountProblemForReport,
- getTrendLineData,
- getQustionCountData,
- } from "../../api/homeMainView.js";
- export default {
- //import引入的组件需要注入到对象中才能使用
- components: {
- Systemstatus,
- QuestionCount,
- QuestionLineChart,
- Notices,
- HomeViewBar,
- CenterMap,
- Centerbar,
- PublicSentiment,
- FinishRate,
- ProblemPieChart,
- DcdxDetails,
- FxwtDetails,
- DczDetails,
- DcryDetails,
- },
- props: [],
- data() {
- //这里存放数据
- return {
- backgroundChangeColor: 'background: rgba(255, 255, 255,1);',
- 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: [],
- },
- jbyywtStatisticsData: {//问题相关统计数据,包括总数、类别分异、行政区分异
- 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: '#13C5A6',//用于地图关注焦点数字气泡颜色
- barStartColor: '#76E9C0',
- barEndColor: '#13C4B8',
- barsChooseUnit: '组',
- GlobalCenterMapUseData: [],
- barsChooseType: '',
- dczLists: [],
- usersNum: 0,
- grounpNum: 0,
- transferUseLists: [],//传递地图左侧督查对象列表数据至CenterMap组件
- dcdxTitle: '',
- dcdxVisible: false,
- dcdxAdcode: '',
- fxwtTitle: '',
- fxwtVisible: false,
- dczVisible: false,
- dcryVisible: false
- };
- },
- //监听属性 类似于data概念
- computed: {
- // showPicPanel(){
- // this.$router.push('/picPanel');
- // },
- requestQuote() {
- if (this.GlobalFocusType == 'jbyywt') {
- return "1";
- } else {
- return "";
- }
- },
- msg() {
- // return theme.state.testMsg;
- return this.$store.state.theme.testMsg;
- },
- 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 '';
- // }
- if (this.GlobalObjectType) {
- return this.GlobalObjectType;
- } else {
- return '';
- }
- },
- lineUseSttmTime: function () {//问题趋势折线使用的查询开始时间
- return this.GlobalSttmTime;
- },
- lineUseEntmTime: function () {//问题趋势折线使用的查询结束时间
- return this.GlobalEntmTime;
- },
- yqListsEvent(item) {
- this.$emit('yqLists', item);
- },
- },
- //监控data中的数据变化
- watch: {
- msg(n, o) {
- if (n == 'dark') {
- this.backgroundChangeColor = 'background: linear-gradient(#1C204D, #0F067D);';
- } else {
- this.backgroundChangeColor = 'background: rgba(255, 255, 255,1);';
- }
- window.document.documentElement.setAttribute('data-theme', n);
- },
- 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
- };
- let searchParmasForReportqustions = {
- endTime: this.requestEntmTime,
- orgIds: this.requestOrgId,
- startTime: this.requestSttmTime,
- quote: this.requestQuote,
- };
- axios.all([BarsDczNums(searchParmas), BarsDcyrNums(searchParmas), BarsDcdxNums(searchParmas), BarsFxwtNums(searchParmas), BarsFxwtReportNums(searchParmasForReportqustions)]).then(
- axios.spread(function (dcz, dcry, dcdx, fxwt, jbyywt) {
- _self.dczStatisticsData.byObjectType = dcz.data;
- _self.dcryStatisticsData.byObjectType = dcry.data;
- _self.dcdxStatisticsData.byObjectType = dcdx.data;
- _self.fxwtStatisticsData.byObjectType = fxwt.data;
- _self.jbyywtStatisticsData.byObjectType = jbyywt.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 if (_self.GlobalFocusType === 'fxwt') {
- _self.transferUseLists = _self.fxwtStatisticsData.byObjectType;
- } else {
- _self.transferUseLists = _self.jbyywtStatisticsData.byObjectType;
- }
- }));
- },
- getBarsDczNum() { //四个按钮数据请求
- var _self = this;
- let searchParmas = {
- endTime: this.requestEntmTime,
- orgIds: this.requestOrgId,
- pTypes: this.requestObjectType,
- startTime: this.requestSttmTime
- };
- let searchParmasForReportqustions = {
- endTime: this.requestEntmTime,
- orgIds: this.requestOrgId,
- pTypes: this.requestObjectType,
- startTime: this.requestSttmTime,
- quote: '1',
- };
- axios.all([BarsDczNums(searchParmas), BarsDcyrNums(searchParmas), BarsDcdxNums(searchParmas), BarsFxwtNums(searchParmas), BarsFxwtReportNums(searchParmasForReportqustions)]).then(
- axios.spread(function (dcz, dcry, dcdx, fxwt, jbyywt) {
- // 四个请求现在都执行完成
- //存储对象类别分异原始结果
- _self.dczStatisticsData.byObjectType = dcz.data;
- _self.dcryStatisticsData.byObjectType = dcry.data;
- _self.dcdxStatisticsData.byObjectType = dcdx.data;
- _self.fxwtStatisticsData.byObjectType = fxwt.data;
- _self.jbyywtStatisticsData.byObjectType = jbyywt.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.jbyywtStatisticsData.total = _self.countSum(_self.jbyywtStatisticsData.byObjectType, 'total');
- //赋值并计算督查对象完成率相关
- // _self.finishRateData.finishedCount = _self.dcdxStatisticsData.total ;
- _self.finishRateData.unfinishedCount = _self.dcdxStatisticsData.total - _self.finishRateData.total;
- }));
- //督查组
- },
- //获取在线人数及所在督查组
- 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.finishedCount = _self.finishRateData.total;
- _self.finishRateData.unfinishedCount = _self.finishRateData.finishedCount - _self.finishRateData.total;
- }
- });
- },
- 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 if (this.GlobalFocusType == 'fxwt') {//发现问题
- getAddvCountProblem(this.requestEntmTime, this.requestOrgId, this.requestObjectType, this.requestSttmTime).then((res) => {
- console.log(res);
- _self.fxwtStatisticsData.byAddv = res.data;
- _self.GlobalCenterMapUseData = _self.fxwtStatisticsData.byAddv;
- });
- } else {
- getAddvCountProblemForReport(this.requestEntmTime, this.requestOrgId, this.requestObjectType, this.requestSttmTime, this.requestQuote).then((res) => {
- console.log(res);
- _self.jbyywtStatisticsData.byAddv = res.data;
- _self.GlobalCenterMapUseData = _self.jbyywtStatisticsData.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;//地图上的圆形小标记数字颜色
- this.barStartColor = item.barStartColor;//中部柱状图 柱子渐变--起始--颜色
- this.barEndColor = item.barEndColor;//中部柱状图 柱子渐变--结束--颜色
- },
- //获取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);
- // 切换主题后再次切换系统时需要在这里给data-theme重新赋值
- window.document.documentElement.setAttribute('data-theme', this.msg);
- },
- beforeCreate() {
- }, //生命周期 - 创建之前
- beforeMount() {
- }, //生命周期 - 挂载之前
- beforeUpdate() {
- }, //生命周期 - 更新之前
- updated() {
- }, //生命周期 - 更新之后
- beforeDestroy() {
- }, //生命周期 - 销毁之前
- destroyed() {
- }, //生命周期 - 销毁完成
- activated() {
- } //如果页面有keep-alive缓存功能,这个函数会触发
- };
- </script>
- <style lang="scss">
- // @media screen and (min-width: 1024px) and (max-width:1360px) {
- // @import "@scss/home1024";
- // .mainDiv {
- // padding: 5px;
- // // background: rgb(255, 255, 255);
- // }
- // }
- @media screen and (min-width: 1024px) and (max-width: 1920px) {
- @import "@scss/home";
- .mainDiv {
- padding: 5px;
- // background: rgb(255, 255, 255);
- }
- }
- @media screen and (min-width: 1920px) {
- @import "@scss/home1920";
- .mainDiv {
- padding: 10px;
- // background: rgb(255, 255, 255);
- }
- }
- </style>
|