update
1.修改socket弹窗等
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="content-search">
|
||||
<div class="type-select">
|
||||
<div>
|
||||
<a-select v-model:value="selectValue" class="type-select" :options="selectOptions">
|
||||
<a-select-option value="全部数据">全部数据</a-select-option>
|
||||
</a-select>
|
||||
@@ -42,7 +42,7 @@
|
||||
import { ref, onMounted } from 'vue';
|
||||
import * as echarts from 'echarts';
|
||||
import { getClassCharts } from '/@/views/indexSun/indexSun.ts';
|
||||
import { twoLApi } from '/@/views/indexSun/indexSun.api.ts';
|
||||
import { allSecondaryDepartsApi, twoLApi } from '/@/views/indexSun/indexSun.api.ts';
|
||||
|
||||
const chooseType = ref('0');
|
||||
const selectValue = ref('all');
|
||||
@@ -52,12 +52,35 @@
|
||||
if (chooseType.value === type) return;
|
||||
chooseType.value = type;
|
||||
getData();
|
||||
// initChart();
|
||||
}
|
||||
onMounted(() => {
|
||||
getData();
|
||||
// initChart();
|
||||
if (selectOptions.value.length === 1) {
|
||||
getAllDepart();
|
||||
}
|
||||
});
|
||||
|
||||
function getAllDepart() {
|
||||
allSecondaryDepartsApi({})
|
||||
.then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
const op: any[] = res?.result
|
||||
? res.result.map((it: any) => {
|
||||
return {
|
||||
label: it.departName,
|
||||
value: it.orgCode,
|
||||
};
|
||||
})
|
||||
: [];
|
||||
selectOptions.value = selectOptions.value.concat(op);
|
||||
} else {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
const myChart = ref(null);
|
||||
function getData() {
|
||||
twoLApi({
|
||||
@@ -81,7 +104,10 @@
|
||||
value.map((item) => {
|
||||
return item.count;
|
||||
}) || [];
|
||||
let option = getClassCharts(dx, dy);
|
||||
|
||||
const max = value.sort((a, b) => b.count - a.count).length > 0 ? value.sort((a, b) => b.count - a.count)[0].count : [];
|
||||
const m = max % 25 === 0 ? max : (parseInt(max / 25) + 1) * 25;
|
||||
let option = getClassCharts(dx, dy, m);
|
||||
myChart.value.setOption(option);
|
||||
window.addEventListener('resize', () => {
|
||||
myChart.value.resize();
|
||||
@@ -123,6 +149,7 @@
|
||||
align-items: center;
|
||||
margin: 5px 10px;
|
||||
.type-select {
|
||||
width: 200px;
|
||||
}
|
||||
}
|
||||
.type-time {
|
||||
|
||||
Reference in New Issue
Block a user