Browse Source

数据总览-分类统计添加查看二(三)级分类

master
尹作梅 6 years ago
parent
commit
1a27f7f75c
  1. 191
      src/views/modules/analysis/issue/issue-classified-statistic-second.vue
  2. 49
      src/views/modules/analysis/issue/issue-classified-statistic.vue

191
src/views/modules/analysis/issue/issue-classified-statistic-second.vue

@ -0,0 +1,191 @@
<template>
<el-dialog
:visible.sync="visible"
:title="title"
:close-on-click-modal="false"
:close-on-press-escape="false">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label="所属机构">
<el-cascader v-model="ids" :options="options" :props="{ checkStrictly: true }" clearable filterable>
</el-cascader>
</el-form-item>
<el-form-item label="排序">
<el-select v-model="dataForm.sort" placeholder="请选择">
<el-option
v-for="item in sortOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<div class="block">
<el-form-item label="时间"
prop="startTime">
<el-date-picker v-model="dataForm.startTime"
type="date"
:picker-options="pickerBeginDateBefore"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<el-form-item label="至"
label-width="25px"
prop="endTime">
<el-date-picker v-model="dataForm.endTime"
type="date"
:picker-options="pickerBeginDateAfter"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
</div>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column label="序号" type="index" show-overflow-tooltip align="center" width="50"></el-table-column>
<el-table-column prop="categoryName" label="分类名称" header-align="center" align="center"></el-table-column>
<el-table-column prop="categoryNum" label="议题项目总数" header-align="center" align="center"></el-table-column>
<el-table-column prop="issueNum" label="议题数" header-align="center" align="center"></el-table-column>
<el-table-column prop="itemNum" label="项目数" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150" v-if="false">
<template slot-scope="scope">
<el-button type="text" size="small" @click="queryThirdList(scope.row.categoryName)">查看三级目录</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<!-- <issue-classified-statistic-third v-if="thirdVisible" ref="issueClassifiedStatisticThird" @refreshDataList="getDataList"></issue-classified-statistic-third> -->
</el-dialog>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
// import IssueClassifiedStatisticThird from './issue-classified-statistic-third'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/analysis/issue/pageCategoryAnalysis',
getDataListIsPage: true
},
// thirdVisible: false,
visible: false,
title: '',
dataForm: {
id: '',
streetId: '',
communityId: '',
gridId: '',
startTime: '',
endTime: '',
sort: 'desc',
categoryLevel: '',
categoryName: ''
},
pickerBeginDateBefore: {
disabledDate: (time) => {
let beginDateVal = this.dataForm.startTime
if (beginDateVal) {
return time.getTime() > new Date(beginDateVal).getTime()
}
}
},
pickerBeginDateAfter: {
disabledDate: (time) => {
let EndDateVal = this.dataForm.endTime
if (EndDateVal) {
return time.getTime() < new Date(EndDateVal).getTime()
}
}
},
ids: [],
options: [],
sortOptions: [{
value: 'desc',
label: '议题项目总数最多'
}, {
value: 'asc',
label: '议题项目总数最少'
}]
}
},
components: {
// IssueClassifiedStatisticThird
},
created: function () {
this.getOptions()
},
watch: {
'ids': function (val) {
if (val.length === 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 1) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 2) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = ''
}
if (val.length === 3) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = this.ids[2]
}
}
},
methods: {
init () {
this.visible = true
this.$nextTick(() => {
this.getDataList()
})
},
getOptions () {
this.$http.get(`/sys/user/deptOptions/getByLoginUser`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
}).catch(() => {})
}
// queryThirdList (categoryName) {
// this.thirdVisible = true
// this.$nextTick(() => {
// this.$refs.issueClassifiedStatisticThird.ids = this.ids
// this.$refs.issueClassifiedStatisticThird.dataForm.categoryName = categoryName
// this.$refs.issueClassifiedStatisticThird.dataForm.streetId = this.dataForm.streetId
// this.$refs.issueClassifiedStatisticThird.dataForm.communityId = this.dataForm.communityId
// this.$refs.issueClassifiedStatisticThird.dataForm.gridId = this.dataForm.gridId
// this.$refs.issueClassifiedStatisticThird.dataForm.startTime = this.dataForm.startTime
// this.$refs.issueClassifiedStatisticThird.dataForm.endTime = this.dataForm.endTime
// this.$refs.issueClassifiedStatisticThird.dataForm.sort = this.dataForm.sort
// this.$refs.issueClassifiedStatisticThird.dataForm.categoryLevel = '3'
// this.$refs.issueClassifiedStatisticThird.init()
// })
// }
}
}
</script>

