|
|
@@ -7,7 +7,7 @@
|
|
|
:table-data="tableData"
|
|
|
@table-params-changed="
|
|
|
(v) => {
|
|
|
- tableQueryParams = v;
|
|
|
+ tableQueryParams = _.cloneDeep(v);
|
|
|
}
|
|
|
"
|
|
|
/>
|
|
|
@@ -17,18 +17,20 @@
|
|
|
title="各分数段所对应人数折线图"
|
|
|
:close-on-click-modal="true"
|
|
|
:destroy-on-close="true"
|
|
|
- @close="dept = []"
|
|
|
+ @open="handleDialogOpen"
|
|
|
center
|
|
|
>
|
|
|
- <div>
|
|
|
+ <div class="dialog-header">
|
|
|
<div class="dept-select">
|
|
|
<el-tree-select
|
|
|
v-model="dept"
|
|
|
:data="departmentList"
|
|
|
:render-after-expand="false"
|
|
|
:default-expand-all="true"
|
|
|
- style="width: 200px"
|
|
|
+ style="width: 240px"
|
|
|
multiple
|
|
|
+ clearable
|
|
|
+ collapse-tags
|
|
|
show-checkbox
|
|
|
check-strictly
|
|
|
placeholder="请选择组织"
|
|
|
@@ -38,7 +40,7 @@
|
|
|
<el-button
|
|
|
@click="onSearch"
|
|
|
type="primary"
|
|
|
- style="width: 65px; height: 32px; margin-left: 16px"
|
|
|
+ style="width: 95px; height: 32px; margin-left: 16px"
|
|
|
>生成折线图
|
|
|
</el-button>
|
|
|
</div>
|
|
|
@@ -59,7 +61,7 @@
|
|
|
import ScoreTable from '../common/ScoreTable.vue';
|
|
|
import ScoreLineChart from '../../charts/ScoreLineChart.vue';
|
|
|
import { deptTreeList } from '@/api/auth/dept';
|
|
|
- // import { } from '@/utils/platformUtils';
|
|
|
+ import _ from 'lodash-es';
|
|
|
|
|
|
const departmentList = ref<any[]>([]);
|
|
|
|
|
|
@@ -77,12 +79,6 @@
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- // dialog显示
|
|
|
- const dialogVisible = ref(false);
|
|
|
- const onOpenScoreChart = () => {
|
|
|
- dialogVisible.value = true;
|
|
|
- };
|
|
|
-
|
|
|
// 请求表格数据
|
|
|
const tableQueryParams = ref<ScoreTableQueryBody>({
|
|
|
pageNumber: 1,
|
|
|
@@ -103,6 +99,25 @@
|
|
|
},
|
|
|
);
|
|
|
|
|
|
+ // dialog显示
|
|
|
+ const dialogVisible = ref(false);
|
|
|
+ const onOpenScoreChart = () => {
|
|
|
+ dialogVisible.value = true;
|
|
|
+ };
|
|
|
+
|
|
|
+ const handleDialogOpen = () => {
|
|
|
+ dept.value = getAllIds(departmentList.value as { value: number; children: [] }[]);
|
|
|
+ onSearch();
|
|
|
+ };
|
|
|
+
|
|
|
+ function getAllIds(list: { value: number; children: [] }[] = [], ids: number[] = []) {
|
|
|
+ for (let item of list) {
|
|
|
+ !ids.includes(item.value) && ids.push(item.value);
|
|
|
+ if (item.children && item.children.length) getAllIds(item.children, ids);
|
|
|
+ }
|
|
|
+ return ids;
|
|
|
+ }
|
|
|
+
|
|
|
// 折线图筛选
|
|
|
const dept = ref<number[]>([]);
|
|
|
const chartData = ref<{
|
|
|
@@ -113,16 +128,35 @@
|
|
|
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>
|
|
|
+<style scoped lang="scss">
|
|
|
+ :deep(.el-dialog__header) {
|
|
|
+ text-align: left;
|
|
|
+ border-bottom: 1px solid rgba(232, 232, 232, 1);
|
|
|
+ padding-bottom: 16px;
|
|
|
+ margin-bottom: 16px;
|
|
|
+ }
|
|
|
+
|
|
|
+ :deep(.el-dialog__title) {
|
|
|
+ font-weight: 600;
|
|
|
+ font-size: 16px;
|
|
|
+ color: rgba(0, 0, 0, 0.88);
|
|
|
+ line-height: 24px;
|
|
|
+ }
|
|
|
+ .dialog-header {
|
|
|
+ padding-right: 25px;
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+</style>
|