对接大部分接口

This commit is contained in:
aixianling
2023-10-23 10:48:30 +08:00
parent 189e7621ad
commit 8c07c9a6cb
5 changed files with 232 additions and 139 deletions

View File

@@ -1,7 +1,7 @@
<template> <template>
<section class="AppBIBoard" :class="{fullscreen}"> <section class="AppBIBoard" :class="{fullscreen}">
<ai-fit-view @scale="v=>scale=v"> <ai-fit-view @scale="v=>scale=v">
<ai-dv-wrapper ref="fddv" title="丰收号-家庭互助" :instance="instance" :mask="false"> <ai-dv-wrapper ref="fddv" title="丰收号-家庭互助" :instance="instance" :mask="false" @pick="getData()">
<template v-slot:head="head"> <template v-slot:head="head">
<fengdu-head v-model="areaId" v-bind="head" @fullscreen="handleFullScreen" @setting="handleSetting"/> <fengdu-head v-model="areaId" v-bind="head" @fullscreen="handleFullScreen" @setting="handleSetting"/>
</template> </template>
@@ -53,9 +53,10 @@
</fd-card> </fd-card>
</div> </div>
<div class="center fill relative"> <div class="center fill relative">
<fd-map class="w100 h100"/> <fd-map class="w100 h100" v-model="map"/>
<fd-card class="centerBottom pad-b8" label="实时动态"> <fd-card class="centerBottom pad-b8" label="实时动态">
<dv-scroll-board class="mar-t14" :config="realtimeEvents" style="height: 228px"/> <dv-scroll-board class="mar-t14" :config="realtimeEvents" style="height: 228px"
@click="handleRealtimeEventDialog"/>
</fd-card> </fd-card>
</div> </div>
<div class="right"> <div class="right">
@@ -67,11 +68,11 @@
<div class="boxSta flex"> <div class="boxSta flex">
<div class="flex text"> <div class="flex text">
<div>获取总积分</div> <div>获取总积分</div>
<p v-text="12000"/> <p v-text="GongdeBank.total"/>
</div> </div>
</div> </div>
<div class="staPanel simple right flex mar-t14"> <div class="staPanel simple right flex mar-t14">
<div class="fill" v-for="(v,k) in volunteers" :key="k"> <div class="fill" v-for="(v,k) in GongdeBank.users" :key="k">
<div v-text="k"/> <div v-text="k"/>
<b v-text="v"/> <b v-text="v"/>
</div> </div>
@@ -79,17 +80,17 @@
<div class="boxSta flex"> <div class="boxSta flex">
<div class="flex text"> <div class="flex text">
<div>兑换总积分</div> <div>兑换总积分</div>
<p v-text="9500"/> <p v-text="GongdeBank.useTotal"/>
</div> </div>
</div> </div>
<div class="staPanel simple right flex mar-t14"> <div class="staPanel simple right flex mar-t14">
<div class="fill" v-for="(v,k) in volunteers" :key="k"> <div class="fill" v-for="(v,k) in GongdeBank.stores" :key="k">
<div v-text="k"/> <div v-text="k"/>
<b v-text="v"/> <b v-text="v"/>
</div> </div>
</div> </div>
<div class="grid c-3 pad-t14 pad-b20"> <div class="grid c-3 pad-t14 pad-b20">
<div class="staPanel" v-for="(v,k) in volunteers"> <div class="staPanel" v-for="(v,k) in GongdeBank.tasks">
<div v-text="k"/> <div v-text="k"/>
<b v-text="v"/> <b v-text="v"/>
</div> </div>
@@ -228,13 +229,13 @@ export default {
columnWidth: [250], columnWidth: [250],
align: ['left', 'right', 'right'], align: ['left', 'right', 'right'],
data: [ data: [
['渝快办', 178, 266], // ['渝快办', 178, 266],
['公交乘车码', 178, 266], // ['公交乘车码', 178, 266],
['警快办', 178, 266], // ['警快办', 178, 266],
['医保电子凭证', 178, 266], // ['医保电子凭证', 178, 266],
['居民上报', 178, 266], // ['居民上报', 178, 266],
['医保电子凭证', 178, 266], // ['医保电子凭证', 178, 266],
['居民上报', 178, 266], // ['居民上报', 178, 266],
] ]
}, },
current: 1, current: 1,
@@ -245,24 +246,31 @@ export default {
columnWidth: [226], columnWidth: [226],
align: ['center', 'left'], align: ['center', 'left'],
data: [ data: [
['<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>', '汇南社区-张三 邀请居民"蓝天白云"加入居民群“书院社区2群”'], // ['<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>', '汇南社区-张三 将居民"蓝天白云"踢出居民群 “书院社区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-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>', '三角路社区居民-陈思宇在丰收号小程序中进行了物品兑换'], // ['<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>', '三角路社区居民-陈思宇在丰收号小程序中进行了物品兑换'],
] ]
}, },
shortcut: 0 shortcut: 0,
GongdeBank: {},
map: null
} }
}, },
computed: { computed: {
tablePages: v => Math.ceil(v.volunteerConfig.data.length / v.volunteerConfig.rowNum) || 0, tablePages: v => Math.ceil(v.volunteerConfig.data.length / v.volunteerConfig.rowNum) || 0,
shortcuts: () => Object.assign({0: '昨日', 1: '近七天', 2: '近30天', 3: '近一年'}) shortcuts: () => Object.assign({0: '昨日', 1: '近七天', 2: '近30天', 3: '近一年'})
}, },
watch: {
shortcut() {
this.getGdyh(this.areaId)
}
},
methods: { methods: {
handleFullScreen() { handleFullScreen() {
this.fullscreen = this.$refs.fddv.handleFullScreen() this.fullscreen = this.$refs.fddv.handleFullScreen()
@@ -283,13 +291,86 @@ export default {
setTimeout(() => this.watchTablePageChange(++c), 500) setTimeout(() => this.watchTablePageChange(++c), 500)
} }
}, },
getData() { getData(c = 0) {
const {areaId} = this.$data const {areaId} = this.$data
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) {
this.instance.post("/app/fdDiy/realTimeDynamic", null, {params: {areaId}}).then(res => { this.instance.post("/app/fdDiy/realTimeDynamic", null, {params: {areaId}}).then(res => {
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 => {
if (res?.data) { if (res?.data) {
} }
}) })
},
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)
} }
}, },
created() { created() {
@@ -444,6 +525,11 @@ export default {
background-position: 20px center; background-position: 20px center;
text-indent: 24px; text-indent: 24px;
} }
.blue {
color: #02FEFF;
cursor: pointer;
}
} }
.dots { .dots {
@@ -498,7 +584,7 @@ export default {
.boxSta { .boxSta {
margin-top: 16px; margin-top: 16px;
padding-right: 70px; padding-right: 40px;
justify-content: flex-end; justify-content: flex-end;
background: url("./assets/box.png") no-repeat 80px center; background: url("./assets/box.png") no-repeat 80px center;
height: 82px; height: 82px;
@@ -506,7 +592,7 @@ export default {
.text { .text {
color: #FFFFFF; color: #FFFFFF;
width: 156px; width: 200px;
justify-content: space-between; justify-content: space-between;
& > p { & > p {

View File

@@ -8,6 +8,13 @@ import fdEdge from "../assets/fdEdge.json"
export default { export default {
name: "fdMap", name: "fdMap",
model: {
prop: "ins",
event: "input"
},
props: {
ins: {default: null}
},
data() { data() {
return { return {
map: null map: null
@@ -54,6 +61,7 @@ export default {
}, },
] ]
}) })
this.$emit("input", this.map)
} else if (c < 5) setTimeout(() => this.init(++c), 500) } else if (c < 5) setTimeout(() => this.init(++c), 500)
} }
}, },

View File

@@ -1,7 +1,7 @@
<template> <template>
<section class="fengduHead"> <section class="fengduHead">
<div class="content flex"> <div class="content flex">
<ai-area class="fill" v-model="current" :mask="false" :root="currentRoot"> <ai-area class="fill" v-model="current" :mask="false" :root="currentRoot" @area="v=>$emit('pick',v)">
<template slot-scope="{areaname}"> <template slot-scope="{areaname}">
<el-input class="areaPicker" :value="areaname" readonly suffix-icon="el-icon-arrow-down"/> <el-input class="areaPicker" :value="areaname" readonly suffix-icon="el-icon-arrow-down"/>
</template> </template>
@@ -45,11 +45,11 @@ export default {
active: { active: {
immediate: true, immediate: true,
handler(v) { handler(v) {
if (v != this.current) this.current = this.$copy(this.active) if (v && v != this.current) this.current = this.$copy(this.active)
} }
}, },
current(v) { current(v) {
this.$emit("change", v) v != this.active && this.$emit("change", v)
} }
}, },
created() { created() {

View File

@@ -96,7 +96,7 @@ export default class Area {
getName(names) { getName(names) {
this.meta = names this.meta = names
this.nameMap = names?.map(e => e?.name) || [] this.nameMap = names?.map(e => e?.name) || []
this.name = names?.slice(-1)?.[0]?.name this.name = names?.slice(-1)?.[0]?.name || "无"
this.fullname = this.nameMap.join('') this.fullname = this.nameMap.join('')
} }

View File

@@ -12,14 +12,14 @@
</div> </div>
<el-button v-else-if="!customClicker&&!$scopedSlots.default" class="area-btn" type="primary" size="mini" <el-button v-else-if="!customClicker&&!$scopedSlots.default" class="area-btn" type="primary" size="mini"
@click="chooseArea"> @click="chooseArea">
{{ btnShowArea ? selectedName : "切换地区" }} {{ btnShowArea ? selectedArea.name : "切换地区" }}
</el-button> </el-button>
<a class="custom-clicker" v-else @click="chooseArea"> <a class="custom-clicker" v-else @click="chooseArea">
<slot :areaname="selectedName" :fullname="fullName" :id="selected"/> <slot :areaname="selectedArea.name" :fullname="fullName" :id="selected"/>
</a> </a>
<ai-dialog :visible.sync="dialog" title="选择地区" width="60%" @onConfirm="confirmArea" :modal="mask" <ai-dialog :visible.sync="dialog" title="选择地区" width="60%" @onConfirm="confirmArea" :modal="mask"
@open="selected=(value||'')"> @open="selected=(value||'')">
<ai-highlight content="您当前选择&nbsp;@v" :value="selectedName" color="#333" bold/> <ai-highlight content="您当前选择&nbsp;@v" :value="selectedArea.name" color="#333" bold/>
<div class="area_edge"> <div class="area_edge">
<div class="area-box" v-for="ops in showOps"> <div class="area-box" v-for="ops in showOps">
<h2 v-text="ops.header"/> <h2 v-text="ops.header"/>
@@ -85,7 +85,6 @@ export default {
startLevel: v => Math.max(Number(v.hideLevel), 0, v.rootArea.level),//地区最高可选行政地区等级 startLevel: v => Math.max(Number(v.hideLevel), 0, v.rootArea.level),//地区最高可选行政地区等级
endLevel: v => Number(v.areaLevel) || 0,//地区最低可选行政地区等级 endLevel: v => Number(v.areaLevel) || 0,//地区最低可选行政地区等级
selectedArea: v => new Area(v.currentArea, v.hashMap), selectedArea: v => new Area(v.currentArea, v.hashMap),
selectedName: v => v.selectedArea.name || "无",
selectedMap: v => v.selectedArea.areaMap, selectedMap: v => v.selectedArea.areaMap,
validateState: v => ['', 'success'].includes(v.elFormItem?.validateState), validateState: v => ['', 'success'].includes(v.elFormItem?.validateState),
hashMap() { hashMap() {
@@ -230,7 +229,7 @@ export default {
Area.createByAction(this.currentArea, this.instance).then(names => { Area.createByAction(this.currentArea, this.instance).then(names => {
this.selectedArea.getName(names) this.selectedArea.getName(names)
this.fullName = this.selectedArea.nameMap.join(this.separator) this.fullName = this.selectedArea.nameMap.join(this.separator)
this.$emit("update:name", this.selectedName) this.$emit("update:name", this.selectedArea.name)
this.$emit("fullname", this.fullName) this.$emit("fullname", this.fullName)
}) })
} }