卢龙
This commit is contained in:
@@ -1,282 +1,151 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="AppWorkOrder">
|
<div class="AppHandSnapshot">
|
||||||
<AiTopFixed>
|
<component v-if="refresh && isGridMember" :is="component" @change="onChange" :params="params" :ref="component"/>
|
||||||
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bg-color="#3975C6" inactive-color="#fff" active-color="#fff"
|
<div class="tabs" v-if="isTab && isGridMember">
|
||||||
@change="change"></u-tabs>
|
<div class="item" @click="tabClick(index, item.component)" v-for="(item, index) in tabs" :key="index">
|
||||||
<div class="select-top">
|
<img :src="tabIndex == index ? item.activeImg : item.img" alt=""/>
|
||||||
<!-- <div class="tab-item">
|
<p :class="tabIndex == index ? 'color-3267F0' : ''">{{ item.text }}</p>
|
||||||
<AiPagePicker type="gird" v-model="searchGrid" @change="confirm" valueObj nodeKey="id" formType="2">
|
|
||||||
<AiMore v-model="searchGrid.girdName" icon="arrow-down" placeholder="所属网格"/>
|
|
||||||
</AiPagePicker>
|
|
||||||
</div> -->
|
|
||||||
<div class="tab-item" @click="showType = true">
|
|
||||||
<AiMore v-model="eventStatusText" icon="arrow-down" placeholder="办件状态"/>
|
|
||||||
</div>
|
|
||||||
<u-select v-model="showType" :list="listType" value-name="dictValue" label-name="dictName" @confirm="confirm"></u-select>
|
|
||||||
</div>
|
</div>
|
||||||
</AiTopFixed>
|
</div>
|
||||||
<template>
|
<div v-if="!isGridMember" class="empty">
|
||||||
<AiCard v-for="(item, i) in datas" :key="i" @click.native="goDetail(item, 1)">
|
<img src="./components/img/no-admin.png" alt="">
|
||||||
<template #custom>
|
<p>没有网格员权限<br/>无法查看巡查上报信息哦~</p>
|
||||||
<div class="card-top">
|
</div>
|
||||||
<div class="titles">{{ item.content }}</div>
|
|
||||||
|
|
||||||
<div class="types">
|
|
||||||
<span>事件类型</span>
|
|
||||||
<span class="types-right">{{ $dict.getLabel('xbotReportEventType', item.type)}}</span>
|
|
||||||
</div>
|
|
||||||
<div class="types">
|
|
||||||
<span>所属群聊</span>
|
|
||||||
<span class="types-right">{{ item.groupName }}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="gards">
|
|
||||||
<span>上报时间</span>
|
|
||||||
<span class="gards-right">{{ item.createTime }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="status" :class="item.eventStatus == 0 ? 'status0' : item.eventStatus == 1 ? 'status1' : item.eventStatus == 2 ? 'status2' : 'status3'"
|
|
||||||
v-if="item.eventStatus">
|
|
||||||
<span class="icon"></span>
|
|
||||||
<span>
|
|
||||||
{{ $dict.getLabel('clapEventStatus', item.eventStatus) }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</AiCard>
|
|
||||||
<AiEmpty v-if="!datas.length"></AiEmpty>
|
|
||||||
</template>
|
|
||||||
<div class="pad-b120" v-if="datas.length"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import List from './List.vue'
|
||||||
|
import Statistics from './Statistics.vue'
|
||||||
import {mapState} from 'vuex'
|
import {mapState} from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {},
|
|
||||||
name: "AppWorkOrder",
|
name: "AppWorkOrder",
|
||||||
appName: "工单管理",
|
appName: "工单管理",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
datas: [],
|
component: 'List',
|
||||||
tabList: [
|
params: {},
|
||||||
|
refresh: true,
|
||||||
|
tabIndex: 0,
|
||||||
|
tabs: [
|
||||||
{
|
{
|
||||||
name: '全部待办',
|
img: require('./components/img/handle-icon.png'),
|
||||||
|
activeImg: require('./components/img/handle-icon-active.png'),
|
||||||
|
text: '办理',
|
||||||
|
component: 'List',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '办件历史',
|
img: require('./components/img/statistics-icon.png'),
|
||||||
|
activeImg: require('./components/img/statistics-icon-active.png'),
|
||||||
|
text: '统计',
|
||||||
|
component: 'Statistics',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
currentTabs: 0,
|
isTab: true,
|
||||||
current: 1,
|
|
||||||
pages: 0,
|
|
||||||
searchGrid: {},
|
|
||||||
showType: false,
|
|
||||||
eventStatus: '',
|
|
||||||
eventStatusText: '',
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['user']),
|
...mapState(['user']),
|
||||||
listType() {
|
isGridMember() {
|
||||||
return this.$dict.getDict(this.currentTabs == 0 ? 'clapEventStatusAll' : 'clapEventStatusHistory')
|
return this.user.girdCheckType > 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
components: {
|
||||||
uni.$on('nextList', () => {
|
List,
|
||||||
this.current++
|
Statistics,
|
||||||
this.getList()
|
Set,
|
||||||
})
|
},
|
||||||
uni.$on('getListInit', () => {
|
|
||||||
this.current = 1
|
|
||||||
this.getList()
|
|
||||||
})
|
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
onChange(e) {
|
||||||
|
this.params = e.params
|
||||||
|
this.component = e.type
|
||||||
|
},
|
||||||
|
tabClick(index, component) {
|
||||||
|
this.tabIndex = index
|
||||||
|
this.component = component
|
||||||
|
this.refresh = false
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.refresh = true
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
document.title = '工单管理'
|
document.title = '巡查上报'
|
||||||
},
|
uni.$on('hideTab', () => {
|
||||||
created() {
|
this.isTab = false
|
||||||
this.$dict.load('clapEventStatus', 'clapEventStatusAll', 'clapEventStatusHistory', 'xbotReportEventType').then(() => {
|
|
||||||
this.getList()
|
|
||||||
})
|
})
|
||||||
|
uni.$on('showTab', () => {
|
||||||
|
this.isTab = true
|
||||||
|
})
|
||||||
|
uni.$on('getListInit', () => {
|
||||||
|
this.$nextTick(() => this.$refs['List'].getListInit())
|
||||||
|
})
|
||||||
|
|
||||||
|
this.$nextTick(() => this.$refs['List'].getListInit())
|
||||||
},
|
},
|
||||||
methods: {
|
onReachBottom() {
|
||||||
getList() {
|
if (!this.tabIndex) {
|
||||||
let {current, eventStatus, searchGrid: {id: girdId}} = this
|
this.$nextTick(() => this.$refs['List'].nextPage())
|
||||||
this.$http.post(`/app/appsessionarchivereportinfo/list`, null, {
|
}
|
||||||
params: {
|
|
||||||
size: 10,
|
|
||||||
current, searchType: this.currentTabs == 1 ? '1' : '0',
|
|
||||||
eventStatus, girdId
|
|
||||||
},
|
|
||||||
})
|
|
||||||
.then((res) => {
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
|
|
||||||
this.pages = res.data.pages
|
|
||||||
this.$forceUpdate()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
confirm(e) {
|
|
||||||
if (this.showType) {
|
|
||||||
this.eventStatus = e[0].value
|
|
||||||
this.eventStatusText = e[0].label
|
|
||||||
}
|
|
||||||
this.current = 1
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
|
|
||||||
goDetail(item) {
|
|
||||||
uni.navigateTo({url: `./Detail?id=${item.id}`})
|
|
||||||
},
|
|
||||||
|
|
||||||
change(index) {
|
|
||||||
this.current = 1
|
|
||||||
this.datas = []
|
|
||||||
this.eventStatus = ''
|
|
||||||
this.currentTabs = index
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
|
|
||||||
linkTo(url) {
|
|
||||||
uni.navigateTo({url})
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style lang="scss" scoped>
|
||||||
.AppWorkOrder {
|
.AppHandSnapshot {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 0;
|
}
|
||||||
width: 100vw;
|
|
||||||
|
|
||||||
.select-top {
|
.tabs {
|
||||||
background: #fff;
|
width: 100%;
|
||||||
display: flex;
|
height: 98px;
|
||||||
padding: 24px 0;
|
background: #fff;
|
||||||
|
border-top: 1px solid #ddd;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
.tab-item {
|
.item {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 48px;
|
|
||||||
font-size: 26px;
|
|
||||||
font-family: PingFangSC-Regular, PingFang SC;
|
|
||||||
color: #666;
|
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 32px;
|
width: 56px;
|
||||||
height: 32px;
|
height: 56px;
|
||||||
margin-left: 8px;
|
margin-top: 8px;
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-item:nth-of-type(1) {
|
p {
|
||||||
border-right: 1px solid #eee;
|
font-size: 22px;
|
||||||
|
font-family: PingFangSC-Medium, PingFang SC;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #c4cad4;
|
||||||
|
line-height: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-3267F0 {
|
||||||
|
color: #3267f0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
::v-deep .AiTopFixed .content {
|
.empty {
|
||||||
padding: 0;
|
text-align: center;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 282px;
|
||||||
|
height: 306px;
|
||||||
|
margin: 136px auto 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .AiCard {
|
p {
|
||||||
background: #f3f6f9;
|
font-size: 28px;
|
||||||
padding: 24px 40px 0 32px;
|
font-family: PingFangSC-Regular, PingFang SC;
|
||||||
|
color: #999;
|
||||||
.start {
|
line-height: 40px;
|
||||||
background: #fff;
|
|
||||||
border-radius: 16px;
|
|
||||||
|
|
||||||
.card-top {
|
|
||||||
padding: 32px;
|
|
||||||
|
|
||||||
.titles {
|
|
||||||
margin-bottom: 34px;
|
|
||||||
font-size: 32px;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333333;
|
|
||||||
line-height: 1.4;
|
|
||||||
word-break: break-all;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
}
|
|
||||||
|
|
||||||
.types,
|
|
||||||
.gards {
|
|
||||||
margin-top: 8px;
|
|
||||||
font-size: 26px;
|
|
||||||
|
|
||||||
.types-right,
|
|
||||||
.gards-right {
|
|
||||||
margin-left: 32px;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.status {
|
|
||||||
padding: 32px;
|
|
||||||
border-top: 1px solid #dddddd;
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
display: inline-block;
|
|
||||||
width: 8px;
|
|
||||||
height: 8px;
|
|
||||||
vertical-align: middle;
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.status0 {
|
|
||||||
color: #ff883c;
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
background: #ff883c;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.status1 {
|
|
||||||
color: #1aaaff;
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
background: #1aaaff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.status2 {
|
|
||||||
color: #42d784;
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
background: #42d784;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.status3 {
|
|
||||||
color: #ff4466;
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
background: #ff4466;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ::v-deep .AiCard:last-child {
|
|
||||||
// padding-bottom: 24px;
|
|
||||||
// }
|
|
||||||
.pad-b120 {
|
|
||||||
background-color: #f3f6f9;
|
|
||||||
padding-bottom: 120px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
289
src/apps/AppWorkOrderXbot/List.vue
Normal file
289
src/apps/AppWorkOrderXbot/List.vue
Normal file
@@ -0,0 +1,289 @@
|
|||||||
|
<template>
|
||||||
|
<div class="AppWorkOrder">
|
||||||
|
<AiTopFixed>
|
||||||
|
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bg-color="#3975C6" inactive-color="#fff" active-color="#fff"
|
||||||
|
@change="change"></u-tabs>
|
||||||
|
<div class="select-top">
|
||||||
|
<!-- <div class="tab-item">
|
||||||
|
<AiPagePicker type="gird" v-model="searchGrid" @change="confirm" valueObj nodeKey="id" formType="2">
|
||||||
|
<AiMore v-model="searchGrid.girdName" icon="arrow-down" placeholder="所属网格"/>
|
||||||
|
</AiPagePicker>
|
||||||
|
</div> -->
|
||||||
|
<div class="tab-item" @click="showType = true">
|
||||||
|
<AiMore v-model="eventStatusText" icon="arrow-down" placeholder="办件状态"/>
|
||||||
|
</div>
|
||||||
|
<u-select v-model="showType" :list="listType" value-name="dictValue" label-name="dictName" @confirm="confirm"></u-select>
|
||||||
|
</div>
|
||||||
|
</AiTopFixed>
|
||||||
|
<template>
|
||||||
|
<AiCard v-for="(item, i) in datas" :key="i" @click.native="goDetail(item, 1)">
|
||||||
|
<template #custom>
|
||||||
|
<div class="card-top">
|
||||||
|
<div class="titles">{{ item.content }}</div>
|
||||||
|
|
||||||
|
<div class="types">
|
||||||
|
<span>事件类型</span>
|
||||||
|
<span class="types-right">{{ $dict.getLabel('xbotReportEventType', item.type)}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="types">
|
||||||
|
<span>所属群聊</span>
|
||||||
|
<span class="types-right">{{ item.groupName }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="gards">
|
||||||
|
<span>上报时间</span>
|
||||||
|
<span class="gards-right">{{ item.createTime }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="status" :class="item.eventStatus == 0 ? 'status0' : item.eventStatus == 1 ? 'status1' : item.eventStatus == 2 ? 'status2' : 'status3'"
|
||||||
|
v-if="item.eventStatus">
|
||||||
|
<span class="icon"></span>
|
||||||
|
<span>
|
||||||
|
{{ $dict.getLabel('clapEventStatus', item.eventStatus) }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</AiCard>
|
||||||
|
<AiEmpty v-if="!datas.length"></AiEmpty>
|
||||||
|
</template>
|
||||||
|
<div class="pad-b120" v-if="datas.length"></div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {mapState} from 'vuex'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
datas: [],
|
||||||
|
tabList: [
|
||||||
|
{
|
||||||
|
name: '全部待办',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '办件历史',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
currentTabs: 0,
|
||||||
|
current: 1,
|
||||||
|
pages: 0,
|
||||||
|
searchGrid: {},
|
||||||
|
showType: false,
|
||||||
|
eventStatus: '',
|
||||||
|
eventStatusText: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
listType() {
|
||||||
|
return this.$dict.getDict(this.currentTabs == 0 ? 'clapEventStatusAll' : 'clapEventStatusHistory')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
uni.$on('nextList', () => {
|
||||||
|
this.current++
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
uni.$on('getListInit', () => {
|
||||||
|
this.current = 1
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
document.title = '工单管理'
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.$dict.load('clapEventStatus', 'clapEventStatusAll', 'clapEventStatusHistory', 'xbotReportEventType').then(() => {
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getListInit() {
|
||||||
|
this.current = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
nextPage() {
|
||||||
|
this.current++
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
|
||||||
|
getList() {
|
||||||
|
let {current, eventStatus, searchGrid: {id: girdId}} = this
|
||||||
|
this.$http.post(`/app/appsessionarchivereportinfo/list`, null, {
|
||||||
|
params: {
|
||||||
|
size: 10,
|
||||||
|
current, searchType: this.currentTabs == 1 ? '1' : '0',
|
||||||
|
eventStatus, girdId
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
|
||||||
|
this.pages = res.data.pages
|
||||||
|
this.$forceUpdate()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
confirm(e) {
|
||||||
|
if (this.showType) {
|
||||||
|
this.eventStatus = e[0].value
|
||||||
|
this.eventStatusText = e[0].label
|
||||||
|
}
|
||||||
|
this.current = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
|
||||||
|
goDetail(item) {
|
||||||
|
uni.navigateTo({url: `./Detail?id=${item.id}`})
|
||||||
|
},
|
||||||
|
|
||||||
|
change(index) {
|
||||||
|
this.current = 1
|
||||||
|
this.datas = []
|
||||||
|
this.eventStatus = ''
|
||||||
|
this.currentTabs = index
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
|
||||||
|
linkTo(url) {
|
||||||
|
uni.navigateTo({url})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppWorkOrder {
|
||||||
|
height: 100%;
|
||||||
|
padding: 0;
|
||||||
|
width: 100vw;
|
||||||
|
|
||||||
|
.select-top {
|
||||||
|
background: #fff;
|
||||||
|
display: flex;
|
||||||
|
padding: 24px 0;
|
||||||
|
|
||||||
|
.tab-item {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 48px;
|
||||||
|
font-size: 26px;
|
||||||
|
font-family: PingFangSC-Regular, PingFang SC;
|
||||||
|
color: #666;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
margin-left: 8px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-item:nth-of-type(1) {
|
||||||
|
border-right: 1px solid #eee;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .AiTopFixed .content {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .AiCard {
|
||||||
|
background: #f3f6f9;
|
||||||
|
padding: 24px 40px 0 32px;
|
||||||
|
|
||||||
|
.start {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 16px;
|
||||||
|
|
||||||
|
.card-top {
|
||||||
|
padding: 32px;
|
||||||
|
|
||||||
|
.titles {
|
||||||
|
margin-bottom: 34px;
|
||||||
|
font-size: 32px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #333333;
|
||||||
|
line-height: 1.4;
|
||||||
|
word-break: break-all;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
}
|
||||||
|
|
||||||
|
.types,
|
||||||
|
.gards {
|
||||||
|
margin-top: 8px;
|
||||||
|
font-size: 26px;
|
||||||
|
|
||||||
|
.types-right,
|
||||||
|
.gards-right {
|
||||||
|
margin-left: 32px;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.status {
|
||||||
|
padding: 32px;
|
||||||
|
border-top: 1px solid #dddddd;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
display: inline-block;
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.status0 {
|
||||||
|
color: #ff883c;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
background: #ff883c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.status1 {
|
||||||
|
color: #1aaaff;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
background: #1aaaff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.status2 {
|
||||||
|
color: #42d784;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
background: #42d784;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.status3 {
|
||||||
|
color: #ff4466;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
background: #ff4466;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ::v-deep .AiCard:last-child {
|
||||||
|
// padding-bottom: 24px;
|
||||||
|
// }
|
||||||
|
.pad-b120 {
|
||||||
|
background-color: #f3f6f9;
|
||||||
|
padding-bottom: 120px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
370
src/apps/AppWorkOrderXbot/Statistics.vue
Normal file
370
src/apps/AppWorkOrderXbot/Statistics.vue
Normal file
@@ -0,0 +1,370 @@
|
|||||||
|
<template>
|
||||||
|
<div class="statistics">
|
||||||
|
<AiTopFixed>
|
||||||
|
<div class="select-gird">
|
||||||
|
<AiPagePicker type="gird" v-model="selectGird" valueObj nodeKey="id" formType="2" class="right-span">
|
||||||
|
<AiMore v-model="selectGird.girdName"/>
|
||||||
|
</AiPagePicker>
|
||||||
|
</div>
|
||||||
|
</AiTopFixed>
|
||||||
|
<div class="statstics-content">
|
||||||
|
<div class="info-content">
|
||||||
|
<div class="title">概况总览</div>
|
||||||
|
<div class="el-row">
|
||||||
|
<div class="item" v-for="(item, index) in todayList" :key="index">
|
||||||
|
<h2>{{item.value}}</h2>
|
||||||
|
<p>{{item.label}}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="info-content">
|
||||||
|
<div class="title">事件办结率</div>
|
||||||
|
<div class="echart-content" id="finish"></div>
|
||||||
|
<div class="num" v-if="finishData">{{finshNum}}%</div>
|
||||||
|
<AiEmpty v-else></AiEmpty>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="info-content">
|
||||||
|
<div class="title">巡查上报趋势图</div>
|
||||||
|
<div class="echart-content" id="trend"></div>
|
||||||
|
<AiEmpty v-if="!trendData.length"></AiEmpty>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="info-content">
|
||||||
|
<div class="title">巡查事件分类
|
||||||
|
<div class="type-select" :style="statusInfo.name ? '' : 'color:#999;'" @click="show=true">{{statusInfo.name || '请选择'}}<u-icon name="arrow-right"></u-icon></div>
|
||||||
|
<u-select v-model="show" :list="$dict.getDict('clapEventStatusHistory')" value-name="dictValue" label-name="dictName" @confirm="selectStatus"></u-select>
|
||||||
|
</div>
|
||||||
|
<div class="echart-content" id="type"></div>
|
||||||
|
<AiEmpty v-if="!typeData.length"></AiEmpty>
|
||||||
|
</div>
|
||||||
|
<div class="pad-b120"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {mapState} from 'vuex'
|
||||||
|
import echarts from 'echarts'
|
||||||
|
export default {
|
||||||
|
props: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
todayList: [],
|
||||||
|
selectGird: {girdId: '', girdName: ''},
|
||||||
|
finishChart: null,
|
||||||
|
trendChart: null,
|
||||||
|
typeChart: null,
|
||||||
|
show: false,
|
||||||
|
finishData: [],
|
||||||
|
finshNum: '',
|
||||||
|
trendData: [],
|
||||||
|
trendDataX: [],
|
||||||
|
typeData: [],
|
||||||
|
statusInfo: {name: '', eventStatus: ''}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
// this.selectGird.girdName = this.user.girdName
|
||||||
|
// this.selectGird.girdId = this.user.girdId
|
||||||
|
this.$dict.load('clapEventStatusHistory').then(() => {
|
||||||
|
this.getStatistics()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getStatistics() {
|
||||||
|
this.todayList = [], this.finishData = [], this.trendDataX = [], this.trendData = [], this.typeData = []
|
||||||
|
this.$http.post(`/app/apppatrolreportinfo/countByGirdId?girdId=${this.selectGird.girdId}&eventStatus=${this.statusInfo.eventStatus}`).then((res) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.chartInit()
|
||||||
|
})
|
||||||
|
|
||||||
|
Object.keys(res.data.allCountMap).forEach((key) => {
|
||||||
|
var info = {
|
||||||
|
label: key,
|
||||||
|
value: res.data.allCountMap[key]
|
||||||
|
}
|
||||||
|
this.todayList.push(info)
|
||||||
|
})
|
||||||
|
|
||||||
|
Object.keys(res.data.finishCountMap).forEach((key) => {
|
||||||
|
var info = {
|
||||||
|
name: key,
|
||||||
|
value: res.data.finishCountMap[key]
|
||||||
|
}
|
||||||
|
this.finishData.push(info)
|
||||||
|
})
|
||||||
|
|
||||||
|
var total = Number(res.data.finishCountMap['累计事件上报'])+Number(res.data.finishCountMap['累计事件办结'])
|
||||||
|
var num = res.data.finishCountMap['累计事件办结']/total
|
||||||
|
this.finshNum = Number(num*100).toFixed(2)
|
||||||
|
|
||||||
|
res.data.dateCountList.map((item) => {
|
||||||
|
this.trendData.push(item.ecount)
|
||||||
|
this.trendDataX.push(item.ymd)
|
||||||
|
})
|
||||||
|
|
||||||
|
res.data.groupList.map((item) => {
|
||||||
|
var info = {
|
||||||
|
name: item.groupName,
|
||||||
|
value: item.totalNum
|
||||||
|
}
|
||||||
|
this.typeData.push(info)
|
||||||
|
})
|
||||||
|
|
||||||
|
this.chartInit()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
chartInit() {
|
||||||
|
this.finishChart = echarts.init(document.getElementById('finish'))
|
||||||
|
this.trendChart = echarts.init(document.getElementById('trend'))
|
||||||
|
this.typeChart = echarts.init(document.getElementById('type'))
|
||||||
|
|
||||||
|
var option = {
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'item'
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: '事件办结率',
|
||||||
|
type: 'pie',
|
||||||
|
radius: ['30%', '60%'],
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: function (colors) {
|
||||||
|
var colorList = ['#83B5F7', '#7E94F6', '#85E3D5', '#2891FF'];
|
||||||
|
return colorList[colors.dataIndex];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data: this.finishData,
|
||||||
|
emphasis: {
|
||||||
|
itemStyle: {
|
||||||
|
shadowBlur: 10,
|
||||||
|
shadowOffsetX: 0,
|
||||||
|
shadowColor: 'rgba(0, 0, 0, 0.5)',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
this.finishChart.setOption(option)
|
||||||
|
|
||||||
|
var option2 = {
|
||||||
|
grid: {
|
||||||
|
left: '5%',
|
||||||
|
right: '5%',
|
||||||
|
bottom: '3%',
|
||||||
|
containLabel: true
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
boundaryGap: false,
|
||||||
|
axisLine: {
|
||||||
|
lineStyle: {
|
||||||
|
color: '#E1E5EF', //x轴的颜色
|
||||||
|
width: 1, //轴线的宽度
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
show: true,
|
||||||
|
textStyle: {
|
||||||
|
color: '#666',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data: this.trendDataX
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
axisLine:{ //y轴
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
axisTick: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
show: true,
|
||||||
|
textStyle: {
|
||||||
|
color: '#666',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
type: 'value',
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis'
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
data: this.trendData,
|
||||||
|
type: 'line',
|
||||||
|
areaStyle: {//覆盖区域的渐变色
|
||||||
|
normal: {
|
||||||
|
color: {
|
||||||
|
type: 'linear',x: 0,y: 0,x2: 0,y2: 1,
|
||||||
|
colorStops: [
|
||||||
|
{
|
||||||
|
offset: 0, color: 'rgba(58,132,255, 0.8)' // 0% 处的颜色
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1, color: 'rgba(58,132,255, 0)' // 100% 处的颜色
|
||||||
|
}
|
||||||
|
],
|
||||||
|
global: false // 缺省为 false
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
lineStyle: {
|
||||||
|
normal: {
|
||||||
|
color: '#2891FF'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
itemStyle : {
|
||||||
|
normal : {
|
||||||
|
color:'#2891FF',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
this.trendChart.setOption(option2)
|
||||||
|
|
||||||
|
var option3 = {
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'item'
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: '巡查事件分类',
|
||||||
|
type: 'pie',
|
||||||
|
radius: ['0%', '70%'],
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: function (colors) {
|
||||||
|
var colorList = ['#2891FF', '#FF8700', '#83B5F7', '#7E94F6', '#85E3D5', '#2891FF'];
|
||||||
|
return colorList[colors.dataIndex];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data: this.typeData,
|
||||||
|
emphasis: {
|
||||||
|
itemStyle: {
|
||||||
|
shadowBlur: 10,
|
||||||
|
shadowOffsetX: 0,
|
||||||
|
shadowColor: 'rgba(0, 0, 0, 0.5)',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
this.typeChart.setOption(option3)
|
||||||
|
},
|
||||||
|
|
||||||
|
selectStatus(e) {
|
||||||
|
this.statusInfo.name = e[0].label
|
||||||
|
this.statusInfo.eventStatus = e[0].value
|
||||||
|
this.getStatistics()
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.statistics {
|
||||||
|
background-color: #F3F7F8;
|
||||||
|
|
||||||
|
.statstics-content {
|
||||||
|
padding: 30px 30px 0;
|
||||||
|
}
|
||||||
|
::v-deep .AiTopFixed {
|
||||||
|
.content {
|
||||||
|
background-color: #3975C6;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.icon-img{
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep .AiMore{
|
||||||
|
span{
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.info-content{
|
||||||
|
width: 100%;
|
||||||
|
background: #FFF;
|
||||||
|
border-radius: 16px;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
position: relative;
|
||||||
|
padding-bottom: 32px;
|
||||||
|
.title{
|
||||||
|
font-size: 32px;
|
||||||
|
font-family: PingFangSC-Regular, PingFang SC;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #333;
|
||||||
|
line-height: 48px;
|
||||||
|
padding: 24px 16px 24px 24px;
|
||||||
|
img{
|
||||||
|
float: right;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
.type-select {
|
||||||
|
font-size: 26px;
|
||||||
|
position: absolute;
|
||||||
|
top: 20px;
|
||||||
|
right: 32px;
|
||||||
|
width: calc(100% - 250px);
|
||||||
|
text-align: right;
|
||||||
|
line-height: 48px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-row{
|
||||||
|
display: flex;
|
||||||
|
padding: 32px 0 60px 0;
|
||||||
|
.item{
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
h2{
|
||||||
|
font-size: 64px;
|
||||||
|
font-family: DINAlternate-Bold, DINAlternate;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #3B424A;
|
||||||
|
line-height: 64px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
p{
|
||||||
|
font-size: 28px;
|
||||||
|
font-family: PingFangSC-Regular, PingFang SC;
|
||||||
|
color: #999;
|
||||||
|
line-height: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.echart-content {
|
||||||
|
width: 100%;
|
||||||
|
height: 500px;
|
||||||
|
}
|
||||||
|
.num {
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 320px;
|
||||||
|
margin-left: -100px;
|
||||||
|
font-size: 40px;
|
||||||
|
font-weight: 600;
|
||||||
|
width: 200px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.pad-b120{
|
||||||
|
background-color: #F3F7F8;
|
||||||
|
padding-bottom: 120px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="statistics">
|
<div class="statistics">
|
||||||
<AiTopFixed>
|
<AiTopFixed>
|
||||||
<div class="select-gird">
|
<div class="select-gird">
|
||||||
<AiPagePicker type="gird" v-model="selectGird" valueObj nodeKey="id" formType="2" class="right-span">
|
<AiPagePicker type="gird" v-model="selectGird" valueObj nodeKey="id" formType="2" class="right-span" @change="handleSelectGird">
|
||||||
<AiMore v-model="selectGird.girdName"/>
|
<AiMore v-model="selectGird.girdName"/>
|
||||||
</AiPagePicker>
|
</AiPagePicker>
|
||||||
</div>
|
</div>
|
||||||
@@ -19,24 +19,24 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="info-content">
|
<div class="info-content">
|
||||||
<div class="title">事件办结率</div>
|
<div class="title">事件办结率</div>
|
||||||
<div class="echart-content" id="finish"></div>
|
<div class="echart-content" id="finish" v-if="finishData.length && finshNum > 0"></div>
|
||||||
<div class="num" v-if="finishData">{{finshNum}}%</div>
|
<div class="num" v-if="finishData.length && finshNum > 0">{{finshNum}}%</div>
|
||||||
<AiEmpty v-else></AiEmpty>
|
<AiEmpty v-else></AiEmpty>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="info-content">
|
<div class="info-content">
|
||||||
<div class="title">巡查上报趋势图</div>
|
<div class="title">巡查上报趋势图</div>
|
||||||
<div class="echart-content" id="trend"></div>
|
|
||||||
<AiEmpty v-if="!trendData.length"></AiEmpty>
|
<AiEmpty v-if="!trendData.length"></AiEmpty>
|
||||||
|
<div class="echart-content" id="trend" v-else></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="info-content">
|
<div class="info-content">
|
||||||
<div class="title">巡查事件分类
|
<div class="title">巡查事件分类
|
||||||
<div class="type-select" :style="statusInfo.name ? '' : 'color:#999;'" @click="show=true">{{statusInfo.name || '请选择'}}<u-icon name="arrow-right"></u-icon></div>
|
<!-- <div class="type-select" :style="statusInfo.name ? '' : 'color:#999;'" @click="show=true">{{statusInfo.name || '请选择'}}<u-icon name="arrow-right"></u-icon></div> -->
|
||||||
<u-select v-model="show" :list="$dict.getDict('clapEventStatusHistory')" value-name="dictValue" label-name="dictName" @confirm="selectStatus"></u-select>
|
<u-select v-model="show" :list="$dict.getDict('clapEventStatusHistory')" value-name="dictValue" label-name="dictName" @confirm="selectStatus"></u-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="echart-content" id="type"></div>
|
|
||||||
<AiEmpty v-if="!typeData.length"></AiEmpty>
|
<AiEmpty v-if="!typeData.length"></AiEmpty>
|
||||||
|
<div class="echart-content" id="type" v-else></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pad-b120"></div>
|
<div class="pad-b120"></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -51,7 +51,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
todayList: [],
|
todayList: [],
|
||||||
selectGird: {girdId: '', girdName: ''},
|
selectGird: {id: '', girdName: ''},
|
||||||
finishChart: null,
|
finishChart: null,
|
||||||
trendChart: null,
|
trendChart: null,
|
||||||
typeChart: null,
|
typeChart: null,
|
||||||
@@ -78,7 +78,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
getStatistics() {
|
getStatistics() {
|
||||||
this.todayList = [], this.finishData = [], this.trendDataX = [], this.trendData = [], this.typeData = []
|
this.todayList = [], this.finishData = [], this.trendDataX = [], this.trendData = [], this.typeData = []
|
||||||
this.$http.post(`/app/apppatrolreportinfo/countByGirdId?girdId=${this.selectGird.girdId}&eventStatus=${this.statusInfo.eventStatus}`).then((res) => {
|
this.$http.post(`/app/apppatrolreportinfo/countByGirdId?girdId=${this.selectGird.id}&eventStatus=${this.statusInfo.eventStatus}`).then((res) => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.chartInit()
|
this.chartInit()
|
||||||
@@ -117,7 +117,9 @@ export default {
|
|||||||
this.typeData.push(info)
|
this.typeData.push(info)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.chartInit()
|
this.$nextTick(() => {
|
||||||
|
this.chartInit()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -270,6 +272,11 @@ export default {
|
|||||||
this.statusInfo.eventStatus = e[0].value
|
this.statusInfo.eventStatus = e[0].value
|
||||||
this.getStatistics()
|
this.getStatistics()
|
||||||
},
|
},
|
||||||
|
handleSelectGird(v) {
|
||||||
|
console.log(v)
|
||||||
|
this.selectGird = v || {}
|
||||||
|
this.getStatistics()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user