银行 国家地区

This commit is contained in:
‘huanghaiixia’
2025-10-23 14:02:27 +08:00
parent f54d083784
commit 39953e5648
13 changed files with 3378 additions and 2798 deletions

View File

@ -45,6 +45,13 @@
onMounted(async () => {
try {
let curParentId=currentRoute.value.query.id;
setTimeout(() => {
setFieldsValue({pid: curParentId}) // 重置表单({pId: curParentId});
}, );
console.log(curParentId, 'curParentId')
// 合并渲染覆盖配置中的字段配置、表单事件配置
await mergeCustomFormRenderConfig();
@ -176,6 +183,7 @@
if (formConfig.useCustomConfig) {
const parts = obj.formConfigKey.split('_');
const formId=parts[1];
console.log(parts, 'parts')
cloneProps.schemas=await mergeFormSchemas({formSchema:cloneProps.schemas!,formId:formId});
customFormEventConfigs=await mergeFormEventConfigs({formEventConfigs:customFormEventConfigs,formId:formId});
}

View File

@ -6,39 +6,49 @@ export const formConfig = {
};
export const searchFormSchema: FormSchema[] = [
{
field: 'code',
label: '编码',
component: 'Input',
},
// {
// field: 'id',
// label: 'id',
// component: 'Input',
// },
// {
// field: 'code',
// label: '编码',
// component: 'Input',
// },
// {
// field: 'code',
// label: '编码',
// component: 'Input',
// },
{
field: 'fullName',
label: '名称',
component: 'Input',
},
{
field: 'regionTypeCode',
label: '类型',
component: 'XjrSelect',
componentProps: {
datasourceType: 'dic',
params: { itemId: '1980458729324212226' },
labelField: 'name',
valueField: 'value',
// {
// field: 'regionTypeCode',
// label: '类型',
// component: 'XjrSelect',
// componentProps: {
// datasourceType: 'dic',
// params: { itemId: '1980458729324212226' },
// labelField: 'name',
// valueField: 'value',
getPopupContainer: () => document.body,
},
},
{
field: 'pid',
label: '上级ID',
component: 'Input',
},
{
field: 'fullPath',
label: '全路径名称',
component: 'Input',
},
// getPopupContainer: () => document.body,
// },
// },
// {
// field: 'pid',
// label: '上级ID',
// component: 'Input',
// },
// {
// field: 'fullPath',
// label: '全路径名称',
// component: 'Input',
// },
{
field: 'valid',
label: '有效标志',
@ -52,11 +62,11 @@ export const searchFormSchema: FormSchema[] = [
getPopupContainer: () => document.body,
},
},
{
field: 'note',
label: '备注',
component: 'Input',
},
// {
// field: 'note',
// label: '备注',
// component: 'Input',
// },
];
export const columns: BasicColumn[] = [
@ -86,7 +96,7 @@ export const columns: BasicColumn[] = [
sorter: true,
},
{
dataIndex: 'pid',
title: '上级ID',
@ -198,7 +208,7 @@ export const formProps: FormProps = {
label: '编码',
type: 'input',
component: 'Input',
colProps: { span: 24 },
colProps: { span: 8 },
defaultValue: '',
componentProps: {
width: '100%',
@ -216,7 +226,7 @@ export const formProps: FormProps = {
disabled: false,
allowClear: false,
showLabel: true,
required: false,
required: true,
rules: [],
events: {},
isSave: false,
@ -231,7 +241,7 @@ export const formProps: FormProps = {
label: '名称',
type: 'input',
component: 'Input',
colProps: { span: 24 },
colProps: { span: 8 },
defaultValue: '',
componentProps: {
width: '100%',
@ -249,7 +259,7 @@ export const formProps: FormProps = {
disabled: false,
allowClear: false,
showLabel: true,
required: false,
required: true,
rules: [],
events: {},
isSave: false,
@ -264,7 +274,7 @@ export const formProps: FormProps = {
label: '类型',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
colProps: { span: 8 },
componentProps: {
width: '100%',
span: '',
@ -278,7 +288,7 @@ export const formProps: FormProps = {
showSearch: false,
clearable: false,
disabled: false,
mode: 'multiple',
// mode: 'tags',
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
@ -294,7 +304,7 @@ export const formProps: FormProps = {
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
required: true,
rules: [],
events: {},
isShow: true,
@ -308,7 +318,7 @@ export const formProps: FormProps = {
label: '上级ID',
type: 'input',
component: 'Input',
colProps: { span: 24 },
colProps: { span: 8 },
defaultValue: '',
componentProps: {
width: '100%',
@ -323,7 +333,7 @@ export const formProps: FormProps = {
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
disabled: true,
allowClear: false,
showLabel: true,
required: false,
@ -341,7 +351,7 @@ export const formProps: FormProps = {
label: '全路径名称',
type: 'input',
component: 'Input',
colProps: { span: 24 },
colProps: { span: 8 },
defaultValue: '',
componentProps: {
width: '100%',
@ -356,7 +366,7 @@ export const formProps: FormProps = {
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
disabled: true,
allowClear: false,
showLabel: true,
required: false,
@ -374,7 +384,7 @@ export const formProps: FormProps = {
label: '有效标志',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
colProps: { span: 8 },
componentProps: {
width: '100%',
span: '',
@ -387,13 +397,14 @@ export const formProps: FormProps = {
showLabel: true,
showSearch: false,
clearable: false,
disabled: false,
mode: 'multiple',
disabled: true,
// mode: 'tags',
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
defaultSelect: 'Y',
datasourceType: 'dic',
params: { itemId: '1978057078528327681' },
labelField: 'name',

View File

@ -5,13 +5,15 @@
title="国家地区"
toolbar
search
show-line
:show-icon="false"
:clickRowToExpand="true"
:treeData="treeData"
:fieldNames="{ key: 'key', title: 'title' }"
:fieldNames="{ key: 'id', title: 'fullName' }"
@select="handleSelect"
>
<template #title="item">
&nbsp;&nbsp;{{ item.title }}
&nbsp;&nbsp;{{ item.fullName }}
</template>
</BasicTree>
</div>
@ -48,7 +50,7 @@
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getLngBRegionPage, deleteLngBRegion} from '/@/api/mdm/CountryRegion';
import { getLngBRegionPage, deleteLngBRegion, getTreeData, disableLngBRegion, enableLngBRegion} from '/@/api/mdm/CountryRegion';
import { PageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
@ -77,7 +79,7 @@
const filterColumns = cloneDeep(filterColumnAuth(columns));
const customConfigColums =ref(filterColumns);
const customSearchFormSchema =ref(searchFormSchema);
const selectedKeys = ref<string[]>([]);
const tableRef = ref();
//所有按钮
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"isUse":true,"name":"启用","code":"enable","icon":"ant-design:form-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"作废","code":"disable","icon":"ant-design:stop-outlined","isDefault":true,"type":"dashed"},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]);
@ -104,6 +106,7 @@
const schemaIdComputedRef = ref();
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
const selectId = ref('');
const curTreeId = ref('')
const treeData = ref<TreeItem[]>([]);
const [registerModal, { openModal }] = useModal();
const formName='国家地区';
@ -137,13 +140,19 @@
dataIndex: 'action',
slots: { customRender: 'action' },
},
rowSelection: {
type: 'checkbox',
onChange: onSelectChange
},
tableSetting: {
size: false,
setting: false,
},
});
function onSelectChange(rowKeys: string[]) {
selectedKeys.value = rowKeys;
}
function dbClickRow(record) {
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
return;
@ -184,7 +193,9 @@
btnEvent[code]();
}
function handleDatalog () {
}
function handleAdd() {
if (schemaIdComputedRef.value) {
router.push({
@ -196,7 +207,8 @@
query: {
formPath: 'mdm/CountryRegion',
formName: formName,
formId:currentRoute.value.meta.formId
formId:currentRoute.value.meta.formId,
id: curTreeId.value
}
});
}
@ -294,10 +306,13 @@
}
function handleRefresh() {
reload();
fetchTree()
}
function handleSuccess() {
reload();
fetchTree()
console.log(77777777777)
}
function handleView(record: Recordable) {
@ -305,17 +320,18 @@
dbClickRow(record);
}
function handleSelect(selectIds) {
function handleSelect(selectIds, e) {
selectId.value = selectIds[0];
reload({ searchInfo: { code: selectIds[0] } });
reload({ searchInfo: { pid: selectIds[0] } });
curTreeId.value = selectIds[0]
console.log(selectId.value, 777, selectIds, e,88, e.selectedNodes[0].parentId)
}
async function fetch() {
treeData.value = [];
async function fetchTree() {
treeData.value = (await getTreeData({})) as unknown as TreeItem[];
}
onMounted(() => {
fetch();
fetchTree();
if (schemaIdComputedRef.value) {
bus.on(FLOW_PROCESSED, handleRefresh);
bus.on(CREATE_FLOW, handleRefresh);