完善表单细节

This commit is contained in:
Cool 2025-03-03 19:41:01 +08:00
parent 2beaa3b57e
commit 34f7309717
10 changed files with 1215 additions and 1236 deletions

View File

@ -1,97 +1,101 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
{
title: '宿舍信息',
align:"center",
dataIndex: 'dormitory'
},
{
align: 'center',
dataIndex: 'dormitory',
},
{
title: '宿舍类型(男/女)',
align:"center",
dataIndex: 'dormitoryType'
},
{
align: 'center',
dataIndex: 'dormitoryType',
},
{
title: '宿舍人数',
align:"center",
dataIndex: 'dormitoryNum'
},
{
align: 'center',
dataIndex: 'dormitoryNum',
},
{
title: '状态',
align:"center",
dataIndex: 'dormitoryStatus'
},
align: 'center',
dataIndex: 'dormitoryStatus',
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
export const searchFormSchema: FormSchema[] = [];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '宿舍信息',
field: 'dormitory',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入宿舍信息!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入宿舍信息!' }];
},
},
{
label: '男/女',
field: 'dormitoryType',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入男/女!'},
];
},
component: 'RadioGroup',
componentProps: {
options: [
{ label: '男', value: 0 },
{ label: '女', value: 1 },
],
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请选择男/女!' }];
},
},
{
label: '宿舍人数',
field: 'dormitoryNum',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入宿舍人数!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入宿舍人数!' }];
},
},
{
label: '宿舍状态0没满1已满',
label: '宿舍状态',
//0没满1已满
field: 'dormitoryStatus',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入宿舍状态0没满1已满!'},
];
},
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,
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
// 高级查询数据
export const superQuerySchema = {
dormitory: {title: '宿舍信息',order: 0,view: 'text', type: 'string',},
dormitoryType: {title: '男/女',order: 1,view: 'text', type: 'string',},
dormitoryNum: {title: '宿舍人数',order: 2,view: 'number', type: 'number',},
dormitoryStatus: {title: '宿舍状态0没满1已满',order: 3,view: 'text', type: 'string',},
dormitory: { title: '宿舍信息', order: 0, view: 'text', type: 'string' },
dormitoryType: { title: '男/女', order: 1, view: 'text', type: 'string' },
dormitoryNum: { title: '宿舍人数', order: 2, view: 'number', type: 'number' },
dormitoryStatus: { title: '宿舍状态0没满1已满', order: 3, view: 'text', type: 'string' },
};
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[] {
// 默认和原始表单保持一致 如果流程中配置了权限数据这里需要单独处理formSchema
return formSchema;
}
}

View File

@ -1,93 +1,101 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined" />
删除
</a-menu-item>
</a-menu>
</template>
<a-button
>批量操作
<Icon icon="mdi:chevron-down" />
</a-button>
</a-dropdown>
<!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<!--操作栏-->
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template>
<!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }">
<template #bodyCell="{ column, record, index, text }">
<span v-if="column.dataIndex === 'dormitoryType'">
<a-tag v-if="record.dormitoryType === 0" color="green"></a-tag>
<a-tag v-else-if="record.dormitoryType !== 0" color="red"></a-tag>
</span>
<span v-if="column.dataIndex === 'dormitoryStatus'">
<a-tag v-if="record.dormitoryStatus === 0" color="green">未满</a-tag>
<a-tag v-else-if="record.dormitoryStatus !== 0" color="red">已满</a-tag>
</span>
</template>
</BasicTable>
<!-- 表单区域 -->
<CeesDormitoryInfoModal @register="registerModal" @success="handleSuccess"></CeesDormitoryInfoModal>
<CeesDormitoryInfoModal @register="registerModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" name="CEES-ceesDormitoryInfo" setup>
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 CeesDormitoryInfoModal from './components/CeesDormitoryInfoModal.vue'
import {columns, searchFormSchema, superQuerySchema} from './CeesDormitoryInfo.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './CeesDormitoryInfo.api';
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 CeesDormitoryInfoModal from './components/CeesDormitoryInfoModal.vue';
import { columns, searchFormSchema, superQuerySchema } from './CeesDormitoryInfo.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './CeesDormitoryInfo.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();
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);
},
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '宿舍信息表',
api: list,
columns,
canResize: false,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true,
showAdvancedButton: true,
fieldMapToNumber: [],
fieldMapToTime: [],
},
exportConfig: {
name:"宿舍信息表",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
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
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
//
const superQueryConfig = reactive(superQuerySchema);
@ -101,86 +109,83 @@
});
reload();
}
/**
* 新增事件
*/
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
}
}
]
}
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
},
];
}
</script>
<style scoped>
</style>
<style scoped></style>

