warningDispose.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. <!-- 数据看板-预警处置 -->
  2. <template>
  3. <view class="warningDispose">
  4. <!-- <view class="chart">
  5. <img class="chart-bg" src="@/pages/images/dataBoard/dataBoard-icon4.png">
  6. <view class="chart-n">
  7. <view class="chart-t">
  8. <view class="chart-t-li" @click="dateClick(index)" :class="dateIndex==index?'color-A':'color-B'"
  9. v-for="(item,index) in dateList">
  10. <view class="chart-t-li-t">{{item.num}}</view>
  11. <view class="chart-t-li-b">{{item.letterNUm}}</view>
  12. </view>
  13. </view>
  14. <view class="chart-b">
  15. <view class="chart-b-li" v-for="(item,index) in deptList" :key="index">
  16. <view>{{item.deptSortName}}:{{item.todayTotal}}</view>
  17. <img v-if="item.todayTotal==0" src="@/pages/images/dataBoard/img_xyzc_bg.png">
  18. <img v-if="item.todayTotal!=0" src="@/pages/images/newImage/img_xyyc_bg@1x.png">
  19. </view>
  20. </view>
  21. </view>
  22. </view> -->
  23. <view class="statistics">
  24. <view class="statistics-b">
  25. <view class="statistics-b-li">
  26. <view class="statistics-b-li-t">{{yesterdayTotal}}</view>
  27. <view class="statistics-b-li-b">昨日预警处置数</view>
  28. </view>
  29. <view class="line"></view>
  30. <view class="statistics-b-li">
  31. <view class="statistics-b-li-t">{{todayTotal}}</view>
  32. <view class="statistics-b-li-b">今日预警处置数</view>
  33. </view>
  34. <view class="line"></view>
  35. <view class="statistics-b-li">
  36. <view class="statistics-b-li-t-tow">
  37. <text class="color-B">{{rate}}%</text>
  38. <img src="@/pages/images/dataBoard/dataBoard-icon3.png">
  39. </view>
  40. <view class="statistics-b-li-b">环比增长</view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="table">
  45. <uni-card>
  46. <view style="height: 400px">
  47. <zb-table :columns="column" :stripe="false" :border="false" :data="dataList"></zb-table>
  48. </view>
  49. </uni-card>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. import {
  55. config
  56. } from '@/api/request/config.js'
  57. import {
  58. reportAppStatisticsWarningHandle
  59. } from '@/pages/api/index.js'
  60. export default {
  61. name: "warningDispose",
  62. components: {
  63. },
  64. data() {
  65. return {
  66. dateList: [],
  67. dateIndex: 6,
  68. deptList: [],
  69. // 查询参数
  70. queryParams: {
  71. page: 1,
  72. pageSize: 10,
  73. },
  74. column: [{
  75. type: 'index',
  76. label: '排行',
  77. fixed: true,
  78. width: 60,
  79. align: 'center',
  80. },
  81. {
  82. name: 'deptSortName',
  83. label: '学院单位',
  84. fixed: true,
  85. width: 80,
  86. align: 'center',
  87. },
  88. {
  89. name: 'handleTotal',
  90. label: '总数',
  91. align: 'center',
  92. },
  93. {
  94. name: 'yesterdayTotal',
  95. label: '昨日',
  96. align: 'center',
  97. },
  98. {
  99. name: 'todayTotal',
  100. label: '今日',
  101. align: 'center',
  102. },
  103. {
  104. name: 'rate',
  105. label: '环比',
  106. align: 'center',
  107. },
  108. ],
  109. dataList: [],
  110. total: 0,
  111. todayTotal: 0,
  112. yesterdayTotal: 0,
  113. rate: 0,
  114. }
  115. },
  116. created() {
  117. },
  118. beforeMount() {
  119. },
  120. mounted() {
  121. this.getCurrentDate();
  122. },
  123. methods: {
  124. dateClick(index) {
  125. this.dateIndex = index;
  126. this.reportAppStatisticsWarningHandle();
  127. },
  128. getCurrentDate() {
  129. // 获取当前日期和星期
  130. let date = new Date();
  131. let weekdays = ["Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"];
  132. let weekdaysTow = ["7", "1", "2", "3", "4", "5", "6"];
  133. // 获取星期几的索引
  134. let dayOfWeekIndex = date.getDay();
  135. // 获取当天的日期和星期
  136. let dayOfMonth = date.getDate();
  137. let month = date.getMonth() + 1; // 月份从0开始,需要加1
  138. let year = date.getFullYear();
  139. // 输出当前日期和星期
  140. console.log("Today is " + month + "/" + dayOfMonth + "/" + year + ", " + weekdays[dayOfWeekIndex] + ".");
  141. // 获取接下来一周的每天日期和星期
  142. let nextDays = [];
  143. for (let i = 0; i < 7; i++) {
  144. let nextDate = new Date(date.getTime() - (i * 24 * 60 * 60 * 1000)); // 加上一天的时间差
  145. nextDays.push({
  146. date: nextDate.getDate(),
  147. month: nextDate.getMonth() + 1,
  148. year: nextDate.getFullYear(),
  149. dayOfWeek: weekdays[nextDate.getDay()],
  150. dayOfWeekTow: weekdaysTow[nextDate.getDay()],
  151. });
  152. }
  153. // 输出接下来一周的每天日期和星期
  154. for (let i = 0; i < 7; i++) {
  155. this.dateList.push({
  156. num:nextDays[i].dayOfWeekTow,
  157. letterNUm:nextDays[i].dayOfWeek,
  158. format:nextDays[i].year + "-" + nextDays[i].month + "-" + nextDays[i].date
  159. })
  160. }
  161. this.dateList=this.dateList.reverse();
  162. this.reportAppStatisticsWarningHandle();
  163. },
  164. //预警处置
  165. async reportAppStatisticsWarningHandle(planId) {
  166. let self = this;
  167. const {
  168. data
  169. } = await reportAppStatisticsWarningHandle({
  170. 'date': this.dateList[this.dateIndex].format
  171. });
  172. if (data.code == 200) {
  173. this.deptList = data.data.warningList;
  174. this.dataList = data.data.warningScatterList;
  175. this.$set(self, 'todayTotal', data.data.warning.todayTotal);
  176. this.$set(self, 'yesterdayTotal', data.data.warning.yesterdayTotal);
  177. this.$set(self, 'rate', data.data.warning.rate);
  178. }
  179. },
  180. },
  181. }
  182. </script>
  183. <style lang="stylus" scoped>
  184. .warningDispose {
  185. height: 100%;
  186. width: 100%;
  187. background: #363744;
  188. padding: 20rpx 0rpx 36rpx;
  189. box-sizing: border-box;
  190. .chart {
  191. width: 750rpx;
  192. height: 500rpx;
  193. position: relative;
  194. .chart-bg {
  195. width: 750rpx;
  196. height: 500rpx;
  197. position: absolute;
  198. z-index: 100;
  199. }
  200. .chart-n {
  201. padding: 34rpx 0rpx 26rpx;
  202. box-sizing: border-box;
  203. position: absolute;
  204. z-index: 200;
  205. .chart-t {
  206. display: flex;
  207. justify-content: space-between;
  208. margin: 0 50rpx;
  209. width: 650rpx;
  210. .chart-t-li {
  211. width: 76rpx;
  212. height: 100rpx;
  213. .chart-t-li-t {
  214. font-weight: 400;
  215. font-size: 30rpx;
  216. line-height: 42rpx;
  217. text-align: center;
  218. margin-top: 8rpx;
  219. }
  220. .chart-t-li-b {
  221. font-weight: 400;
  222. font-size: 28rpx;
  223. line-height: 39rpx;
  224. text-align: center;
  225. margin-top: 4rpx;
  226. }
  227. }
  228. .color-A {
  229. background: #0183FA;
  230. border-radius: 10rpx 10rpx 10rpx 10rpx;
  231. .chart-t-li-t {
  232. color: #FFFFFF;
  233. }
  234. .chart-t-li-b {
  235. color: #FFFFFF;
  236. }
  237. }
  238. .color-B {
  239. background: none;
  240. .chart-t-li-t {
  241. color: #FFFFFF;
  242. }
  243. .chart-t-li-b {
  244. color: #FFFFFF;
  245. }
  246. }
  247. }
  248. .chart-b {
  249. width: 690rpx;
  250. height: 350rpx;
  251. position: absolute;
  252. .chart-b-li {
  253. position: absolute;
  254. z-index: 300;
  255. width: 200rpx;
  256. height: 46rpx;
  257. >img {
  258. width: 200rpx;
  259. height: 46rpx;
  260. position: absolute;
  261. z-index: 400;
  262. }
  263. >view {
  264. padding-left: 16rpx;
  265. box-sizing: border-box;
  266. width: 200rpx;
  267. height: 46rpx;
  268. position: absolute;
  269. z-index: 500;
  270. font-weight: 400;
  271. font-size: 24rpx;
  272. color: #FFFFFF;
  273. line-height: 46rpx;
  274. text-align: left;
  275. }
  276. }
  277. .chart-b-li:nth-child(1){
  278. top:20rpx;
  279. left:30rpx;
  280. }
  281. .chart-b-li:nth-child(2){
  282. top:20rpx;
  283. left:260rpx;
  284. }
  285. .chart-b-li:nth-child(3){
  286. top:20rpx;
  287. left:490rpx;
  288. }
  289. .chart-b-li:nth-child(4){
  290. top:80rpx;
  291. left:30rpx;
  292. }
  293. .chart-b-li:nth-child(5){
  294. top:80rpx;
  295. left:260rpx;
  296. }
  297. .chart-b-li:nth-child(6){
  298. top:80rpx;
  299. left:490rpx;
  300. }
  301. .chart-b-li:nth-child(7){
  302. top:140rpx;
  303. left:30rpx;
  304. }
  305. .chart-b-li:nth-child(8){
  306. top:140rpx;
  307. left:260rpx;
  308. }
  309. .chart-b-li:nth-child(9){
  310. top:140rpx;
  311. left:490rpx;
  312. }
  313. .chart-b-li:nth-child(10){
  314. top:200rpx;
  315. left:30rpx;
  316. }
  317. .chart-b-li:nth-child(11){
  318. top:200rpx;
  319. left:260rpx;
  320. }
  321. .chart-b-li:nth-child(12){
  322. top:200rpx;
  323. left:490rpx;
  324. }
  325. .chart-b-li:nth-child(13){
  326. top:260rpx;
  327. left:30rpx;
  328. }
  329. .chart-b-li:nth-child(14){
  330. top:260rpx;
  331. left:260rpx;
  332. }
  333. .chart-b-li:nth-child(15){
  334. top:260rpx;
  335. left:490rpx;
  336. }
  337. .chart-b-li:nth-child(16){
  338. top:320rpx;
  339. left:30rpx;
  340. }
  341. .chart-b-li:nth-child(17){
  342. top:320rpx;
  343. left:260rpx;
  344. }
  345. .chart-b-li:nth-child(18){
  346. top:320rpx;
  347. left:490rpx;
  348. }
  349. .chart-b-li:nth-child(19){
  350. top:380rpx;
  351. left:30rpx;
  352. }
  353. .chart-b-li:nth-child(20){
  354. top:380rpx;
  355. left:260rpx;
  356. }
  357. .chart-b-li:nth-child(21){
  358. top:380rpx;
  359. left:490rpx;
  360. }
  361. }
  362. }
  363. }
  364. .statistics {
  365. width: 750rpx;
  366. height: 120rpx;
  367. background: #3E414F;
  368. .statistics-b {
  369. display: flex;
  370. justify-content: space-between;
  371. align-items: center;
  372. .statistics-b-li {
  373. flex: 1;
  374. text-align: center;
  375. .statistics-b-li-t {
  376. font-weight: 400;
  377. font-size: 36rpx;
  378. color: #FFFFFF;
  379. line-height: 50rpx;
  380. margin-top: 10rpx;
  381. }
  382. .statistics-b-li-t-tow {
  383. margin-top: 10rpx;
  384. display: flex;
  385. justify-content: center;
  386. align-items: center;
  387. >text {
  388. font-weight: 400;
  389. font-size: 28rpx;
  390. line-height: 50rpx;
  391. }
  392. >img {
  393. width: 22rpx;
  394. height: 28rpx;
  395. }
  396. }
  397. .color-A {
  398. color: #FF0000;
  399. }
  400. .color-B {
  401. color: #2EA805;
  402. }
  403. .statistics-b-li-b {
  404. font-weight: 400;
  405. font-size: 24rpx;
  406. color: #FFFFFF;
  407. line-height: 34rpx;
  408. margin-top: 9rpx;
  409. }
  410. }
  411. .line {
  412. width: 2rpx;
  413. height: 30rpx;
  414. background: #D8D8D8;
  415. }
  416. }
  417. }
  418. .table {
  419. width: 690rpx;
  420. margin-top: 20rpx;
  421. border-radius: 20rpx 20rpx 0 0;
  422. overflow: hidden;
  423. margin-left: 30rpx;
  424. }
  425. }
  426. </style>