![]()
0) {
- let info = data[0];
- this.info = { ...this.info, ...info };
+ if (code === 0) {
+ if (data && Array.isArray(data) && data.length > 0) {
+ let info = data[0];
+ this.info = { ...this.info, ...info };
+ } else {
+ this.info = {
+ resident_count: 0,
+ inhabitant_count: 0,
+ floating_count: 0,
+ };
+ }
} else {
this.$message.error(msg);
}
@@ -232,8 +240,11 @@ export default {
const { info } = this;
// 设置三个配置值
this.pieOption.title.text =
- parseInt((100 * info.inhabitant_count) / info.resident_count) +
- "%";
+ (info.resident_count != 0
+ ? parseInt(
+ (100 * info.inhabitant_count) / info.resident_count
+ )
+ : "--") + "%";
this.pieData = [
{ value: info.inhabitant_count, name: "常住人口" },
{ value: info.floating_count, name: "流动人口" },
@@ -249,13 +260,16 @@ export default {
fromActionPayload: { dataIndexInside },
} = params;
this.pieOption.title.text =
- parseInt(
- (100 *
- [info.inhabitant_count, info.floating_count][
- dataIndexInside
- ]) /
- info.resident_count
- ) + "%";
+ (info.resident_count != 0
+ ? parseInt(
+ (100 *
+ [
+ info.inhabitant_count,
+ info.floating_count,
+ ][dataIndexInside]) /
+ info.resident_count
+ )
+ : "--") + "%";
this.$refs.pieChart.myChart.setOption(this.pieOption);
});
},
@@ -273,24 +287,26 @@ export default {
},
},
{
- mockId: 60389779,
+ // mockId: 60389779,
}
);
- if (code === 0 && data && Array.isArray(data) && data.length > 0) {
- let xaxis = [];
- let series = [{ data: [] }, { data: [] }];
- for (const {
- month,
- inhabitant_count,
- floating_count,
- } of data) {
- xaxis.push(month);
- series[0].data.push(inhabitant_count);
- series[1].data.push(floating_count);
+ if (code === 0) {
+ if (data && Array.isArray(data) && data.length > 0) {
+ let xaxis = [];
+ let series = [{ data: [] }, { data: [] }];
+ for (const {
+ month,
+ inhabitant_count,
+ floating_count,
+ } of data) {
+ xaxis.push(month);
+ series[0].data.push(inhabitant_count);
+ series[1].data.push(floating_count);
+ }
+ this.iniBarChart(xaxis, series);
+ this.$refs.barChart.hideLoading();
}
- this.iniBarChart(xaxis, series);
- this.$refs.barChart.hideLoading();
} else {
this.$message.error(msg);
}
diff --git a/src/views/dataBoard/renfang/cpts/rkfx.vue b/src/views/dataBoard/renfang/cpts/rkfx.vue
index b6110fc79..6715005ab 100644
--- a/src/views/dataBoard/renfang/cpts/rkfx.vue
+++ b/src/views/dataBoard/renfang/cpts/rkfx.vue
@@ -149,14 +149,16 @@ export default {
},
},
{
- mockId: 60041615,
+ // mockId: 60041615,
}
);
this.$refs.pieChart.hideLoading();
- if (code === 0 && data && Array.isArray(data) && data.length > 0) {
- let info = data[0];
- this.info = { ...this.info, ...info };
+ if (code === 0) {
+ if (data && Array.isArray(data) && data.length > 0) {
+ let info = data[0];
+ this.info = { ...this.info, ...info };
+ }
} else {
this.$message.error(msg);
}
@@ -191,12 +193,12 @@ export default {
if (currentTab == "性别") {
this.pieData = [
{
- value: info.male_count,
+ value: info.male_count || 0,
type: "male_count",
name: "男性",
},
{
- value: info.female_count,
+ value: info.female_count || 0,
type: "female_count",
name: "女性",
},
@@ -204,12 +206,12 @@ export default {
} else if (currentTab == "户籍") {
this.pieData = [
{
- value: info.local_count,
+ value: info.local_count || 0,
type: "local_count",
name: "本地户籍",
},
{
- value: info.field_count,
+ value: info.field_count || 0,
type: "field_count",
name: "外地户籍",
},
@@ -217,17 +219,17 @@ export default {
} else if (currentTab == "人户状况") {
this.pieData = [
{
- value: info.resi_y_house_y_count,
+ value: info.resi_y_house_y_count || 0,
type: "resi_y_house_y_count",
name: "人户一致",
},
{
- value: info.resi_y_house_n_count,
+ value: info.resi_y_house_n_count || 0,
type: "resi_y_house_n_count",
name: "人在户不在",
},
{
- value: info.resi_n_house_y_count,
+ value: info.resi_n_house_y_count || 0,
type: "resi_n_house_y_count",
name: "户在人不在",
},
@@ -235,27 +237,27 @@ export default {
} else if (currentTab == "年龄") {
this.pieData = [
{
- value: info.age50_count,
+ value: info.age50_count || 0,
type: "age50_count",
name: "50岁以下",
},
{
- value: info.age5059_count,
+ value: info.age5059_count || 0,
type: "age5059_count",
name: "50-59岁",
},
{
- value: info.age6069_count,
+ value: info.age6069_count || 0,
type: "age6069_count",
name: "60-69岁",
},
{
- value: info.age7079_count,
+ value: info.age7079_count || 0,
type: "age7079_count",
name: "70-79岁",
},
{
- value: info.age80_count,
+ value: info.age80_count || 0,
type: "age80_count",
name: "80岁以上",
},
@@ -263,47 +265,47 @@ export default {
} else if (currentTab == "志愿者类别") {
this.pieData = [
{
- value: info.culture_count,
+ value: info.culture_count || 0,
type: "culture_count",
name: "文化队伍",
},
{
- value: info.committee_count,
+ value: info.committee_count || 0,
type: "committee_count",
name: "楼委会",
},
{
- value: info.capable_count,
+ value: info.capable_count || 0,
type: "capable_count",
name: "能人达人",
},
{
- value: info.friend_count,
+ value: info.friend_count || 0,
type: "friend_count",
name: "老友俱乐部",
},
{
- value: info.agent_count,
+ value: info.agent_count || 0,
type: "agent_count",
name: "代办员",
},
{
- value: info.mediator_count,
+ value: info.mediator_count || 0,
type: "mediator_count",
name: "调解员",
},
{
- value: info.collector_count,
+ value: info.collector_count || 0,
type: "collector_count",
name: "采集员",
},
{
- value: info.security_count,
+ value: info.security_count || 0,
type: "security_count",
name: "治安巡逻员",
},
{
- value: info.party_mem_count,
+ value: info.party_mem_count || 0,
type: "party_mem_count",
name: "党员中心户",
},
@@ -311,42 +313,42 @@ export default {
} else if (currentTab == "党员文化程度") {
this.pieData = [
{
- value: info.primary_count,
+ value: info.primary_count || 0,
type: "primary_count",
name: "小学及文盲",
},
{
- value: info.junior_high_count,
+ value: info.junior_high_count || 0,
type: "junior_high_count",
name: "初中",
},
{
- value: info.second_speci_count,
+ value: info.second_speci_count || 0,
type: "second_speci_count",
name: "中专",
},
{
- value: info.high_school_count,
+ value: info.high_school_count || 0,
type: "high_school_count",
name: "高中",
},
{
- value: info.junior_college_count,
+ value: info.junior_college_count || 0,
type: "junior_college_count",
name: "大专",
},
{
- value: info.undergrad_count,
+ value: info.undergrad_count || 0,
type: "undergrad_count",
name: "本科",
},
{
- value: info.master_count,
+ value: info.master_count || 0,
type: "master_count",
name: "硕士",
},
{
- value: info.doctor_count,
+ value: info.doctor_count || 0,
type: "doctor_count",
name: "博士",
},
diff --git a/src/views/dataBoard/renfang/cpts/rkyj.vue b/src/views/dataBoard/renfang/cpts/rkyj.vue
index 7999c1bff..9de02d590 100644
--- a/src/views/dataBoard/renfang/cpts/rkyj.vue
+++ b/src/views/dataBoard/renfang/cpts/rkyj.vue
@@ -102,6 +102,12 @@ export default {
mounted() {
this.getList();
},
+
+ watch: {
+ orgId() {
+ this.getList();
+ },
+ },
methods: {
toListPage(level, type_id = "", type_name) {
this.$router.push({
@@ -126,12 +132,14 @@ export default {
},
},
{
- mockId: 60040087,
+ // mockId: 60040087,
}
);
- if (code === 0 && data && Array.isArray(data) && data.length > 0) {
- this.list = data;
+ if (code === 0) {
+ if (data && Array.isArray(data) && data.length > 0) {
+ this.list = data;
+ }
} else {
this.$message.error(msg);
}
diff --git a/src/views/dataBoard/renfang/cpts/szsq.vue b/src/views/dataBoard/renfang/cpts/szsq.vue
index b2a767e4a..7b42cf36c 100644
--- a/src/views/dataBoard/renfang/cpts/szsq.vue
+++ b/src/views/dataBoard/renfang/cpts/szsq.vue
@@ -97,17 +97,19 @@ export default {
},
},
{
- mockId: 61305622,
+ // mockId: 61305622,
}
);
- if (code === 0 && data && Array.isArray(data) && data.length > 0) {
- let info = data[0];
- this.info.community_count = info.community_count;
- this.info.account_count = info.account_count;
- this.info.per = parseInt(
- (100 * info.account_count) / info.community_count
- );
+ if (code === 0) {
+ if (data && Array.isArray(data) && data.length > 0) {
+ let info = data[0];
+ this.info.community_count = info.community_count;
+ this.info.account_count = info.account_count;
+ this.info.per = parseInt(
+ (100 * info.account_count) / info.community_count
+ );
+ }
} else {
this.$message.error(msg);
}
diff --git a/src/views/dataBoard/renfang/house/list.vue b/src/views/dataBoard/renfang/house/list.vue
index 9be4bfbf9..4c943ec90 100644
--- a/src/views/dataBoard/renfang/house/list.vue
+++ b/src/views/dataBoard/renfang/house/list.vue
@@ -76,7 +76,7 @@ export default {
houseType: "", // 流动 常驻 全部
loading: true,
- pageSize: 10,
+ pageSize: parseInt(localStorage.getItem("dataBoard_PageSize")) || 20,
pageNo: 1,
total: 0,
srcTableData: [],
@@ -158,6 +158,7 @@ export default {
const type_name = getQueryPara("type_name");
this.breadList[1].meta.title = type_name + "房屋列表";
this.tableTitle = type_name + "房屋列表";
+ this.pageNo = 1;
this.getList();
this.getCount();
},
@@ -182,6 +183,7 @@ export default {
},
handleSizeChange(pageSize) {
+ localStorage.setItem('dataBoard_PageSize', pageSize);
this.pageSize = pageSize;
this.getList();
},
@@ -203,7 +205,7 @@ export default {
},
},
{
- mockId: 60068051,
+ // mockId: 60068051,
}
);
@@ -235,7 +237,7 @@ export default {
}
},
- async getList() {
+ async getCount() {
const { org_id, houseType, pageNo, pageSize } = this;
const url = "house_list_total";
@@ -251,12 +253,12 @@ export default {
},
},
{
- mockId: 63070189,
+ // mockId: 63070189,
}
);
if (code === 0) {
- this.total = data[0].count;
+ this.total = parseInt(data[0].count);
} else {
this.$message.error(msg);
}
diff --git a/src/views/dataBoard/renfang/index.vue b/src/views/dataBoard/renfang/index.vue
index 8a7d90acb..97f89d650 100644
--- a/src/views/dataBoard/renfang/index.vue
+++ b/src/views/dataBoard/renfang/index.vue
@@ -13,7 +13,7 @@