View File

@ -1,70 +1,70 @@
<template>
<div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm>
<div style="width: 100%;text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary"> </a-button>
</div>
<div style="min-height: 400px">
<BasicForm @register="registerForm" />
<div style="width: 100%; text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary"> </a-button>
</div>
</div>
</template>
<script lang="ts">
import {BasicForm, useForm} from '/@/components/Form/index';
import {computed, defineComponent} from 'vue';
import {defHttp} from '/@/utils/http/axios';
import { propTypes } from '/@/utils/propTypes';
import {getBpmFormSchema} from '../CeesDormitoryInfo.data';
import {saveOrUpdate} from '../CeesDormitoryInfo.api';
export default defineComponent({
name: "CeesDormitoryInfoForm",
components:{
BasicForm
},
props:{
formData: propTypes.object.def({}),
formBpm: propTypes.bool.def(true),
},
setup(props){
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
labelWidth: 150,
schemas: getBpmFormSchema(props.formData),
showActionButtonGroup: false,
baseColProps: {span: 24}
});
import { BasicForm, useForm } from '/@/components/Form/index';
import { computed, defineComponent } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { propTypes } from '/@/utils/propTypes';
import { getBpmFormSchema } from '../CeesDormitoryInfo.data';
import { saveOrUpdate } from '../CeesDormitoryInfo.api';
const formDisabled = computed(()=>{
if(props.formData.disabled === false){
return false;
}
return true;
});
export default defineComponent({
name: 'CeesDormitoryInfoForm',
components: {
BasicForm,
},
props: {
formData: propTypes.object.def({}),
formBpm: propTypes.bool.def(true),
},
setup(props) {
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
labelWidth: 150,
schemas: getBpmFormSchema(props.formData),
showActionButtonGroup: false,
baseColProps: { span: 24 },
});
let formData = {};
const queryByIdUrl = '/CEES/ceesDormitoryInfo/queryById';
async function initFormData(){
let params = {id: props.formData.dataId};
const data = await defHttp.get({url: queryByIdUrl, params});
formData = {...data}
//
await setFieldsValue(formData);
//
await setProps({disabled: formDisabled.value})
}
async function submitForm() {
let data = getFieldsValue();
let params = Object.assign({}, formData, data);
console.log('表单数据', params)
await saveOrUpdate(params, true)
}
initFormData();
return {
registerForm,
formDisabled,
submitForm,
}
const formDisabled = computed(() => {
if (props.formData.disabled === false) {
return false;
}
});
</script>
return true;
});
let formData = {};
const queryByIdUrl = '/CEES/ceesDormitoryInfo/queryById';
async function initFormData() {
let params = { id: props.formData.dataId };
const data = await defHttp.get({ url: queryByIdUrl, params });
formData = { ...data };
//
await setFieldsValue(formData);
//
await setProps({ disabled: formDisabled.value });
}
async function submitForm() {
let data = getFieldsValue();
let params = Object.assign({}, formData, data);
console.log('表单数据', params);
await saveOrUpdate(params, true);
}
initFormData();
return {
registerForm,
formDisabled,
submitForm,
};
},
});
</script>

View File

@ -1,66 +1,66 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
<BasicForm @register="registerForm"/>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../CeesDormitoryInfo.data';
import {saveOrUpdate} from '../CeesDormitoryInfo.api';
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
//
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
//labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: {span: 24}
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} finally {
setModalProps({confirmLoading: false});
}
import { ref, computed, unref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from '../CeesDormitoryInfo.data';
import { saveOrUpdate } from '../CeesDormitoryInfo.api';
// Emits
const emit = defineEmits(['register', 'success']);
const isUpdate = ref(true);
//
const [registerForm, { setProps, resetFields, setFieldsValue, validate }] = useForm({
//labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: { span: 24 },
});
//
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter });
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({ confirmLoading: true });
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} finally {
setModalProps({ confirmLoading: false });
}
}
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number){
width: 100%
}
/** 时间和数字输入框样式 */
:deep(.ant-input-number) {
width: 100%;
}
:deep(.ant-calendar-picker){
width: 100%
}
</style>
:deep(.ant-calendar-picker) {
width: 100%;
}
</style>

