securityHidden.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  1. <!-- 数据看板-安全隐患 -->
  2. <template>
  3. <view class="hazardSources">
  4. <view class="small-title">
  5. <view class="small-title-l">安全检查校级巡查计划标题标题标题标题标题</view>
  6. <img class="small-title-r" src="@/pages/images/dataBoard/icon_06.png">
  7. </view>
  8. <view class="chart">
  9. <view class="chart-t">
  10. <view class="chart-t-li" :class="chartIndex==index?'color-A':'color-B'" @click="chartClick(index)"
  11. v-for="(item,index) in chartTitle">{{item}}</view>
  12. </view>
  13. <view class="chart-b" v-if="chartIndex==0">
  14. <qiun-data-charts type="column" :opts="opts" :echartsH5="true" :chartData="chartData" />
  15. </view>
  16. <view class="chart-b2" v-if="chartIndex==0">
  17. <view class="chart-b2-li">
  18. <view class="chart-b2-li-t">
  19. <text>1</text>
  20. <text>农学院</text>
  21. </view>
  22. <view class="chart-b2-li-b">70</view>
  23. </view>
  24. <view class="chart-b2-li">
  25. <view class="chart-b2-li-t">
  26. <text>2</text>
  27. <text>理学院</text>
  28. </view>
  29. <view class="chart-b2-li-b">61</view>
  30. </view>
  31. <view class="chart-b2-li">
  32. <view class="chart-b2-li-t">
  33. <text>3</text>
  34. <text>生命科学</text>
  35. </view>
  36. <view class="chart-b2-li-b">54</view>
  37. </view>
  38. </view>
  39. <view class="chart-b-tow" v-if="chartIndex==1 || chartIndex==2">
  40. <qiun-data-charts type="radar" :opts="optsTow" :echartsH5="true" :chartData="chartDataTow" />
  41. </view>
  42. </view>
  43. <scroll-view scroll-x @scrolltolower="scrollGet" v-if="chartIndex!=0">
  44. <view class="tabTitle_tow">
  45. <view class="tabTitle_tow_li" @tap="tabClickTow(item,index)" :key="index"
  46. v-for="(item,index) in tabTextTow">
  47. <view :class="{on:curTabTow==index}" class="tabTitle_tow_text">{{item}}</view>
  48. <view :class="{on:curTabTow==index}" class="tabTitle_tow_across"></view>
  49. </view>
  50. </view>
  51. </scroll-view>
  52. <!--安全隐患排行 -->
  53. <view class="table" v-if="chartIndex==0">
  54. <uni-card>
  55. <view style="height: 200px">
  56. <zb-table :columns="column" :stripe="false" :border="false" :data="dataList"></zb-table>
  57. </view>
  58. </uni-card>
  59. </view>
  60. <!-- 一级指标排行 -->
  61. <view class="table-tow" v-if="chartIndex!=0 && curTabTow==0">
  62. <uni-card>
  63. <view style="height: 200px">
  64. <zb-table :columns="column2" :stripe="false" :border="false" :data="dataList"></zb-table>
  65. </view>
  66. </uni-card>
  67. </view>
  68. <!--学院单位 -->
  69. <view class="table-three" v-if="chartIndex!=0 && curTabTow==1">
  70. <uni-card>
  71. <view style="height: 200px">
  72. <zb-table :columns="column3" :stripe="false" :border="false" :data="dataList"></zb-table>
  73. </view>
  74. </uni-card>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. import {
  80. config
  81. } from '@/api/request/config.js'
  82. import {
  83. } from '@/pages_basics/api/index.js'
  84. export default {
  85. name: "hazardSources",
  86. components: {
  87. },
  88. data() {
  89. return {
  90. chartType: 3,
  91. chartTitle: ['安全隐患排行', '一级指标排行', '暂无法整改'],
  92. chartIndex: 0,
  93. opts: {
  94. color: ["#149F12", "#FF0000", "#FF9D25", ],
  95. padding: [15, 15, 4, 5],
  96. enableScroll: false,
  97. legend: {
  98. position: 'top',
  99. fontColor: '#fff',
  100. },
  101. xAxis: {
  102. disableGrid: true,
  103. disabled: true,
  104. axisLine: false,
  105. },
  106. yAxis: {
  107. disableGrid: true,
  108. data: [{
  109. disabled: true,
  110. }]
  111. },
  112. extra: {
  113. column: {
  114. type: "group",
  115. width: 14,
  116. linearType: "opacity",
  117. linearOpacity: 0.6,
  118. }
  119. }
  120. },
  121. optsTow: {
  122. color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
  123. "#ea7ccc"
  124. ],
  125. padding: [5, 5, 5, 5],
  126. dataLabel: false,
  127. enableScroll: false,
  128. legend: {
  129. show: false,
  130. },
  131. extra: {
  132. radar: {
  133. gridType: "radar",
  134. gridColor: "#CCCCCC",
  135. gridCount: 3,
  136. opacity: 0.2,
  137. max: 200,
  138. labelShow: true,
  139. border: true,
  140. labelColor: '#fff',
  141. }
  142. }
  143. },
  144. chartData: {},
  145. chartDataTow: {},
  146. // 查询参数
  147. queryParams: {
  148. page: 1,
  149. pageSize: 10,
  150. },
  151. column: [{
  152. type: 'index',
  153. label: '排行',
  154. fixed: true,
  155. width: 60,
  156. align: 'center',
  157. },
  158. {
  159. name: 'data1',
  160. label: '学院单位',
  161. fixed: true,
  162. width: 80,
  163. align: 'center',
  164. },
  165. {
  166. name: 'data2',
  167. label: '总隐患',
  168. align: 'center',
  169. },
  170. {
  171. name: 'data3',
  172. label: '已整改',
  173. align: 'center',
  174. },
  175. {
  176. name: 'data4',
  177. label: '未整改',
  178. align: 'center',
  179. },
  180. {
  181. name: 'data5',
  182. label: '暂无法整改',
  183. align: 'center',
  184. },
  185. ],
  186. column2: [{
  187. type: 'index',
  188. label: '序号',
  189. fixed: true,
  190. width: 60,
  191. align: 'center',
  192. },
  193. {
  194. name: 'data1',
  195. label: '一级指标',
  196. fixed: true,
  197. width: 80,
  198. align: 'center',
  199. },
  200. {
  201. name: 'data2',
  202. label: '隐患数',
  203. align: 'center',
  204. },
  205. {
  206. name: 'data3',
  207. label: '占比',
  208. align: 'center',
  209. },
  210. ],
  211. column3: [{
  212. type: 'index',
  213. label: '排行',
  214. fixed: true,
  215. width: 60,
  216. align: 'center',
  217. },
  218. {
  219. name: 'data1',
  220. label: '学院单位',
  221. fixed: true,
  222. width: 80,
  223. align: 'center',
  224. },
  225. {
  226. name: 'data2',
  227. label: '总隐患',
  228. align: 'center',
  229. },
  230. {
  231. name: 'data3',
  232. label: '实验场所',
  233. align: 'center',
  234. },
  235. {
  236. name: 'data4',
  237. label: '安全设施',
  238. align: 'center',
  239. },
  240. {
  241. name: 'data5',
  242. label: '化学安全',
  243. align: 'center',
  244. },
  245. {
  246. name: 'data6',
  247. label: '基础安全',
  248. align: 'center',
  249. },
  250. {
  251. name: 'data7',
  252. label: '生物安全',
  253. align: 'center',
  254. },
  255. {
  256. name: 'data8',
  257. label: '特种与冷热设备',
  258. align: 'center',
  259. },
  260. ],
  261. dataList: [{
  262. data1: '植物保护',
  263. data2: '102',
  264. data3: '47',
  265. data4: '22',
  266. data5: '13',
  267. data6: '4',
  268. data7: '12',
  269. data8: '23',
  270. data9: '21',
  271. },
  272. {
  273. data1: '资源环境',
  274. data2: '74',
  275. data3: '8',
  276. data4: '32',
  277. data5: '18',
  278. data6: '2',
  279. data7: '3',
  280. data8: '23',
  281. data9: '12',
  282. },
  283. {
  284. data1: '生命科学',
  285. data2: '66',
  286. data3: '28',
  287. data4: '10',
  288. data5: '8',
  289. data6: '56',
  290. data7: '22',
  291. data8: '13',
  292. data9: '12',
  293. },
  294. {
  295. data1: '园林艺术',
  296. data2: '56',
  297. data3: '23',
  298. data4: '17',
  299. data5: '5',
  300. data6: '12',
  301. data7: '24',
  302. data8: '53',
  303. data9: '14',
  304. },
  305. {
  306. data1: '化学与药物',
  307. data2: '34',
  308. data3: '12',
  309. data4: '11',
  310. data5: '21',
  311. data6: '54',
  312. data7: '11',
  313. data8: '23',
  314. data9: '12',
  315. },
  316. ],
  317. total: 0,
  318. tabTextTow: ['一级指标', '学院单位'],
  319. curTabTow: 0,
  320. }
  321. },
  322. created() {
  323. },
  324. beforeMount() {
  325. },
  326. mounted() {
  327. this.getServerData();
  328. },
  329. methods: {
  330. scrollGet() {
  331. },
  332. chartClick(index) {
  333. this.chartIndex = index;
  334. this.getServerDataTow();
  335. },
  336. //顶部tab点击
  337. tabClickTow(item, index) {
  338. this.curTabTow = index;
  339. },
  340. getServerData() {
  341. //模拟从服务器获取数据时的延时
  342. setTimeout(() => {
  343. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  344. let res = {
  345. categories: ["化学与药品学院", "化学与药品学院", "化学与药品学院"],
  346. series: [{
  347. name: "已整改",
  348. textColor: '#fff',
  349. data: [18, 27, 21, ]
  350. },
  351. {
  352. name: "未整改",
  353. textColor: '#fff',
  354. data: [35, 36, 31, ]
  355. },
  356. {
  357. name: "暂无法整改",
  358. textColor: '#fff',
  359. data: [8, 7, 2, ]
  360. }
  361. ]
  362. };
  363. this.chartData = JSON.parse(JSON.stringify(res));
  364. }, 500);
  365. },
  366. getServerDataTow() {
  367. //模拟从服务器获取数据时的延时
  368. setTimeout(() => {
  369. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  370. let res = {
  371. categories: ["生物安全", "基础安全", "安全设施", "化学安全"],
  372. series: [{
  373. name: "",
  374. data: [55, 31, 61, 48]
  375. },
  376. ]
  377. };
  378. this.chartDataTow = JSON.parse(JSON.stringify(res));
  379. }, 500);
  380. },
  381. },
  382. }
  383. </script>
  384. <style lang="stylus" scoped>
  385. .hazardSources {
  386. height: 100%;
  387. width: 100%;
  388. background: #363744;
  389. .small-title {
  390. width: 750rpx;
  391. height: 80rpx;
  392. background: #3E414F;
  393. display: flex;
  394. justify-content: space-between;
  395. align-items: center;
  396. padding: 0 20rpx 0 30rpx;
  397. box-sizing: border-box;
  398. margin-top: 2rpx;
  399. .small-title-l {
  400. flex: 1;
  401. font-weight: 400;
  402. font-size: 30rpx;
  403. color: #FFFFFF;
  404. line-height: 42rpx;
  405. overflow: hidden;
  406. text-overflow: ellipsis;
  407. white-space: nowrap;
  408. }
  409. .small-title-r {
  410. width: 14rpx;
  411. height: 8rpx;
  412. }
  413. }
  414. .chart {
  415. width: 690rpx;
  416. height: 520rpx;
  417. background: #3E414F;
  418. border-radius: 20rpx 20rpx 20rpx 20rpx;
  419. margin: 20rpx 30rpx 0;
  420. overflow: hidden;
  421. .chart-t {
  422. width: 570rpx;
  423. height: 50rpx;
  424. display: flex;
  425. justify-content: flex-start;
  426. border: 1rpx solid #52545F;
  427. border-radius: 10rpx;
  428. margin: 30rpx 0 0 72rpx;
  429. .chart-t-li {
  430. width: 190rpx;
  431. font-weight: 400;
  432. font-size: 28rpx;
  433. line-height: 50rpx;
  434. text-align: center;
  435. background: none;
  436. }
  437. .chart-t-li:nth-of-type(1) {
  438. border-right: 1rpx solid #52545F;
  439. }
  440. .chart-t-li:nth-of-type(2) {
  441. border-right: 1rpx solid #52545F;
  442. }
  443. .color-A {
  444. color: #FFFFFF;
  445. background: #52545F;
  446. }
  447. .color-B {
  448. color: #999999;
  449. background: none;
  450. }
  451. }
  452. .chart-b {
  453. width: 630rpx;
  454. height: 334rpx;
  455. margin-left: 30rpx;
  456. }
  457. .chart-b2 {
  458. width: 630rpx;
  459. margin: 0 30rpx;
  460. height: 106rx;
  461. display: flex;
  462. justify-content: flex-start;
  463. align-items: center;
  464. .chart-b2-li {
  465. flex: 1;
  466. .chart-b2-li-t {
  467. margin-top: 10rpx;
  468. text-align: center;
  469. >text:nth-of-type(1) {
  470. display: inline-block;
  471. width: 24rpx;
  472. height: 24rpx;
  473. background: #FF0000;
  474. border-radius: 6rpx 6rpx 6rpx 6rpx;
  475. margin-right: 10rpx;
  476. font-weight: 400;
  477. font-size: 22rpx;
  478. color: #FFFFFF;
  479. line-height: 24rpx;
  480. text-align: center;
  481. }
  482. >text:nth-of-type(2) {
  483. font-weight: 400;
  484. font-size: 24rpx;
  485. color: #FFFFFF;
  486. line-height: 34rpx;
  487. }
  488. }
  489. .chart-b2-li-b {
  490. margin-top: 10rpx;
  491. font-weight: 400;
  492. font-size: 24rpx;
  493. color: #FFFFFF;
  494. line-height: 34rpx;
  495. text-align: center;
  496. }
  497. }
  498. }
  499. .chart-b-tow {
  500. width: 630rpx;
  501. height: 440rpx;
  502. margin-left: 30rpx;
  503. }
  504. }
  505. .tabTitle_tow {
  506. width: 750rpx;
  507. height: 80rpx;
  508. white-space: nowrap;
  509. display: inline-flex;
  510. background: #3E414F;
  511. margin-top: 20rpx;
  512. padding-left: 35rpx;
  513. .tabTitle_tow_li {
  514. position: relative;
  515. width: 152rpx;
  516. height: 80rpx;
  517. text-align center;
  518. padding-top: 18rpx;
  519. box-sizing: border-box;
  520. .tabTitle_tow_text {
  521. display: inline-block;
  522. font-size: 32rpx;
  523. font-family: PingFang SC;
  524. font-weight: 500;
  525. color: #FFFFFF;
  526. line-height: 46rpx;
  527. position: relative;
  528. &.on {
  529. color: #0183FA;
  530. }
  531. }
  532. .tabTitle_tow_across {
  533. width: 50rpx;
  534. height: 4rpx;
  535. background: #0183FA;
  536. border-radius: 2rpx;
  537. margin-left: 33%;
  538. margin-top: 16rpx;
  539. display none;
  540. &.on {
  541. display block;
  542. }
  543. }
  544. }
  545. }
  546. .table {
  547. width: 690rpx;
  548. margin-top: 20rpx;
  549. margin-left: 30rpx;
  550. border-radius: 20rpx 20rpx 0 0;
  551. overflow: hidden;
  552. }
  553. .sortOne {
  554. display: inline-block;
  555. width: 40rpx;
  556. height: 40rpx;
  557. padding: 4rpx;
  558. box-sizing: border-box;
  559. background: rgba(255, 0, 0, 0.2);
  560. font-weight: 400;
  561. font-size: 28rpx;
  562. color: #FF0000;
  563. line-height: 40rpx;
  564. text-align: center;
  565. border-radius: 20rpx;
  566. }
  567. .sortTow {
  568. display: inline-block;
  569. width: 40rpx;
  570. height: 40rpx;
  571. padding: 4rpx;
  572. box-sizing: border-box;
  573. background: rgba(255, 153, 0, 0.2);
  574. font-weight: 400;
  575. font-size: 28rpx;
  576. color: #FF9900;
  577. line-height: 40rpx;
  578. text-align: center;
  579. border-radius: 20rpx;
  580. }
  581. .sortThree {
  582. display: inline-block;
  583. width: 40rpx;
  584. height: 40rpx;
  585. padding: 4rpx;
  586. box-sizing: border-box;
  587. background: rgba(255, 242, 0, 0.2);
  588. font-weight: 400;
  589. font-size: 28rpx;
  590. color: #FFF200;
  591. line-height: 40rpx;
  592. text-align: center;
  593. border-radius: 20rpx;
  594. }
  595. .sortFive {
  596. display: inline-block;
  597. width: 40rpx;
  598. height: 40rpx;
  599. padding: 4rpx;
  600. box-sizing: border-box;
  601. background: rgba(1, 131, 250, 0.2);
  602. font-weight: 400;
  603. font-size: 28rpx;
  604. color: #0183FA;
  605. line-height: 40rpx;
  606. text-align: center;
  607. border-radius: 20rpx;
  608. }
  609. .table-tow {
  610. width: 690rpx;
  611. margin: 20rpx 0 0 30rpx;
  612. .table-border {
  613. width: auto;
  614. overflow: auto;
  615. .table-th {
  616. width: 690rpx;
  617. padding: 0 30rpx;
  618. box-sizing: border-box;
  619. background: rgba(162, 162, 162, 0.2);
  620. border-radius: 20rpx 20rpx 0rpx 0rpx;
  621. .table-th-li {
  622. height: 80rpx;
  623. display: flex;
  624. justify-content: flex-start;
  625. >view {
  626. font-weight: 400;
  627. font-size: 30rpx;
  628. color: #FFFFFF;
  629. line-height: 80rpx;
  630. text-align: center;
  631. margin-right: 38rpx;
  632. width: 120rpx;
  633. overflow: hidden;
  634. text-overflow: ellipsis;
  635. white-space: nowrap;
  636. }
  637. >view:nth-of-type(1) {
  638. width: 64rpx;
  639. text-align: left;
  640. margin-right: 0;
  641. }
  642. >view:nth-of-type(2) {
  643. width: 270rpx;
  644. }
  645. >view:last-child {
  646. margin-right: 0;
  647. }
  648. }
  649. }
  650. .table-tb {
  651. width: 690rpx;
  652. background: #3E414F;
  653. padding: 0 30rpx;
  654. box-sizing: border-box;
  655. .table-tb-li {
  656. height: 80rpx;
  657. border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
  658. display: flex;
  659. justify-content: flex-start;
  660. >view {
  661. font-weight: 400;
  662. font-size: 28rpx;
  663. color: #FFFFFF;
  664. line-height: 80rpx;
  665. text-align: center;
  666. margin-right: 38rpx;
  667. width: 120rpx;
  668. overflow: hidden;
  669. text-overflow: ellipsis;
  670. white-space: nowrap;
  671. }
  672. >view:nth-of-type(1) {
  673. width: 64rpx;
  674. text-align: left;
  675. margin-right: 0;
  676. }
  677. >view:nth-of-type(2) {
  678. width: 270rpx;
  679. }
  680. >view:last-child {
  681. margin-right: 0;
  682. }
  683. }
  684. }
  685. }
  686. }
  687. .table-three {
  688. width: 720rpx;
  689. margin: 20rpx 0 0 30rpx;
  690. .table-border {
  691. width: auto;
  692. overflow: auto;
  693. .table-th {
  694. width: 1510rpx;
  695. padding: 0 30rpx;
  696. box-sizing: border-box;
  697. background: rgba(162, 162, 162, 0.2);
  698. border-radius: 20rpx 20rpx 0rpx 0rpx;
  699. .table-th-li {
  700. height: 80rpx;
  701. display: flex;
  702. justify-content: flex-start;
  703. >view {
  704. font-weight: 400;
  705. font-size: 30rpx;
  706. color: #FFFFFF;
  707. line-height: 80rpx;
  708. text-align: center;
  709. margin-right: 38rpx;
  710. width: 120rpx;
  711. overflow: hidden;
  712. text-overflow: ellipsis;
  713. white-space: nowrap;
  714. }
  715. >view:nth-of-type(1) {
  716. width: 116rpx;
  717. text-align: left;
  718. margin-right: 0;
  719. }
  720. >view:nth-of-type(2) {
  721. width: 168rpx;
  722. }
  723. >view:last-child {
  724. margin-right: 0;
  725. width: 228rpx;
  726. }
  727. }
  728. }
  729. .table-tb {
  730. width: 1510rpx;
  731. background: #3E414F;
  732. padding: 0 30rpx;
  733. box-sizing: border-box;
  734. .table-tb-li {
  735. height: 80rpx;
  736. border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
  737. display: flex;
  738. justify-content: flex-start;
  739. >view {
  740. font-weight: 400;
  741. font-size: 28rpx;
  742. color: #FFFFFF;
  743. line-height: 80rpx;
  744. text-align: center;
  745. margin-right: 38rpx;
  746. width: 120rpx;
  747. overflow: hidden;
  748. text-overflow: ellipsis;
  749. white-space: nowrap;
  750. }
  751. >view:nth-of-type(1) {
  752. width: 116rpx;
  753. text-align: left;
  754. margin-right: 0;
  755. }
  756. >view:nth-of-type(2) {
  757. width: 168rpx;
  758. }
  759. >view:last-child {
  760. margin-right: 0;
  761. width: 228rpx;
  762. }
  763. }
  764. }
  765. }
  766. }
  767. }
  768. </style>