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

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,
dict: Object,
permissions: Function,
menuName: {default: "网格员积分"}
},
computed: {
currentPage() {
let {hash} = this.$route
return hash == "#gridScoreDetail" ? gridScoreDetail :
hash == "#gridScoreRules" ? gridScoreRules :
hash == "#gridScoreStatistics" ? gridScoreStatistics :
hash == "#gridScoreRules" ? gridScoreRules :
hash == "#gridScoreStatistics" ? gridScoreStatistics :
hash == "#gridScoreManage" ? gridScoreManage : gmScore
}
},
@@ -41,7 +41,7 @@ export default {
methods: {
onChange(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})
}
}

View File

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

View File

@@ -1,6 +1,6 @@
<template>
<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;">
<div class="card_list">
<div class="card">
@@ -21,7 +21,9 @@
<div class="title">
<h4>事件汇总</h4>
<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 class="bar_Box">
@@ -34,12 +36,12 @@
<template #content>
<ai-search-bar>
<template #left>
<ai-select v-model="search.type" placeholder="请选择类型" @change="search.current=1,getIntegralChange()"
:selectList="dict.getDict('integralType')"/>
<ai-select v-model="search.type" placeholder="请选择类型" @change="search.current=1,getIntegralChange()"
:selectList="dict.getDict('integralType')"/>
</template>
<template #right>
<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>
</ai-download>
</template>
@@ -73,6 +75,7 @@
<script>
import dayjs from "dayjs";
import * as echarts from 'echarts';
export default {
name: "gridScoreDetail",
data() {
@@ -102,16 +105,17 @@ export default {
instance: Function,
dict: Object,
permissions: Function,
menuName: String
},
computed: {
colConfigs() {
return [
{ prop: "doTime", label: '时间', align: "left", width: "200px" },
{ slot: "integralType", label: '类型', align: "center", width: "240px", dict:"integralType"},
{ slot: "changeIntegral"},
{ prop: "nowIntegral", label: '剩余积分', align: "center",width: "200px" },
{ slot: "eventDesc"},
{prop: "doTime", label: '时间', align: "left", width: "200px"},
{slot: "integralType", label: '类型', align: "center", width: "240px", dict: "integralType"},
{slot: "changeIntegral"},
{prop: "nowIntegral", label: '剩余积分', align: "center", width: "200px"},
{slot: "eventDesc"},
]
}
},
@@ -121,21 +125,20 @@ export default {
this.getIntegralChange()
this.getEventSummary()
let nowTime = dayjs().format('YYYY-MM-DD')
let timeAgo = dayjs().subtract(29, 'day').format('YYYY-MM-DD')
this.startPla = timeAgo
this.startPla = dayjs().subtract(29, 'day').format('YYYY-MM-DD')
this.endPla = nowTime
})
},
methods: {
// 详情
getDetail() {
this.instance.post(`/app/appintegraluser/girdDetail`,null,{
this.instance.post(`/app/appintegraluser/girdDetail`, null, {
params: {
id: this.$route.query.id
}
}).then(res=>{
if(res?.data) {
}).then(res => {
if (res?.data) {
this.data = res.data
}
})
@@ -143,16 +146,16 @@ export default {
// 事件汇总
getEventSummary() {
this.instance.post(`/app/appintegraluser/eventSummary`,null,{
this.instance.post(`/app/appintegraluser/eventSummary`, null, {
params: {
id: this.$route.query.id,
startTime: this.startTime,
endTime: this.endTime,
endTime: this.endTime,
}
}).then(res=>{
if(res?.data) {
this.xData = res.data.map(x=> x.eventName)
this.yData = res.data.map(y=> y.totalIntegral)
}).then(res => {
if (res?.data) {
this.xData = res.data.map(x => x.eventName)
this.yData = res.data.map(y => y.totalIntegral)
this.getColEcherts(this.xData, this.yData)
}
})
@@ -167,7 +170,7 @@ export default {
id: this.$route.query.id,
}
}).then(res => {
if(res?.data) {
if (res?.data) {
this.tableData = res.data.records
this.total = res.data.total
}
@@ -175,7 +178,7 @@ export default {
},
timeChange() {
if(this.timeList.length) {
if (this.timeList.length) {
this.startTime = this.timeList[0]
this.endTime = this.timeList[1]
this.getEventSummary()
@@ -248,7 +251,7 @@ export default {
filters: {
formatTime(num) {
if(num > 0) {
if (num > 0) {
return '+' + num
} else {
return num
@@ -260,7 +263,7 @@ export default {
this.getColEcherts()
},
destroyed () {
destroyed() {
window.removeEventListener('resize', this.onResize)
},
}
@@ -273,55 +276,65 @@ export default {
padding: 0 20px;
box-sizing: border-box;
overflow-y: scroll;
.card_list {
display: flex;
.card {
flex: 1;
height: 96px;
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;
margin-right: 20px;
padding: 16px 24px;
box-sizing: border-box;
h2 {
color: #888888;
font-weight: 600;
font-size: 16px;
}
p {
margin-top: 8px;
font-size: 24px;
font-weight: 600;
}
.color1 {
color: #2891FF;
}
.color2 {
color: #22AA99;
}
.color3 {
color: #F8B425;
}
}
.card:last-child {
margin-right: 0;
}
}
.echertsBox {
width: 100%;
margin-top: 20px;
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;
padding: 16px;
box-sizing: border-box;
.title {
display: flex;
justify-content: space-between;
h4 {
color: #222222;
font-style: 16px;
font-weight: 600;
}
@@ -329,13 +342,14 @@ export default {
.bar_Box {
width: 100%;
#chartDom {
width: 100%;
height: 230px;
margin-top: 16px;
}
}
}
}
</style>
</style>

View File

@@ -5,14 +5,14 @@
<ai-search-bar>
<template #left>
<el-button type="primary" size="small" icon="iconfont iconAdd" @click="changeIntegral('',0)">&nbsp;批量调整积分</el-button>
<el-cascader ref="cascader1" clearable v-model="girdIdList" :options="girdOptions" placeholder="所属网格" size="small"
<el-cascader ref="cascader1" clearable v-model="girdIdList" :options="girdOptions" placeholder="所属网格" size="small"
:props="defaultProps" :show-all-levels="false" @change="gridChange"></el-cascader>
</template>
<template #right>
<el-input size="small" placeholder="姓名" v-model="search.userName" clearable
@clear="current = 1, search.userName = '', getTableData()" suffix-icon="iconfont iconSearch"
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">
<el-button size="small">导出</el-button>
</ai-download>
@@ -21,7 +21,7 @@
<ai-table :tableData="tableData" :total="total" :current.sync="current" :size.sync="size"
@getList="getTableData()" :col-configs="colConfigs" :dict="dict" @sort-change="changeTableSort">
<el-table-column slot="options" label="操作" align="center">
<template slot-scope="{ row }">
<el-button type="text" @click="changeIntegral(row,1)">调整积分</el-button>
@@ -65,7 +65,7 @@
</el-form>
</ai-dialog>
</section>
</template>
<script>
@@ -77,26 +77,27 @@ export default {
instance: Function,
dict: Object,
permissions: Function,
menuName:String
},
data() {
return {
search: {
userName: '',
girdId: '',
current: 1,
current: 1,
size: 10,
sortFiled: '',
sortRule: '',
},
girdIdList: [],
tableData: [],
size: 10,
size: 10,
total: 0,
current: 1,
girdList: [],
form: {
ids: [],
eventDesc: "",
eventDesc: "",
enclosure: "", // 附件
integralCalcType: "",
integral: '',
@@ -257,7 +258,7 @@ export default {
this.flag = true
this.instance.post(`/app/appintegraluser/changeIntegral`,{
ids: this.form.ids,
eventDesc: this.form.eventDesc,
eventDesc: this.form.eventDesc,
enclosure: this.form.enclosure, // 附件
integralCalcType: this.form.integralCalcType,
integral: this.form.integral,
@@ -275,7 +276,7 @@ export default {
})
}
})
},
toDetail(id) {
@@ -298,7 +299,7 @@ export default {
max-height: 600px!important;
}
.userlist {
display: inline-block;
@@ -358,4 +359,4 @@ export default {
background: pink;
}
}
</style>
</style>