ow
This commit is contained in:
1 parent
133ba4c295
commit
b26bcfcd3b
3 files changed
+396
-241
No files matched your search
@@ -1,78 +1,146 @@
|
||||
<template>
|
||||
<search @on-submit="onSubmit" @on-print="onPrint" @on-reset="onReset" @use-pagination="onPagination"
|
||||
:is-modal="isModal" :loading="loading" :pagination="result" :rowSelectionType="selectionType"
|
||||
@on-row-dblclick="onRowDblclick" @on-select-change="onSelectChange">
|
||||
<template #control>
|
||||
<a-button type="primary" v-if="canCreate && !isModal" :icon="h(FileAddOutlined)"
|
||||
@click.prevent="onCreate">新增</a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
|
||||
</template>
|
||||
<template #footer>
|
||||
<div v-if="!isModal" class="page-footer">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="24" :sm="24">
|
||||
<a-row :gutter="[16, 8]">
|
||||
<a-space>
|
||||
<a-button type="primary" v-if="canView" :icon="h(FileTextOutlined)"
|
||||
:disabled="!(keys && keys.length ==1)" @click.prevent="onView">查看</a-button>
|
||||
<a-button type="primary" v-if="canAmend" :icon="h(EditOutlined)"
|
||||
:disabled="!(keys && keys.length ==1)" @click.prevent="onAmend">修改</a-button>
|
||||
<a-popconfirm title="确定是否删除这条记录?" ok-text="是" cancel-text="否" @confirm="onDelete">
|
||||
<a-button type="primary" danger :icon="h(DeleteOutlined)" v-if="canDelete"
|
||||
:disabled="!(keys && keys.length > 0)">删除</a-button>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</a-row>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
</search>
|
||||
<search
|
||||
@on-submit="onSubmit"
|
||||
@on-print="onPrint"
|
||||
@on-reset="onReset"
|
||||
@use-pagination="onPagination"
|
||||
:is-modal="isModal"
|
||||
:loading="loading"
|
||||
:pagination="result"
|
||||
:rowSelectionType="selectionType"
|
||||
@on-row-dblclick="onRowDblclick"
|
||||
@on-select-change="onSelectChange"
|
||||
>
|
||||
<template #control>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-if="canCreate && !isModal"
|
||||
:icon="h(FileAddOutlined)"
|
||||
@click.prevent="onCreate"
|
||||
>新增</a-button
|
||||
>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === FamilyPersonEntity.GENDER">
|
||||
<span>{{ getPolicyText(genderOptions, record.Gender) }}</span>
|
||||
</template>
|
||||
</template>
|
||||
<template #footer>
|
||||
<div v-if="!isModal" class="page-footer">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="24" :sm="24">
|
||||
<a-row :gutter="[16, 8]">
|
||||
<a-space>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-if="canView"
|
||||
:icon="h(FileTextOutlined)"
|
||||
:disabled="!(keys && keys.length == 1)"
|
||||
@click.prevent="onView"
|
||||
>查看</a-button
|
||||
>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-if="canAmend"
|
||||
:icon="h(EditOutlined)"
|
||||
:disabled="!(keys && keys.length == 1)"
|
||||
@click.prevent="onAmend"
|
||||
>修改</a-button
|
||||
>
|
||||
<a-popconfirm
|
||||
title="确定是否删除这条记录?"
|
||||
ok-text="是"
|
||||
cancel-text="否"
|
||||
@confirm="onDelete"
|
||||
>
|
||||
<a-button
|
||||
type="primary"
|
||||
danger
|
||||
:icon="h(DeleteOutlined)"
|
||||
v-if="canDelete"
|
||||
:disabled="!(keys && keys.length > 0)"
|
||||
>删除</a-button
|
||||
>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</a-row>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
</search>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { reactive, inject, defineComponent, onMounted, ref, unref, provide, h } from "vue";
|
||||
import {
|
||||
reactive,
|
||||
inject,
|
||||
defineComponent,
|
||||
onMounted,
|
||||
ref,
|
||||
unref,
|
||||
provide,
|
||||
h,
|
||||
} from "vue";
|
||||
import { BindOption } from "@/data/custom/bindOption";
|
||||
import { SelectOption } from "@/data/auto/selectOption";
|
||||
import search from "@/components/basic/Search.vue";
|
||||
import { DeleteOutlined, EditOutlined, FileAddOutlined, FileTextOutlined } from "@ant-design/icons-vue";
|
||||
import {
|
||||
DeleteOutlined,
|
||||
EditOutlined,
|
||||
FileAddOutlined,
|
||||
FileTextOutlined,
|
||||
} from "@ant-design/icons-vue";
|
||||
|
||||
import { FamilyPersonResultData } from "@/data/auto/familyPersonResultData";
|
||||
import { FamilyPersonEntity } from "@/data/auto/familyPersonEntity";
|
||||
import { SearchFilter } from "@/data/auto/searchFilter"
|
||||
import { SearchFilter } from "@/data/auto/searchFilter";
|
||||
import familyPersonService from "@/service/master/familyPersonService";
|
||||
import { FamilyPersonSearchCriteria } from "@/data/auto/familyPersonSearchCriteria";
|
||||
|
||||
import { SearchCriteriaResultData } from "@/data/auto/searchCriteriaResultData";
|
||||
import { PermissionContext, usePermissionContext } from "@/hooks/PermissionContext"
|
||||
import {
|
||||
PermissionContext,
|
||||
usePermissionContext,
|
||||
} from "@/hooks/PermissionContext";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import { useBindOption } from "@/hooks/useBindOption";
|
||||
import { SearchFilterOperatorPolicy } from "@/data/custom/searchFilterOperatorPolicy"
|
||||
import { SearchFilterTypePolicy } from "@/data/custom/searchFilterTypePolicy"
|
||||
import { useLocalePolicy } from "@/hooks/useLocalePolicy";
|
||||
import { SearchFilterOperatorPolicy } from "@/data/custom/searchFilterOperatorPolicy";
|
||||
import { SearchFilterTypePolicy } from "@/data/custom/searchFilterTypePolicy";
|
||||
import { notification } from "ant-design-vue";
|
||||
import { GridColumnInfo } from "@/data/auto/gridColumnInfo"
|
||||
import { useGridColumnInfo } from "@/hooks/gridColumnInfo"
|
||||
import { GridColumnInfo } from "@/data/auto/gridColumnInfo";
|
||||
import { useGridColumnInfo } from "@/hooks/gridColumnInfo";
|
||||
import { title } from "process";
|
||||
import { useOrderedChildren } from "@/hooks/use-ordered-children";
|
||||
import { SearchCriteriaContext } from "@/injections";
|
||||
import { enquiryMethodKey, searchCriteriaManagerKey, operationToEnquiryMethodKey, OperationToEnquiryModelOption, layoutProviderMethodKey } from "@/injections";
|
||||
import {
|
||||
enquiryMethodKey,
|
||||
searchCriteriaManagerKey,
|
||||
operationToEnquiryMethodKey,
|
||||
OperationToEnquiryModelOption,
|
||||
layoutProviderMethodKey,
|
||||
} from "@/injections";
|
||||
//page from-----------------------------------------------------------------------------------------------------------------------------------
|
||||
//================inject================
|
||||
const actorOperationMethod = inject(operationToEnquiryMethodKey);
|
||||
const modelOption = actorOperationMethod?.getOperationToEnquiryModelOption() as OperationToEnquiryModelOption;
|
||||
const modelOption =
|
||||
actorOperationMethod?.getOperationToEnquiryModelOption() as OperationToEnquiryModelOption;
|
||||
|
||||
const isModal = ref(modelOption ? modelOption.isModalPerson : false);
|
||||
const selectionType = ref(modelOption ? modelOption.selectionTypePerson : 'checkbox');
|
||||
const initBindOptions = ref((modelOption ? modelOption.initBindOptionsPerson : []) as BindOption[]);
|
||||
const selectionType = ref(
|
||||
modelOption ? modelOption.selectionTypePerson : "checkbox",
|
||||
);
|
||||
const initBindOptions = ref(
|
||||
(modelOption ? modelOption.initBindOptionsPerson : []) as BindOption[],
|
||||
);
|
||||
|
||||
//报表名称(layout)
|
||||
const layoutProviderMethod = inject(layoutProviderMethodKey);
|
||||
|
||||
//================inject================
|
||||
|
||||
const emit = defineEmits(['onRowDblclick']);
|
||||
const emit = defineEmits(["onRowDblclick"]);
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const canView = ref<boolean>(false);
|
||||
@@ -82,56 +150,69 @@ const canCreate = ref<boolean>(false);
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
width: '5%',
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
sequence: 0,
|
||||
hidden: 'N',
|
||||
format: ''
|
||||
},
|
||||
{
|
||||
title: "姓氏",
|
||||
dataIndex: FamilyPersonEntity.SURNAME,
|
||||
sorter: true,
|
||||
width: '15%',
|
||||
sequence: 1,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "谱名",
|
||||
dataIndex: FamilyPersonEntity.GENEALOGY_NAME,
|
||||
sorter: true,
|
||||
width: '15%',
|
||||
sequence: 2,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "常用名",
|
||||
dataIndex: FamilyPersonEntity.COMMON_NAME,
|
||||
sorter: true,
|
||||
width: '20%',
|
||||
sequence: 2,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "创建日期",
|
||||
dataIndex: FamilyPersonEntity.CREATED_DATETIME,
|
||||
sorter: true,
|
||||
width: '20%',
|
||||
sequence: 2,
|
||||
hidden: 'N'
|
||||
},
|
||||
{
|
||||
title: "序号",
|
||||
dataIndex: "index",
|
||||
width: "5%",
|
||||
align: "center",
|
||||
fixed: "left",
|
||||
sequence: 0,
|
||||
hidden: "N",
|
||||
format: "",
|
||||
},
|
||||
{
|
||||
title: "姓氏",
|
||||
dataIndex: FamilyPersonEntity.SURNAME,
|
||||
sorter: true,
|
||||
width: "15%",
|
||||
sequence: 1,
|
||||
hidden: "N",
|
||||
},
|
||||
{
|
||||
title: "谱名",
|
||||
dataIndex: FamilyPersonEntity.GENEALOGY_NAME,
|
||||
sorter: true,
|
||||
width: "15%",
|
||||
sequence: 2,
|
||||
hidden: "N",
|
||||
},
|
||||
{
|
||||
title: "性别",
|
||||
dataIndex: FamilyPersonEntity.GENDER,
|
||||
sorter: true,
|
||||
width: "10%",
|
||||
sequence: 3,
|
||||
hidden: "N",
|
||||
},
|
||||
{
|
||||
title: "常用名",
|
||||
dataIndex: FamilyPersonEntity.COMMON_NAME,
|
||||
sorter: true,
|
||||
width: "20%",
|
||||
sequence: 2,
|
||||
hidden: "N",
|
||||
},
|
||||
{
|
||||
title: "创建日期",
|
||||
dataIndex: FamilyPersonEntity.CREATED_DATETIME,
|
||||
sorter: true,
|
||||
width: "20%",
|
||||
sequence: 2,
|
||||
hidden: "N",
|
||||
},
|
||||
]);
|
||||
|
||||
const genderOptions = useLocalePolicy().getPolicyOptions("GenderPolicy", false);
|
||||
const getPolicyText = (options: SelectOption[], value?: string | null) => {
|
||||
const o = options.find((x) => x.BindValue === value);
|
||||
return o ? o.DisplayName : value;
|
||||
};
|
||||
|
||||
const viewOption = {
|
||||
Value: 'default',
|
||||
SelectOptions: [{ BindValue: 'default', DisplayName: "默认" }],
|
||||
Columns: [{ BindValue: 'default', BindColumn: columns }]
|
||||
Value: "default",
|
||||
SelectOptions: [{ BindValue: "default", DisplayName: "默认" }],
|
||||
Columns: [{ BindValue: "default", BindColumn: columns }],
|
||||
};
|
||||
|
||||
const bindOptions = ref<BindOption[]>([]);
|
||||
@@ -143,197 +224,261 @@ const result = ref<SearchCriteriaResultData>(new SearchCriteriaResultData());
|
||||
const data = ref<FamilyPersonResultData>(new FamilyPersonResultData());
|
||||
|
||||
const isSearched = ref<boolean>(false);
|
||||
const currentSearchCriteria = ref<FamilyPersonSearchCriteria>(new FamilyPersonSearchCriteria());
|
||||
const currentSearchCriteria = ref<FamilyPersonSearchCriteria>(
|
||||
new FamilyPersonSearchCriteria(),
|
||||
);
|
||||
|
||||
const keys = ref<FamilyPersonEntity[]>([]);
|
||||
|
||||
const {
|
||||
children: items,
|
||||
addChild: addItem,
|
||||
removeChild: removeItem,
|
||||
children: items,
|
||||
addChild: addItem,
|
||||
removeChild: removeItem,
|
||||
} = useOrderedChildren<SearchCriteriaContext>();
|
||||
//================provide================
|
||||
//初始化查询条件UI(search)
|
||||
provide(enquiryMethodKey, {
|
||||
getLayoutSetting: () => { return { controlLeft: 16, controlRight: 8, space: true, soltLeft: 24, soltRight: 24 }; },
|
||||
getBindOptions: () => { return unref(bindOptions); },
|
||||
getViewOption: () => { return unref(viewOption); },
|
||||
getDatas: () => { return datas; },
|
||||
getLayoutSetting: () => {
|
||||
return {
|
||||
controlLeft: 16,
|
||||
controlRight: 8,
|
||||
space: true,
|
||||
soltLeft: 24,
|
||||
soltRight: 24,
|
||||
};
|
||||
},
|
||||
getBindOptions: () => {
|
||||
return unref(bindOptions);
|
||||
},
|
||||
getViewOption: () => {
|
||||
return unref(viewOption);
|
||||
},
|
||||
getDatas: () => {
|
||||
return datas;
|
||||
},
|
||||
});
|
||||
|
||||
provide(
|
||||
searchCriteriaManagerKey,
|
||||
reactive({
|
||||
items,
|
||||
addItem,
|
||||
removeItem,
|
||||
})
|
||||
searchCriteriaManagerKey,
|
||||
reactive({
|
||||
items,
|
||||
addItem,
|
||||
removeItem,
|
||||
}),
|
||||
);
|
||||
|
||||
//================provide================
|
||||
|
||||
defineExpose({
|
||||
keys,
|
||||
initBindOptions,
|
||||
})
|
||||
keys,
|
||||
initBindOptions,
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
let pContext: PermissionContext = usePermissionContext();
|
||||
canView.value = pContext.canView(route.meta.permission as string);
|
||||
canAmend.value = pContext.canAmend(route.meta.permission as string);
|
||||
canDelete.value = pContext.canDelete(route.meta.permission as string);
|
||||
canCreate.value = pContext.canCreate(route.meta.permission as string);
|
||||
initBindOption();
|
||||
onSearch();
|
||||
})
|
||||
let pContext: PermissionContext = usePermissionContext();
|
||||
canView.value = pContext.canView(route.meta.permission as string);
|
||||
canAmend.value = pContext.canAmend(route.meta.permission as string);
|
||||
canDelete.value = pContext.canDelete(route.meta.permission as string);
|
||||
canCreate.value = pContext.canCreate(route.meta.permission as string);
|
||||
initBindOption();
|
||||
onSearch();
|
||||
});
|
||||
|
||||
const onSelectChange = ((selected: FamilyPersonEntity[]) => {
|
||||
keys.value = selected;
|
||||
})
|
||||
const onSelectChange = (selected: FamilyPersonEntity[]) => {
|
||||
keys.value = selected;
|
||||
};
|
||||
|
||||
const onRowDblclick = ((e: any, record: FamilyPersonEntity) => {
|
||||
if (isModal.value) {
|
||||
emit('onRowDblclick', record);
|
||||
}
|
||||
else {
|
||||
router.push({ name: "FamilyPersonOperation", params: { id: record.PersonId, mode: 'view' } });
|
||||
}
|
||||
})
|
||||
|
||||
const onReset = (() => {
|
||||
keys.value = [];
|
||||
result.value.Total = 0;
|
||||
})
|
||||
|
||||
const onView = (() => {
|
||||
if (keys.value.length == 0) return;
|
||||
router.push({ name: "FamilyPersonOperation", params: { id: keys.value[0].PersonId, mode: 'view' } });
|
||||
})
|
||||
|
||||
const onCreate = (() => {
|
||||
router.push({ name: "FamilyPersonOperation", params: { id: '', mode: 'create' } });
|
||||
})
|
||||
|
||||
const onAmend = (() => {
|
||||
if (keys.value.length == 0) return;
|
||||
router.push({ name: "FamilyPersonOperation", params: { id: keys.value[0].PersonId, mode: 'amend' } });
|
||||
})
|
||||
|
||||
const onDelete = (async () => {
|
||||
for (let i = 0; i < keys.value.length; i++) {
|
||||
await familyPersonService.Delete(keys.value[i].PersonId);
|
||||
}
|
||||
|
||||
notification.info({
|
||||
message: '系统提示:',
|
||||
description: '记录删除成功',
|
||||
placement: "topRight",
|
||||
const onRowDblclick = (e: any, record: FamilyPersonEntity) => {
|
||||
if (isModal.value) {
|
||||
emit("onRowDblclick", record);
|
||||
} else {
|
||||
router.push({
|
||||
name: "FamilyPersonOperation",
|
||||
params: { id: record.PersonId, mode: "view" },
|
||||
});
|
||||
onReload();
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
const setBindOptionValue = ((bindValue: string, value: string, value1: string, values: string[], disabled: boolean) => {
|
||||
let bindOption: BindOption = bindOptions.value.filter(x => x.BindValue == bindValue)[0];
|
||||
if (!bindOption) return;
|
||||
bindOption.Value = value;
|
||||
bindOption.Value1 = value1;
|
||||
bindOption.Values = values;
|
||||
bindOption.disabled = disabled;
|
||||
})
|
||||
const onReset = () => {
|
||||
keys.value = [];
|
||||
result.value.Total = 0;
|
||||
};
|
||||
|
||||
const onView = () => {
|
||||
if (keys.value.length == 0) return;
|
||||
router.push({
|
||||
name: "FamilyPersonOperation",
|
||||
params: { id: keys.value[0].PersonId, mode: "view" },
|
||||
});
|
||||
};
|
||||
|
||||
const onCreate = () => {
|
||||
router.push({
|
||||
name: "FamilyPersonOperation",
|
||||
params: { id: "", mode: "create" },
|
||||
});
|
||||
};
|
||||
|
||||
const onAmend = () => {
|
||||
if (keys.value.length == 0) return;
|
||||
router.push({
|
||||
name: "FamilyPersonOperation",
|
||||
params: { id: keys.value[0].PersonId, mode: "amend" },
|
||||
});
|
||||
};
|
||||
|
||||
const onDelete = async () => {
|
||||
for (let i = 0; i < keys.value.length; i++) {
|
||||
await familyPersonService.Delete(keys.value[i].PersonId);
|
||||
}
|
||||
|
||||
notification.info({
|
||||
message: "系统提示:",
|
||||
description: "记录删除成功",
|
||||
placement: "topRight",
|
||||
});
|
||||
onReload();
|
||||
};
|
||||
|
||||
const setBindOptionValue = (
|
||||
bindValue: string,
|
||||
value: string,
|
||||
value1: string,
|
||||
values: string[],
|
||||
disabled: boolean,
|
||||
) => {
|
||||
let bindOption: BindOption = bindOptions.value.filter(
|
||||
(x) => x.BindValue == bindValue,
|
||||
)[0];
|
||||
if (!bindOption) return;
|
||||
bindOption.Value = value;
|
||||
bindOption.Value1 = value1;
|
||||
bindOption.Values = values;
|
||||
bindOption.disabled = disabled;
|
||||
};
|
||||
|
||||
//初始化查询条件
|
||||
const initBindOption = (async () => {
|
||||
let ubo = useBindOption();
|
||||
let bindOption: BindOption = ubo.getBindOption(FamilyPersonEntity.DB_SURNAME, '姓氏', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CONTAIN);
|
||||
bindOptions.value.push(bindOption);
|
||||
const initBindOption = async () => {
|
||||
let ubo = useBindOption();
|
||||
let bindOption = ubo.getBindOption(
|
||||
FamilyPersonEntity.DB_GENEALOGY_NAME,
|
||||
"谱名",
|
||||
SearchFilterTypePolicy.TEXT,
|
||||
SearchFilterOperatorPolicy.CONTAIN,
|
||||
);
|
||||
bindOption.lg = 10;
|
||||
bindOptions.value.push(bindOption);
|
||||
|
||||
bindOption = ubo.getBindOption(FamilyPersonEntity.DB_GENEALOGY_NAME, '谱名', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CONTAIN);
|
||||
bindOption.lg = 10;
|
||||
bindOptions.value.push(bindOption);
|
||||
bindOption = ubo.getBindOption(
|
||||
FamilyPersonEntity.DB_COMMON_NAME,
|
||||
"常用名",
|
||||
SearchFilterTypePolicy.TEXT,
|
||||
SearchFilterOperatorPolicy.CONTAIN,
|
||||
);
|
||||
bindOption.lg = 10;
|
||||
bindOptions.value.push(bindOption);
|
||||
|
||||
bindOption = ubo.getBindOption(FamilyPersonEntity.DB_CREATED_DATETIME, '创建日期', SearchFilterTypePolicy.DATE, SearchFilterOperatorPolicy.DATE_BETWEEN);
|
||||
bindOptions.value.push(bindOption);
|
||||
let genderSelectOptions: SelectOption[] = useLocalePolicy().getPolicyOptions(
|
||||
"GenderPolicy",
|
||||
true,
|
||||
);
|
||||
bindOption = ubo.getBindSelectOption(
|
||||
FamilyPersonEntity.DB_GENDER,
|
||||
"性别",
|
||||
SearchFilterTypePolicy.SINGLE_SELECTION,
|
||||
SearchFilterOperatorPolicy.SINGLE,
|
||||
genderSelectOptions,
|
||||
);
|
||||
bindOption.lg = 10;
|
||||
bindOptions.value.push(bindOption);
|
||||
|
||||
bindOption = ubo.getBindOption(FamilyPersonEntity.DB_COMMON_NAME, '常用名', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CONTAIN);
|
||||
bindOption.lg = 10;
|
||||
bindOptions.value.push(bindOption);
|
||||
initBindOptions.value.forEach((element) => {
|
||||
setBindOptionValue(
|
||||
element.BindValue,
|
||||
element.Value,
|
||||
element.Value1,
|
||||
element.Values,
|
||||
element.disabled,
|
||||
);
|
||||
});
|
||||
|
||||
initBindOptions.value.forEach(element => {
|
||||
setBindOptionValue(element.BindValue, element.Value, element.Value1, element.Values, element.disabled);
|
||||
});
|
||||
})
|
||||
bindOption = ubo.getBindOption(
|
||||
FamilyPersonEntity.DB_CREATED_DATETIME,
|
||||
"创建日期",
|
||||
SearchFilterTypePolicy.DATE,
|
||||
SearchFilterOperatorPolicy.DATE_BETWEEN,
|
||||
);
|
||||
bindOption.lg = 10;
|
||||
bindOptions.value.push(bindOption);
|
||||
};
|
||||
|
||||
//table from-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
result.value.Page = pagingParams.value.page ?? 1;
|
||||
result.value.Limit = pagingParams.value.pageSize;
|
||||
|
||||
const onSubmit = (async (filters: SearchFilter[]) => {
|
||||
const onSubmit = async (filters: SearchFilter[]) => {
|
||||
let c: FamilyPersonSearchCriteria = new FamilyPersonSearchCriteria();
|
||||
|
||||
let c: FamilyPersonSearchCriteria = new FamilyPersonSearchCriteria();
|
||||
isSearched.value = true;
|
||||
c.Filter = filters;
|
||||
c.limit = pagingParams.value.pageSize;
|
||||
c.page = pagingParams.value.page ?? 1;
|
||||
c.GridColumns = [];
|
||||
currentSearchCriteria.value = c;
|
||||
await findBySearchCriteria(c);
|
||||
};
|
||||
|
||||
isSearched.value = true;
|
||||
c.Filter = filters;
|
||||
c.limit = pagingParams.value.pageSize;
|
||||
c.page = pagingParams.value.page ?? 1;
|
||||
c.GridColumns = [];
|
||||
currentSearchCriteria.value = c;
|
||||
await findBySearchCriteria(c);
|
||||
})
|
||||
const onSearch = async () => {
|
||||
onSubmit(items.value[0].getFilter());
|
||||
};
|
||||
|
||||
const onSearch = (async () => {
|
||||
onSubmit(items.value[0].getFilter());
|
||||
})
|
||||
const onPrint = async () => {
|
||||
let c: FamilyPersonSearchCriteria = new FamilyPersonSearchCriteria();
|
||||
|
||||
const onPrint = (async () => {
|
||||
let c: FamilyPersonSearchCriteria = new FamilyPersonSearchCriteria();
|
||||
c.Filter = items.value[0].getFilter();
|
||||
|
||||
c.Filter = items.value[0].getFilter();
|
||||
c.limit = pagingParams.value.pageSize;
|
||||
c.page = pagingParams.value.page ?? 1;
|
||||
c.GridColumns = useGridColumnInfo().getGridColumnInfo(unref(columns));
|
||||
c.ReportName = layoutProviderMethod?.getLayoutProvider().layoutTitle!;
|
||||
try {
|
||||
let sss = await familyPersonService.PrintBySearchCriteria(c);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
c.limit = pagingParams.value.pageSize;
|
||||
c.page = pagingParams.value.page ?? 1;
|
||||
c.GridColumns = useGridColumnInfo().getGridColumnInfo(unref(columns));
|
||||
c.ReportName = layoutProviderMethod?.getLayoutProvider().layoutTitle!;
|
||||
try {
|
||||
let sss = await familyPersonService.PrintBySearchCriteria(c);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
const findBySearchCriteria = async (c: FamilyPersonSearchCriteria) => {
|
||||
try {
|
||||
data.value = await familyPersonService.FindBySearchCriteria(c);
|
||||
result.value.Total = data.value.Total;
|
||||
result.value.Page = data.value.Page;
|
||||
result.value.Limit = data.value.Limit;
|
||||
datas.value = data.value.Datas;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
})
|
||||
const onPagination = async (params: PagingParams) => {
|
||||
if (!isSearched.value) return;
|
||||
let c: FamilyPersonSearchCriteria = new FamilyPersonSearchCriteria();
|
||||
|
||||
const findBySearchCriteria = (async (c: FamilyPersonSearchCriteria) => {
|
||||
try {
|
||||
data.value = await familyPersonService.FindBySearchCriteria(c);
|
||||
result.value.Total = data.value.Total;
|
||||
result.value.Page = data.value.Page;
|
||||
result.value.Limit = data.value.Limit;
|
||||
datas.value = data.value.Datas;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
c.Filter = items.value[0].getFilter();
|
||||
|
||||
const onPagination = (async (params: PagingParams) => {
|
||||
c.limit = params.pageSize;
|
||||
c.page = params.page ?? 1;
|
||||
if (params.sortField) c.orderby = params.sortField!;
|
||||
if (params.sortOrder)
|
||||
c.orderbytag = params.sortOrder?.toString().substring(0, 4)!;
|
||||
c.GridColumns = [];
|
||||
currentSearchCriteria.value = c;
|
||||
await findBySearchCriteria(c);
|
||||
};
|
||||
|
||||
if (!isSearched.value) return;
|
||||
let c: FamilyPersonSearchCriteria = new FamilyPersonSearchCriteria();
|
||||
|
||||
c.Filter = items.value[0].getFilter();
|
||||
|
||||
c.limit = params.pageSize;
|
||||
c.page = params.page ?? 1;
|
||||
if (params.sortField)
|
||||
c.orderby = params.sortField!;
|
||||
if (params.sortOrder)
|
||||
c.orderbytag = params.sortOrder?.toString().substring(0, 4)!;
|
||||
c.GridColumns = [];
|
||||
currentSearchCriteria.value = c;
|
||||
await findBySearchCriteria(c);
|
||||
});
|
||||
|
||||
const onReload = (async () => {
|
||||
await findBySearchCriteria(unref(currentSearchCriteria));
|
||||
})
|
||||
const onReload = async () => {
|
||||
await findBySearchCriteria(unref(currentSearchCriteria));
|
||||
};
|
||||
//table end-----------------------------------------------------------------------------------------------------------------------------------
|
||||
</script>
|
||||
@@ -99,7 +99,7 @@ const columns = ref([
|
||||
format: ''
|
||||
},
|
||||
{
|
||||
title: "树名称",
|
||||
title: "族谱名称",
|
||||
dataIndex: FamilyTreeViewEntity.TREE_NAME,
|
||||
sorter: true,
|
||||
width: '15%',
|
||||
@@ -259,7 +259,7 @@ const setBindOptionValue = ((bindValue: string, value: string, value1: string, v
|
||||
//初始化查询条件
|
||||
const initBindOption = (async () => {
|
||||
let ubo = useBindOption();
|
||||
let bindOption: BindOption = ubo.getBindOption(FamilyTreeViewEntity.DB_TREE_NAME, '树名称', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CONTAIN);
|
||||
let bindOption: BindOption = ubo.getBindOption(FamilyTreeViewEntity.DB_TREE_NAME, '族谱名称', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CONTAIN);
|
||||
bindOptions.value.push(bindOption);
|
||||
bindOption = ubo.getBindOption(FamilyTreeViewEntity.DB_BRIEF, '简介', SearchFilterTypePolicy.TEXT, SearchFilterOperatorPolicy.CN_CONTAIN);
|
||||
bindOption.lg = 10;
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
<a-divider orientation="left" orientation-margin="0px" dashed style="background-color: silver">
|
||||
</a-divider>
|
||||
<a-row :gutter="[16, 8]">
|
||||
<a-col :lg="8" :sm="24">
|
||||
<a-col :lg="12" :sm="24">
|
||||
<a-row :wrap="false">
|
||||
<a-col flex="auto">
|
||||
<a-input-group compact style="display: flex; width: 100%;">
|
||||
@@ -123,6 +123,14 @@
|
||||
<a-input :disabled="!isEdit"
|
||||
v-model:value="data.CurrentPerson.FamilyPerson.GenealogyName" placeholder="族谱名"
|
||||
style="flex: 1; min-width: 0;" />
|
||||
<a-input :disabled="!isEdit"
|
||||
v-model:value="data.CurrentPerson.FamilyPerson.CommonName" placeholder="常用名"
|
||||
style="flex: 1; min-width: 0;" />
|
||||
<a-select v-model:value="data.CurrentPerson.FamilyPerson.Gender" :disabled="!isEdit"
|
||||
placeholder="性别" style="width: 140px; flex: none;">
|
||||
<a-select-option v-for="o in genderOptions" :value="o.BindValue">{{
|
||||
o.DisplayName }}</a-select-option>
|
||||
</a-select>
|
||||
<a-input-search style="flex: 1; min-width: 0;"
|
||||
v-model:value="data.CurrentPerson.FamilyPerson.PersonId"
|
||||
@search="onModalCurrentPerson" />
|
||||
@@ -273,6 +281,8 @@
|
||||
</a-row>
|
||||
<a-row v-else :gutter="[16, 8]">
|
||||
<a-space>
|
||||
<a-button type="primary" :icon="h(FileSearchOutlined)"
|
||||
:disabled="!hasData" >谱系</a-button>
|
||||
<a-button type="primary" v-if="canAmend" :icon="h(EditOutlined)"
|
||||
:disabled="!hasData" @click.prevent="onAmend">修改</a-button>
|
||||
<a-popconfirm :disabled="!hasData" title="确定是否删除这条记录?" ok-text="是"
|
||||
|
||||
Reference in new issue
Block a user