View File

@ -1,63 +1,63 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
{
title: '用户id',
align:"center",
dataIndex: 'userId'
},
{
align: 'center',
dataIndex: 'userId',
},
{
title: '用户名',
align:"center",
dataIndex: 'userName'
},
{
align: 'center',
dataIndex: 'userName',
},
{
title: '专业id,0表示未选择',
align:"center",
dataIndex: 'majorId'
},
{
align: 'center',
dataIndex: 'majorId',
},
{
title: '用户专业id',
align:"center",
dataIndex: 'userMajorId'
},
{
align: 'center',
dataIndex: 'userMajorId',
},
{
title: '用户专业id',
align:"center",
dataIndex: 'teacherId'
},
{
align: 'center',
dataIndex: 'teacherId',
},
{
title: '手机号',
align:"center",
dataIndex: 'phone'
},
{
align: 'center',
dataIndex: 'phone',
},
{
title: '组id',
align:"center",
dataIndex: 'groupId'
},
{
align: 'center',
dataIndex: 'groupId',
},
{
title: '使用次数',
align:"center",
dataIndex: 'numberuse'
},
{
title: '状态0正常 1禁用',
align:"center",
dataIndex: 'status'
},
align: 'center',
dataIndex: 'numberuse',
},
{
title: '状态',
align: 'center',
dataIndex: 'status',
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "用户名",
field: 'userName',
component: 'Input',
//colProps: {span: 6},
},
{
label: '用户名',
field: 'userName',
component: 'Input',
//colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
@ -65,119 +65,107 @@ export const formSchema: FormSchema[] = [
label: '用户id',
field: 'userId',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入用户id!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入用户id!' }];
},
},
{
label: '用户名',
field: 'userName',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入用户名!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入用户名!' }];
},
},
{
label: '专业id,0表示未选择',
field: 'majorId',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入专业id,0表示未选择!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入专业id,0表示未选择!' }];
},
},
{
label: '用户专业id',
field: 'userMajorId',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入用户专业id!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入用户专业id!' }];
},
},
{
label: '用户专业id',
field: 'teacherId',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入用户专业id!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入用户专业id!' }];
},
},
{
label: '手机号',
field: 'phone',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入手机号!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入手机号!' }];
},
},
{
label: '组id',
field: 'groupId',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入组id!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入组id!' }];
},
},
{
label: '使用次数',
field: 'numberuse',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入使用次数!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入使用次数!' }];
},
},
{
label: '状态0正常 1禁用',
label: '状态',
field: 'status',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入状态0正常 1禁用!'},
];
},
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,
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
// 高级查询数据
export const superQuerySchema = {
userId: {title: '用户id',order: 0,view: 'text', type: 'string',},
userName: {title: '用户名',order: 1,view: 'text', type: 'string',},
majorId: {title: '专业id,0表示未选择',order: 2,view: 'number', type: 'number',},
userMajorId: {title: '用户专业id',order: 3,view: 'text', type: 'string',},
teacherId: {title: '用户专业id',order: 4,view: 'text', type: 'string',},
phone: {title: '手机号',order: 5,view: 'text', type: 'string',},
groupId: {title: '组id',order: 6,view: 'number', type: 'number',},
numberuse: {title: '使用次数',order: 7,view: 'number', type: 'number',},
status: {title: '状态0正常 1禁用',order: 8,view: 'number', type: 'number',},
userId: { title: '用户id', order: 0, view: 'text', type: 'string' },
userName: { title: '用户名', order: 1, view: 'text', type: 'string' },
majorId: { title: '专业id,0表示未选择', order: 2, view: 'number', type: 'number' },
userMajorId: { title: '用户专业id', order: 3, view: 'text', type: 'string' },
teacherId: { title: '用户专业id', order: 4, view: 'text', type: 'string' },
phone: { title: '手机号', order: 5, view: 'text', type: 'string' },
groupId: { title: '组id', order: 6, view: 'number', type: 'number' },
numberuse: { title: '使用次数', order: 7, view: 'number', type: 'number' },
status: { title: '状态0正常 1禁用', order: 8, view: 'number', type: 'number' },
};
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[] {
// 默认和原始表单保持一致 如果流程中配置了权限数据这里需要单独处理formSchema
return formSchema;
}
}

