1
This commit is contained in:
@@ -123,7 +123,7 @@ export function useTable(options?: BasicTableProps) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 覆盖默认值
|
// 覆盖默认值
|
||||||
const state = mergeDefaultOptions(defaultOptions, options);
|
const state = mergeDefaultOptions(defaultOptions, options || {});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发起分页查询,并设置表格数据和分页信息
|
* 发起分页查询,并设置表格数据和分页信息
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mod-config">
|
<div >
|
||||||
<basic-container>
|
|
||||||
<el-form :inline="true" :model="dataForm" @keyup.enter="handleFilter" ref="searchFormRef">
|
<el-form :inline="true" :model="dataForm" @keyup.enter="handleFilter" ref="searchFormRef">
|
||||||
<el-form-item label="招生计划" prop="groupId">
|
<el-form-item label="招生计划" prop="groupId">
|
||||||
<el-select v-model="dataForm.groupId" filterable placeholder="请选择招生计划" size="small">
|
<el-select v-model="dataForm.groupId" filterable placeholder="请选择招生计划" >
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in planList"
|
v-for="item in planList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@@ -14,10 +13,10 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button icon="Search" type="primary" size="small"
|
<el-button icon="Search" type="primary"
|
||||||
@click="handleFilter">查询
|
@click="handleFilter">查询
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button icon="Delete" type="default" plain size="small"
|
<el-button icon="Delete" type="default" plain
|
||||||
@click="resetForm">清空
|
@click="resetForm">清空
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -27,27 +26,24 @@
|
|||||||
<el-button icon="Download" type="warning" size="small" @click="dataExportHandle">导出</el-button>
|
<el-button icon="Download" type="warning" size="small" @click="dataExportHandle">导出</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div class="avue-crud">
|
|
||||||
<el-table :data="dataList" border stripe v-loading="dataListLoading"
|
<el-table :data="dataList" border stripe v-loading="dataListLoading"
|
||||||
:summary-method="getSummaries" show-summary
|
:summary-method="getSummaries" show-summary height="700"
|
||||||
>
|
>
|
||||||
<el-table-column align="center" header-align="center" prop="provinceName" label="省市" />
|
<el-table-column align="center" header-align="center" prop="provinceName" label="省市" />
|
||||||
<el-table-column align="center" header-align="center" prop="peopleNum" label="人数" />
|
<el-table-column align="center" header-align="center" prop="peopleNum" label="人数" />
|
||||||
<el-table-column align="center" header-align="center" prop="peopleRate" label="占比" />
|
<el-table-column align="center" header-align="center" prop="peopleRate" label="占比" />
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<chart ref="typeEchartBarRef" style="width:100%;margin-top:80px" :options="chartOption" theme="macarons"></chart>
|
<!-- <chart ref="typeEchartBarRef" style="width:100%;margin-top:80px" :options="chartOption" theme="macarons"></chart>-->
|
||||||
|
|
||||||
</div>
|
|
||||||
</basic-container>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted } from 'vue'
|
import { ref, reactive, onMounted } from 'vue'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { getAreaStatic } from "@/api/recruit/recruitstudentsignup"
|
import { getAreaStatic } from '/@/api/recruit/recruitstudentsignup'
|
||||||
import { getList } from "@/api/recruit/recruitstudentplangroup"
|
import { getList } from '/@/api/recruit/recruitstudentplangroup'
|
||||||
|
|
||||||
// 响应式数据
|
// 响应式数据
|
||||||
const dataForm = reactive({
|
const dataForm = reactive({
|
||||||
@@ -65,11 +61,13 @@ const typeEchartBarRef = ref()
|
|||||||
// 初始化
|
// 初始化
|
||||||
const init = () => {
|
const init = () => {
|
||||||
getList().then((data: any) => {
|
getList().then((data: any) => {
|
||||||
planList.value = data.data
|
planList.value = Array.isArray(data?.data) ? data.data : []
|
||||||
if (planList.value.length > 0) {
|
if (planList.value.length > 0) {
|
||||||
dataForm.groupId = planList.value[0].id
|
dataForm.groupId = planList.value[0].id
|
||||||
}
|
}
|
||||||
getDataList()
|
getDataList()
|
||||||
|
}).catch(() => {
|
||||||
|
planList.value = []
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,8 +77,26 @@ const getDataList = () => {
|
|||||||
dataForm.degreeOfEducation = '1'
|
dataForm.degreeOfEducation = '1'
|
||||||
dataListLoading.value = true
|
dataListLoading.value = true
|
||||||
getAreaStatic(dataForm).then((response: any) => {
|
getAreaStatic(dataForm).then((response: any) => {
|
||||||
dataList.value = response.data
|
const res = response?.data
|
||||||
chartOption.value = response.data.option
|
// 兼容:接口可能返回 { data: [], option: {} } 或直接返回数组
|
||||||
|
dataList.value = Array.isArray(res) ? res : (res?.data || res?.records || res?.list || [])
|
||||||
|
const rawOption = Array.isArray(res) ? null : (res?.option ?? null)
|
||||||
|
// 确保 chart 的 option 合法,series[].data 必须为数组,避免 .includes 报错
|
||||||
|
if (rawOption && typeof rawOption === 'object') {
|
||||||
|
const option = { ...rawOption }
|
||||||
|
if (Array.isArray(option.series)) {
|
||||||
|
option.series = option.series.map((s: any) => ({
|
||||||
|
...s,
|
||||||
|
data: Array.isArray(s?.data) ? s.data : []
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
if (option.data !== undefined && !Array.isArray(option.data)) {
|
||||||
|
option.data = []
|
||||||
|
}
|
||||||
|
chartOption.value = option
|
||||||
|
} else {
|
||||||
|
chartOption.value = {}
|
||||||
|
}
|
||||||
dataListLoading.value = false
|
dataListLoading.value = false
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
dataListLoading.value = false
|
dataListLoading.value = false
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mod-config">
|
<div>
|
||||||
<basic-container>
|
|
||||||
<el-form :inline="true" :model="dataForm" @keyup.enter="handleFilter" ref="searchFormRef">
|
<el-form :inline="true" :model="dataForm" @keyup.enter="handleFilter" ref="searchFormRef">
|
||||||
<el-form-item label="招生计划" prop="groupId">
|
<el-form-item label="招生计划" prop="groupId">
|
||||||
<el-select v-model="dataForm.groupId" filterable placeholder="请选择招生计划" size="small">
|
<el-select v-model="dataForm.groupId" filterable placeholder="请选择招生计划" >
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in planList"
|
v-for="item in planList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@@ -14,30 +13,26 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button icon="Search" type="primary" size="small"
|
<el-button icon="Search" type="primary"
|
||||||
@click="handleFilter">查询
|
@click="handleFilter">查询
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button icon="Delete" type="default" plain size="small"
|
<el-button icon="Delete" type="default" plain
|
||||||
@click="resetForm">清空
|
@click="resetForm">清空
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-form>
|
<el-form>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button icon="Download" type="warning" size="small" @click="dataExportHandle">导出</el-button>
|
<el-button icon="Download" type="warning" @click="dataExportHandle">导出</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div class="avue-crud">
|
<el-table :data="dataList" border stripe v-loading="dataListLoading" height="700"
|
||||||
<el-table :data="dataList" border stripe v-loading="dataListLoading"
|
:summary-method="getSummaries" show-summary>
|
||||||
:summary-method="getSummaries" show-summary
|
|
||||||
>
|
|
||||||
<el-table-column align="center" header-align="center" prop="deptName" label="部门" />
|
<el-table-column align="center" header-align="center" prop="deptName" label="部门" />
|
||||||
<el-table-column align="center" header-align="center" prop="allNum" label="合计" />
|
<el-table-column align="center" header-align="center" prop="allNum" label="合计" />
|
||||||
<el-table-column align="center" header-align="center" prop="schoolNum" label="学校推荐" />
|
<el-table-column align="center" header-align="center" prop="schoolNum" label="学校推荐" />
|
||||||
<el-table-column align="center" header-align="center" prop="contantNum" label="联系人" />
|
<el-table-column align="center" header-align="center" prop="contantNum" label="联系人" />
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
|
||||||
</basic-container>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mod-config">
|
<div class="mod-config">
|
||||||
<basic-container>
|
|
||||||
<el-form :inline="true" :model="dataForm" @keyup.enter="handleFilter" ref="searchFormRef">
|
<el-form :inline="true" :model="dataForm" @keyup.enter="handleFilter" ref="searchFormRef">
|
||||||
<el-form-item label="招生计划" prop="groupId">
|
<el-form-item label="招生计划" prop="groupId">
|
||||||
<el-select v-model="dataForm.groupId" filterable placeholder="请选择招生计划" size="small">
|
<el-select v-model="dataForm.groupId" filterable placeholder="请选择招生计划">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in planList"
|
v-for="item in planList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@@ -14,17 +13,17 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button icon="Search" type="primary" size="small"
|
<el-button icon="Search" type="primary"
|
||||||
@click="handleFilter">查询
|
@click="handleFilter">查询
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button icon="Delete" type="default" plain size="small"
|
<el-button icon="Delete" type="default" plain
|
||||||
@click="resetForm">清空
|
@click="resetForm">清空
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-form>
|
<el-form>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button icon="Download" type="warning" size="small" @click="dataExportHandle">导出</el-button>
|
<el-button icon="Download" type="warning" @click="dataExportHandle">导出</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div class="avue-crud">
|
<div class="avue-crud">
|
||||||
@@ -40,7 +39,6 @@
|
|||||||
<el-table-column align="center" header-align="center" prop="allNum" label="高中+技职校" />
|
<el-table-column align="center" header-align="center" prop="allNum" label="高中+技职校" />
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
</basic-container>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
<el-table-column prop="minScore" header-align="center" align="center" label="最低分" />
|
<el-table-column prop="minScore" header-align="center" align="center" label="最低分" />
|
||||||
<el-table-column prop="avgScore" header-align="center" align="center" label="平均分" />
|
<el-table-column prop="avgScore" header-align="center" align="center" label="平均分" />
|
||||||
<el-table-column prop="majorPeopleNum" header-align="center" align="center" label="专业人数" />
|
<el-table-column prop="majorPeopleNum" header-align="center" align="center" label="专业人数" />
|
||||||
<el-table-column prop="avgScoreDB" header-align="center" align="center" label="均分对比" />
|
<!-- <el-table-column prop="avgScoreDB" header-align="center" align="center" label="均分对比" />-->
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -76,12 +76,13 @@ import { useDict } from '/@/hooks/dict'
|
|||||||
import { juniorlneStatic } from '/@/api/recruit/recruitstudentsignup'
|
import { juniorlneStatic } from '/@/api/recruit/recruitstudentsignup'
|
||||||
import { getList } from '/@/api/recruit/recruitstudentplangroup'
|
import { getList } from '/@/api/recruit/recruitstudentplangroup'
|
||||||
import { getDeptListByLevelTwo } from '/@/api/basic/basicdept'
|
import { getDeptListByLevelTwo } from '/@/api/basic/basicdept'
|
||||||
|
import {getDictsByTypes} from "/@/api/admin/dict";
|
||||||
|
|
||||||
// 消息提示 hooks
|
// 消息提示 hooks
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
|
|
||||||
// 字典
|
// 字典
|
||||||
const { getTypeValue } = useDict()
|
// const { useDict } = useDict()
|
||||||
|
|
||||||
// 引用
|
// 引用
|
||||||
const searchFormRef = ref()
|
const searchFormRef = ref()
|
||||||
@@ -104,17 +105,22 @@ const queryForm = reactive({
|
|||||||
// 使用 table hook 获取样式
|
// 使用 table hook 获取样式
|
||||||
const { tableStyle, downBlobFile } = useTable()
|
const { tableStyle, downBlobFile } = useTable()
|
||||||
|
|
||||||
|
const queryDictData=()=>{
|
||||||
|
getDictsByTypes(['basic_major_years']).then((res:any)=>{
|
||||||
|
majorYears.value = res.data.basic_major_years || []
|
||||||
|
})
|
||||||
|
}
|
||||||
// 初始化
|
// 初始化
|
||||||
const init = async () => {
|
const init = async () => {
|
||||||
try {
|
try {
|
||||||
const [deptResponse, majorYearsRes, planData] = await Promise.all([
|
queryDictData()
|
||||||
|
|
||||||
|
const [deptResponse, planData] = await Promise.all([
|
||||||
getDeptListByLevelTwo(),
|
getDeptListByLevelTwo(),
|
||||||
getTypeValue('basic_major_years'),
|
|
||||||
getList()
|
getList()
|
||||||
])
|
])
|
||||||
|
|
||||||
deptCodes.value = deptResponse.data || []
|
deptCodes.value = deptResponse.data || []
|
||||||
majorYears.value = majorYearsRes.data || []
|
|
||||||
planList.value = planData.data || []
|
planList.value = planData.data || []
|
||||||
|
|
||||||
if (planList.value.length > 0) {
|
if (planList.value.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user