This commit is contained in:
shijing 2021-10-20 15:50:34 +08:00
parent 76d1142741
commit 8db20b3f0f
7 changed files with 63 additions and 20 deletions

View File

@ -19,7 +19,7 @@ export default {
}
},
mounted(){
this.$store.dispatch("user/getCount", {})
// this.$store.dispatch("user/getCount", {})
this.timer = window.setInterval(() => {
setTimeout(() => {
this.$store.dispatch("user/getCount", {})

View File

@ -6,8 +6,8 @@
<div class="right-menu">
<template>
<el-badge v-if="count>0" :value="count" class="item right-menu-item navbarBadge" @click.native="gotoTicketPage">
<el-icon class="el-icon-s-management" @click.native="gotoTicketPage" style="font-size: 25px;color: #409EFF;padding-top: 12px;cursor: pointer;"></el-icon>
<el-badge v-if="count.total_count>0" :value="count.total_count" class="item right-menu-item navbarBadge" @click.native="gotoTicketPage">
<el-icon class="el-icon-s-management" style="font-size: 25px;color: #409EFF;padding-top: 12px;cursor: pointer;"></el-icon>
</el-badge>
<search id="header-search" class="right-menu-item" />
<el-tooltip content="全局组件大小" effect="dark" placement="bottom">
@ -77,8 +77,12 @@ export default {
},
methods: {
gotoTicketPage(){
debugger;
this.$router.push({name:'ticket',params:{}})
let path = this.$route.path;
if(path==='/workflow/ticket'){
this.$message.success("已在当前页面");
}else{
this.$router.push({name:'ticket',params:{}})
}
},
toggleSideBar() {
this.$store.dispatch('app/toggleSideBar')

View File

@ -9,10 +9,13 @@
</div>
<app-main />
<div class="floatDiv" @click="gotoTicketPage" v-if="count>0">
<el-badge :value="count" class="item ">
<div class="floatDiv" @click="gotoTicketPage" v-if="count.total_count>0">
<el-badge :value="count.total_count" class="item ">
<el-icon class="el-icon-s-management" style="font-size: 30px;color: #409EFF;padding-top: 12px;"></el-icon>
</el-badge>
<div class="typeWrap">
<div class="detailItem" v-for="item in count.details" :key="item.workflow">{{item.workflow__name}}{{item.count}}</div>
</div>
</div>
</div>
</div>
@ -58,8 +61,14 @@ export default {
handleClickOutside() {
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
},
gotoTicketPage(){
this.$router.push({name:'ticket',params:{}})
let path = this.$route.path;
if(path==='/workflow/ticket'){
this.$message.success("已在当前页面");
}else{
this.$router.push({name:'ticket',params:{}})
}
},
}
}
@ -118,4 +127,22 @@ export default {
border-radius: 26px;
border: 2px solid #409EFF;
}
.typeWrap{
display: none;
background: #ffffff;
padding: 10px;
box-shadow: 0 0 7px 2px #d3dce6;
position: absolute;
right: 60px;
bottom: 0;
}
.floatDiv:hover>.typeWrap{
display: block;
}
.detailItem{
height: 30px;
color: #888888;
line-height: 30px;
width: max-content;
}
</style>

View File

@ -8,7 +8,7 @@ const getDefaultState = () => {
token: getToken(),
name: '',
avatar: '',
count: '',
count: {},
perms: []
}
}
@ -110,7 +110,7 @@ const actions = {
getCount({ commit }) {
return new Promise((resolve, reject) => {
getCount({}).then((res) => {
commit('SET_COUNT', res.data.total_count);
commit('SET_COUNT', res.data);
resolve()
}).catch(error => {
reject(error)

View File

@ -1,7 +1,7 @@
<template>
<div class="dashboard-container">
<el-badge v-if="count>0" :value="count" class="item" @click.native="gotoTicketPage">
<el-icon class="el-icon-s-management" @click.native="gotoTicketPage" style="font-size: 70px;color: #d29898"></el-icon>
<el-badge v-if="count.total_count>0" :value="count.total_count" class="item" @click.native="gotoTicketPage">
<el-icon class="el-icon-s-management" style="font-size: 70px;color: #d29898"></el-icon>
</el-badge>
<div></div>
<div class="dashboard-text">name: {{ name }}</div>
@ -23,8 +23,12 @@ export default {
},
methods:{
gotoTicketPage(){
debugger;
this.$router.push({name:'ticket',params:{}})
let path = this.$route.path;
if(path==='/workflow/ticket'){
this.$message.success("已在当前页面");
}else{
this.$router.push({name:'ticket',params:{}})
}
},
}
}

View File

@ -29,12 +29,15 @@
</el-card>
<el-tabs v-model="pageForm.category" type="border-card" @tab-click="handleClick">
<el-tab-pane label="待处理" name="duty">
<el-table :data="tickets"
border fit stripe
style="width: 100%"
height="100"
highlight-current-row
v-el-height-adaptive-table="{bottomOffset: 60}">
<el-table
v-loading="listLoading"
:data="tickets"
border fit stripe
style="width: 100%"
height="100"
highlight-current-row
v-el-height-adaptive-table="{bottomOffset: 100}"
>
<el-table-column label="工单标题" min-width="100" prop="title">
</el-table-column>
<el-table-column label="当前状态" min-width="100">
@ -615,6 +618,7 @@
ticketRetreat(this.retreatId,this.handleForm).then(res=>{
this.limitedRetreat = false;
this.getList();
this.$store.dispatch("user/getCount", {})
this.$message.success("成功");
})
})
@ -631,6 +635,7 @@
ticketClose(this.retreatId,this.handleForm).then(res=>{
this.limitedRetreat = false;
this.getList();
this.$store.dispatch("user/getCount", {})
this.$message.success("成功");
})
})

View File

@ -517,6 +517,7 @@
console.log(this.ticketForm);
ticketHandle(this.ticketId,obj).then(res=>{
if (res.data){
this.$store.dispatch("user/getCount", {})
this.$router.replace({name:"ticket"})
}
})
@ -544,6 +545,7 @@
.then(async () => {
url(this.ticketId,this.handleForm).then(res=>{
this.limitedHandle = false;
this.$store.dispatch("user/getCount", {})
this.$router.replace({name:"ticket"})
this.$message.success("成功");
})
@ -579,6 +581,7 @@
this.limitedAdd = false;
this.$nextTick(function () {
this.limitedAdd = true;
this.$store.dispatch("user/getCount", {})
this.$router.replace({name:"ticket"})
})