银行 国家地区

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

@ -0,0 +1,93 @@
<template>
<div :style="{ height: '100%', background: '#fff' }">
<a-table :columns="columns" :data-source="data" :scroll="{y: 500}" :row-key="record => record.id"
/>
</div>
</template>
<script lang="ts" setup>
import { getDataLog } from '/@/api/mdm/Bank';
import { defineProps, ref, computed, onMounted, onUnmounted, createVNode, reactive, } from 'vue';
const columns = [
{
title: '表名',
dataIndex: 'tableName',
key: 'tableName',
width: 80
},
{
title: '属性名称',
dataIndex: 'name',
key: 'name',
width: 140
},
{
title: '操作类型',
dataIndex: 'operationType',
key: 'operationType',
width: 100,
customRender: ({ record }) => {
let text = record.operationType
if (record.operationType == 'INSERT') text='新增'
if (record.operationType == 'UPDATE') text='修改'
if (record.operationType == 'DELETE') text='删除'
return text
}
},
{
title: '原数据',
dataIndex: 'oldValue',
key: 'oldValue',
width: 150
},
{
title: '新数据',
dataIndex: 'newValue',
key: 'newValue',
width: 150
},
{
title: '操作人',
dataIndex: 'operatorName',
key: 'operatorName',
width: 100
},
{
title: '操作IP',
dataIndex: 'operationIp',
key: 'operationIp',
width: 150
},
{
title: '操作时间',
dataIndex: 'operationTime',
key: 'operationTime',
width: 150
},
];
const props = defineProps({
logId: {
type: String,
required: true
},
logPath: {
type: String,
required: true
},
})
console.log(props.logId, 444, props.logPath)
interface DataItem {
children?: DataItem[];
}
// const data: DataItem[] = [];
const data = ref<DataItem[]>([]);
onMounted( async() => {
data.value = await getDataLog(props.logId, {},props.logPath)
console.log(data.value, 88)
});
</script>

View File

