b71ec89a05be0ffc1630836e790baed9b341d2b3.svn-base 32 KB

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