This commit is contained in:
2026-07-20 11:50:47 +08:00
parent 95d43746f6
commit 019ed28d37
401 changed files with 61622 additions and 23869 deletions
@@ -0,0 +1,318 @@
<template>
<a-modal
:width="900"
:visible="visible"
:title="isUpdate ? '编辑' : '新增'"
:confirm-loading="loading"
@update:visible="updateVisible"
@ok="save"
>
<a-form ref="formRef" :model="form">
<a-row :gutter="16">
<a-col :span="24">
<a-form-item
label="年份"
name="year"
:rules="[{ required: true, message: '请选择年份' }]"
>
<a-date-picker
v-model:value="form.year"
picker="year"
value-format="YYYY"
style="width: 100%"
:disabled="!!props.fixedYear"
placeholder="请选择年份"
/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item
label="姓名"
name="name"
:rules="[{ required: true, message: '请输入姓名' }]"
>
<a-input v-model:value="form.name" placeholder="请输入姓名" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="性别" name="gender">
<a-select
v-model:value="form.gender"
:options="genderOptions"
placeholder="请选择性别"
/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="民族" name="nation">
<a-select
allow-clear
show-search
v-model:value="form.nation"
:options="nationOptions"
:filter-option="filterSelectOption"
placeholder="请选择民族"
/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="出生年月" name="birthMonth">
<a-date-picker
v-model:value="form.birthMonth"
picker="month"
value-format="YYYY-MM"
style="width: 100%"
placeholder="请选择出生年月"
/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="政治面貌" name="politics">
<a-select
allow-clear
show-search
v-model:value="form.politics"
:options="politicsOptions"
:filter-option="filterSelectOption"
placeholder="请选择政治面貌"
/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="职务" name="position">
<a-input v-model:value="form.position" placeholder="请输入职务" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="身份" name="identity">
<a-input v-model:value="form.identity" placeholder="请输入身份" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="所在团组织" name="organization">
<a-input
v-model:value="form.organization"
placeholder="请输入所在团组织"
/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="联系方式" name="contact">
<a-input
v-model:value="form.contact"
placeholder="请输入联系方式"
/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="发展团员编号" name="memberNo">
<a-input
v-model:value="form.memberNo"
placeholder="请输入发展团员编号"
/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="任现团内职务时间" name="currentDutyTime">
<a-date-picker
v-model:value="form.currentDutyTime"
picker="month"
value-format="YYYY-MM"
style="width: 100%"
placeholder="请选择任现团内职务时间"
/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="担任团干部年限" name="cadreYears">
<a-input
v-model:value="form.cadreYears"
placeholder="请输入担任团干部年限"
/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="上一年度工作考核结果" name="assessment2024">
<a-input
v-model:value="form.assessment2024"
placeholder="请输入上一年度工作考核结果"
/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="成为注册志愿者时间" name="volunteerRegTime">
<a-date-picker
v-model:value="form.volunteerRegTime"
picker="month"
value-format="YYYY-MM"
style="width: 100%"
placeholder="请选择成为注册志愿者时间"
/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="从事团干部经历" name="cadreExperience">
<a-textarea
v-model:value="form.cadreExperience"
:rows="3"
placeholder="请输入从事团干部经历"
/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item
label="近五年获得校级及以上荣誉情况"
name="honorsFiveYears"
>
<a-textarea
v-model:value="form.honorsFiveYears"
:rows="3"
placeholder="请输入近五年获得校级及以上荣誉情况"
/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="主要事迹" name="mainStory">
<a-textarea
v-model:value="form.mainStory"
:rows="3"
placeholder="请输入主要事迹"
/>
</a-form-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-item label="所在单位团组织意见" name="leagueOpinion">-->
<!-- <a-textarea-->
<!-- v-model:value="form.leagueOpinion"-->
<!-- :rows="2"-->
<!-- placeholder="请输入所在单位团组织意见"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="所在单位党组织意见" name="partyOpinion">-->
<!-- <a-textarea-->
<!-- v-model:value="form.partyOpinion"-->
<!-- :rows="2"-->
<!-- placeholder="请输入所在单位党组织意见"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- </a-col>-->
</a-row>
</a-form>
</a-modal>
</template>
<script lang="ts" setup>
import { reactive, ref, watch } from 'vue';
import { message } from 'ant-design-vue';
import {
addYxgqtdgbForm,
updateYxgqtdgbForm
} from '@/api/gxmu/yxgqtdgb-form';
import type { YxgqtdgbForm } from '@/api/gxmu/yxgqtdgb-form/model';
import {
filterSelectOption,
useGxmuFormSelectOptions
} from '@/views/gxmu/useFormSelectOptions';
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
const props = defineProps<{
visible: boolean;
data?: YxgqtdgbForm | null;
fixedYear?: string | number;
}>();
const formRef = ref();
const loading = ref(false);
const isUpdate = ref(false);
const { nationOptions, politicsOptions, genderOptions, loadNationOptions, loadPoliticsOptions } =
useGxmuFormSelectOptions();
const createDefaultForm = (): YxgqtdgbForm => ({
id: undefined,
year: '',
name: '',
gender: '',
nation: '',
birthMonth: '',
politics: '',
position: '',
identity: '',
organization: '',
contact: '',
memberNo: '',
currentDutyTime: '',
cadreYears: '',
assessment2024: '',
volunteerRegTime: '',
cadreExperience: '',
honorsFiveYears: '',
mainStory: '',
leagueOpinion: '',
partyOpinion: ''
});
const form = reactive<YxgqtdgbForm>(createDefaultForm());
watch(
() => props.visible,
async (visible) => {
if (visible) {
try {
await Promise.all([loadNationOptions(), loadPoliticsOptions()]);
} catch (e: any) {
message.error(e.message || '下拉选项加载失败');
}
isUpdate.value = !!props.data?.id;
Object.assign(form, createDefaultForm(), props.data ?? {});
if (props.fixedYear) {
form.year = String(props.fixedYear);
}
} else {
formRef.value?.resetFields?.();
Object.assign(form, createDefaultForm());
}
}
);
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
const save = () => {
formRef.value
?.validate()
.then(() => {
loading.value = true;
const saveOrUpdate = isUpdate.value
? updateYxgqtdgbForm
: addYxgqtdgbForm;
saveOrUpdate({
...form,
year: props.fixedYear ? String(props.fixedYear) : form.year
})
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
</script>
<style lang="less" scoped>
@import '../../form-theme.less';
.gxmu-field-theme();
</style>
@@ -0,0 +1,93 @@
<template>
<common-import
v-bind="$props"
@done="emit('done')"
@update:visible="emit('update:visible', $event)"
module-name="优秀共青团干部"
file-name="优秀共青团干部导入模板.xlsx"
:template-fields="templateFields"
:sample-row="sampleRow"
:create-payload="createPayload"
:save-item="saveItem"
/>
</template>
<script lang="ts" setup>
import CommonImport from '../../components/common-import.vue';
import { addYxgqtdgbForm } from '@/api/gxmu/yxgqtdgb-form';
import type { YxgqtdgbForm } from '@/api/gxmu/yxgqtdgb-form/model';
defineProps<{ visible: boolean }>();
const emit = defineEmits(['done', 'update:visible']);
const templateFields = [
{ header: '年份', key: 'year', required: true },
{ header: '姓名', key: 'name', required: true },
{ header: '性别', key: 'gender' },
{ header: '民族', key: 'nation' },
{ header: '出生年月', key: 'birthMonth' },
{ header: '政治面貌', key: 'politics' },
{ header: '职务', key: 'position' },
{ header: '身份类别', key: 'identity' },
{ header: '所在团组织', key: 'organization' },
{ header: '联系方式', key: 'contact' },
{ header: '团员编号', key: 'memberNo' },
{ header: '现任职务时间', key: 'currentDutyTime' },
{ header: '从事团的工作年限', key: 'cadreYears' },
{ header: '2024年度考核等次', key: 'assessment2024' },
{ header: '志愿汇注册时间', key: 'volunteerRegTime' },
{ header: '团干部经历', key: 'cadreExperience' },
{ header: '近五年获得校级及以上荣誉情况', key: 'honorsFiveYears' },
{ header: '主要事迹', key: 'mainStory' },
{ header: '二级团组织意见', key: 'leagueOpinion' },
{ header: '二级党组织意见', key: 'partyOpinion' }
] as const;
const sampleRow = {
年份: '2025',
姓名: '王五',
性别: '男',
民族: '汉族',
出生年月: '1999-04',
政治面貌: '中共党员',
职务: '团委副书记',
身份类别: '学生',
所在团组织: '第一临床医学院团委',
联系方式: '13800138000',
团员编号: 'TW2025001',
现任职务时间: '2023-09',
从事团的工作年限: '2',
'2024年度考核等次': '优秀',
志愿汇注册时间: '2021-03',
团干部经历: '连续两年担任学院团学骨干',
近五年获得校级及以上荣誉情况: '校优秀团干部',
主要事迹: '组织多场品牌志愿服务活动',
二级团组织意见: '',
二级党组织意见: ''
};
const createPayload = (row: Record<string, any>): YxgqtdgbForm => ({
year: String(row['年份'] || '').trim(),
name: String(row['姓名'] || '').trim(),
gender: String(row['性别'] || '').trim(),
nation: String(row['民族'] || '').trim(),
birthMonth: String(row['出生年月'] || '').trim(),
politics: String(row['政治面貌'] || '').trim(),
position: String(row['职务'] || '').trim(),
identity: String(row['身份类别'] || '').trim(),
organization: String(row['所在团组织'] || '').trim(),
contact: String(row['联系方式'] || '').trim(),
memberNo: String(row['团员编号'] || '').trim(),
currentDutyTime: String(row['现任职务时间'] || '').trim(),
cadreYears: String(row['从事团的工作年限'] || '').trim(),
assessment2024: String(row['2024年度考核等次'] || '').trim(),
volunteerRegTime: String(row['志愿汇注册时间'] || '').trim(),
cadreExperience: String(row['团干部经历'] || '').trim(),
honorsFiveYears: String(row['近五年获得校级及以上荣誉情况'] || '').trim(),
mainStory: String(row['主要事迹'] || '').trim(),
leagueOpinion: String(row['二级团组织意见'] || '').trim(),
partyOpinion: String(row['二级党组织意见'] || '').trim()
});
const saveItem = (item: YxgqtdgbForm) => addYxgqtdgbForm(item);
</script>
+412
View File
@@ -0,0 +1,412 @@
<template>
<div class="page">
<div class="ele-body">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:scroll="{ x: 3000 }"
tool-class="ele-toolbar-form"
>
<template #toolbar>
<a-space>
<a-button
class="gxmu-toolbar-btn gxmu-add-btn"
@click="openEdit()"
>
<template #icon>
<plus-outlined />
</template>
<span>{{ props.popup ? '立即申报' : '添加' }}</span>
</a-button>
<a-button
v-if="!props.popup"
class="gxmu-toolbar-btn gxmu-import-btn"
@click="openImport"
>
<template #icon>
<UploadOutlined />
</template>
<span>导入</span>
</a-button>
<a-button
v-if="!props.popup"
class="gxmu-toolbar-btn"
:loading="exporting"
@click="exportData"
>
<template #icon>
<DownloadOutlined />
</template>
<span>导出</span>
</a-button>
<a-input-search
allow-clear
v-model:value="searchText"
placeholder="请输入姓名/所在团组织/联系方式"
@search="reload"
@pressEnter="reload"
/>
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'currentReviewStatus'">
<ReviewStatusTag :review-list="record.reviewList" />
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openDetail(record)">详情</a>
<a-divider type="vertical" />
<template v-if="!shouldHideEditByReviewList(record.reviewList)">
<a @click="openEdit(record)">编辑</a>
<a-divider type="vertical" />
</template>
<a @click="openReviewHistory(record)">审核历史</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
</div>
<edit-modal
v-model:visible="showEdit"
:data="current"
:fixed-year="props.fixedYear"
@done="reload"
/>
<import-modal v-model:visible="showImport" @done="reload" />
<ModuleDataModal
v-model:visible="showDetail"
:module="REVIEW_MODULE"
module-name="优秀共青团干部"
:pk="detailCurrent?.id"
/>
<ReviewHistoryModal
v-model:visible="showReviewHistory"
:module="REVIEW_MODULE"
:pk="reviewCurrent?.id"
:review-list="reviewCurrent?.reviewList"
/>
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { message } from 'ant-design-vue';
import {
DownloadOutlined,
UploadOutlined,
PlusOutlined
} from '@ant-design/icons-vue';
import EditModal from './components/edit.vue';
import ImportModal from './components/import.vue';
import ReviewHistoryModal from '../components/reviewHistoryModal.vue';
import ModuleDataModal from '../reviewList/components/moduleDataModal.vue';
import ReviewStatusTag from '../components/reviewStatusTag.vue';
import { shouldHideEditByReviewList } from '../utils/review';
import type { EleProTable } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import {
exportYxgqtdgbForm,
userPageYxgqtdgbForm,
removeYxgqtdgbForm
} from '@/api/gxmu/yxgqtdgb-form';
import type {
YxgqtdgbForm,
YxgqtdgbFormParam
} from '@/api/gxmu/yxgqtdgb-form/model';
const props = withDefaults(
defineProps<{
popup?: boolean;
fixedYear?: string | number;
}>(),
{
popup: false
}
);
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
const searchText = ref('');
const showEdit = ref(false);
const showImport = ref(false);
const current = ref<YxgqtdgbForm>();
const showDetail = ref(false);
const detailCurrent = ref<YxgqtdgbForm | null>(null);
const REVIEW_MODULE = 'gxmu_yxgqtdgb';
const showReviewHistory = ref(false);
const reviewCurrent = ref<YxgqtdgbForm | null>(null);
const exporting = ref(false);
const columns = ref<ColumnItem[]>([
{
title: '姓名',
dataIndex: 'name',
key: 'name',
align: 'center',
width: 100
},
{
title: '年份',
dataIndex: 'year',
key: 'year',
align: 'center',
width: 100
},
{
title: '性别',
dataIndex: 'gender',
key: 'gender',
align: 'center',
width: 80
},
{
title: '民族',
dataIndex: 'nation',
key: 'nation',
align: 'center',
width: 100
},
{
title: '出生年月',
dataIndex: 'birthMonth',
key: 'birthMonth',
align: 'center',
width: 120
},
{
title: '政治面貌',
dataIndex: 'politics',
key: 'politics',
align: 'center',
width: 120
},
{
title: '职务',
dataIndex: 'position',
key: 'position',
align: 'center',
width: 120
},
{
title: '身份',
dataIndex: 'identity',
key: 'identity',
align: 'center',
width: 120
},
{
title: '所在团组织',
dataIndex: 'organization',
key: 'organization',
align: 'center',
width: 180,
ellipsis: true
},
{
title: '联系方式',
dataIndex: 'contact',
key: 'contact',
align: 'center',
width: 140
},
{
title: '发展团员编号',
dataIndex: 'memberNo',
key: 'memberNo',
align: 'center',
width: 160
},
{
title: '任现团内职务时间',
dataIndex: 'currentDutyTime',
key: 'currentDutyTime',
align: 'center',
width: 160
},
{
title: '担任团干部年限',
dataIndex: 'cadreYears',
key: 'cadreYears',
align: 'center',
width: 140
},
{
title: '上一年度工作考核结果',
dataIndex: 'assessment2024',
key: 'assessment2024',
align: 'center',
width: 180
},
{
title: '成为注册志愿者时间',
dataIndex: 'volunteerRegTime',
key: 'volunteerRegTime',
align: 'center',
width: 180
},
{
title: '从事团干部经历',
dataIndex: 'cadreExperience',
key: 'cadreExperience',
align: 'center',
width: 260,
ellipsis: true
},
{
title: '近五年获得校级及以上荣誉情况',
dataIndex: 'honorsFiveYears',
key: 'honorsFiveYears',
align: 'center',
width: 240,
ellipsis: true
},
{
title: '主要事迹',
dataIndex: 'mainStory',
key: 'mainStory',
align: 'center',
width: 240,
ellipsis: true
},
{
title: '所在单位团组织意见',
dataIndex: 'leagueOpinion',
key: 'leagueOpinion',
align: 'center',
width: 200,
ellipsis: true
},
{
title: '所在单位党组织意见',
dataIndex: 'partyOpinion',
key: 'partyOpinion',
align: 'center',
width: 200,
ellipsis: true
},
{
title: '当前审核状态',
dataIndex: 'reviewList',
key: 'currentReviewStatus',
align: 'center',
width: 140
},
{
title: '操作',
key: 'action',
fixed: 'right',
align: 'center',
width: 220
}
]);
const datasource: DatasourceFunction = ({ page, limit }) => {
return userPageYxgqtdgbForm({
page,
limit,
year: props.fixedYear ? String(props.fixedYear) : undefined,
keywords: searchText.value.trim() || undefined
} as YxgqtdgbFormParam).catch((e) => {
message.error(e.message);
return { list: [], count: 0 };
});
};
const buildQueryParams = (): YxgqtdgbFormParam => {
return {
year: props.fixedYear ? String(props.fixedYear) : undefined,
keywords: searchText.value.trim() || undefined
} as YxgqtdgbFormParam;
};
const reload = () => {
tableRef.value?.reload();
};
const openImport = () => {
showImport.value = true;
};
const resolveExportUrl = (payload: any) => {
return String(
payload?.url || payload?.downloadUrl || payload?.path || ''
);
};
const exportData = async () => {
if (exporting.value) {
return;
}
exporting.value = true;
const hide = message.loading('导出中..', 0);
try {
const result = await exportYxgqtdgbForm(buildQueryParams());
const url = resolveExportUrl(result);
if (!url) {
throw new Error('导出地址缺失');
}
window.open(url, '_blank');
hide();
message.success('导出成功');
} catch (e: any) {
hide();
message.error(e.message || '导出失败');
} finally {
exporting.value = false;
}
};
const openEdit = (record?: YxgqtdgbForm) => {
current.value = record
? (JSON.parse(JSON.stringify(record)) as YxgqtdgbForm)
: undefined;
showEdit.value = true;
};
const openReviewHistory = (record: YxgqtdgbForm) => {
reviewCurrent.value = record;
showReviewHistory.value = true;
};
const openDetail = (record: YxgqtdgbForm) => {
detailCurrent.value = record;
showDetail.value = true;
};
const remove = (record: YxgqtdgbForm) => {
const hide = message.loading('请求中..', 0);
removeYxgqtdgbForm(record.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
</script>
<script lang="ts">
export default {
name: 'YXGQTDGBForm'
};
</script>
<style lang="less" scoped>
@import '../toolbar.less';
</style>