planDetail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. <template>
  2. <div class="main">
  3. <Header/>
  4. <div class="main_t">
  5. <div class="main_t_t">
  6. <i class="main_t_t_l">当前位置:首页 &gt;</i>
  7. <i>风险预警统计</i>
  8. </div>
  9. <!--<div class="main_t_b" id="plan_chart"></div>-->
  10. </div>
  11. <div class="main_b">
  12. <!--查询条件-->
  13. <el-form :model="editForm" ref="queryParams" class="form-box" :inline="true" style="margin:20px;">
  14. <el-form-item label="实验室" prop="dangerId" label-width="98px">
  15. <el-select v-model="editForm.subjectId" popper-class="select-big-data" placeholder="请选择实验室">
  16. <el-option
  17. v-for="item in labList"
  18. :key="item.id"
  19. :label="item.name"
  20. :value="item.id">
  21. </el-option>
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item label="日期" prop="dateRange" label-width="68px">
  25. <el-date-picker
  26. popper-class="select-big-data-time"
  27. v-model="dateRange"
  28. size="small"
  29. style="width: 240px"
  30. value-format="yyyy-MM-dd"
  31. type="daterange"
  32. range-separator="-"
  33. start-placeholder="开始日期"
  34. end-placeholder="结束日期"
  35. ></el-date-picker>
  36. </el-form-item>
  37. <el-form-item label-width="0">
  38. <el-button type="primary" @click.native.prevent="onSearch" native-type="submit">查询</el-button>
  39. <el-button @click="resetForm('searchForm')">重置</el-button>
  40. </el-form-item>
  41. </el-form>
  42. <!--列表-->
  43. <el-table :data="tableData" style="width: 100%;" height="740" :row-class-name="tableRowClassName">
  44. <el-table-column align="center" header-align='center' type="index" :index="indexMethod" label="序号" width="60"></el-table-column>
  45. <el-table-column align="left" header-align='center' prop="subjectName" label="实验室">
  46. <template slot-scope="scope" >
  47. <div class="lab_border">
  48. <span class="lab_span"><i>{{scope.row.classifiedName}}</i><i>{{scope.row.typeName}}</i></span>
  49. <span class="lab_span2">{{scope.row.subjectName}}</span>
  50. </div>
  51. </template>
  52. </el-table-column>
  53. <el-table-column align="center" header-align='center' prop="createTimeStr" label="起始时间"></el-table-column>
  54. <el-table-column align="center" header-align='center' prop="overTime" label="结束时间"></el-table-column>
  55. <el-table-column align="center" header-align='center' prop="alarmInfo" label="风险预警">
  56. <template slot-scope="scope">
  57. <span class="risk_span"><img v-if="scope.row.alarmInfo==1" src="@/assets/image/icon_fxyj_xz.png"/><img v-if="scope.row.alarmInfo==0" src="@/assets/image/icon_fxyj_zc.png"/>声光报警</span>
  58. <span class="risk_span"><img v-if="scope.row.phoneInfo==1" src="@/assets/image/icon_fxyj_xz.png"/><img v-if="scope.row.phoneInfo==0" src="@/assets/image/icon_fxyj_zc.png"/>电话</span>
  59. <span class="risk_span"><img v-if="scope.row.phoneInfo==1" src="@/assets/image/icon_fxyj_xz.png"/><img v-if="scope.row.phoneInfo==0" src="@/assets/image/icon_fxyj_zc.png"/>短信</span>
  60. </template>
  61. </el-table-column>
  62. <el-table-column align="center" header-align='center' prop="sesorContent" label="应急处置">
  63. <template slot-scope="scope" >
  64. <span class="risk_span"><img v-if="scope.row.windInfo==1" src="@/assets/image/icon_fxyj_xz.png"/><img v-if="scope.row.windInfo==0" src="@/assets/image/icon_fxyj_zc.png"/>通风</span>
  65. <span class="risk_span"><img v-if="scope.row.powerInfo==1" src="@/assets/image/icon_fxyj_xz.png"/><img v-if="scope.row.powerInfo==0" src="@/assets/image/icon_fxyj_zc.png"/>断电</span>
  66. <span class="risk_span"><img src="@/assets/image/icon_fxyj_zc.png"/>短信</span>
  67. </template>
  68. </el-table-column>
  69. </el-table>
  70. <el-pagination
  71. style="margin-top: 14px"
  72. background
  73. @current-change="handleCurrentChange"
  74. :page-sizes="[10, 20, 30, 40]"
  75. :current-page.sync="editForm.pageNum"
  76. :page-size="editForm.pageSize"
  77. layout="total,prev, pager, next"
  78. :total="totalNum">
  79. </el-pagination>
  80. </div>
  81. </div>
  82. </template>
  83. <script>
  84. import {departmentsList, getRiskPlanList, getSubjectDict, getYearControlInfo,} from "../api/http"
  85. import Header from '@/components/header.vue'
  86. export default {
  87. components: {
  88. Header
  89. },
  90. data() {
  91. return {
  92. editForm:{
  93. deptLevel:'',//这个是登陆后,刘波给你的院校的类型
  94. groupDeptId:'',//院系id
  95. subjectId:'',//实验室类型
  96. beginTimeStr:'',//开始时间
  97. endTimeStr:'',//结束时间
  98. pageNum:1,
  99. pageSize:10
  100. },
  101. subjectOptions:[],//院系
  102. labList:[],//实验室
  103. dateRange:[],//时间
  104. totalNum:0,
  105. tableData:[],
  106. }
  107. },
  108. methods: {
  109. back(){
  110. this.$router.push('/')
  111. },
  112. tableRowClassName({ rowIndex}) {
  113. if (rowIndex%2 === 0) {
  114. return 'success-row';
  115. } else{
  116. return 'warning-row';
  117. }
  118. },
  119. indexMethod(index) {
  120. return (this.editForm.pageNum - 1) * this.editForm.pageSize + index + 1;
  121. },
  122. //请求列表
  123. getAjaxList:function (){
  124. let _this=this;
  125. //列表
  126. let obj={
  127. 'groupDeptId':this.editForm.groupDeptId,
  128. 'subjectId':this.editForm.subjectId,
  129. 'pageNum':this.editForm.pageNum,
  130. 'pageSize':this.editForm.pageSize,
  131. 'beginTimeStr':this.editForm.beginTimeStr,
  132. 'endTimeStr':this.editForm.endTimeStr,
  133. }
  134. getRiskPlanList(obj).then((res) =>{
  135. if(res.code==200){
  136. let data = res.rows;
  137. if(data && data.length>0){
  138. _this.tableData = data;
  139. _this.totalNum = parseInt(res.total);
  140. }else{
  141. _this.tableData = [];
  142. _this.totalNum = 0;
  143. }
  144. }
  145. })
  146. },
  147. getAjaxData: function () {
  148. let _this=this;
  149. let obj={
  150. 'deptLevel':localStorage.getItem('deptLevel')
  151. }
  152. //图表
  153. getYearControlInfo(obj).then((res) =>{
  154. if(res.code==200){
  155. let dataX=[];
  156. let dataValue=[];
  157. let data=res.data.list;
  158. for (var i = 0; i < data.length; i++) {
  159. dataX.push( data[i].yearMonth)
  160. dataValue.push(data[i].num)
  161. }
  162. // planDetailFun(dataX,dataValue)
  163. }
  164. })
  165. //查询院系
  166. departmentsList().then((res) =>{
  167. if(res.code==200){
  168. let data=res.data;
  169. _this.subjectOptions=data
  170. }
  171. })
  172. //查询实验室
  173. getSubjectDict().then((res) =>{
  174. if(res.code==200){
  175. let data=res.data;
  176. _this.labList=data
  177. }
  178. })
  179. },
  180. /*查询*/
  181. onSearch() {
  182. if(this.dateRange.length>0){
  183. this.editForm.beginTimeStr = this.dateRange[0];
  184. this.editForm.endTimeStr = this.dateRange[1];
  185. }
  186. this.editForm.pageNum =1;
  187. this.getAjaxList();
  188. this.getAjaxData();
  189. },
  190. /*重置*/
  191. resetForm() {
  192. this.editForm.groupDeptId = "";
  193. this.editForm.subjectId = "";
  194. this.editForm.beginTimeStr = "";
  195. this.editForm.endTimeStr = "";
  196. this.dateRange = [];
  197. this.onSearch();
  198. },
  199. handleCurrentChange(val) {
  200. this.editForm.pageNum = val;
  201. this.getAjaxList();
  202. },
  203. /*安全隐患详情图表*/
  204. planDetailFun:function (dataX,dataVal) {
  205. const data = dataVal
  206. const sideData = data.map(item => item)//侧边主体高度
  207. let planOption = {
  208. tooltip: {
  209. /* trigger: 'axis',
  210. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  211. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  212. }*/
  213. },
  214. /*内边距*/
  215. grid: {
  216. top: '14%',
  217. left: '2%',
  218. right: '2%',
  219. bottom: '5%',
  220. containLabel: true
  221. },
  222. xAxis: {
  223. data: dataX,
  224. //坐标轴
  225. axisLine: {
  226. lineStyle: {
  227. "color": "#486CC2",
  228. width:2,
  229. }
  230. },
  231. axisTick: {
  232. show: false,
  233. length: 9,
  234. alignWithLabel: true,
  235. lineStyle: {
  236. color: '#7DFFFD'
  237. }
  238. },
  239. //坐标值标注
  240. axisLabel: {
  241. show: true,
  242. textStyle: {
  243. color: '#fff',
  244. fontSize:16,
  245. }
  246. }
  247. },
  248. yAxis: [
  249. {
  250. //坐标轴
  251. axisLine: {
  252. lineStyle: {
  253. "color": "#486CC2",
  254. width:2,
  255. }
  256. },
  257. axisTick: {
  258. show: false,
  259. },
  260. //坐标值标注
  261. axisLabel: {
  262. show: true,
  263. textStyle: {
  264. color: '#fff',
  265. fontSize:16,
  266. }
  267. },
  268. //分格线
  269. splitLine: {
  270. show: false,
  271. lineStyle: {
  272. color: '#4784e8'
  273. }
  274. }
  275. }
  276. ],
  277. series: [{
  278. name: '预案执行统计',//正面
  279. //柱状图顶部数值
  280. "label": {
  281. "normal": {
  282. "show": true,
  283. "position": "top",
  284. fontSize: 14,
  285. fontWeight: '500',
  286. color: '#fff',
  287. padding:[2,2,2,10],
  288. }
  289. },
  290. tooltip: {
  291. show: false
  292. },
  293. type: 'bar',
  294. barWidth: 24.5,
  295. itemStyle: {
  296. normal: {
  297. color: new this.$echarts.graphic.LinearGradient(0, 1, 0, 0, [{
  298. offset: 0,
  299. color: "#228efb" // 0% 处的颜色
  300. }, {
  301. offset: 0.6,
  302. color: "#04acf3" // 60% 处的颜色
  303. }, {
  304. offset: 1,
  305. color: "#05e5e5" // 100% 处的颜色
  306. }], false)
  307. }
  308. },
  309. data: data,
  310. }, {
  311. type: 'bar',//侧边
  312. name: '预案执行统计',
  313. barWidth: 8,
  314. itemStyle: {
  315. normal: {
  316. color: new this.$echarts.graphic.LinearGradient(0, 1, 0, 0, [{
  317. offset: 0,
  318. color: "#228efb" // 0% 处的颜色
  319. }, {
  320. offset: 0.6,
  321. color: "#04acf3" // 60% 处的颜色
  322. }, {
  323. offset: 1,
  324. color: "#05e5e5" // 100% 处的颜色
  325. }], false)
  326. }
  327. },
  328. barGap: 0,
  329. data: sideData
  330. }, {
  331. name: '预案执行统计',
  332. tooltip: {
  333. show: false
  334. },
  335. type: 'pictorialBar',
  336. itemStyle: {
  337. borderWidth: 1,
  338. borderColor: '#0058FF',
  339. color: '#0058FF'
  340. },
  341. symbol: 'path://M 0,0 l 120,0 l -30,60 l -120,0 z',
  342. symbolSize: ['32', '12'],
  343. symbolOffset: ['-1', '-11'],
  344. //symbolRotate: -5,
  345. symbolPosition: 'end',
  346. data: data,
  347. z: 3
  348. },
  349. ]
  350. };
  351. var plan_chart = this.$echarts.init(document.getElementById('plan_chart'));
  352. plan_chart.setOption(planOption);
  353. }
  354. },
  355. mounted() {
  356. this.getAjaxData()
  357. this.getAjaxList()
  358. },
  359. }
  360. </script>
  361. <!-- Add "scoped" attribute to limit CSS to this component only -->
  362. <style lang="scss" scoped>
  363. @function rw($px){
  364. @return $px*100/1920 *1vw;
  365. }
  366. @function rh($px){
  367. @return $px*100/1080 *1vh;
  368. }
  369. * {
  370. padding: 0;
  371. margin: 0;
  372. box-sizing: border-box;
  373. }
  374. .lab_border{
  375. display: flex;
  376. align-items: center;
  377. }
  378. .lab_span{
  379. display: inline-block;
  380. border: 1px solid #0183FA;
  381. border-radius: rh(6);
  382. padding: rh(6) rw(16);
  383. margin-right: rw(8);
  384. >i{
  385. font-size: rh(12);
  386. font-family: Microsoft YaHei;
  387. font-weight: 400;
  388. color: #0183FA;
  389. line-height: rh(16);
  390. display: block;
  391. }
  392. >i:nth-of-type(1){}
  393. >i:nth-of-type(2){}
  394. }
  395. .lab_span2{
  396. display: inline-block;
  397. font-size: rh(14);
  398. font-family: Microsoft YaHei;
  399. font-weight: 400;
  400. color: #FFFFFF;
  401. }
  402. .risk_span{
  403. font-size: rh(14);
  404. font-family: Microsoft YaHei;
  405. font-weight: 400;
  406. color: #FFFFFF;
  407. margin-right: rw(28);
  408. >img{
  409. width: rw(14);
  410. height:rh(14);
  411. margin-right: rw(8);
  412. position: relative;
  413. top: rh(2);
  414. }
  415. }
  416. .main {
  417. width: rw(1920);
  418. height: rh(1080);
  419. /* background: url("../img/index_bg.png") no-repeat;
  420. background-size: 100% 100%;*/
  421. position: relative;
  422. left: 0;
  423. top: 0;
  424. z-index: 50;
  425. background: #062338;
  426. .header {
  427. width: 100%;
  428. position: absolute;
  429. left: rw(0);
  430. top: rh(0);
  431. z-index: 100;
  432. display: flex;
  433. justify-content: flex-start;
  434. .header_l {
  435. width: rw(182);
  436. height: rh(44);
  437. margin: rh(10) 0 0 rw(40);
  438. }
  439. .header_c {
  440. width: rw(1180);
  441. height: rh(152);
  442. margin-left: rw(136);
  443. background: url("~@/assets/image/index_icon2.png") no-repeat;
  444. background-size: 100% 100%;
  445. font-size: rh(30);
  446. font-family: Microsoft YaHei;
  447. font-weight: bold;
  448. color: #FFFFFF;
  449. line-height: rh(30);
  450. text-align: center;
  451. padding-top: rh(26);
  452. }
  453. .header_r {
  454. margin-left: rw(264);
  455. width: rw(82);
  456. height: rh(32);
  457. margin-top: rh(18);
  458. }
  459. }
  460. .main_t{
  461. /*background: rgba(9, 55, 81, 0.6);*/
  462. width: rw(1852);
  463. /* height: rh(352);*/
  464. position: absolute;
  465. left: rw(34);
  466. top: rh(86);
  467. z-index: 200;
  468. .main_t_t{
  469. margin: rh(20) 0 0 rw(18);
  470. >i{
  471. font-size: rh(16);
  472. font-family: Microsoft YaHei;
  473. font-weight: bold;
  474. color: #FFFFFF;
  475. line-height: rh(16);
  476. }
  477. >i:nth-of-type(1){
  478. }
  479. >i:nth-of-type(2){
  480. color: #1ED0F8;
  481. }
  482. }
  483. /* .main_t_b{
  484. width: rw(1852);
  485. height: rh(302);
  486. }*/
  487. }
  488. .main_b{
  489. background: rgba(9, 55, 81, 0.6);
  490. padding: 0 rw(32);
  491. width: rw(1852);
  492. height: rh(862);
  493. position: absolute;
  494. left: rw(34);
  495. top: rh(168);
  496. z-index: 200;
  497. }
  498. }
  499. </style>
  500. <style lang="scss">
  501. li{list-style:none}
  502. i,em,b{font-style:normal;font-weight:100;}
  503. body{margin: 0}
  504. </style>