银行 国家地区

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

@ -79,6 +79,7 @@
"nzh": "^1.0.8",
"path-to-regexp": "^6.2.0",
"pinia": "2.0.12",
"pnpm": "^10.18.2",
"print-js": "^1.6.0",
"qrcode": "^1.5.0",
"qs": "^6.10.3",

View File

@ -137,3 +137,19 @@ export async function disableLngBBank(ids: string[], mode: ErrorMessageMode = 'm
},
);
}
/**
* @description: 获取数据日志
*/
export async function getDataLog(id: string, mode: ErrorMessageMode = 'modal', path:string) {
return defHttp.post<boolean>(
{
url: path,
params: { id },
},
{
errorMessageMode: mode,
},
);
}

View File

@ -14,6 +14,22 @@ enum Api {
Disable= '/mdm/countryRegion/disable',
DataLog = '/mdm/countryRegion/datalog',
TreeData = '/mdm/countryRegion/tree'
}
/**
* @description: 查询LngBRegion分页列表
*/
export async function getTreeData(params: LngBRegionPageParams, mode: ErrorMessageMode = 'modal') {
return defHttp.get<LngBRegionPageResult>(
{
url: Api.TreeData,
params,
},
{
errorMessageMode: mode,
},
);
}
/**

View File

@ -4,7 +4,7 @@ import type { ComponentType } from './types/index';
/**
* Component list, register here to setting it in the form
*/
import { Input, InputNumber, Select, Radio, Checkbox, DatePicker, TreeSelect, Rate, Divider } from 'ant-design-vue';
import { Input, InputNumber,Cascader, Select, Radio, Checkbox, DatePicker, TreeSelect, Rate, Divider } from 'ant-design-vue';
const DatasourceSelect = defineAsyncComponent({
loader: () => import('/@/components/DataSourceSelect/src/DatasourceSelect.vue')
});
@ -81,6 +81,7 @@ componentMap.set('InputPassword', XjrInputPassword);
componentMap.set('InputSearch', Input.Search);
componentMap.set('InputTextArea', Input.TextArea);
componentMap.set('InputNumber', InputNumber);
componentMap.set('Cascader', Cascader);
// componentMap.set('AutoComplete', AutoComplete);
componentMap.set('AutoCodeRule', AutoCodeRule);
componentMap.set('MoneyChineseInput', MoneyChineseInput);

View File

@ -14,6 +14,7 @@ import { setupStore } from '/@/store';
import { setupGlobDirectives } from '/@/directives';
import { setupI18n } from '/@/locales/setupI18n';
import { registerGlobComp } from '/@/components/registerGlobComp';
import DataLog from '/@/views/mdm/Bank/components/DataLog.vue';
import axios from 'axios';
import VueGridLayout from 'vue-grid-layout';
import Antd from 'ant-design-vue';
@ -73,6 +74,7 @@ async function bootstrap() {
app.use(Antd);
app.use(VueGridLayout);
app.component('DataLog', DataLog);
//如果需要使用葡萄城报表 放开代码注释
//这里是viewer的key

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();
@ -44,6 +44,13 @@
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({

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[] = [
@ -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);

5316
yarn.lock

File diff suppressed because it is too large Load Diff