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