Merge branch 'new-1.0' of http://62.234.217.137:3000/Big-Data-Lab/CEES-manage into new-1.0
This commit is contained in:
commit
be44e6195a
|
@ -2,6 +2,11 @@ import { BasicColumn } from '/@/components/Table';
|
|||
import { FormSchema } from '/@/components/Table';
|
||||
import { rules } from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
// 学科过滤方法
|
||||
const filterMajor = (value, row) => {
|
||||
console.log(value, row); // 打印过滤值和行数据
|
||||
return row === value;
|
||||
};
|
||||
import { ref, onMounted,reactive } from 'vue';
|
||||
|
||||
const groupOptions=ref()
|
||||
|
@ -38,6 +43,15 @@ export const columns: BasicColumn[] = [
|
|||
title: '学科',
|
||||
align: 'center',
|
||||
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: '所属分组',
|
||||
|
@ -61,14 +75,12 @@ export const columns: BasicColumn[] = [
|
|||
// align: 'center',
|
||||
// dataIndex: 'userMajorId',
|
||||
//},
|
||||
|
||||
|
||||
|
||||
//{
|
||||
// title: '使用次数',
|
||||
// align: 'center',
|
||||
// dataIndex: 'numberuse',
|
||||
//},
|
||||
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
|
@ -81,45 +93,29 @@ export const searchFormSchema: FormSchema[] = [
|
|||
];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
//{
|
||||
// label: '用户id',
|
||||
// field: 'userId',
|
||||
// component: 'Input',
|
||||
// dynamicRules: ({ model, schema }) => {
|
||||
// return [{ required: true, message: '请输入用户id!' }];
|
||||
// },
|
||||
//},
|
||||
{
|
||||
label: '用户id',
|
||||
field: 'userId',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [{ required: true, message: '请输入用户id!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '用户名',
|
||||
label: '姓名',
|
||||
field: 'userName',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
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!' }];
|
||||
return [{ required: true, message: '请输入姓名!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '工号',
|
||||
field: 'teacherId',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [{ required: true, message: '请输入工号!' }];
|
||||
},
|
||||
//dynamicRules: ({ model, schema }) => {
|
||||
// return [{ required: true, message: '请输入工号!' }];
|
||||
//},
|
||||
},
|
||||
{
|
||||
label: '手机号',
|
||||
|
@ -129,8 +125,33 @@ export const formSchema: FormSchema[] = [
|
|||
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',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
|
@ -140,14 +161,14 @@ export const formSchema: FormSchema[] = [
|
|||
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: '是否第一次阅卷',
|
||||
field: 'status',
|
||||
|
@ -158,17 +179,17 @@ export const formSchema: FormSchema[] = [
|
|||
{ label: '否', value: 1 },
|
||||
],
|
||||
},
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [{ required: true, message: '请选择是否第一次阅卷!' }];
|
||||
},
|
||||
//dynamicRules: ({ model, schema }) => {
|
||||
// return [{ required: true, message: '请选择是否第一次阅卷!' }];
|
||||
//},
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
//{
|
||||
// label: '',
|
||||
// field: 'id',
|
||||
// component: 'Input',
|
||||
// show: false,
|
||||
//},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
<a-tag v-if="record.status === 0" color="green">是</a-tag>
|
||||
<a-tag v-else-if="record.status !== 0" color="red">否</a-tag>
|
||||
</span>
|
||||
<span v-if="column.dataIndex === 'majorId'">
|
||||
<span>{{ record.majorIdDescription }}</span>
|
||||
</span>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
|
@ -88,6 +91,53 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
|||
success: handleSuccess,
|
||||
},
|
||||
});
|
||||
import { ref, reactive, computed, unref } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import CeesLocalTeacherModal from './components/CeesLocalTeacherModal.vue';
|
||||
import { columns, searchFormSchema, superQuerySchema } from './CeesLocalTeacher.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './CeesLocalTeacher.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
const queryParam = reactive<any>({});
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const userStore = useUserStore();
|
||||
//注册model
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '本校教师表',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
formConfig: {
|
||||
//labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: '本校教师表',
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess,
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ export const columns: BasicColumn[] = [
|
|||
onFilter: (value, record) => filterMajor(value, record.majorId), // 过滤方法
|
||||
},
|
||||
{
|
||||
title: '所属分组',
|
||||
title: '所属分组',
|
||||
align: 'center',
|
||||
customRender: ({ text }) => {
|
||||
if (!groupOptions.value) {
|
||||
|
@ -89,16 +89,16 @@ export const columns: BasicColumn[] = [
|
|||
dataIndex: 'checked',
|
||||
},
|
||||
|
||||
{
|
||||
title: '使用次数',
|
||||
align: 'center',
|
||||
dataIndex: 'numberuse',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
dataIndex: 'status',
|
||||
},
|
||||
//{
|
||||
// title: '使用次数',
|
||||
// align: 'center',
|
||||
// dataIndex: 'numberuse',
|
||||
//},
|
||||
//{
|
||||
// title: '状态',
|
||||
// align: 'center',
|
||||
// dataIndex: 'status',
|
||||
//},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
|
@ -111,54 +111,31 @@ export const searchFormSchema: FormSchema[] = [
|
|||
];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
//{
|
||||
// label: '用户id',
|
||||
// field: 'userId',
|
||||
// component: 'Input',
|
||||
// dynamicRules: ({ model, schema }) => {
|
||||
// return [{ required: true, message: '请输入用户id!' }];
|
||||
// },
|
||||
//},
|
||||
{
|
||||
label: '用户id',
|
||||
field: 'userId',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [{ required: true, message: '请输入用户id!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '用户名',
|
||||
label: '学生名',
|
||||
field: 'userName',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
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: '学生id',
|
||||
label: '学号',
|
||||
field: 'studentId',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [{ required: true, message: '请输入学生id!' }];
|
||||
return [{ required: true, message: '请输入学号!' }];
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
label: '手机号',
|
||||
field: 'phone',
|
||||
|
@ -167,6 +144,39 @@ export const formSchema: FormSchema[] = [
|
|||
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: '是否第一次阅卷',
|
||||
field: 'checked',
|
||||
|
@ -177,9 +187,9 @@ export const formSchema: FormSchema[] = [
|
|||
{ label: '否', value: 1 },
|
||||
],
|
||||
},
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [{ required: true, message: '请选择是否第一次阅卷!' }];
|
||||
},
|
||||
//dynamicRules: ({ model, schema }) => {
|
||||
// return [{ required: true, message: '请选择是否第一次阅卷!' }];
|
||||
//},
|
||||
},
|
||||
{
|
||||
label: '所属分组',
|
||||
|
@ -192,35 +202,35 @@ export const formSchema: FormSchema[] = [
|
|||
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
|
||||
{
|
||||
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,
|
||||
//},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
|
|
|
@ -37,6 +37,9 @@
|
|||
<a-tag v-if="record.status === 0" color="green">正常</a-tag>
|
||||
<a-tag v-else-if="record.status !== 0" color="red">禁用</a-tag>
|
||||
</span>
|
||||
<span v-if="column.dataIndex === 'majorId'">
|
||||
<span>{{ record.majorIdDescription }}</span>
|
||||
</span>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
|
|
|
@ -2,6 +2,12 @@ import { BasicColumn } from '/@/components/Table';
|
|||
import { FormSchema } from '/@/components/Table';
|
||||
import { rules } from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
|
||||
// 学科过滤方法
|
||||
const filterMajor = (value, row) => {
|
||||
console.log(value, row); // 打印过滤值和行数据
|
||||
return row === value;
|
||||
};
|
||||
import { ref, onMounted,reactive } from 'vue';
|
||||
|
||||
const groupOptions=ref()
|
||||
|
@ -39,6 +45,15 @@ export const columns: BasicColumn[] = [
|
|||
title: '学科',
|
||||
align: 'center',
|
||||
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: '手机号',
|
||||
|
@ -72,82 +87,80 @@ export const columns: BasicColumn[] = [
|
|||
align: 'center',
|
||||
dataIndex: 'dormitory',
|
||||
},
|
||||
|
||||
{
|
||||
title: '用户专业id',
|
||||
align: 'center',
|
||||
dataIndex: 'userMajorId',
|
||||
},
|
||||
{
|
||||
title: '银行卡号',
|
||||
align: 'center',
|
||||
dataIndex: 'pyCard',
|
||||
},
|
||||
{
|
||||
title: '饭卡',
|
||||
align: 'center',
|
||||
dataIndex: 'mealCard',
|
||||
},
|
||||
|
||||
{
|
||||
title: '工作名称',
|
||||
align: 'center',
|
||||
dataIndex: 'workName',
|
||||
},
|
||||
{
|
||||
title: '固定电话',
|
||||
align: 'center',
|
||||
dataIndex: 'workPhone',
|
||||
},
|
||||
{
|
||||
title: '身份证',
|
||||
align: 'center',
|
||||
dataIndex: 'identityId',
|
||||
},
|
||||
{
|
||||
title: '车牌号',
|
||||
align: 'center',
|
||||
dataIndex: 'carNumber',
|
||||
},
|
||||
{
|
||||
title: '车辆是否入校',
|
||||
align: 'center',
|
||||
dataIndex: 'carStatus',
|
||||
},
|
||||
{
|
||||
title: '是否住宿',
|
||||
align: 'center',
|
||||
dataIndex: 'dormitoryStatus',
|
||||
},
|
||||
{
|
||||
title: '开户所在地',
|
||||
align: 'center',
|
||||
dataIndex: 'bankAddress',
|
||||
},
|
||||
{
|
||||
title: '开户行',
|
||||
align: 'center',
|
||||
dataIndex: 'bankName',
|
||||
},
|
||||
{
|
||||
title: '使用次数',
|
||||
align: 'center',
|
||||
dataIndex: 'numberuse',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
dataIndex: 'status',
|
||||
},
|
||||
//{
|
||||
// title: '用户专业id',
|
||||
// align: 'center',
|
||||
// dataIndex: 'userMajorId',
|
||||
//},
|
||||
//{
|
||||
// title: '银行卡号',
|
||||
// align: 'center',
|
||||
// dataIndex: 'pyCard',
|
||||
//},
|
||||
//{
|
||||
// title: '饭卡',
|
||||
// align: 'center',
|
||||
// dataIndex: 'mealCard',
|
||||
//},
|
||||
//{
|
||||
// title: '工作名称',
|
||||
// align: 'center',
|
||||
// dataIndex: 'workName',
|
||||
//},
|
||||
//{
|
||||
// title: '固定电话',
|
||||
// align: 'center',
|
||||
// dataIndex: 'workPhone',
|
||||
//},
|
||||
//{
|
||||
// title: '身份证',
|
||||
// align: 'center',
|
||||
// dataIndex: 'identityId',
|
||||
//},
|
||||
//{
|
||||
// title: '车牌号',
|
||||
// align: 'center',
|
||||
// dataIndex: 'carNumber',
|
||||
//},
|
||||
//{
|
||||
// title: '车辆是否入校',
|
||||
// align: 'center',
|
||||
// dataIndex: 'carStatus',
|
||||
//},
|
||||
//{
|
||||
// title: '是否住宿',
|
||||
// align: 'center',
|
||||
// dataIndex: 'dormitoryStatus',
|
||||
//},
|
||||
//{
|
||||
// title: '开户所在地',
|
||||
// align: 'center',
|
||||
// dataIndex: 'bankAddress',
|
||||
//},
|
||||
//{
|
||||
// title: '开户行',
|
||||
// align: 'center',
|
||||
// dataIndex: 'bankName',
|
||||
//},
|
||||
//{
|
||||
// title: '使用次数',
|
||||
// align: 'center',
|
||||
// dataIndex: 'numberuse',
|
||||
//},
|
||||
//{
|
||||
// title: '状态',
|
||||
// align: 'center',
|
||||
// dataIndex: 'status',
|
||||
//},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '学科',
|
||||
field: 'majorId',
|
||||
component: 'JRangeNumber',
|
||||
//colProps: {span: 6},
|
||||
},
|
||||
//{
|
||||
// label: '学科',
|
||||
// field: 'majorId',
|
||||
// component: 'JRangeNumber',
|
||||
// //colProps: {span: 6},
|
||||
//},
|
||||
{
|
||||
label: '姓名',
|
||||
field: 'userName',
|
||||
|
@ -165,22 +178,6 @@ export const formSchema: FormSchema[] = [
|
|||
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: '姓名',
|
||||
field: 'userName',
|
||||
|
@ -189,62 +186,6 @@ export const formSchema: FormSchema[] = [
|
|||
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: '身份证',
|
||||
field: 'identityId',
|
||||
|
@ -254,12 +195,9 @@ export const formSchema: FormSchema[] = [
|
|||
},
|
||||
},
|
||||
{
|
||||
label: '车牌号',
|
||||
field: 'carNumber',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [{ required: true, message: '请输入车牌号!' }];
|
||||
},
|
||||
label: '年龄',
|
||||
field: 'age',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
{
|
||||
label: '性别',
|
||||
|
@ -273,31 +211,109 @@ export const formSchema: FormSchema[] = [
|
|||
},
|
||||
},
|
||||
{
|
||||
label: '年龄',
|
||||
field: 'age',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
{
|
||||
label: '车辆是否入校',
|
||||
field: 'carStatus',
|
||||
component: 'RadioGroup',
|
||||
label: '学科',
|
||||
field: 'majorId',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '是', value: 0 },
|
||||
{ label: '否', value: 1 },
|
||||
{ label: '语文', value: 1 },
|
||||
{ label: '地理', value: 4 },
|
||||
{ label: '历史', value: 7 },
|
||||
{ label: '政治', value: 8 },
|
||||
],
|
||||
},
|
||||
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: 'dormitory',
|
||||
label: '手机号',
|
||||
field: 'phone',
|
||||
component: 'Input',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [{ required: true, message: '请输入宿舍信息!' }];
|
||||
},
|
||||
//dynamicRules: ({ model, schema }) => {
|
||||
// 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: '是否住宿',
|
||||
|
@ -309,25 +325,9 @@ export const formSchema: FormSchema[] = [
|
|||
{ label: '否', value: 1 },
|
||||
],
|
||||
},
|
||||
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: '请输入开户行!' }];
|
||||
},
|
||||
//dynamicRules: ({ model, schema }) => {
|
||||
// return [{ required: true, message: '请输入是否住宿!' }];
|
||||
//},
|
||||
},
|
||||
{
|
||||
label: '所属分组',
|
||||
|
@ -341,40 +341,72 @@ export const formSchema: FormSchema[] = [
|
|||
},
|
||||
},
|
||||
{
|
||||
label: '使用次数',
|
||||
field: 'numberuse',
|
||||
component: 'InputNumber',
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [{ required: true, message: '请输入使用次数!' }];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态:',
|
||||
field: 'status',
|
||||
label: '车辆是否入校',
|
||||
field: 'carStatus',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '已报到', value: 0 },
|
||||
{ label: '未报到', value: 1 },
|
||||
{ label: '是', value: 0 },
|
||||
{ label: '否', value: 1 },
|
||||
],
|
||||
},
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [{ required: true, message: '请选择状态' }];
|
||||
},
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
}
|
||||
//dynamicRules: ({ model, schema }) => {
|
||||
// return [{ required: true, message: '请输入车辆是否入校!' }];
|
||||
//},
|
||||
|
||||
//{
|
||||
// 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 = {
|
||||
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' },
|
||||
userName: { title: '姓名', order: 3, view: 'text', type: 'string' },
|
||||
phone: { title: '手机号', order: 4, view: 'text', type: 'string' },
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<template>
|
||||
<div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection" :expanded-row-keys="expandedRowKeys"
|
||||
:expandable="expandable" @expanded-rows-change="handleExpand">
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection" ref="tableRef" :expandedRowKeys="expandedKeys"
|
||||
rowKey="id" :expandedRowRender="renderExpandedRow" @expand="handleExpand">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
|
@ -24,34 +24,6 @@
|
|||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</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 }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
|
@ -59,12 +31,12 @@
|
|||
<!--字段回显插槽-->
|
||||
<template #bodyCell="{ column, record, index, text }">
|
||||
<span v-if="column.dataIndex === 'sex'">
|
||||
<a-tag v-if="record.dormitoryType === 0" color="green">男</a-tag>
|
||||
<a-tag v-else-if="record.dormitoryType !== 0" color="red">女</a-tag>
|
||||
<a-tag v-if="record.sex === 0" color="green">男</a-tag>
|
||||
<a-tag v-else-if="record.sex !== 0" color="red">女</a-tag>
|
||||
</span>
|
||||
<span v-if="column.dataIndex === 'status'">
|
||||
<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-if="record.status === 0" color="green">已报到</a-tag>
|
||||
<a-tag v-else-if="record.status !== 0" color="red">未报到</a-tag>
|
||||
</span>
|
||||
<span v-if="column.dataIndex === 'carStatus'">
|
||||
<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-else-if="record.dormitoryStatus !== 0" color="red">否</a-tag>
|
||||
</span>
|
||||
<span v-if="column.dataIndex === 'majorId'">
|
||||
<span>{{ record.majorIdDescription }}</span>
|
||||
</span>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
|
@ -81,14 +56,14 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="cees-ceesWaiTeacher" setup>
|
||||
import { ref, reactive, computed, unref,onMounted } from 'vue';
|
||||
<script lang="tsx" name="cees-ceesWaiTeacher" setup>
|
||||
import { ref, reactive, computed, unref, onMounted } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import CeesWaiTeacherModal from './components/CeesWaiTeacherModal.vue';
|
||||
import { columns, searchFormSchema, superQuerySchema,updateGroupOptions } from './CeesWaiTeacher.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl,getGroup } from './CeesWaiTeacher.api';
|
||||
import { columns, searchFormSchema, superQuerySchema, updateGroupOptions } from './CeesWaiTeacher.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, getGroup } from './CeesWaiTeacher.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
const queryParam = reactive<any>({});
|
||||
|
@ -129,21 +104,33 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
|||
success: handleSuccess,
|
||||
},
|
||||
});
|
||||
// 展开的行
|
||||
const expandedRowKeys = ref<string[]>(["0"]);
|
||||
const expandable = {
|
||||
expandedRowKeys,
|
||||
expandedRowRender: (record) => (
|
||||
1111
|
||||
),
|
||||
};
|
||||
// 处理展开事件
|
||||
const handleExpand = (expanded, record) => {
|
||||
console.log(expanded, record, 'expand');
|
||||
|
||||
// 指定默认展开的行(根据 rowKey 属性传入行的 key 值)
|
||||
const expandedKeys = ref<string[]>(['1']); // 默认展开第一行
|
||||
// 定义展开行内容的渲染函数
|
||||
const renderExpandedRow = (record: Record<string, any>) => {
|
||||
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: boolean, record: Record<string, any>) => {
|
||||
console.log('展开/收起', expanded, record);
|
||||
if (expanded) {
|
||||
expandedRowKeys.value = [record.id]; // 展开当前行
|
||||
if (!expandedKeys.value.includes(record.id)) {
|
||||
expandedKeys.value.push(record.id);
|
||||
}
|
||||
} else {
|
||||
expandedRowKeys.value = []; // 收起所有行
|
||||
expandedKeys.value = expandedKeys.value.filter((key) => key !== record.id);
|
||||
}
|
||||
};
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
|
Loading…
Reference in New Issue