港口、LNG气源地调试
This commit is contained in:
@ -3,17 +3,15 @@ import { defHttp } from '/@/utils/http/axios';
|
||||
import { ErrorMessageMode } from '/#/axios';
|
||||
|
||||
enum Api {
|
||||
Page = '/mdm/lngStation/page',
|
||||
List = '/mdm/lngStation/list',
|
||||
Info = '/mdm/lngStation/info',
|
||||
LngBStationLng = '/mdm/lngStation',
|
||||
Page = '/mdm/lNGStation/page',
|
||||
List = '/mdm/lNGStation/list',
|
||||
Info = '/mdm/lNGStation/info',
|
||||
LngBStationLng = '/mdm/lNGStation',
|
||||
|
||||
Enable = '/mdm/lNGStation/enable',
|
||||
Disable = '/mdm/lNGStation/disable',
|
||||
|
||||
|
||||
Enable = '/mdm/lngStation/enable',
|
||||
Disable= '/mdm/lngStation/disable',
|
||||
|
||||
DataLog = '/mdm/lngStation/datalog',
|
||||
DataLog = '/mdm/lNGStation/datalog'
|
||||
}
|
||||
|
||||
/**
|
||||
@ -23,11 +21,11 @@ export async function getLngBStationLngPage(params: LngBStationLngPageParams, mo
|
||||
return defHttp.get<LngBStationLngPageResult>(
|
||||
{
|
||||
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>(
|
||||
{
|
||||
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>(
|
||||
{
|
||||
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>(
|
||||
{
|
||||
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>(
|
||||
{
|
||||
url: Api.LngBStationLng,
|
||||
data: ids,
|
||||
data: ids
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
errorMessageMode: mode
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description: 启用数据LngBStationLng
|
||||
*/
|
||||
@ -99,11 +96,11 @@ export async function enableLngBStationLng(ids: string[], mode: ErrorMessageMode
|
||||
return defHttp.post<boolean>(
|
||||
{
|
||||
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>(
|
||||
{
|
||||
url: Api.Disable,
|
||||
data: ids,
|
||||
data: ids
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
errorMessageMode: mode
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* @description: 获取数据日志LngBStationLng
|
||||
*/
|
||||
export async function getDataLogLngBStationLng(id: string, mode: ErrorMessageMode = 'modal') {
|
||||
export async function getDataLogLngBStationLng(id: string, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.post<boolean>(
|
||||
{
|
||||
url: Api.Datalog,
|
||||
data: id,
|
||||
data: id
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
errorMessageMode: mode
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@ -2,14 +2,14 @@ import { FormProps, FormSchema } from '/@/components/Form';
|
||||
import { BasicColumn } from '/@/components/Table';
|
||||
|
||||
export const formConfig = {
|
||||
useCustomConfig: false,
|
||||
useCustomConfig: false
|
||||
};
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'fullName',
|
||||
label: '名称',
|
||||
component: 'Input',
|
||||
component: 'Input'
|
||||
},
|
||||
{
|
||||
field: 'valid',
|
||||
@ -21,13 +21,13 @@ export const searchFormSchema: FormSchema[] = [
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
getPopupContainer: () => document.body
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'code',
|
||||
label: '编码',
|
||||
component: 'Input',
|
||||
component: 'Input'
|
||||
},
|
||||
{
|
||||
field: 'unitCode',
|
||||
@ -39,27 +39,27 @@ export const searchFormSchema: FormSchema[] = [
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
getPopupContainer: () => document.body
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'coefficient',
|
||||
label: '车/数量单位',
|
||||
component: 'Input',
|
||||
component: 'Input'
|
||||
},
|
||||
{
|
||||
field: 'sort',
|
||||
label: '显示顺序',
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'note',
|
||||
label: '备注',
|
||||
component: 'Input',
|
||||
},
|
||||
component: 'Input'
|
||||
}
|
||||
];
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
@ -69,7 +69,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -78,7 +78,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -87,7 +87,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'select',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -96,7 +96,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -105,7 +105,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'number',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -114,7 +114,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'select',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -123,8 +123,8 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'textarea',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
sorter: true
|
||||
}
|
||||
];
|
||||
//表单事件
|
||||
export const formEventConfigs = {
|
||||
@ -135,7 +135,7 @@ export const formEventConfigs = {
|
||||
text: '开始节点',
|
||||
icon: '#icon-kaishi',
|
||||
bgcColor: '#D8E5FF',
|
||||
isUserDefined: false,
|
||||
isUserDefined: false
|
||||
},
|
||||
{
|
||||
color: '#F6AB01',
|
||||
@ -143,8 +143,8 @@ export const formEventConfigs = {
|
||||
text: '初始化表单',
|
||||
bgcColor: '#f9f5ea',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
nodeInfo: { processEvent: [] }
|
||||
}
|
||||
],
|
||||
1: [
|
||||
{
|
||||
@ -154,8 +154,8 @@ export const formEventConfigs = {
|
||||
detail: '(新增无此操作)',
|
||||
bgcColor: '#F8F2FC',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
nodeInfo: { processEvent: [] }
|
||||
}
|
||||
],
|
||||
2: [
|
||||
{
|
||||
@ -164,8 +164,8 @@ export const formEventConfigs = {
|
||||
text: '加载表单',
|
||||
bgcColor: '#FFF1F1',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
nodeInfo: { processEvent: [] }
|
||||
}
|
||||
],
|
||||
3: [
|
||||
{
|
||||
@ -174,8 +174,8 @@ export const formEventConfigs = {
|
||||
text: '提交表单',
|
||||
bgcColor: '#F5F4FF',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
nodeInfo: { processEvent: [] }
|
||||
}
|
||||
],
|
||||
4: [
|
||||
{
|
||||
@ -185,9 +185,9 @@ export const formEventConfigs = {
|
||||
icon: '#icon-jieshuzhiliao',
|
||||
bgcColor: '#FFD6D6',
|
||||
isLast: true,
|
||||
isUserDefined: false,
|
||||
},
|
||||
],
|
||||
isUserDefined: false
|
||||
}
|
||||
]
|
||||
};
|
||||
export const formProps: FormProps = {
|
||||
labelCol: { span: 3, offset: 0 },
|
||||
@ -226,8 +226,8 @@ export const formProps: FormProps = {
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'bf017ce23394455689757955a23d7b72',
|
||||
@ -260,8 +260,8 @@ export const formProps: FormProps = {
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '533dcfe1e679462e830091588c1cb9fd',
|
||||
@ -287,7 +287,7 @@ export const formProps: FormProps = {
|
||||
staticOptions: [
|
||||
{ key: 1, label: 'Option 1', value: 'Option 1' },
|
||||
{ key: 2, label: 'Option 2', value: 'Option 2' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' }
|
||||
],
|
||||
defaultSelect: null,
|
||||
datasourceType: 'dic',
|
||||
@ -297,7 +297,7 @@ export const formProps: FormProps = {
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7'
|
||||
},
|
||||
dicOptions: [],
|
||||
required: true,
|
||||
@ -305,8 +305,8 @@ export const formProps: FormProps = {
|
||||
events: {},
|
||||
isShow: true,
|
||||
itemId: '1980562721538633730',
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '57d85cbf34fa475298997f5a7427bf8d',
|
||||
@ -339,8 +339,8 @@ export const formProps: FormProps = {
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '870650303cf54491b476233e6d5d9b6b',
|
||||
@ -369,8 +369,8 @@ export const formProps: FormProps = {
|
||||
isShow: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '17bbaf11ddb0454d854f2082abd7b191',
|
||||
@ -396,7 +396,7 @@ export const formProps: FormProps = {
|
||||
staticOptions: [
|
||||
{ key: 1, label: 'Option 1', value: 'Option 1' },
|
||||
{ key: 2, label: 'Option 2', value: 'Option 2' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' }
|
||||
],
|
||||
defaultSelect: null,
|
||||
datasourceType: 'dic',
|
||||
@ -406,7 +406,7 @@ export const formProps: FormProps = {
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7'
|
||||
},
|
||||
dicOptions: [],
|
||||
required: false,
|
||||
@ -414,8 +414,8 @@ export const formProps: FormProps = {
|
||||
events: {},
|
||||
isShow: true,
|
||||
itemId: '1978057078528327681',
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '7e8014fe939e4ca88ebe986dd91c555c',
|
||||
@ -445,14 +445,14 @@ export const formProps: FormProps = {
|
||||
isShow: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
}
|
||||
],
|
||||
showActionButtonGroup: false,
|
||||
buttonLocation: 'center',
|
||||
actionColOptions: { span: 24 },
|
||||
showResetButton: false,
|
||||
showSubmitButton: false,
|
||||
hiddenComponent: [],
|
||||
hiddenComponent: []
|
||||
};
|
||||
@ -1,9 +1,7 @@
|
||||
<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';
|
||||
@ -23,7 +21,7 @@
|
||||
isUpdate: true,
|
||||
isView: false,
|
||||
isCopy: false,
|
||||
rowId: '',
|
||||
rowId: ''
|
||||
});
|
||||
|
||||
const { t } = useI18n();
|
||||
@ -38,7 +36,7 @@
|
||||
showCancelBtn: !state.isView,
|
||||
showOkBtn: !state.isView,
|
||||
canFullscreen: true,
|
||||
width: 900,
|
||||
width: 900
|
||||
});
|
||||
if (state.isUpdate || state.isView || state.isCopy) {
|
||||
state.rowId = data.id;
|
||||
@ -87,12 +85,12 @@
|
||||
//false 新增
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('新增成功!'),
|
||||
description: t('新增成功!')
|
||||
}); //提示消息
|
||||
} else {
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('修改成功!'),
|
||||
description: t('修改成功!')
|
||||
}); //提示消息
|
||||
}
|
||||
closeModal();
|
||||
|
||||
@ -2,94 +2,14 @@ import { FormProps, FormSchema } from '/@/components/Form';
|
||||
import { BasicColumn } from '/@/components/Table';
|
||||
|
||||
export const formConfig = {
|
||||
useCustomConfig: false,
|
||||
useCustomConfig: false
|
||||
};
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'code',
|
||||
label: '编码',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'fullName',
|
||||
label: '名称',
|
||||
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%' },
|
||||
},
|
||||
component: 'Input'
|
||||
},
|
||||
{
|
||||
field: 'valid',
|
||||
@ -101,14 +21,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'note',
|
||||
label: '备注',
|
||||
component: 'Input',
|
||||
},
|
||||
getPopupContainer: () => document.body
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
@ -118,7 +33,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -127,7 +42,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -136,7 +51,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -145,7 +60,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -154,7 +69,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -163,7 +78,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -172,71 +87,8 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'select',
|
||||
align: 'left',
|
||||
|
||||
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,
|
||||
},
|
||||
sorter: true
|
||||
}
|
||||
];
|
||||
//表单事件
|
||||
export const formEventConfigs = {
|
||||
@ -247,7 +99,7 @@ export const formEventConfigs = {
|
||||
text: '开始节点',
|
||||
icon: '#icon-kaishi',
|
||||
bgcColor: '#D8E5FF',
|
||||
isUserDefined: false,
|
||||
isUserDefined: false
|
||||
},
|
||||
{
|
||||
color: '#F6AB01',
|
||||
@ -255,8 +107,8 @@ export const formEventConfigs = {
|
||||
text: '初始化表单',
|
||||
bgcColor: '#f9f5ea',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
nodeInfo: { processEvent: [] }
|
||||
}
|
||||
],
|
||||
1: [
|
||||
{
|
||||
@ -266,8 +118,8 @@ export const formEventConfigs = {
|
||||
detail: '(新增无此操作)',
|
||||
bgcColor: '#F8F2FC',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
nodeInfo: { processEvent: [] }
|
||||
}
|
||||
],
|
||||
2: [
|
||||
{
|
||||
@ -276,8 +128,8 @@ export const formEventConfigs = {
|
||||
text: '加载表单',
|
||||
bgcColor: '#FFF1F1',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
nodeInfo: { processEvent: [] }
|
||||
}
|
||||
],
|
||||
3: [
|
||||
{
|
||||
@ -286,8 +138,8 @@ export const formEventConfigs = {
|
||||
text: '提交表单',
|
||||
bgcColor: '#F5F4FF',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
nodeInfo: { processEvent: [] }
|
||||
}
|
||||
],
|
||||
4: [
|
||||
{
|
||||
@ -297,9 +149,9 @@ export const formEventConfigs = {
|
||||
icon: '#icon-jieshuzhiliao',
|
||||
bgcColor: '#FFD6D6',
|
||||
isLast: true,
|
||||
isUserDefined: false,
|
||||
},
|
||||
],
|
||||
isUserDefined: false
|
||||
}
|
||||
]
|
||||
};
|
||||
export const formProps: FormProps = {
|
||||
labelCol: { span: 3, offset: 0 },
|
||||
@ -338,8 +190,8 @@ export const formProps: FormProps = {
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'e23fcb9f62104eb284b553403a12ee12',
|
||||
@ -347,7 +199,7 @@ export const formProps: FormProps = {
|
||||
label: '名称',
|
||||
type: 'input',
|
||||
component: 'Input',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 8 },
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
@ -372,8 +224,8 @@ export const formProps: FormProps = {
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'd32af84b3fc8443cbef441fc6ce5fc0b',
|
||||
@ -381,7 +233,7 @@ export const formProps: FormProps = {
|
||||
label: '所属企业',
|
||||
type: 'input',
|
||||
component: 'Input',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 8 },
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
@ -406,8 +258,8 @@ export const formProps: FormProps = {
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '5adb1f7560b344d789102d4b0af05b64',
|
||||
@ -415,7 +267,7 @@ export const formProps: FormProps = {
|
||||
label: '联系人',
|
||||
type: 'input',
|
||||
component: 'Input',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 8 },
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
@ -440,8 +292,8 @@ export const formProps: FormProps = {
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'a5a825723d8f4789aaea9189a98f792c',
|
||||
@ -449,7 +301,7 @@ export const formProps: FormProps = {
|
||||
label: '电话',
|
||||
type: 'input',
|
||||
component: 'Input',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 8 },
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
@ -474,8 +326,8 @@ export const formProps: FormProps = {
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'cbdd54bdc1334671904b1c10e064571d',
|
||||
@ -483,7 +335,7 @@ export const formProps: FormProps = {
|
||||
label: '邮箱',
|
||||
type: 'input',
|
||||
component: 'Input',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 8 },
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
@ -508,8 +360,8 @@ export const formProps: FormProps = {
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '1485b829c80a493bb55f37d1c839ccc9',
|
||||
@ -517,7 +369,7 @@ export const formProps: FormProps = {
|
||||
label: '行政区域',
|
||||
type: 'area',
|
||||
component: 'Area',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 8 },
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
@ -533,8 +385,8 @@ export const formProps: FormProps = {
|
||||
rules: [],
|
||||
events: {},
|
||||
isShow: true,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'e98223a611784bee9a626acceb1745e8',
|
||||
@ -564,8 +416,8 @@ export const formProps: FormProps = {
|
||||
isShow: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'a0e7e0343222424c823d2a3149a0ceb6',
|
||||
@ -595,8 +447,8 @@ export const formProps: FormProps = {
|
||||
isShow: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '94d31ed5e9b04033bf33a41d10f2d33b',
|
||||
@ -604,7 +456,7 @@ export const formProps: FormProps = {
|
||||
label: '自有设备标识',
|
||||
type: 'select',
|
||||
component: 'XjrSelect',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 8 },
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
@ -618,30 +470,30 @@ export const formProps: FormProps = {
|
||||
showSearch: false,
|
||||
clearable: false,
|
||||
disabled: false,
|
||||
mode: 'multiple',
|
||||
mode: '',
|
||||
staticOptions: [
|
||||
{ key: 1, label: 'Option 1', value: 'Option 1' },
|
||||
{ key: 2, label: 'Option 2', value: 'Option 2' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' }
|
||||
],
|
||||
defaultSelect: null,
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '1679045876047552513' },
|
||||
params: { itemId: '1978056598125330433' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7'
|
||||
},
|
||||
dicOptions: [],
|
||||
required: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
isShow: true,
|
||||
itemId: '1679045876047552513',
|
||||
style: { width: '100%' },
|
||||
},
|
||||
itemId: '1978056598125330433',
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '136ded020cc84ef4827e0b077b64d24f',
|
||||
@ -649,7 +501,7 @@ export const formProps: FormProps = {
|
||||
label: '系统直联',
|
||||
type: 'select',
|
||||
component: 'XjrSelect',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 8 },
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
@ -663,30 +515,30 @@ export const formProps: FormProps = {
|
||||
showSearch: false,
|
||||
clearable: false,
|
||||
disabled: false,
|
||||
mode: 'multiple',
|
||||
mode: '',
|
||||
staticOptions: [
|
||||
{ key: 1, label: 'Option 1', value: 'Option 1' },
|
||||
{ key: 2, label: 'Option 2', value: 'Option 2' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' }
|
||||
],
|
||||
defaultSelect: null,
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '1419276800524423168' },
|
||||
params: { itemId: '1978056598125330433' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7'
|
||||
},
|
||||
dicOptions: [],
|
||||
required: false,
|
||||
required: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
isShow: true,
|
||||
itemId: '1419276800524423168',
|
||||
style: { width: '100%' },
|
||||
},
|
||||
itemId: '1978056598125330433',
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '38a1796c62434566ae6de94eb1b5f914',
|
||||
@ -694,7 +546,7 @@ export const formProps: FormProps = {
|
||||
label: '显示顺序',
|
||||
type: 'number',
|
||||
component: 'InputNumber',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 8 },
|
||||
defaultValue: null,
|
||||
componentProps: {
|
||||
labelWidthMode: 'fix',
|
||||
@ -715,8 +567,8 @@ export const formProps: FormProps = {
|
||||
isShow: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '7c3ac171d20642bcb8f5b079f118b775',
|
||||
@ -724,7 +576,7 @@ export const formProps: FormProps = {
|
||||
label: '有效标志',
|
||||
type: 'select',
|
||||
component: 'XjrSelect',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 8 },
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
@ -737,12 +589,12 @@ export const formProps: FormProps = {
|
||||
showLabel: true,
|
||||
showSearch: false,
|
||||
clearable: false,
|
||||
disabled: false,
|
||||
mode: 'multiple',
|
||||
disabled: true,
|
||||
mode: '',
|
||||
staticOptions: [
|
||||
{ key: 1, label: 'Option 1', value: 'Option 1' },
|
||||
{ key: 2, label: 'Option 2', value: 'Option 2' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' }
|
||||
],
|
||||
defaultSelect: null,
|
||||
datasourceType: 'dic',
|
||||
@ -752,7 +604,7 @@ export const formProps: FormProps = {
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7'
|
||||
},
|
||||
dicOptions: [],
|
||||
required: false,
|
||||
@ -760,8 +612,8 @@ export const formProps: FormProps = {
|
||||
events: {},
|
||||
isShow: true,
|
||||
itemId: '1978057078528327681',
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '972e6f34ee7d42899f19a9cae558544f',
|
||||
@ -791,14 +643,14 @@ export const formProps: FormProps = {
|
||||
isShow: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
}
|
||||
],
|
||||
showActionButtonGroup: false,
|
||||
buttonLocation: 'center',
|
||||
actionColOptions: { span: 24 },
|
||||
showResetButton: false,
|
||||
showSubmitButton: false,
|
||||
hiddenComponent: [],
|
||||
hiddenComponent: []
|
||||
};
|
||||
@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<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 v-for="button in tableButtonConfig" :key="button.code">
|
||||
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
||||
@ -24,25 +23,23 @@
|
||||
</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';
|
||||
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 { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
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 { getLngBStationLng } from '/@/api/mdm/LNGStation';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
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 useEventBus from '/@/hooks/event/useEventBus';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
@ -53,20 +50,29 @@
|
||||
const { t } = useI18n();
|
||||
defineEmits(['register']);
|
||||
const { filterColumnAuth, filterButtonAuth } = usePermission();
|
||||
const { mergeColumns,mergeSearchFormSchema,mergeButtons } = useFormConfig();
|
||||
const { mergeColumns, mergeSearchFormSchema, mergeButtons } = useFormConfig();
|
||||
|
||||
const filterColumns = cloneDeep(filterColumnAuth(columns));
|
||||
const customConfigColums =ref(filterColumns);
|
||||
const customSearchFormSchema =ref(searchFormSchema);
|
||||
const customConfigColums = ref(filterColumns);
|
||||
const customSearchFormSchema = ref(searchFormSchema);
|
||||
|
||||
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 buttonConfigs = computed(()=>{
|
||||
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));
|
||||
@ -76,35 +82,34 @@
|
||||
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 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='LNG气源地';
|
||||
const [registerTable, { reload, }] = useTable({
|
||||
title: '' || (formName + '列表'),
|
||||
const formName = 'LNG气源地';
|
||||
const [registerTable, { reload }] = useTable({
|
||||
title: '' || formName + '列表',
|
||||
api: getLngBStationLngPage,
|
||||
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,
|
||||
@ -114,17 +119,16 @@
|
||||
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 || {};
|
||||
@ -134,7 +138,7 @@
|
||||
query: {
|
||||
taskId: taskIds[0],
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else if (schemaId && !taskIds && processId) {
|
||||
@ -144,7 +148,7 @@
|
||||
readonly: 1,
|
||||
taskId: '',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@ -153,14 +157,13 @@
|
||||
query: {
|
||||
formPath: 'mdm/LNGStation',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function buttonClick(code) {
|
||||
|
||||
btnEvent[code]();
|
||||
}
|
||||
|
||||
@ -175,20 +178,19 @@
|
||||
query: {
|
||||
formPath: 'mdm/LNGStation',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
|
||||
router.push({
|
||||
path: '/form/LNGStation/' + record.id + '/updateForm',
|
||||
query: {
|
||||
formPath: 'mdm/LNGStation',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -200,7 +202,7 @@
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要启用的数据'),
|
||||
description: t('请选择需要启用的数据')
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -217,19 +219,18 @@
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('启用成功!'),
|
||||
description: t('启用成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
onCancel() {}
|
||||
});
|
||||
|
||||
}
|
||||
function handleDisable() {
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要禁用的数据'),
|
||||
description: t('请选择需要禁用的数据')
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -245,13 +246,14 @@
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('禁用成功!'),
|
||||
description: t('禁用成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
onCancel() {}
|
||||
});
|
||||
}
|
||||
function handleDatalog() {}
|
||||
function deleteList(ids) {
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
@ -264,28 +266,24 @@
|
||||
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);
|
||||
@ -304,22 +302,21 @@
|
||||
bus.off(FORM_LIST_MODIFIED, handleRefresh);
|
||||
}
|
||||
});
|
||||
function getActions(record: Recordable):ActionItem[] {
|
||||
|
||||
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 {};
|
||||
@ -328,29 +325,29 @@
|
||||
});
|
||||
return actionsList;
|
||||
}
|
||||
async function mergeCustomListRenderConfig(){
|
||||
async function mergeCustomListRenderConfig() {
|
||||
if (formConfig.useCustomConfig) {
|
||||
let formId=currentRoute.value.meta.formId;
|
||||
let formId = currentRoute.value.meta.formId;
|
||||
//1.合并展示字段配置
|
||||
let cols= await mergeColumns(customConfigColums.value,formId);
|
||||
customConfigColums.value=cols;
|
||||
let cols = await mergeColumns(customConfigColums.value, formId);
|
||||
customConfigColums.value = cols;
|
||||
//2.合并搜索字段配置
|
||||
let sFormSchema= await mergeSearchFormSchema(customSearchFormSchema.value,formId);
|
||||
customSearchFormSchema.value=sFormSchema;
|
||||
let sFormSchema = await mergeSearchFormSchema(customSearchFormSchema.value, formId);
|
||||
customSearchFormSchema.value = sFormSchema;
|
||||
//3.合并按钮配置
|
||||
let btns= await mergeButtons(buttons.value,formId);
|
||||
buttons.value=btns;
|
||||
let btns = await mergeButtons(buttons.value, formId);
|
||||
buttons.value = btns;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-table-selection-col) {
|
||||
width: 50px;
|
||||
}
|
||||
.show{
|
||||
.show {
|
||||
display: flex;
|
||||
}
|
||||
.hide{
|
||||
.hide {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
@ -1,14 +1,9 @@
|
||||
<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';
|
||||
import { formProps, formEventConfigs ,formConfig} from './config';
|
||||
import { reactive, ref, onBeforeMount, onMounted } from 'vue';
|
||||
import { formProps, formEventConfigs, formConfig } from './config';
|
||||
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
|
||||
import { addLngBPort, getLngBPort, updateLngBPort, deleteLngBPort } from '/@/api/mdm/Port';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
@ -16,46 +11,50 @@
|
||||
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';
|
||||
import { getTreeData } from '/@/api/mdm/CountryRegion';
|
||||
|
||||
const { filterFormSchemaAuth } = usePermission();
|
||||
const { mergeFormSchemas,mergeFormEventConfigs } = useFormConfig();
|
||||
const { mergeFormSchemas, mergeFormEventConfigs } = useFormConfig();
|
||||
const { currentRoute } = useRouter();
|
||||
|
||||
const RowKey = 'id';
|
||||
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'form-mounted']);
|
||||
const emits = defineEmits(['changeUploadComponentIds', 'loadingCompleted', 'form-mounted']);
|
||||
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=[];
|
||||
let customFormEventConfigs = [];
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const treeData = await getTreeData({});
|
||||
formProps.schemas?.forEach((v) => {
|
||||
if (v.field == 'regionCode') {
|
||||
v.componentProps.options = treeData;
|
||||
}
|
||||
});
|
||||
|
||||
// 合并渲染覆盖配置中的字段配置、表单事件配置
|
||||
await mergeCustomFormRenderConfig();
|
||||
|
||||
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方法
|
||||
@ -64,34 +63,27 @@
|
||||
} 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);
|
||||
let cloneProps = cloneDeep(formProps);
|
||||
let fEventConfigs = cloneDeep(formEventConfigs);
|
||||
if (formConfig.useCustomConfig) {
|
||||
if(props.fromPage !== FromPageType.FLOW){
|
||||
let formPath=currentRoute.value.query.formPath;
|
||||
if (props.fromPage !== FromPageType.FLOW) {
|
||||
let formPath = currentRoute.value.query.formPath;
|
||||
//1.合并字段配置
|
||||
cloneProps.schemas=await mergeFormSchemas({formSchema:cloneProps.schemas!,formPath:formPath});
|
||||
cloneProps.schemas = await mergeFormSchemas({ formSchema: cloneProps.schemas!, formPath: formPath });
|
||||
//2.合并表单事件配置
|
||||
fEventConfigs=await mergeFormEventConfigs({formEventConfigs:fEventConfigs,formPath:formPath});
|
||||
fEventConfigs = await mergeFormEventConfigs({ formEventConfigs: fEventConfigs, formPath: formPath });
|
||||
}
|
||||
}
|
||||
data.formDataProps=cloneProps;
|
||||
customFormEventConfigs=fEventConfigs;
|
||||
data.formDataProps = cloneProps;
|
||||
customFormEventConfigs = fEventConfigs;
|
||||
}
|
||||
|
||||
// 根据菜单页面权限,设置表单属性(必填,禁用,显示)
|
||||
@ -125,9 +117,7 @@
|
||||
state.formModel = record;
|
||||
await getFormDataEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据
|
||||
return record;
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
} catch (error) {}
|
||||
}
|
||||
// 辅助设置表单数据
|
||||
function setFieldsValue(record) {
|
||||
@ -139,7 +129,7 @@
|
||||
}
|
||||
// 设置表单数据全部为Disabled 【查看】
|
||||
async function setDisabledForm(isDisabled) {
|
||||
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas),isDisabled);
|
||||
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas), isDisabled);
|
||||
}
|
||||
// 获取行键值
|
||||
function getRowKey() {
|
||||
@ -151,9 +141,7 @@
|
||||
values[RowKey] = rowId;
|
||||
state.formModel = values;
|
||||
let saveVal = await updateLngBPort(values);
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:提交表单
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
|
||||
return saveVal;
|
||||
} catch (error) {}
|
||||
}
|
||||
@ -162,22 +150,20 @@
|
||||
try {
|
||||
state.formModel = values;
|
||||
let saveVal = await addLngBPort(values);
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:提交表单
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
|
||||
return saveVal;
|
||||
} catch (error) {}
|
||||
}
|
||||
// 根据工作流页面权限,设置表单属性(必填,禁用,显示)
|
||||
async function setWorkFlowForm(obj: WorkFlowFormParams) {
|
||||
try {
|
||||
const cloneProps=cloneDeep(formProps);
|
||||
customFormEventConfigs=cloneDeep(formEventConfigs);
|
||||
const cloneProps = cloneDeep(formProps);
|
||||
customFormEventConfigs = cloneDeep(formEventConfigs);
|
||||
if (formConfig.useCustomConfig) {
|
||||
const parts = obj.formConfigKey.split('_');
|
||||
const formId=parts[1];
|
||||
cloneProps.schemas=await mergeFormSchemas({formSchema:cloneProps.schemas!,formId:formId});
|
||||
customFormEventConfigs=await mergeFormEventConfigs({formEventConfigs:customFormEventConfigs,formId:formId});
|
||||
const formId = parts[1];
|
||||
cloneProps.schemas = await mergeFormSchemas({ formSchema: cloneProps.schemas!, formId: formId });
|
||||
customFormEventConfigs = await mergeFormEventConfigs({ formEventConfigs: customFormEventConfigs, formId: formId });
|
||||
}
|
||||
|
||||
let flowData = changeWorkFlowForm(cloneProps, obj);
|
||||
@ -188,21 +174,17 @@
|
||||
setDisabledForm(); //查看
|
||||
}
|
||||
state.formModel = formModels;
|
||||
if(formModels[RowKey]) {
|
||||
setFormDataFromId(formModels[RowKey], false)
|
||||
if (formModels[RowKey]) {
|
||||
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 deleteLngBPort([id]);
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
<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';
|
||||
@ -23,7 +21,7 @@
|
||||
isUpdate: true,
|
||||
isView: false,
|
||||
isCopy: false,
|
||||
rowId: '',
|
||||
rowId: ''
|
||||
});
|
||||
|
||||
const { t } = useI18n();
|
||||
@ -38,7 +36,7 @@
|
||||
showCancelBtn: !state.isView,
|
||||
showOkBtn: !state.isView,
|
||||
canFullscreen: true,
|
||||
width: 900,
|
||||
width: 900
|
||||
});
|
||||
if (state.isUpdate || state.isView || state.isCopy) {
|
||||
state.rowId = data.id;
|
||||
@ -87,12 +85,12 @@
|
||||
//false 新增
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('新增成功!'),
|
||||
description: t('新增成功!')
|
||||
}); //提示消息
|
||||
} else {
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('修改成功!'),
|
||||
description: t('修改成功!')
|
||||
}); //提示消息
|
||||
}
|
||||
closeModal();
|
||||
|
||||
@ -2,14 +2,14 @@ import { FormProps, FormSchema } from '/@/components/Form';
|
||||
import { BasicColumn } from '/@/components/Table';
|
||||
|
||||
export const formConfig = {
|
||||
useCustomConfig: false,
|
||||
useCustomConfig: false
|
||||
};
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'fullName',
|
||||
label: '名称',
|
||||
component: 'Input',
|
||||
component: 'Input'
|
||||
},
|
||||
{
|
||||
field: 'valid',
|
||||
@ -21,92 +21,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
|
||||
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',
|
||||
},
|
||||
getPopupContainer: () => document.body
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
@ -116,7 +33,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -125,7 +42,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -134,7 +51,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -143,79 +60,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'cascader',
|
||||
align: 'left',
|
||||
|
||||
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,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -224,7 +69,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'select',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -233,8 +78,8 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'textarea',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
sorter: true
|
||||
}
|
||||
];
|
||||
//表单事件
|
||||
export const formEventConfigs = {
|
||||
@ -245,7 +90,7 @@ export const formEventConfigs = {
|
||||
text: '开始节点',
|
||||
icon: '#icon-kaishi',
|
||||
bgcColor: '#D8E5FF',
|
||||
isUserDefined: false,
|
||||
isUserDefined: false
|
||||
},
|
||||
{
|
||||
color: '#F6AB01',
|
||||
@ -253,8 +98,8 @@ export const formEventConfigs = {
|
||||
text: '初始化表单',
|
||||
bgcColor: '#f9f5ea',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
nodeInfo: { processEvent: [] }
|
||||
}
|
||||
],
|
||||
1: [
|
||||
{
|
||||
@ -264,8 +109,8 @@ export const formEventConfigs = {
|
||||
detail: '(新增无此操作)',
|
||||
bgcColor: '#F8F2FC',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
nodeInfo: { processEvent: [] }
|
||||
}
|
||||
],
|
||||
2: [
|
||||
{
|
||||
@ -274,8 +119,8 @@ export const formEventConfigs = {
|
||||
text: '加载表单',
|
||||
bgcColor: '#FFF1F1',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
nodeInfo: { processEvent: [] }
|
||||
}
|
||||
],
|
||||
3: [
|
||||
{
|
||||
@ -284,8 +129,8 @@ export const formEventConfigs = {
|
||||
text: '提交表单',
|
||||
bgcColor: '#F5F4FF',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
nodeInfo: { processEvent: [] }
|
||||
}
|
||||
],
|
||||
4: [
|
||||
{
|
||||
@ -295,9 +140,9 @@ export const formEventConfigs = {
|
||||
icon: '#icon-jieshuzhiliao',
|
||||
bgcColor: '#FFD6D6',
|
||||
isLast: true,
|
||||
isUserDefined: false,
|
||||
},
|
||||
],
|
||||
isUserDefined: false
|
||||
}
|
||||
]
|
||||
};
|
||||
export const formProps: FormProps = {
|
||||
labelCol: { span: 3, offset: 0 },
|
||||
@ -336,8 +181,8 @@ export const formProps: FormProps = {
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '1b3bf1efab214701a9588b4cfb9dfd5c',
|
||||
@ -345,7 +190,7 @@ export const formProps: FormProps = {
|
||||
label: '名称',
|
||||
type: 'input',
|
||||
component: 'Input',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 16 },
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
@ -370,8 +215,8 @@ export const formProps: FormProps = {
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '0dcc7f43f9e34f1b87cc2f730417b3e0',
|
||||
@ -379,7 +224,7 @@ export const formProps: FormProps = {
|
||||
label: '简称',
|
||||
type: 'input',
|
||||
component: 'Input',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 8 },
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
@ -404,41 +249,42 @@ export const formProps: FormProps = {
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '6020d6d0bab849089148eba1d194931a',
|
||||
field: 'regionCode',
|
||||
label: '所属国家和地区',
|
||||
type: 'cascader',
|
||||
component: 'ApiCascader',
|
||||
colProps: { span: 24 },
|
||||
component: 'Cascader',
|
||||
colProps: { span: 16 },
|
||||
componentProps: {
|
||||
options: [],
|
||||
fieldNames: { label: 'fullName', value: 'code', children: 'children' },
|
||||
width: '100%',
|
||||
span: '',
|
||||
defaultValue: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
width: '100%',
|
||||
span: '',
|
||||
placeholder: '请选择所属国家和地区',
|
||||
showFormat: 'all',
|
||||
separator: '/',
|
||||
selectedConfig: 'selectMostChildLevel',
|
||||
placeholder: '请选择',
|
||||
maxlength: null,
|
||||
prefix: '',
|
||||
suffix: '',
|
||||
addonBefore: '',
|
||||
addonAfter: '',
|
||||
disabled: false,
|
||||
allowClear: false,
|
||||
showLabel: true,
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/cascade',
|
||||
method: 'GET',
|
||||
apiId: '0772d128d20f4f80aaafc784adba338a',
|
||||
},
|
||||
required: false,
|
||||
rules: [],
|
||||
events: {},
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
scan: false,
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'cd46b163fa8345809ab5d579d96f40f2',
|
||||
@ -446,7 +292,7 @@ export const formProps: FormProps = {
|
||||
label: '吞吐量',
|
||||
type: 'number',
|
||||
component: 'InputNumber',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 8 },
|
||||
defaultValue: null,
|
||||
componentProps: {
|
||||
labelWidthMode: 'fix',
|
||||
@ -454,10 +300,31 @@ export const formProps: FormProps = {
|
||||
responsive: false,
|
||||
width: '100%',
|
||||
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,
|
||||
max: null,
|
||||
step: 0.01,
|
||||
step: 0.0001,
|
||||
maxlength: '',
|
||||
disabled: false,
|
||||
showLabel: true,
|
||||
@ -467,8 +334,8 @@ export const formProps: FormProps = {
|
||||
isShow: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '16e52805d5334759be1d2f40d517efa6',
|
||||
@ -476,13 +343,14 @@ export const formProps: FormProps = {
|
||||
label: '连线经度',
|
||||
type: 'number',
|
||||
component: 'InputNumber',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 8 },
|
||||
defaultValue: null,
|
||||
componentProps: {
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
width: '100%',
|
||||
precision: '2',
|
||||
span: '',
|
||||
defaultValue: null,
|
||||
min: null,
|
||||
@ -497,8 +365,8 @@ export const formProps: FormProps = {
|
||||
isShow: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '6b1a921de60d4676be79074cefe0327a',
|
||||
@ -506,12 +374,14 @@ export const formProps: FormProps = {
|
||||
label: '连线纬度',
|
||||
type: 'number',
|
||||
component: 'InputNumber',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 8 },
|
||||
defaultValue: null,
|
||||
componentProps: {
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
precision: '2',
|
||||
|
||||
width: '100%',
|
||||
span: '',
|
||||
defaultValue: null,
|
||||
@ -527,8 +397,8 @@ export const formProps: FormProps = {
|
||||
isShow: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '68e573db83d941efb9a5687f84726b6b',
|
||||
@ -558,8 +428,8 @@ export const formProps: FormProps = {
|
||||
isShow: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '34c007fd1d9544ecb3a5ecea5d7f7b1b',
|
||||
@ -589,8 +459,8 @@ export const formProps: FormProps = {
|
||||
isShow: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '9099e3d919a64dfe860719c34fcaf37d',
|
||||
@ -620,8 +490,8 @@ export const formProps: FormProps = {
|
||||
isShow: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '16fbe387e5c6471b9be06524f4766f10',
|
||||
@ -651,8 +521,8 @@ export const formProps: FormProps = {
|
||||
isShow: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'ef6536972cc54e21b09b4f5637730d0b',
|
||||
@ -660,7 +530,7 @@ export const formProps: FormProps = {
|
||||
label: '显示顺序',
|
||||
type: 'number',
|
||||
component: 'InputNumber',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 8 },
|
||||
defaultValue: null,
|
||||
componentProps: {
|
||||
labelWidthMode: 'fix',
|
||||
@ -681,8 +551,8 @@ export const formProps: FormProps = {
|
||||
isShow: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '03f1a079e8544b77a793460306207f41',
|
||||
@ -690,7 +560,7 @@ export const formProps: FormProps = {
|
||||
label: '有效标志',
|
||||
type: 'select',
|
||||
component: 'XjrSelect',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 8 },
|
||||
componentProps: {
|
||||
width: '100%',
|
||||
span: '',
|
||||
@ -708,7 +578,7 @@ export const formProps: FormProps = {
|
||||
staticOptions: [
|
||||
{ key: 1, label: 'Option 1', value: 'Option 1' },
|
||||
{ key: 2, label: 'Option 2', value: 'Option 2' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' }
|
||||
],
|
||||
defaultSelect: null,
|
||||
datasourceType: 'dic',
|
||||
@ -718,7 +588,7 @@ export const formProps: FormProps = {
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7'
|
||||
},
|
||||
dicOptions: [],
|
||||
required: false,
|
||||
@ -726,8 +596,8 @@ export const formProps: FormProps = {
|
||||
events: {},
|
||||
isShow: true,
|
||||
itemId: '1978057078528327681',
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'e15f5901160a49e9969fdd7d61e00053',
|
||||
@ -757,14 +627,14 @@ export const formProps: FormProps = {
|
||||
isShow: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
}
|
||||
],
|
||||
showActionButtonGroup: false,
|
||||
buttonLocation: 'center',
|
||||
actionColOptions: { span: 24 },
|
||||
showResetButton: false,
|
||||
showSubmitButton: false,
|
||||
hiddenComponent: [],
|
||||
hiddenComponent: []
|
||||
};
|
||||
@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<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 v-for="button in tableButtonConfig" :key="button.code">
|
||||
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
||||
@ -24,25 +23,23 @@
|
||||
</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';
|
||||
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 { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
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 { getLngBPort } from '/@/api/mdm/Port';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
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 useEventBus from '/@/hooks/event/useEventBus';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
@ -53,20 +50,29 @@
|
||||
const { t } = useI18n();
|
||||
defineEmits(['register']);
|
||||
const { filterColumnAuth, filterButtonAuth } = usePermission();
|
||||
const { mergeColumns,mergeSearchFormSchema,mergeButtons } = useFormConfig();
|
||||
const { mergeColumns, mergeSearchFormSchema, mergeButtons } = useFormConfig();
|
||||
|
||||
const filterColumns = cloneDeep(filterColumnAuth(columns));
|
||||
const customConfigColums =ref(filterColumns);
|
||||
const customSearchFormSchema =ref(searchFormSchema);
|
||||
const customConfigColums = ref(filterColumns);
|
||||
const customSearchFormSchema = ref(searchFormSchema);
|
||||
|
||||
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 buttonConfigs = computed(()=>{
|
||||
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));
|
||||
@ -76,35 +82,34 @@
|
||||
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 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 formName = '港口';
|
||||
const [registerTable, { reload }] = useTable({
|
||||
title: '' || formName + '列表',
|
||||
api: getLngBPortPage,
|
||||
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,
|
||||
@ -114,17 +119,16 @@
|
||||
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 || {};
|
||||
@ -134,7 +138,7 @@
|
||||
query: {
|
||||
taskId: taskIds[0],
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else if (schemaId && !taskIds && processId) {
|
||||
@ -144,7 +148,7 @@
|
||||
readonly: 1,
|
||||
taskId: '',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@ -153,14 +157,13 @@
|
||||
query: {
|
||||
formPath: 'mdm/Port',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function buttonClick(code) {
|
||||
|
||||
btnEvent[code]();
|
||||
}
|
||||
|
||||
@ -175,20 +178,19 @@
|
||||
query: {
|
||||
formPath: 'mdm/Port',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
|
||||
router.push({
|
||||
path: '/form/Port/' + record.id + '/updateForm',
|
||||
query: {
|
||||
formPath: 'mdm/Port',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -200,7 +202,7 @@
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要启用的数据'),
|
||||
description: t('请选择需要启用的数据')
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -217,19 +219,18 @@
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('启用成功!'),
|
||||
description: t('启用成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
onCancel() {}
|
||||
});
|
||||
|
||||
}
|
||||
function handleDisable() {
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要禁用的数据'),
|
||||
description: t('请选择需要禁用的数据')
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -245,11 +246,11 @@
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('禁用成功!'),
|
||||
description: t('禁用成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
onCancel() {}
|
||||
});
|
||||
}
|
||||
function deleteList(ids) {
|
||||
@ -264,28 +265,25 @@
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('删除成功!'),
|
||||
description: t('删除成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
onCancel() {}
|
||||
});
|
||||
}
|
||||
function handleRefresh() {
|
||||
reload();
|
||||
}
|
||||
function handleSuccess() {
|
||||
|
||||
reload();
|
||||
}
|
||||
function handleDatalog() {}
|
||||
|
||||
function handleView(record: Recordable) {
|
||||
|
||||
dbClickRow(record);
|
||||
|
||||
}
|
||||
onMounted(() => {
|
||||
|
||||
if (schemaIdComputedRef.value) {
|
||||
bus.on(FLOW_PROCESSED, handleRefresh);
|
||||
bus.on(CREATE_FLOW, handleRefresh);
|
||||
@ -304,22 +302,21 @@
|
||||
bus.off(FORM_LIST_MODIFIED, handleRefresh);
|
||||
}
|
||||
});
|
||||
function getActions(record: Recordable):ActionItem[] {
|
||||
|
||||
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 {};
|
||||
@ -328,29 +325,29 @@
|
||||
});
|
||||
return actionsList;
|
||||
}
|
||||
async function mergeCustomListRenderConfig(){
|
||||
async function mergeCustomListRenderConfig() {
|
||||
if (formConfig.useCustomConfig) {
|
||||
let formId=currentRoute.value.meta.formId;
|
||||
let formId = currentRoute.value.meta.formId;
|
||||
//1.合并展示字段配置
|
||||
let cols= await mergeColumns(customConfigColums.value,formId);
|
||||
customConfigColums.value=cols;
|
||||
let cols = await mergeColumns(customConfigColums.value, formId);
|
||||
customConfigColums.value = cols;
|
||||
//2.合并搜索字段配置
|
||||
let sFormSchema= await mergeSearchFormSchema(customSearchFormSchema.value,formId);
|
||||
customSearchFormSchema.value=sFormSchema;
|
||||
let sFormSchema = await mergeSearchFormSchema(customSearchFormSchema.value, formId);
|
||||
customSearchFormSchema.value = sFormSchema;
|
||||
//3.合并按钮配置
|
||||
let btns= await mergeButtons(buttons.value,formId);
|
||||
buttons.value=btns;
|
||||
let btns = await mergeButtons(buttons.value, formId);
|
||||
buttons.value = btns;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-table-selection-col) {
|
||||
width: 50px;
|
||||
}
|
||||
.show{
|
||||
.show {
|
||||
display: flex;
|
||||
}
|
||||
.hide{
|
||||
.hide {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user