北尚诉办前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

218 lines
8.7 KiB

<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-news__topic}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataListSearch()">
<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.categoryLevel" placeholder="请选择">
<el-option
v-for="item in categoryLevelOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</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>
<br>
<el-form-item label="时间"
prop="startTime" label-width="70px">
<el-date-picker v-model="dataForm.startTime"
type="date"
:picker-options="pickerBeginDateBefore"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期时间"
style="width:200px">
</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="选择日期时间"
style="width:200px">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="success" @click="getDataListSearch()">{{ $t('query') }}</el-button>
</el-form-item>
</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">
<template slot-scope="scope">
<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
: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-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 () {
return {
mixinViewModuleOptions: {
getDataListURL: '/analysis/issue/pageCategoryAnalysis',
getDataListIsPage: true
},
secondVisible: false,
dataForm: {
id: '',
streetId: '',
communityId: '',
gridId: '',
sort: 'desc',
categoryLevel: '1'
},
pickerBeginDateBefore: {
disabledDate: (time) => {
let beginDateVal = this.dataForm.endTime
if (beginDateVal) {
return time.getTime() > new Date(beginDateVal + ' 00:00:00').getTime()
}
}
},
pickerBeginDateAfter: {
disabledDate: (time) => {
let EndDateVal = this.dataForm.startTime
if (EndDateVal) {
return time.getTime() < new Date(EndDateVal + ' 00:00:00').getTime()
}
}
},
ids: [],
options: [],
categoryLevelOptions: [{
value: '1',
label: '一级类目'
}, {
value: '2',
label: '二级类目'
}, {
value: '3',
label: '三季类目'
}],
sortOptions: [{
value: 'desc',
label: '议题项目总数最多'
}, {
value: 'asc',
label: '议题项目总数最少'
}]
}
},
components: {
IssueClassifiedStatisticSecond
},
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: {
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(() => {})
},
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()
})
}
}
}
</script>