e93cb3e46f0eb40ed407fef475b1d45c6686067d.svn-base 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209
  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_qusLineChart">
  8. <!--<PublicSentiment></PublicSentiment>-->
  9. <jc-news @showNews="showNewsHandler" ></jc-news>
  10. </div>
  11. <div class="left_notices">
  12. <jc-notices @showAnnouncement="showAnnouncementHandler"></jc-notices>
  13. </div>
  14. </div>
  15. <!-- 中部组件 -->
  16. <div class="middle">
  17. <div class="middle_map">
  18. <template v-if="year !== null && batch !== null">
  19. <div class="map_header">
  20. <span>{{year}}</span>年第<span>{{batch}}</span>批稽察任务分布图
  21. </div>
  22. </template>
  23. <template v-else>
  24. <div class="map_header" style="display: none;"></div>
  25. </template>
  26. <div class="map_select" style="display: none">
  27. <el-select v-model="year" placeholder="请选择年份" @change="yearChange">
  28. <el-option
  29. v-for="item in yearoptions"
  30. :key="item.value"
  31. :label="item.label"
  32. :value="item.value">
  33. </el-option>
  34. </el-select>
  35. <el-select v-model="round" placeholder="请选择批次">
  36. <el-option
  37. v-for="item in roundoptions"
  38. :key="item.value"
  39. :label="item.label"
  40. :value="item.value">
  41. </el-option>
  42. </el-select>
  43. </div>
  44. <div id="syMainMapContainer" style="width: 100%;height: calc(100%);">
  45. <!--<div style="width:100%;height:80%;" id="jcmapChart"></div>-->
  46. <div style="width:100%;height:90%;" id="myChart"></div>
  47. </div>
  48. </div>
  49. <div class="middle_bar">
  50. <div class="simple_header">
  51. <div class="simple_header_icon"></div>
  52. <div class="simple_header_text">稽察次数</div>
  53. </div>
  54. <div class="" style="width: 100%;" :style="{'height':heightCont +'px'}">
  55. <div style="width:100%;height:100%;" id="barChart" ref="barChart"></div>
  56. </div>
  57. </div>
  58. </div>
  59. <!-- 右侧组件 -->
  60. <div class="right">
  61. <div class="right_qus">
  62. <div class="firstDiv">
  63. <p class="p_header">本年度问题</p>
  64. <div class="flexBox">
  65. <div class="imgBox">
  66. <img src="../../assets/img/rtop1.png" alt="">
  67. </div>
  68. <div class="contentBox">
  69. <p class="firstP">{{questionCount}}</p>
  70. <p class="secondP">同比去年
  71. <template v-if="percolor">
  72. <span class="spanBox" style="color: red;">
  73. <span class="jian">↑</span> <span class="num">{{questionPercent}}%</span>
  74. </span>
  75. </template>
  76. <template v-else="percolor">
  77. <span class="spanBox" style="color: #73DEB3;">
  78. <span class="jian">↓</span> <span class="num">{{questionPercent}}%</span>
  79. </span>
  80. </template>
  81. </p>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="secondDiv">
  86. <p class="p_header">稽察进度</p>
  87. <div class="flexBox">
  88. <div class="imgBox">
  89. <img src="../../assets/img/rtop2.png" alt="">
  90. </div>
  91. <div class="contentBox">
  92. <p class="firstP">剩余<span>{{progressCount}}</span>天</p>
  93. <p class="secondP">稽察进度<span>{{progressPercent}}%</span></p>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. <div class="right_pie_dcdx">
  99. <div class="simple_header">
  100. <div class="simple_header_icon"></div>
  101. <div class="simple_header_text">项目类型</div>
  102. </div>
  103. <div class="right_FinishRate_content" >
  104. <div style="width:100%;height:100%;" ref="objTypechart" id="objTypechart"></div>
  105. </div>
  106. </div>
  107. <div class="right_pie_wtfb">
  108. <div class="simple_header">
  109. <div class="simple_header_icon"></div>
  110. <div class="simple_header_text">问题类别</div>
  111. </div>
  112. <div class="left_ProblemPieChart_content">
  113. <div style="width:100%;height:100%;" ref="problempiechart" id="problempiechart"></div>
  114. </div>
  115. </div>
  116. </div>
  117. <el-dialog title="我的消息" :visible.sync="showAnnouncement2" :close-on-click-modal="false" width="40%">
  118. <div style="display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;min-height:100px;">
  119. <template v-if="announcementItem2.type == 1 || announcementItem2.type == 2">
  120. <div style="display:flex;flex-direction:row;justify-content:center;align-items:center">
  121. <h1>{{announcementItem2.title}}</h1>
  122. </div>
  123. </template>
  124. <template v-else>
  125. <div style="display:flex;flex-direction:row;">
  126. <div class="mainBox">
  127. <h2>
  128. 尊敬的<span id="name">{{announcementItem2.exptNm}}</span>专家:
  129. </h2>
  130. <p style="text-indent: 2em;font-size: 20px;line-height: 30px;margin-top: 20px;margin-bottom: 20px;">
  131. 您好!您已选择参加由水利部组织的&nbsp;&nbsp;<span style="font-weight: 600;text-decoration:underline;">{{announcementItem2.year}}</span>&nbsp;&nbsp;年度第&nbsp;&nbsp;<span style="font-weight: 600;text-decoration:underline;">{{announcementItem2.batch}}</span>&nbsp;&nbsp;批次稽察工作。您所要稽察的地点是:<span style="font-weight: 600;">{{announcementItem2.noticeInfo}}</span>,本次稽察工作时间为:<span style="font-weight: 600;">{{showNewsDate(announcementItem2.sttm)}}</span>-<span style="font-weight: 600;">{{showNewsDate(announcementItem2.entm)}}</span>。您所在组助理为:{{announcementItem2.assNm}},助理联系方式为:{{announcementItem2.assPhone}}。如果您由于特殊原因无法参加本批次稽察工作,请您及时联系助理。
  132. </p>
  133. </div>
  134. </div>
  135. </template>
  136. </div>
  137. </el-dialog>
  138. <el-dialog title="通知公告" :visible.sync="showAnnouncement" :close-on-click-modal="false" width="40%">
  139. <div style="display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;min-height:200px;">
  140. <div style="display:flex;flex-direction:row;justify-content:center;align-items:center">
  141. <h1>{{announcementItem.title}}</h1>
  142. </div>
  143. <div style="display:flex;flex-direction:row;justify-content:center;align-items:center;color:gray;margin-top:20px;">
  144. <p>{{announcementItem.persNm}}</p>
  145. <p style="margin-left:10px;">{{announcementItem.orgNm}}</p>
  146. <p style="margin-left:10px;">{{showStrDate(announcementItem.pubTm)}}</p>
  147. </div>
  148. <div v-html="announcementItem.content" class="ql-editor">
  149. <!-- <p ></p> -->
  150. </div>
  151. </div>
  152. </el-dialog>
  153. </div>
  154. </template>
  155. <script>
  156. //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  157. //例如:import 《组件名称》 from '《组件路径》';
  158. import axios from 'axios' //引入axios
  159. //左侧组件
  160. import JcNews from "./jcNews";
  161. import JcNotices from "./jcNotices";
  162. //方法引用脚本
  163. import request from "@util/gw_ajax_request.js";
  164. import echarts from 'echarts';
  165. // import 'echarts/map/js/china.js'
  166. import {dateFormat} from "@util/gw_date.js"
  167. export default {
  168. //import引入的组件需要注入到对象中才能使用
  169. components: {
  170. JcNotices,
  171. JcNews,
  172. },
  173. props: [],
  174. data() {
  175. //这里存放数据
  176. return {
  177. isRead:'',
  178. year:new Date().getFullYear(),
  179. batch:'',
  180. yearoptions: [{
  181. value: '2019',
  182. label: '2019年'
  183. }, {
  184. value: '2018',
  185. label: '2018年'
  186. }, {
  187. value: '2017',
  188. label: '2017年'
  189. }],
  190. round:'1',
  191. roundoptions: [{
  192. value: '1',
  193. label: '第1批'
  194. }, {
  195. value: '2',
  196. label: '第2批'
  197. }, {
  198. value: '3',
  199. label: '第3批'
  200. }],
  201. barData:'', //稽察次数获取data
  202. xData1:[], // 稽察次数X轴数据
  203. yData1:[], //稽察次数y轴数据
  204. questionCount:'', //右侧本年度问题数量
  205. questionPercent:'', //右侧本年度问题百分比数量
  206. percolor:false, //右侧本年度问题箭头方向颜色
  207. progressCount:'', //右侧稽察进度剩余天数
  208. progressPercent:'', //右侧稽察进度百分比
  209. basePieData1:'', //右侧项目类型
  210. objData:[], //右侧项目类型option
  211. legendDataPie1:[], //右侧项目类型option--legend
  212. basePieData2:'', //右侧问题类别
  213. queData:[], //右侧问题类别option
  214. legendDataPie2:[], //右侧问题类别option--legend
  215. themeColor:'rgba(93, 104, 118, 1)',
  216. themeColorSplitLine:'#888ea3',
  217. backgroundChangeColor:'background: rgba(239,240,244,1);',
  218. transformScale:1,
  219. finishNumber:'85',
  220. unfinishNumber:'15',
  221. viewHeight:window.innerHeight, //右侧饼图用的数据开始
  222. viewWidth:window.innerWidth,
  223. itemWidthChart:25,
  224. itemHeightChart:14,
  225. topChart:'',
  226. pcOrPadFontSize:12, //右侧饼图用的数据结束
  227. showAnnouncement:false,
  228. announcementItem:{
  229. "id": "c2219c04336a46bd92163bf0463a773e",
  230. "type": null,
  231. "title": "测试",
  232. "content": "<p>测试</p>",
  233. "url": null,
  234. "note": null,
  235. "persId": "89E69B31FE1344A98316A0153BA7386C",
  236. "persNm": "王晓辰",
  237. "orgId": "041",
  238. "orgNm": "北京金水公司",
  239. "pubState": "0",
  240. "pubTm": null,
  241. "intm": 1561363050000,
  242. "uptm": 1561363050000
  243. },
  244. showAnnouncement2:false,
  245. announcementItem2:{
  246. "id": "c2219c04336a46bd92163bf0463a773e",
  247. "type": null,
  248. "title": "测试",
  249. "content": "<p>测试</p>",
  250. "url": null,
  251. "note": null,
  252. "persId": "89E69B31FE1344A98316A0153BA7386C",
  253. "persNm": "王晓辰",
  254. "orgId": "041",
  255. "orgNm": "北京金水公司",
  256. "pubState": "0",
  257. "pubTm": null,
  258. "intm": 1561363050000,
  259. "uptm": 1561363050000
  260. },
  261. mapPointColor:'#13C5A6',//用于地图关注焦点数字气泡颜色
  262. addvCenters:{},
  263. mapData:[{"name":"天津市","total":"18","objType":null,"adCode":"120000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"辽宁省","total":"10","objType":null,"adCode":"210000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"上海市","total":"7","objType":null,"adCode":"310000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"江西省","total":"50","objType":null,"adCode":"360000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"广东省","total":"103","objType":null,"adCode":"440000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"云南省","total":"22","objType":null,"adCode":"530000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"甘肃省","total":"6","objType":null,"adCode":"620000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"吉林省","total":"10","objType":null,"adCode":"220000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"浙江省","total":"8","objType":null,"adCode":"330000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"广西壮族自治区","total":"50","objType":null,"adCode":"450000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"宁夏回族自治区","total":"3","objType":null,"adCode":"640000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"内蒙古自治区","total":"18","objType":null,"adCode":"150000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"江苏省","total":"21","objType":null,"adCode":"320000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"福建省","total":"12","objType":null,"adCode":"350000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"湖南省","total":"77","objType":null,"adCode":"430000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"海南省","total":"15","objType":null,"adCode":"460000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"贵州省","total":"22","objType":null,"adCode":"520000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"青海省","total":"6","objType":null,"adCode":"630000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"新疆维吾尔自治区","total":"7","objType":null,"adCode":"650000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"重庆市","total":"8","objType":null,"adCode":"500000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"陕西省","total":"6","objType":null,"adCode":"610000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"黑龙江省","total":"9","objType":null,"adCode":"230000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"河南省","total":"124","objType":null,"adCode":"410000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"河北省","total":"63","objType":null,"adCode":"130000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"山东省","total":"79","objType":null,"adCode":"370000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"西藏自治区","total":"5","objType":null,"adCode":"540000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"北京市","total":"32","objType":null,"adCode":"110000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"山西省","total":"24","objType":null,"adCode":"140000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"安徽省","total":"28","objType":null,"adCode":"340000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"湖北省","total":"81","objType":null,"adCode":"420000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"四川省","total":"69","objType":null,"adCode":"510000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null},{"name":"新疆生产建设兵团","total":"6","objType":null,"adCode":"660000000000","children":null,"level":"2","pblmDtoList":null,"objGroupList":null}],
  264. mydata:[],
  265. mapName:'china',
  266. };
  267. },
  268. //监听属性 类似于data概念
  269. computed: {
  270. heightCont(){
  271. if(window.innerWidth <= 1366){
  272. return window.innerHeight *0.17;
  273. }else{
  274. return window.innerHeight *0.15;
  275. }
  276. },
  277. msg(){
  278. // return theme.state.testMsg;
  279. return this.$store.state.theme.testMsg;
  280. },
  281. organNm(){
  282. return localStorage.getItem('currentOrgNm') ? localStorage.getItem('currentOrgNm') : ''
  283. },
  284. organCode(){
  285. return localStorage.getItem('currentRlcode') ? localStorage.getItem('currentRlcode') : ''
  286. },
  287. },
  288. //监控data中的数据变化
  289. watch: {
  290. },
  291. mounted() {
  292. this.getMapData();
  293. this.drawLine();
  294. //获取稽查次数数据
  295. this.getBarData();
  296. //获取本年度问题数
  297. this.getQuestionData();
  298. //获取稽察进度数据
  299. this.getJCProgressData();
  300. //获取项目类型数据
  301. this.getObjTypeData();
  302. //获取问题类别数据
  303. this.getQueTypeData();
  304. if(this.viewWidth >= 1920){
  305. this.itemWidthChart = 25;
  306. this.itemHeightChart = 14;
  307. this.topChart = '85%';
  308. }else if(this.viewWidth <= 1024){
  309. this.itemWidthChart = 5;
  310. this.itemHeightChart = 5;
  311. this.topChart = '85%';
  312. this.pcOrPadFontSize = 8;
  313. }else if(this.viewWidth <= 1360){
  314. this.itemWidthChart = 5;
  315. this.itemHeightChart = 5;
  316. this.topChart = '75%';
  317. this.pcOrPadFontSize = 10;
  318. }else{
  319. this.itemWidthChart = 10;
  320. this.itemHeightChart = 10;
  321. this.topChart = '75%';
  322. }
  323. },
  324. //方法集合
  325. methods: {
  326. //获取中间稽察地图的数据
  327. getMapData(){
  328. request({
  329. url: "/tac/index/getAreaList",
  330. method:'POST',
  331. data: {
  332. year:this.year
  333. }
  334. }).then((response) => {
  335. console.log('mapdataresponse:'+JSON.stringify(response))
  336. if(response.success){
  337. var data = response.data;
  338. for(var i = 0 ;i<data.length;i++){
  339. this.year = data[i].year;
  340. this.batch = data[i].batch;
  341. this.mydata.push({name:data[i].name,value:data[i].value})
  342. }
  343. this.drawLine();
  344. }else{
  345. alert('稽察地图数据获取失败')
  346. }
  347. }).catch(function (err) {
  348. console.log(err);
  349. });
  350. },
  351. //配置中间地图的数据
  352. drawLine:async function(){
  353. // 基于准备好的dom,初始化echarts实例
  354. let myChart = echarts.init(document.getElementById('myChart'))
  355. let geoAdcode = this.organCode.substr(0,6) //省级切换时获取不同的行政区代码
  356. let geoJsonResult = await this.getAddvGeoData(geoAdcode);// 根据行政区划代码请求地图geoJson
  357. console.log(geoJsonResult)
  358. let geoJson = this.getTheCustomGeoDataByOrg(geoJsonResult.data,'');//根据可能的所选机构处理摘出需要的行政区数据
  359. echarts.registerMap(this.mapName, geoJson);//向echart注册地图
  360. // 绘制图表
  361. let option = {
  362. visualMap: {
  363. show:false,
  364. type: 'continuous',
  365. showLabel: true,
  366. seriesIndex: [0],
  367. min: 0,
  368. max:5,
  369. inRange: {
  370. color: ['#edfbfb', '#b7d6f3',]
  371. },
  372. },
  373. tooltip: {
  374. show: true,
  375. formatter: function(params) {
  376. return params.name
  377. },
  378. },
  379. geo: {
  380. roam: false,
  381. map: this.mapName,
  382. label: {
  383. emphasis: {
  384. show: false
  385. }
  386. },
  387. itemStyle: {
  388. emphasis: {
  389. areaColor: '#fff464'
  390. }
  391. },
  392. // 这里是重点!!!
  393. regions: [
  394. {
  395. name: "南海诸岛",
  396. itemStyle: {
  397. // 隐藏地图
  398. normal: {
  399. opacity: 0, // 为 0 时不绘制该图形
  400. }
  401. },
  402. label: {
  403. show: false // 隐藏文字
  404. }
  405. }
  406. ],
  407. top: "50",
  408. bottom: "30",
  409. zoom: 1.2,
  410. },
  411. series: [
  412. {
  413. name: '',
  414. type: 'map',
  415. mapType: this.mapName, // 自定义扩展图表类型
  416. roam: false,
  417. zoom: 1.5,
  418. geoIndex: 0,
  419. itemStyle: {
  420. normal: { label: { show: true } },
  421. emphasis: { label: { show: true } }
  422. },
  423. data: this.mydata
  424. }
  425. ]
  426. };
  427. myChart.setOption(option,true);
  428. // myChart.setOption({
  429. //
  430. // })
  431. },
  432. //年份改变,从新获取数据
  433. yearChange(val){
  434. this.year = val;
  435. //console.log('year:'+this.year);
  436. //获取稽查次数数据
  437. this.getBarData();
  438. //获取本年度问题数
  439. this.getQuestionData();
  440. //获取稽察进度数据
  441. this.getJCProgressData();
  442. //获取项目类型数据
  443. this.getObjTypeData();
  444. //获取问题类别数据
  445. this.getQueTypeData();
  446. },
  447. //获取稽察次数的数据
  448. getBarData(){
  449. request({
  450. url: "/tac/index/countAdcodeAuditByYear",
  451. method:'POST',
  452. data: {
  453. year:this.year
  454. }
  455. }).then((response) => {
  456. //console.log('bardataresponse:'+JSON.stringify(response))
  457. if(response.success){
  458. this.barData = response.data;
  459. this.barChart();
  460. }else{
  461. alert('稽察次数数据获取失败')
  462. }
  463. }).catch(function (err) {
  464. console.log(err);
  465. });
  466. },
  467. //稽察次数柱状图配置
  468. barChart:function(){
  469. var _self = this;
  470. var newbarData = _self.barData;
  471. newbarData.forEach(element => {
  472. _self.xData1.push(element.name.replace(/\省|\市|\自治区|\维吾尔自治区|\生产建设|\壮族|\回族/ig, ''));
  473. _self.yData1.push(element.count);
  474. });
  475. let chart = echarts.init(this.$refs['barChart']);
  476. let option = {
  477. // backgroundColor:'rgba(226,250,255,1)',
  478. grid:{
  479. top:'4%',
  480. bottom:'3%',
  481. left:'3%',
  482. right:'3%',
  483. containLabel:true
  484. },
  485. tooltip: {
  486. trigger: 'axis',
  487. label: {
  488. show: true
  489. },
  490. formatter: function (params) {
  491. return params[0].axisValue + ': ' +params[0].data + '次'
  492. }
  493. },
  494. xAxis: {
  495. axisLabel:{
  496. interval:0,
  497. rotate:30,
  498. color:'rgba(93, 104, 118, 1)'
  499. },
  500. axisLine: {
  501. show: true,
  502. lineStyle:{
  503. color:'#888ea3'
  504. },
  505. },
  506. splitLine: {
  507. show: false
  508. },
  509. axisTick: {
  510. show: false,
  511. alignWithLabel: true
  512. },
  513. type: 'category',
  514. data: _self.xData1
  515. },
  516. // dataZoom: [{
  517. // type: 'slider',
  518. // show: true,
  519. // xAxisIndex: [0],
  520. // left: '9%',
  521. // bottom: -5,
  522. // start: 10,
  523. // end: 90 //初始化滚动条
  524. // }],
  525. yAxis: {
  526. axisLabel:{
  527. interval:3,
  528. show:true,
  529. color:'rgba(93, 104, 118, 1)'
  530. },
  531. axisLine: {
  532. show: false,
  533. },
  534. splitLine: {
  535. interval:3,
  536. show: true,
  537. lineStyle: {
  538. type: 'dashed',
  539. color: '#888ea3'
  540. }
  541. },
  542. axisTick: {
  543. show: false,
  544. interval:3
  545. },
  546. splitArea: {
  547. show: false,
  548. areaStyle: {
  549. color: 'transparent'//浅色主题
  550. // color: ["rgba(250,250,250,0.0)", "rgba(250,250,250,0.05)"]
  551. }
  552. },
  553. type: 'value',
  554. max: function(value) {
  555. return value.max;
  556. },
  557. min: function(value) {
  558. return value.min;
  559. },
  560. // splitNumber:2
  561. },
  562. series: [{
  563. barMaxWidth: '30%',
  564. symbolSize: 7,
  565. lineStyle: {
  566. color: 'rgba(124, 129, 255, 1)',
  567. shadowBlur: 12,
  568. shadowColor: 'rgba(33,148,246,0.9)',
  569. shadowOffsetX: 1,
  570. shadowOffsetY: 1
  571. },
  572. itemStyle: {
  573. borderWidth: 1,
  574. color: 'rgba(124, 129, 255, 1)',
  575. borderColor: 'rgba(124, 129, 255, 1)',
  576. normal: {
  577. barBorderRadius:[5,5,0,0],
  578. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  579. offset: 0,
  580. color: "rgba(171, 228, 255, 1)"
  581. },
  582. {
  583. offset: 1,
  584. color: "rgba(63, 161, 255, 1)"
  585. }
  586. ])
  587. },
  588. },
  589. data: _self.yData1,
  590. type: 'bar',
  591. areaStyle: {
  592. // color: 'rgba(63, 158, 255, 0.3)',
  593. normal: {
  594. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  595. offset: 0,
  596. color: "rgba(171, 228, 255, 1)"
  597. },
  598. {
  599. offset: 1,
  600. color: "rgba(63, 161, 255, 1)"
  601. }
  602. ])
  603. }
  604. }
  605. }]
  606. };
  607. chart.setOption(option);
  608. this.xData1 = [];
  609. this.yData1 = [];
  610. },
  611. //获取右侧本年度问题数据
  612. getQuestionData(){
  613. request({
  614. url: "/tac/index/countPblmByYear",
  615. method:'POST',
  616. data: {
  617. year:this.year
  618. }
  619. }).then((response) => {
  620. //console.log('questionresponse:'+JSON.stringify(response))
  621. if(response.success){
  622. this.questionCount = response.data.count; //右侧本年度问题数量
  623. if(response.data.percent > 0){
  624. this.percolor = true ;
  625. var newper = response.data.percent.toString().replace(/[-]/g,"");
  626. this.questionPercent = newper;
  627. }else{
  628. this.percolor = false;
  629. var newper = response.data.percent.toString().replace(/[-]/g,"");
  630. this.questionPercent = newper;
  631. }
  632. }else{
  633. alert('本年度问题数据获取失败')
  634. }
  635. }).catch(function (err) {
  636. console.log(err);
  637. });
  638. },
  639. //获取右侧稽察进度数据
  640. getJCProgressData(){
  641. request({
  642. url: "/tac/index/countAuditByYear",
  643. method:'POST',
  644. data: {
  645. year:this.year
  646. }
  647. }).then((response) => {
  648. //console.log('jcpressresponse:'+JSON.stringify(response))
  649. if(response.success){
  650. this.progressCount = response.data.count; //右侧本年度问题数量
  651. this.progressPercent = response.data.percent;
  652. }else{
  653. alert('稽察进度数据获取失败')
  654. }
  655. }).catch(function (err) {
  656. console.log(err);
  657. });
  658. },
  659. //获取右侧项目类别数据
  660. getObjTypeData(){
  661. request({
  662. url: "/tac/index/countObjByYear",
  663. method:'POST',
  664. data: {
  665. year:this.year
  666. }
  667. }).then((response) => {
  668. console.log('objTyperesponse:'+JSON.stringify(response))
  669. if(response.success){
  670. this.basePieData1 = response.data;
  671. this.pieChart1();
  672. }else{
  673. alert('问题类别数据获取失败')
  674. }
  675. }).catch(function (err) {
  676. console.log(err);
  677. });
  678. },
  679. //右侧项目类型数据配置
  680. pieChart1:function(){
  681. let _self = this;
  682. let chart = echarts.init(this.$refs['objTypechart']);
  683. var newData = _self.basePieData1;
  684. newData.forEach(element => {
  685. //console.log('elme:'+JSON.stringify(element))
  686. _self.legendDataPie1.push(element.name)
  687. _self.objData.push({'name':element.name,'value':element.count});
  688. });
  689. let option = {
  690. backgroundColor:'rgba(0,0,0,0)',
  691. color:['#5CE9C7','#FEB23A','#E8684A','#5B8FF9','#aff6f4',],
  692. title: {
  693. text: '',
  694. left: 'center',
  695. top: 20,
  696. textStyle: {
  697. color: '#ccc'
  698. }
  699. },
  700. legend: {
  701. textStyle:{
  702. fontSize:10,
  703. color:'#666666'
  704. },
  705. itemWidth: 10, // 设置宽度
  706. itemHeight: 10, // 设置高度
  707. bottom: 10,
  708. left: 'center',
  709. data:_self.legendDataPie1,
  710. icon:'circle',
  711. },
  712. tooltip : {
  713. trigger: 'item',
  714. formatter: "{b} : {c}"
  715. },
  716. series : [
  717. {
  718. name:'项目类型',
  719. type:'pie',
  720. radius : '60%',
  721. center: ['50%', '30%'],
  722. hoverAnimation:false,
  723. data:_self.objData,
  724. label: {
  725. normal: {
  726. show: true,
  727. position: 'outside',
  728. // formatter: '{b}\n{d}%',
  729. // formatter: '{b}:{c}',
  730. formatter(v) {
  731. let text = v.name
  732. return text.length < 4
  733. ? text
  734. : `${text.slice(0,6)}\n${text.slice(6)}`
  735. },
  736. textStyle: {
  737. color: 'rgba(51,51,51,1)'
  738. }
  739. }
  740. // normal:{
  741. // }
  742. },
  743. labelLine: {
  744. normal: {
  745. show:true,
  746. length: 6,
  747. }
  748. },
  749. animationType:'expansion'
  750. },
  751. {
  752. name:'项目类型',
  753. type:'pie',
  754. radius : '60%',
  755. center: ['50%', '30%'],
  756. hoverAnimation:false,
  757. data:_self.objData,
  758. label: {
  759. normal: {
  760. show: true,
  761. position: 'inner',
  762. formatter: function(params, ticket, callback) {
  763. var total = 0;
  764. var percent = 0;
  765. _self.objData.forEach(function(value, index, array) {
  766. total += Number(value.value);
  767. });
  768. if(total != 0){
  769. percent = ((params.value / total) * 100).toFixed(0);
  770. return percent + '%';
  771. }else{
  772. return 0 + '%';;
  773. }
  774. },
  775. textStyle: {
  776. color: 'rgba(255,255,255,1)'
  777. }
  778. }
  779. },
  780. animationType:'expansion'
  781. },
  782. ],
  783. };
  784. chart.setOption(option,true);
  785. _self.objData = []
  786. },
  787. //获取问题类别数据
  788. getQueTypeData(){
  789. request({
  790. url: "/tac/index/countPblmInfoByYear",
  791. method:'POST',
  792. data: {
  793. year:this.year
  794. }
  795. }).then((response) => {
  796. //console.log('queTyperesponse:'+JSON.stringify(response))
  797. if(response.success){
  798. this.basePieData2 = response.data;
  799. this.pieChart2();
  800. }else{
  801. alert('问题类别数据获取失败')
  802. }
  803. }).catch(function (err) {
  804. console.log(err);
  805. });
  806. },
  807. //右侧问题类别数据配置
  808. pieChart2:function(){
  809. let _self = this;
  810. let chart = echarts.init(this.$refs['problempiechart']);
  811. var newData = _self.basePieData2;
  812. newData.forEach(element => {
  813. //console.log('elme:'+JSON.stringify(element))
  814. _self.legendDataPie2.push(element.name)
  815. _self.queData.push({'name':element.name,'value':element.count});
  816. });
  817. let option = {
  818. backgroundColor:'rgba(0,0,0,0)',
  819. color:['#0195F2','#5CE9C7','#FED172','#FB6086','#F235D8','#20F274'],
  820. title: {
  821. text: '',
  822. left: 'center',
  823. bottom:10,
  824. textStyle: {
  825. color: '#ccc'
  826. }
  827. },
  828. legend: {
  829. icon:'circle',
  830. orient: 'horizontal',
  831. textStyle:{
  832. fontSize:10,
  833. color:'#666666'
  834. },
  835. itemWidth: 10, // 设置宽度
  836. itemHeight: 10, // 设置高度
  837. bottom:10,
  838. left : 'center',
  839. data:_self.legendDataPie2,
  840. },
  841. tooltip : {
  842. trigger: 'item',
  843. formatter: "{b} : {c} "
  844. },
  845. series : [
  846. {
  847. name:'问题类别',
  848. type:'pie',
  849. // radius : ['40%','60%'],
  850. radius : ['25%','50%'],
  851. center: ['50%', '35%'],
  852. data:_self.queData,
  853. label: {
  854. normal: {
  855. show: true,
  856. position: 'outside',
  857. formatter: '{b}',
  858. textStyle: {
  859. color: 'rgba(51,51,51,1)'
  860. }
  861. }
  862. },
  863. labelLine: {
  864. normal: {
  865. show:true,
  866. length: 6,
  867. }
  868. },
  869. animationType:'expansion'
  870. },
  871. {
  872. name:'问题类别',
  873. type:'pie',
  874. // radius : ['40%','60%'],
  875. radius : ['25%','50%'],
  876. center: ['50%', '35%'],
  877. data:_self.queData,
  878. label: {
  879. normal: {
  880. show: true,
  881. position: 'inner',
  882. formatter: function(params, ticket, callback) {
  883. var total = 0;
  884. var percent = 0;
  885. _self.queData.forEach(function(value, index, array) {
  886. total += Number(value.value);
  887. });
  888. if(total != 0){
  889. percent = ((params.value / total) * 100).toFixed(0);
  890. return percent + '%';
  891. }else{
  892. return 0 + '%';;
  893. }
  894. },
  895. textStyle: {
  896. color: 'rgba(255,255,255,1)'
  897. }
  898. }
  899. },
  900. animationType:'expansion'
  901. }
  902. ],
  903. animationDuration: '400',
  904. animationDurationUpdate:'400',
  905. animationEasing: 'cubicOut',
  906. animationEasingUpdate: 'cubicOut',
  907. };
  908. chart.setOption(option,true);
  909. _self.queData = []
  910. },
  911. //弹框公告日期处理
  912. showStrDate:function(pubTm){
  913. //console.log(pubTm)
  914. if(pubTm){
  915. let d = new Date(pubTm);
  916. return dateFormat(d,'yyyy-MM-dd');
  917. }else{
  918. return '';
  919. }
  920. },
  921. //弹框消息(稽察批次)日期处理
  922. showNewsDate:function(pubTm){
  923. //console.log(pubTm)
  924. if(pubTm){
  925. let d = new Date(pubTm);
  926. return dateFormat(d,'yyyy年MM月dd日');
  927. }else{
  928. return '';
  929. }
  930. },
  931. showAnnouncementHandler:function(params){
  932. this.showAnnouncement = true;
  933. this.announcementItem = params.announcement.item;
  934. },
  935. showNewsHandler:function(params){
  936. this.showAnnouncement2 = true;
  937. //console.log('newsparam:'+JSON.stringify(params.newsDetail.item))
  938. //let currentUrl = window.location.href.split("#")[0] +'#/inspection_Index';
  939. this.announcementItem2 = params.newsDetail.item;
  940. if(params.newsDetail.item.type == '3'){
  941. request({
  942. url: `/tac/insp/year/batch/group/meg/${params.newsDetail.item.id}`,
  943. method:'get',
  944. data: {
  945. }
  946. }).then((response) => {
  947. console.log('newsType3response:'+JSON.stringify(response))
  948. if(response.success){
  949. this.announcementItem2 = response.data;
  950. console.log('newsparam:'+JSON.stringify(this.announcementItem2))
  951. }else{
  952. console.log('稽察任务提示数据获取失败')
  953. }
  954. }).catch(function (err) {
  955. console.log(err);
  956. });
  957. }
  958. },
  959. getTheCustomGeoDataByOrg(originalGeoJson,useAdName){
  960. /*该方法接收原本的geoJson,从中挑选出所选机构涉及的行政区(其余的不要了) */
  961. let usedGeoJson = [];
  962. let originalGeoObject = {};
  963. originalGeoJson.features.forEach(item=>{//将要处理的originalGeoJson的Features数组转化为以adCode做key的对象,方便后续根据业务数据进行查找,避免嵌套循环
  964. originalGeoObject[item.id] = item;
  965. });
  966. this.mapData.forEach((dataItem)=>{//根据业务数据,将业务数据包含的行政区划代码对应的geo数据放到数组里以过滤不涉及的行政区划
  967. if(originalGeoObject[dataItem.adCode.substr(0,6)]){
  968. usedGeoJson.push(originalGeoObject[dataItem.adCode.substr(0,6)]);
  969. }
  970. });
  971. let _self = this;
  972. usedGeoJson.forEach(item=>{//在挑选完需要保留的geo数据后,将中间点取出单独存储,供散点图使用。防止过度嵌套的for循环影像效率。
  973. _self.addvCenters[item.properties.name] = item.properties.cp;
  974. });
  975. // originalGeoJson.features = usedGeoJson;//将处理过后的features赋回原有对象,保持对象格式,便于echarts引用
  976. // 2019.06.19 因为政治问题保留全部数据
  977. return originalGeoJson;
  978. },
  979. convertData:function() {//制作散点数据。
  980. var res = [];
  981. let _self = this;
  982. let mapSeriesData = _self.mapData;
  983. for (var i = 0; i < mapSeriesData.length; i++) {
  984. var geoCoord = _self.addvCenters[mapSeriesData[i].name];
  985. if (geoCoord) {
  986. res.push({
  987. name: mapSeriesData[i].name,
  988. value: geoCoord.concat(Number(mapSeriesData[i].total)),
  989. });
  990. }
  991. }
  992. return res;
  993. },
  994. getChartSeriesData:function(){
  995. let seriesData =this.convertData();
  996. //console.log(seriesData);
  997. return seriesData;
  998. },
  999. getChartOption:function(){
  1000. var _self = this;
  1001. //console.log(this.mapData);
  1002. let seriesData = this.getChartSeriesData();
  1003. let option = {
  1004. title: {
  1005. text: '',
  1006. left: 'center',
  1007. },
  1008. tooltip: {
  1009. show:false
  1010. },
  1011. geo: {
  1012. itemStyle: {
  1013. normal: {
  1014. borderColor:'#778387',
  1015. borderWidth: 1,
  1016. },
  1017. },
  1018. show: true,
  1019. map: this.mapName,
  1020. label: {
  1021. show: false,
  1022. normal: {
  1023. show: false
  1024. },
  1025. emphasis: {
  1026. show: false,
  1027. }
  1028. },
  1029. roam: false,
  1030. // zoom: 1.2,
  1031. },
  1032. visualMap: {
  1033. show: false,
  1034. min: 0,
  1035. max: 800,
  1036. left: 'left',
  1037. top: 'bottom',
  1038. text: ['高', '低'],
  1039. textStyle: {
  1040. color: '#ccc'
  1041. },
  1042. calculable: true,
  1043. seriesIndex: [1],
  1044. inRange: {
  1045. // color:['rgb(186,231,248)','rgb(92,168,222)']
  1046. color:'rgb(195,240,255)'
  1047. }
  1048. },
  1049. series: [
  1050. {
  1051. left:'20%',
  1052. // name: '散点',
  1053. tooltip: {
  1054. show:true,
  1055. formatter:function (params) { return params.name + ': ' + params.value[2] },
  1056. },
  1057. type: 'scatter',
  1058. coordinateSystem: 'geo',
  1059. symbol: 'pin', //气泡
  1060. symbolSize:40,
  1061. data:seriesData,
  1062. label: {
  1063. normal: {
  1064. show: true,
  1065. formatter:function (params) { return params.value[2] },
  1066. textStyle: {
  1067. fontSize: 12,
  1068. }
  1069. },
  1070. emphasis: {
  1071. show: false
  1072. }
  1073. },
  1074. itemStyle: {
  1075. normal: {
  1076. color:'#13C5A6',
  1077. borderColor: '#fff',
  1078. borderWidth: 1,
  1079. borderType: 'solid',
  1080. }
  1081. }
  1082. },
  1083. {
  1084. type: 'map',
  1085. map: this.mapName,
  1086. geoIndex: 0,
  1087. aspectScale: 0.75, //长宽比
  1088. showLegendSymbol: false, // 存在legend时显示
  1089. label: {
  1090. show: false,
  1091. },
  1092. roam: false,
  1093. animation: false,
  1094. data: seriesData
  1095. },
  1096. ]
  1097. };
  1098. return option;
  1099. },
  1100. refreshTheChart:async function(){
  1101. // 准备工作
  1102. let _self = this;
  1103. let myChart = echarts.init(document.getElementById('jcmapChart'));
  1104. // 处理地图数据
  1105. let geoAdcode = this.organCode.substr(0,6) //省级切换时获取不同的行政区代码
  1106. let geoJsonResult = await this.getAddvGeoData(geoAdcode);// 根据行政区划代码请求地图geoJson
  1107. let geoJson = _self.getTheCustomGeoDataByOrg(geoJsonResult.data,'');//根据可能的所选机构处理摘出需要的行政区数据
  1108. echarts.registerMap(this.mapName, geoJson);//向echart注册地图
  1109. // 获取option
  1110. let option = _self.getChartOption();
  1111. myChart.setOption(option,true);
  1112. },
  1113. getAddvGeoData:function(adCode){
  1114. let geoJsonName = adCode+"DATA.json";
  1115. return axios.get('/src/assets/addvGeoData/'+geoJsonName);
  1116. },
  1117. autoSetScale() {
  1118.     let zoom = (window.innerHeight / 1080).toFixed(3)
  1119.     this.transformScale = `scale(${zoom})`
  1120.     this.width = `${(window.innerWidth * zoom).toFixed(2)}px`
  1121.     }
  1122. },
  1123. //生命周期 - 创建完成(可以访问当前this实例)
  1124. created() {},
  1125. //生命周期 - 挂载完成(可以访问DOM元素)
  1126. beforeCreate() {}, //生命周期 - 创建之前
  1127. beforeMount() {}, //生命周期 - 挂载之前
  1128. beforeUpdate() {}, //生命周期 - 更新之前
  1129. updated() {}, //生命周期 - 更新之后
  1130. beforeDestroy() {}, //生命周期 - 销毁之前
  1131. destroyed() {}, //生命周期 - 销毁完成
  1132. activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
  1133. };
  1134. </script>
  1135. <style lang="scss" scoped>
  1136. // @media screen and (min-width: 1024px) and (max-width:1360px) {
  1137. // @import "@scss/home1024";
  1138. // .mainDiv {
  1139. // padding: 5px;
  1140. // // background: rgb(255, 255, 255);
  1141. // }
  1142. // }
  1143. @media screen and (min-width: 1024px) and (max-width:1920px){
  1144. @import "@scss/jchome";
  1145. .mainDiv {
  1146. padding: 15px;
  1147. // background: rgb(255, 255, 255);
  1148. }
  1149. }
  1150. @media screen and (min-width: 1920px) {
  1151. @import "@scss/jchome1920";
  1152. .mainDiv {
  1153. padding: 20px;
  1154. // background: rgb(255, 255, 255);
  1155. }
  1156. }
  1157. </style>