港口、LNG气源地调试

This commit is contained in:
2025-10-24 17:19:02 +08:00
parent bd17824058
commit 112a34944d
9 changed files with 2801 additions and 3112 deletions

View File

@ -3,17 +3,15 @@ import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios'; import { ErrorMessageMode } from '/#/axios';
enum Api { enum Api {
Page = '/mdm/lngStation/page', Page = '/mdm/lNGStation/page',
List = '/mdm/lngStation/list', List = '/mdm/lNGStation/list',
Info = '/mdm/lngStation/info', Info = '/mdm/lNGStation/info',
LngBStationLng = '/mdm/lngStation', LngBStationLng = '/mdm/lNGStation',
Enable = '/mdm/lNGStation/enable',
Disable = '/mdm/lNGStation/disable',
DataLog = '/mdm/lNGStation/datalog'
Enable = '/mdm/lngStation/enable',
Disable= '/mdm/lngStation/disable',
DataLog = '/mdm/lngStation/datalog',
} }
/** /**
@ -23,11 +21,11 @@ export async function getLngBStationLngPage(params: LngBStationLngPageParams, mo
return defHttp.get<LngBStationLngPageResult>( return defHttp.get<LngBStationLngPageResult>(
{ {
url: Api.Page, url: Api.Page,
params, params
}, },
{ {
errorMessageMode: mode, errorMessageMode: mode
}, }
); );
} }
@ -38,11 +36,11 @@ export async function getLngBStationLng(id: String, mode: ErrorMessageMode = 'mo
return defHttp.get<LngBStationLngPageModel>( return defHttp.get<LngBStationLngPageModel>(
{ {
url: Api.Info, url: Api.Info,
params: { id }, params: { id }
}, },
{ {
errorMessageMode: mode, errorMessageMode: mode
}, }
); );
} }
@ -53,11 +51,11 @@ export async function addLngBStationLng(lngBStationLng: Recordable, mode: ErrorM
return defHttp.post<boolean>( return defHttp.post<boolean>(
{ {
url: Api.LngBStationLng, url: Api.LngBStationLng,
params: lngBStationLng, params: lngBStationLng
}, },
{ {
errorMessageMode: mode, errorMessageMode: mode
}, }
); );
} }
@ -68,11 +66,11 @@ export async function updateLngBStationLng(lngBStationLng: Recordable, mode: Err
return defHttp.put<boolean>( return defHttp.put<boolean>(
{ {
url: Api.LngBStationLng, url: Api.LngBStationLng,
params: lngBStationLng, params: lngBStationLng
}, },
{ {
errorMessageMode: mode, errorMessageMode: mode
}, }
); );
} }
@ -83,15 +81,14 @@ export async function deleteLngBStationLng(ids: string[], mode: ErrorMessageMode
return defHttp.delete<boolean>( return defHttp.delete<boolean>(
{ {
url: Api.LngBStationLng, url: Api.LngBStationLng,
data: ids, data: ids
}, },
{ {
errorMessageMode: mode, errorMessageMode: mode
}, }
); );
} }
/** /**
* @description: 启用数据LngBStationLng * @description: 启用数据LngBStationLng
*/ */
@ -99,11 +96,11 @@ export async function enableLngBStationLng(ids: string[], mode: ErrorMessageMode
return defHttp.post<boolean>( return defHttp.post<boolean>(
{ {
url: Api.Enable, url: Api.Enable,
data: ids, data: ids
}, },
{ {
errorMessageMode: mode, errorMessageMode: mode
}, }
); );
} }
/** /**
@ -113,27 +110,25 @@ export async function disableLngBStationLng(ids: string[], mode: ErrorMessageMod
return defHttp.post<boolean>( return defHttp.post<boolean>(
{ {
url: Api.Disable, url: Api.Disable,
data: ids, data: ids
}, },
{ {
errorMessageMode: mode, errorMessageMode: mode
}, }
); );
} }
/**
/**
* @description: 获取数据日志LngBStationLng * @description: 获取数据日志LngBStationLng
*/ */
export async function getDataLogLngBStationLng(id: string, mode: ErrorMessageMode = 'modal') { export async function getDataLogLngBStationLng(id: string, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>( return defHttp.post<boolean>(
{ {
url: Api.Datalog, url: Api.Datalog,
data: id, data: id
}, },
{ {
errorMessageMode: mode, errorMessageMode: mode
},
);
} }
);
}

View File

