123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427 |
- <!-- 数据看板-首页 -->
- <template>
- <view class="labPage">
- <view class="chart">
- <!-- <view class="chart-t">
- <view class="chart-t-li" @click="dateClick(index)" :class="dateIndex==index?'color-A':'color-B'"
- v-for="(item,index) in dateList">
- <view class="chart-t-li-t">{{item.num}}</view>
- <view class="chart-t-li-b">{{item.letterNUm}}</view>
- </view>
- </view> -->
- <view class="chart-b">
- <qiun-data-charts :canvas2d="true" :background="'rgba(0,0,1,0)'" type="line" :opts="opts" :echartsH5="true" :chartData="chartData" :ontouch="true" />
- </view>
- </view>
- <view class="statistics">
- <view class="statistics-t">
- <view class="statistics-t-l">实验室总数:</view>
- <view class="statistics-t-r">{{labTotal}} 间</view>
- </view>
- <view class="statistics-b">
- <view class="statistics-b-li">
- <view class="statistics-b-li-t color-A">{{useTotal}} 间</view>
- <view class="statistics-b-li-b">使用</view>
- </view>
- <view class="line"></view>
- <view class="statistics-b-li">
- <view class="statistics-b-li-t color-B">{{availableTotal}} 间</view>
- <view class="statistics-b-li-b">空闲</view>
- </view>
- <view class="line"></view>
- <view class="statistics-b-li">
- <view class="statistics-b-li-t color-C">{{exceptionalTotal}} 间</view>
- <view class="statistics-b-li-b">异常</view>
- </view>
- </view>
- </view>
- <view class="table">
- <uni-card>
- <view style="height: 200px">
- <zb-table :columns="column" :stripe="false" :border="false" :data="dataList"></zb-table>
- </view>
- </uni-card>
- </view>
- </view>
- </template>
- <script>
- import {
- config
- } from '@/api/request/config.js'
- import {
- reportAppStatisticsLabStateStatistics,
- reportAppStatisticsLabNumberPeople,
- reportAppStatisticsPersonDeviceSafety,
- } from '@/pages/api/index.js'
- export default {
- name: "labPage",
- components: {
- },
- data() {
- return {
- dateList: [{
- num: '1',
- letterNUm: 'Mon',
- },
- {
- num: '2',
- letterNUm: 'Tue',
- },
- {
- num: '3',
- letterNUm: 'Wed',
- },
- {
- num: '4',
- letterNUm: 'Thur',
- },
- {
- num: '5',
- letterNUm: 'Fri',
- },
- {
- num: '6',
- letterNUm: 'Sat',
- },
- {
- num: '7',
- letterNUm: 'Sun',
- },
- ],
- dateIndex: 0,
- // 查询参数
- queryParams: {
- page: 1,
- pageSize: 10,
- },
- opts: {
- color: ["#0183FA", "#16BF32", "#FF8C00", "#FF0000", ],
- padding: [0, 0, 0, 0],
- enableScroll: true,
- touchMoveLimit:24,
- legend: {
- show: true,
- fontColor: '#fff',
- position: 'top',
- fontSize: 8,
- margin: 10,
- },
- extra: {
- tooltip: {
- legendShape: 'circle',
- },
- },
- xAxis: {
- disableGrid: true,
- scrollShow: true,
- itemCount: 4,
- fontColor: '#fff',
-
- },
- yAxis: {
- gridType: "dash",
- dashLength: 2,
- data: [{
- axisLine: false,
- fontColor: '#fff',
- }]
- },
- },
- chartData: {},
- column: [{
- name: 'deptSortName',
- label: '学院单位',
- fixed: true,
- width: 80,
- align: 'center',
- },
- {
- name: 'labCount',
- label: '实验人数',
- fixed: true,
- width: 80,
- align: 'center',
- },
- {
- name: 'dutyCount',
- label: '值班人数',
- align: 'center',
- },
- {
- name: 'checkCount',
- label: '检查次数',
- align: 'center',
- },
- {
- name: 'overdueDevice',
- label: '超期设备',
- align: 'center',
- },
- ],
- dataList: [],
- total: 0,
- labTotal: 0,
- useTotal: 0,
- availableTotal: 0,
- exceptionalTotal: 0,
- }
- },
- created() {
- this.dateIndex = new Date().getDay() - 1;
- console.log(this.dateIndex)
- },
- beforeMount() {
- },
- mounted() {
- this.reportAppStatisticsLabNumberPeople();
- this.reportAppStatisticsLabStateStatistics();
- this.getList();
- },
- methods: {
- dateClick(index) {
- //this.dateIndex = index;
- },
- //实验室使用、空闲、异常数量
- async reportAppStatisticsLabNumberPeople() {
- let self = this;
- const {
- data
- } = await reportAppStatisticsLabNumberPeople();
- if (data.code == 200) {
- let date = [];
- let list = []; //实验人数
- let list2 = []; //值日人数
- let list3 = []; //检查次数
- let list4 = []; //超期设备数
- date = data.data.dateList
- // 实验人数
- data.data.experimentList.forEach(function(item) {
- list.push(item.num)
- })
- // 值班
- data.data.dutyList.forEach(function(item) {
- list2.push(item.num)
- })
- // 检查
- data.data.checkList.forEach(function(item) {
- list3.push(item.num)
- })
- // 超期设备
- // data.data.deviceList.forEach(function(item) {
- // list4.push(item.num)
- // })
- let res = {
- categories: date,
- series: [{
- name: "实验人数",
- data: list
- },
- {
- name: "值日人数",
- data: list2
- },
- {
- name: "检查次数",
- data: list3
- },
- // {
- // name: "超期设备数",
- // data: list4
- // }
- ]
- };
- this.chartData = JSON.parse(JSON.stringify(res));
- }
- },
- //实验室使用、空闲、异常数量
- async reportAppStatisticsLabStateStatistics() {
- let self = this;
- const {
- data
- } = await reportAppStatisticsLabStateStatistics();
- if (data.code == 200) {
- this.$set(this, 'labTotal', data.data.labTotal)
- this.$set(this, 'useTotal', data.data.useTotal)
- this.$set(this, 'availableTotal', data.data.availableTotal)
- this.$set(this, 'exceptionalTotal', data.data.exceptionalTotal)
- }
- },
- async getList() {
- let self = this;
- const {
- data
- } = await reportAppStatisticsPersonDeviceSafety();
- if (data.code == 200) {
- this.dataList = data.data;
- }
- },
- },
- }
- </script>
- <style lang="stylus" scoped>
- .labPage {
- height: 100%;
- width: 100%;
- background: #363744;
- padding: 20rpx 30rpx 36rpx;
- box-sizing: border-box;
- .chart {
- width: 690rpx;
- height: 640rpx;
- background: #3E414F;
- border-radius: 20rpx 20rpx 20rpx 20rpx;
- padding: 34rpx 30rpx 26rpx;
- box-sizing: border-box;
- .chart-t {
- display: flex;
- justify-content: space-between;
- .chart-t-li {
- width: 76rpx;
- height: 100rpx;
- .chart-t-li-t {
- font-weight: 400;
- font-size: 30rpx;
- line-height: 42rpx;
- text-align: center;
- margin-top: 8rpx;
- }
- .chart-t-li-b {
- font-weight: 400;
- font-size: 28rpx;
- line-height: 39rpx;
- text-align: center;
- margin-top: 4rpx;
- }
- }
- .color-A {
- background: #0183FA;
- border-radius: 10rpx 10rpx 10rpx 10rpx;
- .chart-t-li-t {
- color: #FFFFFF;
- }
- .chart-t-li-b {
- color: #FFFFFF;
- }
- }
- .color-B {
- background: none;
- .chart-t-li-t {
- color: #FFFFFF;
- }
- .chart-t-li-b {
- color: #FFFFFF;
- }
- }
- }
- .chart-b {
- width: 632rpx;
- height: 444rpx;
- /* margin-top: 34rpx; */
- }
- }
- .statistics {
- width: 690rpx;
- height: 241rpx;
- background: #3E414F;
- border-radius: 20rpx 20rpx 20rpx 20rpx;
- margin-top: 20rpx;
- .statistics-t {
- height: 100rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- border-bottom: 1rpx solid #52545F;
- padding: 0 42rpx 0 38rpx;
- box-sizing: border-box;
- .statistics-t-l {
- font-weight: 400;
- font-size: 32rpx;
- color: #FFFFFF;
- line-height: 45rpx;
- }
- .statistics-t-r {
- font-weight: 400;
- font-size: 36rpx;
- color: #FFFFFF;
- line-height: 50rpx;
- }
- }
- .statistics-b {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .statistics-b-li {
- flex: 1;
- text-align: center;
- .statistics-b-li-t {
- font-weight: 400;
- font-size: 36rpx;
- line-height: 50rpx;
- margin-top: 28rpx;
- }
- .statistics-b-li-b {
- font-weight: 400;
- font-size: 28rpx;
- color: #FFFFFF;
- line-height: 39rpx;
- margin-top: 9rpx;
- }
- }
- .line {
- width: 2rpx;
- height: 30rpx;
- background: #D8D8D8;
- }
- .color-A {
- color: #FF8C00;
- }
- .color-B {
- color: #26C736;
- }
- .color-C {
- color: #FF0000;
- }
- }
- }
- .table {
- width: 690rpx;
- margin-top: 20rpx;
- border-radius: 20rpx 20rpx 0 0;
- overflow: hidden;
- }
- }
- </style>
|