@ -20,7 +20,7 @@
import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
import { useRouter } from 'vue-router';
import { getTreeData } from '/@/api/mdm/CountryRegion';
const { filterFormSchemaAuth } = usePermission();
const { mergeFormSchemas,mergeFormEventConfigs } = useFormConfig();
const { currentRoute } = useRouter();
@ -42,8 +42,15 @@
});
let customFormEventConfigs=[];
onMounted(async () => {
const treeData = await getTreeData({})
formProps.schemas?.forEach(v => {
if (v.field == 'regionCode') {
v.componentProps.options = treeData
}
})
console.log(formProps.schemas, 667)
try {
// 合并渲染覆盖配置中的字段配置、表单事件配置
await mergeCustomFormRenderConfig();
@ -117,7 +124,8 @@
// 根据行唯一ID查询行数据并设置表单数据 【编辑】
async function setFormDataFromId(rowId, skipUpdate) {
try {
const record = await getLngBBank(rowId);
let record = await getLngBBank(rowId);
record = {...record, regionCode: (record.regionCode || []).split(',')}
if (skipUpdate) {
return record;
}
@ -150,7 +158,7 @@
try {
values[RowKey] = rowId;
state.formModel = values;
let saveVal = await updateLngBBank(values);
let saveVal = await updateLngBBank({...values, regionCode: (values.regionCode||[]).join(',')});
await submitFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:提交表单
@ -161,7 +169,7 @@
async function add(values) {
try {
state.formModel = values;
let saveVal = await addLngBBank(values);
let saveVal = await addLngBBank({...values, regionCode: (values.regionCode||[]).join(',')});
await submitFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:提交表单

View File

@ -1,5 +1,9 @@
import { FormProps, FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n();
import { h } from 'vue';
import { Tag } from 'ant-design-vue';
export const formConfig = {
useCustomConfig: false,
@ -12,12 +16,12 @@ export const searchFormSchema: FormSchema[] = [
component: 'Input',
},
{
field: 'bankCode',
field: 'code',
label: '编码',
component: 'Input',
},
{
field: 'regionCode',
field: 'bankCode',
label: '联行号',
component: 'Input',
},
@ -34,26 +38,26 @@ export const searchFormSchema: FormSchema[] = [
getPopupContainer: () => document.body,
},
},
{
field: 'fullName',
label: '银行名称',
component: 'Input',
},
{
field: 'code',
label: '所属国家和地区',
component: 'Input',
},
{
field: 'swift',
label: 'SWIFT',
component: 'Input',
},
// {
// field: 'fullName',
// label: '银行名称',
// component: 'Input',
// },
// {
// field: 'code',
// label: '所属国家和地区',
// component: 'Input',
// },
// {
// field: 'swift',
// label: 'SWIFT',
// component: 'Input',
// },
];
export const columns: BasicColumn[] = [
{
dataIndex: 'bankCode',
dataIndex: 'code',
title: '编码',
componentType: 'input',
align: 'left',
@ -63,33 +67,30 @@ export const columns: BasicColumn[] = [
{
dataIndex: 'fullName',
title: '银行名称',
title: '名称',
componentType: 'input',
align: 'left',
sorter: true,
},
{
dataIndex: 'shortName',
title: '银行名称/简称',
title: '简称',
componentType: 'input',
align: 'left',
sorter: true,
},
{
dataIndex: 'regionCode',
dataIndex: 'bankCode',
title: '联行号',
componentType: 'input',
align: 'left',
sorter: true,
},
{
dataIndex: 'code',
dataIndex: 'regionName',
title: '所属国家和地区',
componentType: 'input',
align: 'left',
@ -113,6 +114,13 @@ export const columns: BasicColumn[] = [
align: 'left',
sorter: true,
// customRender: ({ record }) => {
// const enabledMark = record.valid;
// const enable = ~~enabledMark === '有效';
// const color = enable ? 'green' : 'red';
// const text = enable ? t('有效') : t('无效');
// return h(Tag, { color: color }, () => text);
// }
},
];
//表单事件
@ -185,42 +193,8 @@ export const formProps: FormProps = {
size: 'default',
schemas: [
{
key: '151d6e797f7e411297992bd2460ddd29',
field: 'shortName',
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: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
isSave: false,
isShow: true,
scan: false,
style: { width: '100%' },
},
},
{
key: 'df917f42491f4a8888a9d661a89ac3ce',
field: 'bankCode',
key: '1',
field: 'code',
label: '编码',
type: 'input',
component: 'Input',
@ -234,13 +208,13 @@ export const formProps: FormProps = {
labelFixWidth: 120,
responsive: false,
respNewRow: false,
placeholder: '请输入编码',
placeholder: '',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
disabled: true,
allowClear: false,
showLabel: true,
required: false,
@ -253,12 +227,80 @@ export const formProps: FormProps = {
},
},
{
key: '0e4069a334ea44219d6f1d364d830ffe',
field: 'regionCode',
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: 24 },
colProps: { span: 8 },
defaultValue: '',
componentProps: {
width: '100%',
@ -287,59 +329,33 @@ export const formProps: FormProps = {
},
},
{
key: 'e00cdcea0ed14c99b7f7901526f5a5fe',
field: 'valid',
label: '有效标志',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
key: '4',
field: 'regionCode',
label: '所属国家/地区',
type: 'cascader',
component: 'Cascader',
colProps: { span: 8 },
defaultValue: [],
componentProps: {
width: '100%',
span: '',
labelWidthMode: 'fix',
labelFixWidth: 120,
responsive: false,
respNewRow: false,
placeholder: '请选择下拉选择',
sepTextField: '',
showLabel: true,
showSearch: false,
clearable: false,
disabled: false,
mode: 'multiple',
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' },
options: [
// {
// value: 'zhejiang',
// label: '浙江省',
// children: [
// {
// value: 'hangzhou',
// label: '杭州市',
// children: [
// {
// value: 'xihu',
// label: '西湖区',
// },
// ],
// },
// ],
// }
],
defaultSelect: null,
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: 'fe4822ade6334198965e983ab26c4100',
field: 'fullName',
label: '银行名称',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
fieldNames: {label: 'fullName', value: 'code', children: 'children'},
width: '100%',
span: '',
defaultValue: '',
@ -347,7 +363,7 @@ export const formProps: FormProps = {
labelFixWidth: 120,
responsive: false,
respNewRow: false,
placeholder: '请输入银行名称',
placeholder: '请选择',
maxlength: null,
prefix: '',
suffix: '',
@ -366,46 +382,12 @@ export const formProps: FormProps = {
},
},
{
key: '503adbb6dd024e0f934a41ec1ccbff07',
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: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
isSave: false,
isShow: true,
scan: false,
style: { width: '100%' },
},
},
{
key: '08b8ef5bc2a148e2b14093e97be20305',
key: '6461a5e152124abca28bd2114dd577e6',
field: 'swift',
label: 'SWIFT',
type: 'input',
component: 'Input',
colProps: { span: 24 },
colProps: { span: 8 },
defaultValue: '',
componentProps: {
width: '100%',
@ -433,6 +415,220 @@ export const formProps: FormProps = {
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%' },
},
},
],
showActionButtonGroup: false,
buttonLocation: 'center',

View File

@ -21,13 +21,18 @@
</template>
</BasicTable>
<BankModal @register="registerModal" @success="handleSuccess" />
<!-- <div>
<DataLog :logId="logId" :logPath="logPath" />
</div> -->
</PageWrapper>
</template>
<script lang="ts" setup>
import { ref, computed, onMounted, onUnmounted, createVNode,
import { ref, computed, onMounted, onUnmounted, createVNode, reactive,
} from 'vue';
const logId = ref('77773434')
const logPath = ref('/bank/b')
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
@ -39,7 +44,7 @@
import { useFormConfig } from '/@/hooks/web/useFormConfig';
import { useRouter } from 'vue-router';
import { setIndexFlowStatus } from '/@/utils/flow/index'
import { getLngBBank } from '/@/api/mdm/Bank';
import { getLngBBank,enableLngBBank,disableLngBBank } from '/@/api/mdm/Bank';
import { useModal } from '/@/components/Modal';
import BankModal from './components/BankModal.vue';
import {formConfig, searchFormSchema, columns } from './components/config';
@ -55,13 +60,28 @@
const { filterColumnAuth, filterButtonAuth } = usePermission();
const { mergeColumns,mergeSearchFormSchema,mergeButtons } = useFormConfig();
const filterColumns = cloneDeep(filterColumnAuth(columns));
// const filterColumns = cloneDeep(filterColumnAuth(columns));
const filterColumns = cloneDeep(columns);
const customConfigColums =ref(filterColumns);
const customSearchFormSchema =ref(searchFormSchema);
const selectedKeys = ref<string[]>([]);
const tableRef = ref();
const dataObj = reactive({
url: '',
visible: false,
type: ''
})
//所有按钮
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":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"},{"isUse":true,"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}]);
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}]);
//展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
const buttonConfigs = computed(()=>{
@ -85,6 +105,7 @@
const schemaIdComputedRef = ref();
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
const [registerModal, { openModal }] = useModal();
const formName='银行';
const [registerTable, { reload, }] = useTable({
title: '' || (formName + '列表'),
@ -93,11 +114,12 @@
columns: customConfigColums,
formConfig: {
rowProps: {
gutter: 16,
// gutter: 16,
},
labelCol:{span: 9, offSet:10},
schemas: customSearchFormSchema,
fieldMapToTime: [],
showResetButton: false,
showResetButton: true,
},
beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
@ -116,13 +138,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;
@ -163,7 +191,9 @@
btnEvent[code]();
}
function handleDatalog () {
dataObj.visible = true
}
function handleAdd() {
if (schemaIdComputedRef.value) {
router.push({