@ -2,14 +2,14 @@ import { FormProps, FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table'; import { BasicColumn } from '/@/components/Table';
export const formConfig = { export const formConfig = {
useCustomConfig: false, useCustomConfig: false
}; };
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{ {
field: 'fullName', field: 'fullName',
label: '名称', label: '名称',
component: 'Input', component: 'Input'
}, },
{ {
field: 'valid', field: 'valid',
@ -21,13 +21,13 @@ export const searchFormSchema: FormSchema[] = [
labelField: 'name', labelField: 'name',
valueField: 'value', valueField: 'value',
getPopupContainer: () => document.body, getPopupContainer: () => document.body
}, }
}, },
{ {
field: 'code', field: 'code',
label: '编码', label: '编码',
component: 'Input', component: 'Input'
}, },
{ {
field: 'unitCode', field: 'unitCode',
@ -39,27 +39,27 @@ export const searchFormSchema: FormSchema[] = [
labelField: 'name', labelField: 'name',
valueField: 'value', valueField: 'value',
getPopupContainer: () => document.body, getPopupContainer: () => document.body
}, }
}, },
{ {
field: 'coefficient', field: 'coefficient',
label: '车/数量单位', label: '车/数量单位',
component: 'Input', component: 'Input'
}, },
{ {
field: 'sort', field: 'sort',
label: '显示顺序', label: '显示顺序',
component: 'InputNumber', component: 'InputNumber',
componentProps: { componentProps: {
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
field: 'note', field: 'note',
label: '备注', label: '备注',
component: 'Input', component: 'Input'
}, }
]; ];
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
@ -69,7 +69,7 @@ export const columns: BasicColumn[] = [
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -78,7 +78,7 @@ export const columns: BasicColumn[] = [
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -87,7 +87,7 @@ export const columns: BasicColumn[] = [
componentType: 'select', componentType: 'select',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -96,7 +96,7 @@ export const columns: BasicColumn[] = [
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -105,7 +105,7 @@ export const columns: BasicColumn[] = [
componentType: 'number', componentType: 'number',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -114,7 +114,7 @@ export const columns: BasicColumn[] = [
componentType: 'select', componentType: 'select',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -123,8 +123,8 @@ export const columns: BasicColumn[] = [
componentType: 'textarea', componentType: 'textarea',
align: 'left', align: 'left',
sorter: true, sorter: true
}, }
]; ];
//表单事件 //表单事件
export const formEventConfigs = { export const formEventConfigs = {
@ -135,7 +135,7 @@ export const formEventConfigs = {
text: '开始节点', text: '开始节点',
icon: '#icon-kaishi', icon: '#icon-kaishi',
bgcColor: '#D8E5FF', bgcColor: '#D8E5FF',
isUserDefined: false, isUserDefined: false
}, },
{ {
color: '#F6AB01', color: '#F6AB01',
@ -143,8 +143,8 @@ export const formEventConfigs = {
text: '初始化表单', text: '初始化表单',
bgcColor: '#f9f5ea', bgcColor: '#f9f5ea',
isUserDefined: false, isUserDefined: false,
nodeInfo: { processEvent: [] }, nodeInfo: { processEvent: [] }
}, }
], ],
1: [ 1: [
{ {
@ -154,8 +154,8 @@ export const formEventConfigs = {
detail: '(新增无此操作)', detail: '(新增无此操作)',
bgcColor: '#F8F2FC', bgcColor: '#F8F2FC',
isUserDefined: false, isUserDefined: false,
nodeInfo: { processEvent: [] }, nodeInfo: { processEvent: [] }
}, }
], ],
2: [ 2: [
{ {
@ -164,8 +164,8 @@ export const formEventConfigs = {
text: '加载表单', text: '加载表单',
bgcColor: '#FFF1F1', bgcColor: '#FFF1F1',
isUserDefined: false, isUserDefined: false,
nodeInfo: { processEvent: [] }, nodeInfo: { processEvent: [] }
}, }
], ],
3: [ 3: [
{ {
@ -174,8 +174,8 @@ export const formEventConfigs = {
text: '提交表单', text: '提交表单',
bgcColor: '#F5F4FF', bgcColor: '#F5F4FF',
isUserDefined: false, isUserDefined: false,
nodeInfo: { processEvent: [] }, nodeInfo: { processEvent: [] }
}, }
], ],
4: [ 4: [
{ {
@ -185,9 +185,9 @@ export const formEventConfigs = {
icon: '#icon-jieshuzhiliao', icon: '#icon-jieshuzhiliao',
bgcColor: '#FFD6D6', bgcColor: '#FFD6D6',
isLast: true, isLast: true,
isUserDefined: false, isUserDefined: false
}, }
], ]
}; };
export const formProps: FormProps = { export const formProps: FormProps = {
labelCol: { span: 3, offset: 0 }, labelCol: { span: 3, offset: 0 },
@ -226,8 +226,8 @@ export const formProps: FormProps = {
isSave: false, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: 'bf017ce23394455689757955a23d7b72', key: 'bf017ce23394455689757955a23d7b72',
@ -260,8 +260,8 @@ export const formProps: FormProps = {
isSave: false, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '533dcfe1e679462e830091588c1cb9fd', key: '533dcfe1e679462e830091588c1cb9fd',
@ -287,7 +287,7 @@ export const formProps: FormProps = {
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' },
{ key: 3, label: 'Option 3', value: 'Option 3' }, { key: 3, label: 'Option 3', value: 'Option 3' }
], ],
defaultSelect: null, defaultSelect: null,
datasourceType: 'dic', datasourceType: 'dic',
@ -297,7 +297,7 @@ export const formProps: FormProps = {
apiConfig: { apiConfig: {
path: 'CodeGeneration/selection', path: 'CodeGeneration/selection',
method: 'GET', method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7', apiId: '93d735dcb7364a0f8102188ec4d77ac7'
}, },
dicOptions: [], dicOptions: [],
required: true, required: true,
@ -305,8 +305,8 @@ export const formProps: FormProps = {
events: {}, events: {},
isShow: true, isShow: true,
itemId: '1980562721538633730', itemId: '1980562721538633730',
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '57d85cbf34fa475298997f5a7427bf8d', key: '57d85cbf34fa475298997f5a7427bf8d',
@ -339,8 +339,8 @@ export const formProps: FormProps = {
isSave: false, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '870650303cf54491b476233e6d5d9b6b', key: '870650303cf54491b476233e6d5d9b6b',
@ -369,8 +369,8 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '17bbaf11ddb0454d854f2082abd7b191', key: '17bbaf11ddb0454d854f2082abd7b191',
@ -396,7 +396,7 @@ export const formProps: FormProps = {
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' },
{ key: 3, label: 'Option 3', value: 'Option 3' }, { key: 3, label: 'Option 3', value: 'Option 3' }
], ],
defaultSelect: null, defaultSelect: null,
datasourceType: 'dic', datasourceType: 'dic',
@ -406,7 +406,7 @@ export const formProps: FormProps = {
apiConfig: { apiConfig: {
path: 'CodeGeneration/selection', path: 'CodeGeneration/selection',
method: 'GET', method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7', apiId: '93d735dcb7364a0f8102188ec4d77ac7'
}, },
dicOptions: [], dicOptions: [],
required: false, required: false,
@ -414,8 +414,8 @@ export const formProps: FormProps = {
events: {}, events: {},
isShow: true, isShow: true,
itemId: '1978057078528327681', itemId: '1978057078528327681',
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '7e8014fe939e4ca88ebe986dd91c555c', key: '7e8014fe939e4ca88ebe986dd91c555c',
@ -445,14 +445,14 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
style: { width: '100%' }, style: { width: '100%' }
}, }
}, }
], ],
showActionButtonGroup: false, showActionButtonGroup: false,
buttonLocation: 'center', buttonLocation: 'center',
actionColOptions: { span: 24 }, actionColOptions: { span: 24 },
showResetButton: false, showResetButton: false,
showSubmitButton: false, showSubmitButton: false,
hiddenComponent: [], hiddenComponent: []
}; };

View File

@ -1,9 +1,7 @@
<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';
@ -23,7 +21,7 @@
isUpdate: true, isUpdate: true,
isView: false, isView: false,
isCopy: false, isCopy: false,
rowId: '', rowId: ''
}); });
const { t } = useI18n(); const { t } = useI18n();
@ -38,7 +36,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;
@ -87,12 +85,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

