重新生成bank和region

This commit is contained in:
2025-10-22 12:15:37 +08:00
parent 8cd8af121b
commit 280eac6a61
14 changed files with 1516 additions and 1265 deletions

View File

@ -9,6 +9,9 @@ enum Api {
LngBBank = '/mdm/bank', LngBBank = '/mdm/bank',
DataLog = '/mdm/bank/datalog',
} }
/** /**
@ -85,3 +88,21 @@ export async function deleteLngBBank(ids: string[], mode: ErrorMessageMode = 'mo
}, },
); );
} }
/**
* @description: 获取数据日志LngBBank
*/
export async function getDataLogLngBBank(id: string, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.Datalog,
data: id,
},
{
errorMessageMode: mode,
},
);
}

View File

@ -11,6 +11,12 @@ export interface LngBBankPageParams extends BasicPageParams {
regionCode: string; regionCode: string;
valid: string; valid: string;
fullName: string;
code: string;
swift: string;
} }
/** /**
@ -21,10 +27,16 @@ export interface LngBBankPageModel {
bankCode: string; bankCode: string;
fullName: string;
shortName: string; shortName: string;
regionCode: string; regionCode: string;
code: string;
swift: string;
valid: string; valid: string;
} }

View File

@ -9,6 +9,9 @@ enum Api {
LngBRegion = '/mdm/countryRegion', LngBRegion = '/mdm/countryRegion',
DataLog = '/mdm/countryRegion/datalog',
} }
/** /**
@ -85,3 +88,21 @@ export async function deleteLngBRegion(ids: string[], mode: ErrorMessageMode = '
}, },
); );
} }
/**
* @description: 获取数据日志LngBRegion
*/
export async function getDataLogLngBRegion(id: string, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.Datalog,
data: id,
},
{
errorMessageMode: mode,
},
);
}

View File

