网格员积分应用名称可随菜单变化

This commit is contained in:
aixianling
2022-08-26 15:13:18 +08:00
parent ded1bbfcb9
commit 80704876f0
4 changed files with 69 additions and 57 deletions

View File

@@ -19,14 +19,14 @@ export default {
instance: Function, instance: Function,
dict: Object, dict: Object,
permissions: Function, permissions: Function,
menuName: {default: "网格员积分"}
}, },
computed: { computed: {
currentPage() { currentPage() {
let {hash} = this.$route let {hash} = this.$route
return hash == "#gridScoreDetail" ? gridScoreDetail : return hash == "#gridScoreDetail" ? gridScoreDetail :
hash == "#gridScoreRules" ? gridScoreRules : hash == "#gridScoreRules" ? gridScoreRules :
hash == "#gridScoreStatistics" ? gridScoreStatistics : hash == "#gridScoreStatistics" ? gridScoreStatistics :
hash == "#gridScoreManage" ? gridScoreManage : gmScore hash == "#gridScoreManage" ? gridScoreManage : gmScore
} }
}, },
@@ -41,7 +41,7 @@ export default {
methods: { methods: {
onChange(data) { onChange(data) {
let {type, params: query} = data, let {type, params: query} = data,
hash = ["gridScoreManage", "gridScoreRules","gridScoreStatistics"].includes(type) ? "" : "#" + type hash = ["gridScoreManage", "gridScoreRules", "gridScoreStatistics"].includes(type) ? "" : "#" + type
this.$router.push({hash, query}) this.$router.push({hash, query})
} }
} }

View File

@@ -1,7 +1,7 @@
<template> <template>
<ai-list class="AppGridMemberScore"> <ai-list class="AppGridMemberScore">
<template slot="title"> <template slot="title">
<ai-title title="网格员积分" :isShowBottomBorder="false" :instance="instance" > <ai-title :title="menuName" :isShowBottomBorder="false" :instance="instance">
<template slot="sub"> <template slot="sub">
<div>网格员可通过完成某些任务获取一定数量的积分积分可去兑换相应的奖励</div> <div>网格员可通过完成某些任务获取一定数量的积分积分可去兑换相应的奖励</div>
</template> </template>
@@ -10,8 +10,7 @@
<template slot="tabs"> <template slot="tabs">
<el-tabs v-model="currIndex"> <el-tabs v-model="currIndex">
<el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label"> <el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label">
<component :is="tab.comp" v-if="currIndex === String(i)" :ref="tab.name" v-on="$listeners" <component :is="tab.comp" v-if="currIndex === String(i)" :ref="tab.name" v-on="$listeners" :areaId="areaId" v-bind="$props"/>
:areaId="areaId" :instance="instance" :dict="dict" :permissions="permissions"/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</template> </template>
@@ -25,8 +24,7 @@ import gridScoreStatistics from './gridScoreStatistics.vue'
import {mapState} from 'vuex' import {mapState} from 'vuex'
export default { export default {
name: 'AppGridMemberScore', name: 'gmScore',
label: "网格员积分",
components: { components: {
girdScoreManage, girdScoreManage,
gridScoreRules, gridScoreRules,
@@ -36,6 +34,7 @@ export default {
instance: Function, instance: Function,
dict: Object, dict: Object,
permissions: Function, permissions: Function,
menuName: String
}, },
data() { data() {
@@ -74,9 +73,7 @@ export default {
this.areaId = this.user.info.areaId this.areaId = this.user.info.areaId
// this.$dict.load("") // this.$dict.load("")
}, },
methods: { methods: {},
},
} }
</script> </script>

View File

@@ -1,6 +1,6 @@
<template> <template>
<section class="gridScoreDetail"> <section class="gridScoreDetail">
<ai-title slot="title" title="网格员积分详情" isShowBottomBorder :isShowBack="true" @onBackClick="cancel(false)"/> <ai-title slot="title" :title="`${menuName}详情`" isShowBottomBorder :isShowBack="true" @onBackClick="cancel(false)"/>
<el-row style="margin-top: 20px;"> <el-row style="margin-top: 20px;">
<div class="card_list"> <div class="card_list">
<div class="card"> <div class="card">
@@ -21,7 +21,9 @@
<div class="title"> <div class="title">
<h4>事件汇总</h4> <h4>事件汇总</h4>
<div class="timecSelect"> <div class="timecSelect">
时间<el-date-picker size="small" value-format="yyyy-MM-dd" @change="timeChange" v-model="timeList" type="daterange" range-separator="至" :start-placeholder="startPla" :end-placeholder="endPla"></el-date-picker> 时间
<el-date-picker size="small" value-format="yyyy-MM-dd" @change="timeChange" v-model="timeList" type="daterange" range-separator="至"
:start-placeholder="startPla" :end-placeholder="endPla"></el-date-picker>
</div> </div>
</div> </div>
<div class="bar_Box"> <div class="bar_Box">
@@ -35,11 +37,11 @@
<ai-search-bar> <ai-search-bar>
<template #left> <template #left>
<ai-select v-model="search.type" placeholder="请选择类型" @change="search.current=1,getIntegralChange()" <ai-select v-model="search.type" placeholder="请选择类型" @change="search.current=1,getIntegralChange()"
:selectList="dict.getDict('integralType')"/> :selectList="dict.getDict('integralType')"/>
</template> </template>
<template #right> <template #right>
<ai-download :instance="instance" :url="`/app/appintegraluser/changeIntegralExport?id=${$route.query.id}`" :params="search" fileName="网格员余额变动明细" <ai-download :instance="instance" :url="`/app/appintegraluser/changeIntegralExport?id=${$route.query.id}`" :params="search" fileName="网格员余额变动明细"
:disabled="tableData.length == 0"> :disabled="tableData.length == 0">
<el-button size="small">导出</el-button> <el-button size="small">导出</el-button>
</ai-download> </ai-download>
</template> </template>
@@ -73,6 +75,7 @@
<script> <script>
import dayjs from "dayjs"; import dayjs from "dayjs";
import * as echarts from 'echarts'; import * as echarts from 'echarts';
export default { export default {
name: "gridScoreDetail", name: "gridScoreDetail",
data() { data() {
@@ -102,16 +105,17 @@ export default {
instance: Function, instance: Function,
dict: Object, dict: Object,
permissions: Function, permissions: Function,
menuName: String
}, },
computed: { computed: {
colConfigs() { colConfigs() {
return [ return [
{ prop: "doTime", label: '时间', align: "left", width: "200px" }, {prop: "doTime", label: '时间', align: "left", width: "200px"},
{ slot: "integralType", label: '类型', align: "center", width: "240px", dict:"integralType"}, {slot: "integralType", label: '类型', align: "center", width: "240px", dict: "integralType"},
{ slot: "changeIntegral"}, {slot: "changeIntegral"},
{ prop: "nowIntegral", label: '剩余积分', align: "center",width: "200px" }, {prop: "nowIntegral", label: '剩余积分', align: "center", width: "200px"},
{ slot: "eventDesc"}, {slot: "eventDesc"},
] ]
} }
}, },
@@ -121,8 +125,7 @@ export default {
this.getIntegralChange() this.getIntegralChange()
this.getEventSummary() this.getEventSummary()
let nowTime = dayjs().format('YYYY-MM-DD') let nowTime = dayjs().format('YYYY-MM-DD')
let timeAgo = dayjs().subtract(29, 'day').format('YYYY-MM-DD') this.startPla = dayjs().subtract(29, 'day').format('YYYY-MM-DD')
this.startPla = timeAgo
this.endPla = nowTime this.endPla = nowTime
}) })
@@ -130,12 +133,12 @@ export default {
methods: { methods: {
// 详情 // 详情
getDetail() { getDetail() {
this.instance.post(`/app/appintegraluser/girdDetail`,null,{ this.instance.post(`/app/appintegraluser/girdDetail`, null, {
params: { params: {
id: this.$route.query.id id: this.$route.query.id
} }
}).then(res=>{ }).then(res => {
if(res?.data) { if (res?.data) {
this.data = res.data this.data = res.data
} }
}) })
@@ -143,16 +146,16 @@ export default {
// 事件汇总 // 事件汇总
getEventSummary() { getEventSummary() {
this.instance.post(`/app/appintegraluser/eventSummary`,null,{ this.instance.post(`/app/appintegraluser/eventSummary`, null, {
params: { params: {
id: this.$route.query.id, id: this.$route.query.id,
startTime: this.startTime, startTime: this.startTime,
endTime: this.endTime, endTime: this.endTime,
} }
}).then(res=>{ }).then(res => {
if(res?.data) { if (res?.data) {
this.xData = res.data.map(x=> x.eventName) this.xData = res.data.map(x => x.eventName)
this.yData = res.data.map(y=> y.totalIntegral) this.yData = res.data.map(y => y.totalIntegral)
this.getColEcherts(this.xData, this.yData) this.getColEcherts(this.xData, this.yData)
} }
}) })
@@ -167,7 +170,7 @@ export default {
id: this.$route.query.id, id: this.$route.query.id,
} }
}).then(res => { }).then(res => {
if(res?.data) { if (res?.data) {
this.tableData = res.data.records this.tableData = res.data.records
this.total = res.data.total this.total = res.data.total
} }
@@ -175,7 +178,7 @@ export default {
}, },
timeChange() { timeChange() {
if(this.timeList.length) { if (this.timeList.length) {
this.startTime = this.timeList[0] this.startTime = this.timeList[0]
this.endTime = this.timeList[1] this.endTime = this.timeList[1]
this.getEventSummary() this.getEventSummary()
@@ -248,7 +251,7 @@ export default {
filters: { filters: {
formatTime(num) { formatTime(num) {
if(num > 0) { if (num > 0) {
return '+' + num return '+' + num
} else { } else {
return num return num
@@ -260,7 +263,7 @@ export default {
this.getColEcherts() this.getColEcherts()
}, },
destroyed () { destroyed() {
window.removeEventListener('resize', this.onResize) window.removeEventListener('resize', this.onResize)
}, },
} }
@@ -273,55 +276,65 @@ export default {
padding: 0 20px; padding: 0 20px;
box-sizing: border-box; box-sizing: border-box;
overflow-y: scroll; overflow-y: scroll;
.card_list { .card_list {
display: flex; display: flex;
.card { .card {
flex: 1; flex: 1;
height: 96px; height: 96px;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0px 4px 6px -2px rgba(15,15,21,0.1500); box-shadow: 0px 4px 6px -2px rgba(15, 15, 21, 0.1500);
border-radius: 4px; border-radius: 4px;
margin-right: 20px; margin-right: 20px;
padding: 16px 24px; padding: 16px 24px;
box-sizing: border-box; box-sizing: border-box;
h2 { h2 {
color: #888888; color: #888888;
font-weight: 600; font-weight: 600;
font-size: 16px; font-size: 16px;
} }
p { p {
margin-top: 8px; margin-top: 8px;
font-size: 24px; font-size: 24px;
font-weight: 600; font-weight: 600;
} }
.color1 { .color1 {
color: #2891FF; color: #2891FF;
} }
.color2 { .color2 {
color: #22AA99; color: #22AA99;
} }
.color3 { .color3 {
color: #F8B425; color: #F8B425;
} }
} }
.card:last-child { .card:last-child {
margin-right: 0; margin-right: 0;
} }
} }
.echertsBox { .echertsBox {
width: 100%; width: 100%;
margin-top: 20px; margin-top: 20px;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0px 4px 6px -2px rgba(15,15,21,0.1500); box-shadow: 0px 4px 6px -2px rgba(15, 15, 21, 0.1500);
border-radius: 4px; border-radius: 4px;
padding: 16px; padding: 16px;
box-sizing: border-box; box-sizing: border-box;
.title { .title {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
h4 { h4 {
color: #222222; color: #222222;
font-style: 16px;
font-weight: 600; font-weight: 600;
} }
@@ -329,6 +342,7 @@ export default {
.bar_Box { .bar_Box {
width: 100%; width: 100%;
#chartDom { #chartDom {
width: 100%; width: 100%;
height: 230px; height: 230px;

View File

@@ -12,7 +12,7 @@
<el-input size="small" placeholder="姓名" v-model="search.userName" clearable <el-input size="small" placeholder="姓名" v-model="search.userName" clearable
@clear="current = 1, search.userName = '', getTableData()" suffix-icon="iconfont iconSearch" @clear="current = 1, search.userName = '', getTableData()" suffix-icon="iconfont iconSearch"
v-throttle="() => {(current = 1), getTableData();}"/> v-throttle="() => {(current = 1), getTableData();}"/>
<ai-download :instance="instance" url="/app/appintegraluser/girdIntegralExport" :params="search" fileName="网格员积分" <ai-download :instance="instance" url="/app/appintegraluser/girdIntegralExport" :params="search" :fileName="menuName"
:disabled="tableData.length == 0"> :disabled="tableData.length == 0">
<el-button size="small">导出</el-button> <el-button size="small">导出</el-button>
</ai-download> </ai-download>
@@ -77,6 +77,7 @@ export default {
instance: Function, instance: Function,
dict: Object, dict: Object,
permissions: Function, permissions: Function,
menuName:String
}, },
data() { data() {
return { return {