feat: 全部表格开启enter自动提交查询

This commit is contained in:
louis 2024-03-08 10:41:59 +08:00
parent fdc30067de
commit e7cdafc6f1
6 changed files with 9 additions and 35 deletions

View File

@ -3,4 +3,3 @@ export enum ContractStatusEnum {
Approved = 1, // 已通过 Approved = 1, // 已通过
Rejected = 2, // 已拒绝 Rejected = 2, // 已拒绝
} }
// 使用es6数组方法遍历枚举

View File

@ -37,7 +37,7 @@
defineOptions({ defineOptions({
name: 'Contract', name: 'Contract',
}); });
const [DynamicTable, dynamicTableInstance] = useTable(); const [DynamicTable, dynamicTableInstance] = useTable({ formProps: { autoSubmitOnEnter: true } });
const [showModal] = useFormModal(); const [showModal] = useFormModal();
const [fnModal] = useModal(); const [fnModal] = useModal();
const isUploadPopupVisiable = ref(false); const isUploadPopupVisiable = ref(false);

View File

@ -32,16 +32,14 @@
import AttachmentManage from '@/components/business/attachment-manage/index.vue'; import AttachmentManage from '@/components/business/attachment-manage/index.vue';
import AttachmentUpload from '@/components/business/attachment-upload/index.vue'; import AttachmentUpload from '@/components/business/attachment-upload/index.vue';
import { ref, onMounted, type FunctionalComponent } from 'vue'; import { ref, onMounted, type FunctionalComponent } from 'vue';
import { useDictStore } from '@/store/modules/dict'; import { useDictStore } from '@/store/modules/dict';
defineOptions({ defineOptions({
name: 'Company', name: 'Company',
}); });
const [DynamicTable, dynamicTableInstance] = useTable(); const [DynamicTable, dynamicTableInstance] = useTable({ formProps: { autoSubmitOnEnter: true } });
const [showModal] = useFormModal(); const [showModal] = useFormModal();
const [fnModal] = useModal(); const [fnModal] = useModal();
const isUploadPopupVisiable = ref(false); const isUploadPopupVisiable = ref(false);
const dictStore = useDictStore();
// companyList;
let columns = ref<TableColumnItem[]>(); let columns = ref<TableColumnItem[]>();
onMounted(() => { onMounted(() => {
columns.value = [ columns.value = [
@ -59,7 +57,7 @@ import { useDictStore } from '@/store/modules/dict';
maxWidth: 150, maxWidth: 150,
width: 150, width: 150,
minWidth: 150, minWidth: 150,
fixed:'right', fixed: 'right',
dataIndex: 'ACTION', dataIndex: 'ACTION',
hideInSearch: true, hideInSearch: true,
actions: ({ record }) => [ actions: ({ record }) => [

View File

@ -31,20 +31,15 @@
import { onMounted, ref, type FunctionalComponent } from 'vue'; import { onMounted, ref, type FunctionalComponent } from 'vue';
import { DictEnum } from '@/enums/dictEnum'; import { DictEnum } from '@/enums/dictEnum';
import { useFormModal, useModal } from '@/hooks/useModal'; import { useFormModal, useModal } from '@/hooks/useModal';
import { contractSchemas } from './formSchemas';
import { formatToDate } from '@/utils/dateUtil';
import { Button } from 'ant-design-vue'; import { Button } from 'ant-design-vue';
import AttachmentManage from '@/components/business/attachment-manage/index.vue';
import AttachmentUpload from '@/components/business/attachment-upload/index.vue';
defineOptions({ defineOptions({
name: 'MaterialsInventory', name: 'MaterialsInventory',
}); });
const [DynamicTable, dynamicTableInstance] = useTable(); const [DynamicTable, dynamicTableInstance] = useTable();
const [showModal] = useFormModal();
const [fnModal] = useModal(); const [fnModal] = useModal();
const isUploadPopupVisiable = ref(false); const isUploadPopupVisiable = ref(false);
// contractList;
let columns = ref<TableColumnItem[]>(); let columns = ref<TableColumnItem[]>();
onMounted(() => { onMounted(() => {
columns.value = [ columns.value = [
@ -156,7 +151,6 @@
// schemas: contractSchemas(contractTypes.value), // schemas: contractSchemas(contractTypes.value),
// }, // },
// }); // });
// // // //
// if (record.id) { // if (record.id) {
// const info = await Api.contract.contractInfo({ id: record.id }); // const info = await Api.contract.contractInfo({ id: record.id });

View File

@ -37,27 +37,11 @@
defineOptions({ defineOptions({
name: 'Product', name: 'Product',
}); });
const [DynamicTable, dynamicTableInstance] = useTable(); const [DynamicTable, dynamicTableInstance] = useTable({ formProps: { autoSubmitOnEnter: true } });
const [showModal] = useFormModal(); const [showModal] = useFormModal();
const [fnModal] = useModal(); const [fnModal] = useModal();
const isUploadPopupVisiable = ref(false); const isUploadPopupVisiable = ref(false);
const dictStore = useDictStore();
let columns = ref<TableColumnItem[]>(); let columns = ref<TableColumnItem[]>();
// const loadData = async (params): Promise<API.ProductEntity> => {
// console.log('params', params);
// return Api.product.productList(params);
// };
// const loadTableData = async (params: any) => {
// const { company, ...res } = params;
// const data = await Api.product.productList({
// ...res,
// company,
// });
// return data;
// };
const exportFormatter = (columns: TableColumn[], tableData: any[]) => {
return { header: columns.map((item) => item.title), data: [] };
};
onMounted(() => { onMounted(() => {
columns.value = [ columns.value = [
...baseColumns, ...baseColumns,

View File

@ -32,15 +32,14 @@
import AttachmentManage from '@/components/business/attachment-manage/index.vue'; import AttachmentManage from '@/components/business/attachment-manage/index.vue';
import AttachmentUpload from '@/components/business/attachment-upload/index.vue'; import AttachmentUpload from '@/components/business/attachment-upload/index.vue';
import { ref, onMounted, type FunctionalComponent } from 'vue'; import { ref, onMounted, type FunctionalComponent } from 'vue';
import { useDictStore } from '@/store/modules/dict'; import { useDictStore } from '@/store/modules/dict';
defineOptions({ defineOptions({
name: 'Project', name: 'Project',
}); });
const [DynamicTable, dynamicTableInstance] = useTable(); const [DynamicTable, dynamicTableInstance] = useTable({ formProps: { autoSubmitOnEnter: true } });
const [showModal] = useFormModal(); const [showModal] = useFormModal();
const [fnModal] = useModal(); const [fnModal] = useModal();
const isUploadPopupVisiable = ref(false); const isUploadPopupVisiable = ref(false);
const dictStore = useDictStore();
// projectList; // projectList;
let columns = ref<TableColumnItem[]>(); let columns = ref<TableColumnItem[]>();
onMounted(() => { onMounted(() => {
@ -59,7 +58,7 @@ import { useDictStore } from '@/store/modules/dict';
maxWidth: 150, maxWidth: 150,
width: 150, width: 150,
minWidth: 150, minWidth: 150,
fixed:'right', fixed: 'right',
dataIndex: 'ACTION', dataIndex: 'ACTION',
hideInSearch: true, hideInSearch: true,
actions: ({ record }) => [ actions: ({ record }) => [