|
@@ -0,0 +1,436 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="card-search">
|
|
|
|
+ <a-form
|
|
|
|
+ ref="formRef"
|
|
|
|
+ name="advanced_search"
|
|
|
|
+ class="ant-advanced-search-form"
|
|
|
|
+ :model="searchParams"
|
|
|
|
+ >
|
|
|
|
+ <a-row :gutter="24">
|
|
|
|
+ <a-col :span="6">
|
|
|
|
+ <a-form-item label="重点人员类别" :label-col="{ span: 8 }" name="keyPersonTypeID">
|
|
|
|
+ <a-select
|
|
|
|
+ ref="select"
|
|
|
|
+ v-model:value="searchParams.keyPersonTypeID"
|
|
|
|
+ :options="keyPersonTypeList"
|
|
|
|
+ :field-names="{ label: 'name', value: 'value' }"
|
|
|
|
+ :allow-clear="true"
|
|
|
|
+ @change="onFinish"
|
|
|
|
+ >
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :span="6">
|
|
|
|
+ <a-form-item label="统计周期" :label-col="{ span: 8 }" name="emphasisTypeId">
|
|
|
|
+ <a-range-picker format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']" v-model:value="reportDate"
|
|
|
|
+ @change="onRangeChange"/>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :span="6">
|
|
|
|
+ <a-form-item label="所属县区" :label-col="{span:8}" name="regionCode">
|
|
|
|
+ <a-select
|
|
|
|
+ ref="select"
|
|
|
|
+ v-model:value="searchParams.regionCode"
|
|
|
|
+ :options="regionList"
|
|
|
|
+ :field-names="{ label: 'name', value: 'code' }"
|
|
|
|
+ :allow-clear="true"
|
|
|
|
+ @change="onFinish"
|
|
|
|
+ >
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :span="6" style="text-align: left">
|
|
|
|
+ <a-button type="primary" html-type="submit" @click="onFinish">查询</a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ style="margin: 0 8px"
|
|
|
|
+ @click="
|
|
|
|
+ () => {
|
|
|
|
+ formRef.resetFields();
|
|
|
|
+ onFinish();
|
|
|
|
+ }
|
|
|
|
+ ">重置
|
|
|
|
+ </a-button>
|
|
|
|
+ <a style="font-size: 12px" @click="expand = !expand">
|
|
|
|
+ <template v-if="expand">
|
|
|
|
+ <UpOutlined/>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-else>
|
|
|
|
+ <DownOutlined/>
|
|
|
|
+ </template>
|
|
|
|
+ {{ expand ? '收缩' : '展开' }}
|
|
|
|
+ </a>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ <a-row :gutter="24" v-show="expand">
|
|
|
|
+ <a-col :span="6">
|
|
|
|
+ <a-form-item label="所属驿站" :label-col="{ span: 8 }" name="siteID">
|
|
|
|
+ <a-select
|
|
|
|
+ ref="select"
|
|
|
|
+ v-model:value="searchParams.siteID"
|
|
|
|
+ :options="siteList"
|
|
|
|
+ :field-names="{ label: 'siteName', value: 'siteID' }"
|
|
|
|
+ :allow-clear="true"
|
|
|
|
+ @change="onFinish"
|
|
|
|
+ >
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ </a-form>
|
|
|
|
+ <!-- 操作按钮 -->
|
|
|
|
+ <a-row class="edit-operation" style="margin-bottom: 20px">
|
|
|
|
+ <a-col :span="24" class="flex-space-between">
|
|
|
|
+ <div>
|
|
|
|
+ <a-radio-group v-model:value="searchType" button-style="solid" @change="searchTypeChange">
|
|
|
|
+ <a-radio-button value="personTypeByJobUser">重点人员类别分布情况</a-radio-button>
|
|
|
|
+ <a-radio-button value="personTypeByRegion">各区县重点人员类别分布情况</a-radio-button>
|
|
|
|
+ </a-radio-group>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ </div>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ <!-- 数据展示 -->
|
|
|
|
+ <!-- 重点人员类别在求职人员的性别,年龄,学历的分布情况 -->
|
|
|
|
+ <div v-show="searchType == 'personTypeByJobUser'">
|
|
|
|
+ <a-table :columns="personTypeInJobUserDataTableColumns" :data-source="personTypeInJobUserDataList"
|
|
|
|
+ :scroll="{ x:'100%' }"
|
|
|
|
+ :loading="searchLoading"
|
|
|
|
+ :pagination="false"
|
|
|
|
+ bordered>
|
|
|
|
+ </a-table>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 各区县重点人员类别分布情况 -->
|
|
|
|
+ <div v-show="searchType == 'personTypeByRegion'">
|
|
|
|
+ <a-table :columns="personTypeInRegionTableColumns" :data-source="personTypeInRegionList" :scroll="{ x:'100%' }"
|
|
|
|
+ :loading="searchLoading"
|
|
|
|
+ :pagination="false"
|
|
|
|
+ bordered>
|
|
|
|
+ </a-table>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script setup lang="ts">
|
|
|
|
+import {onMounted, reactive, ref} from "vue";
|
|
|
|
+import {DownOutlined, UpOutlined} from "@ant-design/icons-vue";
|
|
|
|
+import {getSysDictionaryList} from "@/api/system/dictionary";
|
|
|
|
+import type {RangeValue} from "ant-design-vue/es/vc-picker/interface";
|
|
|
|
+import dayjs from "dayjs";
|
|
|
|
+import {get} from "@/api/common";
|
|
|
|
+import {getSiteList} from "@/api/baseSettings/siteInfo";
|
|
|
|
+import {getPersonTypeCountInJobUserData, getPersonTypeCountInRegion} from "@/api/statistics";
|
|
|
|
+
|
|
|
|
+const searchParams = reactive({
|
|
|
|
+ keyPersonTypeID: null,
|
|
|
|
+ startDate: "",
|
|
|
|
+ endDate: "",
|
|
|
|
+ regionCode: "",
|
|
|
|
+ siteID: ""
|
|
|
|
+})
|
|
|
|
+const formRef = ref();
|
|
|
|
+const expand = ref(false);
|
|
|
|
+const keyPersonTypeList = ref([])
|
|
|
|
+const reportDate = ref<RangeValue<any>>();
|
|
|
|
+const regionList = ref<Array<any>>([]);
|
|
|
|
+const siteList = ref();
|
|
|
|
+const searchType = ref("personTypeByJobUser");
|
|
|
|
+const searchLoading = ref(false);
|
|
|
|
+const personTypeInRegionKeyTemp = [];
|
|
|
|
+const personTypeInRegionTableColumns = ref([{
|
|
|
|
+ title: '人员类别', dataIndex: 'keyTypeName', key: 'keyTypeName', align: "center", width: 280
|
|
|
|
+},]);
|
|
|
|
+const personTypeInRegionList = ref<Array<any>>([])
|
|
|
|
+const personTypeInJobUserDataKeyTemp = ['gander1', 'gander2', 'age18-20岁', 'age21-30岁', 'age31-40岁', 'age41-50岁', 'age51-60岁', "cultureRank1", "cultureRank2", "cultureRank3", "cultureRank4", "cultureRank5"];
|
|
|
|
+const personTypeInJobUserDataTableColumns = ref([
|
|
|
|
+ {
|
|
|
|
+ title: '人员类别', dataIndex: 'keyTypeName', key: 'keyTypeName', align: "center", width: 280
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '性别', dataIndex: 'sex', key: 'sex', align: "center",
|
|
|
|
+ children: [
|
|
|
|
+ {
|
|
|
|
+ title: '男',
|
|
|
|
+ dataIndex: 'gander1',
|
|
|
|
+ key: 'gander1',
|
|
|
|
+ align: "center"
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '女',
|
|
|
|
+ dataIndex: 'gander2',
|
|
|
|
+ key: 'gander2',
|
|
|
|
+ align: "center"
|
|
|
|
+ },
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '年龄', dataIndex: 'age', key: 'age', align: "center",
|
|
|
|
+ children: [
|
|
|
|
+ {
|
|
|
|
+ title: '18-20岁',
|
|
|
|
+ dataIndex: 'age18-20岁',
|
|
|
|
+ key: 'age18-20岁',
|
|
|
|
+ align: "center"
|
|
|
|
+ }, {
|
|
|
|
+ title: '21-30岁',
|
|
|
|
+ dataIndex: 'age21-30岁',
|
|
|
|
+ key: 'age21-30岁',
|
|
|
|
+ align: "center"
|
|
|
|
+ }, {
|
|
|
|
+ title: '31-40岁',
|
|
|
|
+ dataIndex: 'age31-40岁',
|
|
|
|
+ key: 'age31-40岁',
|
|
|
|
+ align: "center"
|
|
|
|
+ }, {
|
|
|
|
+ title: '41-50岁',
|
|
|
|
+ dataIndex: 'age41-50岁',
|
|
|
|
+ key: 'age41-50岁',
|
|
|
|
+ align: "center"
|
|
|
|
+ }, {
|
|
|
|
+ title: '51-60岁',
|
|
|
|
+ dataIndex: 'age51-60岁',
|
|
|
|
+ key: 'age51-60岁',
|
|
|
|
+ align: "center"
|
|
|
|
+ },
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '文化程度', dataIndex: 'cultureRank', key: 'cultureRank', align: "center",
|
|
|
|
+ children: [
|
|
|
|
+ {
|
|
|
|
+ title: '初中及以下',
|
|
|
|
+ dataIndex: 'cultureRank1',
|
|
|
|
+ key: 'cultureRank1',
|
|
|
|
+ width: 130,
|
|
|
|
+ align: "center"
|
|
|
|
+ }, {
|
|
|
|
+ title: '高中、中职、中技',
|
|
|
|
+ dataIndex: 'cultureRank2',
|
|
|
|
+ key: 'cultureRank2',
|
|
|
|
+ width: 130,
|
|
|
|
+ align: "center"
|
|
|
|
+ }, {
|
|
|
|
+ title: '大专',
|
|
|
|
+ dataIndex: 'cultureRank3',
|
|
|
|
+ key: 'cultureRank3',
|
|
|
|
+ width: 130,
|
|
|
|
+ align: "center"
|
|
|
|
+ }, {
|
|
|
|
+ title: '本科',
|
|
|
|
+ dataIndex: 'cultureRank4',
|
|
|
|
+ key: 'cultureRank4',
|
|
|
|
+ width: 130,
|
|
|
|
+ align: "center"
|
|
|
|
+ }, {
|
|
|
|
+ title: '硕士及以上',
|
|
|
|
+ dataIndex: 'cultureRank5',
|
|
|
|
+ key: 'cultureRank5',
|
|
|
|
+ width: 130,
|
|
|
|
+ align: "center"
|
|
|
|
+ },
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+]);
|
|
|
|
+const personTypeInJobUserDataList = ref<Array<any>>([])
|
|
|
|
+
|
|
|
|
+function onFinish() {
|
|
|
|
+ searchTypeChange();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const getKeyPersonTypeList = () => {
|
|
|
|
+ getSysDictionaryList('KeyPersonType').then((data) => {
|
|
|
|
+ keyPersonTypeList.value = data;
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+// 时间段变更事件
|
|
|
|
+const onRangeChange = (dateString: [string, string]) => {
|
|
|
|
+ searchParams.startDate = dateString != null ? dayjs(dateString[0]).format("YYYY-MM-DD") : "";
|
|
|
|
+ searchParams.endDate = dateString != null ? dayjs(dateString[1]).format("YYYY-MM-DD") : "";
|
|
|
|
+ onFinish();
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+function getRegionList() {
|
|
|
|
+ get('system/area/getCityList', {}).then(data => {
|
|
|
|
+ regionList.value = data;
|
|
|
|
+ // 生成各区县重点人员类别分布情况的表格定义
|
|
|
|
+ data.forEach((region) => {
|
|
|
|
+ personTypeInRegionTableColumns.value.push({
|
|
|
|
+ title: region.name,
|
|
|
|
+ dataIndex: "region" + region.code,
|
|
|
|
+ key: "region" + region.code,
|
|
|
|
+ align: "center"
|
|
|
|
+ })
|
|
|
|
+ personTypeInRegionKeyTemp.push("region" + region.code)
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function getAllSites() {
|
|
|
|
+ getSiteList({pageIndex: 1, pageSize: 9999}).then((result: any) => {
|
|
|
|
+ siteList.value = result.list;
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function searchTypeChange() {
|
|
|
|
+ if (searchType.value == "personTypeByJobUser") {
|
|
|
|
+ searchLoading.value = true;
|
|
|
|
+ personTypeInJobUserDataList.value = []
|
|
|
|
+ getPersonTypeCountInJobUserData({...searchParams}).then((result: any) => {
|
|
|
|
+ // 初始化合计数据
|
|
|
|
+ let count = {
|
|
|
|
+ keyPersonTypeID: -1,
|
|
|
|
+ keyTypeName: "合计",
|
|
|
|
+ }
|
|
|
|
+ personTypeInJobUserDataKeyTemp.forEach(key => {
|
|
|
|
+ count[key] = 0; // 指定字段赋值为0
|
|
|
|
+ })
|
|
|
|
+ result.forEach((resItem: any) => {
|
|
|
|
+ // 查询获取人员类别数据的下标,保证每种人员类别只存在一条数据
|
|
|
|
+ const findIndex = personTypeInJobUserDataList.value.findIndex((find: any) => find.keyPersonTypeID == resItem.keyPersonTypeID);
|
|
|
|
+ if (findIndex > -1) {
|
|
|
|
+ // 人员类型已存在,修改这条数据
|
|
|
|
+ if (resItem.genderID != null) {
|
|
|
|
+ // 性别分布
|
|
|
|
+ personTypeInJobUserDataList.value[findIndex]['gander' + resItem.genderID] = resItem.jobUserCount;
|
|
|
|
+ count['gander' + resItem.genderID] += resItem.jobUserCount; // 计算合计
|
|
|
|
+ } else if (resItem.ageRange != null) {
|
|
|
|
+ // 年龄分布
|
|
|
|
+ personTypeInJobUserDataList.value[findIndex]['age' + resItem.ageRange] = resItem.jobUserCount;
|
|
|
|
+ count['age' + resItem.ageRange] += resItem.jobUserCount; // 计算合计
|
|
|
|
+ } else if (resItem.cultureRank != null) {
|
|
|
|
+ // 学历分布
|
|
|
|
+ let cultureRankKey;
|
|
|
|
+ switch (resItem.cultureRank) {
|
|
|
|
+ case 11:
|
|
|
|
+ case 14:
|
|
|
|
+ cultureRankKey = 'cultureRank5'; // 硕士以上
|
|
|
|
+ break;
|
|
|
|
+ case 21:
|
|
|
|
+ cultureRankKey = 'cultureRank4'; // 大学本科
|
|
|
|
+ break;
|
|
|
|
+ case 31:
|
|
|
|
+ cultureRankKey = 'cultureRank3'; // 大学专科
|
|
|
|
+ break;
|
|
|
|
+ case 41:
|
|
|
|
+ case 44:
|
|
|
|
+ case 47:
|
|
|
|
+ case 61:
|
|
|
|
+ case 100:
|
|
|
|
+ cultureRankKey = 'cultureRank2'; // 高中、中职、中技
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ cultureRankKey = 'cultureRank1'; // 初中及以下
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ personTypeInJobUserDataList.value[findIndex][cultureRankKey] += resItem.jobUserCount;
|
|
|
|
+ count[cultureRankKey] += resItem.jobUserCount; // 计算合计
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ // 不存在,新增一条数据
|
|
|
|
+ const newData = {
|
|
|
|
+ keyPersonTypeID: resItem.keyPersonTypeID,
|
|
|
|
+ keyTypeName: resItem.keyTypeName
|
|
|
|
+ }
|
|
|
|
+ personTypeInJobUserDataKeyTemp.forEach(key => {
|
|
|
|
+ newData[key] = 0; // 指定字段赋值为0
|
|
|
|
+ })
|
|
|
|
+ if (resItem.genderID != null) {
|
|
|
|
+ newData['gander' + resItem.genderID] = resItem.jobUserCount; // 性别分布情况
|
|
|
|
+ count['gander' + resItem.genderID] += resItem.jobUserCount; // 计算合计
|
|
|
|
+ } else if (resItem.ageRange != null) {
|
|
|
|
+ newData['age' + resItem.ageRange] = resItem.jobUserCount; // 年龄分布情况
|
|
|
|
+ count['age' + resItem.ageRange] += resItem.jobUserCount; // 计算合计
|
|
|
|
+ } else if (resItem.cultureRank != null) {
|
|
|
|
+ // 学历分布
|
|
|
|
+ let cultureRankKey;
|
|
|
|
+ switch (resItem.cultureRank) {
|
|
|
|
+ case 11:
|
|
|
|
+ case 14:
|
|
|
|
+ cultureRankKey = 'cultureRank5'; // 硕士以上
|
|
|
|
+ break;
|
|
|
|
+ case 21:
|
|
|
|
+ cultureRankKey = 'cultureRank4'; // 大学本科
|
|
|
|
+ break;
|
|
|
|
+ case 31:
|
|
|
|
+ cultureRankKey = 'cultureRank3'; // 大学专科
|
|
|
|
+ break;
|
|
|
|
+ case 41:
|
|
|
|
+ case 44:
|
|
|
|
+ case 47:
|
|
|
|
+ case 61:
|
|
|
|
+ case 100:
|
|
|
|
+ cultureRankKey = 'cultureRank2'; // 高中、中职、中技
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ cultureRankKey = 'cultureRank1'; // 初中及以下
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ newData[cultureRankKey] += resItem.jobUserCount;
|
|
|
|
+ count[cultureRankKey] += resItem.jobUserCount; // 计算合计
|
|
|
|
+ }
|
|
|
|
+ personTypeInJobUserDataList.value.push(newData);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ personTypeInJobUserDataList.value.push(count);
|
|
|
|
+ }).finally(() => {
|
|
|
|
+ searchLoading.value = false;
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ if (searchType.value == "personTypeByRegion") {
|
|
|
|
+ searchLoading.value = true;
|
|
|
|
+ personTypeInRegionList.value = [];
|
|
|
|
+ getPersonTypeCountInRegion({...searchParams}).then((result: any) => {
|
|
|
|
+ let count = {
|
|
|
|
+ keyPersonTypeID: -1,
|
|
|
|
+ keyTypeName: "合计",
|
|
|
|
+ }
|
|
|
|
+ personTypeInRegionKeyTemp.forEach(key => {
|
|
|
|
+ count[key] = 0;
|
|
|
|
+ })
|
|
|
|
+ result.forEach((item: any) => {
|
|
|
|
+ const key = 'region' + item.regionCode;
|
|
|
|
+ const findIndex = personTypeInRegionList.value.findIndex((find: any) => find.keyPersonTypeID == item.keyPersonTypeID);
|
|
|
|
+ if (findIndex > -1) {
|
|
|
|
+ personTypeInRegionList.value[findIndex][key] = item.jobUserCount;
|
|
|
|
+ count[key] += item.jobUserCount;
|
|
|
|
+ } else {
|
|
|
|
+ let newData = {
|
|
|
|
+ keyPersonTypeID: item.keyPersonTypeID,
|
|
|
|
+ keyTypeName: item.keyTypeName,
|
|
|
|
+ }
|
|
|
|
+ personTypeInRegionKeyTemp.forEach(key => {
|
|
|
|
+ newData[key] = 0;
|
|
|
|
+ })
|
|
|
|
+ // 将当前循环到的元素的求职人数赋值
|
|
|
|
+ newData[key] = item.jobUserCount;
|
|
|
|
+ // 计算合计
|
|
|
|
+ count[key] += item.jobUserCount;
|
|
|
|
+ personTypeInRegionList.value.push(newData);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ personTypeInRegionList.value.push(count);
|
|
|
|
+ }).finally(() => {
|
|
|
|
+ searchLoading.value = false;
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+onMounted(() => {
|
|
|
|
+ getKeyPersonTypeList();
|
|
|
|
+ getRegionList();
|
|
|
|
+ getAllSites();
|
|
|
|
+ onFinish();
|
|
|
|
+})
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<script lang="ts">
|
|
|
|
+// 设置页面名称进行组件缓存
|
|
|
|
+export default {
|
|
|
|
+ name: "SiteStatistics",
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style scoped>
|
|
|
|
+
|
|
|
|
+</style>
|