Browse Source

解决一些类bug

shibei_master
13176889840 4 years ago
parent
commit
ea8871d93b
  1. 134
      src/views/modules/visual/communityParty/community.vue
  2. 35
      src/views/modules/visual/communityParty/party.vue
  3. 4
      src/views/modules/visual/components/screen-table/index.vue

134
src/views/modules/visual/communityParty/community.vue

@ -6,13 +6,20 @@
src="../../../../assets/img/shuju/title-tip.png" /> src="../../../../assets/img/shuju/title-tip.png" />
<div class="title-label"> <div class="title-label">
区域化党建 区域化党建
<el-cascader
v-model="selectAgency"
:options="propTree"
:props="{ checkStrictly: true }"
:show-all-levels="false"
clearable
@change="handleCascader">
</el-cascader>
</div> </div>
</div> </div>
<div class="second-title"> <div class="second-title">
<div class="second-title-label">党建单位分类统计</div> <div class="second-title-label">党建单位分类统计</div>
<div class="second-select"> <div class="second-select">
<el-select v-model="serviceMatter" <el-select v-model="serviceMatter"
clearable
placeholder="请选择" placeholder="请选择"
@change="handleSelectChange" @change="handleSelectChange"
@clear="handleSelectChange"> @clear="handleSelectChange">
@ -31,6 +38,7 @@
end-placeholder="结束日期" end-placeholder="结束日期"
prefix-icon="el-icon-caret-bottom" prefix-icon="el-icon-caret-bottom"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
:clearable="false"
:default-time="['00:00:00', '23:59:59']" :default-time="['00:00:00', '23:59:59']"
> >
</el-date-picker> </el-date-picker>
@ -147,13 +155,15 @@ export default {
value2: '', value2: '',
timeRange: '', timeRange: '',
visibleLoading: true, visibleLoading: true,
serviceMatter: '', serviceMatter: 'all',
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
activeIndex: 0, activeIndex: 0,
activeLevel: "1", activeLevel: "1",
selectAgency: '',
unitList: [], unitList: [],
propTree: [],
partyItem: [ partyItem: [
{ {
name: '楼宇党建', name: '楼宇党建',
@ -231,33 +241,37 @@ export default {
async mounted () { async mounted () {
const { user } = this.$store.state const { user } = this.$store.state
this.agencyId = user.agencyId this.agencyId = user.agencyId
console.log('agencyId-------', this.agencyId)
this.initTime()
await nextTick(100); await nextTick(100);
await this.getAgencyList()
this.loadUnit() this.loadUnit()
this.getList(); this.getList(this.agencyId)
this.getCateCount() this.getCateCount()
this.getCateType() this.getCateType()
await this.getWorkUserInfo() await this.getWorkUserInfo()
await this.getMapUnitList() await this.getMapUnitList(this.agencyId)
}, },
watch: { watch: {
timeRange(val) { timeRange(val) {
console.log('val-www', val) console.log('val-www', val)
this.getList(); this.getList(this.agencyId);
} }
}, },
methods: { methods: {
// //
async getList () { async getList (agencyId) {
this.visibleLoading = true this.visibleLoading = true
const url = "/heart/icpartyactivity/activitylist" const url = "/heart/icpartyactivity/activitylist"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/list" // const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/list"
let params = { let params = {
agencyId: this.agencyId, agencyId,
pageSize: this.pageSize, pageSize: this.pageSize,
pageNo: this.pageNo, pageNo: this.pageNo,
serviceMatter: this.serviceMatter, serviceMatter: this.serviceMatter == 'all' ? '' : this.serviceMatter,
startTime: this.timeRange && this.timeRange[0] || '', startTime: this.timeRange && this.timeRange[0] || '',
endTime: this.timeRange && this.timeRange[1] || '' endTime: this.timeRange && this.timeRange[1] || ''
} }
@ -277,6 +291,55 @@ export default {
} }
this.visibleLoading = false this.visibleLoading = false
}, },
async getAgencyList() {
// const url = "/gov/org/customeragency/staffinagencylist";
// const url = '/gov/org/customeragency/agencygridtree'
const url = '/gov/org/customeragency/staffinagencylist'
// let params = {
// agencyId: this.$store.state.user.agencyId,
// };
const { data, code, msg } = await requestPost(url);
if (code === 0) {
console.log('data-org----o', data)
let { agencyList, subAgencyList } = data
this.selectAgency = [`${agencyList.agencyId}-${agencyList.level}`]
let arr = []
agencyList.subAgencyList = subAgencyList
arr.push(agencyList)
this.propTree = arr && this.getTreeData(arr)
} else {
this.$message.error(msg)
}
},
getTreeData(data){
if (!Array.isArray(data)) return []
let arr = data.map(item => {
let _item = {}
if (item.subAgencyList) {
if (item.subAgencyList.length === 0) {
_item = {
label: item.agencyName,
value: item.agencyId + '-' + item.level,
level: item.level,
children: undefined
}
} else _item = {
label: item.agencyName,
value: item.agencyId + '-' + item.level,
level: item.level,
children: this.getTreeData(item.subAgencyList)}
} else {
_item = {
label: item.agencyName,
value: item.agencyId + '-' + item.level,
level: item.level,
}
}
return _item
})
return arr
},
async getCateCount () { async getCateCount () {
const url = "/heart/icpartyactivity/statistics" const url = "/heart/icpartyactivity/statistics"
@ -352,7 +415,35 @@ export default {
this.$message.error(msg) this.$message.error(msg)
} }
}, },
handleCascader(val) {
console.log('val-vvv', val)
if (val.length > 0) {
const _arr = val[val.length - 1].split('-')
const orgType = _arr[1] !== 'grid' ? 'agency': 'grid'
this.getList(_arr[0])
this.getMapUnitList(_arr[0])
}
},
initTime() {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
console.log('time-rtt', this.timeFormat(start), this.timeFormat(end))
this.timeRange = [this.timeFormat(start), this.timeFormat(end)]
},
timeFormat(date) {
if (!date || typeof date === 'string') {
return false
}
var y = date.getFullYear() //
var m = date.getMonth() + 1 //
if (m < 10) m = '0' + m
var d = date.getDate() //
if (d < 10) d = '0' + d
return y + '-' + m + '-' + d + ' 00:00:00'
},
async loadUnit () { async loadUnit () {
const url = "/heart/icresidemanddict/subcodelist" const url = "/heart/icresidemanddict/subcodelist"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/option" // const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/option"
@ -365,7 +456,10 @@ export default {
if (code === 0) { if (code === 0) {
this.unitList = data this.unitList = data
this.unitList.unshift({
label: '全部',
value: 'all'
})
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
@ -419,12 +513,12 @@ export default {
// }, // },
// //
async getMapUnitList () { async getMapUnitList (agencyId) {
const url = "/heart/icpartyunit/distribution" const url = "/heart/icpartyunit/distribution"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/distribution" // const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/distribution"
let params = { let params = {
agencyId: this.agencyId agencyId
} }
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
@ -492,7 +586,7 @@ export default {
this.showedMoreInfo = true this.showedMoreInfo = true
}, },
handleSelectChange () { handleSelectChange (val) {
this.getList(); this.getList();
}, },
pageSizeChangeHandleNew (val) { pageSizeChangeHandleNew (val) {
@ -562,8 +656,22 @@ export default {
margin-right: 6px; margin-right: 6px;
} }
.title-label { .title-label {
font-size: 16px; font-size: 20px;
font-weight: 800; font-weight: 800;
::v-deep .el-input {
width: 180px;
margin-left: 10px;
.el-input__inner {
font-size: 18px;
font-weight: 800;
color: #fff;
background: transparent;
border: 0;
}
.el-icon-arrow-down::before {
content: "\e790";
}
}
} }
::v-deep .el-dropdown { ::v-deep .el-dropdown {
font-size: 16px; font-size: 16px;

35
src/views/modules/visual/communityParty/party.vue

@ -59,6 +59,7 @@
:tableData="ageList" :tableData="ageList"
:visibleLoading="visibleLoading" :visibleLoading="visibleLoading"
:operate="false" :operate="false"
@row="handleClickRow"
></screen-table> ></screen-table>
<div class="pagination"> <div class="pagination">
<el-pagination <el-pagination
@ -100,6 +101,7 @@
:tableData="eduList" :tableData="eduList"
:visibleLoading="visibleLoading" :visibleLoading="visibleLoading"
:operate="false" :operate="false"
@row="handleClickRow"
></screen-table> ></screen-table>
<div class="pagination"> <div class="pagination">
<el-pagination <el-pagination
@ -454,9 +456,17 @@ export default {
}, },
clickAgePie (seriesIndex) { clickAgePie (seriesIndex) {
let _code = '' let _code = ''
let isClick = false
this.ageItem.forEach((element, index) => { this.ageItem.forEach((element, index) => {
if (index === seriesIndex) { if (index === seriesIndex) {
_code = element.code _code = element.code
if (!this.noInit) isClick = false
else {
element.isClick = !element.isClick
isClick = element.isClick
}
element.label = { element.label = {
show: true, show: true,
@ -492,16 +502,25 @@ export default {
if (this.noInit) { if (this.noInit) {
const _arr = this.selectAgency[this.selectAgency.length - 1].split('-') const _arr = this.selectAgency[this.selectAgency.length - 1].split('-')
const orgType = _arr[1] !== 'grid' ? 'agency': 'grid' const orgType = _arr[1] !== 'grid' ? 'agency': 'grid'
this.getAgeList(_arr[0], orgType, _code) console.log('zlcm---isClick', isClick)
this.getAgeList(_arr[0], orgType, isClick && _code || '')
} }
this.noInit = true this.noInit = true
}, },
clickEduPie (seriesIndex) { clickEduPie (seriesIndex) {
let _code = '' let _code = ''
let isClick = false
this.eduItem.forEach((element, index) => { this.eduItem.forEach((element, index) => {
if (index === seriesIndex) { if (index === seriesIndex) {
_code = element.code _code = element.code
if (!this.noEduInit) isClick = false
else {
element.isClick = !element.isClick
isClick = element.isClick
}
element.label = { element.label = {
show: true, show: true,
@ -538,7 +557,7 @@ export default {
const _arr = this.selectAgency[this.selectAgency.length - 1].split('-') const _arr = this.selectAgency[this.selectAgency.length - 1].split('-')
const orgType = _arr[1] !== 'grid' ? 'agency': 'grid' const orgType = _arr[1] !== 'grid' ? 'agency': 'grid'
this.getEduList(_arr[0], orgType, _code) this.getEduList(_arr[0], orgType, isClick && _code || '')
} }
this.noEduInit = true this.noEduInit = true
@ -555,7 +574,8 @@ export default {
this.ageItem = data.map(item => { this.ageItem = data.map(item => {
return { return {
...item, ...item,
name: item.label name: item.label,
isClick: false
} }
}) })
data.forEach(item => { data.forEach(item => {
@ -576,7 +596,8 @@ export default {
this.eduItem = data.map(item => { this.eduItem = data.map(item => {
return { return {
...item, ...item,
name: item.label name: item.label,
isClick: false
} }
}) })
data.forEach(item => { data.forEach(item => {
@ -679,6 +700,12 @@ export default {
}) })
return arr return arr
}, },
handleClickRow(val) {
console.log('click-row----', val)
this.$router.push({
path: `/main-shuju/visual-basicinfo-people/${val.userId}`,
});
},
handleCascader(val) { handleCascader(val) {
console.log('val-vvv', val) console.log('val-vvv', val)
const _arr = val[val.length - 1].split('-') const _arr = val[val.length - 1].split('-')

4
src/views/modules/visual/components/screen-table/index.vue

@ -22,6 +22,7 @@
class="table-body-tr" class="table-body-tr"
v-for="(value, index) in tableData" v-for="(value, index) in tableData"
:key="index" :key="index"
@click.stop="handleClickRow(value)"
> >
<div <div
class="td" class="td"
@ -201,6 +202,9 @@ export default {
look(val) { look(val) {
console.log('look-----l', val) console.log('look-----l', val)
this.$emit('look', val) this.$emit('look', val)
},
handleClickRow(val) {
this.$emit('row', val)
} }
}, },
}; };

Loading…
Cancel
Save