重新生成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',
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;
valid: string;
fullName: string;
code: string;
swift: string;
}
/**
@ -21,10 +27,16 @@ export interface LngBBankPageModel {
bankCode: string;
fullName: string;
shortName: string;
regionCode: string;
code: string;
swift: string;
valid: string;
}

View File

@ -9,6 +9,9 @@ enum Api {
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分页参数 模型
*/
export interface LngBRegionPageParams extends BasicPageParams {
id: string;
code: string;
createUserId: string;
fullName: string;
regionTypeCode: string;
pid: string;
fullName: string;
fullPath: string;
valid: string;
@ -27,19 +25,19 @@ export interface LngBRegionPageParams extends BasicPageParams {
export interface LngBRegionPageModel {
id: string;
regionTypeCode: string;
valid: string;
code: string;
fullName: string;
regionTypeCode: string;
pid: string;
note: string;
fullPath: string;
createUserId: string;
valid: string;
note: string;
}
0;

View File

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

View File

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

View File

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

View File

@ -11,7 +11,7 @@ export const permissionList = [
isSubTable: false,
showChildren: true,
type: 'input',
key: '5fdaec7802364d16a979fc9d3218bbfa',
key: '151d6e797f7e411297992bd2460ddd29',
children: [],
},
{
@ -26,7 +26,7 @@ export const permissionList = [
isSubTable: false,
showChildren: true,
type: 'input',
key: '38bd834c265446658be6f9784672e1ae',
key: 'df917f42491f4a8888a9d661a89ac3ce',
children: [],
},
{
@ -41,7 +41,7 @@ export const permissionList = [
isSubTable: false,
showChildren: true,
type: 'input',
key: '6461a5e152124abca28bd2114dd577e6',
key: '0e4069a334ea44219d6f1d364d830ffe',
children: [],
},
{
@ -56,7 +56,52 @@ export const permissionList = [
isSubTable: false,
showChildren: true,
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: [],
},
];

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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