View File

@ -1,93 +1,96 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined" />
删除
</a-menu-item>
</a-menu>
</template>
<a-button
>批量操作
<Icon icon="mdi:chevron-down" />
</a-button>
</a-dropdown>
<!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<!--操作栏-->
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template>
<!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }">
<template #bodyCell="{ column, record, index, text }">
<span v-if="column.dataIndex === 'status'">
<a-tag v-if="record.status === 0" color="green">正常</a-tag>
<a-tag v-else-if="record.status !== 0" color="red">禁用</a-tag>
</span>
</template>
</BasicTable>
<!-- 表单区域 -->
<CeesLocalTeacherModal @register="registerModal" @success="handleSuccess"></CeesLocalTeacherModal>
<CeesLocalTeacherModal @register="registerModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" name="CEES-ceesLocalTeacher" setup>
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 { 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();
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);
},
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '本校教师表',
api: list,
columns,
canResize: false,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true,
showAdvancedButton: true,
fieldMapToNumber: [],
fieldMapToTime: [],
},
exportConfig: {
name:"本校教师表",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
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
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
//
const superQueryConfig = reactive(superQuerySchema);
@ -101,86 +104,83 @@
});
reload();
}
/**
* 新增事件
*/
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
}
}
]
}
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
},
];
}
</script>
<style scoped>
</style>
<style scoped></style>

View File

