移动端
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

396 řádky
9.5 KiB

  1. <template>
  2. <div class="home_wrapper">
  3. <div class="header_main">
  4. 案件统计
  5. <div class="return_btn" @click="onClickLeft"></div>
  6. </div>
  7. <div style="height: 58px;"></div>
  8. <div class="top_main">
  9. <img src="../../../../static/images/lawEnforcement/icon/statistics_icon_01.png">
  10. <div class="main_text">
  11. <p>{{countNum}}</p>
  12. <p>案件数量</p>
  13. </div>
  14. <van-popover
  15. v-model="showPopover"
  16. trigger="click"
  17. :actions="actions"
  18. @select="changeTime"
  19. placement="bottom-end"
  20. >
  21. <template #reference>
  22. <div class="select_box">
  23. <p>{{query.year}}</p>
  24. <van-icon name="arrow-down" color="#ffffff" />
  25. </div>
  26. </template>
  27. </van-popover>
  28. </div>
  29. <div class="main_box" style="margin-top: 10px;">
  30. <p class="tit">案件分类统计</p>
  31. <div id="main" style="width: 100%;height: 200px;margin-top: 10px"></div>
  32. </div>
  33. <div class="main_box" style="margin-top: 10px;">
  34. <p class="tit">案件来源分析</p>
  35. <div id="main2" style="width: 100%;height: 200px;margin-top: 10px"></div>
  36. <div class="len_box">
  37. <div class="len_box_01" v-for="( item,index ) in caseSourceArray">
  38. <p><i></i>{{item.name}}</p>
  39. <p>{{item.value}}</p>
  40. </div>
  41. <!-- <div class="len_box_02">-->
  42. <!-- <p><i></i>计划执法</p>-->
  43. <!-- <p>64</p>-->
  44. <!-- </div>-->
  45. <!-- <div class="len_box_03">-->
  46. <!-- <p><i></i>计划执法</p>-->
  47. <!-- <p>64</p>-->
  48. <!-- </div>-->
  49. <!-- <div class="len_box_04">-->
  50. <!-- <p><i></i>计划执法</p>-->
  51. <!-- <p>64</p>-->
  52. <!-- </div>-->
  53. </div>
  54. </div>
  55. <div class="main_box" style="margin-top: 10px;">
  56. <p class="tit">案件月度走势</p>
  57. <div id="main3" style="width: 100%;height: 200px;margin-top: 10px"></div>
  58. </div>
  59. </div>
  60. </template>
  61. <script>
  62. import { caseNumberAll , caseTypeAccount , caseSourceTypeAccount , casePreMonthNum } from "@/api/lawEnforcement/index";
  63. import * as echarts from 'echarts';
  64. export default {
  65. name: "caseAllocation",
  66. data() {
  67. return {
  68. showPopover: false,
  69. // 通过 actions 属性来定义菜单选项
  70. actions: [
  71. { text: '2022',value:'2022' },
  72. { text: '2021',value:'2021' },
  73. { text: '2020',value:'2020' },
  74. { text: '2019',value:'2019' },
  75. { text: '2018',value:'2018' },
  76. ],
  77. countNum:'',
  78. query:{
  79. year:'2022'
  80. },
  81. caseSourceArray:[]
  82. };
  83. },
  84. created() {
  85. },
  86. mounted(){
  87. this.getNum();
  88. },
  89. methods: {
  90. changeTime(val){
  91. console.log(val)
  92. this.query.year = val.value;
  93. this.getNum();
  94. },
  95. getNum(){
  96. caseNumberAll(this.query).then(response => {
  97. this.countNum = response.data;
  98. })
  99. caseTypeAccount(this.query).then(response => {
  100. this.chart(response.data);
  101. })
  102. caseSourceTypeAccount(this.query).then(response => {
  103. this.caseSourceArray =response.data.seriesData;
  104. this.chart2(response.data);
  105. })
  106. casePreMonthNum(this.query).then(response => {
  107. this.chart3(response.data);
  108. })
  109. },
  110. chart(data){
  111. var chartDom = document.getElementById('main');
  112. var myChart = echarts.init(chartDom);
  113. var option;
  114. option = {
  115. tooltip: {
  116. trigger: 'item'
  117. },
  118. series: [
  119. {
  120. type: 'pie',
  121. radius: ['40%', '70%'],
  122. label: {
  123. // alignTo: 'edge',
  124. // edgeDistance: 10,
  125. color: "#000",
  126. normal: {
  127. alignTo: 'edge',
  128. edgeDistance: 10,
  129. color:'#000',
  130. formatter: "{c_set|{c}}\t{a_set|{b}}",
  131. rich: {
  132. a_set: {
  133. // color: "#ffffff",
  134. lineHeight: 20,
  135. align: "left",
  136. fontSize: 12,
  137. },
  138. c_set: {
  139. // color: "#ffffff",
  140. fontSize: 14,
  141. },
  142. },
  143. },
  144. },
  145. data: data.seriesData
  146. }
  147. ]
  148. };
  149. option && myChart.setOption(option);
  150. },
  151. chart2(data){
  152. var chartDom = document.getElementById('main2');
  153. var myChart = echarts.init(chartDom);
  154. var option;
  155. option = {
  156. tooltip: {
  157. trigger: 'item'
  158. },
  159. series: [
  160. {
  161. type: 'pie',
  162. radius: ['40%', '70%'],
  163. label: {
  164. // alignTo: 'edge',
  165. // edgeDistance: 10,
  166. color: "#000",
  167. normal: {
  168. alignTo: 'edge',
  169. edgeDistance: 10,
  170. color:'#000',
  171. formatter: "{c_set|{c}}\t{a_set|{b}}",
  172. rich: {
  173. a_set: {
  174. // color: "#ffffff",
  175. lineHeight: 20,
  176. align: "left",
  177. fontSize: 12,
  178. },
  179. c_set: {
  180. // color: "#ffffff",
  181. fontSize: 14,
  182. },
  183. },
  184. },
  185. },
  186. data: data.seriesData
  187. }
  188. ]
  189. };
  190. option && myChart.setOption(option);
  191. },
  192. chart3(data){
  193. var chartDom = document.getElementById('main3');
  194. var myChart = echarts.init(chartDom);
  195. var option;
  196. option = {
  197. grid: {
  198. top:'5%',
  199. left: '3%',
  200. right: '4%',
  201. bottom: '3%',
  202. containLabel: true
  203. },
  204. xAxis: {
  205. type: 'category',
  206. data: data.xaxisData
  207. },
  208. yAxis: {
  209. type: 'value'
  210. },
  211. series: [
  212. {
  213. data: data.series,
  214. type: 'line'
  215. }
  216. ]
  217. };
  218. option && myChart.setOption(option);
  219. }
  220. },
  221. }
  222. </script>
  223. <style scoped lang="scss">
  224. .home_wrapper{
  225. background: #e9e9e9;
  226. min-height: 100vh;
  227. width: 100vw;
  228. padding: 0 3% 0.2rem;
  229. .header_main{
  230. height: 116px;
  231. background: url('../../../../static/images/lawEnforcement/new/list_head.png') no-repeat;
  232. background-size: 100% 100%;
  233. position: fixed;
  234. top: 0;
  235. left: 0;
  236. width: 100%;
  237. font-size: 36px;
  238. line-height: 116px;
  239. text-align: center;
  240. color: #fff;
  241. z-index: 999;
  242. .return_btn{
  243. width: 24px;
  244. height: 43.2px;
  245. background: url('../../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  246. background-size: 20px 36px;
  247. position: absolute;
  248. left: 38px;
  249. top: 36px;
  250. }
  251. .add_btn{
  252. width: 56.4px;
  253. height: 40.8px;
  254. background: url('../../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  255. background-size: 47px 34px;
  256. position: absolute;
  257. right: 38px;
  258. top: 36px;
  259. }
  260. }
  261. }
  262. .top_main{
  263. display: flex;
  264. align-items: center;
  265. background: url('../../../../static/images/lawEnforcement/new/list_head.png') no-repeat;
  266. background-size: 100% 100%;
  267. color: #ffffff;
  268. padding: 15PX;
  269. margin-top: 10PX;
  270. border-radius: 8PX;
  271. .main_text{
  272. margin-left: 15PX;
  273. p{
  274. &:first-child{
  275. font-size: .6rem;
  276. }
  277. }
  278. }
  279. /deep/ .van-popover__wrapper{
  280. margin-left: auto;
  281. }
  282. }
  283. .select_box{
  284. border: 1px solid #ffffff;
  285. border-radius: 50PX;
  286. padding: 0 12PX ;
  287. height: 25PX;
  288. line-height: 25PX;
  289. display: flex;
  290. justify-content: space-around;
  291. align-items: center;
  292. p{
  293. margin-right: 10PX;
  294. }
  295. }
  296. .main_box {
  297. width: 100%;
  298. margin: 0 auto;
  299. border-radius: 10PX;
  300. box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.16);
  301. overflow: hidden;
  302. background-color: #FFF;
  303. padding: 15PX;
  304. .tit{
  305. background: url('../../../../static/images/lawEnforcement/icon/statistics_icon_02.png') no-repeat left center;
  306. padding-left: 10PX;
  307. font-size: .4rem;
  308. }
  309. }
  310. .len_box{
  311. display: flex;
  312. justify-content: space-between;
  313. div{
  314. background: rgba(196,218,249,0.2);
  315. width: 24%;
  316. border-radius: 5PX;
  317. padding: 8PX;
  318. i{
  319. width: 10PX;
  320. height: 10PX;
  321. display: inline-block;
  322. border-radius: 2PX;
  323. margin-right: 5PX;
  324. }
  325. p:last-child{
  326. padding-left: 15PX;
  327. margin-top: 8PX;
  328. font-size: .4rem;
  329. }
  330. &:nth-child(1){
  331. i{
  332. background-color: rgb(84,112,198);
  333. }
  334. }
  335. &:nth-child(2){
  336. i{
  337. background-color: rgb(145,204,117);
  338. }
  339. }
  340. &:nth-child(3){
  341. i{
  342. background-color: rgb(250,200,88);
  343. }
  344. }
  345. &:nth-child(4){
  346. i{
  347. background-color: rgb(238,102,102);
  348. }
  349. }
  350. }
  351. /*.len_box_01{*/
  352. /* i{*/
  353. /* background: #1CB8B1;*/
  354. /* }*/
  355. /*}*/
  356. /*.len_box_02{*/
  357. /* i{*/
  358. /* background: #508EEC;*/
  359. /* }*/
  360. /*}*/
  361. /*.len_box_03{*/
  362. /* i{*/
  363. /* background: #F68E68;*/
  364. /* }*/
  365. /*}*/
  366. /*.len_box_04{*/
  367. /* i{*/
  368. /* background: #6163B0;*/
  369. /* }*/
  370. /*}*/
  371. }
  372. </style>