securityHidden.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864
  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">132</view>
  23. </view>
  24. <view class="chart-b2-li">
  25. <view class="chart-b2-li-t">
  26. <text>1</text>
  27. <text>理学院</text>
  28. </view>
  29. <view class="chart-b2-li-b">132</view>
  30. </view>
  31. <view class="chart-b2-li">
  32. <view class="chart-b2-li-t">
  33. <text>1</text>
  34. <text>生命科学</text>
  35. </view>
  36. <view class="chart-b2-li-b">132</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: 'data3',
  167. label: '总隐患',
  168. align: 'center',
  169. },
  170. {
  171. name: 'data4',
  172. label: '已整改',
  173. align: 'center',
  174. },
  175. {
  176. name: 'data5',
  177. label: '未整改',
  178. align: 'center',
  179. },
  180. {
  181. name: 'data6',
  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: 'data3',
  202. label: '隐患数',
  203. align: 'center',
  204. },
  205. {
  206. name: 'data4',
  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: 'data3',
  227. label: '总隐患',
  228. align: 'center',
  229. },
  230. {
  231. name: 'data4',
  232. label: '实验场所',
  233. align: 'center',
  234. },
  235. {
  236. name: 'data5',
  237. label: '安全设施',
  238. align: 'center',
  239. },
  240. {
  241. name: 'data6',
  242. label: '化学安全',
  243. align: 'center',
  244. },
  245. {
  246. name: 'data7',
  247. label: '基础安全',
  248. align: 'center',
  249. },
  250. {
  251. name: 'data8',
  252. label: '生物安全',
  253. align: 'center',
  254. },
  255. {
  256. name: 'data9',
  257. label: '特种与冷热设备',
  258. align: 'center',
  259. },
  260. ],
  261. dataList: [{
  262. data1: '植物保护',
  263. data2: '499',
  264. data3: '47',
  265. data4: '220',
  266. data5: '137',
  267. data6: '137',
  268. data7: '137',
  269. data8: '137',
  270. data9: '137',
  271. },
  272. {
  273. data1: '资源环境',
  274. data2: '199',
  275. data3: '7',
  276. data4: '120',
  277. data5: '37',
  278. data6: '137',
  279. data7: '137',
  280. data8: '137',
  281. data9: '137',
  282. },
  283. {
  284. data1: '生命科学',
  285. data2: '299',
  286. data3: '71',
  287. data4: '10',
  288. data5: '37',
  289. data6: '137',
  290. data7: '137',
  291. data8: '137',
  292. data9: '137',
  293. },
  294. {
  295. data1: '资源环境',
  296. data2: '199',
  297. data3: '7',
  298. data4: '120',
  299. data5: '37',
  300. data6: '137',
  301. data7: '137',
  302. data8: '137',
  303. data9: '137',
  304. },
  305. {
  306. data1: '生命科学',
  307. data2: '299',
  308. data3: '71',
  309. data4: '10',
  310. data5: '37',
  311. data6: '137',
  312. data7: '137',
  313. data8: '137',
  314. data9: '137',
  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: [35, 36, 31, ]
  350. },
  351. {
  352. name: "未整改",
  353. textColor: '#fff',
  354. data: [18, 27, 21, ]
  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: "成交量1",
  374. data: [90, 110, 165, 195, 187]
  375. },
  376. {
  377. name: "成交量2",
  378. data: [190, 210, 105, 35, 27]
  379. }
  380. ]
  381. };
  382. this.chartDataTow = JSON.parse(JSON.stringify(res));
  383. }, 500);
  384. },
  385. },
  386. }
  387. </script>
  388. <style lang="stylus" scoped>
  389. .hazardSources {
  390. height: 100%;
  391. width: 100%;
  392. background: #363744;
  393. .small-title {
  394. width: 750rpx;
  395. height: 80rpx;
  396. background: #3E414F;
  397. display: flex;
  398. justify-content: space-between;
  399. align-items: center;
  400. padding: 0 20rpx 0 30rpx;
  401. box-sizing: border-box;
  402. margin-top: 2rpx;
  403. .small-title-l {
  404. flex: 1;
  405. font-weight: 400;
  406. font-size: 30rpx;
  407. color: #FFFFFF;
  408. line-height: 42rpx;
  409. overflow: hidden;
  410. text-overflow: ellipsis;
  411. white-space: nowrap;
  412. }
  413. .small-title-r {
  414. width: 14rpx;
  415. height: 8rpx;
  416. }
  417. }
  418. .chart {
  419. width: 690rpx;
  420. height: 520rpx;
  421. background: #3E414F;
  422. border-radius: 20rpx 20rpx 20rpx 20rpx;
  423. margin: 20rpx 30rpx 0;
  424. overflow: hidden;
  425. .chart-t {
  426. width: 570rpx;
  427. height: 50rpx;
  428. display: flex;
  429. justify-content: flex-start;
  430. border: 1rpx solid #52545F;
  431. border-radius: 10rpx;
  432. margin: 30rpx 0 0 72rpx;
  433. .chart-t-li {
  434. width: 190rpx;
  435. font-weight: 400;
  436. font-size: 28rpx;
  437. line-height: 50rpx;
  438. text-align: center;
  439. background: none;
  440. }
  441. .chart-t-li:nth-of-type(1) {
  442. border-right: 1rpx solid #52545F;
  443. }
  444. .chart-t-li:nth-of-type(2) {
  445. border-right: 1rpx solid #52545F;
  446. }
  447. .color-A {
  448. color: #FFFFFF;
  449. background: #52545F;
  450. }
  451. .color-B {
  452. color: #999999;
  453. background: none;
  454. }
  455. }
  456. .chart-b {
  457. width: 630rpx;
  458. height: 334rpx;
  459. margin-left: 30rpx;
  460. }
  461. .chart-b2 {
  462. width: 630rpx;
  463. margin: 0 30rpx;
  464. height: 106rx;
  465. display: flex;
  466. justify-content: flex-start;
  467. align-items: center;
  468. .chart-b2-li {
  469. flex: 1;
  470. .chart-b2-li-t {
  471. margin-top: 10rpx;
  472. text-align: center;
  473. >text:nth-of-type(1) {
  474. display: inline-block;
  475. width: 24rpx;
  476. height: 24rpx;
  477. background: #FF0000;
  478. border-radius: 6rpx 6rpx 6rpx 6rpx;
  479. margin-right: 10rpx;
  480. font-weight: 400;
  481. font-size: 22rpx;
  482. color: #FFFFFF;
  483. line-height: 24rpx;
  484. text-align: center;
  485. }
  486. >text:nth-of-type(2) {
  487. font-weight: 400;
  488. font-size: 24rpx;
  489. color: #FFFFFF;
  490. line-height: 34rpx;
  491. }
  492. }
  493. .chart-b2-li-b {
  494. margin-top: 10rpx;
  495. font-weight: 400;
  496. font-size: 24rpx;
  497. color: #FFFFFF;
  498. line-height: 34rpx;
  499. text-align: center;
  500. }
  501. }
  502. }
  503. .chart-b-tow {
  504. width: 630rpx;
  505. height: 440rpx;
  506. margin-left: 30rpx;
  507. }
  508. }
  509. .tabTitle_tow {
  510. width: 750rpx;
  511. height: 80rpx;
  512. white-space: nowrap;
  513. display: inline-flex;
  514. background: #3E414F;
  515. margin-top: 20rpx;
  516. padding-left: 35rpx;
  517. .tabTitle_tow_li {
  518. position: relative;
  519. width: 152rpx;
  520. height: 80rpx;
  521. text-align center;
  522. padding-top: 18rpx;
  523. box-sizing: border-box;
  524. .tabTitle_tow_text {
  525. display: inline-block;
  526. font-size: 32rpx;
  527. font-family: PingFang SC;
  528. font-weight: 500;
  529. color: #FFFFFF;
  530. line-height: 46rpx;
  531. position: relative;
  532. &.on {
  533. color: #0183FA;
  534. }
  535. }
  536. .tabTitle_tow_across {
  537. width: 50rpx;
  538. height: 4rpx;
  539. background: #0183FA;
  540. border-radius: 2rpx;
  541. margin-left: 33%;
  542. margin-top: 16rpx;
  543. display none;
  544. &.on {
  545. display block;
  546. }
  547. }
  548. }
  549. }
  550. .table {
  551. width: 690rpx;
  552. margin-top: 20rpx;
  553. margin-left: 30rpx;
  554. border-radius: 20rpx 20rpx 0 0;
  555. overflow: hidden;
  556. }
  557. .sortOne {
  558. display: inline-block;
  559. width: 40rpx;
  560. height: 40rpx;
  561. padding: 4rpx;
  562. box-sizing: border-box;
  563. background: rgba(255, 0, 0, 0.2);
  564. font-weight: 400;
  565. font-size: 28rpx;
  566. color: #FF0000;
  567. line-height: 40rpx;
  568. text-align: center;
  569. border-radius: 20rpx;
  570. }
  571. .sortTow {
  572. display: inline-block;
  573. width: 40rpx;
  574. height: 40rpx;
  575. padding: 4rpx;
  576. box-sizing: border-box;
  577. background: rgba(255, 153, 0, 0.2);
  578. font-weight: 400;
  579. font-size: 28rpx;
  580. color: #FF9900;
  581. line-height: 40rpx;
  582. text-align: center;
  583. border-radius: 20rpx;
  584. }
  585. .sortThree {
  586. display: inline-block;
  587. width: 40rpx;
  588. height: 40rpx;
  589. padding: 4rpx;
  590. box-sizing: border-box;
  591. background: rgba(255, 242, 0, 0.2);
  592. font-weight: 400;
  593. font-size: 28rpx;
  594. color: #FFF200;
  595. line-height: 40rpx;
  596. text-align: center;
  597. border-radius: 20rpx;
  598. }
  599. .sortFive {
  600. display: inline-block;
  601. width: 40rpx;
  602. height: 40rpx;
  603. padding: 4rpx;
  604. box-sizing: border-box;
  605. background: rgba(1, 131, 250, 0.2);
  606. font-weight: 400;
  607. font-size: 28rpx;
  608. color: #0183FA;
  609. line-height: 40rpx;
  610. text-align: center;
  611. border-radius: 20rpx;
  612. }
  613. .table-tow {
  614. width: 690rpx;
  615. margin: 20rpx 0 0 30rpx;
  616. .table-border {
  617. width: auto;
  618. overflow: auto;
  619. .table-th {
  620. width: 690rpx;
  621. padding: 0 30rpx;
  622. box-sizing: border-box;
  623. background: rgba(162, 162, 162, 0.2);
  624. border-radius: 20rpx 20rpx 0rpx 0rpx;
  625. .table-th-li {
  626. height: 80rpx;
  627. display: flex;
  628. justify-content: flex-start;
  629. >view {
  630. font-weight: 400;
  631. font-size: 30rpx;
  632. color: #FFFFFF;
  633. line-height: 80rpx;
  634. text-align: center;
  635. margin-right: 38rpx;
  636. width: 120rpx;
  637. overflow: hidden;
  638. text-overflow: ellipsis;
  639. white-space: nowrap;
  640. }
  641. >view:nth-of-type(1) {
  642. width: 64rpx;
  643. text-align: left;
  644. margin-right: 0;
  645. }
  646. >view:nth-of-type(2) {
  647. width: 270rpx;
  648. }
  649. >view:last-child {
  650. margin-right: 0;
  651. }
  652. }
  653. }
  654. .table-tb {
  655. width: 690rpx;
  656. background: #3E414F;
  657. padding: 0 30rpx;
  658. box-sizing: border-box;
  659. .table-tb-li {
  660. height: 80rpx;
  661. border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
  662. display: flex;
  663. justify-content: flex-start;
  664. >view {
  665. font-weight: 400;
  666. font-size: 28rpx;
  667. color: #FFFFFF;
  668. line-height: 80rpx;
  669. text-align: center;
  670. margin-right: 38rpx;
  671. width: 120rpx;
  672. overflow: hidden;
  673. text-overflow: ellipsis;
  674. white-space: nowrap;
  675. }
  676. >view:nth-of-type(1) {
  677. width: 64rpx;
  678. text-align: left;
  679. margin-right: 0;
  680. }
  681. >view:nth-of-type(2) {
  682. width: 270rpx;
  683. }
  684. >view:last-child {
  685. margin-right: 0;
  686. }
  687. }
  688. }
  689. }
  690. }
  691. .table-three {
  692. width: 720rpx;
  693. margin: 20rpx 0 0 30rpx;
  694. .table-border {
  695. width: auto;
  696. overflow: auto;
  697. .table-th {
  698. width: 1510rpx;
  699. padding: 0 30rpx;
  700. box-sizing: border-box;
  701. background: rgba(162, 162, 162, 0.2);
  702. border-radius: 20rpx 20rpx 0rpx 0rpx;
  703. .table-th-li {
  704. height: 80rpx;
  705. display: flex;
  706. justify-content: flex-start;
  707. >view {
  708. font-weight: 400;
  709. font-size: 30rpx;
  710. color: #FFFFFF;
  711. line-height: 80rpx;
  712. text-align: center;
  713. margin-right: 38rpx;
  714. width: 120rpx;
  715. overflow: hidden;
  716. text-overflow: ellipsis;
  717. white-space: nowrap;
  718. }
  719. >view:nth-of-type(1) {
  720. width: 116rpx;
  721. text-align: left;
  722. margin-right: 0;
  723. }
  724. >view:nth-of-type(2) {
  725. width: 168rpx;
  726. }
  727. >view:last-child {
  728. margin-right: 0;
  729. width: 228rpx;
  730. }
  731. }
  732. }
  733. .table-tb {
  734. width: 1510rpx;
  735. background: #3E414F;
  736. padding: 0 30rpx;
  737. box-sizing: border-box;
  738. .table-tb-li {
  739. height: 80rpx;
  740. border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
  741. display: flex;
  742. justify-content: flex-start;
  743. >view {
  744. font-weight: 400;
  745. font-size: 28rpx;
  746. color: #FFFFFF;
  747. line-height: 80rpx;
  748. text-align: center;
  749. margin-right: 38rpx;
  750. width: 120rpx;
  751. overflow: hidden;
  752. text-overflow: ellipsis;
  753. white-space: nowrap;
  754. }
  755. >view:nth-of-type(1) {
  756. width: 116rpx;
  757. text-align: left;
  758. margin-right: 0;
  759. }
  760. >view:nth-of-type(2) {
  761. width: 168rpx;
  762. }
  763. >view:last-child {
  764. margin-right: 0;
  765. width: 228rpx;
  766. }
  767. }
  768. }
  769. }
  770. }
  771. }
  772. </style>