Browse Source

Merge remote-tracking branch 'origin/feature/phaseOne'

origin/feature/monitoring
liuchuang 5 years ago
parent
commit
632c8df6d4
  1. BIN
      src/assets/img/issue.png
  2. BIN
      src/assets/img/project-end.png
  3. BIN
      src/assets/img/project.png
  4. BIN
      src/assets/img/superviseItem.png
  5. BIN
      src/assets/img/topic.png
  6. 71
      src/views/modules/sys/user-add-or-update.vue
  7. 95
      src/views/modules/workbench/barOption.js
  8. 113
      src/views/modules/workbench/lineOption.js
  9. 337
      src/views/modules/workbench/workbench.vue

BIN
src/assets/img/issue.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
src/assets/img/project-end.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
src/assets/img/project.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
src/assets/img/superviseItem.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
src/assets/img/topic.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

71
src/views/modules/sys/user-add-or-update.vue

@ -17,6 +17,7 @@
:label="$t('user.deptName')"
class="dept-list">
<el-popover v-model="deptListVisible"
popper-class="scroll-tree"
ref="deptListPopover"
placement="bottom-start"
trigger="click">
@ -83,6 +84,25 @@
<el-input v-model="dataForm.mobile"
:placeholder="$t('user.mobile')"></el-input>
</el-form-item>
<el-row>
<el-form-item label="头像" v-loading="loading" prop="headUrl">
<el-upload class="avatar-uploader"
:action="uploadUrl"
:show-file-list="false"
:on-success="handleAvatarActSuccess"
:on-error="handelError"
:before-upload="beforeAvatarUpload">
<img v-if="dataForm.headUrl"
:src="dataForm.headUrl"
class="avatar">
<i v-else
class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-row>
<el-form-item label="箴言" prop="proverbs">
<el-input v-model="dataForm.proverbs" placeholder="请输入内容"></el-input>
</el-form-item>
<el-form-item prop="staffName"
label="关联网格员">
<div>
@ -151,6 +171,7 @@ export default {
deptListVisible: false,
roleList: [],
roleIdListDefault: [],
uploadUrl: '',
dataForm: {
id: '',
username: '',
@ -162,6 +183,8 @@ export default {
gender: 1,
email: '',
mobile: '',
headUrl: '',
proverbs: '',
roleIdList: [],
status: 1,
verifyFlag: '0',
@ -179,7 +202,8 @@ export default {
}
},
verifyMobileList: [],
userTagDictList: []
userTagDictList: [],
loading: false
}
},
computed: {
@ -235,6 +259,9 @@ export default {
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
{ validator: validateMobile, trigger: 'blur' }
],
headUrl: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
userTagKey: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
@ -395,7 +422,19 @@ export default {
})
}).catch(() => { })
})
}, 1000, { 'leading': true, 'trailing': false })
}, 1000, { 'leading': true, 'trailing': false }),
handleAvatarActSuccess (res, file) {
this.loading = false
this.dataForm.headUrl = res.data.url
this.btnAble = false
},
beforeAvatarUpload (file) {
this.loading = true
this.btnAble = false
},
handelError () {
this.loading = false
}
}
}
</script>
@ -414,4 +453,32 @@ export default {
}
}
}
.scroll-tree {
width: 500px;
height: 600px;
overflow: auto;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 80px;
height: 80px;
line-height: 80px;
text-align: center;
}
.avatar {
width: 80px;
height: 80px;
display: block;
}
</style>

95
src/views/modules/workbench/barOption.js