@ -1,16 +1,16 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
// 学科映射
const majorMap = {
1: '语文',
4: '地理',
7: '历史',
8: '政治',
};
1: '语文',
4: '地理',
7: '历史',
8: '政治',
};
// 根据 majorId 获取学科名称
const isMajor = (majorId) => {
return majorMap[majorId] || '未知学科';
@ -18,81 +18,78 @@ const isMajor = (majorId) => {
// 学科过滤方法
const filterMajor = (value, row) => {
console.log(value, row); // 打印过滤值和行数据
console.log(value, row); // 打印过滤值和行数据
return row === value;
};
//列表数据
export const columns: BasicColumn[] = [
{
{
title: '学生名',
align:"center",
dataIndex: 'userName'
},
{
align: 'center',
dataIndex: 'userName',
},
{
title: '用户ID',
align:"center",
dataIndex: 'userId'
},
{
align: 'center',
dataIndex: 'userId',
},
{
title: '学号',
align:"center",
dataIndex: 'studentId'
},
{
align: 'center',
dataIndex: 'studentId',
},
{
title: '手机号',
align:"center",
dataIndex: 'phone'
},
{
align: 'center',
dataIndex: 'phone',
},
{
title: '学科',
align:"center",
align: 'center',
dataIndex: 'majorId',
customRender: ({ text }) => {
return isMajor(text); // 根据 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), // 过滤方法
},
{
return isMajor(text); // 根据 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: '所属分组',
align:"center",
dataIndex: 'groupId'
},
{
align: 'center',
dataIndex: 'groupId',
},
{
title: '是否第一次阅卷',
align:"center",
align: 'center',
dataIndex: 'checked',
customRender: ({text}) => {
return text == 1 ? '是' : '否';
}
},
{
},
{
title: '使用次数',
align:"center",
dataIndex: 'numberuse'
},
{
title: '状态0正常 1禁用',
align:"center",
dataIndex: 'status'
},
align: 'center',
dataIndex: 'numberuse',
},
{
title: '状态',
align: 'center',
dataIndex: 'status',
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "用户名",
field: 'userName',
component: 'Input',
//colProps: {span: 6},
},
{
label: '用户名',
field: 'userName',
component: 'Input',
//colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
@ -100,21 +97,17 @@ export const formSchema: FormSchema[] = [
label: '用户id',
field: 'userId',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入用户id!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入用户id!' }];
},
},
{
label: '用户名',
field: 'userName',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入用户名!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入用户名!' }];
},
},
{
label: '学科',
@ -128,116 +121,106 @@ export const formSchema: FormSchema[] = [
{ label: '政治', value: 8 },
],
},
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请选择学科!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请选择学科!' }];
},
},
{
label: '用户专业id',
field: 'userMajorId',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入用户专业id!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入用户专业id!' }];
},
},
{
label: '学生id',
field: 'studentId',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入学生id!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入学生id!' }];
},
},
{
label: '手机号',
field: 'phone',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入手机号!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入手机号!' }];
},
},
{
label: '是否第一次阅卷',
field: 'checked',
component: 'RadioGroup',
componentProps: {
options: [
{ label: '是', value: 1 },
{ label: '否', value: 0 },
],
},
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请选择是否第一次阅卷!'},
];
},
options: [
{ label: '是', value: 0 },
{ label: '否', value: 1 },
],
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请选择是否第一次阅卷!' }];
},
},
{
label: '组id',
field: 'groupId',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入组id!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入组id!' }];
},
},
{
label: '使用次数',
field: 'numberuse',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入使用次数!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入使用次数!' }];
},
},
{
label: '状态0正常 1禁用',
label: '状态',
field: 'status',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入状态0正常 1禁用!'},
];
},
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,
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
// 高级查询数据
export const superQuerySchema = {
userId: {title: '用户id',order: 0,view: 'text', type: 'string',},
userName: {title: '用户名',order: 1,view: 'text', type: 'string',},
majorId: {title: '专业id,0表示未选择',order: 2,view: 'number', type: 'number',},
userMajorId: {title: '用户专业id',order: 3,view: 'text', type: 'string',},
studentId: {title: '学生id',order: 4,view: 'text', type: 'string',},
phone: {title: '手机号',order: 5,view: 'text', type: 'string',},
checked: {title: '是否第一次阅卷',order: 6,view: 'text', type: 'string',},
groupId: {title: '组id',order: 7,view: 'number', type: 'number',},
numberuse: {title: '使用次数',order: 8,view: 'number', type: 'number',},
status: {title: '状态0正常 1禁用',order: 9,view: 'number', type: 'number',},
userId: { title: '用户id', order: 0, view: 'text', type: 'string' },
userName: { title: '用户名', order: 1, view: 'text', type: 'string' },
majorId: { title: '专业id,0表示未选择', order: 2, view: 'number', type: 'number' },
userMajorId: { title: '用户专业id', order: 3, view: 'text', type: 'string' },
studentId: { title: '学生id', order: 4, view: 'text', type: 'string' },
phone: { title: '手机号', order: 5, view: 'text', type: 'string' },
checked: { title: '是否第一次阅卷', order: 6, view: 'text', type: 'string' },
groupId: { title: '组id', order: 7, view: 'number', type: 'number' },
numberuse: { title: '使用次数', order: 8, view: 'number', type: 'number' },
status: { title: '状态0正常 1禁用', order: 9, view: 'number', type: 'number' },
};
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[] {
// 默认和原始表单保持一致 如果流程中配置了权限数据这里需要单独处理formSchema
return formSchema;
}
}

View File

