index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. <template>
  2. <div class="app-container">
  3. <div style="display: inline-flex;padding-left:1.7rem">
  4. <div :class='currentindex==1?"selectClass":"unSelect"' style="width: 6.3rem;height: 3.2rem;" @click="getDate(1)">
  5. <div style="line-height:3.2rem; font-size: 1.7rem;text-align:center;">本月</div>
  6. </div>
  7. <div :class='currentindex==2?"selectClass":"unSelect"' style="width: 6.3rem;height: 3.2rem;margin-left:2rem" @click="getDate(2)">
  8. <div style="line-height:3.2rem; font-size: 1.7rem;text-align:center;">今天</div>
  9. </div>
  10. <div :class='currentindex==3?"selectClass":"unSelect"' style="width: 8.7rem;height: 3.2rem;margin-left:2rem" @click="getDate(3)">
  11. <div style="line-height:3.2rem; font-size: 1.7rem;text-align:center;">最近7天</div>
  12. </div>
  13. <div :class='currentindex==4?"selectClass":"unSelect"' style="width: 9.7rem;height: 3.2rem;margin-left:2rem" @click="getDate(4)">
  14. <div style="line-height:3.2rem; font-size: 1.7rem;text-align:center;">最近30天</div>
  15. </div>
  16. <div :class='currentindex==5?"selectClass":"unSelect"' style="width: 8.7rem;height: 3.2rem;margin-left:2rem" @click="getDate(5)">
  17. <div style="line-height:3.2rem; font-size: 1.7rem;text-align:center;">最近1年</div>
  18. </div>
  19. <div style="margin-left:5rem">
  20. <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="6.8rem">
  21. <el-form-item label="选择区域" prop="deviceCode">
  22. <el-select v-model="queryParams.deviceType" placeholder="请选择区域" clearable size="small" style="width:16rem">
  23. <el-option
  24. key="0"
  25. label="全部"
  26. value="0"
  27. />
  28. <el-option
  29. v-for="dict in dict.type.tl_xun_area"
  30. :key="dict.value"
  31. :label="dict.label"
  32. :value="dict.value"
  33. />
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item label="时间" prop="deviceCode">
  37. <el-date-picker
  38. v-model="value1"
  39. type="daterange"
  40. format="yyyy 年 MM 月 dd 日"
  41. value-format="yyyy-MM-dd"
  42. range-separator="至"
  43. start-placeholder="开始日期"
  44. end-placeholder="结束日期">
  45. </el-date-picker>
  46. </el-form-item>
  47. <el-form-item>
  48. <el-button style="border-radius: 0.6rem;" type="primary" size="mini" @click="getMonthStatic">搜索</el-button>
  49. <el-button style="background-color:#7B7B7B;border-radius: 0.6rem;color:white" size="mini" @click="resetQuery">重置</el-button>
  50. </el-form-item>
  51. </el-form>
  52. </div>
  53. </div>
  54. <div style="display:inline-flex">
  55. <div style="width:28.8rem;height:13.3rem;background: rgba(35, 255, 252, 0.2);padding-top:0.5rem;padding-left:2.5rem">
  56. <div style="font-size: 4rem;
  57. font-family: Microsoft YaHei;
  58. font-weight: bold;
  59. color: #23FFFC;">
  60. {{monthStatic.planXunLocationTotal}}
  61. </div>
  62. <div style="font-size: 1.8rem;
  63. font-family: Microsoft YaHei;
  64. font-weight: bold;
  65. color: #23FFFC;
  66. margin-top:1rem">
  67. 本月计划巡更点总数
  68. </div>
  69. </div>
  70. <div style="width:28.8rem;height:13.3rem;background:rgba(35, 154, 255, 0.2);padding-top:0.5rem;padding-left:2.5rem;margin-left:2rem">
  71. <div style="font-size: 4rem;
  72. font-family: Microsoft YaHei;
  73. font-weight: bold;
  74. color: #239AFF;">
  75. {{monthStatic.actualXunTotal}}
  76. </div>
  77. <div style="font-size: 1.8rem;
  78. font-family: Microsoft YaHei;
  79. font-weight: bold;
  80. color: #239AFF;
  81. margin-top:1rem">
  82. 本月已巡更点总数
  83. </div>
  84. </div>
  85. <div style="width:28.8rem;height:13.3rem;background:rgba(254, 213, 47, 0.2);padding-top:0.5rem;padding-left:2.5rem;margin-left:2rem">
  86. <div style="font-size: 4rem;
  87. font-family: Microsoft YaHei;
  88. font-weight: bold;
  89. color: #FED52F;">
  90. {{monthStatic.unXunTotal}}
  91. </div>
  92. <div style="font-size: 1.8rem;
  93. font-family: Microsoft YaHei;
  94. font-weight: bold;
  95. color: #FED52F;
  96. margin-top:1rem">
  97. 本月漏巡更点总数
  98. </div>
  99. </div>
  100. <div style="width:28.8rem;height:13.3rem;background: rgba(35, 255, 252, 0.2);padding-top:0.5rem;padding-left:2.5rem;margin-left:2rem">
  101. <div style="font-size: 4rem;
  102. font-family: Microsoft YaHei;
  103. font-weight: bold;
  104. color: #23FFFC;">
  105. {{monthStatic.weiXun}}
  106. </div>
  107. <div style="font-size: 1.8rem;
  108. font-family: Microsoft YaHei;
  109. font-weight: bold;
  110. color: #23FFFC;
  111. margin-top:1rem">
  112. 本月未巡更点总数
  113. </div>
  114. </div>
  115. <div style="width:28.8rem;height:13.3rem;background: rgba(35, 255, 252, 0.2);padding-top:0.5rem;padding-left:2.5rem;margin-left:2rem">
  116. <div style="font-size: 4rem;
  117. font-family: Microsoft YaHei;
  118. font-weight: bold;
  119. color: #23FFFC;">
  120. {{monthStatic.unPercent}}
  121. </div>
  122. <div style="font-size: 1.8rem;
  123. font-family: Microsoft YaHei;
  124. font-weight: bold;
  125. color: #23FFFC;
  126. margin-top:1rem">
  127. 本月漏巡率
  128. </div>
  129. </div>
  130. </div>
  131. <div class="divtitle" style="margin-top:2rem">
  132. <img src="@/assets/images/icon.png" style="width:1.8rem;height:1.8rem;margin-top:0.3rem"/>
  133. <div style="font-size:1.6rem;font-family: Adobe Heiti Std;font-weight: normal;color: #DFEEF3;margin-left:0.5rem">巡更统计</div>
  134. </div>
  135. <div style="display:inline-flex;width:100%">
  136. <div style="width:15%;padding-left:2rem">
  137. <div class='watchStaticContent'style="margin-top:1.5rem;display:inline-flex;">
  138. <div><img src="@/assets/images/static/11.png" style="width:4.7rem;height:5.3rem;margin-top:1.2rem;margin-left:3rem"/></div>
  139. <div style="margin-top:1.2rem;margin-left:2rem">
  140. <div style="font-size: 2.1rem;
  141. font-family: SourceHanSansCN;
  142. font-weight: bold;
  143. color: #F0F6F5;"> {{monthStatic.unXunTotal}}</div>
  144. <div style="font-size: 1.4rem;
  145. font-family: Adobe Heiti Std;
  146. font-weight: normal;
  147. color: #B4C1BF;">漏巡</div>
  148. </div>
  149. </div>
  150. <div class='watchStaticContent' style="margin-top:1.5rem;display:inline-flex;">
  151. <div><img src="@/assets/images/static/22.png" style="width:4.7rem;height:5.3rem;margin-top:1.2rem;margin-left:3rem"/></div>
  152. <div style="margin-top:1.2rem;margin-left:2rem">
  153. <div style="font-size: 2.1rem;
  154. font-family: SourceHanSansCN;
  155. font-weight: bold;
  156. color: #F0F6F5;"> {{monthStatic.actualXunTotal}}</div>
  157. <div style="font-size: 1.4rem;
  158. font-family: Adobe Heiti Std;
  159. font-weight: normal;
  160. color: #B4C1BF;">已巡</div>
  161. </div>
  162. </div>
  163. <div class='watchStaticContent'style="margin-top:1.5rem;display:inline-flex;">
  164. <div><img src="@/assets/images/static/33.png" style="width:4.7rem;height:5.3rem;margin-top:1.2rem;margin-left:3rem"/></div>
  165. <div style="margin-top:1.2rem;margin-left:2rem">
  166. <div style="font-size: 2.1rem;
  167. font-family: SourceHanSansCN;
  168. font-weight: bold;
  169. color: #F0F6F5;"> {{monthStatic.planXunLocationTotal}}</div>
  170. <div style="font-size: 1.4rem;
  171. font-family: Adobe Heiti Std;
  172. font-weight: normal;
  173. color: #B4C1BF;">全部</div>
  174. </div>
  175. </div>
  176. </div>
  177. <div style="width:85%">
  178. <div id='watchChart' style="width:130rem;height:28rem"></div>
  179. </div>
  180. </div>
  181. <div class="divtitle" style="margin-top:2rem">
  182. <img src="@/assets/images/icon.png" style="width:1.8rem;height:1.8rem;margin-top:0.3rem"/>
  183. <div style="font-size:1.6rem;font-family: Adobe Heiti Std;font-weight: normal;color: #DFEEF3;margin-left:0.5rem">巡更列表</div>
  184. </div>
  185. <div style="margin-top:1rem">
  186. <el-table :data="monthStatic.xunList" stripe
  187. class="my_table"
  188. :row-class-name="tableRowClassName"
  189. :max-height="tableHeight"
  190. :header-cell-style="{background:'#24A3B3 50%',color: '#C5D0D4'}">
  191. <!-- <el-table-column type="selection" width="55" align="center" /> -->
  192. <el-table-column type="index" width="55" align="center" label='序号'/>
  193. <el-table-column label="统计日期" align="center" prop="staticDate" />
  194. <el-table-column label="巡更点数量" align="center" prop="xunTotal" />
  195. <el-table-column label="计划巡更点总数" align="center" prop="planLocationTotal" />
  196. <el-table-column label="实际巡更数" align="center" prop="actualXunTotal" />
  197. <el-table-column label="漏巡率" align="center" prop="unXunPercent" />
  198. <el-table-column label="漏巡数" align="center" prop="unXunTotal" />
  199. </el-table>
  200. </div>
  201. </div>
  202. </template>
  203. <script>
  204. import mapdiv from "@/components/map/index.vue"
  205. import { getMonthStatic } from "@/api/qdtl/data";
  206. export default {
  207. name: "Device",
  208. dicts: ['tl_xun_area'],
  209. data() {
  210. return {
  211. // 遮罩层
  212. currentindex:1,
  213. queryParams:{},
  214. value1:'',
  215. tableHeight:245,
  216. monthStatic:{},
  217. echartsData:{}
  218. };
  219. },
  220. created() {
  221. // this.getGdChart();
  222. },
  223. mounted() {
  224. this.getGdChart();
  225. this.getStatic();
  226. },
  227. components:{
  228. mapdiv
  229. },
  230. methods: {
  231. getStatic(){
  232. var date = new Date();
  233. var y = new Date().getFullYear(); //获取年份
  234. var m = new Date().getMonth() + 1; //获取月份
  235. var d = new Date(y, m, 0).getDate(); //获取当月最后一日
  236. m = m < 10 ? '0' + m : m; //月份补 0
  237. d = d < 10 ? '0' + d : d; //日数补 0
  238. // console.log(this.value1);
  239. this.queryParams.startDate = [y,m,'01'].join("-")
  240. this.queryParams.endDate = [y,m,d].join("-")
  241. getMonthStatic(this.queryParams).then(response =>{
  242. console.log(response);
  243. this.monthStatic = response.data;
  244. this.getGdChart(response.data.xunList);
  245. })
  246. },
  247. getMonthStatic(){
  248. // console.log(this.value1);
  249. this.queryParams.startDate = this.value1[0]
  250. this.queryParams.endDate = this.value1[1]
  251. getMonthStatic(this.queryParams).then(response =>{
  252. console.log(response);
  253. this.getMonthStatic = response.data;
  254. this.getGdChart(response.data.xunList);
  255. })
  256. },
  257. tableRowClassName({ row, rowIndex }) {
  258. if ((rowIndex + 1) % 2 === 0) {
  259. return "warning-row";
  260. } else {
  261. return "success-row";
  262. }
  263. },
  264. getDate(index){
  265. this.currentindex = index
  266. },
  267. handleQuery(){
  268. },
  269. resetQuery(){
  270. },
  271. getGdChart(data){
  272. var datesArry = [];
  273. var xunArry = [];
  274. var unXunArry = [];
  275. for(var index in data){
  276. datesArry.push(data[index].staticDate);
  277. xunArry.push(data[index].actualXunTotal);
  278. unXunArry.push(data[index].unXunTotal);
  279. }
  280. console.log(xunArry);
  281. console.log(unXunArry);
  282. var myChart = this.$echarts.init(document.getElementById('watchChart'));
  283. var option = {
  284. color: [
  285. new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  286. offset: 0,
  287. color: '#00E3C0'
  288. }, {
  289. offset: 1,
  290. color: '#0068DC'
  291. }]),
  292. new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  293. offset: 0,
  294. color: '#0068DC'
  295. }, {
  296. offset: 1,
  297. color: '#00E3C0'
  298. }])
  299. ],
  300. tooltip: {
  301. trigger: 'axis',
  302. axisPointer: {
  303. type: 'shadow'
  304. }
  305. },
  306. legend: {
  307. x:'right',
  308. textStyle:{
  309. fontSize: 12,//字体大小
  310. color: '"#fft'//字体颜色
  311. },
  312. },
  313. grid: {
  314. left: '3%',
  315. right: '4%',
  316. bottom: '3%',
  317. containLabel: true
  318. },
  319. yAxis: {
  320. type: 'value',
  321. boundaryGap: [0, 0.01],
  322. axisLabel: {
  323. show: true,
  324. textStyle: {
  325. color: '#ACB6B9' //这里用参数代替了
  326. }
  327. },
  328. },
  329. xAxis: {
  330. type: 'category',
  331. data: datesArry,
  332. axisLabel: {
  333. show: true,
  334. interval:0,
  335. rotate:40,
  336. textStyle: {
  337. color: '#ACB6B9' //这里用参数代替了
  338. }
  339. },
  340. },
  341. series: [
  342. {
  343. name: '已巡',
  344. type: 'bar',
  345. data: xunArry,
  346. barWidth:10
  347. },
  348. {
  349. name: '漏巡',
  350. type: 'bar',
  351. data: unXunArry,
  352. barWidth:10
  353. }
  354. ]
  355. };
  356. myChart.setOption(option);
  357. },
  358. }
  359. };
  360. </script>
  361. <style scoped>
  362. .divtitle{
  363. background: url("~@/assets/images/title2@2x.png") no-repeat;
  364. background-size: 100% 100%;
  365. width:100%;
  366. height:3.9rem;
  367. padding-top:0.8rem;
  368. padding-left:3rem;
  369. display: inline-flex
  370. /* float: left; */
  371. }
  372. .selectClass{
  373. background: #3DFFEA;
  374. border-radius: 0.6rem;
  375. color:#032738;
  376. }
  377. .unSelect{
  378. color:#C5D0D4;
  379. }
  380. /* .el-date-editor .el-range-separator{
  381. color: #C5D0D4
  382. } */
  383. .el-date-editor .el-range-separator{
  384. color:white
  385. }
  386. .watchStaticContent{
  387. width: 19rem;
  388. height: 7.8rem;
  389. background:rgba(0, 190, 117, 0.06)
  390. }
  391. </style>