对接劳务班组出勤分析,右侧图
This commit is contained in:
parent
ecd1c51e30
commit
31df8dcfd2
@ -32,7 +32,10 @@ const form = ref({
|
||||
});
|
||||
let xData = ref([] as any);
|
||||
let yData = ref([] as any);
|
||||
const option = reactive({
|
||||
let option = ref(null as any);
|
||||
|
||||
function initOption() {
|
||||
option.value = {
|
||||
grid: {
|
||||
left: "5%",
|
||||
right: "5%",
|
||||
@ -179,10 +182,14 @@ const option = reactive({
|
||||
z: 2
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
}
|
||||
// let horizontalEcharts: any = null;
|
||||
function horizontalChart() {
|
||||
initOption();
|
||||
let horizontalEcharts = echarts.init(document.getElementById("horizontalEcharts"));
|
||||
horizontalEcharts.setOption(option);
|
||||
console.log(option.value, "绘图数据");
|
||||
horizontalEcharts.setOption(option.value);
|
||||
}
|
||||
// //选择日期
|
||||
// const onDatePicker = () => {
|
||||
@ -192,27 +199,33 @@ function horizontalChart() {
|
||||
// };
|
||||
//获取劳务班组人员数据
|
||||
const getList = async val => {
|
||||
// 清数据
|
||||
const res: any = await getWorkerInfoApi({
|
||||
projectSn: store.sn,
|
||||
enterpriseId: val
|
||||
// queryStartTime: form.queryStartTime.value,
|
||||
// queryEndTime: form.queryEndTime.value
|
||||
});
|
||||
if (res.result[0]) {
|
||||
// console.log(res.result.length,'长度')
|
||||
if (res.result.length != 0) {
|
||||
for (let index = 0; index < res.result.length; index++) {
|
||||
xData.value[index] = res.result[index].totalPersonNum;
|
||||
yData.value[index] = res.result[index].teamName;
|
||||
}
|
||||
} else {
|
||||
console.log("没有数据");
|
||||
xData.value = [];
|
||||
yData.value = [];
|
||||
}
|
||||
console.log("获取劳务班组人员数据2", res);
|
||||
// console.log("获取劳务班组人员数据2", res);
|
||||
horizontalChart();
|
||||
};
|
||||
onMounted(async () => {
|
||||
mitts.on("enterpriseId", e => {
|
||||
// horizontalEcharts = echarts.init(document.getElementById('chart-view'))
|
||||
// 清数据
|
||||
xData.value = [];
|
||||
yData.value = [];
|
||||
getList(e);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user