@ -2,94 +2,14 @@ import { FormProps, FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table'; import { BasicColumn } from '/@/components/Table';
export const formConfig = { export const formConfig = {
useCustomConfig: false, useCustomConfig: false
}; };
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{
field: 'code',
label: '编码',
component: 'Input',
},
{ {
field: 'fullName', field: 'fullName',
label: '名称', label: '名称',
component: 'Input', component: 'Input'
},
{
field: 'enterprise',
label: '所属企业',
component: 'Input',
},
{
field: 'contact',
label: '联系人',
component: 'Input',
},
{
field: 'tel',
label: '电话',
component: 'Input',
},
{
field: 'email',
label: '邮箱',
component: 'Input',
},
{
field: 'regionCode',
label: '行政区域',
component: 'Area',
componentProps: {
suffix: 'ant-design:setting-outlined',
placeholder: '请选择',
getPopupContainer: () => document.body,
},
},
{
field: 'addr',
label: '地址',
component: 'Input',
},
{
field: 'addrMail',
label: '通讯地址',
component: 'Input',
},
{
field: 'ownSign',
label: '自有设备标识',
component: 'XjrSelect',
componentProps: {
datasourceType: 'dic',
params: { itemId: '1679045876047552513' },
labelField: 'name',
valueField: 'value',
getPopupContainer: () => document.body,
},
},
{
field: 'onlineSign',
label: '系统直联',
component: 'XjrSelect',
componentProps: {
datasourceType: 'dic',
params: { itemId: '1419276800524423168' },
labelField: 'name',
valueField: 'value',
getPopupContainer: () => document.body,
},
},
{
field: 'sort',
label: '显示顺序',
component: 'InputNumber',
componentProps: {
style: { width: '100%' },
},
}, },
{ {
field: 'valid', field: 'valid',
@ -101,14 +21,9 @@ export const searchFormSchema: FormSchema[] = [
labelField: 'name', labelField: 'name',
valueField: 'value', valueField: 'value',
getPopupContainer: () => document.body, getPopupContainer: () => document.body
}, }
}, }
{
field: 'note',
label: '备注',
component: 'Input',
},
]; ];
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
@ -118,7 +33,7 @@ export const columns: BasicColumn[] = [
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -127,7 +42,7 @@ export const columns: BasicColumn[] = [
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -136,7 +51,7 @@ export const columns: BasicColumn[] = [
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -145,7 +60,7 @@ export const columns: BasicColumn[] = [
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -154,7 +69,7 @@ export const columns: BasicColumn[] = [
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -163,7 +78,7 @@ export const columns: BasicColumn[] = [
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -172,71 +87,8 @@ export const columns: BasicColumn[] = [
componentType: 'select', componentType: 'select',
align: 'left', align: 'left',
sorter: true, sorter: true
}, }
{
dataIndex: 'regionCode',
title: '行政区域',
componentType: 'area',
align: 'left',
sorter: true,
},
{
dataIndex: 'addr',
title: '地址',
componentType: 'textarea',
align: 'left',
sorter: true,
},
{
dataIndex: 'addrMail',
title: '通讯地址',
componentType: 'textarea',
align: 'left',
sorter: true,
},
{
dataIndex: 'ownSign',
title: '自有设备标识',
componentType: 'select',
align: 'left',
sorter: true,
},
{
dataIndex: 'onlineSign',
title: '系统直联',
componentType: 'select',
align: 'left',
sorter: true,
},
{
dataIndex: 'sort',
title: '显示顺序',
componentType: 'number',
align: 'left',
sorter: true,
},
{
dataIndex: 'note',
title: '备注',
componentType: 'textarea',
align: 'left',
sorter: true,
},
]; ];
//表单事件 //表单事件
export const formEventConfigs = { export const formEventConfigs = {
@ -247,7 +99,7 @@ export const formEventConfigs = {
text: '开始节点', text: '开始节点',
icon: '#icon-kaishi', icon: '#icon-kaishi',
bgcColor: '#D8E5FF', bgcColor: '#D8E5FF',
isUserDefined: false, isUserDefined: false
}, },
{ {
color: '#F6AB01', color: '#F6AB01',
@ -255,8 +107,8 @@ export const formEventConfigs = {
text: '初始化表单', text: '初始化表单',
bgcColor: '#f9f5ea', bgcColor: '#f9f5ea',
isUserDefined: false, isUserDefined: false,
nodeInfo: { processEvent: [] }, nodeInfo: { processEvent: [] }
}, }
], ],
1: [ 1: [
{ {
@ -266,8 +118,8 @@ export const formEventConfigs = {
detail: '(新增无此操作)', detail: '(新增无此操作)',
bgcColor: '#F8F2FC', bgcColor: '#F8F2FC',
isUserDefined: false, isUserDefined: false,
nodeInfo: { processEvent: [] }, nodeInfo: { processEvent: [] }
}, }
], ],
2: [ 2: [
{ {
@ -276,8 +128,8 @@ export const formEventConfigs = {
text: '加载表单', text: '加载表单',
bgcColor: '#FFF1F1', bgcColor: '#FFF1F1',
isUserDefined: false, isUserDefined: false,
nodeInfo: { processEvent: [] }, nodeInfo: { processEvent: [] }
}, }
], ],
3: [ 3: [
{ {
@ -286,8 +138,8 @@ export const formEventConfigs = {
text: '提交表单', text: '提交表单',
bgcColor: '#F5F4FF', bgcColor: '#F5F4FF',
isUserDefined: false, isUserDefined: false,
nodeInfo: { processEvent: [] }, nodeInfo: { processEvent: [] }
}, }
], ],
4: [ 4: [
{ {
@ -297,9 +149,9 @@ export const formEventConfigs = {
icon: '#icon-jieshuzhiliao', icon: '#icon-jieshuzhiliao',
bgcColor: '#FFD6D6', bgcColor: '#FFD6D6',
isLast: true, isLast: true,
isUserDefined: false, isUserDefined: false
}, }
], ]
}; };
export const formProps: FormProps = { export const formProps: FormProps = {
labelCol: { span: 3, offset: 0 }, labelCol: { span: 3, offset: 0 },
@ -338,8 +190,8 @@ export const formProps: FormProps = {
isSave: false, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: 'e23fcb9f62104eb284b553403a12ee12', key: 'e23fcb9f62104eb284b553403a12ee12',
@ -347,7 +199,7 @@ export const formProps: FormProps = {
label: '名称', label: '名称',
type: 'input', type: 'input',
component: 'Input', component: 'Input',
colProps: { span: 24 }, colProps: { span: 8 },
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
width: '100%', width: '100%',
@ -372,8 +224,8 @@ export const formProps: FormProps = {
isSave: false, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: 'd32af84b3fc8443cbef441fc6ce5fc0b', key: 'd32af84b3fc8443cbef441fc6ce5fc0b',
@ -381,7 +233,7 @@ export const formProps: FormProps = {
label: '所属企业', label: '所属企业',
type: 'input', type: 'input',
component: 'Input', component: 'Input',
colProps: { span: 24 }, colProps: { span: 8 },
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
width: '100%', width: '100%',
@ -406,8 +258,8 @@ export const formProps: FormProps = {
isSave: false, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '5adb1f7560b344d789102d4b0af05b64', key: '5adb1f7560b344d789102d4b0af05b64',
@ -415,7 +267,7 @@ export const formProps: FormProps = {
label: '联系人', label: '联系人',
type: 'input', type: 'input',
component: 'Input', component: 'Input',
colProps: { span: 24 }, colProps: { span: 8 },
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
width: '100%', width: '100%',
@ -440,8 +292,8 @@ export const formProps: FormProps = {
isSave: false, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: 'a5a825723d8f4789aaea9189a98f792c', key: 'a5a825723d8f4789aaea9189a98f792c',
@ -449,7 +301,7 @@ export const formProps: FormProps = {
label: '电话', label: '电话',
type: 'input', type: 'input',
component: 'Input', component: 'Input',
colProps: { span: 24 }, colProps: { span: 8 },
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
width: '100%', width: '100%',
@ -474,8 +326,8 @@ export const formProps: FormProps = {
isSave: false, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: 'cbdd54bdc1334671904b1c10e064571d', key: 'cbdd54bdc1334671904b1c10e064571d',
@ -483,7 +335,7 @@ export const formProps: FormProps = {
label: '邮箱', label: '邮箱',
type: 'input', type: 'input',
component: 'Input', component: 'Input',
colProps: { span: 24 }, colProps: { span: 8 },
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
width: '100%', width: '100%',
@ -508,8 +360,8 @@ export const formProps: FormProps = {
isSave: false, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '1485b829c80a493bb55f37d1c839ccc9', key: '1485b829c80a493bb55f37d1c839ccc9',
@ -517,7 +369,7 @@ export const formProps: FormProps = {
label: '行政区域', label: '行政区域',
type: 'area', type: 'area',
component: 'Area', component: 'Area',
colProps: { span: 24 }, colProps: { span: 8 },
componentProps: { componentProps: {
width: '100%', width: '100%',
span: '', span: '',
@ -533,8 +385,8 @@ export const formProps: FormProps = {
rules: [], rules: [],
events: {}, events: {},
isShow: true, isShow: true,
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: 'e98223a611784bee9a626acceb1745e8', key: 'e98223a611784bee9a626acceb1745e8',
@ -564,8 +416,8 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: 'a0e7e0343222424c823d2a3149a0ceb6', key: 'a0e7e0343222424c823d2a3149a0ceb6',
@ -595,8 +447,8 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '94d31ed5e9b04033bf33a41d10f2d33b', key: '94d31ed5e9b04033bf33a41d10f2d33b',
@ -604,7 +456,7 @@ export const formProps: FormProps = {
label: '自有设备标识', label: '自有设备标识',
type: 'select', type: 'select',
component: 'XjrSelect', component: 'XjrSelect',
colProps: { span: 24 }, colProps: { span: 8 },
componentProps: { componentProps: {
width: '100%', width: '100%',
span: '', span: '',
@ -618,30 +470,30 @@ export const formProps: FormProps = {
showSearch: false, showSearch: false,
clearable: false, clearable: false,
disabled: false, disabled: false,
mode: 'multiple', mode: '',
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' },
{ key: 3, label: 'Option 3', value: 'Option 3' }, { key: 3, label: 'Option 3', value: 'Option 3' }
], ],
defaultSelect: null, defaultSelect: null,
datasourceType: 'dic', datasourceType: 'dic',
params: { itemId: '1679045876047552513' }, params: { itemId: '1978056598125330433' },
labelField: 'name', labelField: 'name',
valueField: 'value', valueField: 'value',
apiConfig: { apiConfig: {
path: 'CodeGeneration/selection', path: 'CodeGeneration/selection',
method: 'GET', method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7', apiId: '93d735dcb7364a0f8102188ec4d77ac7'
}, },
dicOptions: [], dicOptions: [],
required: true, required: true,
rules: [], rules: [],
events: {}, events: {},
isShow: true, isShow: true,
itemId: '1679045876047552513', itemId: '1978056598125330433',
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '136ded020cc84ef4827e0b077b64d24f', key: '136ded020cc84ef4827e0b077b64d24f',
@ -649,7 +501,7 @@ export const formProps: FormProps = {
label: '系统直联', label: '系统直联',
type: 'select', type: 'select',
component: 'XjrSelect', component: 'XjrSelect',
colProps: { span: 24 }, colProps: { span: 8 },
componentProps: { componentProps: {
width: '100%', width: '100%',
span: '', span: '',
@ -663,30 +515,30 @@ export const formProps: FormProps = {
showSearch: false, showSearch: false,
clearable: false, clearable: false,
disabled: false, disabled: false,
mode: 'multiple', mode: '',
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' },
{ key: 3, label: 'Option 3', value: 'Option 3' }, { key: 3, label: 'Option 3', value: 'Option 3' }
], ],
defaultSelect: null, defaultSelect: null,
datasourceType: 'dic', datasourceType: 'dic',
params: { itemId: '1419276800524423168' }, params: { itemId: '1978056598125330433' },
labelField: 'name', labelField: 'name',
valueField: 'value', valueField: 'value',
apiConfig: { apiConfig: {
path: 'CodeGeneration/selection', path: 'CodeGeneration/selection',
method: 'GET', method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7', apiId: '93d735dcb7364a0f8102188ec4d77ac7'
}, },
dicOptions: [], dicOptions: [],
required: false, required: true,
rules: [], rules: [],
events: {}, events: {},
isShow: true, isShow: true,
itemId: '1419276800524423168', itemId: '1978056598125330433',
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '38a1796c62434566ae6de94eb1b5f914', key: '38a1796c62434566ae6de94eb1b5f914',
@ -694,7 +546,7 @@ export const formProps: FormProps = {
label: '显示顺序', label: '显示顺序',
type: 'number', type: 'number',
component: 'InputNumber', component: 'InputNumber',
colProps: { span: 24 }, colProps: { span: 8 },
defaultValue: null, defaultValue: null,
componentProps: { componentProps: {
labelWidthMode: 'fix', labelWidthMode: 'fix',
@ -715,8 +567,8 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '7c3ac171d20642bcb8f5b079f118b775', key: '7c3ac171d20642bcb8f5b079f118b775',
@ -724,7 +576,7 @@ export const formProps: FormProps = {
label: '有效标志', label: '有效标志',
type: 'select', type: 'select',
component: 'XjrSelect', component: 'XjrSelect',
colProps: { span: 24 }, colProps: { span: 8 },
componentProps: { componentProps: {
width: '100%', width: '100%',
span: '', span: '',
@ -737,12 +589,12 @@ export const formProps: FormProps = {
showLabel: true, showLabel: true,
showSearch: false, showSearch: false,
clearable: false, clearable: false,
disabled: false, disabled: true,
mode: 'multiple', mode: '',
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' },
{ key: 3, label: 'Option 3', value: 'Option 3' }, { key: 3, label: 'Option 3', value: 'Option 3' }
], ],
defaultSelect: null, defaultSelect: null,
datasourceType: 'dic', datasourceType: 'dic',
@ -752,7 +604,7 @@ export const formProps: FormProps = {
apiConfig: { apiConfig: {
path: 'CodeGeneration/selection', path: 'CodeGeneration/selection',
method: 'GET', method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7', apiId: '93d735dcb7364a0f8102188ec4d77ac7'
}, },
dicOptions: [], dicOptions: [],
required: false, required: false,
@ -760,8 +612,8 @@ export const formProps: FormProps = {
events: {}, events: {},
isShow: true, isShow: true,
itemId: '1978057078528327681', itemId: '1978057078528327681',
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '972e6f34ee7d42899f19a9cae558544f', key: '972e6f34ee7d42899f19a9cae558544f',
@ -791,14 +643,14 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
style: { width: '100%' }, style: { width: '100%' }
}, }
}, }
], ],
showActionButtonGroup: false, showActionButtonGroup: false,
buttonLocation: 'center', buttonLocation: 'center',
actionColOptions: { span: 24 }, actionColOptions: { span: 24 },
showResetButton: false, showResetButton: false,
showSubmitButton: false, showSubmitButton: false,
hiddenComponent: [], hiddenComponent: []
}; };

View File

@ -1,7 +1,6 @@
<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-db-click="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)">
@ -24,25 +23,23 @@
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed, onMounted, onUnmounted, createVNode, import { ref, computed, onMounted, onUnmounted, createVNode } from 'vue';
} 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';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table'; import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getLngBStationLngPage, deleteLngBStationLng} from '/@/api/mdm/LNGStation'; import { getLngBStationLngPage, deleteLngBStationLng } from '/@/api/mdm/LNGStation';
import { PageWrapper } from '/@/components/Page'; import { PageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n'; import { useI18n } from '/@/hooks/web/useI18n';
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 { getLngBStationLng } from '/@/api/mdm/LNGStation'; import { getLngBStationLng } from '/@/api/mdm/LNGStation';
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import LngStationModal from './components/LngStationModal.vue'; import LngStationModal from './components/LngStationModal.vue';
import {formConfig, searchFormSchema, columns } from './components/config'; import { formConfig, searchFormSchema, columns } from './components/config';
import Icon from '/@/components/Icon/index'; import Icon from '/@/components/Icon/index';
import useEventBus from '/@/hooks/event/useEventBus'; import useEventBus from '/@/hooks/event/useEventBus';
import { cloneDeep } from 'lodash-es'; import { cloneDeep } from 'lodash-es';
@ -53,20 +50,29 @@
const { t } = useI18n(); const { t } = useI18n();
defineEmits(['register']); defineEmits(['register']);
const { filterColumnAuth, filterButtonAuth } = usePermission(); const { filterColumnAuth, filterButtonAuth } = usePermission();
const { mergeColumns,mergeSearchFormSchema,mergeButtons } = useFormConfig(); const { mergeColumns, mergeSearchFormSchema, mergeButtons } = useFormConfig();
const filterColumns = cloneDeep(filterColumnAuth(columns)); const filterColumns = cloneDeep(filterColumnAuth(columns));
const customConfigColums =ref(filterColumns); const customConfigColums = ref(filterColumns);
const customSearchFormSchema =ref(searchFormSchema); const customSearchFormSchema = ref(searchFormSchema);
const tableRef = ref(); 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":"enable","icon":"ant-design:form-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"作废","code":"disable","icon":"ant-design:stop-outlined","isDefault":true,"type":"dashed"},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true},{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true}]); const buttons = ref([
{ isUse: true, name: '新增', code: 'add', icon: 'ant-design:plus-outlined', isDefault: true, type: 'primary' },
{ isUse: true, name: '编辑', code: 'edit', icon: 'ant-design:form-outlined', isDefault: true },
{ isUse: true, name: '启用', code: 'enable', icon: 'ant-design:form-outlined', isDefault: true, type: 'primary' },
{ isUse: true, name: '作废', code: 'disable', icon: 'ant-design:stop-outlined', isDefault: true, type: 'dashed' },
{ isUse: true, name: '刷新', code: 'refresh', icon: 'ant-design:reload-outlined', isDefault: true },
{ isUse: true, name: '查看', code: 'view', icon: 'ant-design:eye-outlined', isDefault: true },
{ isUse: true, name: '数据日志', code: 'datalog', icon: 'ant-design:profile-outlined', isDefault: true },
{ isUse: true, name: '删除', code: 'delete', icon: 'ant-design:delete-outlined', isDefault: true }
]);
//展示在列表内的按钮 //展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit','datalog', '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));
@ -76,35 +82,34 @@
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,enable : handleEnable,disable : handleDisable,refresh : handleRefresh,view : handleView,datalog : handleDatalog,delete : handleDelete,} const btnEvent = { add: handleAdd, edit: handleEdit, enable: handleEnable, disable: handleDisable, 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='LNG气源地'; const formName = 'LNG气源地';
const [registerTable, { reload, }] = useTable({ const [registerTable, { reload }] = useTable({
title: '' || (formName + '列表'), title: '' || formName + '列表',
api: getLngBStationLngPage, api: getLngBStationLngPage,
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,
@ -114,17 +119,16 @@
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 || {};
@ -134,7 +138,7 @@
query: { query: {
taskId: taskIds[0], taskId: taskIds[0],
formName: formName, formName: formName,
formId:currentRoute.value.meta.formId formId: currentRoute.value.meta.formId
} }
}); });
} else if (schemaId && !taskIds && processId) { } else if (schemaId && !taskIds && processId) {
@ -144,7 +148,7 @@
readonly: 1, readonly: 1,
taskId: '', taskId: '',
formName: formName, formName: formName,
formId:currentRoute.value.meta.formId formId: currentRoute.value.meta.formId
} }
}); });
} else { } else {
@ -153,14 +157,13 @@
query: { query: {
formPath: 'mdm/LNGStation', formPath: 'mdm/LNGStation',
formName: formName, formName: formName,
formId:currentRoute.value.meta.formId formId: currentRoute.value.meta.formId
} }
}); });
} }
} }
function buttonClick(code) { function buttonClick(code) {
btnEvent[code](); btnEvent[code]();
} }
@ -175,20 +178,19 @@
query: { query: {
formPath: 'mdm/LNGStation', formPath: 'mdm/LNGStation',
formName: formName, formName: formName,
formId:currentRoute.value.meta.formId formId: currentRoute.value.meta.formId
} }
}); });
} }
} }
function handleEdit(record: Recordable) { function handleEdit(record: Recordable) {
router.push({ router.push({
path: '/form/LNGStation/' + record.id + '/updateForm', path: '/form/LNGStation/' + record.id + '/updateForm',
query: { query: {
formPath: 'mdm/LNGStation', formPath: 'mdm/LNGStation',
formName: formName, formName: formName,
formId:currentRoute.value.meta.formId formId: currentRoute.value.meta.formId
} }
}); });
} }
@ -200,7 +202,7 @@
if (!selectedKeys.value.length) { if (!selectedKeys.value.length) {
notification.warning({ notification.warning({
message: 'Tip', message: 'Tip',
description: t('请选择需要启用的数据'), description: t('请选择需要启用的数据')
}); });
return; return;
} }
@ -217,19 +219,18 @@
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: 'Tip',
description: t('启用成功!'), description: t('启用成功!')
}); });
}); });
}, },
onCancel() {}, onCancel() {}
}); });
} }
function handleDisable() { function handleDisable() {
if (!selectedKeys.value.length) { if (!selectedKeys.value.length) {
notification.warning({ notification.warning({
message: 'Tip', message: 'Tip',
description: t('请选择需要禁用的数据'), description: t('请选择需要禁用的数据')
}); });
return; return;
} }
@ -245,13 +246,14 @@
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: 'Tip',
description: t('禁用成功!'), description: t('禁用成功!')
}); });
}); });
}, },
onCancel() {}, onCancel() {}
}); });
} }
function handleDatalog() {}
function deleteList(ids) { function deleteList(ids) {
Modal.confirm({ Modal.confirm({
title: '提示信息', title: '提示信息',
@ -264,28 +266,24 @@
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);
@ -304,22 +302,21 @@
bus.off(FORM_LIST_MODIFIED, handleRefresh); bus.off(FORM_LIST_MODIFIED, handleRefresh);
} }
}); });
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 {};
@ -328,29 +325,29 @@
}); });
return actionsList; return actionsList;
} }
async function mergeCustomListRenderConfig(){ async function mergeCustomListRenderConfig() {
if (formConfig.useCustomConfig) { if (formConfig.useCustomConfig) {
let formId=currentRoute.value.meta.formId; let formId = currentRoute.value.meta.formId;
//1.合并展示字段配置 //1.合并展示字段配置
let cols= await mergeColumns(customConfigColums.value,formId); let cols = await mergeColumns(customConfigColums.value, formId);
customConfigColums.value=cols; customConfigColums.value = cols;
//2.合并搜索字段配置 //2.合并搜索字段配置
let sFormSchema= await mergeSearchFormSchema(customSearchFormSchema.value,formId); let sFormSchema = await mergeSearchFormSchema(customSearchFormSchema.value, formId);
customSearchFormSchema.value=sFormSchema; customSearchFormSchema.value = sFormSchema;
//3.合并按钮配置 //3.合并按钮配置
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) {
width: 50px; width: 50px;
} }
.show{ .show {
display: flex; display: flex;
} }
.hide{ .hide {
display: none !important; display: none !important;
} }
</style> </style>

View File

@ -1,14 +1,9 @@
<template> <template>
<SimpleForm <SimpleForm ref="systemFormRef" :formProps="data.formDataProps" :formModel="{}" :isWorkFlow="props.fromPage != FromPageType.MENU" />
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';
import { formProps, formEventConfigs ,formConfig} from './config'; import { formProps, formEventConfigs, formConfig } from './config';
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue'; import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
import { addLngBPort, getLngBPort, updateLngBPort, deleteLngBPort } from '/@/api/mdm/Port'; import { addLngBPort, getLngBPort, updateLngBPort, deleteLngBPort } from '/@/api/mdm/Port';
import { cloneDeep } from 'lodash-es'; import { cloneDeep } from 'lodash-es';
@ -16,46 +11,50 @@
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';
import { getTreeData } from '/@/api/mdm/CountryRegion';
const { filterFormSchemaAuth } = usePermission(); const { filterFormSchemaAuth } = usePermission();
const { mergeFormSchemas,mergeFormEventConfigs } = useFormConfig(); const { mergeFormSchemas, mergeFormEventConfigs } = useFormConfig();
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
const RowKey = 'id'; const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'form-mounted']); const emits = defineEmits(['changeUploadComponentIds', 'loadingCompleted', 'form-mounted']);
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 = [];
onMounted(async () => { onMounted(async () => {
try { try {
const treeData = await getTreeData({});
formProps.schemas?.forEach((v) => {
if (v.field == 'regionCode') {
v.componentProps.options = treeData;
}
});
// 合并渲染覆盖配置中的字段配置、表单事件配置 // 合并渲染覆盖配置中的字段配置、表单事件配置
await mergeCustomFormRenderConfig(); await mergeCustomFormRenderConfig();
if (props.fromPage == FromPageType.MENU) { if (props.fromPage == FromPageType.MENU) {
setMenuPermission(); setMenuPermission();
await createFormEvent(customFormEventConfigs, state.formModel, await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单
systemFormRef.value, await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单
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方法
@ -64,34 +63,27 @@
} else if (props.fromPage == FromPageType.DESKTOP) { } else if (props.fromPage == FromPageType.DESKTOP) {
// 桌面设计 表单事件需要执行 // 桌面设计 表单事件需要执行
emits('loadingCompleted'); //告诉系统表单已经加载完毕 emits('loadingCompleted'); //告诉系统表单已经加载完毕
await createFormEvent(customFormEventConfigs, state.formModel, await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单
systemFormRef.value, await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单
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);
if (formConfig.useCustomConfig) { if (formConfig.useCustomConfig) {
if(props.fromPage !== FromPageType.FLOW){ if (props.fromPage !== FromPageType.FLOW) {
let formPath=currentRoute.value.query.formPath; let formPath = currentRoute.value.query.formPath;
//1.合并字段配置 //1.合并字段配置
cloneProps.schemas=await mergeFormSchemas({formSchema:cloneProps.schemas!,formPath:formPath}); cloneProps.schemas = await mergeFormSchemas({ formSchema: cloneProps.schemas!, formPath: formPath });
//2.合并表单事件配置 //2.合并表单事件配置
fEventConfigs=await mergeFormEventConfigs({formEventConfigs:fEventConfigs,formPath:formPath}); fEventConfigs = await mergeFormEventConfigs({ formEventConfigs: fEventConfigs, formPath: formPath });
} }
} }
data.formDataProps=cloneProps; data.formDataProps = cloneProps;
customFormEventConfigs=fEventConfigs; customFormEventConfigs = fEventConfigs;
} }
// 根据菜单页面权限,设置表单属性(必填,禁用,显示) // 根据菜单页面权限,设置表单属性(必填,禁用,显示)
@ -125,9 +117,7 @@
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) {
@ -139,7 +129,7 @@
} }
// 设置表单数据全部为Disabled 【查看】 // 设置表单数据全部为Disabled 【查看】
async function setDisabledForm(isDisabled) { async function setDisabledForm(isDisabled) {
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas),isDisabled); data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas), isDisabled);
} }
// 获取行键值 // 获取行键值
function getRowKey() { function getRowKey() {
@ -151,9 +141,7 @@
values[RowKey] = rowId; values[RowKey] = rowId;
state.formModel = values; state.formModel = values;
let saveVal = await updateLngBPort(values); let saveVal = await updateLngBPort(values);
await submitFormEvent(customFormEventConfigs, state.formModel, await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
systemFormRef.value,
formProps.schemas); //表单事件:提交表单
return saveVal; return saveVal;
} catch (error) {} } catch (error) {}
} }
@ -162,22 +150,20 @@
try { try {
state.formModel = values; state.formModel = values;
let saveVal = await addLngBPort(values); let saveVal = await addLngBPort(values);
await submitFormEvent(customFormEventConfigs, state.formModel, await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
systemFormRef.value,
formProps.schemas); //表单事件:提交表单
return saveVal; return saveVal;
} catch (error) {} } catch (error) {}
} }
// 根据工作流页面权限,设置表单属性(必填,禁用,显示) // 根据工作流页面权限,设置表单属性(必填,禁用,显示)
async function setWorkFlowForm(obj: WorkFlowFormParams) { async function setWorkFlowForm(obj: WorkFlowFormParams) {
try { try {
const cloneProps=cloneDeep(formProps); const cloneProps = cloneDeep(formProps);
customFormEventConfigs=cloneDeep(formEventConfigs); customFormEventConfigs = cloneDeep(formEventConfigs);
if (formConfig.useCustomConfig) { if (formConfig.useCustomConfig) {
const parts = obj.formConfigKey.split('_'); const parts = obj.formConfigKey.split('_');
const formId=parts[1]; const formId = parts[1];
cloneProps.schemas=await mergeFormSchemas({formSchema:cloneProps.schemas!,formId:formId}); cloneProps.schemas = await mergeFormSchemas({ formSchema: cloneProps.schemas!, formId: formId });
customFormEventConfigs=await mergeFormEventConfigs({formEventConfigs:customFormEventConfigs,formId:formId}); customFormEventConfigs = await mergeFormEventConfigs({ formEventConfigs: customFormEventConfigs, formId: formId });
} }
let flowData = changeWorkFlowForm(cloneProps, obj); let flowData = changeWorkFlowForm(cloneProps, obj);
@ -188,21 +174,17 @@
setDisabledForm(); //查看 setDisabledForm(); //查看
} }
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, await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单
systemFormRef.value, await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单
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 deleteLngBPort([id]); return await deleteLngBPort([id]);

View File

@ -1,9 +1,7 @@
<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';
@ -23,7 +21,7 @@
isUpdate: true, isUpdate: true,
isView: false, isView: false,
isCopy: false, isCopy: false,
rowId: '', rowId: ''
}); });
const { t } = useI18n(); const { t } = useI18n();
@ -38,7 +36,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;
@ -87,12 +85,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

