Files
dvcp_v2_webapp/project/fengdu/AppBIBoard/AppBIBoard.vue

607 lines
18 KiB
Vue
Raw Normal View History

2023-10-11 18:21:40 +08:00
<template>
<section class="AppBIBoard" :class="{fullscreen}">
2023-10-18 10:34:41 +08:00
<ai-fit-view @scale="v=>scale=v">
2023-10-23 10:48:30 +08:00
<ai-dv-wrapper ref="fddv" title="丰收号-家庭互助" :instance="instance" :mask="false" @pick="getData()">
2023-10-11 18:21:40 +08:00
<template v-slot:head="head">
2023-10-19 17:19:15 +08:00
<fengdu-head v-model="areaId" v-bind="head" @fullscreen="handleFullScreen" @setting="handleSetting"/>
2023-10-11 18:21:40 +08:00
</template>
2023-10-13 18:10:45 +08:00
<div class="left">
<fd-card label="社群动态概况">
<div class="grid c-2 pad-t14 pad-b20">
<div class="staPanel" v-for="(v,k) in sta" :key="k">
<div v-text="k"/>
<b v-text="v"/>
</div>
<div class="chart">
<div class="title">群活跃率7</div>
2023-10-18 10:34:41 +08:00
<ai-echart :ops="chart" :data="calcProgress()">
<div class="legend">
<ai-highlight v-for="item in chartData" :key="item.name" :content="`@v${item.value}`"
:value="item.name" color="#9BB7D4" class="flex center mar-b8"/>
</div>
</ai-echart>
2023-10-13 18:10:45 +08:00
</div>
<div class="chart">
<div class="title">人员活跃7</div>
2023-10-18 10:34:41 +08:00
<ai-echart :ops="chart" :data="calcProgress()">
<div class="legend">
<ai-highlight v-for="item in chartData" :key="item.name" :content="`@v${item.value}`"
:value="item.name" color="#9BB7D4" class="flex center mar-b8"/>
</div>
</ai-echart>
2023-10-13 18:10:45 +08:00
</div>
</div>
</fd-card>
<fd-card class="mar-t14" label="志愿者">
2023-10-18 14:59:52 +08:00
<div class="jumpBtn" slot="right">前往志愿者平台
<div class="el-icon-position"/>
</div>
<div class="staPanel simple flex mar-t10">
<div class="fill" v-for="(v,k) in volunteers" :key="k">
<div v-text="k"/>
<b v-text="v"/>
</div>
</div>
<div class="flex mar-v12">
<b class="fill title">志愿者名单</b>
<ai-select class="areaPicker" placeholder="团队选择"/>
</div>
<dv-scroll-board ref="volunteerTable" :config="volunteerConfig"/>
<div class="dots flex center">
<div class="dot" v-for="i in tablePages" :key="i" :class="{current:current==i}"/>
</div>
2023-10-13 18:10:45 +08:00
</fd-card>
</div>
2023-10-19 17:19:15 +08:00
<div class="center fill relative">
2023-10-23 10:48:30 +08:00
<fd-map class="w100 h100" v-model="map"/>
2023-10-19 17:19:15 +08:00
<fd-card class="centerBottom pad-b8" label="实时动态">
2023-10-23 10:48:30 +08:00
<dv-scroll-board class="mar-t14" :config="realtimeEvents" style="height: 228px"
@click="handleRealtimeEventDialog"/>
2023-10-13 18:10:45 +08:00
</fd-card>
</div>
<div class="right">
<fd-card label="功德银行">
2023-10-19 17:19:15 +08:00
<template #right>
<div class="shortcut" v-for="(v,k) in shortcuts" :key="k" @click="shortcut=k"
:class="{active:shortcut==k}" v-text="v"/>
</template>
<div class="boxSta flex">
<div class="flex text">
<div>获取总积分</div>
2023-10-23 10:48:30 +08:00
<p v-text="GongdeBank.total"/>
2023-10-19 17:19:15 +08:00
</div>
</div>
<div class="staPanel simple right flex mar-t14">
2023-10-23 10:48:30 +08:00
<div class="fill" v-for="(v,k) in GongdeBank.users" :key="k">
2023-10-19 17:19:15 +08:00
<div v-text="k"/>
<b v-text="v"/>
</div>
</div>
<div class="boxSta flex">
<div class="flex text">
<div>兑换总积分</div>
2023-10-23 10:48:30 +08:00
<p v-text="GongdeBank.useTotal"/>
2023-10-19 17:19:15 +08:00
</div>
</div>
<div class="staPanel simple right flex mar-t14">
2023-10-23 10:48:30 +08:00
<div class="fill" v-for="(v,k) in GongdeBank.stores" :key="k">
2023-10-19 17:19:15 +08:00
<div v-text="k"/>
<b v-text="v"/>
</div>
</div>
<div class="grid c-3 pad-t14 pad-b20">
2023-10-23 10:48:30 +08:00
<div class="staPanel" v-for="(v,k) in GongdeBank.tasks">
2023-10-19 17:19:15 +08:00
<div v-text="k"/>
<b v-text="v"/>
</div>
</div>
2023-10-13 18:10:45 +08:00
</fd-card>
2023-10-19 17:19:15 +08:00
<fd-card label="门户应用统计" class="mar-t14 pad-b20">
<dv-scroll-board class="mar-t14" :config="appSta" style="height: 304px"/>
2023-10-13 18:10:45 +08:00
</fd-card>
</div>
2023-10-11 18:21:40 +08:00
</ai-dv-wrapper>
</ai-fit-view>
</section>
</template>
<script>
import AiFitView from "dui/packages/layout/AiFitView.vue";
import FengduHead from "./components/fengduHead.vue";
2023-10-13 18:10:45 +08:00
import FdCard from "./components/fdCard.vue";
import AiEchart from "dui/packages/tools/AiEchart.vue";
import AiHighlight from "dui/packages/layout/AiHighlight.vue";
2023-10-18 10:34:41 +08:00
import AiInfoItem from "dui/packages/basic/AiInfoItem.vue";
import AiWrapper from "dui/packages/basic/AiWrapper.vue";
2023-10-18 14:59:52 +08:00
import Vue from "vue";
import {scrollBoard} from "@jiaminghi/data-view"
2023-10-23 09:18:23 +08:00
import FdMap from "./components/fdMap.vue";
2023-10-11 18:21:40 +08:00
export default {
name: "AppBIBoard",
label: "丰都指挥舱",
2023-10-23 09:18:23 +08:00
components: {FdMap, AiWrapper, AiInfoItem, AiHighlight, AiEchart, FdCard, FengduHead, AiFitView},
2023-10-11 18:21:40 +08:00
props: {
instance: Function,
dict: Object
},
data() {
return {
2023-10-19 17:19:15 +08:00
areaId: '',
2023-10-18 10:34:41 +08:00
scale: 1,
2023-10-13 18:10:45 +08:00
fullscreen: false,
sta: {
群总数: 5118,
群主人数: 956,
'活跃群成员(30天)': '214,098',
'群消息(30天)': '1,214,098',
},
chart: {
2023-10-18 10:34:41 +08:00
legend: {show: false},
2023-10-13 18:10:45 +08:00
series: {
type: 'gauge',
startAngle: 90,
endAngle: -270,
center: ['50%', 74],
radius: 50,
progress: {
2023-10-18 10:34:41 +08:00
show: true,
2023-10-13 18:10:45 +08:00
overlap: false,
roundCap: true,
clip: false,
2023-10-18 10:34:41 +08:00
itemStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{offset: 0, color: '#139AFF'},
{offset: 1, color: '#0ED5A6'},
]
}
},
2023-10-13 18:10:45 +08:00
},
2023-10-18 10:34:41 +08:00
pointer: {show: false},
splitLine: {show: false},
axisTick: {show: false},
axisLabel: {show: false},
2023-10-13 18:10:45 +08:00
axisLine: {
2023-10-18 10:34:41 +08:00
lineStyle: {width: 6, color: [[1, 'rgba(102, 121, 138, 0.4)']]},
},
detail: {
valueAnimation: true,
offsetCenter: [0, 0],
fontSize: 24,
formatter: '{value}%',
color: "#02FEFF",
2023-10-19 17:19:15 +08:00
fontFamily: "DIN",
2023-10-18 10:34:41 +08:00
width: 50,
lineHeight: 50,
padding: 12,
borderWidth: 1,
borderColor: 'rgba(102, 121, 138, 0.4)',
borderRadius: 50
},
},
2023-10-13 18:10:45 +08:00
},
2023-10-18 10:34:41 +08:00
chartData: [
{name: "活跃居民群", value: 3502},
{name: "全部居民群", value: 5118},
2023-10-18 14:59:52 +08:00
],
volunteers: {
团队数量: 125,
志愿者数量: 13,
服务学员数量: 5
},
volunteerConfig: {
header: ['所属团队', '姓名', '性别', '年龄'],
headerBGC: 'rgba(33, 180, 253, 0.1)',
oddRowBGC: 'rgba(112, 112, 112, 0)',
evenRowBGC: 'rgba(112, 112, 112, 0)',
rowNum: 4,
headerHeight: 38,
columnWidth: [250],
align: ['left', 'left', 'left', 'center'],
carousel: 'page',
data: [
['三合街道丁庄社区互助会', '张珊珊', '女', 32],
['三合街道丁庄社区互助会', '王富贵', '女', 32],
['三合街道丁庄社区互助会', '阿萨德', '男', 23],
['三合街道丁庄社区互助会', '阿连德', '男', 54],
['三合街道丁庄社区互助会', '王柏柏', '女', 66],
['三合街道丁庄社区互助会', '赵二狗', '男', 41],
['三合街道丁庄社区互助会', '唯一键', '女', 13],
['三合街道丁庄社区互助会', '卡萨丁', '男', 32],
['三合街道丁庄社区互助会', '卡萨丁', '男', 32],
['三合街道丁庄社区互助会', '卡萨丁', '男', 32],
['三合街道丁庄社区互助会', '张珊珊', '女', 32],
['三合街道丁庄社区互助会', '张珊珊', '女', 32],
]
},
2023-10-19 17:19:15 +08:00
appSta: {
header: ['应用名称', '本日点击', '累计点击'],
headerBGC: 'rgba(33, 180, 253, 0.1)',
oddRowBGC: 'rgba(112, 112, 112, 0)',
evenRowBGC: 'rgba(112, 112, 112, 0)',
rowNum: 7,
headerHeight: 38,
columnWidth: [250],
align: ['left', 'right', 'right'],
data: [
2023-10-23 10:48:30 +08:00
// ['渝快办', 178, 266],
// ['公交乘车码', 178, 266],
// ['警快办', 178, 266],
// ['医保电子凭证', 178, 266],
// ['居民上报', 178, 266],
// ['医保电子凭证', 178, 266],
// ['居民上报', 178, 266],
2023-10-19 17:19:15 +08:00
]
},
current: 1,
realtimeEvents: {
rowNum: 6,
oddRowBGC: 'rgba(112, 112, 112, 0)',
evenRowBGC: 'rgba(112, 112, 112, 0)',
columnWidth: [226],
align: ['center', 'left'],
data: [
2023-10-23 10:48:30 +08:00
// ['<div class="timeRow">2023-10-19 14:55:32</div>', '汇南社区-张三 创建了新的居民群'],
// ['<div class="timeRow">2023-10-19 14:55:32</div>', '汇南社区-张三 邀请居民"蓝天白云"加入居民群“书院社区2群”'],
// ['<div class="timeRow">2023-10-19 14:55:32</div>', '汇南社区-张三 将居民"蓝天白云"踢出居民群 “书院社区2群”'],
// ['<div class="timeRow">2023-10-19 14:55:32</div>', '滨江东路社区居民-陈思宇在丰收号小程序中进行了打卡签到'],
// ['<div class="timeRow">2023-10-19 14:55:32</div>', '滨江东路社区居民-陈思宇在丰收号小程序中进行了积分申请'],
// ['<div class="timeRow">2023-10-19 14:55:32</div>', '滨滨江东路社区居民-陈思宇在丰收号小程序中进行了物品兑换'],
// ['<div class="timeRow">2023-10-18 14:55:32</div>', '三角路社区居民-陈思宇在丰收号小程序中进行了物品兑换'],
// ['<div class="timeRow">2023-10-18 14:55:32</div>', '三角路社区居民-陈思宇在丰收号小程序中进行了物品兑换'],
// ['<div class="timeRow">2023-10-18 14:55:32</div>', '三角路社区居民-陈思宇在丰收号小程序中进行了物品兑换'],
2023-10-19 17:19:15 +08:00
]
},
2023-10-23 10:48:30 +08:00
shortcut: 0,
GongdeBank: {},
map: null
2023-10-11 18:21:40 +08:00
}
},
2023-10-18 14:59:52 +08:00
computed: {
2023-10-19 17:19:15 +08:00
tablePages: v => Math.ceil(v.volunteerConfig.data.length / v.volunteerConfig.rowNum) || 0,
shortcuts: () => Object.assign({0: '昨日', 1: '近七天', 2: '近30天', 3: '近一年'})
2023-10-18 14:59:52 +08:00
},
2023-10-23 10:48:30 +08:00
watch: {
shortcut() {
this.getGdyh(this.areaId)
}
},
2023-10-11 18:21:40 +08:00
methods: {
handleFullScreen() {
this.fullscreen = this.$refs.fddv.handleFullScreen()
},
handleSetting(v) {
this.$refs.fddv.dialog = v
2023-10-18 10:34:41 +08:00
},
calcProgress() {
const value = (this.chartData[0].value / this.chartData.at(-1).value * 100).toFixed(0)
return [{value}]
2023-10-18 14:59:52 +08:00
},
watchTablePageChange(c = 0) {
if (this.$refs.volunteerTable) {
this.$refs.volunteerTable.$watch('animationIndex', i => {
this.current = Math.floor(i / 4) + 1
})
} else if (c < 5) {
setTimeout(() => this.watchTablePageChange(++c), 500)
}
2023-10-19 17:19:15 +08:00
},
2023-10-23 10:48:30 +08:00
getData(c = 0) {
2023-10-19 17:19:15 +08:00
const {areaId} = this.$data
2023-10-23 10:48:30 +08:00
if (areaId) {
this.getMiniAppInfo()
this.getRealTimeDynamic(areaId)
this.getWxGroupOverview(areaId)
this.getGdyh(areaId)
} else if (c < 10) setTimeout(() => this.getData(++c), 500)
else console.error(`尝试${c}次加载数据,无法过去数据`)
},
getMiniAppInfo() {
this.instance.post("/app/fdDiy/miniAppInfo").then(res => {
if (res?.data) {
const data = res.data.map(e => [e.name || "应用", e.lastDayClick, e.totalClick])
this.appSta = {...this.appSta, data}
}
})
},
getRealTimeDynamic(areaId) {
2023-10-19 17:19:15 +08:00
this.instance.post("/app/fdDiy/realTimeDynamic", null, {params: {areaId}}).then(res => {
2023-10-23 10:48:30 +08:00
if (res?.data) {
const data = res.data.map(e => [`<div class="timeRow">${e.eventTime}</div>`, `<div class="flex">${e.bizId ? e.description.replace(e.type, `<div class="blue">${e.type}</div>`) : e.description}</div>`])
this.realtimeEvents = {...this.realtimeEvents, data, meta: res.data}
}
})
},
getWxGroupOverview(areaId) {
this.instance.post("/app/fdDiy/wxGroupOverview", null, {params: {areaId}}).then(res => {
2023-10-19 17:19:15 +08:00
if (res?.data) {
}
})
2023-10-23 10:48:30 +08:00
},
getGdyh(areaId) {
this.instance.post("/app/fdDiy/gdyh", null, {params: {areaId, type: this.shortcut}}).then(res => {
if (res?.data) {
const {
宣发发布任务数,
宣发未审核数,
宣发审核通过数,
店铺总数,
店品库存量 = 0,
兑换物品数量,
获取积分总数: total = 0,
居民签到人次: 签到人数 = 0,
积分申请次数: 申请人数 = 0,
兑换总积分: useTotal = 0
} = res.data
this.GongdeBank = {
total, useTotal,
users: {
参与人数: 签到人数 + 申请人数,
申请人数,
签到人数
},
stores: {店铺总数, 店品库存量, 兑换物品数量},
tasks: {
宣发发布任务数,
审核通过率: (宣发审核通过数 / 宣发发布任务数 * 100 || 0).toFixed(2) + "%",
宣发未审核数,
}
}
}
})
},
handleRealtimeEventDialog({rowIndex}) {
const row = this.realtimeEvents.meta[rowIndex]
if (row.bizId) {
const action = {
积分申请: "",
物品兑换: "",
精选动态: "",
}[row.type]
this.instance.post(action, null, {params: {id: row.bizId}}).then(res => {
if (res?.data) {
}
})
}
console.log(row)
2023-10-11 18:21:40 +08:00
}
},
2023-10-18 14:59:52 +08:00
created() {
Vue.use(scrollBoard)
2023-10-19 17:19:15 +08:00
this.getData()
2023-10-18 14:59:52 +08:00
},
mounted() {
this.watchTablePageChange()
}
2023-10-11 18:21:40 +08:00
}
</script>
<style scoped lang="scss">
.AppBIBoard {
2023-10-13 18:10:45 +08:00
color: #CDDBEA;
font-size: 14px;
2023-10-18 14:59:52 +08:00
:deep(.areaPicker) {
max-width: 300px;
input {
background: rgba(0, 54, 82, 0.9);
border: 1px solid rgba(42, 122, 146, 0.7);
border-radius: 2.2px;
color: #B3DDE5;
cursor: pointer;
}
.el-input__suffix {
color: #B3DDE5;
}
}
2023-10-11 18:21:40 +08:00
&.fullscreen {
position: fixed;
z-index: 202310111819;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
2023-10-12 18:17:46 +08:00
:deep(.viewPanel) {
background-image: url("./assets/img_bg.png");
2023-10-13 18:10:45 +08:00
& > .fill {
display: flex;
gap: 20px;
padding: 12px 24px 0;
}
}
.left, .right {
width: 480px;
flex-shrink: 0;
}
.grid {
display: grid;
gap: 14px;
&.c-2 {
2023-10-19 17:19:15 +08:00
grid-template-columns:1fr 1fr;
}
&.c-3 {
grid-template-columns:1fr 1fr 1fr;
2023-10-13 18:10:45 +08:00
}
}
.staPanel {
text-align: center;
font-size: 15px;
line-height: 20px;
background: url("./assets/staPanel-bg.png") no-repeat;
2023-10-19 17:19:15 +08:00
background-size: 100% 100%;
2023-10-13 18:10:45 +08:00
height: 80px;
padding-top: 14px;
2023-10-19 17:19:15 +08:00
width: 100%;
2023-10-13 18:10:45 +08:00
2023-10-18 14:59:52 +08:00
b {
2023-10-19 17:19:15 +08:00
font-family: DIN;
2023-10-13 18:10:45 +08:00
font-size: 22px;
color: #02FEFF;
letter-spacing: 0;
line-height: 36px;
}
2023-10-19 17:19:15 +08:00
&.simple {
background: #ffffff0a;
padding-top: 0;
&.right {
color: #9BB7D4;
b {
color: #FFFFFF;
}
}
}
2023-10-13 18:10:45 +08:00
}
.chart {
2023-10-18 10:34:41 +08:00
.legend {
position: absolute;
left: 0;
right: 0;
bottom: 0;
}
2023-10-19 17:19:15 +08:00
.AiEchart {
height: 204px;
}
2023-10-12 18:17:46 +08:00
}
2023-10-18 14:59:52 +08:00
.title {
padding-left: 10px;
line-height: 30px;
background-image: linear-gradient(270deg, #1f436600 0%, #245a7570 99%);
}
.jumpBtn {
background-image: linear-gradient(180deg, rgba(90, 200, 246, 0.4) 0%, rgba(1, 51, 101, 0.4) 84%);
box-shadow: inset 0 2px 8px 0 rgba(51, 187, 255, 0.5);
border-radius: 15px;
font-weight: 500;
font-size: 12px;
color: #02FEFF;
padding: 8px 16px;
height: 30px;
user-select: none;
cursor: pointer;
margin-top: -7px;
}
:deep(.dv-scroll-board) {
height: 200px;
.header-item {
color: #02FEFF;
}
.row-item {
2023-10-19 17:19:15 +08:00
height: 38px;
2023-10-18 14:59:52 +08:00
line-height: 38px;
2023-10-19 17:19:15 +08:00
border-bottom: 1px solid #154270;
margin-top: -1px;
}
.timeRow {
background-image: url("./assets/realtimeIcon.png");
background-repeat: no-repeat;
background-position: 20px center;
text-indent: 24px;
2023-10-18 14:59:52 +08:00
}
2023-10-23 10:48:30 +08:00
.blue {
color: #02FEFF;
cursor: pointer;
}
2023-10-18 14:59:52 +08:00
}
.dots {
height: 36px;
padding-top: 22px;
padding-bottom: 8px;
.dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: #679a9a80;
margin-right: 8px;
&.current {
background: #02FEFF;
}
&:last-of-type {
margin-right: 0;
}
}
}
2023-10-19 17:19:15 +08:00
.centerBottom {
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
.shortcut {
background: #1f9ecc29;
padding: 4px 13px;
color: #1FBECC;
font-size: 13px;
margin-left: 4px;
margin-top: -7px;
border: 1px solid transparent;
cursor: pointer;
height: fit-content;
&:first-of-type {
margin-left: 0;
}
&.active {
border-color: #20B4C5;
color: #4ED8E4;
}
}
.boxSta {
margin-top: 16px;
2023-10-23 10:48:30 +08:00
padding-right: 40px;
2023-10-19 17:19:15 +08:00
justify-content: flex-end;
background: url("./assets/box.png") no-repeat 80px center;
height: 82px;
font-size: 16px;
.text {
color: #FFFFFF;
2023-10-23 10:48:30 +08:00
width: 200px;
2023-10-19 17:19:15 +08:00
justify-content: space-between;
& > p {
font-family: DIN;
font-size: 26px;
color: #02FEFF;
}
}
}
2023-10-11 18:21:40 +08:00
}
</style>