@ -4,17 +4,15 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
* @description: LngBRegion分页参数 模型 * @description: LngBRegion分页参数 模型
*/ */
export interface LngBRegionPageParams extends BasicPageParams { export interface LngBRegionPageParams extends BasicPageParams {
id: string;
code: string; code: string;
createUserId: string; fullName: string;
regionTypeCode: string; regionTypeCode: string;
pid: string; pid: string;
fullName: string; fullPath: string;
valid: string; valid: string;
@ -27,19 +25,19 @@ export interface LngBRegionPageParams extends BasicPageParams {
export interface LngBRegionPageModel { export interface LngBRegionPageModel {
id: string; id: string;
regionTypeCode: string;
valid: string;
code: string; code: string;
fullName: string; fullName: string;
regionTypeCode: string;
pid: string; pid: string;
note: string; fullPath: string;
createUserId: string; valid: string;
note: string;
} }
0; 0;

View File

@ -1,7 +1,9 @@
<template> <template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit" @cancel="handleClose" :paddingRight="15" :bodyStyle="{ minHeight: '400px !important' }"> <BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit" @cancel="handleClose" :paddingRight="15" :bodyStyle="{ minHeight: '400px !important' }">
<ModalForm ref="formRef" :fromPage="FromPageType.MENU" /> <ModalForm ref="formRef" :fromPage="FromPageType.MENU" />
</BasicModal> </BasicModal>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed, reactive } from 'vue'; import { ref, computed, reactive } from 'vue';
@ -21,7 +23,7 @@
isUpdate: true, isUpdate: true,
isView: false, isView: false,
isCopy: false, isCopy: false,
rowId: '' rowId: '',
}); });
const { t } = useI18n(); const { t } = useI18n();
@ -36,7 +38,7 @@
showCancelBtn: !state.isView, showCancelBtn: !state.isView,
showOkBtn: !state.isView, showOkBtn: !state.isView,
canFullscreen: true, canFullscreen: true,
width: 900 width: 900,
}); });
if (state.isUpdate || state.isView || state.isCopy) { if (state.isUpdate || state.isView || state.isCopy) {
state.rowId = data.id; state.rowId = data.id;
@ -85,12 +87,12 @@
//false 新增 //false 新增
notification.success({ notification.success({
message: 'Tip', message: 'Tip',
description: t('新增成功!') description: t('新增成功!'),
}); //提示消息 }); //提示消息
} else { } else {
notification.success({ notification.success({
message: 'Tip', message: 'Tip',
description: t('修改成功!') description: t('修改成功!'),
}); //提示消息 }); //提示消息
} }
closeModal(); closeModal();

View File

@ -1,5 +1,10 @@
<template> <template>
<SimpleForm ref="systemFormRef" :formProps="data.formDataProps" :formModel="{}" :isWorkFlow="props.fromPage != FromPageType.MENU" /> <SimpleForm
ref="systemFormRef"
:formProps="data.formDataProps"
:formModel="{}"
:isWorkFlow="props.fromPage!=FromPageType.MENU"
/>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { reactive, ref,onBeforeMount,onMounted } from 'vue'; import { reactive, ref,onBeforeMount,onMounted } from 'vue';
@ -11,7 +16,7 @@
import { usePermission } from '/@/hooks/web/usePermission'; import { usePermission } from '/@/hooks/web/usePermission';
import { useFormConfig } from '/@/hooks/web/useFormConfig'; import { useFormConfig } from '/@/hooks/web/useFormConfig';
import { FromPageType } from '/@/enums/workflowEnum'; import { FromPageType } from '/@/enums/workflowEnum';
import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent } from '/@/hooks/web/useFormEvent'; import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent,} from '/@/hooks/web/useFormEvent';
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';
@ -25,15 +30,15 @@
const props = defineProps({ const props = defineProps({
fromPage: { fromPage: {
type: Number, type: Number,
default: FromPageType.MENU default: FromPageType.MENU,
} },
}); });
const systemFormRef = ref(); const systemFormRef = ref();
const data: { formDataProps: FormDataProps } = reactive({ const data: { formDataProps: FormDataProps } = reactive({
formDataProps: { schemas: [] } as FormDataProps formDataProps: {schemas:[]} as FormDataProps,
}); });
const state = reactive({ const state = reactive({
formModel: {} formModel: {},
}); });
let customFormEventConfigs=[]; let customFormEventConfigs=[];
@ -45,8 +50,12 @@
if (props.fromPage == FromPageType.MENU) { if (props.fromPage == FromPageType.MENU) {
setMenuPermission(); setMenuPermission();
await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单 await createFormEvent(customFormEventConfigs, state.formModel,
await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单 systemFormRef.value,
formProps.schemas); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:加载表单
} else if (props.fromPage == FromPageType.FLOW) { } else if (props.fromPage == FromPageType.FLOW) {
emits('loadingCompleted'); //告诉系统表单已经加载完毕 emits('loadingCompleted'); //告诉系统表单已经加载完毕
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法 // loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
@ -55,13 +64,20 @@
} else if (props.fromPage == FromPageType.DESKTOP) { } else if (props.fromPage == FromPageType.DESKTOP) {
// 桌面设计 表单事件需要执行 // 桌面设计 表单事件需要执行
emits('loadingCompleted'); //告诉系统表单已经加载完毕 emits('loadingCompleted'); //告诉系统表单已经加载完毕
await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单 await createFormEvent(customFormEventConfigs, state.formModel,
await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单 systemFormRef.value,
formProps.schemas); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:加载表单
} }
emits('form-mounted', formProps); emits('form-mounted', formProps);
} catch (error) {} } catch (error) {
}
}); });
async function mergeCustomFormRenderConfig() { async function mergeCustomFormRenderConfig() {
let cloneProps=cloneDeep(formProps); let cloneProps=cloneDeep(formProps);
let fEventConfigs=cloneDeep(formEventConfigs); let fEventConfigs=cloneDeep(formEventConfigs);
@ -109,7 +125,9 @@
state.formModel = record; state.formModel = record;
await getFormDataEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据 await getFormDataEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据
return record; return record;
} catch (error) {} } catch (error) {
}
} }
// 辅助设置表单数据 // 辅助设置表单数据
function setFieldsValue(record) { function setFieldsValue(record) {
@ -133,7 +151,9 @@
values[RowKey] = rowId; values[RowKey] = rowId;
state.formModel = values; state.formModel = values;
let saveVal = await updateLngBBank(values); let saveVal = await updateLngBBank(values);
await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单 await submitFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:提交表单
return saveVal; return saveVal;
} catch (error) {} } catch (error) {}
} }
@ -142,7 +162,9 @@
try { try {
state.formModel = values; state.formModel = values;
let saveVal = await addLngBBank(values); let saveVal = await addLngBBank(values);
await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单 await submitFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:提交表单
return saveVal; return saveVal;
} catch (error) {} } catch (error) {}
} }
@ -167,16 +189,20 @@
} }
state.formModel = formModels; state.formModel = formModels;
if(formModels[RowKey]) { if(formModels[RowKey]) {
setFormDataFromId(formModels[RowKey], false); setFormDataFromId(formModels[RowKey], false)
} else { } else {
setFieldsValue(formModels); setFieldsValue(formModels)
} }
} catch (error) {} } catch (error) {}
await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单 await createFormEvent(customFormEventConfigs, state.formModel,
await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单 systemFormRef.value,
formProps.schemas); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:加载表单
} }
function getFormModel() { function getFormModel() {
return systemFormRef.value.formModel; return systemFormRef.value.formModel
} }
async function handleDelete(id) { async function handleDelete(id) {
return await deleteLngBBank([id]); return await deleteLngBBank([id]);

View File

@ -34,6 +34,21 @@ export const searchFormSchema: FormSchema[] = [
getPopupContainer: () => document.body, getPopupContainer: () => document.body,
}, },
}, },
{
field: 'fullName',
label: '银行名称',
component: 'Input',
},
{
field: 'code',
label: '所属国家和地区',
component: 'Input',
},
{
field: 'swift',
label: 'SWIFT',
component: 'Input',
},
]; ];
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
@ -46,6 +61,15 @@ export const columns: BasicColumn[] = [
sorter: true, sorter: true,
}, },
{
dataIndex: 'fullName',
title: '银行名称',
componentType: 'input',
align: 'left',
sorter: true,
},
{ {
dataIndex: 'shortName', dataIndex: 'shortName',
title: '银行名称/简称', title: '银行名称/简称',
@ -64,6 +88,24 @@ export const columns: BasicColumn[] = [
sorter: true, sorter: true,
}, },
{
dataIndex: 'code',
title: '所属国家和地区',
componentType: 'input',
align: 'left',
sorter: true,
},
{
dataIndex: 'swift',
title: 'SWIFT',
componentType: 'input',
align: 'left',
sorter: true,
},
{ {
dataIndex: 'valid', dataIndex: 'valid',
title: '有效标志', title: '有效标志',
@ -143,7 +185,7 @@ export const formProps: FormProps = {
size: 'default', size: 'default',
schemas: [ schemas: [
{ {
key: '5fdaec7802364d16a979fc9d3218bbfa', key: '151d6e797f7e411297992bd2460ddd29',
field: 'shortName', field: 'shortName',
label: '银行名称/简称', label: '银行名称/简称',
type: 'input', type: 'input',
@ -177,7 +219,7 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: '38bd834c265446658be6f9784672e1ae', key: 'df917f42491f4a8888a9d661a89ac3ce',
field: 'bankCode', field: 'bankCode',
label: '编码', label: '编码',
type: 'input', type: 'input',
@ -211,7 +253,7 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: '6461a5e152124abca28bd2114dd577e6', key: '0e4069a334ea44219d6f1d364d830ffe',
field: 'regionCode', field: 'regionCode',
label: '联行号', label: '联行号',
type: 'input', type: 'input',
@ -245,7 +287,7 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: '714953d458d9402bb507893c92913d44', key: 'e00cdcea0ed14c99b7f7901526f5a5fe',
field: 'valid', field: 'valid',
label: '有效标志', label: '有效标志',
type: 'select', type: 'select',
@ -264,6 +306,7 @@ export const formProps: FormProps = {
showSearch: false, showSearch: false,
clearable: false, clearable: false,
disabled: false, disabled: false,
mode: 'multiple',
staticOptions: [ staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' }, { key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' }, { key: 2, label: 'Option 2', value: 'Option 2' },
@ -288,6 +331,108 @@ export const formProps: FormProps = {
style: { width: '100%' }, style: { width: '100%' },
}, },
}, },
{
key: 'fe4822ade6334198965e983ab26c4100',
field: 'fullName',
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: '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',
field: 'swift',
label: 'SWIFT',
type: 'input',
component: 'Input',
colProps: { span: 24 },
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%' },
},
},
], ],
showActionButtonGroup: false, showActionButtonGroup: false,
buttonLocation: 'center', buttonLocation: 'center',

View File

@ -11,7 +11,7 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'input', type: 'input',
key: '5fdaec7802364d16a979fc9d3218bbfa', key: '151d6e797f7e411297992bd2460ddd29',
children: [], children: [],
}, },
{ {
@ -26,7 +26,7 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'input', type: 'input',
key: '38bd834c265446658be6f9784672e1ae', key: 'df917f42491f4a8888a9d661a89ac3ce',
children: [], children: [],
}, },
{ {
@ -41,7 +41,7 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'input', type: 'input',
key: '6461a5e152124abca28bd2114dd577e6', key: '0e4069a334ea44219d6f1d364d830ffe',
children: [], children: [],
}, },
{ {
@ -56,7 +56,52 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'select', type: 'select',
key: '714953d458d9402bb507893c92913d44', key: 'e00cdcea0ed14c99b7f7901526f5a5fe',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '银行名称',
fieldId: 'fullName',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'fe4822ade6334198965e983ab26c4100',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '所属国家和地区',
fieldId: 'code',
isSubTable: false,
showChildren: true,
type: 'input',
key: '503adbb6dd024e0f934a41ec1ccbff07',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: 'SWIFT',
fieldId: 'swift',
isSubTable: false,
showChildren: true,
type: 'input',
key: '08b8ef5bc2a148e2b14093e97be20305',
children: [], children: [],
}, },
]; ];

