123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336 |
- <!-- 数据看板-首页 -->
- <template>
- <view class="dataBoard">
- <nav-bar :title="title" style="position: absolute; z-index: 1000;"></nav-bar>
- <view class="header">
- <img class="header-bg" src="@/pages/images/dataBoard/dataBoard-icon1.png">
- <view class="header-t">
- <img class="header-t-l" :src="rectangleLogo">
- <img class="header-t-r" @click="outButton" src="@/pages/images/dataBoard/dataBoard-icon5.png">
- <!-- <view class="header-t-r" @click="outButton">管理面板</view> -->
- </view>
- <view class="header-b">
- <view class="header-b-li">
- <view class="header-b-li-t color-A">786</view>
- <view class="header-b-li-b">今日访问人数</view>
- </view>
- <view class="line"></view>
- <view class="header-b-li">
- <view class="header-b-li-t color-B">165</view>
- <view class="header-b-li-b">今日实验人数</view>
- </view>
- <view class="line"></view>
- <view class="header-b-li">
- <view class="header-b-li-t color-C">39</view>
- <view class="header-b-li-b">今日值日人数</view>
- </view>
- <view class="line"></view>
- <view class="header-b-li">
- <view class="header-b-li-t color-D">562</view>
- <view class="header-b-li-b">今日检查次数</view>
- </view>
- </view>
- </view>
- <scroll-view scroll-x @scrolltolower="scrollGet">
- <view class="tabTitle_tow">
- <view class="tabTitle_tow_li" @tap="tabClickTow(item,index)" :key="index"
- v-for="(item,index) in tabTextTow">
- <view :class="{on:curTabTow==index}" class="tabTitle_tow_text">{{item}}</view>
- <view :class="{on:curTabTow==index}" class="tabTitle_tow_across"></view>
- </view>
- </view>
- </scroll-view>
- <lab-page v-if="pageType==1" class="pageFlex"></lab-page>
- <hazard-sources v-if="pageType==2" class="pageFlex"></hazard-sources>
- <hazardous-chemicals v-if="pageType==3" class="pageFlex"></hazardous-chemicals>
- <security-hidden v-if="pageType==4" class="pageFlex"></security-hidden>
- <warning-dispose v-if="pageType==5" class="pageFlex"></warning-dispose>
- <equipment-control v-if="pageType==6" class="pageFlex"></equipment-control>
- <da-yi-reservation v-if="pageType==7" class="pageFlex"></da-yi-reservation>
- <cage-position v-if="pageType==8" class="pageFlex"></cage-position>
- <resource-reservation v-if="pageType==9" class="pageFlex"></resource-reservation>
- </view>
- </template>
- <script>
- import {
- navBar
- } from '@/pages/component/navbar.vue'
- import {labPage} from '@/pages/views/dataBoard/labPage.vue'
- import {hazardSources} from '@/pages/views/dataBoard/hazardSources.vue'
- import {hazardousChemicals} from '@/pages/views/dataBoard/hazardousChemicals.vue'
- import {securityHidden} from '@/pages/views/dataBoard/securityHidden.vue'
- import {warningDispose} from '@/pages/views/dataBoard/warningDispose.vue'
- import {equipmentControl} from '@/pages/views/dataBoard/equipmentControl.vue'
- import {daYiReservation} from '@/pages/views/dataBoard/daYiReservation.vue'
- import {cagePosition} from '@/pages/views/dataBoard/cagePosition.vue'
- import {resourceReservation} from '@/pages/views/dataBoard/resourceReservation.vue'
- import {
- config
- } from '@/api/request/config.js'
- import {
- } from '@/pages_basics/api/index.js'
- export default {
- name: "dataBoard",
- components: {
- navBar,
- labPage,
- hazardSources,
- hazardousChemicals,
- securityHidden,
- warningDispose,
- equipmentControl,
- daYiReservation,
- cagePosition,
- resourceReservation,
- },
- data() {
- return {
- pageType:1,
- rectangleLogo: uni.getStorageSync('rectangleLogo'),
- navHeight: uni.getStorageSync('navHeight'),
- title: '实验室安全智慧化管控系统',
- baseUrl: config.base_url,
- // 查询参数
- queryParams: {
- page: 1,
- pageSize: 10,
- },
- dataList: [],
- total: 0,
- tabTextTow: ['实验室','危险源','危化品','安全隐患','预警处置','设备管控','大仪预约','笼位预约','资源预约'],
- curTabTow: 0,
- }
- },
- created() {
- },
- beforeMount() {
- },
- mounted() {},
- methods: {
- //返回按钮
- outButton(){
- this.$parent.goHome();
- },
- //滚动加载事件
- scrollGet() {
- if (this.total / this.queryParams.pageSize <= this.queryParams.page) {
- this.$set(this, 'getDataType', true);
- } else {
- this.queryParams.page += 1;
- this.$nextTick(() => {
- this.getList();
- })
- }
- },
- //顶部tab点击
- tabClickTow(item, index) {
- this.curTabTow = index;
- this.pageType=index+1
- },
- async getList() {
- let self = this;
- let obj = JSON.parse(JSON.stringify(this.queryParams));
- const {
- data
- } = await laboratoryAppletPassOutList(obj);
- if (data.code == 200) {
- let list = [];
- if (this.queryParams.page != 1) {
- list = JSON.parse(JSON.stringify(this.dataList));
- }
- data.data.records.forEach((item) => {
- let num = 0;
- list.forEach((minItem) => {
- if (item.showInTime == minItem.showInTime) {
- num++
- minItem.list.push(item)
- }
- })
- if (num == 0) {
- list.push({
- showInTime: item.showInTime,
- list: [item]
- })
- }
- })
- this.$set(this, 'dataList', list);
- this.$set(this, 'total', data.data.total);
- if (data.data.total / this.queryParams.pageSize <= this.queryParams.page) {
- this.$set(this, 'getDataType', true);
- }
- }
- },
- },
- }
- </script>
- <style lang="stylus" scoped>
- .dataBoard {
- height: 100%;
- width: 100%;
- background: #363744;
- .pageFlex{
- display: flex;
- }
- .header {
- width: 750rpx;
- height: 476rpx;
- position: relative;
- .header-bg {
- width: 750rpx;
- height: 476rpx;
- position: absolute;
- left: 0;
- top: 0;
- z-index: 100;
- }
- .header-t {
- width: 100%;
- position: absolute;
- left: 0;
- top: 164rpx;
- z-index: 200;
- .header-t-l {
- width: 400rpx;
- height: 88rpx;
- position: absolute;
- left: 0rpx;
- top: 0;
- }
- .header-t-r {
- width: 70rpx;
- height: 58rpx;
- position: fixed;
- right: 0;
- top: 150rpx;
- /* position: absolute;
- right: 0;
- top: 20rpx;
- font-weight: 400;
- font-size: 28rpx;
- color: #FFFFFF;
- line-height: 50rpx;
- text-align: left;
- width: 160rpx;
- height: 50rpx;
- background: rgba(54, 55, 68, 0.6);
- padding-left: 24rpx;
- border-radius: 24rpx 0 0 24rpx; */
- }
- }
- .header-b {
- position: absolute;
- left: 30rpx;
- top: 302rpx;
- z-index: 200;
- width: 689rpx;
- height: 150rpx;
- background: rgba(62, 65, 79, 0.4);
- border-radius: 20rpx 20rpx 20rpx 20rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .header-b-li {
- flex: 1;
- text-align: center;
- .header-b-li-t {
- font-weight: 400;
- font-size: 36rpx;
- line-height: 50rpx;
- margin-top: 32rpx;
- margin-bottom: 9rpx;
- }
- .header-b-li-b {
- font-weight: 400;
- font-size: 24rpx;
- color: #FFFFFF;
- line-height: 34rpx;
- }
- }
- .line {
- width: 2rpx;
- height: 30rpx;
- background: #D8D8D8;
- }
- .color-A {
- color: #0183FA;
- }
- .color-B {
- color: #2EA805;
- }
- .color-C {
- color: #00FFE5;
- }
- .color-D {
- color: #FF8C00;
- }
- }
- }
- .tabTitle_tow {
- height: 80rpx;
- white-space: nowrap;
- display: inline-flex;
- background: #3E414F;
- .tabTitle_tow_li {
- position: relative;
- width: 152rpx;
- height: 80rpx;
- text-align center;
- padding-top: 18rpx;
- box-sizing: border-box;
- .tabTitle_tow_text {
- display: inline-block;
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- line-height: 46rpx;
- position: relative;
- &.on {
- color: #0183FA;
- }
- }
- .tabTitle_tow_across {
- width: 50rpx;
- height: 4rpx;
- background: #0183FA;
- border-radius: 2rpx;
- margin-left: 33%;
- margin-top: 16rpx;
- display none;
- &.on {
- display block;
- }
- }
- }
- }
- }
- </style>
|