9ac3ffd843e20a1f973eb02f247d13d5ef5e19fa.svn-base 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734
  1. <!-- -->
  2. <template>
  3. <div class="mainDiv" style="background: rgb(243, 243, 246);height: 100%;padding:1vh">
  4. <el-row :gutter="5" class="left" style="margin-left:0;margin-right:0;">
  5. <el-col class="left_user" style="" :span="5">
  6. <Systemstatus
  7. :usersNum="usersNum"
  8. :grounpNum="grounpNum"
  9. ></Systemstatus>
  10. </el-col>
  11. <el-col class="middle" style="height:100%;" :span="14">
  12. <div class="middle_button">
  13. <HomeViewBar
  14. @barsType="barTypeChangeHandler"
  15. @globalTime="globalTimeHandler"
  16. :dczNum="dczStatisticsData.total"
  17. :dcyrNum="dcryStatisticsData.total"
  18. :dcdxNum="dcdxStatisticsData.total"
  19. :fxwtNum="fxwtStatisticsData.total"
  20. ></HomeViewBar>
  21. </div>
  22. </el-col>
  23. <el-col class="right" style="height:100%;" :span="5">
  24. <div class="right_qus">
  25. <QuestionCount
  26. @rightQustionTimeLimit="rightQustionTimeLimit"
  27. :qustionsCountNums="qustionsCountNums"
  28. ></QuestionCount>
  29. </div>
  30. </el-col>
  31. </el-row>
  32. <el-row :gutter="5" style="margin-left:0;margin-right:0;margin-top:5px;height:85vh;">
  33. <el-col style="height:100%;" :span="5">
  34. <el-row class="left" style="margin:0 0 0 0;">
  35. <div class="left_qusLineChart">
  36. <PublicSentiment></PublicSentiment>
  37. </div>
  38. </el-row>
  39. <el-row class="left" style="margin:5px 0 0 0;">
  40. <div class="left_notices">
  41. <Notices @showAnnouncement="showAnnouncementHandler"></Notices>
  42. </div>
  43. </el-row>
  44. </el-col>
  45. <el-col class="middle" style="height:100%;" :span="14">
  46. <div class="middle_map">
  47. <CenterMap
  48. @OrgListsEventToMainView="OrgListsEventToMainViewEvent"
  49. @DctypeListsEventToMainView="DctypeListsEventToMainViewEvent"
  50. @mapClick="mapClickHandler"
  51. :barsChooseType="barsChooseType"
  52. :barsChooseUnit="barsChooseUnit"
  53. :dczLists="dczLists"
  54. :transferUseLists="transferUseLists"
  55. :mapData="GlobalCenterMapUseData"
  56. :requestEntmTime="requestEntmTime"
  57. :requestOrgId="requestOrgId"
  58. :requestObjectType="requestObjectType"
  59. :requestSttmTime="requestSttmTime"
  60. :mapTitleFocusName="mapTitleFocusName"
  61. :mapPointColor="mapPointColor"
  62. >
  63. </CenterMap>
  64. </div>
  65. </el-col>
  66. <el-col style="height:100%;" :span="5">
  67. <el-row class="right" style="margin:0 0 0 0;">
  68. <div class="right_line" >
  69. <QuestionLineChart
  70. @trendLineChartType="trendLineChartTypeHandler"
  71. :GlobalSttmTime="GlobalSttmTime"
  72. :GlobalEntmTime="GlobalEntmTime"
  73. :xData="xData"
  74. :yData="yData"
  75. ></QuestionLineChart>
  76. </div>
  77. </el-row>
  78. <el-row class="right" style="margin:5px 0 0 0;">
  79. <div class="right_pie_dcdx">
  80. <FinishRate
  81. :finishNumber="finishRateData.finishedCount"
  82. :unfinishNumber="finishRateData.unfinishedCount"></FinishRate>
  83. </div>
  84. </el-row>
  85. <el-row class="right" style="margin:5px 0 0 0;">
  86. <div class="right_pie_wtfb">
  87. <ProblemPieChart
  88. :levelone="problemLevelStatisticsData.levelOne"
  89. :leveltwo="problemLevelStatisticsData.levelTwo"
  90. :levelthree="problemLevelStatisticsData.levelThree"
  91. levelfour="0"></ProblemPieChart>
  92. </div>
  93. </el-row>
  94. </el-col>
  95. </el-row>
  96. <!--督查组dialog-->
  97. <el-dialog :title="dcdxTitle + '督查组'" :visible.sync="dczVisible" :close-on-click-modal="false" width="40%">
  98. <DczDetails
  99. v-if="dczVisible"
  100. :adCode="dcdxAdcode"
  101. :requestEntmTime="requestEntmTime"
  102. :requestOrgId="requestOrgId"
  103. :requestSttmTime="requestSttmTime"
  104. :requestObjectType="requestObjectType"></DczDetails>
  105. </el-dialog>
  106. <!--督查人员dialog-->
  107. <el-dialog :title="dcdxTitle + '督查人员'" :visible.sync="dcryVisible" :close-on-click-modal="false" width="40%">
  108. <DcryDetails
  109. v-if="dcryVisible"
  110. :adCode="dcdxAdcode"
  111. :requestEntmTime="requestEntmTime"
  112. :requestOrgId="requestOrgId"
  113. :requestSttmTime="requestSttmTime"
  114. :requestObjectType="requestObjectType"></DcryDetails>
  115. </el-dialog>
  116. <!--督查对象dialog-->
  117. <el-dialog :title="dcdxTitle + '督查对象'" :visible.sync="dcdxVisible" :close-on-click-modal="false" width="40%">
  118. <DcdxDetails
  119. v-if="dcdxVisible"
  120. :adCode="dcdxAdcode"
  121. :requestEntmTime="requestEntmTime"
  122. :requestOrgId="requestOrgId"
  123. :requestSttmTime="requestSttmTime"
  124. :requestObjectType="requestObjectType"></DcdxDetails>
  125. </el-dialog>
  126. <!--发现问题dialog-->
  127. <el-dialog :title="dcdxTitle + '问题详情'" :visible.sync="fxwtVisible" :close-on-click-modal="false" width="40%">
  128. <FxwtDetails
  129. v-if="fxwtVisible"
  130. :adCode="dcdxAdcode"
  131. :requestEntmTime="requestEntmTime"
  132. :requestOrgId="requestOrgId"
  133. :requestSttmTime="requestSttmTime"
  134. :requestObjectType="requestObjectType">
  135. </FxwtDetails>
  136. </el-dialog>
  137. <el-dialog title="公告" :visible.sync="showAnnouncement" :close-on-click-modal="false" width="40%">
  138. <div style="display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;min-height:200px;">
  139. <div style="display:flex;flex-direction:row;justify-content:center;align-items:center">
  140. <h1>{{announcementItem.title}}</h1>
  141. </div>
  142. <div style="display:flex;flex-direction:row;justify-content:center;align-items:center;color:gray;margin-top:20px;">
  143. <p>{{announcementItem.persNm}}</p>
  144. <p style="margin-left:10px;">{{announcementItem.orgNm}}</p>
  145. <p style="margin-left:10px;">{{showStrDate(announcementItem.pubTm)}}</p>
  146. </div>
  147. <div style="display:flex;flex-direction:row;justify-content:flex-start;align-items:stretch;padding:15px;">
  148. <p v-html="announcementItem.content"></p>
  149. </div>
  150. </div>
  151. </el-dialog>
  152. </div>
  153. </template>
  154. <script>
  155. //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  156. //例如:import 《组件名称》 from '《组件路径》';
  157. import echarts from "echarts";
  158. import axios from 'axios' //引入axios
  159. //左侧组件
  160. import Systemstatus from "./Systemstatus"; //左侧用户和组现在情况
  161. import Notices from "./Notices"; //左侧公告
  162. import PublicSentiment from "./PublicSentiment"; //舆情信息
  163. //中部组件
  164. import HomeViewBar from "./HomeViewBar"; //地图上方按钮
  165. import CenterMap from "./CenterMap"; //地图上方按钮
  166. //右侧组件
  167. import QuestionCount from "./QuestionCount"; //右侧日周月问题统计
  168. import QuestionLineChart from "./QuestionLineChart"; //右侧趋势
  169. import FinishRate from "./FinishRate"; //右侧督查对象
  170. import ProblemPieChart from "./ProblemPieChart"; //右侧问题分布
  171. import DcdxDetails from "./DcdxDetails";//督查对象地图详情
  172. import FxwtDetails from "./FxwtDetails";//发现问题地图详情
  173. import DczDetails from "./DczDetails";//督查组地图详情
  174. import DcryDetails from "./DcryDetails";//督查人员地图详情
  175. //方法引用脚本
  176. import request from "@util/gw_ajax_request.js";
  177. import {dateFormat} from "@util/gw_date.js"
  178. import {
  179. BarsDczNums,
  180. BarsDcyrNums,
  181. BarsDcdxNums,
  182. BarsFxwtNums,
  183. userAndGroup,//获取指定条件全部督查对象计数
  184. getcountPlan,//获取指定条件全部督查对象计数
  185. getProblemCountByProAndLevel,
  186. getAddvCountGroup,
  187. getAddvCountPerson,
  188. getAddvCountObject,
  189. getAddvCountProblem,
  190. getTrendLineData,
  191. getQustionCountData,
  192. } from "../../api/homeMainView.js";
  193. export default {
  194. //import引入的组件需要注入到对象中才能使用
  195. components: {
  196. Systemstatus,
  197. QuestionCount,
  198. QuestionLineChart,
  199. Notices,
  200. HomeViewBar,
  201. CenterMap,
  202. PublicSentiment,
  203. FinishRate,
  204. ProblemPieChart,
  205. DcdxDetails,
  206. FxwtDetails,
  207. DczDetails,
  208. DcryDetails
  209. },
  210. props: [],
  211. data() {
  212. //这里存放数据
  213. return {
  214. transformScale:1,
  215. showAnnouncement:false,
  216. announcementItem:{
  217. "id": "c2219c04336a46bd92163bf0463a773e",
  218. "type": null,
  219. "title": "测试",
  220. "content": "<p>测试</p>",
  221. "url": null,
  222. "note": null,
  223. "persId": "89E69B31FE1344A98316A0153BA7386C",
  224. "persNm": "王晓辰",
  225. "orgId": "041",
  226. "orgNm": "北京金水公司",
  227. "pubState": "0",
  228. "pubTm": null,
  229. "intm": 1561363050000,
  230. "uptm": 1561363050000
  231. },
  232. dczStatisticsData:{//督查组相关统计数据,包括总数、类别分异、行政区分异
  233. total:0,
  234. byObjectType:[],
  235. byAddv:[],
  236. },
  237. dcryStatisticsData:{//督查人力相关统计数据,包括总数、类别分异、行政区分异
  238. total:0,
  239. byObjectType:[],
  240. byAddv:[],
  241. },
  242. dcdxStatisticsData:{//督查对象相关统计数据,包括总数、类别分异、行政区分异
  243. total:0,
  244. byObjectType:[],
  245. byAddv:[],
  246. },
  247. fxwtStatisticsData:{//问题相关统计数据,包括总数、类别分异、行政区分异
  248. total:0,
  249. byObjectType:[],
  250. byAddv:[],
  251. },
  252. finishRateData:{//督查完成率
  253. total:0,
  254. finishedCount:0,
  255. unfinishedCount:0,
  256. },
  257. problemLevelStatisticsData:{
  258. levelOne:0,
  259. levelTwo:0,
  260. levelThree:0,
  261. total:0,
  262. },
  263. rightTimeLimit: '',//趋势线图点选的是日、月、周
  264. qustionsCountNums: '',//右侧问题统计数据
  265. pblmStateForLine:'',//趋势线是增量、累计
  266. yData:[],//右侧趋势图用Y轴数据
  267. xData:[],//右侧趋势图用X轴数据
  268. GlobalSttmTime: '',//用于响应用户时间筛选,记录用户的开始时间
  269. GlobalEntmTime: '',//用于响应用户时间筛选,记录用户的结束时间
  270. GlobalOrgIds:[],//用于响应并记录用户所点选的筛选机构id
  271. GlobalObjectType:[],//用于响应并记录用户所点选的督查类型
  272. GlobalAdCode:'',//用于响应并记录用户点选行政区,进行下钻所使用的行政区划代码
  273. GlobalFocusType:'dcz',//用于响应用户切换关注点,督查组 督查人员 督查对象 发现问题 默认是督查组。
  274. mapTitleFocusName:'督查组',//用于地图关注焦点的点选title名称
  275. mapPointColor:'#51afea',//用于地图关注焦点数字气泡颜色
  276. barsChooseUnit:'组',
  277. GlobalCenterMapUseData:[],
  278. barsChooseType:'',
  279. dczLists:[],
  280. usersNum:0,
  281. grounpNum:0,
  282. transferUseLists:[],//传递地图左侧督查对象列表数据至CenterMap组件
  283. dcdxTitle: '',
  284. dcdxVisible: false,
  285. dcdxAdcode: '',
  286. fxwtTitle: '',
  287. fxwtVisible: false,
  288. dczVisible: false,
  289. dcryVisible:false
  290. };
  291. },
  292. //监听属性 类似于data概念
  293. computed: {
  294. requestAdCode:function(){
  295. if(this.GlobalAdCode){
  296. console.log("首页computed变化监听:查询行政区划代码为:"+this.GlobalAdCode);
  297. return this.GlobalAdCode;
  298. }else{
  299. return '';
  300. }
  301. },
  302. requestSttmTime:function(){//全局请求使用的开始时间参数,逻辑为用户未填写按照当年1月1日开始,填写后使用填写值
  303. if(this.GlobalSttmTime){
  304. console.log("首页computed变化监听:查询开始时间为:"+this.GlobalSttmTime);
  305. return this.GlobalSttmTime;
  306. }else{
  307. console.log("首页computed变化监听:查询开始时间为:"+dateFormat(new Date(),'yyyy-01-01'));
  308. return dateFormat(new Date(),'yyyy-01-01');
  309. }
  310. },
  311. requestEntmTime:function(){//全局请求使用的结束时间参数,逻辑为用户未填写按照当当天当时,填写后使用填写值
  312. if(this.GlobalEntmTime){
  313. console.log("首页computed变化监听:查询开始时间为:"+this.GlobalEntmTime);
  314. return this.GlobalEntmTime;
  315. }else{
  316. console.log("首页computed变化监听:查询开始时间为:"+dateFormat(new Date(),'yyyy-MM-dd'));
  317. return dateFormat(new Date(),'yyyy-MM-dd');
  318. }
  319. },
  320. requestOrgId:function(){//全局请求使用的多机构查询字符串,默认为''代表全选
  321. // 判断是否有选中的机构id,如果没有默认一个查询条件(目前为'')
  322. if(this.GlobalOrgIds&&this.GlobalOrgIds.length>0){
  323. return this.GlobalOrgIds.join(',');
  324. }else{
  325. return '';
  326. }
  327. },
  328. requestObjectType:function(){//全局请求使用的多督查对象类型查询字符串,默认为''代表全选
  329. if(this.GlobalObjectType&&this.GlobalObjectType.length>0){
  330. return this.GlobalObjectType.join(',');
  331. }else{
  332. return '';
  333. }
  334. },
  335. lineUseSttmTime:function(){//问题趋势折线使用的查询开始时间
  336. return this.GlobalSttmTime;
  337. },
  338. lineUseEntmTime:function(){//问题趋势折线使用的查询结束时间
  339. return this.GlobalEntmTime;
  340. },
  341. },
  342. //监控data中的数据变化
  343. watch: {
  344. rightTimeLimit(newValue,oldValue){
  345. this.rightTimeLimit = newValue;
  346. this.rightQustionLine();
  347. },
  348. pblmStateForLine(newValue,oldValue){
  349. this.pblmStateForLine = newValue;
  350. this.rightQustionLine();
  351. },
  352. requestSttmTime:function(){// 查询时间变化基本影响全局数据变化
  353. this.getDynamicDataRefresh();
  354. this.getLeftMap();
  355. },
  356. requestEntmTime:function(){// 查询时间变化基本影响全局数据变化
  357. this.getDynamicDataRefresh();
  358. this.getLeftMap();
  359. },
  360. requestOrgId:function(){// 查询机构变化基本影响全局数据变化
  361. this.getDynamicDataRefresh();
  362. this.getLeftMap();
  363. this.rightQustionLine();
  364. },
  365. requestObjectType:function(){// 查询对象变化基本影响全局数据变化
  366. this.getDynamicDataRefresh();
  367. this.getLeftMap();
  368. this.rightQustionLine();
  369. },
  370. GlobalFocusType(newValue,oldValue){//关注点变化主要影响 按类型分异的数据、单位 还有中央的行政区分布图
  371. this.GlobalFocusType = newValue;
  372. this.getDynamicDataRefresh();
  373. this.getLeftMap();
  374. this.getAddVcdCountByType();//切换行政区划分布数据
  375. },
  376. lineUseSttmTime:function(){//全局开始时间对趋势图影响
  377. this.rightQustionLine();
  378. },
  379. lineUseEntmTime:function(){//全局结束时间对趋势图影响
  380. this.rightQustionLine();
  381. },
  382. },
  383. //方法集合
  384. methods: {
  385. showStrDate:function(pubTm){
  386. let d = new Date(pubTm);
  387. return dateFormat(d,'yyyy-MM-dd');
  388. },
  389. showAnnouncementHandler:function(params){
  390. this.showAnnouncement = true;
  391. this.announcementItem = params.announcement.item;
  392. },
  393. getLeftMap(){
  394. var _self = this;
  395. let searchParmas = {
  396. endTime: this.requestEntmTime,
  397. orgIds: this.requestOrgId,
  398. startTime: this.requestSttmTime
  399. };
  400. axios.all([BarsDczNums(searchParmas),BarsDcyrNums(searchParmas),BarsDcdxNums(searchParmas),BarsFxwtNums(searchParmas)]).then(
  401. axios.spread(function (dcz,dcry,dcdx,fxwt) {
  402. _self.dczStatisticsData.byObjectType = dcz.data;
  403. _self.dcryStatisticsData.byObjectType = dcry.data;
  404. _self.dcdxStatisticsData.byObjectType = dcdx.data;
  405. _self.fxwtStatisticsData.byObjectType = fxwt.data;
  406. if(_self.GlobalFocusType === 'dcz'){
  407. _self.transferUseLists = _self.dczStatisticsData.byObjectType;
  408. }else if(_self.GlobalFocusType === 'dcry'){
  409. _self.transferUseLists = _self.dcryStatisticsData.byObjectType;
  410. }else if(_self.GlobalFocusType === 'dcdx'){
  411. _self.transferUseLists = _self.dcdxStatisticsData.byObjectType;
  412. }else{
  413. _self.transferUseLists = _self.fxwtStatisticsData.byObjectType;
  414. }
  415. }));
  416. },
  417. getBarsDczNum() { //四个按钮数据请求
  418. var _self = this;
  419. let searchParmas = {
  420. endTime: this.requestEntmTime,
  421. orgIds: this.requestOrgId,
  422. pTypes: this.requestObjectType,
  423. startTime: this.requestSttmTime
  424. };
  425. axios.all([BarsDczNums(searchParmas),BarsDcyrNums(searchParmas),BarsDcdxNums(searchParmas),BarsFxwtNums(searchParmas)]).then(
  426. axios.spread(function (dcz,dcry,dcdx,fxwt) {
  427. // 四个请求现在都执行完成
  428. //存储对象类别分异原始结果
  429. _self.dczStatisticsData.byObjectType = dcz.data;
  430. _self.dcryStatisticsData.byObjectType = dcry.data;
  431. _self.dcdxStatisticsData.byObjectType = dcdx.data;
  432. _self.fxwtStatisticsData.byObjectType = fxwt.data;
  433. // if(_self.GlobalFocusType === 'dcz'){
  434. // _self.transferUseLists = _self.dczStatisticsData.byObjectType;
  435. // }else if(_self.GlobalFocusType === 'dcry'){
  436. // _self.transferUseLists = _self.dcryStatisticsData.byObjectType;
  437. // }else if(_self.GlobalFocusType === 'dcdx'){
  438. // _self.transferUseLists = _self.dcdxStatisticsData.byObjectType;
  439. // }else{
  440. // _self.transferUseLists = _self.fxwtStatisticsData.byObjectType;
  441. // }
  442. //计算总数统计 供给抬头显示
  443. _self.dczStatisticsData.total = _self.countSum(_self.dczStatisticsData.byObjectType,'total');
  444. _self.dcryStatisticsData.total = _self.countSum(_self.dcryStatisticsData.byObjectType,'total');
  445. _self.dcdxStatisticsData.total = _self.countSum(_self.dcdxStatisticsData.byObjectType,'total');
  446. _self.fxwtStatisticsData.total = _self.countSum(_self.fxwtStatisticsData.byObjectType,'total');
  447. //赋值并计算督查对象完成率相关
  448. _self.finishRateData.finishedCount = _self.dcdxStatisticsData.total ;
  449. _self.finishRateData.unfinishedCount = _self.finishRateData.total - _self.finishRateData.finishedCount;
  450. }));
  451. //督查组
  452. },
  453. //获取在线人数及所在督查组
  454. getUsersAndGroup() {
  455. var _this = this;
  456. userAndGroup({}).then(res => {
  457. _this.usersNum = res.data.countPers;
  458. _this.grounpNum = res.data.countGroup;
  459. });
  460. },
  461. // upDateDynamicDataByStep:function(){
  462. // // let _self = this;
  463. // // function *generatorUpdate(){
  464. // // yield console.log('更新头部');
  465. // // yield console.log('更新地图');
  466. // // yield console.log('更新折线');
  467. // // yield console.log('更新饼状图1');
  468. // // yield console.log('更新饼状图2');
  469. // // };
  470. // // let gu = generatorUpdate();
  471. // // setInterval(function(){
  472. // // gu.next();
  473. // // },5000);
  474. // },
  475. getDynamicDataRefresh:function(){
  476. // 时间、机构、对象类别的变化不影响系统状态与公告。所以单独抽出动态数据的请求。
  477. let _self = this;
  478. function *generatorGetTheData(){
  479. console.log('头部数据跟项分类');
  480. _self.getHeaderBarsDataAndObjectTypeCount();//头部数据跟项分类
  481. yield console.log('督查对象总数'); _self.getPlanCount();//督查对象总数
  482. yield console.log('问题严重程度分布'); _self.getProblemLevelCount();//问题严重程度分布
  483. yield console.log('问题线图'); _self.rightQustionLine();//问题线图
  484. yield console.log('问题累计图'); _self.rightQustionCount();//问题累计图
  485. yield _self.getAddVcdCountByType();//行政区划分布
  486. }
  487. let gu = generatorGetTheData();
  488. setInterval(function(){
  489. gu.next();
  490. },500);
  491. },
  492. getAllDataRefresh:function(){
  493. this.getLeftMap();
  494. this.getUsersAndGroup();
  495. this.getDynamicDataRefresh();
  496. },
  497. getPlanCount:function(){//获取计划督查对象总数 并计算完成率
  498. let _self = this;
  499. _self.finishRateData.total = 0;
  500. getcountPlan(this.requestEntmTime,this.requestOrgId,this.requestObjectType,this.requestSttmTime).then((res)=>{
  501. if(res.data&&res.data.length>0){
  502. let result = 0;
  503. res.data.forEach((item)=>{
  504. result += Number(item['total']);
  505. });
  506. _self.finishRateData.total = result;
  507. _self.finishRateData.unfinishedCount = _self.finishRateData.total - _self.finishRateData.finishedCount;
  508. }
  509. });
  510. },
  511. getProblemLevelCount:function(){//获取问题严重程度分异数据
  512. let _self = this;
  513. _self.problemLevelStatisticsData.levelOne = 0;
  514. _self.problemLevelStatisticsData.levelTwo = 0;
  515. _self.problemLevelStatisticsData.levelThree = 0;
  516. getProblemCountByProAndLevel(this.requestEntmTime,this.requestOrgId,this.requestObjectType,this.requestSttmTime).then((res)=>{
  517. let addvData = [];
  518. if(res.data&&res.data.length>0){
  519. res.data.forEach((item)=>{
  520. let singleAddvData = {
  521. 'adName':item.name,
  522. 'total':0,
  523. 'eachLevelData':[],
  524. };
  525. item.pblmDtoList.forEach((inspPblm)=>{
  526. singleAddvData.total += inspPblm.total;
  527. singleAddvData.eachLevelData.push({'level':inspPblm.inspPblmCate,'count':inspPblm.total});
  528. switch(inspPblm.inspPblmCate){
  529. case '0':_self.problemLevelStatisticsData.levelOne += inspPblm.total;break;
  530. case '1':_self.problemLevelStatisticsData.levelTwo += inspPblm.total;break;
  531. case '2':_self.problemLevelStatisticsData.levelThree += inspPblm.total;break;
  532. }
  533. });
  534. });
  535. }
  536. });
  537. },
  538. getAddVcdCountByType:function(){
  539. let _self = this;
  540. if(this.GlobalFocusType=='dcz'){//督查组
  541. getAddvCountGroup(this.requestEntmTime,this.requestOrgId,this.requestObjectType,this.requestSttmTime).then((res)=>{
  542. console.log(res);
  543. _self.dczStatisticsData.byAddv = res.data;
  544. _self.GlobalCenterMapUseData = _self.dczStatisticsData.byAddv;
  545. });
  546. }else if(this.GlobalFocusType=='dcry'){//督查人员
  547. getAddvCountPerson(this.requestEntmTime,this.requestOrgId,this.requestObjectType,this.requestSttmTime).then((res)=>{
  548. console.log(res);
  549. _self.dcryStatisticsData.byAddv = res.data;
  550. _self.GlobalCenterMapUseData = _self.dcryStatisticsData.byAddv;
  551. });
  552. }else if(this.GlobalFocusType=='dcdx'){//督查对象
  553. getAddvCountObject(this.requestEntmTime,this.requestOrgId,this.requestObjectType,this.requestSttmTime).then((res)=>{
  554. console.log(res);
  555. _self.dcdxStatisticsData.byAddv = res.data;
  556. _self.GlobalCenterMapUseData = _self.dcdxStatisticsData.byAddv;
  557. });
  558. }else{//发现问题
  559. getAddvCountProblem(this.requestEntmTime,this.requestOrgId,this.requestObjectType,this.requestSttmTime).then((res)=>{
  560. console.log(res);
  561. _self.fxwtStatisticsData.byAddv = res.data;
  562. _self.GlobalCenterMapUseData = _self.fxwtStatisticsData.byAddv;
  563. });
  564. }
  565. },
  566. getHeaderBarsDataAndObjectTypeCount:function(){
  567. this.getBarsDczNum();
  568. },
  569. updateByOrder:function(){},
  570. //获取右侧QuestionLineChart组件数据
  571. getRightLineData(){
  572. var _this = this;
  573. let searchParmas = {
  574. adCode: this.requestEntmTime,
  575. orgIds: this.requestOrgId,
  576. pTypes: this.requestObjectType,
  577. startTime: this.requestSttmTime
  578. };
  579. },
  580. //获取HomeViewBar组件上传的督查类别
  581. barTypeChangeHandler(item) {
  582. this.GlobalFocusType = item.id;
  583. this.barsChooseUnit = item.unit;
  584. this.mapTitleFocusName = item.spanName;//地图title用的,选中的四个bar中的其一名称
  585. this.mapPointColor = item.mapPointColor;//地图上的圆形小标记数字颜色
  586. },
  587. //获取HomeViewBar组件上传的全局查询时间
  588. globalTimeHandler(item) {
  589. this.GlobalSttmTime = item.sttm;
  590. this.GlobalEntmTime = item.entm;
  591. },
  592. //获取右侧QuestionCount组件点击后时间范围
  593. rightQustionTimeLimit(item){
  594. this.rightTimeLimit = item;
  595. },
  596. //获取右侧QuestionCount组件点选图标类型
  597. trendLineChartTypeHandler(item){
  598. this.pblmStateForLine = item;
  599. },
  600. //获取右侧QuestionLineChart数据
  601. rightQustionLine(){
  602. let _self = this;
  603. getTrendLineData('',this.rightTimeLimit,this.requestOrgId,this.pblmStateForLine,this.lineUseSttmTime,this.lineUseEntmTime,this.requestObjectType).then((res)=>{
  604. var dataList = res.data;
  605. var exData = [];
  606. var eyData = [];
  607. if(this.rightTimeLimit == 'day'){
  608. dataList.forEach(element => {
  609. exData.push(element.name + '日');
  610. eyData.push(element.value);
  611. })
  612. }else if(this.rightTimeLimit == 'week'){
  613. dataList.forEach(element => {
  614. exData.push(element.name);
  615. eyData.push(element.value);
  616. })
  617. }else{
  618. dataList.forEach(element => {
  619. exData.push(element.name + '月');
  620. eyData.push(element.value);
  621. })
  622. }
  623. _self.xData = exData;
  624. _self.yData = eyData;
  625. });
  626. },
  627. //获取右侧QuestionCount数据
  628. rightQustionCount(){
  629. let _self = this;
  630. getQustionCountData().then((res)=>{
  631. this.qustionsCountNums = res.data;
  632. });
  633. },
  634. //接收CenterMap的流域机构id
  635. OrgListsEventToMainViewEvent(item){
  636. //alert('这是mainView接收到的' + item);
  637. this.GlobalOrgIds = item;
  638. },
  639. DctypeListsEventToMainViewEvent(item){
  640. //alert('这是mainView接收到的' + item);
  641. this.GlobalObjectType = item;
  642. },
  643. countSum:function(arr,valueNameToSum){//根据arr中元素指定属性()求和 后续抽离到util中
  644. let result = 0;
  645. if(arr&&arr.length>0){
  646. if(valueNameToSum&&valueNameToSum!=''){//如果不传递valueNameToSum考虑数组arr中都是基本字面量
  647. // 数组是基本字面量
  648. arr.forEach(item=>{
  649. result += Number(item[valueNameToSum]);
  650. });
  651. }else{
  652. // 数组是基本字面量
  653. arr.forEach(item=>{
  654. result += Number(item);
  655. });
  656. }
  657. }else{
  658. result = 0;
  659. }
  660. return result;
  661. },
  662. mapClickHandler:function(params){
  663. console.log(params);
  664. console.log('homeMainView监听mapClick'+params.onClickAdCode);
  665. this.dcdxAdcode = params.onClickAdCode;
  666. this.dcdxTitle = params.onClickAdName
  667. var _self = this;
  668. if(_self.GlobalFocusType == 'dcz'){
  669. _self.dczVisible = true;
  670. }else if(_self.GlobalFocusType == 'dcry'){
  671. _self.dcryVisible = true;
  672. }else if(_self.GlobalFocusType == 'dcdx'){
  673. _self.dcdxVisible = true;
  674. }else{
  675. _self.fxwtVisible = true;
  676. }
  677. },
  678.  autoSetScale() {
  679.       let zoom = (window.innerHeight / 1080).toFixed(3)
  680.       this.transformScale = `scale(${zoom})`
  681.       this.width = `${(window.innerWidth * zoom).toFixed(2)}px`
  682.     }
  683. },
  684. //生命周期 - 创建完成(可以访问当前this实例)
  685. created() {},
  686. //生命周期 - 挂载完成(可以访问DOM元素)
  687. mounted() {
  688. this.getAllDataRefresh();
  689. // alert(window.innerWidth);
  690. // alert(window.innerHeight);
  691. // this.upDateDynamicDataByStep();
  692. // this.getTrend();
  693. },
  694. beforeCreate() {}, //生命周期 - 创建之前
  695. beforeMount() {}, //生命周期 - 挂载之前
  696. beforeUpdate() {}, //生命周期 - 更新之前
  697. updated() {}, //生命周期 - 更新之后
  698. beforeDestroy() {}, //生命周期 - 销毁之前
  699. destroyed() {}, //生命周期 - 销毁完成
  700. activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
  701. };
  702. </script>
  703. <style lang="scss">
  704. @import "@scss/homeForPad";
  705. </style>