| | |
| | | <view class="color6"> 同比上月 </view> |
| | | <view class="txt-aligin-r color4 font-bold mt-4"> |
| | | {{ statisticsData.satisfaction.compare > 0 ? "+" : "" |
| | | }}{{ statisticsData.satisfaction.compare }}% |
| | | }}{{ (statisticsData.satisfaction.compare * 1).toFixed(2) }}% |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | <view class="fs-23"> |
| | | <view class=""> 同比上月 </view> |
| | | <view class="font-bold color8 txt-aligin-r mt-4"> |
| | | {{ statisticsData.demands.compare > 0 ? "+" : "" |
| | | }}{{ statisticsData.demands.compare }} |
| | | {{ (statisticsData.demands.compare * 1).toFixed(2) }} |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | <view class="fs-23"> |
| | | <view class=""> 同比上月 </view> |
| | | <view class="font-bold color4 txt-aligin-r mt-4"> |
| | | {{ statisticsData.processTime.compare > 0 ? "+" : "" |
| | | }}{{ statisticsData.processTime.compare }} |
| | | {{ (statisticsData.processTime.compare * 1).toFixed(2) }} |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | <view class="fs-23 mt-44"> |
| | | <view class="color6"> 同比上月 </view> |
| | | <view class="txt-aligin-r color4 font-bold mt-4"> |
| | | {{ statisticsData.overtime.compare > 0 ? "+" : "" |
| | | }}{{ statisticsData.overtime.compare }} |
| | | {{ (statisticsData.overtime.compare * 1).toFixed(2) }} |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | <view class="txt-center pt-38 pb-40 fs-35 lh-48 font-bold" |
| | | >请选择服务社区</view |
| | | > |
| | | <!-- <view |
| | | <view |
| | | class="flex a-center j-between txt-center py-10 fs-27 font-bold bgColor1" |
| | | > |
| | | <view v-if="hasTier(2)" class="flex1">区县</view> |
| | | <view v-if="hasTier(3)" class="flex1">街道</view> |
| | | <view v-if="hasTier(4)" class="flex1">社区</view> |
| | | </view> --> |
| | | <view v-if="showCountyColumn" class="flex1">区县</view> |
| | | <view v-if="showStreetColumn" class="flex1">街道</view> |
| | | <view v-if="showCommunityColumn" class="flex1">社区</view> |
| | | </view> |
| | | <view class="mb-20"> |
| | | <picker-view |
| | | :value="value" |
| | |
| | | class="picker-view" |
| | | immediate-change |
| | | > |
| | | <picker-view-column v-if="hasTier(2)"> |
| | | <picker-view-column v-if="showCountyColumn"> |
| | | <view |
| | | class="item" |
| | | v-for="(item, index) in regionTree" |
| | |
| | | {{ item.name }} |
| | | </view> |
| | | </picker-view-column> |
| | | <picker-view-column v-if="hasTier(3)"> |
| | | <picker-view-column v-if="showStreetColumn"> |
| | | <view |
| | | class="item" |
| | | v-for="(item, index) in getStreets()" |
| | |
| | | {{ item.name }} |
| | | </view> |
| | | </picker-view-column> |
| | | <picker-view-column v-if="hasTier(4)"> |
| | | <picker-view-column v-if="showCommunityColumn"> |
| | | <view |
| | | class="item" |
| | | v-for="(item, index) in getCommunities()" |
| | |
| | | satisfactionRate: 0, |
| | | generalSatisfactionRate: 0, |
| | | dissatisfactionRate: 0, |
| | | showCountyColumn: false, |
| | | }; |
| | | }, |
| | | computed: { |
| | | showStreetColumn() { |
| | | // 判断当前选中的区县/第一级是否有 children 且有街道 |
| | | const lastItem = this.regionTree[this.regionTree.length - 1]; |
| | | if (!lastItem) return false; |
| | | // 区县为第一级 |
| | | if (lastItem.tier === 2) { |
| | | const county = this.regionTree[this.value[0]]; |
| | | return county && Array.isArray(county.children) && county.children.some(c => c && c.tier === 3); |
| | | } |
| | | // 街道为第一级 |
| | | if (lastItem.tier === 3) { |
| | | return this.regionTree.length > 1; |
| | | } |
| | | return false; |
| | | }, |
| | | showCommunityColumn() { |
| | | const communities = this.getCommunities(); |
| | | return communities.length > 0; |
| | | }, |
| | | }, |
| | | onLoad() { |
| | | this.userInfo = uni.getStorageSync("userInfo"); |
| | |
| | | this.address = "全部"; |
| | | this.currentAreaId = ''; |
| | | this.currentTier = -1; |
| | | // showCountyColumn 仍然根据最后一项 tier 判断 |
| | | const lastItem = this.regionTree[this.regionTree.length - 1]; |
| | | this.showCountyColumn = lastItem && lastItem.tier === 2; |
| | | this.getStatisticsData("", -1); |
| | | this.getChartData(1); |
| | | this.getTypeRankData(); |
| | |
| | | this.value = newValue; |
| | | }, |
| | | openSelectPopup() { |
| | | console.log(this.regionTree); |
| | | |
| | | this.value = this.confirmValue; |
| | | }, |
| | | handleTabClick(index) { |
| | |
| | | tooltip: { |
| | | trigger: "item", |
| | | confine: true, |
| | | // formatter: '{b}: {c}%', |
| | | formatter: '{b}: {c}%', |
| | | backgroundColor: "rgba(255, 255, 255, 0.9)", |
| | | borderColor: "#FFE0E0", |
| | | borderWidth: 1, |
| | |
| | | } |
| | | }, |
| | | hasTier(tier) { |
| | | // tier=2: 区县始终有 |
| | | if (tier === 2) return true; |
| | | // tier=3: 当前区县children里有tier=3 |
| | | if (tier === 3) { |
| | | const county = this.regionTree[this.value[0]]; |
| | | return ( |
| | | county && |
| | | Array.isArray(county.children) && |
| | | county.children.some((c) => c && c.tier === 3) |
| | | ); |
| | | // 检查最后一项的数据类型 |
| | | const lastItem = this.regionTree[this.regionTree.length - 1]; |
| | | if (!lastItem) return false; |
| | | |
| | | // 如果最后一项是区县 |
| | | if (lastItem.tier === 2) { |
| | | if (tier === 2) return true; |
| | | if (tier === 3) { |
| | | const county = this.regionTree[this.value[0]]; |
| | | return ( |
| | | county && |
| | | Array.isArray(county.children) && |
| | | county.children.some((c) => c && c.tier === 3) |
| | | ); |
| | | } |
| | | if (tier === 4) { |
| | | const county = this.regionTree[this.value[0]]; |
| | | if (!county || !Array.isArray(county.children)) return false; |
| | | // 区县下直接有社区 |
| | | if (county.children.some((c) => c && c.tier === 4)) return true; |
| | | // 区县下有街道,街道下有社区 |
| | | const street = county.children[this.value[1]]; |
| | | return ( |
| | | street && |
| | | Array.isArray(street.children) && |
| | | street.children.some((c) => c && c.tier === 4) |
| | | ); |
| | | } |
| | | } |
| | | // tier=4: 当前区县children里有tier=4,或街道children里有tier=4 |
| | | if (tier === 4) { |
| | | const county = this.regionTree[this.value[0]]; |
| | | if (!county || !Array.isArray(county.children)) return false; |
| | | // 区县下直接有社区 |
| | | if (county.children.some((c) => c && c.tier === 4)) return true; |
| | | // 区县下有街道,街道下有社区 |
| | | const street = county.children[this.value[1]]; |
| | | return ( |
| | | street && |
| | | Array.isArray(street.children) && |
| | | street.children.some((c) => c && c.tier === 4) |
| | | ); |
| | | // 如果最后一项是街道 |
| | | else if (lastItem.tier === 3) { |
| | | if (tier === 3) return true; |
| | | if (tier === 4) { |
| | | const street = this.regionTree[this.value[0]]; |
| | | return ( |
| | | street && |
| | | Array.isArray(street.children) && |
| | | street.children.some((c) => c && c.tier === 4) |
| | | ); |
| | | } |
| | | } |
| | | // 如果最后一项是社区 |
| | | else if (lastItem.tier === 4) { |
| | | return tier === 4; |
| | | } |
| | | |
| | | return false; |
| | | }, |
| | | getStreets() { |
| | | const county = this.regionTree[this.value[0]]; |
| | | if (!county || !Array.isArray(county.children)) return []; |
| | | // 只返回tier=3的 |
| | | const streets = county.children.filter((c) => c && c.tier === 3); |
| | | return streets.length |
| | | ? [{ name: "全部", id: "all", tier: 3, children: [] }, ...streets] |
| | | : []; |
| | | |
| | | // 如果第一层是街道 |
| | | if (this.regionTree[this.regionTree.length - 1]?.tier === 3) { |
| | | return this.regionTree.slice(1).map(item => ({ |
| | | name: item.name, |
| | | id: item.id, |
| | | tier: item.tier, |
| | | children: item.children || [] |
| | | })); |
| | | } |
| | | |
| | | // 如果当前选中的是区县 |
| | | if (county.tier === 2) { |
| | | const streets = county.children.filter((c) => c && c.tier === 3); |
| | | return streets.length |
| | | ? [{ name: "全部", id: "all", tier: 3, children: [] }, ...streets] |
| | | : []; |
| | | } |
| | | |
| | | return []; |
| | | }, |
| | | getCommunities() { |
| | | const county = this.regionTree[this.value[0]]; |
| | | if (!county || !Array.isArray(county.children)) return []; |
| | | // 区县下直接有社区 |
| | | const communities = county.children.filter((c) => c && c.tier === 4); |
| | | if (communities.length) |
| | | return [{ name: "全部", id: "all", tier: 4 }, ...communities]; |
| | | // 区县下有街道,街道下有社区 |
| | | const street = county.children[this.value[1]]; |
| | | if (street && Array.isArray(street.children)) { |
| | | const comms = street.children.filter((c) => c && c.tier === 4); |
| | | if (comms.length) |
| | | return [{ name: "全部", id: "all", tier: 4 }, ...comms]; |
| | | |
| | | // 如果第一层是街道 |
| | | if (this.regionTree[this.regionTree.length - 1]?.tier === 3) { |
| | | const street = this.regionTree[this.value[0]]; |
| | | if (!street || street.id === 'all') return []; |
| | | const communities = street.children?.filter(c => c && c.tier === 4) || []; |
| | | return communities.length ? [{ name: "全部", id: "all", tier: 4 }, ...communities] : []; |
| | | } |
| | | |
| | | // 如果当前选中的是区县 |
| | | if (county.tier === 2) { |
| | | // 区县下直接有社区 |
| | | const communities = county.children.filter((c) => c && c.tier === 4); |
| | | if (communities.length) |
| | | return [{ name: "全部", id: "all", tier: 4 }, ...communities]; |
| | | |
| | | // 区县下有街道,街道下有社区 |
| | | const street = county.children[this.value[1] - 1]; |
| | | if (street && Array.isArray(street.children)) { |
| | | const comms = street.children.filter((c) => c && c.tier === 4); |
| | | if (comms.length) |
| | | return [{ name: "全部", id: "all", tier: 4 }, ...comms]; |
| | | } |
| | | } |
| | | |
| | | return []; |
| | | }, |
| | | async getChartData(timeType = 1) { |
| | |
| | | .type-rank-list-scroll { |
| | | max-height: 500rpx; |
| | | overflow-y: auto; |
| | | |
| | | /deep/ .u-line-progress__line { |
| | | min-width: 40rpx; |
| | | } |
| | | } |
| | | </style> |