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