ea44b15e0821f6f7574a57a2749b25e7e7667288.svn-base 73 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923
  1. <!-- -->
  2. <template>
  3. <div>
  4. <el-row>
  5. <el-container>
  6. <el-header style="height: 5vh;padding: 10px 10px;">
  7. <el-form :inline="true" class="demo-form-inline">
  8. <el-form-item label="统计分类">
  9. <el-select v-model="search_type" placeholder="统计分类" @change="changeType" >
  10. <el-option label="专业" value="1"></el-option>
  11. <el-option label="责任主体" value="2"></el-option>
  12. <el-option label="地区" value="3"></el-option>
  13. <el-option label="问题发生频度" value="4"></el-option>
  14. <el-option label="贫困地区" value="5"></el-option>
  15. </el-select>
  16. </el-form-item>
  17. <el-form-item label="对比年度">
  18. <el-select v-model="search_year" placeholder="对比年度" @change="addContrastYear" clearable >
  19. <el-option v-for="item in yearList" :label="item.year" :value="item.year" :key="item.id"></el-option>
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item label="批次">
  23. <el-select v-model="search_batch" placeholder="批次">
  24. <el-option v-for="item in pcList" :label="item.batch" :value="item.batch" :key="item.id"></el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item label="督查状态">
  28. <el-select v-model="search_status" placeholder="督查状态">
  29. <el-option label="专家" value="3" ></el-option>
  30. <el-option label="提交意见稿" value="4" ></el-option>
  31. <el-option label="成果讨论阶段" value="5" ></el-option>
  32. <el-option label="中心修改阶段" value="6" ></el-option>
  33. <el-option label="四局修改阶段" value="7" ></el-option>
  34. </el-select>
  35. </el-form-item>
  36. <el-button type="primary" size="mini" @click="searchData">查询</el-button>
  37. </el-form>
  38. </el-header>
  39. <el-main style="padding:0;">
  40. <el-row>
  41. <el-col :span="12">
  42. <div style="width:100%;" :style="{'height': colHeight/2 - 40 + 'px'}" ref="pie_chart" ></div>
  43. </el-col>
  44. <el-col :span="12">
  45. <div style="width:100%;" :style="{'height': colHeight/2 - 40 + 'px'}" ref="total_bar_chart"></div>
  46. </el-col>
  47. </el-row>
  48. <el-row>
  49. <el-col :span="12">
  50. <div style="width:100%;" :style="{'height': colHeight/2 - 40 + 'px'}" ref="normal_bar_chart"></div>
  51. </el-col>
  52. <el-col :span="12">
  53. <div style="width:100%;" :style="{'height': colHeight/2 - 40 + 'px'}" ref="serious_bar_chart"></div>
  54. </el-col>
  55. </el-row>
  56. </el-main>
  57. </el-container>
  58. </el-row>
  59. </div>
  60. </template>
  61. <script>
  62. //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  63. //例如:import 《组件名称》 from '《组件路径》';
  64. import echarts from 'echarts'
  65. import request from "../../../utils/gw_ajax_request"
  66. import {
  67. getTree,
  68. } from "../../../api/InspectionReport.js";
  69. export default {
  70. //import引入的组件需要注入到对象中才能使用
  71. components: {},
  72. data() {
  73. //这里存放数据
  74. return {
  75. //专业饼图数据
  76. countToNormal:0,
  77. countToHeavier:0,
  78. countToSerious:0,
  79. countTotalHeavierAndSerious:0,
  80. countTotalNormal:0,
  81. countToNormal_DB:0,
  82. countToHeavier_DB:0,
  83. countToSerious_DB:0,
  84. countTotalHeavierAndSerious_DB:0,
  85. countTotalNormal_DB:0,
  86. echartData_ProfessionOrPoverty:[],
  87. //责任主体饼图数据
  88. mainBodyNum:[],
  89. normalNum:[],
  90. heavierNum:[],
  91. seriousNum:[],
  92. xName:[],
  93. //地区数据
  94. areaData:[],
  95. avgNumOfArea:0,
  96. avgAreaLists:[],
  97. //发现问题的专业分布情况
  98. problemNumCount:[],
  99. problemNumCount_DB:[],
  100. problemNumName:[],
  101. proportionLists:[],
  102. proportionLists_DB:[],
  103. heavierAndSeriousLists:[],
  104. heavierAndSeriousLists_DB:[],
  105. problemNumCountHeavier:[],
  106. problemNumCountSerious:[],
  107. problemNumNameHeavierAndSerious:[],
  108. problemNumNameHeavierAndSeriousZb:[],
  109. problemNumCountHeavier_DB:[],
  110. problemNumCountSerious_DB:[],
  111. problemNumNameHeavierAndSerious_DB:[],
  112. problemNumNameHeavierAndSeriousZb_DB:[],
  113. problemNumCountNormal:[],
  114. problemNumNameNormal:[],
  115. problemNumNameNormalZb:[],
  116. problemNumCountNormal_DB:[],
  117. problemNumNameNormal_DB:[],
  118. problemNumNameNormalZb_DB:[],
  119. normalLists:[],
  120. normalLists_DB:[],
  121. yearList:[],
  122. pcList:[],
  123. needToChangeChart_pie:true,
  124. needToChangeChart_responsible_bar:false,
  125. search_type:"1",
  126. search_year:"",
  127. search_batch:"",
  128. search_status:"",
  129. filterText: '',
  130. region:"",
  131. leftWidth: 4,
  132. rightWidth: 20,
  133. isOpen: true,
  134. treeDataLists: [],
  135. defaultExpanded:[],//树默认展开节点数组
  136. defaultProps: {
  137. children: 'children',
  138. label: 'pnm'
  139. },
  140. colHeight:window.innerHeight - 90,
  141. proCountNum:[128,115,100,94,86,50],
  142. proporNum:[22,20,17,16,15,9],
  143. addYear:[],
  144. addYearTotal_BarLineChart:[],
  145. addYearNormal_BarLineChart:[]
  146. };
  147. },
  148. //监听属性 类似于data概念
  149. computed: {},
  150. //监控data中的数据变化
  151. watch: {
  152. filterText(val) {
  153. this.$refs.tree2.filter(val);
  154. },
  155. // search_type(n,o){
  156. // if( n == '2'){
  157. // this.needToChangeChart_pie = false;
  158. // this.needToChangeChart_responsible_bar = true;
  159. // this.init_Responsible_BarLineChart();
  160. // }
  161. // }
  162. },
  163. //方法集合
  164. methods: {
  165. async getYearPc(){
  166. await request.post(`/tac/insp/year/list`,{}).then(res =>{
  167. if(res.success){
  168. this.$nextTick(() =>{
  169. this.yearList = res.data;
  170. })
  171. }
  172. })
  173. request.post(`/tac/insp/batch/list`,{}).then(res =>{
  174. if(res.success){
  175. this.pcList = res.data;
  176. }
  177. })
  178. },
  179. //饼图-专业
  180. getDataChartData(){
  181. var _self = this;
  182. request.post(`/tac/pblm/info/countPblmInfoByStb`,{}).then(res =>{//正确的接口地址
  183. // request.post(`/tac/pblm/info/countPblmInfoBySub`,{}).then(res =>{//测试接口地址
  184. if(res.success){
  185. res.data.sort(function (a, b) {
  186. var value1 = a['count'];
  187. var value2 = b['count'];
  188. return value2 - value1;
  189. });
  190. res.data.forEach(ele => {
  191. _self.countToNormal += Number(ele.normal);
  192. _self.countToHeavier += Number(ele.heavier);
  193. _self.countToSerious += Number(ele.serious);
  194. });
  195. _self.echartData_ProfessionOrPoverty = [
  196. {
  197. "value":_self.countToNormal,
  198. "name": "一般问题"
  199. },
  200. {
  201. "value":_self.countToHeavier,
  202. "name": "严重问题"
  203. },
  204. {
  205. "value":_self.countToSerious,
  206. "name": "较重问题"
  207. },
  208. ]
  209. this.initPieChart();
  210. }
  211. })
  212. },
  213. //柱状图-发现问题的专业分布情况
  214. getBarChartData(){
  215. var _self = this;
  216. let params = {
  217. "year" : _self.search_year
  218. }
  219. request.post(`/tac/pblm/info/countPblmInfoByStb`,{params}).then(res =>{//正确的接口地址
  220. // request.post(`/tac/pblm/info/countPblmInfoBySub`,{}).then(res =>{//测试接口地址
  221. let countTotal = 0;
  222. _self.countTotalHeavierAndSerious = 0;
  223. _self.countTotalNormal = 0;
  224. if(res.success){
  225. res.data.sort(function (a, b) {
  226. var value1 = a['count'];
  227. var value2 = b['count'];
  228. return value2 - value1;
  229. });
  230. res.data.forEach(ele => {
  231. _self.problemNumCount.push(Number(ele.count));
  232. _self.problemNumName.push(ele.name);
  233. countTotal += Number(ele.count);
  234. _self.heavierAndSeriousLists.push({
  235. "countSum":Number(ele.heavier) + Number(ele.serious),
  236. "heavier":Number(ele.heavier),
  237. "serious":Number(ele.serious),
  238. "name":ele.name,
  239. })
  240. _self.normalLists.push({
  241. "normal":Number(ele.normal),
  242. "name":ele.name,
  243. })
  244. });
  245. _self.heavierAndSeriousLists.sort(
  246. function (a, b) {
  247. var value1 = a['countSum'];
  248. var value2 = b['countSum'];
  249. return value2 - value1;
  250. });
  251. _self.normalLists.sort(
  252. function (a, b) {
  253. var value1 = a['normal'];
  254. var value2 = b['normal'];
  255. return value2 - value1;
  256. });
  257. _self.heavierAndSeriousLists.forEach(ele =>{
  258. _self.countTotalHeavierAndSerious += Number(ele.countSum);
  259. })
  260. _self.normalLists.forEach(ele =>{
  261. _self.countTotalNormal += Number(ele.normal);
  262. })
  263. _self.heavierAndSeriousLists.forEach(ele =>{
  264. _self.problemNumCountHeavier.push(Number(ele.heavier));
  265. _self.problemNumCountSerious.push(Number(ele.serious));
  266. _self.problemNumNameHeavierAndSerious.push(ele.name);
  267. _self.problemNumNameHeavierAndSeriousZb.push(parseInt((ele.countSum / _self.countTotalHeavierAndSerious) * 100));
  268. })
  269. _self.normalLists.forEach(ele =>{
  270. _self.problemNumCountNormal.push(Number(ele.normal));
  271. _self.problemNumNameNormal.push(ele.name);
  272. _self.problemNumNameNormalZb.push(parseInt((ele.normal / _self.countTotalNormal) * 100));
  273. })
  274. _self.problemNumCount.forEach(ele => {
  275. _self.proportionLists.push((ele / countTotal) * 100);
  276. });
  277. this.init_Total_BarLineChart();
  278. this.init_Serious_BarLineChart();
  279. this.init_Normal_BarLineChart();
  280. }
  281. })
  282. },
  283. getBarChartData_DB(){
  284. var _self = this;
  285. let params = {
  286. "year" : _self.search_year
  287. }
  288. request.post(`/tac/pblm/info/countPblmInfoByStb`,params).then(res =>{//正确的接口地址
  289. // request.post(`/tac/pblm/info/countPblmInfoBySub`,{}).then(res =>{//测试接口地址
  290. let countTotal = 0;
  291. _self.countTotalHeavierAndSerious_DB = 0;
  292. _self.countTotalNormal_DB = 0;
  293. if(res.success){
  294. res.data.sort(function (a, b) {
  295. var value1 = a['count'];
  296. var value2 = b['count'];
  297. return value2 - value1;
  298. });
  299. res.data.forEach(ele => {
  300. _self.problemNumCount_DB.push(Number(ele.count));
  301. // _self.problemNumName.push(ele.name);
  302. countTotal += Number(ele.count);
  303. _self.heavierAndSeriousLists_DB.push({
  304. "countSum":Number(ele.heavier) + Number(ele.serious),
  305. "heavier":Number(ele.heavier),
  306. "serious":Number(ele.serious),
  307. "name":ele.name,
  308. })
  309. _self.normalLists_DB.push({
  310. "normal":Number(ele.normal),
  311. "name":ele.name,
  312. })
  313. });
  314. _self.heavierAndSeriousLists_DB.sort(
  315. function (a, b) {
  316. var value1 = a['countSum'];
  317. var value2 = b['countSum'];
  318. return value2 - value1;
  319. });
  320. _self.normalLists_DB.sort(
  321. function (a, b) {
  322. var value1 = a['normal'];
  323. var value2 = b['normal'];
  324. return value2 - value1;
  325. });
  326. _self.heavierAndSeriousLists_DB.forEach(ele =>{
  327. _self.countTotalHeavierAndSerious += Number(ele.countSum);
  328. })
  329. _self.normalLists_DB.forEach(ele =>{
  330. _self.countTotalNormal_DB += Number(ele.normal);
  331. })
  332. _self.heavierAndSeriousLists_DB.forEach(ele =>{
  333. _self.problemNumCountHeavier_DB.push(Number(ele.heavier));
  334. _self.problemNumCountSerious_DB.push(Number(ele.serious));
  335. // _self.problemNumNameHeavierAndSerious_DB.push(ele.name);
  336. _self.problemNumNameHeavierAndSeriousZb_DB.push(parseInt((ele.countSum / _self.countTotalHeavierAndSerious_DB) * 100));
  337. })
  338. _self.normalLists_DB.forEach(ele =>{
  339. _self.problemNumCountNormal_DB.push(Number(ele.normal));
  340. // _self.problemNumNameNormal_DB.push(ele.name);
  341. _self.problemNumNameNormalZb_DB.push(parseInt((ele.normal / _self.countTotalNormal_DB) * 100));
  342. })
  343. _self.problemNumCount_DB.forEach(ele => {
  344. _self.proportionLists_DB.push((ele / countTotal) * 100);
  345. });
  346. this.init_Total_BarLineChart();
  347. this.init_Serious_BarLineChart();
  348. this.init_Normal_BarLineChart();
  349. }
  350. })
  351. },
  352. //饼图-责任主体
  353. getResponsibilityData(){
  354. var _self = this;
  355. request.post(`/tac/pblm/info/countPblmInfoBySub`,{}).then(res =>{
  356. if(res.success){
  357. let count = 0;
  358. res.data.forEach(ele =>{
  359. //主体个数
  360. _self.mainBodyNum.push(Number(ele.count));
  361. _self.normalNum.push(Number(ele.normal));
  362. _self.heavierNum.push(Number(ele.heavier));
  363. _self.seriousNum.push(Number(ele.serious));
  364. _self.xName.push(ele.name);
  365. })
  366. this.initPieChart();
  367. }
  368. })
  369. },
  370. //柱图-地区
  371. getAreaData(){
  372. var _self = this;
  373. request.post(`/tac/pblm/info/countPblmInfoByAdCode`,{}).then(res =>{
  374. if(res.success){
  375. let countNum = 0;
  376. res.data.sort(function (a, b) {
  377. var value1 = a['count'];
  378. var value2 = b['count'];
  379. return value2 - value1;
  380. });
  381. res.data.forEach(ele =>{
  382. _self.areaData.push(Number(ele.count));
  383. _self.xName.push(ele.name);
  384. countNum += Number(ele.count);
  385. })
  386. // _self.areaData.sort(function(a, b){
  387. // return b - a
  388. // });
  389. _self.avgNumOfArea = countNum / res.data.length;
  390. for(let i = 0; i < res.data.length; i++){
  391. _self.avgAreaLists.push(parseInt(_self.avgNumOfArea));
  392. }
  393. this.initPieChart();
  394. }
  395. })
  396. },
  397. //饼图-贫困地区
  398. getPovertyData(){
  399. var _self = this;
  400. let params = {
  401. 'isPoverty': "1",
  402. };
  403. request.post(`/tac/pblm/info/countPblmInfoByAdCode`,{params}).then(res =>{
  404. if(res.success){
  405. if(res.success){
  406. if(res.data.length != 0){
  407. res.data.forEach(ele => {
  408. _self.countToNormal += Number(ele.normal);
  409. _self.countToHeavier += Number(ele.heavier);
  410. _self.countToSerious += Number(ele.serious);
  411. });
  412. _self.echartData_ProfessionOrPoverty = [
  413. {
  414. "value":_self.countToNormal,
  415. "name": "一般问题"
  416. },
  417. {
  418. "value":_self.countToHeavier,
  419. "name": "严重问题"
  420. },
  421. {
  422. "value":_self.countToSerious,
  423. "name": "较重问题"
  424. },
  425. ]
  426. }else{
  427. _self.echartData_ProfessionOrPoverty = [
  428. {
  429. "value":0,
  430. "name": "一般问题"
  431. },
  432. {
  433. "value":0,
  434. "name": "严重问题"
  435. },
  436. {
  437. "value":0,
  438. "name": "较重问题"
  439. },
  440. ]
  441. }
  442. this.initPieChart();
  443. }
  444. }
  445. })
  446. },
  447. getTreeData:function(){
  448. let _self = this;
  449. getTree('008','1').then((res)=>{
  450. _self.treeDataLists =_self.filterTreeData(res.data[0].children,9);
  451. _self.treeDataLists;
  452. // 默认隐藏到批次
  453. // _self.treeDataLists.forEach((element) => {
  454. // _self.defaultExpanded.push(element.id);
  455. // });
  456. });
  457. _self.defaultExpanded.unshift("008");
  458. },
  459. compare(value1, value2) {
  460. if(value1 > value2){
  461. return -1;
  462. }else if(value1 < value2){
  463. return 1;
  464. }else{
  465. return 0;
  466. }
  467. },
  468. /**
  469. * 通过判断某个属性,截取全部树结构中符合该条件的节点
  470. * @param {String} arr 旧树结构数据
  471. * @param {String} id the old mime-type
  472. * @return the new mime-type
  473. */
  474. filterTreeData(arr, id) {
  475. var _self = this;
  476. for (var i = 0; i < arr.length; i++) {
  477. var el = arr[i]
  478. if (el.id.length <= id) {
  479. if (el.children && el.children.length) {
  480. _self.filterTreeData(el.children, id)
  481. }
  482. } else {
  483. arr.splice(i, arr.length)
  484. }
  485. }
  486. return arr
  487. },
  488. closeLeft(){
  489. this.isOpen = false
  490. this.leftWidth = 0
  491. this.rightWidth = 24
  492. },
  493. openLeft(){
  494. this.isOpen = true
  495. this.leftWidth = 5
  496. this.rightWidth = 19
  497. },
  498. filterNode(value, data) {
  499. if (!value) return true;
  500. return data.pnm.indexOf(value) !== -1;
  501. },
  502. //树节点点击事件
  503. treeNodeClickHandler:function(data,node,tree){
  504. if(node.childNodes.length == 0){
  505. this.currentNodeId = data.id;
  506. this.projectName = data.pnm;
  507. this.objId = data.objId;
  508. this.inspGroupId = data.pid;
  509. this.reallMenuLists = [];
  510. this.getMenu();
  511. }else{
  512. return;
  513. }
  514. },
  515. changeType(item){
  516. // alert(this.search_type)
  517. this.xName = [];
  518. this.mainBodyNum = [];
  519. this.normalNum = [];
  520. this.heavierNum = [];
  521. this.seriousNum = [];
  522. this.areaData = [];
  523. this.problemNumCount = [];
  524. this.problemNumName = [];
  525. this.proportionLists = [];
  526. this.problemNumCount=[],
  527. this.problemNumCount_DB=[];
  528. this.proportionLists_DB=[];
  529. this.heavierAndSeriousLists=[];
  530. this.heavierAndSeriousLists_DB=[];
  531. this.problemNumCountHeavier=[];
  532. this.problemNumCountSerious=[];
  533. this.problemNumNameHeavierAndSerious=[];
  534. this.problemNumNameHeavierAndSeriousZb=[];
  535. this.problemNumCountHeavier_DB=[];
  536. this.problemNumCountSerious_DB=[];
  537. this.problemNumNameHeavierAndSerious_DB=[];
  538. this.problemNumNameHeavierAndSeriousZb_DB=[];
  539. this.problemNumCountNormal=[];
  540. this.problemNumNameNormal=[];
  541. this.problemNumNameNormalZb=[];
  542. this.problemNumCountNormal_DB=[];
  543. this.problemNumNameNormal_DB=[];
  544. this.problemNumNameNormalZb_DB=[];
  545. this.countToNormal = 0;
  546. this.countToHeavier = 0;
  547. this.countToSerious = 0;
  548. this.countTotalHeavierAndSerious = 0;
  549. this.countTotalNormal = 0;
  550. if(item == 1){
  551. this.getDataChartData();
  552. }else if(item == 2){
  553. this.getResponsibilityData();
  554. }else if (item == 3){
  555. this.getAreaData();
  556. }else{
  557. this.getPovertyData();
  558. }
  559. },
  560. initPieChart:function(){
  561. var _self = this;
  562. let chart = echarts.init(this.$refs['pie_chart']);
  563. var scale = 1;
  564. var echartData = _self.echartData_ProfessionOrPoverty;
  565. // var echartData_poverty = [{
  566. // value: 159,
  567. // name: '一般问题'
  568. // }, {
  569. // value: 16,
  570. // name: '严重问题'
  571. // }, {
  572. // value: 94,
  573. // name: '较重问题'
  574. // }]
  575. var rich = {
  576. yellow: {
  577. color: "#ffc72b",
  578. fontSize: 30 * scale,
  579. padding: [5, 4],
  580. align: 'center'
  581. },
  582. black: {
  583. // color: "#3a3a3a",
  584. fontSize: 30 * scale,
  585. padding: [5, 4],
  586. align: 'center'
  587. },
  588. blackSmall: {
  589. // color: "#3a3a3a",
  590. fontSize: 16 * scale,
  591. padding: [5, 4],
  592. align: 'center'
  593. },
  594. total: {
  595. // color: "#ffc72b",
  596. fontSize: 40 * scale,
  597. align: 'center'
  598. },
  599. white: {
  600. // color: "#fff",
  601. align: 'center',
  602. fontSize: 14 * scale,
  603. padding: [21, 0]
  604. },
  605. blue: {
  606. color: '#49dff0',
  607. fontSize: 16 * scale,
  608. align: 'center'
  609. },
  610. hr: {
  611. borderColor: '#3a3a3a',
  612. width: '100%',
  613. borderWidth: 1,
  614. height: 0,
  615. }
  616. }
  617. let option = {
  618. title: {
  619. text:'发现问题的严重程度分布情况',
  620. top: '3%',
  621. left: '10%',
  622. // padding:[24,0],
  623. textStyle:{
  624. // color:'#fff',
  625. fontSize:18*scale,
  626. align:'center'
  627. }
  628. },
  629. legend: {
  630. // selectedMode:false,
  631. formatter: function(name) {
  632. var total = 0; //各科正确率总和
  633. var averagePercent; //综合正确率
  634. echartData.forEach(function(value, index, array) {
  635. total += value.value;
  636. });
  637. return '{total|' + total + '}';
  638. },
  639. data: [echartData[0].name],
  640. // data: ['高等教育学'],
  641. // itemGap: 50,
  642. left: 'center',
  643. top: 'center',
  644. icon: 'none',
  645. align:'center',
  646. textStyle: {
  647. // color: "#fff",
  648. fontSize: 16 * scale,
  649. rich: rich
  650. },
  651. },
  652. series: [{
  653. name: '总考生数量',
  654. type: 'pie',
  655. radius: ['40%', '50%'],
  656. // hoverAnimation: false,
  657. color: ['#5ce9c7', '#fed172', '#fb6086'],
  658. label: {
  659. normal: {
  660. formatter: function(params, ticket, callback) {
  661. var total = 0;
  662. var percent = 0;
  663. echartData.forEach(function(value, index, array) {
  664. total += value.value;
  665. });
  666. if(total != 0){
  667. percent = ((params.value / total) * 100).toFixed(1);
  668. return '{blackSmall|' + params.name + '}{black|' + params.value + '}\n{blue|' + percent + '%}';
  669. }else{
  670. return '{blackSmall|' + params.name + '}{black|' + params.value + '}\n{blue|' + "0" + '%}';
  671. }
  672. },
  673. rich: rich
  674. },
  675. },
  676. data: echartData
  677. }]
  678. };
  679. let option_responsible = {
  680. title: {
  681. text: '相关责任主体问题分布情况',
  682. textStyle: {
  683. align: 'center',
  684. // color: '#fff',
  685. fontSize: 20,
  686. },
  687. top: '3%',
  688. left: '10%',
  689. },
  690. // backgroundColor: '#0f375f',
  691. grid: {
  692. top: "25%",
  693. bottom: "10%"
  694. },
  695. tooltip: {
  696. trigger: "axis",
  697. axisPointer: {
  698. type: "shadow",
  699. label: {
  700. show: true
  701. }
  702. }
  703. },
  704. legend: {
  705. data: ["主体个数", "一般问题", "较重问题", "严重问题"],
  706. top: "15%",
  707. textStyle: {
  708. // color: "#ffffff"
  709. }
  710. },
  711. xAxis: {
  712. data: _self.xName,
  713. axisLine: {
  714. show: true //隐藏X轴轴线
  715. },
  716. axisTick: {
  717. show: true //隐藏X轴刻度
  718. },
  719. axisLabel: {
  720. rotate:20,
  721. show: true,
  722. textStyle: {
  723. // color: "#ebf8ac" //X轴文字颜色
  724. }
  725. },
  726. axisLine: {
  727. lineStyle: {
  728. // color: '#01FCE3'
  729. }
  730. },
  731. },
  732. yAxis: [{
  733. type: "value",
  734. name: "个",
  735. nameTextStyle: {
  736. // color: "#ebf8ac"
  737. },
  738. splitLine: {
  739. show: false
  740. },
  741. splitLine: {
  742. show: false
  743. },
  744. axisTick: {
  745. show: true
  746. },
  747. axisLine: {
  748. show: true
  749. },
  750. axisLabel: {
  751. show: true,
  752. textStyle: {
  753. // color: "#ebf8ac"
  754. }
  755. },
  756. axisLine: {
  757. lineStyle: {
  758. // color: '#FFFFFF'
  759. }
  760. },
  761. },
  762. {
  763. type: "value",
  764. name: "主体个数",
  765. nameTextStyle: {
  766. // color: "#ebf8ac"
  767. },
  768. position: "right",
  769. splitLine: {
  770. show: false
  771. },
  772. splitLine: {
  773. show: false
  774. },
  775. axisTick: {
  776. show: false
  777. },
  778. axisLine: {
  779. show: false
  780. },
  781. axisLabel: {
  782. show: true,
  783. // formatter: "{value} %", //右侧Y轴文字显示
  784. textStyle: {
  785. // color: "#ebf8ac"
  786. }
  787. }
  788. },
  789. {
  790. type: "value",
  791. gridIndex: 0,
  792. min: 50,
  793. max: 100,
  794. splitNumber: 8,
  795. splitLine: {
  796. show: false
  797. },
  798. axisLine: {
  799. show: false
  800. },
  801. axisTick: {
  802. show: false
  803. },
  804. axisLabel: {
  805. show: false
  806. },
  807. splitArea: {
  808. show: true,
  809. areaStyle: {
  810. color: ["rgba(250,250,250,0.0)", "rgba(250,250,250,0.05)"]
  811. }
  812. }
  813. }
  814. ],
  815. series: [{
  816. name: "主体个数",
  817. type: "line",
  818. yAxisIndex: 1, //使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用
  819. showAllSymbol: true, //显示所有图形。
  820. symbol: "circle", //标记的图形为实心圆
  821. symbolSize: 10, //标记的大小
  822. itemStyle: {
  823. //折线拐点标志的样式
  824. color: "#49dff0"
  825. },
  826. lineStyle: {
  827. color: "#49dff0"
  828. },
  829. areaStyle:{
  830. color: "rgba(5,140,255, 0.2)"
  831. },
  832. data: _self.mainBodyNum
  833. },
  834. {
  835. name: "一般问题",
  836. stack: "总量",
  837. type: "bar",
  838. barWidth: 25,
  839. itemStyle: {
  840. normal: {
  841. color: "#5ce9c7"
  842. }
  843. },
  844. data: _self.normalNum
  845. },
  846. {
  847. name: "较重问题",
  848. stack: "总量",
  849. type: "bar",
  850. barWidth: 25,
  851. itemStyle: {
  852. normal: {
  853. color: "#fed172"
  854. }
  855. },
  856. data: _self.heavierNum
  857. },
  858. {
  859. name: "严重问题",
  860. stack: "总量",
  861. type: "bar",
  862. barWidth: 25,
  863. itemStyle: {
  864. normal: {
  865. color: "#fb6086"
  866. }
  867. },
  868. data: _self.seriousNum
  869. }
  870. ]
  871. };
  872. let option_area = {
  873. title: {
  874. text: '重大水利工程各地区问题分布情况',
  875. textStyle: {
  876. align: 'center',
  877. // color: '#fff',
  878. fontSize: 20,
  879. },
  880. top: '3%',
  881. left: '10%',
  882. },
  883. // backgroundColor: '#0f375f',
  884. grid: {
  885. top: "25%",
  886. bottom: "10%"
  887. },
  888. tooltip: {
  889. trigger: "axis",
  890. axisPointer: {
  891. type: "shadow",
  892. label: {
  893. show: true
  894. }
  895. }
  896. },
  897. legend: {
  898. data: ["平均", "问题数量"],
  899. top: "15%",
  900. textStyle: {
  901. // color: "#ffffff"
  902. }
  903. },
  904. xAxis: {
  905. data:_self.xName,
  906. axisLine: {
  907. show: true //隐藏X轴轴线
  908. },
  909. axisTick: {
  910. show: true //隐藏X轴刻度
  911. },
  912. axisLabel: {
  913. rotate:15,
  914. show: true,
  915. textStyle: {
  916. // color: "#ebf8ac" //X轴文字颜色
  917. }
  918. },
  919. axisLine: {
  920. lineStyle: {
  921. // color: '#01FCE3'
  922. }
  923. },
  924. },
  925. yAxis: [{
  926. type: "value",
  927. name: "个",
  928. nameTextStyle: {
  929. // color: "#ebf8ac"
  930. },
  931. splitLine: {
  932. show: false
  933. },
  934. splitLine: {
  935. show: false
  936. },
  937. axisTick: {
  938. show: true
  939. },
  940. axisLine: {
  941. show: true
  942. },
  943. axisLabel: {
  944. show: true,
  945. textStyle: {
  946. // color: "#ebf8ac"
  947. }
  948. },
  949. axisLine: {
  950. lineStyle: {
  951. // color: '#FFFFFF'
  952. }
  953. },
  954. },
  955. {
  956. type: "value",
  957. name: "平均",
  958. nameTextStyle: {
  959. // color: "#ebf8ac"
  960. },
  961. position: "right",
  962. splitLine: {
  963. show: false
  964. },
  965. splitLine: {
  966. show: false
  967. },
  968. axisTick: {
  969. show: false
  970. },
  971. axisLine: {
  972. show: false
  973. },
  974. max: 40,
  975. min: 0,
  976. axisLabel: {
  977. show: true,
  978. // formatter: "{value} %", //右侧Y轴文字显示
  979. textStyle: {
  980. // color: "#ebf8ac"
  981. }
  982. }
  983. },
  984. {
  985. type: "value",
  986. gridIndex: 0,
  987. min: 50,
  988. max: 100,
  989. splitNumber: 8,
  990. splitLine: {
  991. show: false
  992. },
  993. axisLine: {
  994. show: false
  995. },
  996. axisTick: {
  997. show: false
  998. },
  999. axisLabel: {
  1000. show: false
  1001. },
  1002. splitArea: {
  1003. show: true,
  1004. areaStyle: {
  1005. color: ["rgba(250,250,250,0.0)", "rgba(250,250,250,0.05)"]
  1006. }
  1007. }
  1008. }
  1009. ],
  1010. series: [{
  1011. name: "平均值",
  1012. type: "line",
  1013. yAxisIndex: 1, //使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用
  1014. showAllSymbol: false, //显示所有图形。
  1015. // symbol: "circle", //标记的图形为实心圆
  1016. // symbolSize: 10, //标记的大小
  1017. itemStyle: {
  1018. //折线拐点标志的样式
  1019. color: "#fb6086"
  1020. },
  1021. lineStyle: {
  1022. color: "#fb6086"
  1023. },
  1024. areaStyle:{
  1025. color: "rgba(5,140,255, 0.2)"
  1026. },
  1027. // data: [20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20]
  1028. data: _self.avgAreaLists
  1029. },
  1030. {
  1031. name: "问题数量",
  1032. type: "bar",
  1033. barWidth: 25,
  1034. itemStyle: {
  1035. normal: {
  1036. color: "#0195f2"
  1037. }
  1038. },
  1039. data: _self.areaData
  1040. }
  1041. ]
  1042. };
  1043. let option_poverty = {
  1044. title: {
  1045. text:'贫困地区发现问题的严重程度分布情况',
  1046. top: '3%',
  1047. left: '10%',
  1048. // padding:[24,0],
  1049. textStyle:{
  1050. // color:'#fff',
  1051. fontSize:18*scale,
  1052. align:'center'
  1053. }
  1054. },
  1055. legend: {
  1056. // selectedMode:false,
  1057. formatter: function(name) {
  1058. var total = 0; //各科正确率总和
  1059. var averagePercent; //综合正确率
  1060. echartData.forEach(function(value, index, array) {
  1061. total += value.value;
  1062. });
  1063. return '{total|' + total + '}';
  1064. },
  1065. data: [echartData[0].name],
  1066. // data: ['高等教育学'],
  1067. // itemGap: 50,
  1068. left: 'center',
  1069. top: 'center',
  1070. icon: 'none',
  1071. align:'center',
  1072. textStyle: {
  1073. // color: "#fff",
  1074. fontSize: 16 * scale,
  1075. rich: rich
  1076. },
  1077. },
  1078. series: [{
  1079. name: '总考生数量',
  1080. type: 'pie',
  1081. radius: ['40%', '50%'],
  1082. // hoverAnimation: false,
  1083. color: ['#5ce9c7', '#fed172', '#fb6086'],
  1084. label: {
  1085. normal: {
  1086. formatter: function(params, ticket, callback) {
  1087. var total = 0;
  1088. var percent = 0;
  1089. echartData.forEach(function(value, index, array) {
  1090. total += value.value;
  1091. });
  1092. if(total != 0){
  1093. percent = ((params.value / total) * 100).toFixed(1);
  1094. return '{blackSmall|' + params.name + '}{black|' + params.value + '}\n{blue|' + percent + '%}';
  1095. }else{
  1096. return '{blackSmall|' + params.name + '}{black|' + params.value + '}\n{blue|' + "0" + '%}';
  1097. }
  1098. },
  1099. rich: rich
  1100. },
  1101. },
  1102. data: echartData
  1103. }]
  1104. };
  1105. if(_self.search_type == "1"){
  1106. chart.clear();
  1107. chart.setOption(option);
  1108. }else if(_self.search_type == "2"){
  1109. chart.clear();
  1110. chart.setOption(option_responsible);
  1111. }else if(_self.search_type == "3"){
  1112. chart.clear();
  1113. chart.setOption(option_area);
  1114. }else if(_self.search_type == "5"){
  1115. chart.clear();
  1116. chart.setOption(option_poverty);
  1117. }else{
  1118. alert(1);
  1119. }
  1120. },
  1121. init_Total_BarLineChart:function(){
  1122. var _self = this;
  1123. let chart = echarts.init(this.$refs['total_bar_chart']);
  1124. let option = {
  1125. title: {
  1126. text: '发现问题的专业分布情况',
  1127. textStyle: {
  1128. align: 'center',
  1129. // color: '#fff',
  1130. fontSize: 20,
  1131. },
  1132. top: '3%',
  1133. left: '10%',
  1134. },
  1135. // backgroundColor: '#0f375f',
  1136. grid: {
  1137. top: "25%",
  1138. bottom: "15%"
  1139. },
  1140. tooltip: {
  1141. trigger: "axis",
  1142. axisPointer: {
  1143. type: "shadow",
  1144. label: {
  1145. show: true
  1146. }
  1147. }
  1148. },
  1149. legend: {
  1150. data: ["占比", "问题数量"],
  1151. top: "15%",
  1152. textStyle: {
  1153. // color: "#ffffff"
  1154. }
  1155. },
  1156. xAxis: {
  1157. // data: [
  1158. // "工程质量管理",
  1159. // "安全生产管理",
  1160. // "前期与设计",
  1161. // "建设与管理",
  1162. // "资金使用与管理",
  1163. // "计划下达与执行",
  1164. // ],
  1165. data: _self.problemNumName,
  1166. axisLine: {
  1167. show: true //隐藏X轴轴线
  1168. },
  1169. axisTick: {
  1170. show: true //隐藏X轴刻度
  1171. },
  1172. axisLabel: {
  1173. rotate:15,
  1174. show: true,
  1175. textStyle: {
  1176. // color: "#ebf8ac" //X轴文字颜色
  1177. }
  1178. },
  1179. axisLine: {
  1180. lineStyle: {
  1181. // color: '#01FCE3'
  1182. }
  1183. },
  1184. },
  1185. yAxis: [{
  1186. type: "value",
  1187. name: "个",
  1188. nameTextStyle: {
  1189. // color: "#ebf8ac"
  1190. },
  1191. splitLine: {
  1192. show: false
  1193. },
  1194. splitLine: {
  1195. show: false
  1196. },
  1197. axisTick: {
  1198. show: true
  1199. },
  1200. axisLine: {
  1201. show: true
  1202. },
  1203. axisLabel: {
  1204. show: true,
  1205. textStyle: {
  1206. // color: "#ebf8ac"
  1207. }
  1208. },
  1209. axisLine: {
  1210. lineStyle: {
  1211. // color: '#FFFFFF'
  1212. }
  1213. },
  1214. },
  1215. {
  1216. type: "value",
  1217. name: "占比",
  1218. nameTextStyle: {
  1219. // color: "#ebf8ac"
  1220. },
  1221. position: "right",
  1222. splitLine: {
  1223. show: false
  1224. },
  1225. splitLine: {
  1226. show: false
  1227. },
  1228. axisTick: {
  1229. show: false
  1230. },
  1231. axisLine: {
  1232. show: false
  1233. },
  1234. axisLabel: {
  1235. show: true,
  1236. formatter: "{value} %", //右侧Y轴文字显示
  1237. textStyle: {
  1238. // color: "#ebf8ac"
  1239. }
  1240. }
  1241. },
  1242. {
  1243. type: "value",
  1244. gridIndex: 0,
  1245. min: 50,
  1246. max: 100,
  1247. splitNumber: 8,
  1248. splitLine: {
  1249. show: false
  1250. },
  1251. axisLine: {
  1252. show: false
  1253. },
  1254. axisTick: {
  1255. show: false
  1256. },
  1257. axisLabel: {
  1258. show: false
  1259. },
  1260. splitArea: {
  1261. show: true,
  1262. areaStyle: {
  1263. color: ["rgba(250,250,250,0.0)", "rgba(250,250,250,0.05)"]
  1264. }
  1265. }
  1266. }
  1267. ],
  1268. series: [{
  1269. name: "占比",
  1270. type: "line",
  1271. yAxisIndex: 1, //使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用
  1272. showAllSymbol: true, //显示所有图形。
  1273. symbol: "circle", //标记的图形为实心圆
  1274. symbolSize: 10, //标记的大小
  1275. itemStyle: {
  1276. //折线拐点标志的样式
  1277. color: "#49dff0"
  1278. },
  1279. lineStyle: {
  1280. color: "#49dff0"
  1281. },
  1282. areaStyle:{
  1283. color: "rgba(5,140,255, 0.2)"
  1284. },
  1285. data: _self.proportionLists
  1286. },
  1287. {
  1288. name: "问题数量",
  1289. type: "bar",
  1290. barWidth: 25,
  1291. itemStyle: {
  1292. normal: {
  1293. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  1294. offset: 0,
  1295. color: "#00FFE3"
  1296. },
  1297. {
  1298. offset: 1,
  1299. color: "#4693EC"
  1300. }
  1301. ])
  1302. }
  1303. },
  1304. data: _self.problemNumCount
  1305. }
  1306. ]
  1307. };
  1308. _self.addYearTotal_BarLineChart = [
  1309. {
  1310. name: "占比",
  1311. type: "line",
  1312. yAxisIndex: 1, //使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用
  1313. showAllSymbol: true, //显示所有图形。
  1314. symbol: "circle", //标记的图形为实心圆
  1315. symbolSize: 10, //标记的大小
  1316. itemStyle: {
  1317. //折线拐点标志的样式
  1318. color: "#49dff0"
  1319. },
  1320. lineStyle: {
  1321. color: "#49dff0"
  1322. },
  1323. areaStyle:{
  1324. color: "rgba(5,140,255, 0.2)"
  1325. },
  1326. data: _self.proportionLists_DB
  1327. },
  1328. {
  1329. name: "问题数量",
  1330. type: "bar",
  1331. barWidth: 25,
  1332. itemStyle: {
  1333. normal: {
  1334. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  1335. offset: 0,
  1336. color: "#00FFE3"
  1337. },
  1338. {
  1339. offset: 1,
  1340. color: "#4693EC"
  1341. }
  1342. ])
  1343. }
  1344. },
  1345. data: _self.problemNumCount_DB
  1346. }
  1347. ]
  1348. if(this.search_year != "" ){
  1349. option.series = option.series.concat(_self.addYearTotal_BarLineChart);
  1350. }
  1351. chart.setOption(option);
  1352. },
  1353. init_Serious_BarLineChart:function(){
  1354. var _self = this;
  1355. let chart = echarts.init(this.$refs['normal_bar_chart']);
  1356. let option = {
  1357. title: {
  1358. text: _self.countTotalHeavierAndSerious + '个严重和较重问题分布情况',
  1359. textStyle: {
  1360. align: 'center',
  1361. // color: '#fff',
  1362. fontSize: 20,
  1363. },
  1364. top: '3%',
  1365. left: '10%',
  1366. },
  1367. // backgroundColor: '#0f375f',
  1368. grid: {
  1369. top: "25%",
  1370. bottom: "15%"
  1371. },
  1372. tooltip: {
  1373. trigger: "axis",
  1374. axisPointer: {
  1375. type: "shadow",
  1376. label: {
  1377. show: true
  1378. }
  1379. }
  1380. },
  1381. legend: {
  1382. data: ["占比", "较重问题", "严重问题"],
  1383. top: "15%",
  1384. textStyle: {
  1385. // color: "#ffffff"
  1386. }
  1387. },
  1388. xAxis: {
  1389. // data: [
  1390. // "工程质量管理",
  1391. // "安全生产管理",
  1392. // "前期与设计",
  1393. // "建设与管理",
  1394. // "资金使用与管理",
  1395. // "计划下达与执行",
  1396. // ],
  1397. data:_self.problemNumNameHeavierAndSerious,
  1398. axisLine: {
  1399. show: true //隐藏X轴轴线
  1400. },
  1401. axisTick: {
  1402. show: true //隐藏X轴刻度
  1403. },
  1404. axisLabel: {
  1405. rotate:15,
  1406. show: true,
  1407. textStyle: {
  1408. // color: "#ebf8ac" //X轴文字颜色
  1409. }
  1410. },
  1411. axisLine: {
  1412. lineStyle: {
  1413. // color: '#01FCE3'
  1414. }
  1415. },
  1416. },
  1417. yAxis: [{
  1418. type: "value",
  1419. name: "个",
  1420. nameTextStyle: {
  1421. // color: "#ebf8ac"
  1422. },
  1423. splitLine: {
  1424. show: false
  1425. },
  1426. splitLine: {
  1427. show: false
  1428. },
  1429. axisTick: {
  1430. show: true
  1431. },
  1432. axisLine: {
  1433. show: true
  1434. },
  1435. axisLabel: {
  1436. show: true,
  1437. textStyle: {
  1438. // color: "#ebf8ac"
  1439. }
  1440. },
  1441. axisLine: {
  1442. lineStyle: {
  1443. // color: '#FFFFFF'
  1444. }
  1445. },
  1446. },
  1447. {
  1448. type: "value",
  1449. name: "占比",
  1450. nameTextStyle: {
  1451. // color: "#ebf8ac"
  1452. },
  1453. position: "right",
  1454. splitLine: {
  1455. show: false
  1456. },
  1457. splitLine: {
  1458. show: false
  1459. },
  1460. axisTick: {
  1461. show: false
  1462. },
  1463. axisLine: {
  1464. show: false
  1465. },
  1466. axisLabel: {
  1467. show: true,
  1468. formatter: "{value} %", //右侧Y轴文字显示
  1469. textStyle: {
  1470. // color: "#ebf8ac"
  1471. }
  1472. }
  1473. },
  1474. {
  1475. type: "value",
  1476. gridIndex: 0,
  1477. min: 50,
  1478. max: 100,
  1479. splitNumber: 8,
  1480. splitLine: {
  1481. show: false
  1482. },
  1483. axisLine: {
  1484. show: false
  1485. },
  1486. axisTick: {
  1487. show: false
  1488. },
  1489. axisLabel: {
  1490. show: false
  1491. },
  1492. splitArea: {
  1493. show: true,
  1494. areaStyle: {
  1495. color: ["rgba(250,250,250,0.0)", "rgba(250,250,250,0.05)"]
  1496. }
  1497. }
  1498. }
  1499. ],
  1500. series: [{
  1501. name: "占比",
  1502. type: "line",
  1503. yAxisIndex: 1, //使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用
  1504. showAllSymbol: true, //显示所有图形。
  1505. symbol: "circle", //标记的图形为实心圆
  1506. symbolSize: 10, //标记的大小
  1507. itemStyle: {
  1508. //折线拐点标志的样式
  1509. color: "#49dff0"
  1510. },
  1511. lineStyle: {
  1512. color: "#49dff0"
  1513. },
  1514. areaStyle:{
  1515. color: "rgba(5,140,255, 0.2)"
  1516. },
  1517. // data: [23,21,16,16,16,8]
  1518. data: _self.problemNumNameHeavierAndSeriousZb
  1519. },
  1520. {
  1521. name: "较重问题",
  1522. stack: "总量",
  1523. type: "bar",
  1524. barWidth: 25,
  1525. itemStyle: {
  1526. normal: {
  1527. color: "#fed172"
  1528. }
  1529. },
  1530. // data: [47,47,35,36,35,15]
  1531. data: _self.problemNumCountHeavier
  1532. },
  1533. {
  1534. name: "严重问题",
  1535. stack: "总量",
  1536. type: "bar",
  1537. barWidth: 25,
  1538. itemStyle: {
  1539. normal: {
  1540. color: "#fb6086"
  1541. }
  1542. },
  1543. // data: [7,4,3,2,2,5]
  1544. data: _self.problemNumCountSerious
  1545. },
  1546. ]
  1547. };
  1548. _self.addYear=[
  1549. {
  1550. name: "占比1",
  1551. type: "line",
  1552. yAxisIndex: 1, //使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用
  1553. showAllSymbol: true, //显示所有图形。
  1554. symbol: "circle", //标记的图形为实心圆
  1555. symbolSize: 10, //标记的大小
  1556. itemStyle: {
  1557. //折线拐点标志的样式
  1558. color: "#F6931C"
  1559. },
  1560. lineStyle: {
  1561. color: "#F6931C"
  1562. },
  1563. areaStyle:{
  1564. color: "rgba(5,140,255, 0.2)"
  1565. },
  1566. data: _self.problemNumNameHeavierAndSeriousZb_DB
  1567. },
  1568. {
  1569. name: "较重问题",
  1570. stack: "总量1",
  1571. type: "bar",
  1572. barWidth: 25,
  1573. itemStyle: {
  1574. normal: {
  1575. color: "#fed172"
  1576. }
  1577. },
  1578. data: _self.problemNumCountHeavier_DB
  1579. },
  1580. {
  1581. name: "严重问题",
  1582. stack: "总量1",
  1583. type: "bar",
  1584. barWidth: 25,
  1585. itemStyle: {
  1586. normal: {
  1587. color: "#fb6086"
  1588. }
  1589. },
  1590. data: _self.problemNumCountSerious_DB
  1591. }
  1592. ]
  1593. if(this.search_year != "" ){
  1594. option.series = option.series.concat(_self.addYear);
  1595. }
  1596. chart.setOption(option);
  1597. },
  1598. init_Normal_BarLineChart:function(){
  1599. var _self = this;
  1600. let chart = echarts.init(this.$refs['serious_bar_chart']);
  1601. let option = {
  1602. title: {
  1603. text: _self.countTotalNormal + '个一般问题分布情况',
  1604. textStyle: {
  1605. align: 'center',
  1606. // color: '#fff',
  1607. fontSize: 20,
  1608. },
  1609. top: '3%',
  1610. left: '10%',
  1611. },
  1612. // backgroundColor: '#0f375f',
  1613. grid: {
  1614. top: "25%",
  1615. bottom: "15%"
  1616. },
  1617. tooltip: {
  1618. trigger: "axis",
  1619. axisPointer: {
  1620. type: "shadow",
  1621. label: {
  1622. show: true
  1623. }
  1624. }
  1625. },
  1626. legend: {
  1627. data: ["占比", "问题数量"],
  1628. top: "15%",
  1629. textStyle: {
  1630. // color: "#ffffff"
  1631. }
  1632. },
  1633. xAxis: {
  1634. data: _self.problemNumNameNormal,
  1635. axisLine: {
  1636. show: true //隐藏X轴轴线
  1637. },
  1638. axisTick: {
  1639. show: true //隐藏X轴刻度
  1640. },
  1641. axisLabel: {
  1642. rotate:15,
  1643. show: true,
  1644. textStyle: {
  1645. // color: "#ebf8ac" //X轴文字颜色
  1646. }
  1647. },
  1648. axisLine: {
  1649. lineStyle: {
  1650. // color: '#01FCE3'
  1651. }
  1652. },
  1653. },
  1654. yAxis: [{
  1655. type: "value",
  1656. name: "个",
  1657. nameTextStyle: {
  1658. // color: "#ebf8ac"
  1659. },
  1660. splitLine: {
  1661. show: false
  1662. },
  1663. splitLine: {
  1664. show: false
  1665. },
  1666. axisTick: {
  1667. show: true
  1668. },
  1669. axisLine: {
  1670. show: true
  1671. },
  1672. axisLabel: {
  1673. show: true,
  1674. textStyle: {
  1675. // color: "#ebf8ac"
  1676. }
  1677. },
  1678. axisLine: {
  1679. lineStyle: {
  1680. // color: '#FFFFFF'
  1681. }
  1682. },
  1683. },
  1684. {
  1685. type: "value",
  1686. name: "占比",
  1687. nameTextStyle: {
  1688. // color: "#ebf8ac"
  1689. },
  1690. position: "right",
  1691. splitLine: {
  1692. show: false
  1693. },
  1694. splitLine: {
  1695. show: false
  1696. },
  1697. axisTick: {
  1698. show: false
  1699. },
  1700. axisLine: {
  1701. show: false
  1702. },
  1703. axisLabel: {
  1704. show: true,
  1705. formatter: "{value} %", //右侧Y轴文字显示
  1706. textStyle: {
  1707. // color: "#ebf8ac"
  1708. }
  1709. }
  1710. },
  1711. {
  1712. type: "value",
  1713. gridIndex: 0,
  1714. min: 50,
  1715. max: 100,
  1716. splitNumber: 8,
  1717. splitLine: {
  1718. show: false
  1719. },
  1720. axisLine: {
  1721. show: false
  1722. },
  1723. axisTick: {
  1724. show: false
  1725. },
  1726. axisLabel: {
  1727. show: false
  1728. },
  1729. splitArea: {
  1730. show: true,
  1731. areaStyle: {
  1732. color: ["rgba(250,250,250,0.0)", "rgba(250,250,250,0.05)"]
  1733. }
  1734. }
  1735. }
  1736. ],
  1737. series: [{
  1738. name: "占比",
  1739. type: "line",
  1740. yAxisIndex: 1, //使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用
  1741. showAllSymbol: true, //显示所有图形。
  1742. symbol: "circle", //标记的图形为实心圆
  1743. symbolSize: 10, //标记的大小
  1744. itemStyle: {
  1745. //折线拐点标志的样式
  1746. color: "#49dff0"
  1747. },
  1748. lineStyle: {
  1749. color: "#49dff0"
  1750. },
  1751. areaStyle:{
  1752. color: "rgba(5,140,255, 0.2)"
  1753. },
  1754. // data: [23,19,18,17,15,9]
  1755. data: _self.problemNumNameNormalZb
  1756. },
  1757. {
  1758. name: "问题数量",
  1759. type: "bar",
  1760. barWidth: 25,
  1761. itemStyle: {
  1762. normal: {
  1763. color: "#5ce9c7"
  1764. }
  1765. },
  1766. data: _self.problemNumCountNormal
  1767. }
  1768. ]
  1769. };
  1770. _self.addYearNormal_BarLineChart = [
  1771. {
  1772. name: "占比",
  1773. type: "line",
  1774. yAxisIndex: 1, //使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用
  1775. showAllSymbol: true, //显示所有图形。
  1776. symbol: "circle", //标记的图形为实心圆
  1777. symbolSize: 10, //标记的大小
  1778. itemStyle: {
  1779. //折线拐点标志的样式
  1780. color: "#49dff0"
  1781. },
  1782. lineStyle: {
  1783. color: "#49dff0"
  1784. },
  1785. areaStyle:{
  1786. color: "rgba(5,140,255, 0.2)"
  1787. },
  1788. // data: [23,19,18,17,15,9]
  1789. data: _self.problemNumNameNormalZb_DB
  1790. },
  1791. {
  1792. name: "问题数量",
  1793. type: "bar",
  1794. barWidth: 25,
  1795. itemStyle: {
  1796. normal: {
  1797. color: "#5ce9c7"
  1798. }
  1799. },
  1800. data: _self.problemNumCountNormal_DB
  1801. }
  1802. ]
  1803. if(this.search_year != "" ){
  1804. option.series = option.series.concat(_self.addYearNormal_BarLineChart);
  1805. }
  1806. chart.setOption(option);
  1807. },
  1808. searchData(){
  1809. this.heavierAndSeriousLists_DB=[];
  1810. this.countTotalHeavierAndSerious_DB=[];
  1811. this.problemNumCountHeavier_DB=[];
  1812. this.problemNumCountSerious_DB=[];
  1813. this.problemNumNameHeavierAndSeriousZb_DB=[];
  1814. this.normalLists_DB=[];
  1815. this.countTotalNormal_DB=[];
  1816. this.problemNumCountNormal_DB=[];
  1817. this.problemNumNameNormalZb_DB=[];
  1818. this.search_year.toString();
  1819. this.getBarChartData_DB();
  1820. }
  1821. },
  1822. //生命周期 - 创建完成(可以访问当前this实例)
  1823. created() {
  1824. },
  1825. //生命周期 - 挂载完成(可以访问DOM元素)
  1826. mounted() {
  1827. this.getYearPc();
  1828. // this.getTreeData();
  1829. this.getDataChartData();
  1830. this.getBarChartData();
  1831. // this.init_Total_BarLineChart();
  1832. // this.init_Normal_BarLineChart();
  1833. // this.init_Serious_BarLineChart();
  1834. },
  1835. beforeCreate() {}, //生命周期 - 创建之前
  1836. beforeMount() {}, //生命周期 - 挂载之前
  1837. beforeUpdate() {}, //生命周期 - 更新之前
  1838. updated() {}, //生命周期 - 更新之后
  1839. beforeDestroy() {}, //生命周期 - 销毁之前
  1840. destroyed() {}, //生命周期 - 销毁完成
  1841. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  1842. }
  1843. </script>
  1844. <style lang="scss">
  1845. .filter_tree{
  1846. .el-tree-node__label{
  1847. color: #666;
  1848. font-size: large;
  1849. }
  1850. }
  1851. .filter_tree.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
  1852. background-color: #c7e9fe;
  1853. }
  1854. .assistant_btn{
  1855. position: absolute;
  1856. bottom: -10px;
  1857. right: 20px;
  1858. z-index: 999;
  1859. }
  1860. .open_board{
  1861. position: absolute;
  1862. bottom: 0;
  1863. left: 0;
  1864. width: 24px;
  1865. height: 30px;
  1866. line-height: 30px;
  1867. border: solid 1px #ddd;
  1868. border-top-right-radius: 5px;
  1869. border-bottom-right-radius: 5px;
  1870. text-align: center;
  1871. background-color: #bbebff;
  1872. cursor: pointer;
  1873. }
  1874. </style>