49
src/views/modules/analysis/issue/issue-classified-statistic.vue

@ -57,13 +57,14 @@
<el-table-column prop="categoryNum" label="议题项目总数" header-align="center" align="center"></el-table-column>
<el-table-column prop="issueNum" label="议题数" header-align="center" align="center"></el-table-column>
<el-table-column prop="itemNum" label="项目数" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150" v-if="false">
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="small" @click="look(scope.row.id)">{{ $t('look') }}</el-button>
<el-button type="text" size="small" @click="querySecondList(scope.row.categoryName)" v-if="scope.row.categoryLevel==1">查看二级目录</el-button>
<el-button type="text" size="small" @click="queryThirdList(scope.row.categoryName)" v-if="scope.row.categoryLevel==2">查看三级目录</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
@ -72,12 +73,15 @@
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<issue-classified-statistic-second v-if="secondVisible" ref="issueClassifiedStatisticSecond" @refreshDataList="getDataList"></issue-classified-statistic-second>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import IssueClassifiedStatisticSecond from './issue-classified-statistic-second'
export default {
mixins: [mixinViewModule],
data () {
@ -86,7 +90,7 @@ export default {
getDataListURL: '/analysis/issue/pageCategoryAnalysis',
getDataListIsPage: true
},
closeVisible: false,
secondVisible: false,
dataForm: {
id: '',
streetId: '',
@ -135,6 +139,7 @@ export default {
}
},
components: {
IssueClassifiedStatisticSecond
},
created: function () {
this.getOptions()
@ -172,9 +177,39 @@ export default {
this.options = res.data.options
}).catch(() => {})
},
look (id) {
// this.$parent.selectComponent = 'TopicDetail'
// this.$router.push({ path: '/group-topic', query: { id: id } })
querySecondList (categoryName) {
this.secondVisible = true
this.$nextTick(() => {
this.$refs.issueClassifiedStatisticSecond.ids = this.ids
this.$refs.issueClassifiedStatisticSecond.title = this.categoryName
this.$refs.issueClassifiedStatisticSecond.dataForm.categoryName = categoryName
this.$refs.issueClassifiedStatisticSecond.dataForm.streetId = this.dataForm.streetId
this.$refs.issueClassifiedStatisticSecond.dataForm.communityId = this.dataForm.communityId
this.$refs.issueClassifiedStatisticSecond.dataForm.gridId = this.dataForm.gridId
this.$refs.issueClassifiedStatisticSecond.dataForm.startTime = this.dataForm.startTime
this.$refs.issueClassifiedStatisticSecond.dataForm.endTime = this.dataForm.endTime
this.$refs.issueClassifiedStatisticSecond.dataForm.sort = this.dataForm.sort
this.$refs.issueClassifiedStatisticSecond.dataForm.categoryLevel = '2'
this.$refs.issueClassifiedStatisticSecond.init()
})
},
queryThirdList (categoryName) {
console.log('categoryName=' + categoryName)
this.secondVisible = true
this.$nextTick(() => {
console.log(' this.ids=' + this.ids)
this.$refs.issueClassifiedStatisticSecond.ids = this.ids
this.$refs.issueClassifiedStatisticSecond.title = this.categoryName
this.$refs.issueClassifiedStatisticSecond.dataForm.categoryName = categoryName
this.$refs.issueClassifiedStatisticSecond.dataForm.streetId = this.dataForm.streetId
this.$refs.issueClassifiedStatisticSecond.dataForm.communityId = this.dataForm.communityId
this.$refs.issueClassifiedStatisticSecond.dataForm.gridId = this.dataForm.gridId
this.$refs.issueClassifiedStatisticSecond.dataForm.startTime = this.dataForm.startTime
this.$refs.issueClassifiedStatisticSecond.dataForm.endTime = this.dataForm.endTime
this.$refs.issueClassifiedStatisticSecond.dataForm.sort = this.dataForm.sort
this.$refs.issueClassifiedStatisticSecond.dataForm.categoryLevel = '3'
this.$refs.issueClassifiedStatisticSecond.init()
})
}
}
}

Loading…
Cancel
Save