修改表单细节
This commit is contained in:
parent
dbc9d8b458
commit
6a46bdb45a
|
@ -2,6 +2,11 @@ import { BasicColumn } from '/@/components/Table';
|
||||||
import { FormSchema } from '/@/components/Table';
|
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';
|
||||||
|
// 学科过滤方法
|
||||||
|
const filterMajor = (value, row) => {
|
||||||
|
console.log(value, row); // 打印过滤值和行数据
|
||||||
|
return row === value;
|
||||||
|
};
|
||||||
//列表数据
|
//列表数据
|
||||||
export const columns: BasicColumn[] = [
|
export const columns: BasicColumn[] = [
|
||||||
{
|
{
|
||||||
|
@ -28,6 +33,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: '所属分组',
|
||||||
|
@ -45,13 +59,11 @@ export const columns: BasicColumn[] = [
|
||||||
// dataIndex: 'userMajorId',
|
// dataIndex: 'userMajorId',
|
||||||
//},
|
//},
|
||||||
|
|
||||||
|
|
||||||
//{
|
//{
|
||||||
// title: '使用次数',
|
// title: '使用次数',
|
||||||
// align: 'center',
|
// align: 'center',
|
||||||
// dataIndex: 'numberuse',
|
// dataIndex: 'numberuse',
|
||||||
//},
|
//},
|
||||||
|
|
||||||
];
|
];
|
||||||
//查询数据
|
//查询数据
|
||||||
export const searchFormSchema: FormSchema[] = [
|
export const searchFormSchema: FormSchema[] = [
|
||||||
|
@ -64,45 +76,29 @@ 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: '请输入姓名!' }];
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
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: '手机号',
|
||||||
|
@ -112,22 +108,47 @@ export const formSchema: FormSchema[] = [
|
||||||
return [{ required: true, message: '请输入手机号!' }];
|
return [{ required: true, message: '请输入手机号!' }];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
//{
|
||||||
|
// label: '学科',
|
||||||
|
// field: 'majorId',
|
||||||
|
// component: 'Select',
|
||||||
|
// componentProps: {
|
||||||
|
// options: [
|
||||||
|
// { label: '语文', value: 1 },
|
||||||
|
// { label: '地理', value: 4 },
|
||||||
|
// { label: '历史', value: 7 },
|
||||||
|
// { label: '政治', value: 8 },
|
||||||
|
// ],
|
||||||
|
// },
|
||||||
|
// dynamicRules: ({ model, schema }) => {
|
||||||
|
// return [{ required: true, message: '请选择学科!' }];
|
||||||
|
// },
|
||||||
|
//},
|
||||||
|
//{
|
||||||
|
// label: '用户专业id',
|
||||||
|
// field: 'userMajorId',
|
||||||
|
// component: 'Input',
|
||||||
|
// dynamicRules: ({ model, schema }) => {
|
||||||
|
// return [{ required: true, message: '请输入用户专业id!' }];
|
||||||
|
// },
|
||||||
|
//},
|
||||||
|
|
||||||
{
|
{
|
||||||
label: '所属分组',
|
label: '所属组',
|
||||||
field: 'groupId',
|
field: 'groupId',
|
||||||
component: 'InputNumber',
|
component: 'InputNumber',
|
||||||
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',
|
||||||
|
@ -138,17 +159,17 @@ 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
|
||||||
{
|
//{
|
||||||
label: '',
|
// label: '',
|
||||||
field: 'id',
|
// field: 'id',
|
||||||
component: 'Input',
|
// component: 'Input',
|
||||||
show: false,
|
// show: false,
|
||||||
},
|
//},
|
||||||
];
|
];
|
||||||
|
|
||||||
// 高级查询数据
|
// 高级查询数据
|
||||||
|
|
|
@ -16,7 +16,8 @@
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
</a-menu>
|
</a-menu>
|
||||||
</template>
|
</template>
|
||||||
<a-button>批量操作
|
<a-button
|
||||||
|
>批量操作
|
||||||
<Icon icon="mdi:chevron-down" />
|
<Icon icon="mdi:chevron-down" />
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
|
@ -33,6 +34,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>
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
|
|
|
@ -71,16 +71,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[] = [
|
||||||
|
@ -93,54 +93,31 @@ 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: '请输入学生名!' }];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '学科',
|
label: '学号',
|
||||||
field: 'majorId',
|
|
||||||
component: 'Select',
|
|
||||||
componentProps: {
|
|
||||||
options: [
|
|
||||||
{ label: '语文', value: 1 },
|
|
||||||
{ label: '地理', value: 4 },
|
|
||||||
{ label: '历史', value: 7 },
|
|
||||||
{ label: '政治', value: 8 },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
dynamicRules: ({ model, schema }) => {
|
|
||||||
return [{ required: true, message: '请选择学科!' }];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '用户专业id',
|
|
||||||
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: '请输入学号!' }];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
label: '手机号',
|
label: '手机号',
|
||||||
field: 'phone',
|
field: 'phone',
|
||||||
|
@ -149,6 +126,39 @@ export const formSchema: FormSchema[] = [
|
||||||
return [{ required: true, message: '请输入手机号!' }];
|
return [{ required: true, message: '请输入手机号!' }];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
//{
|
||||||
|
// label: '学科',
|
||||||
|
// field: 'majorId',
|
||||||
|
// component: 'Select',
|
||||||
|
// componentProps: {
|
||||||
|
// options: [
|
||||||
|
// { label: '语文', value: 1 },
|
||||||
|
// { label: '地理', value: 4 },
|
||||||
|
// { label: '历史', value: 7 },
|
||||||
|
// { label: '政治', value: 8 },
|
||||||
|
// ],
|
||||||
|
// },
|
||||||
|
// dynamicRules: ({ model, schema }) => {
|
||||||
|
// return [{ required: true, message: '请选择学科!' }];
|
||||||
|
// },
|
||||||
|
//},
|
||||||
|
//{
|
||||||
|
// label: '用户专业id',
|
||||||
|
// field: 'userMajorId',
|
||||||
|
// component: 'Input',
|
||||||
|
// dynamicRules: ({ model, schema }) => {
|
||||||
|
// return [{ required: true, message: '请输入用户专业id!' }];
|
||||||
|
// },
|
||||||
|
//},
|
||||||
|
|
||||||
|
{
|
||||||
|
label: '所属组',
|
||||||
|
field: 'groupId',
|
||||||
|
component: 'InputNumber',
|
||||||
|
//dynamicRules: ({ model, schema }) => {
|
||||||
|
// return [{ required: true, message: '请输入组id!' }];
|
||||||
|
//},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '是否第一次阅卷',
|
label: '是否第一次阅卷',
|
||||||
field: 'checked',
|
field: 'checked',
|
||||||
|
@ -159,47 +169,40 @@ 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: '组id',
|
|
||||||
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: '',
|
|
||||||
field: 'id',
|
|
||||||
component: 'Input',
|
|
||||||
show: false,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//{
|
||||||
|
// 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: '',
|
||||||
|
// field: 'id',
|
||||||
|
// component: 'Input',
|
||||||
|
// show: false,
|
||||||
|
//},
|
||||||
];
|
];
|
||||||
|
|
||||||
// 高级查询数据
|
// 高级查询数据
|
||||||
|
|
|
@ -38,6 +38,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>
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
|
|
|
@ -2,6 +2,12 @@ import { BasicColumn } from '/@/components/Table';
|
||||||
import { FormSchema } from '/@/components/Table';
|
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';
|
||||||
|
|
||||||
|
// 学科过滤方法
|
||||||
|
const filterMajor = (value, row) => {
|
||||||
|
console.log(value, row); // 打印过滤值和行数据
|
||||||
|
return row === value;
|
||||||
|
};
|
||||||
//列表数据
|
//列表数据
|
||||||
export const columns: BasicColumn[] = [
|
export const columns: BasicColumn[] = [
|
||||||
{
|
{
|
||||||
|
@ -28,6 +34,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: '手机号',
|
||||||
|
@ -54,82 +69,80 @@ export const columns: BasicColumn[] = [
|
||||||
align: 'center',
|
align: 'center',
|
||||||
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: '工作名称',
|
||||||
{
|
// align: 'center',
|
||||||
title: '工作名称',
|
// dataIndex: 'workName',
|
||||||
align: 'center',
|
//},
|
||||||
dataIndex: 'workName',
|
//{
|
||||||
},
|
// title: '固定电话',
|
||||||
{
|
// align: 'center',
|
||||||
title: '固定电话',
|
// dataIndex: 'workPhone',
|
||||||
align: 'center',
|
//},
|
||||||
dataIndex: 'workPhone',
|
//{
|
||||||
},
|
// title: '身份证',
|
||||||
{
|
// align: 'center',
|
||||||
title: '身份证',
|
// dataIndex: 'identityId',
|
||||||
align: 'center',
|
//},
|
||||||
dataIndex: 'identityId',
|
//{
|
||||||
},
|
// title: '车牌号',
|
||||||
{
|
// align: 'center',
|
||||||
title: '车牌号',
|
// dataIndex: 'carNumber',
|
||||||
align: 'center',
|
//},
|
||||||
dataIndex: 'carNumber',
|
//{
|
||||||
},
|
// title: '车辆是否入校',
|
||||||
{
|
// align: 'center',
|
||||||
title: '车辆是否入校',
|
// dataIndex: 'carStatus',
|
||||||
align: 'center',
|
//},
|
||||||
dataIndex: 'carStatus',
|
//{
|
||||||
},
|
// title: '是否住宿',
|
||||||
{
|
// align: 'center',
|
||||||
title: '是否住宿',
|
// dataIndex: 'dormitoryStatus',
|
||||||
align: 'center',
|
//},
|
||||||
dataIndex: 'dormitoryStatus',
|
//{
|
||||||
},
|
// title: '开户所在地',
|
||||||
{
|
// align: 'center',
|
||||||
title: '开户所在地',
|
// dataIndex: 'bankAddress',
|
||||||
align: 'center',
|
//},
|
||||||
dataIndex: 'bankAddress',
|
//{
|
||||||
},
|
// title: '开户行',
|
||||||
{
|
// align: 'center',
|
||||||
title: '开户行',
|
// dataIndex: 'bankName',
|
||||||
align: 'center',
|
//},
|
||||||
dataIndex: 'bankName',
|
//{
|
||||||
},
|
// title: '使用次数',
|
||||||
{
|
// align: 'center',
|
||||||
title: '使用次数',
|
// dataIndex: 'numberuse',
|
||||||
align: 'center',
|
//},
|
||||||
dataIndex: 'numberuse',
|
//{
|
||||||
},
|
// title: '状态',
|
||||||
{
|
// align: 'center',
|
||||||
title: '状态',
|
// dataIndex: 'status',
|
||||||
align: 'center',
|
//},
|
||||||
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',
|
||||||
|
@ -147,22 +160,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',
|
||||||
|
@ -171,62 +168,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',
|
||||||
|
@ -236,12 +177,9 @@ export const formSchema: FormSchema[] = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '车牌号',
|
label: '年龄',
|
||||||
field: 'carNumber',
|
field: 'age',
|
||||||
component: 'Input',
|
component: 'InputNumber',
|
||||||
dynamicRules: ({ model, schema }) => {
|
|
||||||
return [{ required: true, message: '请输入车牌号!' }];
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '性别',
|
label: '性别',
|
||||||
|
@ -255,31 +193,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: '手机号',
|
||||||
|
field: 'phone',
|
||||||
|
component: 'Input',
|
||||||
|
//dynamicRules: ({ model, schema }) => {
|
||||||
|
// return [{ required: true, message: '请输入手机号!' }];
|
||||||
|
//},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '住宿信息',
|
label: '职称',
|
||||||
field: 'dormitory',
|
field: 'jobTitle',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
dynamicRules: ({ model, schema }) => {
|
//dynamicRules: ({ model, schema }) => {
|
||||||
return [{ required: true, message: '请输入宿舍信息!' }];
|
// 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: '是否住宿',
|
||||||
|
@ -291,69 +307,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: '开户所在地',
|
label: '车辆是否入校',
|
||||||
field: 'bankAddress',
|
field: 'carStatus',
|
||||||
component: 'Input',
|
|
||||||
dynamicRules: ({ model, schema }) => {
|
|
||||||
return [{ required: true, message: '请输入开户所在地!' }];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '开户行',
|
|
||||||
field: 'bankName',
|
|
||||||
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',
|
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: 'id',
|
|
||||||
component: 'Input',
|
|
||||||
show: false,
|
|
||||||
},
|
},
|
||||||
|
//{
|
||||||
|
// 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: '',
|
||||||
|
// field: 'id',
|
||||||
|
// component: 'Input',
|
||||||
|
// show: false,
|
||||||
|
//},
|
||||||
];
|
];
|
||||||
|
|
||||||
// 高级查询数据
|
// 高级查询数据
|
||||||
export const superQuerySchema = {
|
export const superQuerySchema = {
|
||||||
userId: { title: '用户ID', order: 0, view: 'text', type: 'string' },
|
userId: { title: '用户ID', order: 0, view: 'text', type: 'string' },
|
||||||
majorId: { title: '学科', order: 1, view: 'number', type: 'number' },
|
majorId: { title: '学科', order: 1, view: 'text', type: 'number' },
|
||||||
userMajorId: { title: '用户专业id', order: 2, view: 'text', type: 'string' },
|
userMajorId: { title: '用户专业id', order: 2, view: 'text', type: 'string' },
|
||||||
userName: { title: '姓名', order: 3, view: 'text', type: 'string' },
|
userName: { title: '姓名', order: 3, view: 'text', type: 'string' },
|
||||||
phone: { title: '手机号', order: 4, view: 'text', type: 'string' },
|
phone: { title: '手机号', order: 4, view: 'text', type: 'string' },
|
||||||
|
|
|
@ -1,8 +1,15 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<!--引用表格-->
|
<!--引用表格-->
|
||||||
<BasicTable @register="registerTable" :rowSelection="rowSelection" :expanded-row-keys="expandedRowKeys"
|
<BasicTable
|
||||||
:expandable="expandable" @expanded-rows-change="handleExpand">
|
@register="registerTable"
|
||||||
|
:rowSelection="rowSelection"
|
||||||
|
ref="tableRef"
|
||||||
|
:expandedRowKeys="expandedKeys"
|
||||||
|
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>
|
||||||
|
@ -17,41 +24,14 @@
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
</a-menu>
|
</a-menu>
|
||||||
</template>
|
</template>
|
||||||
<a-button>批量操作
|
<a-button
|
||||||
|
>批量操作
|
||||||
<Icon icon="mdi:chevron-down" />
|
<Icon icon="mdi:chevron-down" />
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
<!-- 高级查询 -->
|
<!-- 高级查询 -->
|
||||||
<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 +39,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 +54,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,7 +64,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" name="cees-ceesWaiTeacher" setup>
|
<script lang="tsx" name="cees-ceesWaiTeacher" setup>
|
||||||
import { ref, reactive, computed, unref } from 'vue';
|
import { ref, reactive, computed, unref } 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';
|
||||||
|
@ -129,21 +112,33 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
success: handleSuccess,
|
success: handleSuccess,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
// 展开的行
|
|
||||||
const expandedRowKeys = ref<string[]>(["0"]);
|
// 指定默认展开的行(根据 rowKey 属性传入行的 key 值)
|
||||||
const expandable = {
|
const expandedKeys = ref<string[]>(['1']); // 默认展开第一行
|
||||||
expandedRowKeys,
|
// 定义展开行内容的渲染函数
|
||||||
expandedRowRender: (record) => (
|
const renderExpandedRow = (record: Record<string, any>) => {
|
||||||
1111
|
return (
|
||||||
),
|
<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>
|
||||||
|
<a-descriptions-item label="开户所在地">{record.record.bankAddress}</a-descriptions-item>
|
||||||
|
<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, record) => {
|
const handleExpand = (expanded: boolean, record: Record<string, any>) => {
|
||||||
console.log(expanded, record, 'expand');
|
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;
|
||||||
|
|
Loading…
Reference in New Issue