@ -11,13 +11,14 @@
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
<Icon icon="ant-design:delete-outlined" />
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="mdi:chevron-down"></Icon>
<a-button
>批量操作
<Icon icon="mdi:chevron-down" />
</a-button>
</a-dropdown>
<!-- 高级查询 -->
@ -28,157 +29,162 @@
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template>
<!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }">
<template #bodyCell="{ column, record, index, text }">
<span v-if="column.dataIndex === 'checked'">
<a-tag v-if="record.checked === 0" color="green"></a-tag>
<a-tag v-else-if="record.checked !== 0" color="red"></a-tag>
</span>
<span v-if="column.dataIndex === 'status'">
<a-tag v-if="record.status === 0" color="green">正常</a-tag>
<a-tag v-else-if="record.status !== 0" color="red">禁用</a-tag>
</span>
</template>
</BasicTable>
<!-- 表单区域 -->
<StudentModal @register="registerModal" @success="handleSuccess"></StudentModal>
<StudentModal @register="registerModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" name="cees-student" setup>
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 StudentModal from './components/StudentModal.vue'
import { columns, searchFormSchema, superQuerySchema } from './Student.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './Student.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: [
],
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 StudentModal from './components/StudentModal.vue';
import { columns, searchFormSchema, superQuerySchema } from './Student.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './Student.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);
},
},
actionColumn: {
width: 120,
fixed: 'right'
exportConfig: {
name: '研究生表',
url: getExportUrl,
params: queryParam,
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
importConfig: {
url: getImportUrl,
success: handleSuccess,
},
},
exportConfig: {
name: "研究生表",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
});
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
//
const superQueryConfig = reactive(superQuerySchema);
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
reload();
}
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
reload();
}
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
}
]
}
/**
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
}
}
]
}
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
},
];
}
</script>
<style scoped></style>
<style scoped></style>

View File

@ -1,139 +1,139 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
{
title: '用户id',
align:"center",
dataIndex: 'userId'
},
{
align: 'center',
dataIndex: 'userId',
},
{
title: '专业id',
align:"center",
dataIndex: 'majorId'
},
{
align: 'center',
dataIndex: 'majorId',
},
{
title: '用户专业id',
align:"center",
dataIndex: 'userMajorId'
},
{
align: 'center',
dataIndex: 'userMajorId',
},
{
title: '用户名',
align:"center",
dataIndex: 'userName'
},
{
align: 'center',
dataIndex: 'userName',
},
{
title: '手机号',
align:"center",
dataIndex: 'phone'
},
{
align: 'center',
dataIndex: 'phone',
},
{
title: '职称',
align:"center",
dataIndex: 'jobTitle'
},
{
align: 'center',
dataIndex: 'jobTitle',
},
{
title: '银行卡号',
align:"center",
dataIndex: 'pyCard'
},
{
align: 'center',
dataIndex: 'pyCard',
},
{
title: '饭卡',
align:"center",
dataIndex: 'mealCard'
},
{
align: 'center',
dataIndex: 'mealCard',
},
{
title: '办公位',
align:"center",
dataIndex: 'office'
},
{
align: 'center',
dataIndex: 'office',
},
{
title: '工作名称',
align:"center",
dataIndex: 'workName'
},
{
align: 'center',
dataIndex: 'workName',
},
{
title: '固定电话',
align:"center",
dataIndex: 'workPhone'
},
{
align: 'center',
dataIndex: 'workPhone',
},
{
title: '身份证',
align:"center",
dataIndex: 'identityId'
},
{
align: 'center',
dataIndex: 'identityId',
},
{
title: '车牌号',
align:"center",
dataIndex: 'carNumber'
},
{
align: 'center',
dataIndex: 'carNumber',
},
{
title: '性别',
align:"center",
dataIndex: 'sex'
},
{
align: 'center',
dataIndex: 'sex',
},
{
title: '年龄',
align:"center",
dataIndex: 'age'
},
{
align: 'center',
dataIndex: 'age',
},
{
title: '车辆是否入校',
align:"center",
dataIndex: 'carStatus'
},
{
align: 'center',
dataIndex: 'carStatus',
},
{
title: '宿舍信息',
align:"center",
dataIndex: 'dormitory'
},
{
align: 'center',
dataIndex: 'dormitory',
},
{
title: '是否住宿',
align:"center",
dataIndex: 'dormitoryStatus'
},
{
align: 'center',
dataIndex: 'dormitoryStatus',
},
{
title: '开户所在地',
align:"center",
dataIndex: 'bankAddress'
},
{
align: 'center',
dataIndex: 'bankAddress',
},
{
title: '开户行',
align:"center",
dataIndex: 'bankName'
},
{
align: 'center',
dataIndex: 'bankName',
},
{
title: '组id',
align:"center",
dataIndex: 'groupId'
},
{
align: 'center',
dataIndex: 'groupId',
},
{
title: '使用次数',
align:"center",
dataIndex: 'numberuse'
},
{
title: '状态0已报道 1未报到',
align:"center",
dataIndex: 'status'
},
align: 'center',
dataIndex: 'numberuse',
},
{
title: '状态',
align: 'center',
dataIndex: 'status',
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "专业id",
field: "majorId",
component: 'JRangeNumber',
//colProps: {span: 6},
},
{
label: "用户名",
field: 'userName',
component: 'Input',
//colProps: {span: 6},
},
{
label: '专业id',
field: 'majorId',
component: 'JRangeNumber',
//colProps: {span: 6},
},
{
label: '用户名',
field: 'userName',
component: 'Input',
//colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
@ -141,136 +141,116 @@ export const formSchema: FormSchema[] = [
label: '用户id',
field: 'userId',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入用户id!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入用户id!' }];
},
},
{
label: '专业id',
field: 'majorId',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入专业id!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入专业id!' }];
},
},
{
label: '用户专业id',
field: 'userMajorId',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入用户专业id!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入用户专业id!' }];
},
},
{
label: '用户名',
field: 'userName',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入用户名!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入用户名!' }];
},
},
{
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: '请输入职称!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入职称!' }];
},
},
{
label: '银行卡号',
field: 'pyCard',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入银行卡号!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入银行卡号!' }];
},
},
{
label: '饭卡',
field: 'mealCard',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入饭卡!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入饭卡!' }];
},
},
{
label: '办公位',
field: 'office',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入办公位!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入办公位!' }];
},
},
{
label: '工作名称',
field: 'workName',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入工作名称!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入工作名称!' }];
},
},
{
label: '固定电话',
field: 'workPhone',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入固定电话!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入固定电话!' }];
},
},
{
label: '身份证',
field: 'identityId',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入身份证!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入身份证!' }];
},
},
{
label: '车牌号',
field: 'carNumber',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入车牌号!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入车牌号!' }];
},
},
{
label: '性别',
field: 'sex',
component: 'Input',
component: 'RadioGroup',
componentProps: {
options: [
{ label: '男', value: 0 },
{ label: '女', value: 1 },
],
},
},
{
label: '年龄',
@ -280,124 +260,126 @@ export const formSchema: FormSchema[] = [
{
label: '车辆是否入校',
field: 'carStatus',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入车辆是否入校!'},
];
},
component: 'RadioGroup',
componentProps: {
options: [
{ label: '是', value: 0 },
{ label: '否', value: 1 },
],
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入车辆是否入校!' }];
},
},
{
label: '宿舍信息',
field: 'dormitory',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入宿舍信息!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入宿舍信息!' }];
},
},
{
label: '是否住宿',
field: 'dormitoryStatus',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入是否住宿!'},
];
},
component: 'RadioGroup',
componentProps: {
options: [
{ label: '是', value: 0 },
{ label: '否', value: 1 },
],
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入是否住宿!' }];
},
},
{
label: '开户所在地',
field: 'bankAddress',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入开户所在地!'},
];
},
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: '组id',
field: 'groupId',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入组id!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入组id!' }];
},
},
{
label: '使用次数',
field: 'numberuse',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入使用次数!'},
];
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入使用次数!' }];
},
},
{
label: '状态:0已报道 1未报到',
label: '状态:',
field: 'status',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入状态0已报道 1未报到!'},
];
},
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,
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
// 高级查询数据
export const superQuerySchema = {
userId: {title: '用户id',order: 0,view: 'text', type: 'string',},
majorId: {title: '专业id',order: 1,view: 'number', 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',},
jobTitle: {title: '职称',order: 5,view: 'text', type: 'string',},
pyCard: {title: '银行卡号',order: 6,view: 'text', type: 'string',},
mealCard: {title: '饭卡',order: 7,view: 'text', type: 'string',},
office: {title: '办公位',order: 8,view: 'text', type: 'string',},
workName: {title: '工作名称',order: 9,view: 'text', type: 'string',},
workPhone: {title: '固定电话',order: 10,view: 'text', type: 'string',},
identityId: {title: '身份证',order: 11,view: 'text', type: 'string',},
carNumber: {title: '车牌号',order: 12,view: 'text', type: 'string',},
sex: {title: '性别',order: 13,view: 'text', type: 'string',},
age: {title: '年龄',order: 14,view: 'number', type: 'number',},
carStatus: {title: '车辆是否入校',order: 15,view: 'number', type: 'number',},
dormitory: {title: '宿舍信息',order: 16,view: 'text', type: 'string',},
dormitoryStatus: {title: '是否住宿',order: 17,view: 'text', type: 'string',},
bankAddress: {title: '开户所在地',order: 18,view: 'text', type: 'string',},
bankName: {title: '开户行',order: 19,view: 'text', type: 'string',},
groupId: {title: '组id',order: 20,view: 'number', type: 'number',},
numberuse: {title: '使用次数',order: 21,view: 'number', type: 'number',},
status: {title: '状态0已报道 1未报到',order: 22,view: 'number', type: 'number',},
userId: { title: '用户id', order: 0, view: 'text', type: 'string' },
majorId: { title: '专业id', order: 1, view: 'number', 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' },
jobTitle: { title: '职称', order: 5, view: 'text', type: 'string' },
pyCard: { title: '银行卡号', order: 6, view: 'text', type: 'string' },
mealCard: { title: '饭卡', order: 7, view: 'text', type: 'string' },
office: { title: '办公位', order: 8, view: 'text', type: 'string' },
workName: { title: '工作名称', order: 9, view: 'text', type: 'string' },
workPhone: { title: '固定电话', order: 10, view: 'text', type: 'string' },
identityId: { title: '身份证', order: 11, view: 'text', type: 'string' },
carNumber: { title: '车牌号', order: 12, view: 'text', type: 'string' },
sex: { title: '性别', order: 13, view: 'text', type: 'string' },
age: { title: '年龄', order: 14, view: 'number', type: 'number' },
carStatus: { title: '车辆是否入校', order: 15, view: 'number', type: 'number' },
dormitory: { title: '宿舍信息', order: 16, view: 'text', type: 'string' },
dormitoryStatus: { title: '是否住宿', order: 17, view: 'text', type: 'string' },
bankAddress: { title: '开户所在地', order: 18, view: 'text', type: 'string' },
bankName: { title: '开户行', order: 19, view: 'text', type: 'string' },
groupId: { title: '组id', order: 20, view: 'number', type: 'number' },
numberuse: { title: '使用次数', order: 21, view: 'number', type: 'number' },
status: { title: '状态0已报道 1未报到', order: 22, view: 'number', type: 'number' },
};
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[] {
// 默认和原始表单保持一致 如果流程中配置了权限数据这里需要单独处理formSchema
return formSchema;
}
}

View File

@ -1,94 +1,108 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined" />
删除
</a-menu-item>
</a-menu>
</template>
<a-button
>批量操作
<Icon icon="mdi:chevron-down" />
</a-button>
</a-dropdown>
<!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<!--操作栏-->
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template>
<!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }">
<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>
</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>
</span>
<span v-if="column.dataIndex === 'carStatus'">
<a-tag v-if="record.carStatus === 0" color="green"></a-tag>
<a-tag v-else-if="record.carStatus !== 0" color="red"></a-tag>
</span>
<span v-if="column.dataIndex === 'dormitoryStatus'">
<a-tag v-if="record.dormitoryStatus === 0" color="green"></a-tag>
<a-tag v-else-if="record.dormitoryStatus !== 0" color="red"></a-tag>
</span>
</template>
</BasicTable>
<!-- 表单区域 -->
<CeesWaiTeacherModal @register="registerModal" @success="handleSuccess"></CeesWaiTeacherModal>
<CeesWaiTeacherModal @register="registerModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" name="cees-ceesWaiTeacher" setup>
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 CeesWaiTeacherModal from './components/CeesWaiTeacherModal.vue'
import {columns, searchFormSchema, superQuerySchema} from './CeesWaiTeacher.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './CeesWaiTeacher.api';
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 CeesWaiTeacherModal from './components/CeesWaiTeacherModal.vue';
import { columns, searchFormSchema, superQuerySchema } from './CeesWaiTeacher.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './CeesWaiTeacher.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();
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: [
['majorId', ['majorId_begin', 'majorId_end']],
],
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
fixed:'right'
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '外校老师管理',
api: list,
columns,
canResize: false,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true,
showAdvancedButton: true,
fieldMapToNumber: [['majorId', ['majorId_begin', 'majorId_end']]],
fieldMapToTime: [],
},
exportConfig: {
name:"外校老师管理",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
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
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
//
const superQueryConfig = reactive(superQuerySchema);
@ -102,86 +116,83 @@
});
reload();
}
/**
* 新增事件
*/
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
}
}
]
}
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
},
];
}
</script>
<style scoped>
</style>
<style scoped></style>