From 1382a7990e9b13f60c6416ada5477673a934dd16 Mon Sep 17 00:00:00 2001 From: liukangdong <898885815@qq.com> Date: 星期四, 29 八月 2024 09:02:57 +0800 Subject: [PATCH] ll --- pda/pages/index/center.vue | 67 +++++++++++++++++++++++++++------ 1 files changed, 55 insertions(+), 12 deletions(-) diff --git a/pda/pages/index/center.vue b/pda/pages/index/center.vue index 7d8e376..531287e 100644 --- a/pda/pages/index/center.vue +++ b/pda/pages/index/center.vue @@ -1,8 +1,8 @@ <template> <view class="main_app"> <view class="main_content"> - <view class="title" - >瀹夋嘲鐗╂祦瑁呰揣骞冲彴<u-icon + <view class="title" @click="showPlatformgroup = true" + >{{ activePlatformGroup.name }}<u-icon name="arrow-down" size="20" class="ml12" @@ -12,24 +12,25 @@ <view class="platform_list"> <view class="item" - :class="{ active: index === 0 }" - v-for="(i, index) in 8" - :key="i" - >1鍙锋湀鍙�</view + :class="{ active: item.id === activePlatformId }" + v-for="(item, index) in activePlatformGroup.platformList" + :key="index" + @click="platformClick(item.id)" + >{{ item.name }}</view > </view> <view class="status_wrap"> <view class="status" - >浣滀笟锛�<text>{{ 0 }}</text></view + >浣滀笟锛�<text>{{ platformTaskInfo.workNum }}</text></view > <view class="status" - >宸插彨锛�<text>{{ 0 }}</text></view + >宸插彨锛�<text>{{ platformTaskInfo.callNum }}</text></view > <view class="status" - >绛夊緟锛�<text>{{ 0 }}</text></view + >绛夊緟锛�<text>{{ platformTaskInfo.waitNum }}</text></view > <view class="status" - >寮傚父锛�<text>{{ 0 }}</text></view + >寮傚父锛�<text>{{ platformTaskInfo.exceptionNum }}</text></view > </view> </view> @@ -208,22 +209,64 @@ </view> </view> </u-popup> + <!-- --> + <u-picker :show="showPlatformgroup" keyName="name" :columns="[platformGroupList]" @cancel="showPlatformgroup = false" @confirm="platConfirm"></u-picker> </view> </template> <script> +import { getPlatformGroupList, getPlatformWorkData } from '@/api' export default { data() { return { showPlatformCall: false, // 鏈堝彴鍙彿 showDetail: false, - showTransform: false // 杞Щ + showTransform: false, // 杞Щ + showPlatformgroup: false, + + platformGroupList: [], + activePlatformGroup: {}, + platformTaskInfo: {}, + activePlatformId: '', } }, onLoad() { - + this.getPlatformGroup() }, methods: { + getPlatformGroup() { + getPlatformGroupList({ + queryData: 1, + queryType: 0 + }).then(res => { + this.platformGroupList = res.data || [] + if(this.platformGroupList.length > 0){ + this.activePlatformGroup = this.platformGroupList[0] + if(this.activePlatformGroup.platformList && this.activePlatformGroup.platformList.length > 0){ + this.activePlatformId = this.activePlatformGroup.platformList[0].id + this.getPlatformTask() + } + } + }) + }, + getPlatformTask() { + getPlatformWorkData({platformId: this.activePlatformId}).then(res => { + this.platformTaskInfo = res.data + }) + }, + platConfirm(e) { + const index = e.indexs[0] + this.activePlatformGroup = this.platformGroupList[index] + if(this.activePlatformGroup.platformList && this.activePlatformGroup.platformList.length > 0){ + this.activePlatformId = this.activePlatformGroup.platformList[0].id + this.getPlatformTask() + } + this.showPlatformgroup =false + }, + platformClick(id) { + this.activePlatformId = id + this.getPlatformTask() + }, handleDetail() { this.showDetail = true }, -- Gitblit v1.9.3