@ -2,14 +2,14 @@ import { FormProps, FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table'; import { BasicColumn } from '/@/components/Table';
export const formConfig = { export const formConfig = {
useCustomConfig: false, useCustomConfig: false
}; };
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{ {
field: 'fullName', field: 'fullName',
label: '名称', label: '名称',
component: 'Input', component: 'Input'
}, },
{ {
field: 'valid', field: 'valid',
@ -21,92 +21,9 @@ export const searchFormSchema: FormSchema[] = [
labelField: 'name', labelField: 'name',
valueField: 'value', valueField: 'value',
getPopupContainer: () => document.body, getPopupContainer: () => document.body
}, }
}, }
{
field: 'code',
label: '编码',
component: 'Input',
},
{
field: 'shortName',
label: '简称',
component: 'Input',
},
{
field: 'regionCode',
label: '所属国家和地区',
component: 'ApiCascader',
componentProps: {
apiConfig: {
path: 'CodeGeneration/cascade',
method: 'GET',
apiId: '0772d128d20f4f80aaafc784adba338a',
},
showFormat: 'all',
separator: '/',
selectedConfig: 'any',
},
},
{
field: 'capacity',
label: '吞吐量',
component: 'InputNumber',
componentProps: {
style: { width: '100%' },
},
},
{
field: 'longitude',
label: '连线经度',
component: 'InputNumber',
componentProps: {
style: { width: '100%' },
},
},
{
field: 'latitude',
label: '连线纬度',
component: 'InputNumber',
componentProps: {
style: { width: '100%' },
},
},
{
field: 'limit1',
label: '限制1',
component: 'Input',
},
{
field: 'limit2',
label: '限制2',
component: 'Input',
},
{
field: 'limit3',
label: '限制3',
component: 'Input',
},
{
field: 'limit4',
label: '限制4',
component: 'Input',
},
{
field: 'sort',
label: '显示顺序',
component: 'InputNumber',
componentProps: {
style: { width: '100%' },
},
},
{
field: 'note',
label: '备注',
component: 'Input',
},
]; ];
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
@ -116,7 +33,7 @@ export const columns: BasicColumn[] = [
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -125,7 +42,7 @@ export const columns: BasicColumn[] = [
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -134,7 +51,7 @@ export const columns: BasicColumn[] = [
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -143,79 +60,7 @@ export const columns: BasicColumn[] = [
componentType: 'cascader', componentType: 'cascader',
align: 'left', align: 'left',
sorter: true, sorter: true
},
{
dataIndex: 'capacity',
title: '吞吐量',
componentType: 'number',
align: 'left',
sorter: true,
},
{
dataIndex: 'longitude',
title: '连线经度',
componentType: 'number',
align: 'left',
sorter: true,
},
{
dataIndex: 'latitude',
title: '连线纬度',
componentType: 'number',
align: 'left',
sorter: true,
},
{
dataIndex: 'limit1',
title: '限制1',
componentType: 'textarea',
align: 'left',
sorter: true,
},
{
dataIndex: 'limit2',
title: '限制2',
componentType: 'textarea',
align: 'left',
sorter: true,
},
{
dataIndex: 'limit3',
title: '限制3',
componentType: 'textarea',
align: 'left',
sorter: true,
},
{
dataIndex: 'limit4',
title: '限制4',
componentType: 'textarea',
align: 'left',
sorter: true,
},
{
dataIndex: 'sort',
title: '显示顺序',
componentType: 'number',
align: 'left',
sorter: true,
}, },
{ {
@ -224,7 +69,7 @@ export const columns: BasicColumn[] = [
componentType: 'select', componentType: 'select',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -233,8 +78,8 @@ export const columns: BasicColumn[] = [
componentType: 'textarea', componentType: 'textarea',
align: 'left', align: 'left',
sorter: true, sorter: true
}, }
]; ];
//表单事件 //表单事件
export const formEventConfigs = { export const formEventConfigs = {
@ -245,7 +90,7 @@ export const formEventConfigs = {
text: '开始节点', text: '开始节点',
icon: '#icon-kaishi', icon: '#icon-kaishi',
bgcColor: '#D8E5FF', bgcColor: '#D8E5FF',
isUserDefined: false, isUserDefined: false
}, },
{ {
color: '#F6AB01', color: '#F6AB01',
@ -253,8 +98,8 @@ export const formEventConfigs = {
text: '初始化表单', text: '初始化表单',
bgcColor: '#f9f5ea', bgcColor: '#f9f5ea',
isUserDefined: false, isUserDefined: false,
nodeInfo: { processEvent: [] }, nodeInfo: { processEvent: [] }
}, }
], ],
1: [ 1: [
{ {
@ -264,8 +109,8 @@ export const formEventConfigs = {
detail: '(新增无此操作)', detail: '(新增无此操作)',
bgcColor: '#F8F2FC', bgcColor: '#F8F2FC',
isUserDefined: false, isUserDefined: false,
nodeInfo: { processEvent: [] }, nodeInfo: { processEvent: [] }
}, }
], ],
2: [ 2: [
{ {
@ -274,8 +119,8 @@ export const formEventConfigs = {
text: '加载表单', text: '加载表单',
bgcColor: '#FFF1F1', bgcColor: '#FFF1F1',
isUserDefined: false, isUserDefined: false,
nodeInfo: { processEvent: [] }, nodeInfo: { processEvent: [] }
}, }
], ],
3: [ 3: [
{ {
@ -284,8 +129,8 @@ export const formEventConfigs = {
text: '提交表单', text: '提交表单',
bgcColor: '#F5F4FF', bgcColor: '#F5F4FF',
isUserDefined: false, isUserDefined: false,
nodeInfo: { processEvent: [] }, nodeInfo: { processEvent: [] }
}, }
], ],
4: [ 4: [
{ {
@ -295,9 +140,9 @@ export const formEventConfigs = {
icon: '#icon-jieshuzhiliao', icon: '#icon-jieshuzhiliao',
bgcColor: '#FFD6D6', bgcColor: '#FFD6D6',
isLast: true, isLast: true,
isUserDefined: false, isUserDefined: false
}, }
], ]
}; };
export const formProps: FormProps = { export const formProps: FormProps = {
labelCol: { span: 3, offset: 0 }, labelCol: { span: 3, offset: 0 },
@ -336,8 +181,8 @@ export const formProps: FormProps = {
isSave: false, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '1b3bf1efab214701a9588b4cfb9dfd5c', key: '1b3bf1efab214701a9588b4cfb9dfd5c',
@ -345,7 +190,7 @@ export const formProps: FormProps = {
label: '名称', label: '名称',
type: 'input', type: 'input',
component: 'Input', component: 'Input',
colProps: { span: 24 }, colProps: { span: 16 },
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
width: '100%', width: '100%',
@ -370,8 +215,8 @@ export const formProps: FormProps = {
isSave: false, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '0dcc7f43f9e34f1b87cc2f730417b3e0', key: '0dcc7f43f9e34f1b87cc2f730417b3e0',
@ -379,7 +224,7 @@ export const formProps: FormProps = {
label: '简称', label: '简称',
type: 'input', type: 'input',
component: 'Input', component: 'Input',
colProps: { span: 24 }, colProps: { span: 8 },
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
width: '100%', width: '100%',
@ -404,41 +249,42 @@ export const formProps: FormProps = {
isSave: false, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '6020d6d0bab849089148eba1d194931a',
field: 'regionCode', field: 'regionCode',
label: '所属国家和地区', label: '所属国家和地区',
type: 'cascader', type: 'cascader',
component: 'ApiCascader', component: 'Cascader',
colProps: { span: 24 }, colProps: { span: 16 },
componentProps: { componentProps: {
options: [],
fieldNames: { label: 'fullName', value: 'code', children: 'children' },
width: '100%',
span: '',
defaultValue: '',
labelWidthMode: 'fix', labelWidthMode: 'fix',
labelFixWidth: 120, labelFixWidth: 120,
responsive: false, responsive: false,
respNewRow: false, respNewRow: false,
width: '100%', placeholder: '请选择',
span: '', maxlength: null,
placeholder: '请选择所属国家和地区', prefix: '',
showFormat: 'all', suffix: '',
separator: '/', addonBefore: '',
selectedConfig: 'selectMostChildLevel', addonAfter: '',
disabled: false, disabled: false,
allowClear: false, allowClear: false,
showLabel: true, showLabel: true,
apiConfig: {
path: 'CodeGeneration/cascade',
method: 'GET',
apiId: '0772d128d20f4f80aaafc784adba338a',
},
required: false, required: false,
rules: [], rules: [],
events: {}, events: {},
isSave: false,
isShow: true, isShow: true,
style: { width: '100%' }, scan: false,
}, style: { width: '100%' }
}
}, },
{ {
key: 'cd46b163fa8345809ab5d579d96f40f2', key: 'cd46b163fa8345809ab5d579d96f40f2',
@ -446,7 +292,7 @@ export const formProps: FormProps = {
label: '吞吐量', label: '吞吐量',
type: 'number', type: 'number',
component: 'InputNumber', component: 'InputNumber',
colProps: { span: 24 }, colProps: { span: 8 },
defaultValue: null, defaultValue: null,
componentProps: { componentProps: {
labelWidthMode: 'fix', labelWidthMode: 'fix',
@ -454,10 +300,31 @@ export const formProps: FormProps = {
responsive: false, responsive: false,
width: '100%', width: '100%',
span: '', span: '',
defaultValue: null, defaultValue: 0.0,
formatter(value: number) {
if (!value) return '';
console.log(value);
// 3. 保留4位小数toFixed会自动四舍五入
const fixedNum = parseFloat(value).toFixed(4); // 结果为字符串,如 "12345.6700"、"-1234.5679"
// 4. 分割整数部分和小数部分
const [integerPart, decimalPart] = fixedNum.split('.');
// 5. 处理整数部分:添加千分位分隔符
// 正则解释:\B 匹配非单词边界,(?=(\d{3})+(?!\d)) 正向预查每3位数字
const formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
// 6. 拼接整数、小数部分,返回结果
return `${formattedInteger}.${decimalPart}`;
// return value.toLocaleString('zh-CN', {
// minimumFractionDigits: 4,
// maximumFractionDigits: 4
// });
},
min: null, min: null,
max: null, max: null,
step: 0.01, step: 0.0001,
maxlength: '', maxlength: '',
disabled: false, disabled: false,
showLabel: true, showLabel: true,
@ -467,8 +334,8 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '16e52805d5334759be1d2f40d517efa6', key: '16e52805d5334759be1d2f40d517efa6',
@ -476,13 +343,14 @@ export const formProps: FormProps = {
label: '连线经度', label: '连线经度',
type: 'number', type: 'number',
component: 'InputNumber', component: 'InputNumber',
colProps: { span: 24 }, colProps: { span: 8 },
defaultValue: null, defaultValue: null,
componentProps: { componentProps: {
labelWidthMode: 'fix', labelWidthMode: 'fix',
labelFixWidth: 120, labelFixWidth: 120,
responsive: false, responsive: false,
width: '100%', width: '100%',
precision: '2',
span: '', span: '',
defaultValue: null, defaultValue: null,
min: null, min: null,
@ -497,8 +365,8 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '6b1a921de60d4676be79074cefe0327a', key: '6b1a921de60d4676be79074cefe0327a',
@ -506,12 +374,14 @@ export const formProps: FormProps = {
label: '连线纬度', label: '连线纬度',
type: 'number', type: 'number',
component: 'InputNumber', component: 'InputNumber',
colProps: { span: 24 }, colProps: { span: 8 },
defaultValue: null, defaultValue: null,
componentProps: { componentProps: {
labelWidthMode: 'fix', labelWidthMode: 'fix',
labelFixWidth: 120, labelFixWidth: 120,
responsive: false, responsive: false,
precision: '2',
width: '100%', width: '100%',
span: '', span: '',
defaultValue: null, defaultValue: null,
@ -527,8 +397,8 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '68e573db83d941efb9a5687f84726b6b', key: '68e573db83d941efb9a5687f84726b6b',
@ -558,8 +428,8 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '34c007fd1d9544ecb3a5ecea5d7f7b1b', key: '34c007fd1d9544ecb3a5ecea5d7f7b1b',
@ -589,8 +459,8 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '9099e3d919a64dfe860719c34fcaf37d', key: '9099e3d919a64dfe860719c34fcaf37d',
@ -620,8 +490,8 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '16fbe387e5c6471b9be06524f4766f10', key: '16fbe387e5c6471b9be06524f4766f10',
@ -651,8 +521,8 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: 'ef6536972cc54e21b09b4f5637730d0b', key: 'ef6536972cc54e21b09b4f5637730d0b',
@ -660,7 +530,7 @@ export const formProps: FormProps = {
label: '显示顺序', label: '显示顺序',
type: 'number', type: 'number',
component: 'InputNumber', component: 'InputNumber',
colProps: { span: 24 }, colProps: { span: 8 },
defaultValue: null, defaultValue: null,
componentProps: { componentProps: {
labelWidthMode: 'fix', labelWidthMode: 'fix',
@ -681,8 +551,8 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '03f1a079e8544b77a793460306207f41', key: '03f1a079e8544b77a793460306207f41',
@ -690,7 +560,7 @@ export const formProps: FormProps = {
label: '有效标志', label: '有效标志',
type: 'select', type: 'select',
component: 'XjrSelect', component: 'XjrSelect',
colProps: { span: 24 }, colProps: { span: 8 },
componentProps: { componentProps: {
width: '100%', width: '100%',
span: '', span: '',
@ -708,7 +578,7 @@ export const formProps: FormProps = {
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' },
{ key: 3, label: 'Option 3', value: 'Option 3' }, { key: 3, label: 'Option 3', value: 'Option 3' }
], ],
defaultSelect: null, defaultSelect: null,
datasourceType: 'dic', datasourceType: 'dic',
@ -718,7 +588,7 @@ export const formProps: FormProps = {
apiConfig: { apiConfig: {
path: 'CodeGeneration/selection', path: 'CodeGeneration/selection',
method: 'GET', method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7', apiId: '93d735dcb7364a0f8102188ec4d77ac7'
}, },
dicOptions: [], dicOptions: [],
required: false, required: false,
@ -726,8 +596,8 @@ export const formProps: FormProps = {
events: {}, events: {},
isShow: true, isShow: true,
itemId: '1978057078528327681', itemId: '1978057078528327681',
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: 'e15f5901160a49e9969fdd7d61e00053', key: 'e15f5901160a49e9969fdd7d61e00053',
@ -757,14 +627,14 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
style: { width: '100%' }, style: { width: '100%' }
}, }
}, }
], ],
showActionButtonGroup: false, showActionButtonGroup: false,
buttonLocation: 'center', buttonLocation: 'center',
actionColOptions: { span: 24 }, actionColOptions: { span: 24 },
showResetButton: false, showResetButton: false,
showSubmitButton: false, showSubmitButton: false,
hiddenComponent: [], hiddenComponent: []
}; };

View File

@ -1,7 +1,6 @@
<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-db-click="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)">
@ -24,25 +23,23 @@
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed, onMounted, onUnmounted, createVNode, import { ref, computed, onMounted, onUnmounted, createVNode } from 'vue';
} 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';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table'; import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getLngBPortPage, deleteLngBPort} from '/@/api/mdm/Port'; import { getLngBPortPage, deleteLngBPort } from '/@/api/mdm/Port';
import { PageWrapper } from '/@/components/Page'; import { PageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n'; import { useI18n } from '/@/hooks/web/useI18n';
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 { getLngBPort } from '/@/api/mdm/Port'; import { getLngBPort } from '/@/api/mdm/Port';
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import PortModal from './components/PortModal.vue'; import PortModal from './components/PortModal.vue';
import {formConfig, searchFormSchema, columns } from './components/config'; import { formConfig, searchFormSchema, columns } from './components/config';
import Icon from '/@/components/Icon/index'; import Icon from '/@/components/Icon/index';
import useEventBus from '/@/hooks/event/useEventBus'; import useEventBus from '/@/hooks/event/useEventBus';
import { cloneDeep } from 'lodash-es'; import { cloneDeep } from 'lodash-es';
@ -53,20 +50,29 @@
const { t } = useI18n(); const { t } = useI18n();
defineEmits(['register']); defineEmits(['register']);
const { filterColumnAuth, filterButtonAuth } = usePermission(); const { filterColumnAuth, filterButtonAuth } = usePermission();
const { mergeColumns,mergeSearchFormSchema,mergeButtons } = useFormConfig(); const { mergeColumns, mergeSearchFormSchema, mergeButtons } = useFormConfig();
const filterColumns = cloneDeep(filterColumnAuth(columns)); const filterColumns = cloneDeep(filterColumnAuth(columns));
const customConfigColums =ref(filterColumns); const customConfigColums = ref(filterColumns);
const customSearchFormSchema =ref(searchFormSchema); const customSearchFormSchema = ref(searchFormSchema);
const tableRef = ref(); 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":"enable","icon":"ant-design:form-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"作废","code":"disable","icon":"ant-design:stop-outlined","isDefault":true,"type":"dashed"},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true},{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true}]); const buttons = ref([
{ isUse: true, name: '新增', code: 'add', icon: 'ant-design:plus-outlined', isDefault: true, type: 'primary' },
{ isUse: true, name: '编辑', code: 'edit', icon: 'ant-design:form-outlined', isDefault: true },
{ isUse: true, name: '启用', code: 'enable', icon: 'ant-design:form-outlined', isDefault: true, type: 'primary' },
{ isUse: true, name: '作废', code: 'disable', icon: 'ant-design:stop-outlined', isDefault: true, type: 'dashed' },
{ isUse: true, name: '刷新', code: 'refresh', icon: 'ant-design:reload-outlined', isDefault: true },
{ isUse: true, name: '查看', code: 'view', icon: 'ant-design:eye-outlined', isDefault: true },
{ isUse: true, name: '数据日志', code: 'datalog', icon: 'ant-design:profile-outlined', isDefault: true },
{ isUse: true, name: '删除', code: 'delete', icon: 'ant-design:delete-outlined', isDefault: true }
]);
//展示在列表内的按钮 //展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit','datalog', '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));
@ -76,35 +82,34 @@
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,enable : handleEnable,disable : handleDisable,refresh : handleRefresh,view : handleView,datalog : handleDatalog,delete : handleDelete,} const btnEvent = { add: handleAdd, edit: handleEdit, enable: handleEnable, disable: handleDisable, 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: getLngBPortPage, api: getLngBPortPage,
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,
@ -114,17 +119,16 @@
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 || {};
@ -134,7 +138,7 @@
query: { query: {
taskId: taskIds[0], taskId: taskIds[0],
formName: formName, formName: formName,
formId:currentRoute.value.meta.formId formId: currentRoute.value.meta.formId
} }
}); });
} else if (schemaId && !taskIds && processId) { } else if (schemaId && !taskIds && processId) {
@ -144,7 +148,7 @@
readonly: 1, readonly: 1,
taskId: '', taskId: '',
formName: formName, formName: formName,
formId:currentRoute.value.meta.formId formId: currentRoute.value.meta.formId
} }
}); });
} else { } else {
@ -153,14 +157,13 @@
query: { query: {
formPath: 'mdm/Port', formPath: 'mdm/Port',
formName: formName, formName: formName,
formId:currentRoute.value.meta.formId formId: currentRoute.value.meta.formId
} }
}); });
} }
} }
function buttonClick(code) { function buttonClick(code) {
btnEvent[code](); btnEvent[code]();
} }
@ -175,20 +178,19 @@
query: { query: {
formPath: 'mdm/Port', formPath: 'mdm/Port',
formName: formName, formName: formName,
formId:currentRoute.value.meta.formId formId: currentRoute.value.meta.formId
} }
}); });
} }
} }
function handleEdit(record: Recordable) { function handleEdit(record: Recordable) {
router.push({ router.push({
path: '/form/Port/' + record.id + '/updateForm', path: '/form/Port/' + record.id + '/updateForm',
query: { query: {
formPath: 'mdm/Port', formPath: 'mdm/Port',
formName: formName, formName: formName,
formId:currentRoute.value.meta.formId formId: currentRoute.value.meta.formId
} }
}); });
} }
@ -200,7 +202,7 @@
if (!selectedKeys.value.length) { if (!selectedKeys.value.length) {
notification.warning({ notification.warning({
message: 'Tip', message: 'Tip',
description: t('请选择需要启用的数据'), description: t('请选择需要启用的数据')
}); });
return; return;
} }
@ -217,19 +219,18 @@
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: 'Tip',
description: t('启用成功!'), description: t('启用成功!')
}); });
}); });
}, },
onCancel() {}, onCancel() {}
}); });
} }
function handleDisable() { function handleDisable() {
if (!selectedKeys.value.length) { if (!selectedKeys.value.length) {
notification.warning({ notification.warning({
message: 'Tip', message: 'Tip',
description: t('请选择需要禁用的数据'), description: t('请选择需要禁用的数据')
}); });
return; return;
} }
@ -245,11 +246,11 @@
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: 'Tip',
description: t('禁用成功!'), description: t('禁用成功!')
}); });
}); });
}, },
onCancel() {}, onCancel() {}
}); });
} }
function deleteList(ids) { function deleteList(ids) {
@ -264,28 +265,25 @@
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 handleDatalog() {}
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);
@ -304,22 +302,21 @@
bus.off(FORM_LIST_MODIFIED, handleRefresh); bus.off(FORM_LIST_MODIFIED, handleRefresh);
} }
}); });
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 {};
@ -328,29 +325,29 @@
}); });
return actionsList; return actionsList;
} }
async function mergeCustomListRenderConfig(){ async function mergeCustomListRenderConfig() {
if (formConfig.useCustomConfig) { if (formConfig.useCustomConfig) {
let formId=currentRoute.value.meta.formId; let formId = currentRoute.value.meta.formId;
//1.合并展示字段配置 //1.合并展示字段配置
let cols= await mergeColumns(customConfigColums.value,formId); let cols = await mergeColumns(customConfigColums.value, formId);
customConfigColums.value=cols; customConfigColums.value = cols;
//2.合并搜索字段配置 //2.合并搜索字段配置
let sFormSchema= await mergeSearchFormSchema(customSearchFormSchema.value,formId); let sFormSchema = await mergeSearchFormSchema(customSearchFormSchema.value, formId);
customSearchFormSchema.value=sFormSchema; customSearchFormSchema.value = sFormSchema;
//3.合并按钮配置 //3.合并按钮配置
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) {
width: 50px; width: 50px;
} }
.show{ .show {
display: flex; display: flex;
} }
.hide{ .hide {
display: none !important; display: none !important;
} }
</style> </style>