分支合并

This commit is contained in:
Xubx 2025-03-06 17:14:16 +08:00
parent 011d500186
commit ecbfbd5cad
6 changed files with 367 additions and 350 deletions

View File

@ -3,6 +3,11 @@ import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator'; import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils'; import { render } from '/@/utils/common/renderUtils';
import { ref, onMounted,reactive } from 'vue'; import { ref, onMounted,reactive } from 'vue';
// 学科过滤方法
const filterMajor = (value, row) => {
console.log(value, row); // 打印过滤值和行数据
return row === value;
};
const groupOptions=ref() const groupOptions=ref()
// 创建一个简单的事件总线 // 创建一个简单的事件总线
@ -38,6 +43,15 @@ export const columns: BasicColumn[] = [
title: '学科', title: '学科',
align: 'center', align: 'center',
dataIndex: 'majorId', dataIndex: 'majorId',
filters: [
{ text: '语文', value: 1 },
{ text: '地理', value: 4 },
{ text: '历史', value: 7 },
{ text: '政治', value: 8 },
],
filterMultiple: false, // 是否支持多选过滤
//value: 用户选择的过滤值(如 1
onFilter: (value, record) => filterMajor(value, record.majorId), // 过滤方法
}, },
{ {
title: '所属分组', title: '所属分组',
@ -85,41 +99,26 @@ export const formSchema: FormSchema[] = [
label: '用户id', label: '用户id',
field: 'userId', field: 'userId',
component: 'Input', component: 'Input',
dynamicRules: ({ model, schema }) => { show: false,
return [{ required: true, message: '请输入用户id!' }]; //dynamicRules: ({ model, schema }) => {
}, // return [{ required: true, message: '请输入用户id!' }];
//},
}, },
{ {
label: '用户名', label: '名',
field: 'userName', field: 'userName',
component: 'Input', component: 'Input',
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入用户名!' }]; return [{ required: true, message: '请输入姓名!' }];
},
},
{
label: '学科',
field: 'majorId',
component: 'InputNumber',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入学科!' }];
},
},
{
label: '用户专业id',
field: 'userMajorId',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入用户专业id!' }];
}, },
}, },
{ {
label: '工号', label: '工号',
field: 'teacherId', field: 'teacherId',
component: 'Input', component: 'Input',
dynamicRules: ({ model, schema }) => { //dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入工号!' }]; // return [{ required: true, message: '请输入工号!' }];
}, //},
}, },
{ {
label: '手机号', label: '手机号',
@ -136,18 +135,18 @@ export const formSchema: FormSchema[] = [
componentProps: { componentProps: {
options: groupOptions, // 动态设置分组选项 options: groupOptions, // 动态设置分组选项
}, },
dynamicRules: ({ model, schema }) => { //dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请选择分组!' }]; // return [{ required: true, message: '请选择分组!' }];
}, //},
},
{
label: '使用次数',
field: 'numberuse',
component: 'InputNumber',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入使用次数!' }];
},
}, },
//{
// label: '使用次数',
// field: 'numberuse',
// component: 'InputNumber',
// dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入使用次数!' }];
// },
//},
{ {
label: '是否第一次阅卷', label: '是否第一次阅卷',
field: 'status', field: 'status',
@ -158,9 +157,9 @@ export const formSchema: FormSchema[] = [
{ label: '否', value: 1 }, { label: '否', value: 1 },
], ],
}, },
dynamicRules: ({ model, schema }) => { //dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请选择是否第一次阅卷!' }]; // return [{ required: true, message: '请选择是否第一次阅卷!' }];
}, //},
}, },
// TODO 主键隐藏字段目前写死为ID // TODO 主键隐藏字段目前写死为ID
{ {

View File

@ -33,6 +33,9 @@
<a-tag v-if="record.status === 0" color="green"></a-tag> <a-tag v-if="record.status === 0" color="green"></a-tag>
<a-tag v-else-if="record.status !== 0" color="red"></a-tag> <a-tag v-else-if="record.status !== 0" color="red"></a-tag>
</span> </span>
<span v-if="column.dataIndex === 'majorId'">
<span>{{ record.majorIdDescription }}</span>
</span>
</template> </template>
</BasicTable> </BasicTable>
<!-- 表单区域 --> <!-- 表单区域 -->

View File

@ -89,16 +89,16 @@ export const columns: BasicColumn[] = [
dataIndex: 'checked', dataIndex: 'checked',
}, },
{ //{
title: '使用次数', // title: '使用次数',
align: 'center', // align: 'center',
dataIndex: 'numberuse', // dataIndex: 'numberuse',
}, //},
{ //{
title: '状态', // title: '状态',
align: 'center', // align: 'center',
dataIndex: 'status', // dataIndex: 'status',
}, //},
]; ];
//查询数据 //查询数据
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
@ -111,20 +111,20 @@ export const searchFormSchema: FormSchema[] = [
]; ];
//表单数据 //表单数据
export const formSchema: FormSchema[] = [ export const formSchema: FormSchema[] = [
//{
// label: '用户id',
// field: 'userId',
// component: 'Input',
// dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入用户id!' }];
// },
//},
{ {
label: '用户id', label: '学生名',
field: 'userId',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入用户id!' }];
},
},
{
label: '用户名',
field: 'userName', field: 'userName',
component: 'Input', component: 'Input',
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入用户名!' }]; return [{ required: true, message: '请输入学生名!' }];
}, },
}, },
{ {
@ -144,19 +144,11 @@ export const formSchema: FormSchema[] = [
}, },
}, },
{ {
label: '用户专业id', label: '学号',
field: 'userMajorId',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入用户专业id!' }];
},
},
{
label: '学生id',
field: 'studentId', field: 'studentId',
component: 'Input', component: 'Input',
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入学生id!' }]; return [{ required: true, message: '请输入学号!' }];
}, },
}, },
{ {
@ -177,9 +169,9 @@ export const formSchema: FormSchema[] = [
{ label: '否', value: 1 }, { label: '否', value: 1 },
], ],
}, },
dynamicRules: ({ model, schema }) => { //dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请选择是否第一次阅卷!' }]; // return [{ required: true, message: '请选择是否第一次阅卷!' }];
}, //},
}, },
{ {
label: '所属分组', label: '所属分组',
@ -188,32 +180,32 @@ export const formSchema: FormSchema[] = [
componentProps: { componentProps: {
options: groupOptions, // 动态设置分组选项 options: groupOptions, // 动态设置分组选项
}, },
dynamicRules: ({ model, schema }) => { //dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请选择分组!' }]; // return [{ required: true, message: '请选择分组!' }];
}, //},
},
{
label: '使用次数',
field: 'numberuse',
component: 'InputNumber',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入使用次数!' }];
},
},
{
label: '状态',
field: 'status',
component: 'RadioGroup',
componentProps: {
options: [
{ label: '正常', value: 0 },
{ label: '禁用', value: 1 },
],
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请选择状态!' }];
},
}, },
//{
// label: '使用次数',
// field: 'numberuse',
// component: 'InputNumber',
// dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入使用次数!' }];
// },
//},
//{
// label: '状态',
// field: 'status',
// component: 'RadioGroup',
// componentProps: {
// options: [
// { label: '正常', value: 0 },
// { label: '禁用', value: 1 },
// ],
// },
// dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请选择状态!' }];
// },
//},
// TODO 主键隐藏字段目前写死为ID // TODO 主键隐藏字段目前写死为ID
{ {
label: '', label: '',

View File

@ -37,6 +37,9 @@
<a-tag v-if="record.status === 0" color="green">正常</a-tag> <a-tag v-if="record.status === 0" color="green">正常</a-tag>
<a-tag v-else-if="record.status !== 0" color="red">禁用</a-tag> <a-tag v-else-if="record.status !== 0" color="red">禁用</a-tag>
</span> </span>
<span v-if="column.dataIndex === 'majorId'">
<span>{{ record.majorIdDescription }}</span>
</span>
</template> </template>
</BasicTable> </BasicTable>
<!-- 表单区域 --> <!-- 表单区域 -->

View File

@ -4,6 +4,12 @@ import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils'; import { render } from '/@/utils/common/renderUtils';
import { ref, onMounted,reactive } from 'vue'; import { ref, onMounted,reactive } from 'vue';
// 学科过滤方法
const filterMajor = (value, row) => {
console.log(value, row); // 打印过滤值和行数据
return row === value;
};
const groupOptions=ref() const groupOptions=ref()
// 创建一个简单的事件总线 // 创建一个简单的事件总线
@ -39,6 +45,15 @@ export const columns: BasicColumn[] = [
title: '学科', title: '学科',
align: 'center', align: 'center',
dataIndex: 'majorId', dataIndex: 'majorId',
filters: [
{ text: '语文', value: 1 },
{ text: '地理', value: 4 },
{ text: '历史', value: 7 },
{ text: '政治', value: 8 },
],
filterMultiple: false, // 是否支持多选过滤
//value: 用户选择的过滤值(如 1
onFilter: (value, record) => filterMajor(value, record.majorId), // 过滤方法
}, },
{ {
title: '手机号', title: '手机号',
@ -73,81 +88,81 @@ export const columns: BasicColumn[] = [
dataIndex: 'dormitory', dataIndex: 'dormitory',
}, },
{ //{
title: '用户专业id', // title: '用户专业id',
align: 'center', // align: 'center',
dataIndex: 'userMajorId', // dataIndex: 'userMajorId',
}, //},
{ //{
title: '银行卡号', // title: '银行卡号',
align: 'center', // align: 'center',
dataIndex: 'pyCard', // dataIndex: 'pyCard',
}, //},
{ //{
title: '饭卡', // title: '饭卡',
align: 'center', // align: 'center',
dataIndex: 'mealCard', // dataIndex: 'mealCard',
}, //},
{ //{
title: '工作名称', // title: '工作名称',
align: 'center', // align: 'center',
dataIndex: 'workName', // dataIndex: 'workName',
}, //},
{ //{
title: '固定电话', // title: '固定电话',
align: 'center', // align: 'center',
dataIndex: 'workPhone', // dataIndex: 'workPhone',
}, //},
{ //{
title: '身份证', // title: '身份证',
align: 'center', // align: 'center',
dataIndex: 'identityId', // dataIndex: 'identityId',
}, //},
{ //{
title: '车牌号', // title: '车牌号',
align: 'center', // align: 'center',
dataIndex: 'carNumber', // dataIndex: 'carNumber',
}, //},
{ //{
title: '车辆是否入校', // title: '车辆是否入校',
align: 'center', // align: 'center',
dataIndex: 'carStatus', // dataIndex: 'carStatus',
}, //},
{ //{
title: '是否住宿', // title: '是否住宿',
align: 'center', // align: 'center',
dataIndex: 'dormitoryStatus', // dataIndex: 'dormitoryStatus',
}, //},
{ //{
title: '开户所在地', // title: '开户所在地',
align: 'center', // align: 'center',
dataIndex: 'bankAddress', // dataIndex: 'bankAddress',
}, //},
{ //{
title: '开户行', // title: '开户行',
align: 'center', // align: 'center',
dataIndex: 'bankName', // dataIndex: 'bankName',
}, //},
{ //{
title: '使用次数', // title: '使用次数',
align: 'center', // align: 'center',
dataIndex: 'numberuse', // dataIndex: 'numberuse',
}, //},
{ //{
title: '状态', // title: '状态',
align: 'center', // align: 'center',
dataIndex: 'status', // dataIndex: 'status',
}, //},
]; ];
//查询数据 //查询数据
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{ //{
label: '学科', // label: '学科',
field: 'majorId', // field: 'majorId',
component: 'JRangeNumber', // component: 'JRangeNumber',
//colProps: {span: 6}, // //colProps: {span: 6},
}, //},
{ {
label: '姓名', label: '姓名',
field: 'userName', field: 'userName',
@ -165,22 +180,6 @@ export const formSchema: FormSchema[] = [
return [{ required: true, message: '请输入用户ID!' }]; return [{ required: true, message: '请输入用户ID!' }];
}, },
}, },
{
label: '学科',
field: 'majorId',
component: 'InputNumber',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入专业id!' }];
},
},
{
label: '用户专业id',
field: 'userMajorId',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入用户专业id!' }];
},
},
{ {
label: '姓名', label: '姓名',
field: 'userName', field: 'userName',
@ -189,62 +188,6 @@ export const formSchema: FormSchema[] = [
return [{ required: true, message: '请输入姓名!' }]; return [{ required: true, message: '请输入姓名!' }];
}, },
}, },
{
label: '手机号',
field: 'phone',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入手机号!' }];
},
},
{
label: '职称',
field: 'jobTitle',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入职称!' }];
},
},
{
label: '银行卡号',
field: 'pyCard',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入银行卡号!' }];
},
},
{
label: '饭卡',
field: 'mealCard',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入饭卡!' }];
},
},
{
label: '职务',
field: 'office',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入办公位!' }];
},
},
{
label: '工作名称',
field: 'workName',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入工作名称!' }];
},
},
{
label: '固定电话',
field: 'workPhone',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入固定电话!' }];
},
},
{ {
label: '身份证', label: '身份证',
field: 'identityId', field: 'identityId',
@ -254,12 +197,9 @@ export const formSchema: FormSchema[] = [
}, },
}, },
{ {
label: '车牌号', label: '年龄',
field: 'carNumber', field: 'age',
component: 'Input', component: 'InputNumber',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入车牌号!' }];
},
}, },
{ {
label: '性别', label: '性别',
@ -273,31 +213,109 @@ export const formSchema: FormSchema[] = [
}, },
}, },
{ {
label: '年龄', label: '学科',
field: 'age', field: 'majorId',
component: 'InputNumber', component: 'Select',
},
{
label: '车辆是否入校',
field: 'carStatus',
component: 'RadioGroup',
componentProps: { componentProps: {
options: [ options: [
{ label: '是', value: 0 }, { label: '语文', value: 1 },
{ label: '否', value: 1 }, { label: '地理', value: 4 },
{ label: '历史', value: 7 },
{ label: '政治', value: 8 },
], ],
}, },
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入车辆是否入校!' }]; return [{ required: true, message: '请选择学科!' }];
}, },
}, },
//{
// label: '用户专业id',
// field: 'userMajorId',
// component: 'Input',
// dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入用户专业id!' }];
// },
//},
{ {
label: '住宿信息', label: '手机号',
field: 'dormitory', field: 'phone',
component: 'Input', component: 'Input',
dynamicRules: ({ model, schema }) => { //dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入宿舍信息!' }]; // return [{ required: true, message: '请输入手机号!' }];
}, //},
},
{
label: '职称',
field: 'jobTitle',
component: 'Input',
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入职称!' }];
//},
},
{
label: '职务',
field: 'office',
component: 'Input',
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入办公位!' }];
//},
},
{
label: '单位名称',
field: 'workName',
component: 'Input',
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入单位名称!' }];
//},
},
{
label: '单位电话',
field: 'workPhone',
component: 'Input',
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入单位电话!' }];
//},
},
{
label: '银行卡号',
field: 'pyCard',
component: 'Input',
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入银行卡号!' }];
//},
},
{
label: '开户地区',
field: 'bankAddress',
component: 'Input',
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入开户地区(北京,哈尔滨)' }];
//},
},
{
label: '开户行',
field: 'bankName',
component: 'Input',
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入开户行!' }];
//},
},
{
label: '车牌号',
field: 'carNumber',
component: 'Input',
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入车牌号!' }];
//},
},
{
label: '饭卡',
field: 'mealCard',
component: 'Input',
//dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入饭卡!' }];
//},
}, },
{ {
label: '是否住宿', label: '是否住宿',
@ -309,60 +327,76 @@ export const formSchema: FormSchema[] = [
{ label: '否', value: 1 }, { label: '否', value: 1 },
], ],
}, },
dynamicRules: ({ model, schema }) => { //dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入是否住宿!' }]; // return [{ required: true, message: '请输入是否住宿!' }];
}, //},
},
{
label: '开户所在地',
field: 'bankAddress',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入开户所在地!' }];
},
},
{
label: '开户行',
field: 'bankName',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入开户行!' }];
},
}, },
{ {
label: '所属分组', label: '所属分组',
field: 'groupId', field: 'groupId',
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: groupOptions, // 动态设置分组选项 options: groupOptions, // 动态设置分组选项
}, },
dynamicRules: ({ model, schema }) => { dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请选择分组!' }]; return [{ required: true, message: '请选择分组!' }];
}, },
}, },
{ {
label: '使用次数', label: '车辆是否入校',
field: 'numberuse', field: 'carStatus',
component: 'InputNumber',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入使用次数!' }];
},
},
{
label: '状态:',
field: 'status',
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: [ options: [
{ label: '已报到', value: 0 }, { label: '是', value: 0 },
{ label: '未报到', value: 1 }, { label: '否', value: 1 },
], ],
}, },
dynamicRules: ({ model, schema }) => { //dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请选择状态' }]; // return [{ required: true, message: '请输入车辆是否入校!' }];
}, //},
}, },
// TODO 主键隐藏字段目前写死为ID //{
// label: '住宿信息',
// field: 'dormitory',
// component: 'Input',
// dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入宿舍信息!' }];
// },
//},
//{
// label: '所属分组',
// field: 'groupId',
// component: 'InputNumber',
// dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入组id!' }];
// },
//},
//{
// label: '使用次数',
// field: 'numberuse',
// component: 'InputNumber',
// dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请输入使用次数!' }];
// },
//},
//{
// label: '状态:',
// field: 'status',
// component: 'RadioGroup',
// componentProps: {
// options: [
// { label: '已报到', value: 0 },
// { label: '未报到', value: 1 },
// ],
// },
// dynamicRules: ({ model, schema }) => {
// return [{ required: true, message: '请选择状态' }];
// },
//},
//// TODO 主键隐藏字段目前写死为ID
{ {
label: '', label: '',
field: 'id', field: 'id',

View File

@ -1,8 +1,8 @@
<template> <template>
<div> <div>
<!--引用表格--> <!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection" :expanded-row-keys="expandedRowKeys" <BasicTable @register="registerTable" :rowSelection="rowSelection" ref="tableRef" :expandedRowKeys="expandedKeys"
:expandable="expandable" @expanded-rows-change="handleExpand"> rowKey="id" :expandedRowRender="renderExpandedRow" @expand="handleExpand">
<!--插槽:table标题--> <!--插槽:table标题-->
<template #tableTitle> <template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
@ -24,34 +24,6 @@
<!-- 高级查询 --> <!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" /> <super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template> </template>
<template #expand="{ record }">
<a-descriptions bordered :column="2">
<a-descriptions-item label="身份证号">
{{ record.identityId }}
</a-descriptions-item>
<a-descriptions-item label="银行卡号">
{{ record.pyCard }}
</a-descriptions-item>
<a-descriptions-item label="工作单位">
{{ record.workName }}
</a-descriptions-item>
<a-descriptions-item label="开户所在地">
{{ record.bankAddress }}
</a-descriptions-item>
<a-descriptions-item label="单位电话">
{{ record.workPhone }}
</a-descriptions-item>
<a-descriptions-item label="开户行">
{{ record.bankName }}
</a-descriptions-item>
<a-descriptions-item label="车牌号">
{{ record.carNumber }}
</a-descriptions-item>
<a-descriptions-item label="饭卡号">
{{ record.mealCard }}
</a-descriptions-item>
</a-descriptions>
</template>
<!--操作栏--> <!--操作栏-->
<template #action="{ record }"> <template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" /> <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
@ -59,12 +31,12 @@
<!--字段回显插槽--> <!--字段回显插槽-->
<template #bodyCell="{ column, record, index, text }"> <template #bodyCell="{ column, record, index, text }">
<span v-if="column.dataIndex === 'sex'"> <span v-if="column.dataIndex === 'sex'">
<a-tag v-if="record.dormitoryType === 0" color="green"></a-tag> <a-tag v-if="record.sex === 0" color="green"></a-tag>
<a-tag v-else-if="record.dormitoryType !== 0" color="red"></a-tag> <a-tag v-else-if="record.sex !== 0" color="red"></a-tag>
</span> </span>
<span v-if="column.dataIndex === 'status'"> <span v-if="column.dataIndex === 'status'">
<a-tag v-if="record.dormitoryStatus === 0" color="green">已报到</a-tag> <a-tag v-if="record.status === 0" color="green">已报到</a-tag>
<a-tag v-else-if="record.dormitoryStatus !== 0" color="red">未报到</a-tag> <a-tag v-else-if="record.status !== 0" color="red">未报到</a-tag>
</span> </span>
<span v-if="column.dataIndex === 'carStatus'"> <span v-if="column.dataIndex === 'carStatus'">
<a-tag v-if="record.carStatus === 0" color="green"></a-tag> <a-tag v-if="record.carStatus === 0" color="green"></a-tag>
@ -74,6 +46,9 @@
<a-tag v-if="record.dormitoryStatus === 0" color="green"></a-tag> <a-tag v-if="record.dormitoryStatus === 0" color="green"></a-tag>
<a-tag v-else-if="record.dormitoryStatus !== 0" color="red"></a-tag> <a-tag v-else-if="record.dormitoryStatus !== 0" color="red"></a-tag>
</span> </span>
<span v-if="column.dataIndex === 'majorId'">
<span>{{ record.majorIdDescription }}</span>
</span>
</template> </template>
</BasicTable> </BasicTable>
<!-- 表单区域 --> <!-- 表单区域 -->
@ -81,14 +56,14 @@
</div> </div>
</template> </template>
<script lang="ts" name="cees-ceesWaiTeacher" setup> <script lang="tsx" name="cees-ceesWaiTeacher" setup>
import { ref, reactive, computed, unref,onMounted } from 'vue'; import { ref, reactive, computed, unref, onMounted } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table'; import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'; import { useListPage } from '/@/hooks/system/useListPage';
import CeesWaiTeacherModal from './components/CeesWaiTeacherModal.vue'; import CeesWaiTeacherModal from './components/CeesWaiTeacherModal.vue';
import { columns, searchFormSchema, superQuerySchema,updateGroupOptions } from './CeesWaiTeacher.data'; import { columns, searchFormSchema, superQuerySchema, updateGroupOptions } from './CeesWaiTeacher.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl,getGroup } from './CeesWaiTeacher.api'; import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, getGroup } from './CeesWaiTeacher.api';
import { downloadFile } from '/@/utils/common/renderUtils'; import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
const queryParam = reactive<any>({}); const queryParam = reactive<any>({});
@ -129,21 +104,32 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
success: handleSuccess, success: handleSuccess,
}, },
}); });
// // rowKey key
const expandedRowKeys = ref<string[]>(["0"]); const expandedKeys = ref<string[]>(['1']); //
const expandable = { //
expandedRowKeys, const renderExpandedRow = (record: Record<string, any>) => {
expandedRowRender: (record) => ( return (
1111 <a-descriptions column = { 2} >
), <a-descriptions - item label = "身份证号" > { record.record.identityId } </a-descriptions-item>
}; < a - descriptions - item label = "银行卡号" > { record.record.pyCard } </a-descriptions-item>
// < a - descriptions - item label = "工作单位" > { record.record.workName } </a-descriptions-item>
const handleExpand = (expanded, record) => { < a - descriptions - item label = "开户所在地" > { record.record.bankAddress } </a-descriptions-item>
console.log(expanded, record, 'expand'); < a - descriptions - item label = "单位电话" > { record.record.workPhone } </a-descriptions-item>
< a - descriptions - item label = "开户行" > { record.record.bankName } </a-descriptions-item>
< a - descriptions - item label = "车牌号" > { record.record.carNumber } </a-descriptions-item>
< a - descriptions - item label = "饭卡号" > { record.record.mealCard } </a-descriptions-item>
</a-descriptions>
);
};
// / expandedKeys
const handleExpand = (expanded: boolean, record: Record<string, any>) => {
console.log('展开/收起', expanded, record);
if (expanded) { if (expanded) {
expandedRowKeys.value = [record.id]; // if (!expandedKeys.value.includes(record.id)) {
expandedKeys.value.push(record.id);
}
} else { } else {
expandedRowKeys.value = []; // expandedKeys.value = expandedKeys.value.filter((key) => key !== record.id);
} }
}; };
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext; const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;