|
|
@ -1,7 +1,27 @@
|
|
|
|
import { getYj } from "@/api/taicangpop/block.js";
|
|
|
|
import { getYj } from "@/api/taicangpop/block.js";
|
|
|
|
import { getxiaoqu } from "@/api/home";
|
|
|
|
import {
|
|
|
|
|
|
|
|
getxiaoqu,
|
|
|
|
|
|
|
|
getTotaldata,
|
|
|
|
|
|
|
|
echartsData,
|
|
|
|
|
|
|
|
getPersonData,
|
|
|
|
|
|
|
|
} from "@/api/home";
|
|
|
|
import { getColorList } from "@/api/taicangpop/new.js";
|
|
|
|
import { getColorList } from "@/api/taicangpop/new.js";
|
|
|
|
|
|
|
|
const order = [
|
|
|
|
|
|
|
|
"HZ",
|
|
|
|
|
|
|
|
"HL",
|
|
|
|
|
|
|
|
"HO",
|
|
|
|
|
|
|
|
"HF",
|
|
|
|
|
|
|
|
"NZ",
|
|
|
|
|
|
|
|
"NL",
|
|
|
|
|
|
|
|
"NO",
|
|
|
|
|
|
|
|
"NF",
|
|
|
|
|
|
|
|
"户籍",
|
|
|
|
|
|
|
|
"流动",
|
|
|
|
|
|
|
|
"中共党员",
|
|
|
|
|
|
|
|
"帮扶对象",
|
|
|
|
|
|
|
|
"重点人群",
|
|
|
|
|
|
|
|
"退伍军人",
|
|
|
|
|
|
|
|
];
|
|
|
|
const taicang = {
|
|
|
|
const taicang = {
|
|
|
|
state: {
|
|
|
|
state: {
|
|
|
|
yjTotal: 0,
|
|
|
|
yjTotal: 0,
|
|
|
@ -32,6 +52,16 @@ const taicang = {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
colorListL: [],
|
|
|
|
colorListL: [],
|
|
|
|
|
|
|
|
threeCell: {
|
|
|
|
|
|
|
|
houseTotal: 0,
|
|
|
|
|
|
|
|
personTotal: 0,
|
|
|
|
|
|
|
|
netTotal: 0,
|
|
|
|
|
|
|
|
buildingTotal: 0,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
pie: {
|
|
|
|
|
|
|
|
total: 0,
|
|
|
|
|
|
|
|
update: 0,
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mutations: {
|
|
|
|
mutations: {
|
|
|
|
SET_YJ_TOTAL: (state, total) => {
|
|
|
|
SET_YJ_TOTAL: (state, total) => {
|
|
|
@ -47,6 +77,20 @@ const taicang = {
|
|
|
|
state.rightTopColor
|
|
|
|
state.rightTopColor
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
SET_THREE_CELL: (state, obj) => {
|
|
|
|
|
|
|
|
state.threeCell = {
|
|
|
|
|
|
|
|
houseTotal: obj["网格户数据"],
|
|
|
|
|
|
|
|
personTotal: obj["网格人数据"],
|
|
|
|
|
|
|
|
netTotal: obj["网格总数数据"],
|
|
|
|
|
|
|
|
buildingTotal: obj["网格楼栋数据"],
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
SET_PIE: (state, obj) => {
|
|
|
|
|
|
|
|
state.pie = {
|
|
|
|
|
|
|
|
total: obj["所有户数据"],
|
|
|
|
|
|
|
|
update: obj["修改户数据"],
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
actions: {
|
|
|
|
actions: {
|
|
|
|
/**预警总数 */
|
|
|
|
/**预警总数 */
|
|
|
@ -81,13 +125,41 @@ const taicang = {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 获取户总数 /人口数 / 网格总数 / 楼栋总数
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
getThreeCell({ commit }, queryParams) {
|
|
|
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
|
|
|
getTotaldata().then((res) => {
|
|
|
|
|
|
|
|
commit("SET_THREE_CELL", res.data);
|
|
|
|
|
|
|
|
resolve();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 获取住户 / 居民 饼图数据
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
GetPie({ commit }, queryParams) {
|
|
|
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
|
|
|
if (queryParams.type == "house") {
|
|
|
|
|
|
|
|
echartsData().then((res) => {
|
|
|
|
|
|
|
|
commit("SET_PIE", res.data);
|
|
|
|
|
|
|
|
resolve();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
getPersonData().then((res) => {
|
|
|
|
|
|
|
|
commit("SET_PIE", res.data);
|
|
|
|
|
|
|
|
resolve();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
function handleColor(list, leftColor, rightTopColor) {
|
|
|
|
function handleColor(list, leftColor, rightTopColor) {
|
|
|
|
list.map((item) => {
|
|
|
|
list.map((item) => {
|
|
|
|
let isColor = /^[a-zA-Z]+$/.test(item.name);
|
|
|
|
let isColor = /^[a-zA-Z]+$/.test(item.name);
|
|
|
|
console.log(isColor);
|
|
|
|
|
|
|
|
if (isColor) {
|
|
|
|
if (isColor) {
|
|
|
|
item.color = item.name;
|
|
|
|
item.color = item.name;
|
|
|
|
for (let key in leftColor) {
|
|
|
|
for (let key in leftColor) {
|
|
|
@ -98,6 +170,12 @@ function handleColor(list, leftColor, rightTopColor) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
list = list.filter(
|
|
|
|
|
|
|
|
(obj, index, self) => index === self.findIndex((t) => t.name === obj.name)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
list.sort((a, b) => {
|
|
|
|
|
|
|
|
return order.indexOf(a.name) - order.indexOf(b.name);
|
|
|
|
|
|
|
|
});
|
|
|
|
return list;
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|