恢复银行新增表单代码
This commit is contained in:
@ -7,8 +7,7 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { CascaderProps } from 'ant-design-vue';
|
import { reactive, ref,onBeforeMount,onMounted } from 'vue';
|
||||||
import { reactive, ref,onBeforeMount,onMounted,nextTick } from 'vue';
|
|
||||||
import { formProps, formEventConfigs ,formConfig} from './config';
|
import { formProps, formEventConfigs ,formConfig} from './config';
|
||||||
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
|
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
|
||||||
import { addLngBBank, getLngBBank, updateLngBBank, deleteLngBBank } from '/@/api/mdm/Bank';
|
import { addLngBBank, getLngBBank, updateLngBBank, deleteLngBBank } from '/@/api/mdm/Bank';
|
||||||
@ -21,7 +20,7 @@ import type { CascaderProps } from 'ant-design-vue';
|
|||||||
import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
|
import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
|
||||||
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
|
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { getTreeData, getTreeChild } from '/@/api/mdm/CountryRegion';
|
import { getTreeData } from '/@/api/mdm/CountryRegion';
|
||||||
const { filterFormSchemaAuth } = usePermission();
|
const { filterFormSchemaAuth } = usePermission();
|
||||||
const { mergeFormSchemas,mergeFormEventConfigs } = useFormConfig();
|
const { mergeFormSchemas,mergeFormEventConfigs } = useFormConfig();
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
@ -43,520 +42,15 @@ import type { CascaderProps } from 'ant-design-vue';
|
|||||||
});
|
});
|
||||||
|
|
||||||
let customFormEventConfigs=[];
|
let customFormEventConfigs=[];
|
||||||
|
|
||||||
|
|
||||||
// 初始选项
|
|
||||||
const cascaderOptions = ref<CascaderProps['options']>([])
|
|
||||||
const cascaderKey = ref(0); // 用于强制重新渲染
|
|
||||||
|
|
||||||
// 动态加载数据
|
|
||||||
const loadData: CascaderProps['loadData'] = async (selectedOptions) => {
|
|
||||||
const targetOption = selectedOptions[selectedOptions.length - 1];
|
|
||||||
targetOption.loading = true;
|
|
||||||
|
|
||||||
try {
|
|
||||||
// 调用 API 获取子级数据
|
|
||||||
const arr = reactive ([]);
|
|
||||||
arr.value = [
|
|
||||||
{
|
|
||||||
"id": "1981158570698272770",
|
|
||||||
"code": "11",
|
|
||||||
"fullName": "中国",
|
|
||||||
"regionTypeCode": "COUNTRY",
|
|
||||||
"pid": "1980912427490508801",
|
|
||||||
"fullPath": "亚洲中国",
|
|
||||||
"valid": "Y",
|
|
||||||
"note": "国这有",
|
|
||||||
"createUserId": "1000000000000000000",
|
|
||||||
"createDate": "2025-10-23 08:39:46",
|
|
||||||
"modifyUserId": "1000000000000000000",
|
|
||||||
"modifyDate": "2025-10-23 08:49:42",
|
|
||||||
"tenantId": "1",
|
|
||||||
"deptId": null,
|
|
||||||
"ruleUserId": "1000000000000000000"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
// arr.value = await getTreeChild({
|
|
||||||
// pid: targetOption.id,
|
|
||||||
// });
|
|
||||||
console.log(arr.value, 889)
|
|
||||||
targetOption.loading = false;
|
|
||||||
targetOption.children = arr.value
|
|
||||||
// .map(item => ({
|
|
||||||
// ...item,
|
|
||||||
// value: item.code,
|
|
||||||
// label: item.fullName,
|
|
||||||
// // isLeaf: !item.hasChildren,
|
|
||||||
// isLeaf: false,
|
|
||||||
// children: item.children||[]
|
|
||||||
// }));
|
|
||||||
cascaderOptions.value = [...cascaderOptions.value]
|
|
||||||
console.log(targetOption.children,8897)
|
|
||||||
|
|
||||||
} catch (error) {
|
|
||||||
targetOption.loading = false;
|
|
||||||
console.error('加载数据失败:', error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 初始化根节点数据
|
|
||||||
const initRootData = async () => {
|
|
||||||
const data = reactive ([]);
|
|
||||||
data.value = await getTreeChild({});
|
|
||||||
console.log(data, 6767)
|
|
||||||
cascaderOptions.value = data.value.map(item => ({
|
|
||||||
...item,
|
|
||||||
// value: item.code,
|
|
||||||
// label: item.fullName,
|
|
||||||
// isLeaf: !item.hasChildren,
|
|
||||||
isLeaf: false,
|
|
||||||
children: item.children||[]
|
|
||||||
}));
|
|
||||||
console.log(cascaderOptions.value, 888)
|
|
||||||
};
|
|
||||||
formProps.schemas= [
|
|
||||||
{
|
|
||||||
key: '1',
|
|
||||||
field: 'code',
|
|
||||||
label: '编码',
|
|
||||||
type: 'input',
|
|
||||||
component: 'Input',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
defaultValue: '',
|
|
||||||
componentProps: {
|
|
||||||
width: '100%',
|
|
||||||
span: '',
|
|
||||||
defaultValue: '',
|
|
||||||
labelWidthMode: 'fix',
|
|
||||||
labelFixWidth: 120,
|
|
||||||
responsive: false,
|
|
||||||
respNewRow: false,
|
|
||||||
placeholder: '',
|
|
||||||
maxlength: null,
|
|
||||||
prefix: '',
|
|
||||||
suffix: '',
|
|
||||||
addonBefore: '',
|
|
||||||
addonAfter: '',
|
|
||||||
disabled: true,
|
|
||||||
allowClear: false,
|
|
||||||
showLabel: true,
|
|
||||||
required: false,
|
|
||||||
rules: [],
|
|
||||||
events: {},
|
|
||||||
isSave: false,
|
|
||||||
isShow: true,
|
|
||||||
scan: false,
|
|
||||||
style: { width: '100%' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '5fdaec7802364d16a979fc9d3218bbfa',
|
|
||||||
field: 'fullName',
|
|
||||||
label: '银行名称',
|
|
||||||
type: 'input',
|
|
||||||
component: 'Input',
|
|
||||||
colProps: { span: 16 },
|
|
||||||
defaultValue: '',
|
|
||||||
componentProps: {
|
|
||||||
width: '100%',
|
|
||||||
span: '',
|
|
||||||
defaultValue: '',
|
|
||||||
labelWidthMode: 'fix',
|
|
||||||
labelFixWidth: 120,
|
|
||||||
responsive: false,
|
|
||||||
respNewRow: false,
|
|
||||||
placeholder: '请输入银行名称',
|
|
||||||
maxlength: null,
|
|
||||||
prefix: '',
|
|
||||||
suffix: '',
|
|
||||||
addonBefore: '',
|
|
||||||
addonAfter: '',
|
|
||||||
disabled: false,
|
|
||||||
allowClear: false,
|
|
||||||
showLabel: true,
|
|
||||||
required: true,
|
|
||||||
rules: [],
|
|
||||||
events: {},
|
|
||||||
isSave: false,
|
|
||||||
isShow: true,
|
|
||||||
scan: false,
|
|
||||||
style: { width: '100%' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '2',
|
|
||||||
field: 'shortName',
|
|
||||||
label: '简称',
|
|
||||||
type: 'input',
|
|
||||||
component: 'Input',
|
|
||||||
colProps: { span: 8 },
|
|
||||||
defaultValue: '',
|
|
||||||
componentProps: {
|
|
||||||
width: '100%',
|
|
||||||
span: '',
|
|
||||||
defaultValue: '',
|
|
||||||
labelWidthMode: 'fix',
|
|
||||||
labelFixWidth: 120,
|
|
||||||
responsive: false,
|
|
||||||
respNewRow: false,
|
|
||||||
placeholder: '请输入银行名称简称',
|
|
||||||
maxlength: null,
|
|
||||||
prefix: '',
|
|
||||||
suffix: '',
|
|
||||||
addonBefore: '',
|
|
||||||
addonAfter: '',
|
|
||||||
disabled: false,
|
|
||||||
allowClear: false,
|
|
||||||
showLabel: true,
|
|
||||||
required: true,
|
|
||||||
rules: [],
|
|
||||||
events: {},
|
|
||||||
isSave: false,
|
|
||||||
isShow: true,
|
|
||||||
scan: false,
|
|
||||||
style: { width: '100%' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '38bd834c265446658be6f9784672e1ae',
|
|
||||||
field: 'bankCode',
|
|
||||||
label: '联行号',
|
|
||||||
type: 'input',
|
|
||||||
component: 'Input',
|
|
||||||
colProps: { span: 8 },
|
|
||||||
defaultValue: '',
|
|
||||||
componentProps: {
|
|
||||||
width: '100%',
|
|
||||||
span: '',
|
|
||||||
defaultValue: '',
|
|
||||||
labelWidthMode: 'fix',
|
|
||||||
labelFixWidth: 120,
|
|
||||||
responsive: false,
|
|
||||||
respNewRow: false,
|
|
||||||
placeholder: '请输入联行号',
|
|
||||||
maxlength: null,
|
|
||||||
prefix: '',
|
|
||||||
suffix: '',
|
|
||||||
addonBefore: '',
|
|
||||||
addonAfter: '',
|
|
||||||
disabled: false,
|
|
||||||
allowClear: false,
|
|
||||||
showLabel: true,
|
|
||||||
required: false,
|
|
||||||
rules: [],
|
|
||||||
events: {},
|
|
||||||
isSave: false,
|
|
||||||
isShow: true,
|
|
||||||
scan: false,
|
|
||||||
style: { width: '100%' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '4',
|
|
||||||
field: 'regionCode',
|
|
||||||
label: '所属国家/地区',
|
|
||||||
type: 'cascader',
|
|
||||||
component: 'Cascader',
|
|
||||||
colProps: { span: 8 },
|
|
||||||
defaultValue: [],
|
|
||||||
componentProps: {
|
|
||||||
key: cascaderKey,
|
|
||||||
changeOnSelect: false,
|
|
||||||
options: cascaderOptions,
|
|
||||||
loadData,
|
|
||||||
fieldNames: {label: 'fullName', value: 'code', children: 'children'},
|
|
||||||
width: '100%',
|
|
||||||
span: '',
|
|
||||||
defaultValue: '',
|
|
||||||
labelWidthMode: 'fix',
|
|
||||||
labelFixWidth: 120,
|
|
||||||
responsive: false,
|
|
||||||
respNewRow: false,
|
|
||||||
placeholder: '请选择',
|
|
||||||
maxlength: null,
|
|
||||||
prefix: '',
|
|
||||||
suffix: '',
|
|
||||||
addonBefore: '',
|
|
||||||
addonAfter: '',
|
|
||||||
disabled: false,
|
|
||||||
allowClear: false,
|
|
||||||
showLabel: true,
|
|
||||||
required: false,
|
|
||||||
rules: [],
|
|
||||||
events: {},
|
|
||||||
isSave: false,
|
|
||||||
isShow: true,
|
|
||||||
scan: false,
|
|
||||||
style: { width: '100%' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '6461a5e152124abca28bd2114dd577e6',
|
|
||||||
field: 'swift',
|
|
||||||
label: 'SWIFT',
|
|
||||||
type: 'input',
|
|
||||||
component: 'Input',
|
|
||||||
colProps: { span: 8 },
|
|
||||||
defaultValue: '',
|
|
||||||
componentProps: {
|
|
||||||
width: '100%',
|
|
||||||
span: '',
|
|
||||||
defaultValue: '',
|
|
||||||
labelWidthMode: 'fix',
|
|
||||||
labelFixWidth: 120,
|
|
||||||
responsive: false,
|
|
||||||
respNewRow: false,
|
|
||||||
placeholder: '请输入SWIFT',
|
|
||||||
maxlength: null,
|
|
||||||
prefix: '',
|
|
||||||
suffix: '',
|
|
||||||
addonBefore: '',
|
|
||||||
addonAfter: '',
|
|
||||||
disabled: false,
|
|
||||||
allowClear: false,
|
|
||||||
showLabel: true,
|
|
||||||
required: false,
|
|
||||||
rules: [],
|
|
||||||
events: {},
|
|
||||||
isSave: false,
|
|
||||||
isShow: true,
|
|
||||||
scan: false,
|
|
||||||
style: { width: '100%' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '5',
|
|
||||||
field: 'ib',
|
|
||||||
label: '中转行',
|
|
||||||
type: 'input',
|
|
||||||
component: 'Input',
|
|
||||||
colProps: { span: 16 },
|
|
||||||
defaultValue: '',
|
|
||||||
componentProps: {
|
|
||||||
width: '100%',
|
|
||||||
span: '',
|
|
||||||
defaultValue: '',
|
|
||||||
labelWidthMode: 'fix',
|
|
||||||
labelFixWidth: 120,
|
|
||||||
responsive: false,
|
|
||||||
respNewRow: false,
|
|
||||||
placeholder: '请输入中转行',
|
|
||||||
maxlength: null,
|
|
||||||
prefix: '',
|
|
||||||
suffix: '',
|
|
||||||
addonBefore: '',
|
|
||||||
addonAfter: '',
|
|
||||||
disabled: false,
|
|
||||||
allowClear: false,
|
|
||||||
showLabel: true,
|
|
||||||
required: false,
|
|
||||||
rules: [],
|
|
||||||
events: {},
|
|
||||||
isSave: false,
|
|
||||||
isShow: true,
|
|
||||||
scan: false,
|
|
||||||
style: { width: '100%' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '6',
|
|
||||||
field: 'ibSwift',
|
|
||||||
label: '中转行SWIFT',
|
|
||||||
type: 'input',
|
|
||||||
component: 'Input',
|
|
||||||
colProps: { span: 8 },
|
|
||||||
defaultValue: '',
|
|
||||||
componentProps: {
|
|
||||||
width: '100%',
|
|
||||||
span: '',
|
|
||||||
defaultValue: '',
|
|
||||||
labelWidthMode: 'fix',
|
|
||||||
labelFixWidth: 120,
|
|
||||||
responsive: false,
|
|
||||||
respNewRow: false,
|
|
||||||
placeholder: '请输入中转行SWIFT',
|
|
||||||
maxlength: null,
|
|
||||||
prefix: '',
|
|
||||||
suffix: '',
|
|
||||||
addonBefore: '',
|
|
||||||
addonAfter: '',
|
|
||||||
disabled: false,
|
|
||||||
allowClear: false,
|
|
||||||
showLabel: true,
|
|
||||||
required: false,
|
|
||||||
rules: [],
|
|
||||||
events: {},
|
|
||||||
isSave: false,
|
|
||||||
isShow: true,
|
|
||||||
scan: false,
|
|
||||||
style: { width: '100%' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '7',
|
|
||||||
field: 'routing',
|
|
||||||
label: 'Routing',
|
|
||||||
type: 'input',
|
|
||||||
component: 'Input',
|
|
||||||
colProps: { span: 8 },
|
|
||||||
defaultValue: '',
|
|
||||||
componentProps: {
|
|
||||||
width: '100%',
|
|
||||||
span: '',
|
|
||||||
defaultValue: '',
|
|
||||||
labelWidthMode: 'fix',
|
|
||||||
labelFixWidth: 120,
|
|
||||||
responsive: false,
|
|
||||||
respNewRow: false,
|
|
||||||
placeholder: '请输入Routing',
|
|
||||||
maxlength: null,
|
|
||||||
prefix: '',
|
|
||||||
suffix: '',
|
|
||||||
addonBefore: '',
|
|
||||||
addonAfter: '',
|
|
||||||
disabled: false,
|
|
||||||
allowClear: false,
|
|
||||||
showLabel: true,
|
|
||||||
required: false,
|
|
||||||
rules: [],
|
|
||||||
events: {},
|
|
||||||
isSave: false,
|
|
||||||
isShow: true,
|
|
||||||
scan: false,
|
|
||||||
style: { width: '100%' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '8',
|
|
||||||
field: 'soft',
|
|
||||||
label: '显示顺序',
|
|
||||||
type: 'input',
|
|
||||||
component: 'InputNumber',
|
|
||||||
colProps: { span: 8 },
|
|
||||||
defaultValue: '',
|
|
||||||
componentProps: {
|
|
||||||
width: '100%',
|
|
||||||
span: '',
|
|
||||||
defaultValue: '',
|
|
||||||
labelWidthMode: 'fix',
|
|
||||||
labelFixWidth: 120,
|
|
||||||
responsive: false,
|
|
||||||
respNewRow: false,
|
|
||||||
placeholder: '请输入显示顺序',
|
|
||||||
maxlength: null,
|
|
||||||
prefix: '',
|
|
||||||
suffix: '',
|
|
||||||
addonBefore: '',
|
|
||||||
addonAfter: '',
|
|
||||||
disabled: false,
|
|
||||||
allowClear: false,
|
|
||||||
showLabel: true,
|
|
||||||
required: false,
|
|
||||||
rules: [],
|
|
||||||
events: {},
|
|
||||||
isSave: false,
|
|
||||||
isShow: true,
|
|
||||||
scan: false,
|
|
||||||
style: { width: '100%' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '714953d458d9402bb507893c92913d44',
|
|
||||||
field: 'valid',
|
|
||||||
label: '有效标志',
|
|
||||||
type: 'select',
|
|
||||||
component: 'XjrSelect',
|
|
||||||
colProps: { span: 8 },
|
|
||||||
componentProps: {
|
|
||||||
width: '100%',
|
|
||||||
span: '',
|
|
||||||
labelWidthMode: 'fix',
|
|
||||||
labelFixWidth: 120,
|
|
||||||
responsive: false,
|
|
||||||
respNewRow: false,
|
|
||||||
placeholder: '请选择下拉选择',
|
|
||||||
sepTextField: '',
|
|
||||||
showLabel: true,
|
|
||||||
showSearch: false,
|
|
||||||
clearable: false,
|
|
||||||
disabled: true,
|
|
||||||
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',
|
|
||||||
valueField: 'value',
|
|
||||||
apiConfig: {
|
|
||||||
path: 'CodeGeneration/selection',
|
|
||||||
method: 'GET',
|
|
||||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
|
||||||
},
|
|
||||||
dicOptions: [],
|
|
||||||
required: false,
|
|
||||||
rules: [],
|
|
||||||
events: {},
|
|
||||||
isShow: true,
|
|
||||||
itemId: '1978057078528327681',
|
|
||||||
style: { width: '100%' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '9',
|
|
||||||
field: 'note',
|
|
||||||
label: '备注',
|
|
||||||
type: 'input',
|
|
||||||
component: 'InputTextArea',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
defaultValue: '',
|
|
||||||
componentProps: {
|
|
||||||
width: '100%',
|
|
||||||
span: '',
|
|
||||||
defaultValue: '',
|
|
||||||
labelWidthMode: 'fix',
|
|
||||||
labelFixWidth: 120,
|
|
||||||
responsive: false,
|
|
||||||
respNewRow: false,
|
|
||||||
placeholder: '请输入内容,最多200字',
|
|
||||||
maxlength: 200,
|
|
||||||
prefix: '',
|
|
||||||
suffix: '',
|
|
||||||
addonBefore: '',
|
|
||||||
addonAfter: '',
|
|
||||||
disabled: false,
|
|
||||||
allowClear: false,
|
|
||||||
showLabel: true,
|
|
||||||
required: false,
|
|
||||||
rules: [],
|
|
||||||
events: {},
|
|
||||||
isSave: false,
|
|
||||||
isShow: true,
|
|
||||||
scan: false,
|
|
||||||
style: { width: '100%' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await initRootData();
|
const treeData = await getTreeData({})
|
||||||
// const treeData = await getTreeData({})
|
formProps.schemas?.forEach(v => {
|
||||||
// formProps.schemas?.forEach(v => {
|
if (v.field == 'regionCode') {
|
||||||
// if (v.field == 'regionCode') {
|
v.componentProps.options = treeData
|
||||||
// v.componentProps.options = cascaderOptions
|
}
|
||||||
// v.componentProps.loadData = loadData
|
})
|
||||||
// }
|
|
||||||
// })
|
|
||||||
console.log(formProps.schemas, 667)
|
console.log(formProps.schemas, 667)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 合并渲染覆盖配置中的字段配置、表单事件配置
|
// 合并渲染覆盖配置中的字段配置、表单事件配置
|
||||||
await mergeCustomFormRenderConfig();
|
await mergeCustomFormRenderConfig();
|
||||||
|
|||||||
Reference in New Issue
Block a user