123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434 |
- <!-- 数据看板-设备管控-超期服役排行 -->
- <template>
- <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
- <view class="equipmentControl">
- <!-- 超期服役排行 -->
- <view class="table" v-if="pageType==1">
- <view class="table-border">
- <view class="table-th">
- <view class="table-th-li">
- <view>排行</view>
- <view>学院单位</view>
- <view>设备总数(台)</view>
- <view>超期服役数(台)</view>
- </view>
- </view>
- <view class="table-tb">
- <view class="table-tb-li" v-for="(item,index) in dataList" :key="index">
- <view>
- <text
- :class="index==0?'sortOne':(index==1?'sortTow':(index==2?'sortThree':'sortFive'))">{{index+1}}</text>
- </view>
- <view>{{item.deptName}}</view>
- <view>{{item.deviceNum}}</view>
- <view>{{item.extendedService}}</view>
- </view>
- </view>
- </view>
- </view>
- <!-- 设备使用寿命 -->
- <view class="table-tow" v-if="pageType==2">
- <view class="table-border">
- <view class="table-th">
- <view class="table-th-li">
- <view>学院单位</view>
- <view>5年内(台)</view>
- <view>10年内(台)</view>
- <view>12年内(台)</view>
- <view>20年内(台)</view>
- </view>
- </view>
- <view class="table-tb">
- <view class="table-tb-li" v-for="(item,index) in dataList" :key="index">
- <view>{{item.deptName}}</view>
- <view>{{item.fiveYears}}</view>
- <view>{{item.tenYears}}</view>
- <view>{{item.twelveYears}}</view>
- <view>{{item.twentyYears}}</view>
- </view>
- </view>
- </view>
- </view>
- <view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
- </view>
-
- </scroll-view>
- </template>
- <script>
- import {
- config
- } from '@/api/request/config.js'
- import {
- reportAppletReportApiEquipOverdueGetLifePageList,
- reportAppletReportApiEquipLifeGetReportBsEquipLifeList
- } from '@/pages/api/index.js'
- export default {
- name: "equipmentControl",
- components: {
- },
- data() {
- return {
- pageType: 1,
- // 查询参数
- queryParams: {
- page: 1,
- pageSize: 10,
- },
- dataList: [],
- total: 0,
- getDataType:false,
- }
- },
- onLoad(option) {
- if (option.pageType) {
- this.pageType = option.pageType;
- if (this.pageType == 1) {
- uni.setNavigationBarTitle({
- title: '超期服役排行'
- })
- } else if (this.pageType == 2) {
- uni.setNavigationBarTitle({
- title: '设备使用寿命统计'
- })
- }
- }
- },
- created() {
- },
- beforeMount() {
- },
- mounted() {
- if (this.pageType == 1) {
- this.getList();
- } else if (this.pageType == 2) {
- this.getListTow();
- }
- },
- methods: {
- //滚动事件
- scrollGet() {
- let self = this;
- if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
- this.$set(this, 'getDataType', true);
- } else {
- this.queryParams.page += 1;
- this.$nextTick(() => {
- if (this.pageType == 1) {
- this.getList();
- } else if (this.pageType == 2) {
- this.getListTow();
- }
- })
- }
- },
- async getList() {
- let self = this;
- const {
- data
- } = await reportAppletReportApiEquipOverdueGetLifePageList(this.queryParams);
- if (data.code == 200) {
- if (self.queryParams.page == 1) {
- this.dataList = data.data.records;
- this.total = data.data.total;
- if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
- this.$set(this, 'getDataType', true);
- }
- } else {
- this.dataList = [...this.dataList, ...data.data.records]
- this.total = data.data.total;
- if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
- this.$set(this, 'getDataType', true);
- }
- }
- }
- },
- async getListTow() {
- let self = this;
- const {
- data
- } = await reportAppletReportApiEquipLifeGetReportBsEquipLifeList(this.queryParams);
- if (data.code == 200) {
- if (self.queryParams.page == 1) {
- this.dataList = data.data.records;
- this.total = data.data.total;
- if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
- this.$set(this, 'getDataType', true);
- }
- } else {
- this.dataList = [...this.dataList, ...data.data.records]
- this.total = data.data.total;
- if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
- this.$set(this, 'getDataType', true);
- }
- }
- }
- },
-
- dateClick(index) {
- this.dateIndex = index;
- },
- },
- }
- </script>
- <style lang="stylus" scoped>
- .info-max-box{
- height: 100%;
- width: 100%;
- }
- .equipmentControl {
- height: 100%;
- width: 100%;
- background: #363744;
- box-sizing: border-box;
- .table {
- width: 750rpx;
- .table-border {
- overflow: auto;
- .table-th {
- width: 750rpx;
- height: 80rpx;
- background: rgba(162, 162, 162, 0.2);
- padding: 0 30rpx;
- box-sizing: border-box;
- .table-th-li {
- height: 80rpx;
- display: flex;
- justify-content: flex-start;
- >view {
- font-weight: 400;
- font-size: 30rpx;
- color: #FFFFFF;
- line-height: 80rpx;
- text-align: center;
- margin-right: 18rpx;
- width: 120rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- >view:nth-of-type(1) {
- width: 90rpx;
- text-align: left;
- }
- >view:nth-of-type(2) {
- width: 168rpx;
- }
- >view:nth-of-type(3) {
- width: 190rpx;
- }
- >view:nth-of-type(4) {
- width: 300rpx;
- }
- }
- }
- .table-tb {
- width: 750rpx;
- border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
- background: #3E414F;
- padding: 0 30rpx;
- box-sizing: border-box;
- .table-tb-li {
- height: 80rpx;
- border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
- display: flex;
- justify-content: flex-start;
- >view {
- font-weight: 400;
- font-size: 28rpx;
- color: #FFFFFF;
- line-height: 80rpx;
- text-align: center;
- margin-right: 38rpx;
- width: 120rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- >view:nth-of-type(1) {
- width: 90rpx;
- text-align: left;
- }
- >view:nth-of-type(2) {
- width: 168rpx;
- }
- >view:nth-of-type(3) {
- width: 190rpx;
- }
- >view:nth-of-type(4) {
- width: 300rpx;
- }
- }
- }
- }
- }
- .sortOne {
- display: inline-block;
- width: 40rpx;
- height: 40rpx;
- padding: 4rpx;
- box-sizing: border-box;
- background: rgba(255, 0, 0, 0.2);
- font-weight: 400;
- font-size: 28rpx;
- color: #FF0000;
- line-height: 40rpx;
- text-align: center;
- border-radius: 20rpx;
- }
- .sortTow {
- display: inline-block;
- width: 40rpx;
- height: 40rpx;
- padding: 4rpx;
- box-sizing: border-box;
- background: rgba(255, 153, 0, 0.2);
- font-weight: 400;
- font-size: 28rpx;
- color: #FF9900;
- line-height: 40rpx;
- text-align: center;
- border-radius: 20rpx;
- }
- .sortThree {
- display: inline-block;
- width: 40rpx;
- height: 40rpx;
- padding: 4rpx;
- box-sizing: border-box;
- background: rgba(255, 242, 0, 0.2);
- font-weight: 400;
- font-size: 28rpx;
- color: #FFF200;
- line-height: 40rpx;
- text-align: center;
- border-radius: 20rpx;
- }
- .sortFive {
- display: inline-block;
- width: 40rpx;
- height: 40rpx;
- padding: 4rpx;
- box-sizing: border-box;
- background: rgba(1, 131, 250, 0.2);
- font-weight: 400;
- font-size: 28rpx;
- color: #0183FA;
- line-height: 40rpx;
- text-align: center;
- border-radius: 20rpx;
- }
- .table-tow {
- width: 750rpx;
- .table-border {
- overflow: auto;
- .table-th {
- width: 860rpx;
- height: 80rpx;
- background: rgba(162, 162, 162, 0.2);
- padding: 0 30rpx;
- box-sizing: border-box;
- .table-th-li {
- height: 80rpx;
- display: flex;
- justify-content: flex-start;
- >view {
- font-weight: 400;
- font-size: 30rpx;
- color: #FFFFFF;
- line-height: 80rpx;
- text-align: center;
- margin-right: 18rpx;
- width: 140rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- >view:nth-of-type(1) {
- width: 168rpx;
- text-align: left;
- }
- }
- }
- .table-tb {
- width: 860rpx;
- border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
- background: #3E414F;
- padding: 0 30rpx;
- box-sizing: border-box;
- .table-tb-li {
- height: 80rpx;
- border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
- display: flex;
- justify-content: flex-start;
- >view {
- font-weight: 400;
- font-size: 28rpx;
- color: #FFFFFF;
- line-height: 80rpx;
- text-align: center;
- margin-right: 38rpx;
- width: 140rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- >view:nth-of-type(1) {
- width: 168rpx;
- text-align: left;
- }
- }
- }
- }
- }
- }
- .get-data-null-p {
- text-align: center;
- height: 100rpx;
- line-height: 100rpx;
- color: #999;
- padding-bottom:200rpx;
- }
- </style>
|