View File

@ -1,6 +1,7 @@
<template> <template>
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex"> <PageWrapper dense fixedHeight contentFullHeight contentClass="flex">
<BasicTable @register="registerTable" ref="tableRef" @row-dbClick="dbClickRow"> <BasicTable @register="registerTable" ref="tableRef" @row-dbClick="dbClickRow">
<template #toolbar> <template #toolbar>
<template v-for="button in tableButtonConfig" :key="button.code"> <template v-for="button in tableButtonConfig" :key="button.code">
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)"> <a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
@ -23,7 +24,9 @@
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed, onMounted, onUnmounted, createVNode } from 'vue'; import { ref, computed, onMounted, onUnmounted, createVNode,
} from 'vue';
import { Modal } from 'ant-design-vue'; import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
@ -35,7 +38,7 @@
import { usePermission } from '/@/hooks/web/usePermission'; import { usePermission } from '/@/hooks/web/usePermission';
import { useFormConfig } from '/@/hooks/web/useFormConfig'; import { useFormConfig } from '/@/hooks/web/useFormConfig';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { setIndexFlowStatus } from '/@/utils/flow/index'; import { setIndexFlowStatus } from '/@/utils/flow/index'
import { getLngBBank } from '/@/api/mdm/Bank'; import { getLngBBank } from '/@/api/mdm/Bank';
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import BankModal from './components/BankModal.vue'; import BankModal from './components/BankModal.vue';
@ -58,20 +61,12 @@
const tableRef = ref(); const tableRef = ref();
//所有按钮 //所有按钮
const buttons = ref([ 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":"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, 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: 'refresh', icon: 'ant-design:reload-outlined', isDefault: true },
{ isUse: true, name: '查看', code: 'view', icon: 'ant-design:eye-outlined', isDefault: true },
{ isUse: true, name: '启用', code: 'enable', icon: 'ant-design:check-circle-twotone', isDefault: false },
{ isUse: true, name: '停用', code: 'stop', icon: 'ant-design:stop-outlined', isDefault: false },
{ isUse: true, name: '删除', code: 'delete', icon: 'ant-design:delete-outlined', isDefault: true }
]);
//展示在列表内的按钮 //展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit', 'copyData', 'delete', 'startwork', 'flowRecord']); const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
const buttonConfigs = computed(()=>{ const buttonConfigs = computed(()=>{
return filterButtonAuth(buttons.value); return filterButtonAuth(buttons.value);
}); })
const tableButtonConfig = computed(() => { const tableButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code)); return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
@ -81,34 +76,35 @@
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code)); return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
}); });
const btnEvent = { add: handleAdd, edit: handleEdit, refresh: handleRefresh, view: handleView, delete: handleDelete }; const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,datalog : handleDatalog,delete : handleDelete,}
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
const router = useRouter(); const router = useRouter();
const formIdComputedRef = ref(); const formIdComputedRef = ref();
formIdComputedRef.value = currentRoute.value.meta.formId; formIdComputedRef.value = currentRoute.value.meta.formId
const schemaIdComputedRef = ref(); const schemaIdComputedRef = ref();
schemaIdComputedRef.value = currentRoute.value.meta.schemaId; schemaIdComputedRef.value = currentRoute.value.meta.schemaId
const [registerModal, { openModal }] = useModal(); const [registerModal, { openModal }] = useModal();
const formName='银行'; const formName='银行';
const [registerTable, { reload }] = useTable({ const [registerTable, { reload, }] = useTable({
title: '' || formName + '列表', title: '' || (formName + '列表'),
api: getLngBBankPage, api: getLngBBankPage,
rowKey: 'id', rowKey: 'id',
columns: customConfigColums, columns: customConfigColums,
formConfig: { formConfig: {
rowProps: { rowProps: {
gutter: 16 gutter: 16,
}, },
schemas: customSearchFormSchema, schemas: customSearchFormSchema,
fieldMapToTime: [], fieldMapToTime: [],
showResetButton: false showResetButton: false,
}, },
beforeFetch: (params) => { beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id' }; return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
}, },
afterFetch: (res) => { afterFetch: (res) => {
tableRef.value.setToolBarWidth(); tableRef.value.setToolBarWidth();
}, },
useSearchForm: true, useSearchForm: true,
showTableSetting: true, showTableSetting: true,
@ -118,16 +114,17 @@
width: 160, width: 160,
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
slots: { customRender: 'action' } slots: { customRender: 'action' },
}, },
tableSetting: { tableSetting: {
size: false, size: false,
setting: false setting: false,
} },
}); });
function dbClickRow(record) { function dbClickRow(record) {
if (!actionButtonConfig?.value.some((element) => element.code == 'view')) { if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
return; return;
} }
const { processId, taskIds, schemaId } = record.workflowData || {}; const { processId, taskIds, schemaId } = record.workflowData || {};
@ -163,6 +160,7 @@
} }
function buttonClick(code) { function buttonClick(code) {
btnEvent[code](); btnEvent[code]();
} }
@ -184,6 +182,7 @@
} }
function handleEdit(record: Recordable) { function handleEdit(record: Recordable) {
router.push({ router.push({
path: '/form/Bank/' + record.id + '/updateForm', path: '/form/Bank/' + record.id + '/updateForm',
query: { query: {
@ -196,7 +195,6 @@
function handleDelete(record: Recordable) { function handleDelete(record: Recordable) {
deleteList([record.id]); deleteList([record.id]);
} }
function deleteList(ids) { function deleteList(ids) {
Modal.confirm({ Modal.confirm({
title: '提示信息', title: '提示信息',
@ -209,24 +207,28 @@
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: 'Tip',
description: t('删除成功!') description: t('删除成功!'),
}); });
}); });
}, },
onCancel() {} onCancel() {},
}); });
} }
function handleRefresh() { function handleRefresh() {
reload(); reload();
} }
function handleSuccess() { function handleSuccess() {
reload(); reload();
} }
function handleView(record: Recordable) { function handleView(record: Recordable) {
dbClickRow(record); dbClickRow(record);
} }
onMounted(() => { onMounted(() => {
if (schemaIdComputedRef.value) { if (schemaIdComputedRef.value) {
bus.on(FLOW_PROCESSED, handleRefresh); bus.on(FLOW_PROCESSED, handleRefresh);
bus.on(CREATE_FLOW, handleRefresh); bus.on(CREATE_FLOW, handleRefresh);
@ -246,20 +248,21 @@
} }
}); });
function getActions(record: Recordable):ActionItem[] { function getActions(record: Recordable):ActionItem[] {
const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => { const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => {
if (!record.workflowData?.processId) { if (!record.workflowData?.processId) {
return { return {
icon: button?.icon, icon: button?.icon,
tooltip: button?.name, tooltip: button?.name,
color: button.code === 'delete' ? 'error' : undefined, color: button.code === 'delete' ? 'error' : undefined,
onClick: btnEvent[button.code].bind(null, record) onClick: btnEvent[button.code].bind(null, record),
}; };
} else { } else {
if (button.code === 'view') { if (button.code === 'view') {
return { return {
icon: button?.icon, icon: button?.icon,
tooltip: button?.name, tooltip: button?.name,
onClick: btnEvent[button.code].bind(null, record) onClick: btnEvent[button.code].bind(null, record),
}; };
} else { } else {
return {}; return {};
@ -281,7 +284,7 @@
let btns= await mergeButtons(buttons.value,formId); let btns= await mergeButtons(buttons.value,formId);
buttons.value=btns; buttons.value=btns;
} }
} };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
:deep(.ant-table-selection-col) { :deep(.ant-table-selection-col) {

View File

@ -1,7 +1,9 @@
<template> <template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit" @cancel="handleClose" :paddingRight="15" :bodyStyle="{ minHeight: '400px !important' }"> <BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit" @cancel="handleClose" :paddingRight="15" :bodyStyle="{ minHeight: '400px !important' }">
<ModalForm ref="formRef" :fromPage="FromPageType.MENU" /> <ModalForm ref="formRef" :fromPage="FromPageType.MENU" />
</BasicModal> </BasicModal>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed, reactive } from 'vue'; import { ref, computed, reactive } from 'vue';
@ -21,7 +23,7 @@
isUpdate: true, isUpdate: true,
isView: false, isView: false,
isCopy: false, isCopy: false,
rowId: '' rowId: '',
}); });
const { t } = useI18n(); const { t } = useI18n();
@ -36,7 +38,7 @@
showCancelBtn: !state.isView, showCancelBtn: !state.isView,
showOkBtn: !state.isView, showOkBtn: !state.isView,
canFullscreen: true, canFullscreen: true,
width: 900 width: 900,
}); });
if (state.isUpdate || state.isView || state.isCopy) { if (state.isUpdate || state.isView || state.isCopy) {
state.rowId = data.id; state.rowId = data.id;
@ -85,12 +87,12 @@
//false 新增 //false 新增
notification.success({ notification.success({
message: 'Tip', message: 'Tip',
description: t('新增成功!') description: t('新增成功!'),
}); //提示消息 }); //提示消息
} else { } else {
notification.success({ notification.success({
message: 'Tip', message: 'Tip',
description: t('修改成功!') description: t('修改成功!'),
}); //提示消息 }); //提示消息
} }
closeModal(); closeModal();

View File

@ -1,5 +1,10 @@
<template> <template>
<SimpleForm ref="systemFormRef" :formProps="data.formDataProps" :formModel="{}" :isWorkFlow="props.fromPage != FromPageType.MENU" /> <SimpleForm
ref="systemFormRef"
:formProps="data.formDataProps"
:formModel="{}"
:isWorkFlow="props.fromPage!=FromPageType.MENU"
/>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { reactive, ref,onBeforeMount,onMounted } from 'vue'; import { reactive, ref,onBeforeMount,onMounted } from 'vue';
@ -11,7 +16,7 @@
import { usePermission } from '/@/hooks/web/usePermission'; import { usePermission } from '/@/hooks/web/usePermission';
import { useFormConfig } from '/@/hooks/web/useFormConfig'; import { useFormConfig } from '/@/hooks/web/useFormConfig';
import { FromPageType } from '/@/enums/workflowEnum'; import { FromPageType } from '/@/enums/workflowEnum';
import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent } from '/@/hooks/web/useFormEvent'; import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent,} from '/@/hooks/web/useFormEvent';
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';
@ -25,15 +30,15 @@
const props = defineProps({ const props = defineProps({
fromPage: { fromPage: {
type: Number, type: Number,
default: FromPageType.MENU default: FromPageType.MENU,
} },
}); });
const systemFormRef = ref(); const systemFormRef = ref();
const data: { formDataProps: FormDataProps } = reactive({ const data: { formDataProps: FormDataProps } = reactive({
formDataProps: { schemas: [] } as FormDataProps formDataProps: {schemas:[]} as FormDataProps,
}); });
const state = reactive({ const state = reactive({
formModel: {} formModel: {},
}); });
let customFormEventConfigs=[]; let customFormEventConfigs=[];
@ -45,8 +50,12 @@
if (props.fromPage == FromPageType.MENU) { if (props.fromPage == FromPageType.MENU) {
setMenuPermission(); setMenuPermission();
await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单 await createFormEvent(customFormEventConfigs, state.formModel,
await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单 systemFormRef.value,
formProps.schemas); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:加载表单
} else if (props.fromPage == FromPageType.FLOW) { } else if (props.fromPage == FromPageType.FLOW) {
emits('loadingCompleted'); //告诉系统表单已经加载完毕 emits('loadingCompleted'); //告诉系统表单已经加载完毕
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法 // loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
@ -55,13 +64,20 @@
} else if (props.fromPage == FromPageType.DESKTOP) { } else if (props.fromPage == FromPageType.DESKTOP) {
// 桌面设计 表单事件需要执行 // 桌面设计 表单事件需要执行
emits('loadingCompleted'); //告诉系统表单已经加载完毕 emits('loadingCompleted'); //告诉系统表单已经加载完毕
await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单 await createFormEvent(customFormEventConfigs, state.formModel,
await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单 systemFormRef.value,
formProps.schemas); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:加载表单
} }
emits('form-mounted', formProps); emits('form-mounted', formProps);
} catch (error) {} } catch (error) {
}
}); });
async function mergeCustomFormRenderConfig() { async function mergeCustomFormRenderConfig() {
let cloneProps=cloneDeep(formProps); let cloneProps=cloneDeep(formProps);
let fEventConfigs=cloneDeep(formEventConfigs); let fEventConfigs=cloneDeep(formEventConfigs);
@ -109,7 +125,9 @@
state.formModel = record; state.formModel = record;
await getFormDataEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据 await getFormDataEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据
return record; return record;
} catch (error) {} } catch (error) {
}
} }
// 辅助设置表单数据 // 辅助设置表单数据
function setFieldsValue(record) { function setFieldsValue(record) {
@ -133,7 +151,9 @@
values[RowKey] = rowId; values[RowKey] = rowId;
state.formModel = values; state.formModel = values;
let saveVal = await updateLngBRegion(values); let saveVal = await updateLngBRegion(values);
await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单 await submitFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:提交表单
return saveVal; return saveVal;
} catch (error) {} } catch (error) {}
} }
@ -142,7 +162,9 @@
try { try {
state.formModel = values; state.formModel = values;
let saveVal = await addLngBRegion(values); let saveVal = await addLngBRegion(values);
await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单 await submitFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:提交表单
return saveVal; return saveVal;
} catch (error) {} } catch (error) {}
} }
@ -167,16 +189,20 @@
} }
state.formModel = formModels; state.formModel = formModels;
if(formModels[RowKey]) { if(formModels[RowKey]) {
setFormDataFromId(formModels[RowKey], false); setFormDataFromId(formModels[RowKey], false)
} else { } else {
setFieldsValue(formModels); setFieldsValue(formModels)
} }
} catch (error) {} } catch (error) {}
await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单 await createFormEvent(customFormEventConfigs, state.formModel,
await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单 systemFormRef.value,
formProps.schemas); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:加载表单
} }
function getFormModel() { function getFormModel() {
return systemFormRef.value.formModel; return systemFormRef.value.formModel
} }
async function handleDelete(id) { async function handleDelete(id) {
return await deleteLngBRegion([id]); return await deleteLngBRegion([id]);

View File

@ -6,18 +6,13 @@ export const formConfig = {
}; };
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{
field: 'id',
label: 'id',
component: 'Input',
},
{ {
field: 'code', field: 'code',
label: '编码', label: '编码',
component: 'Input', component: 'Input',
}, },
{ {
field: 'createUserId', field: 'fullName',
label: '名称', label: '名称',
component: 'Input', component: 'Input',
}, },
@ -40,7 +35,7 @@ export const searchFormSchema: FormSchema[] = [
component: 'Input', component: 'Input',
}, },
{ {
field: 'fullName', field: 'fullPath',
label: '全路径名称', label: '全路径名称',
component: 'Input', component: 'Input',
}, },
@ -66,8 +61,17 @@ export const searchFormSchema: FormSchema[] = [
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
dataIndex: 'id', dataIndex: 'code',
title: 'id', title: '编码',
componentType: 'input',
align: 'left',
sorter: true,
},
{
dataIndex: 'fullName',
title: '名称',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
@ -83,33 +87,6 @@ export const columns: BasicColumn[] = [
sorter: true, sorter: true,
}, },
{
dataIndex: 'valid',
title: '有效标志',
componentType: 'select',
align: 'left',
sorter: true,
},
{
dataIndex: 'code',
title: '编码',
componentType: 'input',
align: 'left',
sorter: true,
},
{
dataIndex: 'fullName',
title: '全路径名称',
componentType: 'input',
align: 'left',
sorter: true,
},
{ {
dataIndex: 'pid', dataIndex: 'pid',
title: '上级ID', title: '上级ID',
@ -120,18 +97,27 @@ export const columns: BasicColumn[] = [
}, },
{ {
dataIndex: 'note', dataIndex: 'fullPath',
title: '备注', title: '全路径名称',
componentType: 'textarea', componentType: 'input',
align: 'left', align: 'left',
sorter: true, sorter: true,
}, },
{ {
dataIndex: 'createUserId', dataIndex: 'valid',
title: '名称', title: '有效标志',
componentType: 'input', componentType: 'select',
align: 'left',
sorter: true,
},
{
dataIndex: 'note',
title: '备注',
componentType: 'textarea',
align: 'left', align: 'left',
sorter: true, sorter: true,
@ -207,41 +193,7 @@ export const formProps: FormProps = {
size: 'default', size: 'default',
schemas: [ schemas: [
{ {
key: '3665616565b14649b7cc18269b7a2d06', key: '8debb3c9f24b44e6a5256baf825dabd3',
field: 'id',
label: 'id',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
labelWidthMode: 'fix',
labelFixWidth: 120,
responsive: false,
respNewRow: false,
placeholder: '请输入id',
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: '04cf4a78d06244f282a8082070bdd160',
field: 'code', field: 'code',
label: '编码', label: '编码',
type: 'input', type: 'input',
@ -275,8 +227,8 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: '569e80f61cfa49338d3a629acf403b2f', key: 'c9f612f71d7b4d8ba63b29f849e21512',
field: 'createUserId', field: 'fullName',
label: '名称', label: '名称',
type: 'input', type: 'input',
component: 'Input', component: 'Input',
@ -309,7 +261,7 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: 'ac57735d6de3479ab78a092cce60af35', key: 'db1d945640974619b1da11ee3eedc43c',
field: 'regionTypeCode', field: 'regionTypeCode',
label: '类型', label: '类型',
type: 'select', type: 'select',
@ -322,12 +274,13 @@ export const formProps: FormProps = {
labelFixWidth: 120, labelFixWidth: 120,
responsive: false, responsive: false,
respNewRow: false, respNewRow: false,
placeholder: '请选择下拉选择类型', placeholder: '请选择下拉选择',
sepTextField: '', sepTextField: '',
showLabel: true, showLabel: true,
showSearch: false, showSearch: false,
clearable: false, clearable: false,
disabled: false, disabled: false,
mode: 'multiple',
staticOptions: [ staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' }, { key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' }, { key: 2, label: 'Option 2', value: 'Option 2' },
@ -353,7 +306,7 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: '8b4d0e4a36164d219b2fe9045e056581', key: 'ed8d105c346a4306bf6502ecca668328',
field: 'pid', field: 'pid',
label: '上级ID', label: '上级ID',
type: 'input', type: 'input',
@ -387,8 +340,8 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: 'd71fb1fcf5924520b059b1f0b79837f3', key: 'ed4ef5737e834886b33c49a800c180c8',
field: 'fullName', field: 'fullPath',
label: '全路径名称', label: '全路径名称',
type: 'input', type: 'input',
component: 'Input', component: 'Input',
@ -421,7 +374,7 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: '5ee69ee1a3c846aa9ae77035208eac66', key: 'c4eb806479bb49fab6aaab58c2ef8511',
field: 'valid', field: 'valid',
label: '有效标志', label: '有效标志',
type: 'select', type: 'select',
@ -440,6 +393,7 @@ export const formProps: FormProps = {
showSearch: false, showSearch: false,
clearable: false, clearable: false,
disabled: false, disabled: false,
mode: 'multiple',
staticOptions: [ staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' }, { key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' }, { key: 2, label: 'Option 2', value: 'Option 2' },
@ -465,7 +419,7 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: 'fa22773393104485870ba4f6c54e5457', key: '1d4a47bb18044306918247cf66682d5a',
field: 'note', field: 'note',
label: '备注', label: '备注',
type: 'textarea', type: 'textarea',
@ -481,7 +435,7 @@ export const formProps: FormProps = {
responsive: false, responsive: false,
respNewRow: true, respNewRow: true,
placeholder: '请输入备注', placeholder: '请输入备注',
maxlength: 200, maxlength: '',
rows: 4, rows: 4,
autoSize: false, autoSize: false,
showCount: false, showCount: false,

View File

@ -1,19 +1,4 @@
export const permissionList = [ export const permissionList = [
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: 'id',
fieldId: 'id',
isSubTable: false,
showChildren: true,
type: 'input',
key: '3665616565b14649b7cc18269b7a2d06',
children: [],
},
{ {
required: true, required: true,
view: true, view: true,
@ -26,7 +11,7 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'input', type: 'input',
key: '04cf4a78d06244f282a8082070bdd160', key: '8debb3c9f24b44e6a5256baf825dabd3',
children: [], children: [],
}, },
{ {
@ -37,11 +22,11 @@ export const permissionList = [
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '名称', fieldName: '名称',
fieldId: 'createUserId', fieldId: 'fullName',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'input', type: 'input',
key: '569e80f61cfa49338d3a629acf403b2f', key: 'c9f612f71d7b4d8ba63b29f849e21512',
children: [], children: [],
}, },
{ {
@ -56,7 +41,7 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'select', type: 'select',
key: 'ac57735d6de3479ab78a092cce60af35', key: 'db1d945640974619b1da11ee3eedc43c',
children: [], children: [],
}, },
{ {
@ -71,7 +56,7 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'input', type: 'input',
key: '8b4d0e4a36164d219b2fe9045e056581', key: 'ed8d105c346a4306bf6502ecca668328',
children: [], children: [],
}, },
{ {
@ -82,11 +67,11 @@ export const permissionList = [
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '全路径名称', fieldName: '全路径名称',
fieldId: 'fullName', fieldId: 'fullPath',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'input', type: 'input',
key: 'd71fb1fcf5924520b059b1f0b79837f3', key: 'ed4ef5737e834886b33c49a800c180c8',
children: [], children: [],
}, },
{ {
@ -101,7 +86,7 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'select', type: 'select',
key: '5ee69ee1a3c846aa9ae77035208eac66', key: 'c4eb806479bb49fab6aaab58c2ef8511',
children: [], children: [],
}, },
{ {
@ -116,7 +101,7 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'textarea', type: 'textarea',
key: 'fa22773393104485870ba4f6c54e5457', key: '1d4a47bb18044306918247cf66682d5a',
children: [], children: [],
}, },
]; ];

View File

@ -1,12 +1,23 @@
<template> <template>
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex"> <PageWrapper dense fixedHeight contentFullHeight contentClass="flex">
<div class="w-1/5 xl:w-1/5 mr-2"> <div class="w-1/5 xl:w-1/5 mr-2">
<BasicTree title="" toolbar search :clickRowToExpand="true" :treeData="treeData" :fieldNames="{ key: 'key', title: 'title' }" @select="handleSelect"> <BasicTree
<template #title="item"> &nbsp;&nbsp;{{ item.title }} </template> title="国家地区"
toolbar
search
:clickRowToExpand="true"
:treeData="treeData"
:fieldNames="{ key: 'key', title: 'title' }"
@select="handleSelect"
>
<template #title="item">
&nbsp;&nbsp;{{ item.title }}
</template>
</BasicTree> </BasicTree>
</div> </div>
<div class="w-4/5 xl:w-4/5"> <div class="w-4/5 xl:w-4/5">
<BasicTable @register="registerTable" ref="tableRef" @row-dbClick="dbClickRow"> <BasicTable @register="registerTable" ref="tableRef" @row-dbClick="dbClickRow">
<template #toolbar> <template #toolbar>
<template v-for="button in tableButtonConfig" :key="button.code"> <template v-for="button in tableButtonConfig" :key="button.code">
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)"> <a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
@ -30,7 +41,9 @@
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed, onMounted, onUnmounted, createVNode } from 'vue'; import { ref, computed, onMounted, onUnmounted, createVNode,
} from 'vue';
import { Modal } from 'ant-design-vue'; import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
@ -42,7 +55,7 @@
import { usePermission } from '/@/hooks/web/usePermission'; import { usePermission } from '/@/hooks/web/usePermission';
import { useFormConfig } from '/@/hooks/web/useFormConfig'; import { useFormConfig } from '/@/hooks/web/useFormConfig';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { setIndexFlowStatus } from '/@/utils/flow/index'; import { setIndexFlowStatus } from '/@/utils/flow/index'
import { getLngBRegion } from '/@/api/mdm/CountryRegion'; import { getLngBRegion } from '/@/api/mdm/CountryRegion';
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import CountryRegionModal from './components/CountryRegionModal.vue'; import CountryRegionModal from './components/CountryRegionModal.vue';
@ -67,22 +80,12 @@
const tableRef = ref(); const tableRef = ref();
//所有按钮 //所有按钮
const buttons = ref([ 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":"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, 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: 'refresh', icon: 'ant-design:reload-outlined', isDefault: true },
{ isUse: true, name: '查看', code: 'view', icon: 'ant-design:eye-outlined', isDefault: true },
{ isUse: true, name: '启用', code: 'enable', icon: 'ant-design:check-circle-outlined', isDefault: false },
{ isUse: true, name: '停用', code: 'stop', icon: 'ant-design:stop-outlined', isDefault: false },
{ isUse: true, name: '批量启用', code: 'batchenable', icon: 'ant-design:check-circle-outlined', isDefault: false },
{ isUse: true, name: '批量停用', code: 'batchstop', icon: 'ant-design:stop-outlined', isDefault: false },
{ isUse: true, name: '删除', code: 'delete', icon: 'ant-design:delete-outlined', isDefault: true }
]);
//展示在列表内的按钮 //展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit', 'copyData', 'delete', 'startwork', 'flowRecord']); const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
const buttonConfigs = computed(()=>{ const buttonConfigs = computed(()=>{
return filterButtonAuth(buttons.value); return filterButtonAuth(buttons.value);
}); })
const tableButtonConfig = computed(() => { const tableButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code)); return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
@ -92,36 +95,37 @@
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code)); return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
}); });
const btnEvent = { add: handleAdd, edit: handleEdit, refresh: handleRefresh, view: handleView, delete: handleDelete }; const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,datalog : handleDatalog,delete : handleDelete,}
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
const router = useRouter(); const router = useRouter();
const formIdComputedRef = ref(); const formIdComputedRef = ref();
formIdComputedRef.value = currentRoute.value.meta.formId; formIdComputedRef.value = currentRoute.value.meta.formId
const schemaIdComputedRef = ref(); const schemaIdComputedRef = ref();
schemaIdComputedRef.value = currentRoute.value.meta.schemaId; schemaIdComputedRef.value = currentRoute.value.meta.schemaId
const selectId = ref(''); const selectId = ref('');
const treeData = ref<TreeItem[]>([]); const treeData = ref<TreeItem[]>([]);
const [registerModal, { openModal }] = useModal(); const [registerModal, { openModal }] = useModal();
const formName='国家地区'; const formName='国家地区';
const [registerTable, { reload }] = useTable({ const [registerTable, { reload, }] = useTable({
title: '' || formName + '列表', title: '' || (formName + '列表'),
api: getLngBRegionPage, api: getLngBRegionPage,
rowKey: 'id', rowKey: 'id',
columns: customConfigColums, columns: customConfigColums,
formConfig: { formConfig: {
rowProps: { rowProps: {
gutter: 16 gutter: 16,
}, },
schemas: customSearchFormSchema, schemas: customSearchFormSchema,
fieldMapToTime: [], fieldMapToTime: [],
showResetButton: false showResetButton: false,
}, },
beforeFetch: (params) => { beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id' }; return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
}, },
afterFetch: (res) => { afterFetch: (res) => {
tableRef.value.setToolBarWidth(); tableRef.value.setToolBarWidth();
}, },
useSearchForm: true, useSearchForm: true,
showTableSetting: true, showTableSetting: true,
@ -131,16 +135,17 @@
width: 160, width: 160,
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
slots: { customRender: 'action' } slots: { customRender: 'action' },
}, },
tableSetting: { tableSetting: {
size: false, size: false,
setting: false setting: false,
} },
}); });
function dbClickRow(record) { function dbClickRow(record) {
if (!actionButtonConfig?.value.some((element) => element.code == 'view')) { if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
return; return;
} }
const { processId, taskIds, schemaId } = record.workflowData || {}; const { processId, taskIds, schemaId } = record.workflowData || {};
@ -176,6 +181,7 @@
} }
function buttonClick(code) { function buttonClick(code) {
btnEvent[code](); btnEvent[code]();
} }
@ -197,6 +203,7 @@
} }
function handleEdit(record: Recordable) { function handleEdit(record: Recordable) {
router.push({ router.push({
path: '/form/CountryRegion/' + record.id + '/updateForm', path: '/form/CountryRegion/' + record.id + '/updateForm',
query: { query: {
@ -209,7 +216,6 @@
function handleDelete(record: Recordable) { function handleDelete(record: Recordable) {
deleteList([record.id]); deleteList([record.id]);
} }
function deleteList(ids) { function deleteList(ids) {
Modal.confirm({ Modal.confirm({
title: '提示信息', title: '提示信息',
@ -222,29 +228,33 @@
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: 'Tip',
description: t('删除成功!') description: t('删除成功!'),
}); });
}); });
}, },
onCancel() {} onCancel() {},
}); });
} }
function handleRefresh() { function handleRefresh() {
reload(); reload();
} }
function handleSuccess() { function handleSuccess() {
reload(); reload();
} }
function handleView(record: Recordable) { function handleView(record: Recordable) {
dbClickRow(record); dbClickRow(record);
} }
function handleSelect(selectIds) { function handleSelect(selectIds) {
selectId.value = selectIds[0]; selectId.value = selectIds[0];
reload({ searchInfo: { id: selectIds[0] } }); reload({ searchInfo: { code: selectIds[0] } });
} }
async function fetch() { async function fetch() {
treeData.value = []; treeData.value = [];
} }
onMounted(() => { onMounted(() => {
@ -268,20 +278,21 @@
} }
}); });
function getActions(record: Recordable):ActionItem[] { function getActions(record: Recordable):ActionItem[] {
const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => { const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => {
if (!record.workflowData?.processId) { if (!record.workflowData?.processId) {
return { return {
icon: button?.icon, icon: button?.icon,
tooltip: button?.name, tooltip: button?.name,
color: button.code === 'delete' ? 'error' : undefined, color: button.code === 'delete' ? 'error' : undefined,
onClick: btnEvent[button.code].bind(null, record) onClick: btnEvent[button.code].bind(null, record),
}; };
} else { } else {
if (button.code === 'view') { if (button.code === 'view') {
return { return {
icon: button?.icon, icon: button?.icon,
tooltip: button?.name, tooltip: button?.name,
onClick: btnEvent[button.code].bind(null, record) onClick: btnEvent[button.code].bind(null, record),
}; };
} else { } else {
return {}; return {};
@ -303,7 +314,7 @@
let btns= await mergeButtons(buttons.value,formId); let btns= await mergeButtons(buttons.value,formId);
buttons.value=btns; buttons.value=btns;
} }
} };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
:deep(.ant-table-selection-col) { :deep(.ant-table-selection-col) {