@ -0,0 +1,95 @@
import echarts from 'echarts'
export default function getBarOption (xdata, ydata1, ydata2) {
return {
legend: {
data: ['用户数', '党员数'],
right: 10,
textStyle: {
color: "#666666"
},
itemWidth: 15,
itemHeight: 10,
itemGap: 25
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
grid: {
left: '2%',
top:'16%',
containLabel: true
},
xAxis: {
type: 'category',
data: xdata,
axisLine: {
lineStyle: {
color: '#cdd5e2'
}
},
axisLabel: {
textStyle: {
color: "#666666"
},
interval: 0,
rotate: 30
},
},
yAxis: {},
dataZoom: [
{
show: false,
realtime: true,
start: 0,
end: 50
},
{
type: 'inside',
realtime: true,
start: 0,
end: 50
}
],
series: [
{
name: '用户数',
type: 'bar',
barWidth: '15px',
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#e21d1b'
}, {
offset: 1,
color: '#f88e6b'
}]),
barBorderRadius: [ 6, 6, 0, 0 ]
},
},
data: ydata2
},
{
name: '党员数',
type: 'bar',
barWidth: '15px',
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#ff8705'
}, {
offset: 1,
color: '#ffb139'
}]),
barBorderRadius: [ 6, 6, 0, 0 ],
}
},
data: ydata1
}
]
}
}

113
src/views/modules/workbench/lineOption.js

@ -0,0 +1,113 @@
import echarts from 'echarts'
export default function getLineOption (xdata, ydata1, ydata2, ydata3) {
return {
legend: {
data: ['议题数', '项目数', '话题数'],
right: 10,
textStyle: {
color: "#666666"
},
itemWidth: 15,
itemHeight: 10,
itemGap: 25
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
grid: {
left: '2%',
top:'16%',
containLabel: true
},
xAxis: {
type: 'category',
data: xdata,
axisLine: {
lineStyle: {
color: '#cdd5e2'
}
},
axisLabel: {
textStyle: {
color: "#666666"
},
interval: 0,
rotate: 30
},
},
yAxis: {},
dataZoom: [
{
show: false,
realtime: true,
start: 0,
end: 50
},
{
type: 'inside',
realtime: true,
start: 0,
end: 50
}
],
series: [
{
name: '议题数',
type: 'bar',
barWidth: '15px',
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#5291ff'
}, {
offset: 1,
color: '#78aafe'
}]),
barBorderRadius: [ 6, 6, 0, 0 ]
},
},
data: ydata1
},
{
name: '项目数',
type: 'bar',
barWidth: '15px',
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#f28c68'
}, {
offset: 1,
color: '#f8b4a0'
}]),
barBorderRadius: [ 6, 6, 0, 0 ]
},
},
data: ydata2
},
{
name: '话题数',
type: 'bar',
barWidth: '15px',
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#8a79fe'
}, {
offset: 1,
color: '#aca2ff'
}]),
barBorderRadius: [ 6, 6, 0, 0 ],
}
},
data: ydata3
}
]
}
}

337
src/views/modules/workbench/workbench.vue

