|
|
@@ -14,13 +14,35 @@
|
|
|
<el-dialog
|
|
|
v-model="dialogVisible"
|
|
|
width="1000px"
|
|
|
- title="dialogTitle"
|
|
|
+ title="各分数段所对应人数折线图"
|
|
|
:close-on-click-modal="true"
|
|
|
:destroy-on-close="true"
|
|
|
+ @close="dept = []"
|
|
|
center
|
|
|
>
|
|
|
- <div>各分数段所对应人数折线图</div>
|
|
|
- <!-- <LineChart :chart-data="chartData.val" :chart-lable="chartData.label" /> -->
|
|
|
+ <div>
|
|
|
+ <div class="dept-select">
|
|
|
+ <el-tree-select
|
|
|
+ v-model="dept"
|
|
|
+ :data="departmentList"
|
|
|
+ :render-after-expand="false"
|
|
|
+ :default-expand-all="true"
|
|
|
+ style="width: 200px"
|
|
|
+ multiple
|
|
|
+ show-checkbox
|
|
|
+ check-strictly
|
|
|
+ placeholder="请选择组织"
|
|
|
+ class="protocal-select"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <el-button
|
|
|
+ @click="onSearch"
|
|
|
+ type="primary"
|
|
|
+ style="width: 65px; height: 32px; margin-left: 16px"
|
|
|
+ >生成折线图
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <ScoreLineChart :chart-data="chartData.val" :chart-lable="chartData.label" />
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -30,13 +52,14 @@
|
|
|
type ScoreTableRecord,
|
|
|
type ScoreTableQueryBody,
|
|
|
getScoreTable,
|
|
|
+ getScoreChartData,
|
|
|
} from '@/api/datamanagement/dataplatform';
|
|
|
import { ref, onMounted, watch } from 'vue';
|
|
|
import { useSceneInfos } from '@/hooks/useSceneInfos';
|
|
|
import ScoreTable from '../common/ScoreTable.vue';
|
|
|
- // import LineChart from '../../charts/LineChart.vue';
|
|
|
+ import ScoreLineChart from '../../charts/ScoreLineChart.vue';
|
|
|
import { deptTreeList } from '@/api/auth/dept';
|
|
|
- // import { formatWorkshopChart, formatTimeChart } from '@/utils/platformUtils';
|
|
|
+ // import { } from '@/utils/platformUtils';
|
|
|
|
|
|
const departmentList = ref<any[]>([]);
|
|
|
|
|
|
@@ -79,6 +102,27 @@
|
|
|
deep: true,
|
|
|
},
|
|
|
);
|
|
|
+
|
|
|
+ // 折线图筛选
|
|
|
+ const dept = ref<number[]>([]);
|
|
|
+ const chartData = ref<{
|
|
|
+ label: number[];
|
|
|
+ val: any[];
|
|
|
+ }>({
|
|
|
+ label: [],
|
|
|
+ val: [],
|
|
|
+ });
|
|
|
+ const onSearch = () => {
|
|
|
+ console.log(dept.value);
|
|
|
+ const deptIdList = dept.value.join(',');
|
|
|
+ getScoreChartData(deptIdList).then((res) => {
|
|
|
+ chartData.value = {
|
|
|
+ label: res.map((item) => (item.scoreSection[0] + item.scoreSection[1]) / 2),
|
|
|
+ val: res.map((item) => item.num),
|
|
|
+ };
|
|
|
+ console.log(chartData.value.val);
|
|
|
+ });
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style scoped></style>
|