Browse Source

登录联调

dev
tianq 3 years ago
parent
commit
0091231899
  1. 128
      src/views/modules/census/census-accountList.vue
  2. 207
      src/views/modules/census/census-houseList.vue

128
src/views/modules/census/census-accountList.vue

@ -39,7 +39,7 @@
placeholder="结束时间"
></el-date-picker>
</el-form-item>
<el-button class="btnSearch" size="small" @click="getTableData">查询</el-button>
<el-button class="btnSearch" size="small" @click="handleSearch">查询</el-button>
</div>
</el-form>
<div class="flex">
@ -238,7 +238,8 @@ export default {
selVoiceUrl: '',
multipleSelection: [],
TableHeight: ''
TableHeight: '',
pieData: {}
};
},
components: {
@ -265,16 +266,22 @@ export default {
this.user = this.$store.state.user;
this.agencyId = this.user.agencyId;
this.getOrgTreeList();
this.getTableData();
this.getCountLevel();
this.getPie();
this.getTableData();
this.getsubData();
// this.getPie();
},
methods: {
handleSearch(val) {
this.getCountLevel();
this.getTableData();
this.getsubData();
},
show(type) {
switch (type) {
case 1:
this.orgType = 'district';
break;
case 2:
this.orgType = 'street';
@ -286,7 +293,7 @@ export default {
this.orgType = 'sub';
break;
}
this.orgId = this.formData.orgId;
this.pageNo = 1;
this.showNext();
this.dialogVisible = true;
@ -297,67 +304,34 @@ export default {
async showNext() {
let url = '';
let param = {};
console.log('this.orgType', this.orgType);
// district street community
// 1 2 3 4
switch (this.orgType) {
case 'district':
this.title = '区县级账号登录情况';
url = '/gov/org/staffLoginLog/district-count';
param = {
orgId: this.formData.orgId,
level: this.orgType,
startDate: this.formData.startDate,
endDate: this.formData.endDate,
isPage: true,
pageNo: this.pageNo,
pageSize: this.pageSize
};
break;
case 'street':
this.title = '镇街级账号登录情况';
url = '/gov/org/staffLoginLog/street-count';
param = {
orgId: this.formData.orgId,
level: this.orgType,
startDate: this.formData.startDate,
endDate: this.formData.endDate,
isPage: true,
pageNo: this.pageNo,
pageSize: this.pageSize
};
break;
case 'community':
this.title = '社区级账号登录情况';
url = '/gov/org/staffLoginLog/community-count';
param = {
orgId: this.formData.orgId,
level: this.orgType,
startDate: this.formData.startDate,
endDate: this.formData.endDate,
isPage: true,
pageNo: this.pageNo,
pageSize: this.pageSize
};
break;
case 'sub':
this.title = this.orgName + '账号登录情况';
url = '/gov/org/staffLoginLog/sub-count';
param = {
orgId: this.orgId,
level: this.level,
startDate: this.formData.startDate,
endDate: this.formData.endDate
// isPage: true,
// pageNo: this.pageNo,
// pageSize: this.pageSize
};
break;
}
param = {
orgId: this.orgId,
level: this.orgType,
startDate: this.formData.startDate,
endDate: this.formData.endDate,
isPage: true,
pageNo: this.pageNo,
pageSize: this.pageSize
};
this.tableLoading2 = true;
const { data, code, msg } = await requestPost(url, param);
this.tableLoading2 = false;
if (code === 0) {
this.total = data.total || 0;
@ -376,9 +350,7 @@ export default {
console.log(obj);
this.formData.orgId = obj.agencyId;
this.formData.level = obj.level;
this.getTableData();
},
getOrgTreeList() {
const { user } = this.$store.state;
this.$http
@ -429,7 +401,7 @@ export default {
},
async getTableData() {
this.tableLoading = true;
this.$refs.pieChart.showLoading();
const url = '/gov/org/staffLoginLog/community-count';
// const url = 'http://yapi.elinkservice.cn/mock/356/gov/org/staffLoginLog/community-count';
@ -440,7 +412,7 @@ export default {
isPage: true,
...formData
});
this.$refs.pieChart.hideLoading();
this.tableLoading = false;
if (code === 0) {
this.total = data.total || 0;
@ -451,12 +423,30 @@ export default {
})
: [];
console.log('this.tableData ', this.tableData);
this.getPie();
} else {
this.$message.error(msg);
}
},
async getsubData() {
this.$refs.pieChart.showLoading();
let url = '/gov/org/staffLoginLog/sub-count';
let param = {
orgId: this.formData.orgId,
level: this.formData.level,
startDate: this.formData.startDate,
endDate: this.formData.endDate
};
const { data, code, msg } = await requestPost(url, param);
this.$refs.pieChart.hideLoading();
if (code === 0) {
this.pieData = data.list;
console.log('this.pieData ', this.pieData);
this.getPie();
} else {
this.$message.error(msg);
}
},
handleSizeChange(val) {
this.pageSize = val;
window.localStorage.setItem('pageSize', val);
@ -490,30 +480,31 @@ export default {
}
},
setPieData() {
let data = [...this.tableData];
let PieData = {};
PieData.name = data.map(item => item.agencyName);
PieData.data = data.map(item => {
let data = [...this.pieData];
console.log('data', data);
let chartData = {};
chartData.name = data.map(item => item.agencyName);
chartData.data = data.map(item => {
return { value: item.count, id: item.agencyId, level: item.agencyLevel, name: item.agencyName };
});
console.log(PieData);
this.iniPieChart(PieData);
console.log('chartData', chartData);
this.iniPieChart(chartData);
},
//
async iniPieChart(PieData) {
async iniPieChart(chartData) {
this.$refs.pieChart.clear();
// pieChart
this.pieOption = {
xAxis: {
type: 'category',
data: PieData.name
data: chartData.name
},
yAxis: {
type: 'value'
},
series: [
{
data: PieData.data,
data: chartData.data,
type: 'bar',
itemStyle: {
color: 'rgb(33, 149, 254)'
@ -524,10 +515,13 @@ export default {
this.$refs.pieChart.setOption(this.pieOption);
},
handelClickMyPei(param) {
this.show(4);
this.level = param.level;
this.orgId = param.id;
this.orgName = param.name;
console.log(param);
this.orgType = param.data.level;
this.orgId = param.data.id;
this.orgName = param.data.name;
this.pageNo = 1;
this.showNext();
this.dialogVisible = true;
}
}
};

207
src/views/modules/census/census-houseList.vue

@ -75,7 +75,7 @@
:header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }"
class="table"
style="width: 100%"
:height="maxTableHeight"
:height="TableHeight"
>
<el-table-column label="序号" fixed="left" type="index" align="center" width="50" />
<el-table-column prop="streetName" label="镇街" align="center" :show-overflow-tooltip="true" />
@ -92,7 +92,7 @@
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-sizes="[10, 20, 50, 100, 200]"
:page-size="parseInt(pageSize)"
layout="sizes, prev, pager, next, total"
:total="total"
@ -115,7 +115,6 @@ import axios from 'axios';
export default {
components: { screenEchartsFrame, screenEchartsFrame2 },
data() {
let endDisabledDate = time => {
//datareturn
@ -132,64 +131,42 @@ export default {
let nowData = Date.now();
return time.getTime() > nowData;
};
return {
tableLoading: false,
pageType: 'list', // list add dispose info
user: {},
agencyId: '',
gridList: [], //list--
agencyIdArray: [],
orgOptions: [],
orgOptionProps: {
multiple: false,
value: 'agencyId',
label: 'agencyName',
children: 'subAgencyList',
checkStrictly: true
},
tableData: [],
formData: {
gridId: '',
agencyId: '',
sourceType: '',
eventContent: '',
name: '',
mobile: '',
startTime: '',
endTime: '',
status: '',
firstIdList: [],
secondIdList: []
},
cateOptions: [],
eventTypeCheck: [],
formData: {},
pageNo: 1,
pageSize: window.localStorage.getItem('pageSize') || 20,
total: 1,
endPickerOptions: {
//
disabledDate: endDisabledDate
},
startPickerOptions: {
//
disabledDate: startDisabledDate
},
eventId: '',
eventDetailData: {},
showVoice: false,
selVoiceUrl: '',
multipleSelection: [],
agencyId: '', //
agencyIdArray: [], //
orgOptions: [], //
orgOptionProps: {
//
multiple: false,
value: 'agencyId',
label: 'agencyName',
children: 'subAgencyList',
checkStrictly: true
},
TableHeight: ''
};
},
computed: {
maxTableHeight() {
return this.$store.state.inIframe ? this.clientHeight - 440 + this.iframeHeigh : this.clientHeight - 440;
this.TableHeight = this.$store.state.inIframe ? this.clientHeight - 460 + this.iframeHeigh : this.clientHeight - 460;
return this.TableHeight;
},
...mapGetters(['clientHeight', 'iframeHeight'])
},
watch: {
@ -203,52 +180,49 @@ export default {
mounted() {
console.log(this.$store.state);
this.user = this.$store.state.user;
this.agencyId = this.user.agencyId;
this.getOrgTreeList();
this.getTableData();
},
methods: {
handleChangeAgency(val) {
let obj = this.$refs['myCascader'].getCheckedNodes()[0].data;
if (obj) {
if (obj.level === 'grid') {
this.formData.gridId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '';
this.formData.agencyId = '';
} else {
this.formData.agencyId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '';
this.formData.gridId = '';
}
} else {
this.formData.agencyId = '';
this.formData.gridId = '';
}
},
handleSearch(val) {
console.log(this.formData);
this.pageNo = 1;
this.getTableData();
},
async getTableData() {
this.tableLoading = true;
// const url = '/gov/org/staffLoginLog/community-count';
const url = 'http://yapi.elinkservice.cn/mock/356/gov/org/staffLoginLog/community-count';
getOrgTreeList() {
const { user } = this.$store.state;
this.$http
.post('/gov/org/customeragency/agencygridtree', {})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
console.log('获取组织树成功', res.data);
this.orgOptions = [];
this.orgOptions.push(res.data);
}
})
.catch(() => {
return this.$message.error('网络错误');
});
},
const { pageSize, pageNo, formData } = this;
const { data, code, msg } = await requestPost(url, {
pageSize,
pageNo,
...formData
});
this.tableLoading = false;
if (code === 0) {
this.total = data.total || 0;
this.tableData = data.list
? data.list.map(item => {
return item;
})
: [];
} else {
this.$message.error(msg);
}
},
handleSizeChange(val) {
this.pageSize = val;
window.localStorage.setItem('pageSize', val);
this.getTableData();
},
handleCurrentChange(val) {
this.pageNo = val;
this.getTableData();
},
async handleExport() {
const url = '/gov/project/icEvent/export';
const { pageSize, pageNo, formData } = this;
@ -281,65 +255,38 @@ export default {
return this.$message.error('网络错误');
});
},
//
async handleDispose(row) {
this.eventId = row.icEventId;
const url = '/gov/project/icEvent/detail';
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/icEvent/detail";
const { data, code, msg } = await requestPost(url, {
icEventId: this.eventId
});
if (code === 0) {
this.eventDetailData = { ...data };
this.pageType = 'dispose';
} else {
this.$message.error(msg);
}
},
async getCountLevel() {
// const url = '/gov/org/staffLoginLog/count-level';
const url = 'http://yapi.elinkservice.cn/mock/356/gov/org/staffLoginLog/count-level';
let param = {};
getOrgTreeList() {
const { user } = this.$store.state;
this.$http
.post('/gov/org/customeragency/agencygridtree', {})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
console.log('获取组织树成功', res.data);
this.orgOptions = [];
this.orgOptions.push(res.data);
}
})
.catch(() => {
return this.$message.error('网络错误');
});
},
async getTableData() {
this.tableLoading = true;
// const url = '/gov/org/staffLoginLog/community-count';
const url = 'http://yapi.elinkservice.cn/mock/356/gov/org/staffLoginLog/community-count';
const { pageSize, pageNo, formData } = this;
const { data, code, msg } = await requestPost(url, {
pageSize,
pageNo,
...formData
});
this.tableLoading = false;
if (code === 0) {
this.total = data.total || 0;
this.tableData = data.list
? data.list.map(item => {
return item;
})
: [];
handleChangeAgency(val) {
let obj = this.$refs['myCascader'].getCheckedNodes()[0].data;
if (obj) {
if (obj.level === 'grid') {
this.formData.gridId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '';
this.formData.agencyId = '';
} else {
this.formData.agencyId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '';
this.formData.gridId = '';
}
} else {
this.$message.error(msg);
this.formData.agencyId = '';
this.formData.gridId = '';
}
},
handleSizeChange(val) {
this.pageSize = val;
window.localStorage.setItem('pageSize', val);
this.getTableData();
},
handleCurrentChange(val) {
this.pageNo = val;
this.getTableData();
},
deepTree(arr, child) {
if (Array.isArray(arr) && arr.length > 0) {
return arr.map(item => {

Loading…
Cancel
Save