@ -0,0 +1,337 @@
<template>
<div class="work-bench">
<el-card shadow="never" class="aui-card--fill">
<div class="top-bar">
<div class="title"><span class="line"></span>数据汇总</div>
<div class="query">组织
<el-select v-model="selectDetpId" placeholder="全部">
<el-option
v-for="item in deptList"
:key="item.deptId"
:label="item.deptName"
:value="item.deptId">
</el-option>
</el-select>
<el-button type="primary" @click="onQuery">查询</el-button>
<el-button type="warning" @click="exportHandle()">{{ $t('export') }}</el-button>
</div>
</div>
<div class="data-list">
<div class="data-item data-item-bg-1">
<div class="item-content">
<div class="item-num">{{dataStatistics.topicNum || 0}}</div>
<div class="item-desc">
<div class="item-title">话题数</div>
<div class="sub-title">昨日 +{{dataStatistics.topicAddedYesterdayNum || 0}}</div>
</div>
</div>
</div>
<div class="data-item data-item-bg-2">
<div class="item-content">
<div class="item-num">{{dataStatistics.issueNum || 0}}</div>
<div class="item-desc">
<div class="item-title">议题数</div>
<div class="sub-title">昨日 +{{dataStatistics.issueAddedYesterdayNum || 0}}</div>
</div>
</div>
</div>
<div class="data-item data-item-bg-3">
<div class="item-content">
<div class="item-num">{{dataStatistics.itemNum || 0}}</div>
<div class="item-desc">
<div class="item-title">项目数</div>
<div class="sub-title">昨日 +{{dataStatistics.itemAddedYesterdayNum || 0}}</div>
</div>
</div>
</div>
<div class="data-item data-item-bg-4">
<div class="item-content">
<div class="item-num">{{dataStatistics.itemCaseClosedNum || 0}}</div>
<div class="item-desc">
<div class="item-title">项目结案数</div>
<div class="sub-title">昨日 +{{dataStatistics.itemCaseClosedAddedYesterdayNum || 0}}</div>
</div>
</div>
</div>
<div class="data-item data-item-bg-5">
<div class="item-content">
<div class="item-num">{{dataStatistics.superviseItemNum || 0}}</div>
<div class="item-desc">
<div class="item-title">项目结案数</div>
<div class="sub-title">昨日 +{{dataStatistics.superviseItemAddedYesterdayNum || 0}}</div>
</div>
</div>
</div>
</div>
</el-card>
<el-card shadow="never" class="aui-card--fill">
<div class="top-bar">
<div class="title"><span class="line"></span>数据排行</div>
</div>
<div class="chart-box">
<div id="chart-bar" :style="{width: '45%', height: '400px'}"></div>
<div id="chart-line" :style="{width: '45%', height: '400px'}"></div>
</div>
</el-card>
<el-card shadow="never" class="aui-card--fill">
<div class="top-bar">
<div class="title"><span class="line"></span>工作实况</div>
<div class="query">
<el-radio-group v-model="radio" size="small" @change="onRadioChange">
<el-radio-button label="yesterday">昨日</el-radio-button>
<el-radio-button label="lastWeek">上周</el-radio-button>
<el-radio-button label="lastMonth">本月</el-radio-button>
</el-radio-group>
</div>
</div>
<div class="data-table">
<el-table v-loading="dataListLoading" :data="dataList" border style="width: 100%;">
<el-table-column prop="deptName" label="组织" align="center" min-width="200px"></el-table-column>
<el-table-column prop="topicNum" label="话题数" header-align="center" align="center" min-width="200px" show-overflow-tooltip></el-table-column>
<el-table-column prop="issueNum" label="议题数" header-align="center" min-width="200px" align="center"></el-table-column>
<el-table-column prop="itemNum" label="项目数" header-align="center" align="center" min-width="200px" show-overflow-tooltip></el-table-column>
<el-table-column prop="itemCaseClosedNum" label="项目结案数" header-align="center" align="center" min-width="200px"></el-table-column>
<el-table-column prop="superviseItemNum" label="督办项目数" header-align="center" min-width="200px" align="center"></el-table-column>
</el-table>
<el-pagination :current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="page"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
</div>
</el-card>
</div>
</template>
<script>
import echarts from 'echarts'
import getBarOption from './barOption.js'
import getLineOption from './lineOption.js'
import mixinViewModule from '@/mixins/view-module'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/analysis/backstage/workStatusAnalysis',
getDataListIsPage: true,
exportURL: '/analysis/backstage/export'
},
dataForm: {
deptId: '',
dateType: 'yesterday'
},
radio: 'yesterday',
deptList: [], //
selectDetpId: '', // id
dataStatistics: {}, //
userAnalysisDepts: [],
userAnalysisPartyMemberNum: [],
userAnalysisUserNum: [],
issueItemAnalysisDepts: [],
issueItemAnalysisIssueNum: [],
issueItemAnalysisItemNum: [],
issueItemAnalysisTopicNum: [],
}
},
mounted () {
this.barChart = echarts.init(document.getElementById('chart-bar'))
this.lineChart = echarts.init(document.getElementById('chart-line'))
this.getDepts()
this.getDataStatistics()
this.getUserAnalysis()
this.getIssueItemAnalysis()
},
methods: {
//
initData () {
this.dataStatistics = {}
this.userAnalysisDepts = []
this.userAnalysisPartyMemberNum = []
this.userAnalysisUserNum = []
this.issueItemAnalysisDepts = []
this.issueItemAnalysisIssueNum = []
this.issueItemAnalysisItemNum = []
this.issueItemAnalysisTopicNum = []
},
onRadioChange () {
this.dataForm.dateType = this.radio
this.getDataList()
},
onQuery () {
this.initData()
this.dataForm.deptId = this.selectDetpId
this.dataForm.dateType = this.radio
this.getDataStatistics()
this.getUserAnalysis()
this.getIssueItemAnalysis()
this.getDataList()
},
//
getDepts () {
this.$http.get(`/analysis/backstage/depts`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.deptList = res.data
}).catch(() => { })
},
//
getDataStatistics () {
this.$http.get(`/analysis/backstage/dataStatistics?deptId=${this.selectDetpId}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataStatistics = res.data
}).catch(() => { })
},
// -
getUserAnalysis () {
this.$http.get(`/analysis/backstage/userAnalysis?deptId=${this.selectDetpId}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
if (res.data.length > 0) {
res.data.forEach(item => {
this.userAnalysisDepts.push(item.deptName)
this.userAnalysisPartyMemberNum.push(item.partyMemberNum)
this.userAnalysisUserNum.push(item.userNum)
})
setTimeout(() => {
this.barChart.setOption(getBarOption(this.userAnalysisDepts, this.userAnalysisPartyMemberNum, this.userAnalysisUserNum))
}, 500)
}
}).catch(() => { })
},
// -
getIssueItemAnalysis () {
this.$http.get(`/analysis/backstage/issueItemAnalysis?deptId=${this.selectDetpId}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
if (res.data.length > 0) {
res.data.forEach(item => {
this.issueItemAnalysisDepts.push(item.deptName)
this.issueItemAnalysisIssueNum.push(item.issueNum)
this.issueItemAnalysisItemNum.push(item.itemNum)
this.issueItemAnalysisTopicNum.push(item.topicNum)
})
setTimeout(() => {
this.lineChart.setOption(getLineOption(this.issueItemAnalysisDepts, this.issueItemAnalysisIssueNum, this.issueItemAnalysisItemNum, this.issueItemAnalysisTopicNum))
}, 500)
}
}).catch(() => { })
}
}
}
</script>
<style>
.work-bench .el-select {
margin-right: 10px;
width: 150px;
}
.work-bench .el-select .el-input__inner {
color: #FF4C52;
border: 1px solid #FF4C52;
}
.work-bench .el-select .el-input .el-select__caret {
color: #FF4C52;
}
.work-bench .el-table th {
background-color: #FF4C52;
color: #ffffff;
font-size: 22px;
}
</style>
<style scoped>
.work-bench {
}
.top-bar {
width: 100%;
height: 40px;
display: flex;
align-items: center;
justify-content: space-between;
position: relative;
}
.top-bar .title {
font-size: 22px;
color: rgb(200, 67, 69);
font-weight: 700;
}
.top-bar .title .line {
display: block;
width: 4px;
height: 20px;
background: rgb(200, 67, 69);
position: absolute;
left: -20px;
top: 10px;
}
.data-table {
margin-top: 20px;
}
.data-list {
display: flex;
align-items: center;
justify-content: space-around;
margin: 20px 0;
}
.data-list .data-item {
width: 270px;
height: 130px;
display: flex;
align-items: center;
}
.data-list .data-item-bg-1 {
background: url('~@/assets/img/topic.png') no-repeat center center;
background-size: 100% 100%;
}
.data-list .data-item-bg-2 {
background: url('~@/assets/img/issue.png') no-repeat center center;
background-size: 100% 100%;
}
.data-list .data-item-bg-3 {
background: url('~@/assets/img/project.png') no-repeat center center;
background-size: 100% 100%;
}
.data-list .data-item-bg-4 {
background: url('~@/assets/img/project-end.png') no-repeat center center;
background-size: 100% 100%;
}
.data-list .data-item-bg-5 {
background: url('~@/assets/img/superviseItem.png') no-repeat center center;
background-size: 100% 100%;
}
.data-item .item-content {
width: 50%;
margin-left: 40%;
}
.item-content .item-num {
font-size: 36px;
color: #ffffff;
}
.item-content .item-desc {
display: flex;
align-items: center;
justify-content: space-between;
color: #ffffff;
}
.chart-box {
width: 100%;
display: flex;
align-items: center;
justify-content: space-around;
}
</style>
Loading…
Cancel
Save