From 112a34944d87422c67584eba0ba3ee08d3c3ac61 Mon Sep 17 00:00:00 2001 From: "t-aonan.gu" Date: Fri, 24 Oct 2025 17:19:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=AF=E5=8F=A3=E3=80=81LNG=E6=B0=94?= =?UTF-8?q?=E6=BA=90=E5=9C=B0=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mdm/LNGStation/index.ts | 177 +-- src/views/mdm/Category/components/config.ts | 846 +++++----- .../LNGStation/components/LNGStationModal.vue | 190 ++- src/views/mdm/LNGStation/components/config.ts | 1394 ++++++++--------- src/views/mdm/LNGStation/index.vue | 677 ++++---- src/views/mdm/Port/components/Form.vue | 410 +++-- src/views/mdm/Port/components/PortModal.vue | 190 ++- src/views/mdm/Port/components/config.ts | 1352 ++++++++-------- src/views/mdm/Port/index.vue | 677 ++++---- 9 files changed, 2801 insertions(+), 3112 deletions(-) diff --git a/src/api/mdm/LNGStation/index.ts b/src/api/mdm/LNGStation/index.ts index 0e59d1c..c59391d 100644 --- a/src/api/mdm/LNGStation/index.ts +++ b/src/api/mdm/LNGStation/index.ts @@ -3,137 +3,132 @@ 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', - - - - Enable = '/mdm/lngStation/enable', - Disable= '/mdm/lngStation/disable', - - DataLog = '/mdm/lngStation/datalog', + Page = '/mdm/lNGStation/page', + List = '/mdm/lNGStation/list', + Info = '/mdm/lNGStation/info', + LngBStationLng = '/mdm/lNGStation', + + Enable = '/mdm/lNGStation/enable', + Disable = '/mdm/lNGStation/disable', + + DataLog = '/mdm/lNGStation/datalog' } /** * @description: 查询LngBStationLng分页列表 */ export async function getLngBStationLngPage(params: LngBStationLngPageParams, mode: ErrorMessageMode = 'modal') { - return defHttp.get( - { - url: Api.Page, - params, - }, - { - errorMessageMode: mode, - }, - ); + return defHttp.get( + { + url: Api.Page, + params + }, + { + errorMessageMode: mode + } + ); } /** * @description: 获取LngBStationLng信息 */ export async function getLngBStationLng(id: String, mode: ErrorMessageMode = 'modal') { - return defHttp.get( - { - url: Api.Info, - params: { id }, - }, - { - errorMessageMode: mode, - }, - ); + return defHttp.get( + { + url: Api.Info, + params: { id } + }, + { + errorMessageMode: mode + } + ); } /** * @description: 新增LngBStationLng */ export async function addLngBStationLng(lngBStationLng: Recordable, mode: ErrorMessageMode = 'modal') { - return defHttp.post( - { - url: Api.LngBStationLng, - params: lngBStationLng, - }, - { - errorMessageMode: mode, - }, - ); + return defHttp.post( + { + url: Api.LngBStationLng, + params: lngBStationLng + }, + { + errorMessageMode: mode + } + ); } /** * @description: 更新LngBStationLng */ export async function updateLngBStationLng(lngBStationLng: Recordable, mode: ErrorMessageMode = 'modal') { - return defHttp.put( - { - url: Api.LngBStationLng, - params: lngBStationLng, - }, - { - errorMessageMode: mode, - }, - ); + return defHttp.put( + { + url: Api.LngBStationLng, + params: lngBStationLng + }, + { + errorMessageMode: mode + } + ); } /** * @description: 删除LngBStationLng(批量删除) */ export async function deleteLngBStationLng(ids: string[], mode: ErrorMessageMode = 'modal') { - return defHttp.delete( - { - url: Api.LngBStationLng, - data: ids, - }, - { - errorMessageMode: mode, - }, - ); + return defHttp.delete( + { + url: Api.LngBStationLng, + data: ids + }, + { + errorMessageMode: mode + } + ); } - /** * @description: 启用数据LngBStationLng */ export async function enableLngBStationLng(ids: string[], mode: ErrorMessageMode = 'modal') { - return defHttp.post( - { - url: Api.Enable, - data: ids, - }, - { - errorMessageMode: mode, - }, - ); + return defHttp.post( + { + url: Api.Enable, + data: ids + }, + { + errorMessageMode: mode + } + ); } /** * @description: 作废数据LngBStationLng */ export async function disableLngBStationLng(ids: string[], mode: ErrorMessageMode = 'modal') { - return defHttp.post( - { - url: Api.Disable, - data: ids, - }, - { - errorMessageMode: mode, - }, - ); -} - - - - /** - * @description: 获取数据日志LngBStationLng - */ - export async function getDataLogLngBStationLng(id: string, mode: ErrorMessageMode = 'modal') { return defHttp.post( - { - url: Api.Datalog, - data: id, - }, - { - errorMessageMode: mode, - }, + { + url: Api.Disable, + data: ids + }, + { + errorMessageMode: mode + } ); - } \ No newline at end of file +} + +/** + * @description: 获取数据日志LngBStationLng + */ +export async function getDataLogLngBStationLng(id: string, mode: ErrorMessageMode = 'modal') { + return defHttp.post( + { + url: Api.Datalog, + data: id + }, + { + errorMessageMode: mode + } + ); +} diff --git a/src/views/mdm/Category/components/config.ts b/src/views/mdm/Category/components/config.ts index 3c2b503..5a491bd 100644 --- a/src/views/mdm/Category/components/config.ts +++ b/src/views/mdm/Category/components/config.ts @@ -2,457 +2,457 @@ 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', - }, - { - field: 'valid', - label: '有效标志', - component: 'XjrSelect', - componentProps: { - datasourceType: 'dic', - params: { itemId: '1978057078528327681' }, - labelField: 'name', - valueField: 'value', + { + field: 'fullName', + label: '名称', + component: 'Input' + }, + { + field: 'valid', + label: '有效标志', + component: 'XjrSelect', + componentProps: { + datasourceType: 'dic', + params: { itemId: '1978057078528327681' }, + labelField: 'name', + valueField: 'value', - getPopupContainer: () => document.body, + getPopupContainer: () => document.body + } }, - }, - { - field: 'code', - label: '编码', - component: 'Input', - }, - { - field: 'unitCode', - label: '数量单位', - component: 'XjrSelect', - componentProps: { - datasourceType: 'dic', - params: { itemId: '1980562721538633730' }, - labelField: 'name', - valueField: 'value', + { + field: 'code', + label: '编码', + component: 'Input' + }, + { + field: 'unitCode', + label: '数量单位', + component: 'XjrSelect', + componentProps: { + datasourceType: 'dic', + params: { itemId: '1980562721538633730' }, + labelField: 'name', + valueField: 'value', - getPopupContainer: () => document.body, + getPopupContainer: () => document.body + } }, - }, - { - field: 'coefficient', - label: '车/数量单位', - component: 'Input', - }, - { - field: 'sort', - label: '显示顺序', - component: 'InputNumber', - componentProps: { - style: { width: '100%' }, + { + field: 'coefficient', + label: '车/数量单位', + component: 'Input' }, - }, - { - field: 'note', - label: '备注', - component: 'Input', - }, + { + field: 'sort', + label: '显示顺序', + component: 'InputNumber', + componentProps: { + style: { width: '100%' } + } + }, + { + field: 'note', + label: '备注', + component: 'Input' + } ]; export const columns: BasicColumn[] = [ - { - dataIndex: 'code', - title: '编码', - componentType: 'input', - align: 'left', + { + dataIndex: 'code', + title: '编码', + componentType: 'input', + align: 'left', - sorter: true, - }, + sorter: true + }, - { - dataIndex: 'fullName', - title: '名称', - componentType: 'input', - align: 'left', + { + dataIndex: 'fullName', + title: '名称', + componentType: 'input', + align: 'left', - sorter: true, - }, + sorter: true + }, - { - dataIndex: 'unitCode', - title: '数量单位', - componentType: 'select', - align: 'left', + { + dataIndex: 'unitCode', + title: '数量单位', + componentType: 'select', + align: 'left', - sorter: true, - }, + sorter: true + }, - { - dataIndex: 'coefficient', - title: '车/数量单位', - componentType: 'input', - align: 'left', + { + dataIndex: 'coefficient', + title: '车/数量单位', + componentType: 'input', + align: 'left', - sorter: true, - }, + sorter: true + }, - { - dataIndex: 'sort', - title: '显示顺序', - componentType: 'number', - align: 'left', + { + dataIndex: 'sort', + title: '显示顺序', + componentType: 'number', + align: 'left', - sorter: true, - }, + sorter: true + }, - { - dataIndex: 'valid', - title: '有效标志', - componentType: 'select', - align: 'left', + { + dataIndex: 'valid', + title: '有效标志', + componentType: 'select', + align: 'left', - sorter: true, - }, + sorter: true + }, - { - dataIndex: 'note', - title: '备注', - componentType: 'textarea', - align: 'left', + { + dataIndex: 'note', + title: '备注', + componentType: 'textarea', + align: 'left', - sorter: true, - }, + sorter: true + } ]; //表单事件 export const formEventConfigs = { - 0: [ - { - type: 'circle', - color: '#2774ff', - text: '开始节点', - icon: '#icon-kaishi', - bgcColor: '#D8E5FF', - isUserDefined: false, - }, - { - color: '#F6AB01', - icon: '#icon-chushihua', - text: '初始化表单', - bgcColor: '#f9f5ea', - isUserDefined: false, - nodeInfo: { processEvent: [] }, - }, - ], - 1: [ - { - color: '#B36EDB', - icon: '#icon-shujufenxi', - text: '获取表单数据', - detail: '(新增无此操作)', - bgcColor: '#F8F2FC', - isUserDefined: false, - nodeInfo: { processEvent: [] }, - }, - ], - 2: [ - { - color: '#F8625C', - icon: '#icon-jiazai', - text: '加载表单', - bgcColor: '#FFF1F1', - isUserDefined: false, - nodeInfo: { processEvent: [] }, - }, - ], - 3: [ - { - color: '#6C6AE0', - icon: '#icon-jsontijiao', - text: '提交表单', - bgcColor: '#F5F4FF', - isUserDefined: false, - nodeInfo: { processEvent: [] }, - }, - ], - 4: [ - { - type: 'circle', - color: '#F8625C', - text: '结束节点', - icon: '#icon-jieshuzhiliao', - bgcColor: '#FFD6D6', - isLast: true, - isUserDefined: false, - }, - ], + 0: [ + { + type: 'circle', + color: '#2774ff', + text: '开始节点', + icon: '#icon-kaishi', + bgcColor: '#D8E5FF', + isUserDefined: false + }, + { + color: '#F6AB01', + icon: '#icon-chushihua', + text: '初始化表单', + bgcColor: '#f9f5ea', + isUserDefined: false, + nodeInfo: { processEvent: [] } + } + ], + 1: [ + { + color: '#B36EDB', + icon: '#icon-shujufenxi', + text: '获取表单数据', + detail: '(新增无此操作)', + bgcColor: '#F8F2FC', + isUserDefined: false, + nodeInfo: { processEvent: [] } + } + ], + 2: [ + { + color: '#F8625C', + icon: '#icon-jiazai', + text: '加载表单', + bgcColor: '#FFF1F1', + isUserDefined: false, + nodeInfo: { processEvent: [] } + } + ], + 3: [ + { + color: '#6C6AE0', + icon: '#icon-jsontijiao', + text: '提交表单', + bgcColor: '#F5F4FF', + isUserDefined: false, + nodeInfo: { processEvent: [] } + } + ], + 4: [ + { + type: 'circle', + color: '#F8625C', + text: '结束节点', + icon: '#icon-jieshuzhiliao', + bgcColor: '#FFD6D6', + isLast: true, + isUserDefined: false + } + ] }; export const formProps: FormProps = { - labelCol: { span: 3, offset: 0 }, - labelAlign: 'right', - layout: 'horizontal', - size: 'default', - schemas: [ - { - key: '1ac3ffe5d4f54caa890a13d4c9624c4f', - field: 'code', - label: '编码', - type: 'input', - component: 'Input', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请输入编码', - maxlength: null, - prefix: '', - suffix: '', - addonBefore: '', - addonAfter: '', - disabled: false, - allowClear: true, - showLabel: true, - required: true, - rules: [], - events: {}, - isSave: false, - isShow: true, - scan: false, - style: { width: '100%' }, - }, - }, - { - key: 'bf017ce23394455689757955a23d7b72', - field: 'fullName', - label: '名称', - type: 'input', - component: 'Input', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请输入名称', - maxlength: null, - prefix: '', - suffix: '', - addonBefore: '', - addonAfter: '', - disabled: false, - allowClear: true, - showLabel: true, - required: true, - rules: [], - events: {}, - isSave: false, - isShow: true, - scan: false, - style: { width: '100%' }, - }, - }, - { - key: '533dcfe1e679462e830091588c1cb9fd', - field: 'unitCode', - label: '数量单位', - type: 'select', - component: 'XjrSelect', - colProps: { span: 24 }, - componentProps: { - width: '100%', - span: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请选择数量单位', - sepTextField: '', - showLabel: true, - showSearch: false, - clearable: false, - disabled: false, - mode: 'multiple', - staticOptions: [ - { key: 1, label: 'Option 1', value: 'Option 1' }, - { key: 2, label: 'Option 2', value: 'Option 2' }, - { key: 3, label: 'Option 3', value: 'Option 3' }, - ], - defaultSelect: null, - datasourceType: 'dic', - params: { itemId: '1980562721538633730' }, - labelField: 'name', - valueField: 'value', - apiConfig: { - path: 'CodeGeneration/selection', - method: 'GET', - apiId: '93d735dcb7364a0f8102188ec4d77ac7', + labelCol: { span: 3, offset: 0 }, + labelAlign: 'right', + layout: 'horizontal', + size: 'default', + schemas: [ + { + key: '1ac3ffe5d4f54caa890a13d4c9624c4f', + field: 'code', + label: '编码', + type: 'input', + component: 'Input', + colProps: { span: 24 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请输入编码', + maxlength: null, + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: false, + allowClear: true, + showLabel: true, + required: true, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: { width: '100%' } + } }, - dicOptions: [], - required: true, - rules: [], - events: {}, - isShow: true, - itemId: '1980562721538633730', - style: { width: '100%' }, - }, - }, - { - key: '57d85cbf34fa475298997f5a7427bf8d', - field: 'coefficient', - label: '车/数量单位', - type: 'input', - component: 'Input', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请输入车/数量单位', - maxlength: null, - prefix: '', - suffix: '', - addonBefore: '', - addonAfter: '', - disabled: false, - allowClear: false, - showLabel: true, - required: false, - rules: [], - events: {}, - isSave: false, - isShow: true, - scan: false, - style: { width: '100%' }, - }, - }, - { - key: '870650303cf54491b476233e6d5d9b6b', - field: 'sort', - label: '显示顺序', - type: 'number', - component: 'InputNumber', - colProps: { span: 24 }, - defaultValue: null, - componentProps: { - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - width: '100%', - span: '', - defaultValue: null, - min: 0, - max: null, - step: 1, - maxlength: null, - disabled: false, - showLabel: true, - controls: true, - required: false, - subTotal: false, - isShow: true, - rules: [], - events: {}, - style: { width: '100%' }, - }, - }, - { - key: '17bbaf11ddb0454d854f2082abd7b191', - field: 'valid', - label: '有效标志', - type: 'select', - component: 'XjrSelect', - colProps: { span: 24 }, - componentProps: { - width: '100%', - span: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请选择有效标志', - sepTextField: '', - showLabel: true, - showSearch: false, - clearable: false, - disabled: false, - mode: 'multiple', - staticOptions: [ - { key: 1, label: 'Option 1', value: 'Option 1' }, - { key: 2, label: 'Option 2', value: 'Option 2' }, - { key: 3, label: 'Option 3', value: 'Option 3' }, - ], - defaultSelect: null, - datasourceType: 'dic', - params: { itemId: '1978057078528327681' }, - labelField: 'name', - valueField: 'value', - apiConfig: { - path: 'CodeGeneration/selection', - method: 'GET', - apiId: '93d735dcb7364a0f8102188ec4d77ac7', + { + key: 'bf017ce23394455689757955a23d7b72', + field: 'fullName', + label: '名称', + type: 'input', + component: 'Input', + colProps: { span: 24 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请输入名称', + maxlength: null, + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: false, + allowClear: true, + showLabel: true, + required: true, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: { width: '100%' } + } }, - dicOptions: [], - required: false, - rules: [], - events: {}, - isShow: true, - itemId: '1978057078528327681', - style: { width: '100%' }, - }, - }, - { - key: '7e8014fe939e4ca88ebe986dd91c555c', - field: 'note', - label: '备注', - type: 'textarea', - component: 'InputTextArea', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: true, - placeholder: '请输入备注', - maxlength: null, - rows: 4, - autoSize: false, - showCount: false, - disabled: false, - showLabel: true, - allowClear: false, - required: false, - isShow: true, - rules: [], - events: {}, - style: { width: '100%' }, - }, - }, - ], - showActionButtonGroup: false, - buttonLocation: 'center', - actionColOptions: { span: 24 }, - showResetButton: false, - showSubmitButton: false, - hiddenComponent: [], -}; \ No newline at end of file + { + key: '533dcfe1e679462e830091588c1cb9fd', + field: 'unitCode', + label: '数量单位', + type: 'select', + component: 'XjrSelect', + colProps: { span: 24 }, + componentProps: { + width: '100%', + span: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请选择数量单位', + sepTextField: '', + showLabel: true, + showSearch: false, + clearable: false, + disabled: false, + mode: 'multiple', + staticOptions: [ + { key: 1, label: 'Option 1', value: 'Option 1' }, + { key: 2, label: 'Option 2', value: 'Option 2' }, + { key: 3, label: 'Option 3', value: 'Option 3' } + ], + defaultSelect: null, + datasourceType: 'dic', + params: { itemId: '1980562721538633730' }, + labelField: 'name', + valueField: 'value', + apiConfig: { + path: 'CodeGeneration/selection', + method: 'GET', + apiId: '93d735dcb7364a0f8102188ec4d77ac7' + }, + dicOptions: [], + required: true, + rules: [], + events: {}, + isShow: true, + itemId: '1980562721538633730', + style: { width: '100%' } + } + }, + { + key: '57d85cbf34fa475298997f5a7427bf8d', + field: 'coefficient', + label: '车/数量单位', + type: 'input', + component: 'Input', + colProps: { span: 24 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请输入车/数量单位', + maxlength: null, + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: false, + allowClear: false, + showLabel: true, + required: false, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: { width: '100%' } + } + }, + { + key: '870650303cf54491b476233e6d5d9b6b', + field: 'sort', + label: '显示顺序', + type: 'number', + component: 'InputNumber', + colProps: { span: 24 }, + defaultValue: null, + componentProps: { + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + width: '100%', + span: '', + defaultValue: null, + min: 0, + max: null, + step: 1, + maxlength: null, + disabled: false, + showLabel: true, + controls: true, + required: false, + subTotal: false, + isShow: true, + rules: [], + events: {}, + style: { width: '100%' } + } + }, + { + key: '17bbaf11ddb0454d854f2082abd7b191', + field: 'valid', + label: '有效标志', + type: 'select', + component: 'XjrSelect', + colProps: { span: 24 }, + componentProps: { + width: '100%', + span: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请选择有效标志', + sepTextField: '', + showLabel: true, + showSearch: false, + clearable: false, + disabled: false, + mode: 'multiple', + staticOptions: [ + { key: 1, label: 'Option 1', value: 'Option 1' }, + { key: 2, label: 'Option 2', value: 'Option 2' }, + { key: 3, label: 'Option 3', value: 'Option 3' } + ], + defaultSelect: null, + datasourceType: 'dic', + params: { itemId: '1978057078528327681' }, + labelField: 'name', + valueField: 'value', + apiConfig: { + path: 'CodeGeneration/selection', + method: 'GET', + apiId: '93d735dcb7364a0f8102188ec4d77ac7' + }, + dicOptions: [], + required: false, + rules: [], + events: {}, + isShow: true, + itemId: '1978057078528327681', + style: { width: '100%' } + } + }, + { + key: '7e8014fe939e4ca88ebe986dd91c555c', + field: 'note', + label: '备注', + type: 'textarea', + component: 'InputTextArea', + colProps: { span: 24 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: true, + placeholder: '请输入备注', + maxlength: null, + rows: 4, + autoSize: false, + showCount: false, + disabled: false, + showLabel: true, + allowClear: false, + required: false, + isShow: true, + rules: [], + events: {}, + style: { width: '100%' } + } + } + ], + showActionButtonGroup: false, + buttonLocation: 'center', + actionColOptions: { span: 24 }, + showResetButton: false, + showSubmitButton: false, + hiddenComponent: [] +}; diff --git a/src/views/mdm/LNGStation/components/LNGStationModal.vue b/src/views/mdm/LNGStation/components/LNGStationModal.vue index 168dd47..8cfa7cf 100644 --- a/src/views/mdm/LNGStation/components/LNGStationModal.vue +++ b/src/views/mdm/LNGStation/components/LNGStationModal.vue @@ -1,110 +1,108 @@ \ No newline at end of file + + async function handleSubmit() { + try { + const saveSuccess = await saveModal(); + setModalProps({ confirmLoading: true }); + if (saveSuccess) { + if (!state.isUpdate || state.isCopy) { + //false 新增 + notification.success({ + message: 'Tip', + description: t('新增成功!') + }); //提示消息 + } else { + notification.success({ + message: 'Tip', + description: t('修改成功!') + }); //提示消息 + } + closeModal(); + formRef.value.resetFields(); + emit('success'); + } + } finally { + setModalProps({ confirmLoading: false }); + } + } + + function handleClose() { + formRef.value.resetFields(); + } + diff --git a/src/views/mdm/LNGStation/components/config.ts b/src/views/mdm/LNGStation/components/config.ts index 2422467..83c8a9e 100644 --- a/src/views/mdm/LNGStation/components/config.ts +++ b/src/views/mdm/LNGStation/components/config.ts @@ -2,803 +2,655 @@ 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: 'fullName', + label: '名称', + component: 'Input' }, - }, + { + field: 'valid', + label: '有效标志', + component: 'XjrSelect', + componentProps: { + datasourceType: 'dic', + params: { itemId: '1978057078528327681' }, + labelField: 'name', + valueField: 'value', - { - 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', - label: '有效标志', - component: 'XjrSelect', - componentProps: { - datasourceType: 'dic', - params: { itemId: '1978057078528327681' }, - labelField: 'name', - valueField: 'value', - - getPopupContainer: () => document.body, - }, - }, - { - field: 'note', - label: '备注', - component: 'Input', - }, + getPopupContainer: () => document.body + } + } ]; export const columns: BasicColumn[] = [ - { - dataIndex: 'code', - title: '编码', - componentType: 'input', - align: 'left', + { + dataIndex: 'code', + title: '编码', + componentType: 'input', + align: 'left', - sorter: true, - }, + sorter: true + }, - { - dataIndex: 'fullName', - title: '名称', - componentType: 'input', - align: 'left', + { + dataIndex: 'fullName', + title: '名称', + componentType: 'input', + align: 'left', - sorter: true, - }, + sorter: true + }, - { - dataIndex: 'enterprise', - title: '所属企业', - componentType: 'input', - align: 'left', + { + dataIndex: 'enterprise', + title: '所属企业', + componentType: 'input', + align: 'left', - sorter: true, - }, + sorter: true + }, - { - dataIndex: 'contact', - title: '联系人', - componentType: 'input', - align: 'left', + { + dataIndex: 'contact', + title: '联系人', + componentType: 'input', + align: 'left', - sorter: true, - }, + sorter: true + }, - { - dataIndex: 'tel', - title: '电话', - componentType: 'input', - align: 'left', + { + dataIndex: 'tel', + title: '电话', + componentType: 'input', + align: 'left', - sorter: true, - }, + sorter: true + }, - { - dataIndex: 'email', - title: '邮箱', - componentType: 'input', - align: 'left', + { + dataIndex: 'email', + title: '邮箱', + componentType: 'input', + align: 'left', - sorter: true, - }, + sorter: true + }, - { - dataIndex: 'valid', - title: '有效标志', - componentType: 'select', - align: 'left', + { + dataIndex: 'valid', + title: '有效标志', + 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 = { - 0: [ - { - type: 'circle', - color: '#2774ff', - text: '开始节点', - icon: '#icon-kaishi', - bgcColor: '#D8E5FF', - isUserDefined: false, - }, - { - color: '#F6AB01', - icon: '#icon-chushihua', - text: '初始化表单', - bgcColor: '#f9f5ea', - isUserDefined: false, - nodeInfo: { processEvent: [] }, - }, - ], - 1: [ - { - color: '#B36EDB', - icon: '#icon-shujufenxi', - text: '获取表单数据', - detail: '(新增无此操作)', - bgcColor: '#F8F2FC', - isUserDefined: false, - nodeInfo: { processEvent: [] }, - }, - ], - 2: [ - { - color: '#F8625C', - icon: '#icon-jiazai', - text: '加载表单', - bgcColor: '#FFF1F1', - isUserDefined: false, - nodeInfo: { processEvent: [] }, - }, - ], - 3: [ - { - color: '#6C6AE0', - icon: '#icon-jsontijiao', - text: '提交表单', - bgcColor: '#F5F4FF', - isUserDefined: false, - nodeInfo: { processEvent: [] }, - }, - ], - 4: [ - { - type: 'circle', - color: '#F8625C', - text: '结束节点', - icon: '#icon-jieshuzhiliao', - bgcColor: '#FFD6D6', - isLast: true, - isUserDefined: false, - }, - ], + 0: [ + { + type: 'circle', + color: '#2774ff', + text: '开始节点', + icon: '#icon-kaishi', + bgcColor: '#D8E5FF', + isUserDefined: false + }, + { + color: '#F6AB01', + icon: '#icon-chushihua', + text: '初始化表单', + bgcColor: '#f9f5ea', + isUserDefined: false, + nodeInfo: { processEvent: [] } + } + ], + 1: [ + { + color: '#B36EDB', + icon: '#icon-shujufenxi', + text: '获取表单数据', + detail: '(新增无此操作)', + bgcColor: '#F8F2FC', + isUserDefined: false, + nodeInfo: { processEvent: [] } + } + ], + 2: [ + { + color: '#F8625C', + icon: '#icon-jiazai', + text: '加载表单', + bgcColor: '#FFF1F1', + isUserDefined: false, + nodeInfo: { processEvent: [] } + } + ], + 3: [ + { + color: '#6C6AE0', + icon: '#icon-jsontijiao', + text: '提交表单', + bgcColor: '#F5F4FF', + isUserDefined: false, + nodeInfo: { processEvent: [] } + } + ], + 4: [ + { + type: 'circle', + color: '#F8625C', + text: '结束节点', + icon: '#icon-jieshuzhiliao', + bgcColor: '#FFD6D6', + isLast: true, + isUserDefined: false + } + ] }; export const formProps: FormProps = { - labelCol: { span: 3, offset: 0 }, - labelAlign: 'right', - layout: 'horizontal', - size: 'default', - schemas: [ - { - key: '6e1b995f3d4c45c79288cee66ce5308d', - field: 'code', - label: '编码', - type: 'input', - component: 'Input', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请输入编码', - maxlength: null, - prefix: '', - suffix: '', - addonBefore: '', - addonAfter: '', - disabled: true, - allowClear: false, - showLabel: true, - required: false, - rules: [], - events: {}, - isSave: false, - isShow: true, - scan: false, - style: { width: '100%' }, - }, - }, - { - key: 'e23fcb9f62104eb284b553403a12ee12', - field: 'fullName', - label: '名称', - type: 'input', - component: 'Input', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请输入名称', - maxlength: null, - prefix: '', - suffix: '', - addonBefore: '', - addonAfter: '', - disabled: false, - allowClear: false, - showLabel: true, - required: true, - rules: [], - events: {}, - isSave: false, - isShow: true, - scan: false, - style: { width: '100%' }, - }, - }, - { - key: 'd32af84b3fc8443cbef441fc6ce5fc0b', - field: 'enterprise', - label: '所属企业', - type: 'input', - component: 'Input', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请输入所属企业', - maxlength: null, - prefix: '', - suffix: '', - addonBefore: '', - addonAfter: '', - disabled: false, - allowClear: false, - showLabel: true, - required: false, - rules: [], - events: {}, - isSave: false, - isShow: true, - scan: false, - style: { width: '100%' }, - }, - }, - { - key: '5adb1f7560b344d789102d4b0af05b64', - field: 'contact', - label: '联系人', - type: 'input', - component: 'Input', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请输入联系人', - maxlength: null, - prefix: '', - suffix: '', - addonBefore: '', - addonAfter: '', - disabled: false, - allowClear: false, - showLabel: true, - required: false, - rules: [], - events: {}, - isSave: false, - isShow: true, - scan: false, - style: { width: '100%' }, - }, - }, - { - key: 'a5a825723d8f4789aaea9189a98f792c', - field: 'tel', - label: '电话', - type: 'input', - component: 'Input', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请输入电话', - maxlength: null, - prefix: '', - suffix: '', - addonBefore: '', - addonAfter: '', - disabled: false, - allowClear: false, - showLabel: true, - required: false, - rules: [], - events: {}, - isSave: false, - isShow: true, - scan: false, - style: { width: '100%' }, - }, - }, - { - key: 'cbdd54bdc1334671904b1c10e064571d', - field: 'email', - label: '邮箱', - type: 'input', - component: 'Input', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请输入邮箱', - maxlength: null, - prefix: '', - suffix: '', - addonBefore: '', - addonAfter: '', - disabled: false, - allowClear: false, - showLabel: true, - required: false, - rules: [], - events: {}, - isSave: false, - isShow: true, - scan: false, - style: { width: '100%' }, - }, - }, - { - key: '1485b829c80a493bb55f37d1c839ccc9', - field: 'regionCode', - label: '行政区域', - type: 'area', - component: 'Area', - colProps: { span: 24 }, - componentProps: { - width: '100%', - span: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请选择行政区域', - showLabel: true, - disabled: false, - allowClear: false, - required: false, - rules: [], - events: {}, - isShow: true, - style: { width: '100%' }, - }, - }, - { - key: 'e98223a611784bee9a626acceb1745e8', - field: 'addr', - label: '地址', - type: 'textarea', - component: 'InputTextArea', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: true, - placeholder: '请输入地址', - maxlength: null, - rows: 4, - autoSize: false, - showCount: false, - disabled: false, - showLabel: true, - allowClear: false, - required: false, - isShow: true, - rules: [], - events: {}, - style: { width: '100%' }, - }, - }, - { - key: 'a0e7e0343222424c823d2a3149a0ceb6', - field: 'addrMail', - label: '通讯地址', - type: 'textarea', - component: 'InputTextArea', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: true, - placeholder: '请输入通讯地址', - maxlength: null, - rows: 4, - autoSize: false, - showCount: false, - disabled: false, - showLabel: true, - allowClear: false, - required: false, - isShow: true, - rules: [], - events: {}, - style: { width: '100%' }, - }, - }, - { - key: '94d31ed5e9b04033bf33a41d10f2d33b', - field: 'ownSign', - label: '自有设备标识', - type: 'select', - component: 'XjrSelect', - colProps: { span: 24 }, - componentProps: { - width: '100%', - span: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请选择自有设备标识', - sepTextField: '', - showLabel: true, - showSearch: false, - clearable: false, - disabled: false, - mode: 'multiple', - staticOptions: [ - { key: 1, label: 'Option 1', value: 'Option 1' }, - { key: 2, label: 'Option 2', value: 'Option 2' }, - { key: 3, label: 'Option 3', value: 'Option 3' }, - ], - defaultSelect: null, - datasourceType: 'dic', - params: { itemId: '1679045876047552513' }, - labelField: 'name', - valueField: 'value', - apiConfig: { - path: 'CodeGeneration/selection', - method: 'GET', - apiId: '93d735dcb7364a0f8102188ec4d77ac7', + labelCol: { span: 3, offset: 0 }, + labelAlign: 'right', + layout: 'horizontal', + size: 'default', + schemas: [ + { + key: '6e1b995f3d4c45c79288cee66ce5308d', + field: 'code', + label: '编码', + type: 'input', + component: 'Input', + colProps: { span: 24 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请输入编码', + maxlength: null, + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: true, + allowClear: false, + showLabel: true, + required: false, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: { width: '100%' } + } }, - dicOptions: [], - required: true, - rules: [], - events: {}, - isShow: true, - itemId: '1679045876047552513', - style: { width: '100%' }, - }, - }, - { - key: '136ded020cc84ef4827e0b077b64d24f', - field: 'onlineSign', - label: '系统直联', - type: 'select', - component: 'XjrSelect', - colProps: { span: 24 }, - componentProps: { - width: '100%', - span: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请选择系统直联', - sepTextField: '', - showLabel: true, - showSearch: false, - clearable: false, - disabled: false, - mode: 'multiple', - staticOptions: [ - { key: 1, label: 'Option 1', value: 'Option 1' }, - { key: 2, label: 'Option 2', value: 'Option 2' }, - { key: 3, label: 'Option 3', value: 'Option 3' }, - ], - defaultSelect: null, - datasourceType: 'dic', - params: { itemId: '1419276800524423168' }, - labelField: 'name', - valueField: 'value', - apiConfig: { - path: 'CodeGeneration/selection', - method: 'GET', - apiId: '93d735dcb7364a0f8102188ec4d77ac7', + { + key: 'e23fcb9f62104eb284b553403a12ee12', + field: 'fullName', + label: '名称', + type: 'input', + component: 'Input', + colProps: { span: 8 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请输入名称', + maxlength: null, + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: false, + allowClear: false, + showLabel: true, + required: true, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: { width: '100%' } + } }, - dicOptions: [], - required: false, - rules: [], - events: {}, - isShow: true, - itemId: '1419276800524423168', - style: { width: '100%' }, - }, - }, - { - key: '38a1796c62434566ae6de94eb1b5f914', - field: 'sort', - label: '显示顺序', - type: 'number', - component: 'InputNumber', - colProps: { span: 24 }, - defaultValue: null, - componentProps: { - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - width: '100%', - span: '', - defaultValue: null, - min: null, - max: null, - step: 1, - maxlength: null, - disabled: false, - showLabel: true, - controls: true, - required: false, - subTotal: false, - isShow: true, - rules: [], - events: {}, - style: { width: '100%' }, - }, - }, - { - key: '7c3ac171d20642bcb8f5b079f118b775', - field: 'valid', - label: '有效标志', - type: 'select', - component: 'XjrSelect', - colProps: { span: 24 }, - componentProps: { - width: '100%', - span: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请选择有效标志', - sepTextField: '', - showLabel: true, - showSearch: false, - clearable: false, - disabled: false, - mode: 'multiple', - staticOptions: [ - { key: 1, label: 'Option 1', value: 'Option 1' }, - { key: 2, label: 'Option 2', value: 'Option 2' }, - { key: 3, label: 'Option 3', value: 'Option 3' }, - ], - defaultSelect: null, - datasourceType: 'dic', - params: { itemId: '1978057078528327681' }, - labelField: 'name', - valueField: 'value', - apiConfig: { - path: 'CodeGeneration/selection', - method: 'GET', - apiId: '93d735dcb7364a0f8102188ec4d77ac7', + { + key: 'd32af84b3fc8443cbef441fc6ce5fc0b', + field: 'enterprise', + label: '所属企业', + type: 'input', + component: 'Input', + colProps: { span: 8 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请输入所属企业', + maxlength: null, + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: false, + allowClear: false, + showLabel: true, + required: false, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: { width: '100%' } + } }, - dicOptions: [], - required: false, - rules: [], - events: {}, - isShow: true, - itemId: '1978057078528327681', - style: { width: '100%' }, - }, - }, - { - key: '972e6f34ee7d42899f19a9cae558544f', - field: 'note', - label: '备注', - type: 'textarea', - component: 'InputTextArea', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: true, - placeholder: '请输入备注', - maxlength: null, - rows: 4, - autoSize: false, - showCount: false, - disabled: false, - showLabel: true, - allowClear: false, - required: false, - isShow: true, - rules: [], - events: {}, - style: { width: '100%' }, - }, - }, - ], - showActionButtonGroup: false, - buttonLocation: 'center', - actionColOptions: { span: 24 }, - showResetButton: false, - showSubmitButton: false, - hiddenComponent: [], -}; \ No newline at end of file + { + key: '5adb1f7560b344d789102d4b0af05b64', + field: 'contact', + label: '联系人', + type: 'input', + component: 'Input', + colProps: { span: 8 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请输入联系人', + maxlength: null, + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: false, + allowClear: false, + showLabel: true, + required: false, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: { width: '100%' } + } + }, + { + key: 'a5a825723d8f4789aaea9189a98f792c', + field: 'tel', + label: '电话', + type: 'input', + component: 'Input', + colProps: { span: 8 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请输入电话', + maxlength: null, + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: false, + allowClear: false, + showLabel: true, + required: false, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: { width: '100%' } + } + }, + { + key: 'cbdd54bdc1334671904b1c10e064571d', + field: 'email', + label: '邮箱', + type: 'input', + component: 'Input', + colProps: { span: 8 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请输入邮箱', + maxlength: null, + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: false, + allowClear: false, + showLabel: true, + required: false, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: { width: '100%' } + } + }, + { + key: '1485b829c80a493bb55f37d1c839ccc9', + field: 'regionCode', + label: '行政区域', + type: 'area', + component: 'Area', + colProps: { span: 8 }, + componentProps: { + width: '100%', + span: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请选择行政区域', + showLabel: true, + disabled: false, + allowClear: false, + required: false, + rules: [], + events: {}, + isShow: true, + style: { width: '100%' } + } + }, + { + key: 'e98223a611784bee9a626acceb1745e8', + field: 'addr', + label: '地址', + type: 'textarea', + component: 'InputTextArea', + colProps: { span: 24 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: true, + placeholder: '请输入地址', + maxlength: null, + rows: 4, + autoSize: false, + showCount: false, + disabled: false, + showLabel: true, + allowClear: false, + required: false, + isShow: true, + rules: [], + events: {}, + style: { width: '100%' } + } + }, + { + key: 'a0e7e0343222424c823d2a3149a0ceb6', + field: 'addrMail', + label: '通讯地址', + type: 'textarea', + component: 'InputTextArea', + colProps: { span: 24 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: true, + placeholder: '请输入通讯地址', + maxlength: null, + rows: 4, + autoSize: false, + showCount: false, + disabled: false, + showLabel: true, + allowClear: false, + required: false, + isShow: true, + rules: [], + events: {}, + style: { width: '100%' } + } + }, + { + key: '94d31ed5e9b04033bf33a41d10f2d33b', + field: 'ownSign', + label: '自有设备标识', + type: 'select', + component: 'XjrSelect', + colProps: { span: 8 }, + componentProps: { + width: '100%', + span: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请选择自有设备标识', + sepTextField: '', + showLabel: true, + showSearch: false, + clearable: false, + disabled: false, + 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' } + ], + defaultSelect: null, + datasourceType: 'dic', + params: { itemId: '1978056598125330433' }, + labelField: 'name', + valueField: 'value', + apiConfig: { + path: 'CodeGeneration/selection', + method: 'GET', + apiId: '93d735dcb7364a0f8102188ec4d77ac7' + }, + dicOptions: [], + required: true, + rules: [], + events: {}, + isShow: true, + itemId: '1978056598125330433', + style: { width: '100%' } + } + }, + { + key: '136ded020cc84ef4827e0b077b64d24f', + field: 'onlineSign', + label: '系统直联', + type: 'select', + component: 'XjrSelect', + colProps: { span: 8 }, + componentProps: { + width: '100%', + span: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请选择系统直联', + sepTextField: '', + showLabel: true, + showSearch: false, + clearable: false, + disabled: false, + 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' } + ], + defaultSelect: null, + datasourceType: 'dic', + params: { itemId: '1978056598125330433' }, + labelField: 'name', + valueField: 'value', + apiConfig: { + path: 'CodeGeneration/selection', + method: 'GET', + apiId: '93d735dcb7364a0f8102188ec4d77ac7' + }, + dicOptions: [], + required: true, + rules: [], + events: {}, + isShow: true, + itemId: '1978056598125330433', + style: { width: '100%' } + } + }, + { + key: '38a1796c62434566ae6de94eb1b5f914', + field: 'sort', + label: '显示顺序', + type: 'number', + component: 'InputNumber', + colProps: { span: 8 }, + defaultValue: null, + componentProps: { + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + width: '100%', + span: '', + defaultValue: null, + min: null, + max: null, + step: 1, + maxlength: null, + disabled: false, + showLabel: true, + controls: true, + required: false, + subTotal: false, + isShow: true, + rules: [], + events: {}, + style: { width: '100%' } + } + }, + { + key: '7c3ac171d20642bcb8f5b079f118b775', + field: 'valid', + label: '有效标志', + type: 'select', + component: 'XjrSelect', + colProps: { span: 8 }, + componentProps: { + width: '100%', + span: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请选择有效标志', + sepTextField: '', + showLabel: true, + showSearch: false, + clearable: false, + disabled: true, + 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' } + ], + defaultSelect: null, + datasourceType: 'dic', + params: { itemId: '1978057078528327681' }, + labelField: 'name', + valueField: 'value', + apiConfig: { + path: 'CodeGeneration/selection', + method: 'GET', + apiId: '93d735dcb7364a0f8102188ec4d77ac7' + }, + dicOptions: [], + required: false, + rules: [], + events: {}, + isShow: true, + itemId: '1978057078528327681', + style: { width: '100%' } + } + }, + { + key: '972e6f34ee7d42899f19a9cae558544f', + field: 'note', + label: '备注', + type: 'textarea', + component: 'InputTextArea', + colProps: { span: 24 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: true, + placeholder: '请输入备注', + maxlength: null, + rows: 4, + autoSize: false, + showCount: false, + disabled: false, + showLabel: true, + allowClear: false, + required: false, + isShow: true, + rules: [], + events: {}, + style: { width: '100%' } + } + } + ], + showActionButtonGroup: false, + buttonLocation: 'center', + actionColOptions: { span: 24 }, + showResetButton: false, + showSubmitButton: false, + hiddenComponent: [] +}; diff --git a/src/views/mdm/LNGStation/index.vue b/src/views/mdm/LNGStation/index.vue index de71014..5eed3bc 100644 --- a/src/views/mdm/LNGStation/index.vue +++ b/src/views/mdm/LNGStation/index.vue @@ -1,356 +1,353 @@ \ No newline at end of file + :deep(.ant-table-selection-col) { + width: 50px; + } + .show { + display: flex; + } + .hide { + display: none !important; + } + diff --git a/src/views/mdm/Port/components/Form.vue b/src/views/mdm/Port/components/Form.vue index e00f956..b4c08a3 100644 --- a/src/views/mdm/Port/components/Form.vue +++ b/src/views/mdm/Port/components/Form.vue @@ -1,224 +1,206 @@ \ No newline at end of file + // 根据行唯一ID查询行数据,并设置表单数据 【编辑】 + async function setFormDataFromId(rowId, skipUpdate) { + try { + const record = await getLngBPort(rowId); + if (skipUpdate) { + return record; + } + setFieldsValue(record); + state.formModel = record; + await getFormDataEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据 + return record; + } catch (error) {} + } + // 辅助设置表单数据 + function setFieldsValue(record) { + systemFormRef.value.setFieldsValue(record); + } + // 重置表单数据 + async function resetFields() { + await systemFormRef.value.resetFields(); + } + // 设置表单数据全部为Disabled 【查看】 + async function setDisabledForm(isDisabled) { + data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas), isDisabled); + } + // 获取行键值 + function getRowKey() { + return RowKey; + } + // 更新api表单数据 + async function update({ values, rowId }) { + try { + values[RowKey] = rowId; + state.formModel = values; + let saveVal = await updateLngBPort(values); + await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单 + return saveVal; + } catch (error) {} + } + // 新增api表单数据 + async function add(values) { + try { + state.formModel = values; + let saveVal = await addLngBPort(values); + 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); + 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 }); + } + + let flowData = changeWorkFlowForm(cloneProps, obj); + let { buildOptionJson, uploadComponentIds, formModels, isViewProcess } = flowData; + data.formDataProps = buildOptionJson; + emits('changeUploadComponentIds', uploadComponentIds); //工作流中必须保存上传组件id【附件汇总需要】 + if (isViewProcess) { + setDisabledForm(); //查看 + } + state.formModel = formModels; + if (formModels[RowKey]) { + setFormDataFromId(formModels[RowKey], false); + } else { + setFieldsValue(formModels); + } + } catch (error) {} + await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单 + await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单 + } + function getFormModel() { + return systemFormRef.value.formModel; + } + async function handleDelete(id) { + return await deleteLngBPort([id]); + } + defineExpose({ + setFieldsValue, + resetFields, + validate, + add, + update, + setFormDataFromId, + setDisabledForm, + setMenuPermission, + setWorkFlowForm, + getRowKey, + getFormModel, + handleDelete + }); + diff --git a/src/views/mdm/Port/components/PortModal.vue b/src/views/mdm/Port/components/PortModal.vue index 168dd47..8cfa7cf 100644 --- a/src/views/mdm/Port/components/PortModal.vue +++ b/src/views/mdm/Port/components/PortModal.vue @@ -1,110 +1,108 @@ \ No newline at end of file + + async function handleSubmit() { + try { + const saveSuccess = await saveModal(); + setModalProps({ confirmLoading: true }); + if (saveSuccess) { + if (!state.isUpdate || state.isCopy) { + //false 新增 + notification.success({ + message: 'Tip', + description: t('新增成功!') + }); //提示消息 + } else { + notification.success({ + message: 'Tip', + description: t('修改成功!') + }); //提示消息 + } + closeModal(); + formRef.value.resetFields(); + emit('success'); + } + } finally { + setModalProps({ confirmLoading: false }); + } + } + + function handleClose() { + formRef.value.resetFields(); + } + diff --git a/src/views/mdm/Port/components/config.ts b/src/views/mdm/Port/components/config.ts index d6e7b5e..89cefa5 100644 --- a/src/views/mdm/Port/components/config.ts +++ b/src/views/mdm/Port/components/config.ts @@ -2,769 +2,639 @@ 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', - }, - { - field: 'valid', - label: '有效标志', - component: 'XjrSelect', - componentProps: { - datasourceType: 'dic', - params: { itemId: '1978057078528327681' }, - labelField: 'name', - valueField: 'value', + { + field: 'fullName', + label: '名称', + component: 'Input' + }, + { + field: 'valid', + label: '有效标志', + component: 'XjrSelect', + componentProps: { + datasourceType: 'dic', + params: { itemId: '1978057078528327681' }, + 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[] = [ - { - dataIndex: 'code', - title: '编码', - componentType: 'input', - align: 'left', + { + dataIndex: 'code', + title: '编码', + componentType: 'input', + align: 'left', - sorter: true, - }, + sorter: true + }, - { - dataIndex: 'fullName', - title: '名称', - componentType: 'input', - align: 'left', + { + dataIndex: 'fullName', + title: '名称', + componentType: 'input', + align: 'left', - sorter: true, - }, + sorter: true + }, - { - dataIndex: 'shortName', - title: '简称', - componentType: 'input', - align: 'left', + { + dataIndex: 'shortName', + title: '简称', + componentType: 'input', + align: 'left', - sorter: true, - }, + sorter: true + }, - { - dataIndex: 'regionCode', - title: '所属国家和地区', - componentType: 'cascader', - align: 'left', + { + dataIndex: 'regionCode', + title: '所属国家和地区', + componentType: 'cascader', + align: 'left', - sorter: true, - }, + sorter: true + }, - { - dataIndex: 'capacity', - title: '吞吐量', - componentType: 'number', - align: 'left', + { + dataIndex: 'valid', + title: '有效标志', + componentType: 'select', + align: 'left', - sorter: true, - }, + sorter: true + }, - { - dataIndex: 'longitude', - title: '连线经度', - componentType: 'number', - align: 'left', + { + dataIndex: 'note', + title: '备注', + componentType: 'textarea', + 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, - }, - - { - dataIndex: 'valid', - title: '有效标志', - componentType: 'select', - align: 'left', - - sorter: true, - }, - - { - dataIndex: 'note', - title: '备注', - componentType: 'textarea', - align: 'left', - - sorter: true, - }, + sorter: true + } ]; //表单事件 export const formEventConfigs = { - 0: [ - { - type: 'circle', - color: '#2774ff', - text: '开始节点', - icon: '#icon-kaishi', - bgcColor: '#D8E5FF', - isUserDefined: false, - }, - { - color: '#F6AB01', - icon: '#icon-chushihua', - text: '初始化表单', - bgcColor: '#f9f5ea', - isUserDefined: false, - nodeInfo: { processEvent: [] }, - }, - ], - 1: [ - { - color: '#B36EDB', - icon: '#icon-shujufenxi', - text: '获取表单数据', - detail: '(新增无此操作)', - bgcColor: '#F8F2FC', - isUserDefined: false, - nodeInfo: { processEvent: [] }, - }, - ], - 2: [ - { - color: '#F8625C', - icon: '#icon-jiazai', - text: '加载表单', - bgcColor: '#FFF1F1', - isUserDefined: false, - nodeInfo: { processEvent: [] }, - }, - ], - 3: [ - { - color: '#6C6AE0', - icon: '#icon-jsontijiao', - text: '提交表单', - bgcColor: '#F5F4FF', - isUserDefined: false, - nodeInfo: { processEvent: [] }, - }, - ], - 4: [ - { - type: 'circle', - color: '#F8625C', - text: '结束节点', - icon: '#icon-jieshuzhiliao', - bgcColor: '#FFD6D6', - isLast: true, - isUserDefined: false, - }, - ], + 0: [ + { + type: 'circle', + color: '#2774ff', + text: '开始节点', + icon: '#icon-kaishi', + bgcColor: '#D8E5FF', + isUserDefined: false + }, + { + color: '#F6AB01', + icon: '#icon-chushihua', + text: '初始化表单', + bgcColor: '#f9f5ea', + isUserDefined: false, + nodeInfo: { processEvent: [] } + } + ], + 1: [ + { + color: '#B36EDB', + icon: '#icon-shujufenxi', + text: '获取表单数据', + detail: '(新增无此操作)', + bgcColor: '#F8F2FC', + isUserDefined: false, + nodeInfo: { processEvent: [] } + } + ], + 2: [ + { + color: '#F8625C', + icon: '#icon-jiazai', + text: '加载表单', + bgcColor: '#FFF1F1', + isUserDefined: false, + nodeInfo: { processEvent: [] } + } + ], + 3: [ + { + color: '#6C6AE0', + icon: '#icon-jsontijiao', + text: '提交表单', + bgcColor: '#F5F4FF', + isUserDefined: false, + nodeInfo: { processEvent: [] } + } + ], + 4: [ + { + type: 'circle', + color: '#F8625C', + text: '结束节点', + icon: '#icon-jieshuzhiliao', + bgcColor: '#FFD6D6', + isLast: true, + isUserDefined: false + } + ] }; export const formProps: FormProps = { - labelCol: { span: 3, offset: 0 }, - labelAlign: 'right', - layout: 'horizontal', - size: 'default', - schemas: [ - { - key: 'ea4fcc80a1dd40219bcc8e28b7052655', - field: 'code', - label: '编码', - type: 'input', - component: 'Input', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请输入编码', - maxlength: null, - prefix: '', - suffix: '', - addonBefore: '', - addonAfter: '', - disabled: true, - allowClear: false, - showLabel: true, - required: false, - rules: [], - events: {}, - isSave: false, - isShow: true, - scan: false, - style: { width: '100%' }, - }, - }, - { - key: '1b3bf1efab214701a9588b4cfb9dfd5c', - field: 'fullName', - label: '名称', - type: 'input', - component: 'Input', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请输入名称', - maxlength: null, - prefix: '', - suffix: '', - addonBefore: '', - addonAfter: '', - disabled: false, - allowClear: false, - showLabel: true, - required: true, - rules: [], - events: {}, - isSave: false, - isShow: true, - scan: false, - style: { width: '100%' }, - }, - }, - { - key: '0dcc7f43f9e34f1b87cc2f730417b3e0', - field: 'shortName', - label: '简称', - type: 'input', - component: 'Input', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请输入简称', - maxlength: null, - prefix: '', - suffix: '', - addonBefore: '', - addonAfter: '', - disabled: false, - allowClear: true, - showLabel: true, - required: true, - rules: [], - events: {}, - isSave: false, - isShow: true, - scan: false, - style: { width: '100%' }, - }, - }, - { - key: '6020d6d0bab849089148eba1d194931a', - field: 'regionCode', - label: '所属国家和地区', - type: 'cascader', - component: 'ApiCascader', - colProps: { span: 24 }, - componentProps: { - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - width: '100%', - span: '', - placeholder: '请选择所属国家和地区', - showFormat: 'all', - separator: '/', - selectedConfig: 'selectMostChildLevel', - disabled: false, - allowClear: false, - showLabel: true, - apiConfig: { - path: 'CodeGeneration/cascade', - method: 'GET', - apiId: '0772d128d20f4f80aaafc784adba338a', + labelCol: { span: 3, offset: 0 }, + labelAlign: 'right', + layout: 'horizontal', + size: 'default', + schemas: [ + { + key: 'ea4fcc80a1dd40219bcc8e28b7052655', + field: 'code', + label: '编码', + type: 'input', + component: 'Input', + colProps: { span: 24 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请输入编码', + maxlength: null, + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: true, + allowClear: false, + showLabel: true, + required: false, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: { width: '100%' } + } }, - required: false, - rules: [], - events: {}, - isShow: true, - style: { width: '100%' }, - }, - }, - { - key: 'cd46b163fa8345809ab5d579d96f40f2', - field: 'capacity', - label: '吞吐量', - type: 'number', - component: 'InputNumber', - colProps: { span: 24 }, - defaultValue: null, - componentProps: { - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - width: '100%', - span: '', - defaultValue: null, - min: null, - max: null, - step: 0.01, - maxlength: '', - disabled: false, - showLabel: true, - controls: true, - required: false, - subTotal: false, - isShow: true, - rules: [], - events: {}, - style: { width: '100%' }, - }, - }, - { - key: '16e52805d5334759be1d2f40d517efa6', - field: 'longitude', - label: '连线经度', - type: 'number', - component: 'InputNumber', - colProps: { span: 24 }, - defaultValue: null, - componentProps: { - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - width: '100%', - span: '', - defaultValue: null, - min: null, - max: null, - step: 0.01, - maxlength: 2, - disabled: false, - showLabel: true, - controls: true, - required: false, - subTotal: false, - isShow: true, - rules: [], - events: {}, - style: { width: '100%' }, - }, - }, - { - key: '6b1a921de60d4676be79074cefe0327a', - field: 'latitude', - label: '连线纬度', - type: 'number', - component: 'InputNumber', - colProps: { span: 24 }, - defaultValue: null, - componentProps: { - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - width: '100%', - span: '', - defaultValue: null, - min: null, - max: null, - step: 0.01, - maxlength: 2, - disabled: false, - showLabel: true, - controls: true, - required: false, - subTotal: false, - isShow: true, - rules: [], - events: {}, - style: { width: '100%' }, - }, - }, - { - key: '68e573db83d941efb9a5687f84726b6b', - field: 'limit1', - label: '限制1', - type: 'textarea', - component: 'InputTextArea', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: true, - placeholder: '请输入限制1', - maxlength: null, - rows: 4, - autoSize: false, - showCount: true, - disabled: false, - showLabel: true, - allowClear: false, - required: false, - isShow: true, - rules: [], - events: {}, - style: { width: '100%' }, - }, - }, - { - key: '34c007fd1d9544ecb3a5ecea5d7f7b1b', - field: 'limit2', - label: '限制2', - type: 'textarea', - component: 'InputTextArea', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: true, - placeholder: '请输入限制2', - maxlength: null, - rows: 4, - autoSize: false, - showCount: true, - disabled: false, - showLabel: true, - allowClear: false, - required: false, - isShow: true, - rules: [], - events: {}, - style: { width: '100%' }, - }, - }, - { - key: '9099e3d919a64dfe860719c34fcaf37d', - field: 'limit3', - label: '限制3', - type: 'textarea', - component: 'InputTextArea', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: true, - placeholder: '请输入限制3', - maxlength: null, - rows: 4, - autoSize: false, - showCount: true, - disabled: false, - showLabel: true, - allowClear: false, - required: false, - isShow: true, - rules: [], - events: {}, - style: { width: '100%' }, - }, - }, - { - key: '16fbe387e5c6471b9be06524f4766f10', - field: 'limit4', - label: '限制4', - type: 'textarea', - component: 'InputTextArea', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: true, - placeholder: '请输入限制4', - maxlength: null, - rows: 4, - autoSize: false, - showCount: true, - disabled: false, - showLabel: true, - allowClear: false, - required: false, - isShow: true, - rules: [], - events: {}, - style: { width: '100%' }, - }, - }, - { - key: 'ef6536972cc54e21b09b4f5637730d0b', - field: 'sort', - label: '显示顺序', - type: 'number', - component: 'InputNumber', - colProps: { span: 24 }, - defaultValue: null, - componentProps: { - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - width: '100%', - span: '', - defaultValue: null, - min: 0, - max: null, - step: 1, - maxlength: '', - disabled: false, - showLabel: true, - controls: true, - required: false, - subTotal: false, - isShow: true, - rules: [], - events: {}, - style: { width: '100%' }, - }, - }, - { - key: '03f1a079e8544b77a793460306207f41', - field: 'valid', - label: '有效标志', - type: 'select', - component: 'XjrSelect', - colProps: { span: 24 }, - componentProps: { - width: '100%', - span: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: false, - placeholder: '请选择有效标志', - sepTextField: '', - showLabel: true, - showSearch: false, - clearable: false, - disabled: true, - mode: 'multiple', - staticOptions: [ - { key: 1, label: 'Option 1', value: 'Option 1' }, - { key: 2, label: 'Option 2', value: 'Option 2' }, - { key: 3, label: 'Option 3', value: 'Option 3' }, - ], - defaultSelect: null, - datasourceType: 'dic', - params: { itemId: '1978057078528327681' }, - labelField: 'name', - valueField: 'value', - apiConfig: { - path: 'CodeGeneration/selection', - method: 'GET', - apiId: '93d735dcb7364a0f8102188ec4d77ac7', + { + key: '1b3bf1efab214701a9588b4cfb9dfd5c', + field: 'fullName', + label: '名称', + type: 'input', + component: 'Input', + colProps: { span: 16 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请输入名称', + maxlength: null, + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: false, + allowClear: false, + showLabel: true, + required: true, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: { width: '100%' } + } }, - dicOptions: [], - required: false, - rules: [], - events: {}, - isShow: true, - itemId: '1978057078528327681', - style: { width: '100%' }, - }, - }, - { - key: 'e15f5901160a49e9969fdd7d61e00053', - field: 'note', - label: '备注', - type: 'textarea', - component: 'InputTextArea', - colProps: { span: 24 }, - defaultValue: '', - componentProps: { - width: '100%', - span: '', - defaultValue: '', - labelWidthMode: 'fix', - labelFixWidth: 120, - responsive: false, - respNewRow: true, - placeholder: '请输入备注', - maxlength: null, - rows: 4, - autoSize: false, - showCount: false, - disabled: false, - showLabel: true, - allowClear: false, - required: false, - isShow: true, - rules: [], - events: {}, - style: { width: '100%' }, - }, - }, - ], - showActionButtonGroup: false, - buttonLocation: 'center', - actionColOptions: { span: 24 }, - showResetButton: false, - showSubmitButton: false, - hiddenComponent: [], -}; \ No newline at end of file + { + key: '0dcc7f43f9e34f1b87cc2f730417b3e0', + field: 'shortName', + label: '简称', + type: 'input', + component: 'Input', + colProps: { span: 8 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请输入简称', + maxlength: null, + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: false, + allowClear: true, + showLabel: true, + required: true, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: { width: '100%' } + } + }, + { + field: 'regionCode', + label: '所属国家和地区', + type: 'cascader', + 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, + placeholder: '请选择', + maxlength: null, + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: false, + allowClear: false, + showLabel: true, + required: false, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: { width: '100%' } + } + }, + { + key: 'cd46b163fa8345809ab5d579d96f40f2', + field: 'capacity', + label: '吞吐量', + type: 'number', + component: 'InputNumber', + colProps: { span: 8 }, + defaultValue: null, + componentProps: { + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + width: '100%', + span: '', + 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.0001, + maxlength: '', + disabled: false, + showLabel: true, + controls: true, + required: false, + subTotal: false, + isShow: true, + rules: [], + events: {}, + style: { width: '100%' } + } + }, + { + key: '16e52805d5334759be1d2f40d517efa6', + field: 'longitude', + label: '连线经度', + type: 'number', + component: 'InputNumber', + colProps: { span: 8 }, + defaultValue: null, + componentProps: { + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + width: '100%', + precision: '2', + span: '', + defaultValue: null, + min: null, + max: null, + step: 0.01, + maxlength: 2, + disabled: false, + showLabel: true, + controls: true, + required: false, + subTotal: false, + isShow: true, + rules: [], + events: {}, + style: { width: '100%' } + } + }, + { + key: '6b1a921de60d4676be79074cefe0327a', + field: 'latitude', + label: '连线纬度', + type: 'number', + component: 'InputNumber', + colProps: { span: 8 }, + defaultValue: null, + componentProps: { + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + precision: '2', + + width: '100%', + span: '', + defaultValue: null, + min: null, + max: null, + step: 0.01, + maxlength: 2, + disabled: false, + showLabel: true, + controls: true, + required: false, + subTotal: false, + isShow: true, + rules: [], + events: {}, + style: { width: '100%' } + } + }, + { + key: '68e573db83d941efb9a5687f84726b6b', + field: 'limit1', + label: '限制1', + type: 'textarea', + component: 'InputTextArea', + colProps: { span: 24 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: true, + placeholder: '请输入限制1', + maxlength: null, + rows: 4, + autoSize: false, + showCount: true, + disabled: false, + showLabel: true, + allowClear: false, + required: false, + isShow: true, + rules: [], + events: {}, + style: { width: '100%' } + } + }, + { + key: '34c007fd1d9544ecb3a5ecea5d7f7b1b', + field: 'limit2', + label: '限制2', + type: 'textarea', + component: 'InputTextArea', + colProps: { span: 24 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: true, + placeholder: '请输入限制2', + maxlength: null, + rows: 4, + autoSize: false, + showCount: true, + disabled: false, + showLabel: true, + allowClear: false, + required: false, + isShow: true, + rules: [], + events: {}, + style: { width: '100%' } + } + }, + { + key: '9099e3d919a64dfe860719c34fcaf37d', + field: 'limit3', + label: '限制3', + type: 'textarea', + component: 'InputTextArea', + colProps: { span: 24 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: true, + placeholder: '请输入限制3', + maxlength: null, + rows: 4, + autoSize: false, + showCount: true, + disabled: false, + showLabel: true, + allowClear: false, + required: false, + isShow: true, + rules: [], + events: {}, + style: { width: '100%' } + } + }, + { + key: '16fbe387e5c6471b9be06524f4766f10', + field: 'limit4', + label: '限制4', + type: 'textarea', + component: 'InputTextArea', + colProps: { span: 24 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: true, + placeholder: '请输入限制4', + maxlength: null, + rows: 4, + autoSize: false, + showCount: true, + disabled: false, + showLabel: true, + allowClear: false, + required: false, + isShow: true, + rules: [], + events: {}, + style: { width: '100%' } + } + }, + { + key: 'ef6536972cc54e21b09b4f5637730d0b', + field: 'sort', + label: '显示顺序', + type: 'number', + component: 'InputNumber', + colProps: { span: 8 }, + defaultValue: null, + componentProps: { + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + width: '100%', + span: '', + defaultValue: null, + min: 0, + max: null, + step: 1, + maxlength: '', + disabled: false, + showLabel: true, + controls: true, + required: false, + subTotal: false, + isShow: true, + rules: [], + events: {}, + style: { width: '100%' } + } + }, + { + key: '03f1a079e8544b77a793460306207f41', + field: 'valid', + label: '有效标志', + type: 'select', + component: 'XjrSelect', + colProps: { span: 8 }, + componentProps: { + width: '100%', + span: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: false, + placeholder: '请选择有效标志', + sepTextField: '', + showLabel: true, + showSearch: false, + clearable: false, + disabled: true, + mode: 'multiple', + staticOptions: [ + { key: 1, label: 'Option 1', value: 'Option 1' }, + { key: 2, label: 'Option 2', value: 'Option 2' }, + { key: 3, label: 'Option 3', value: 'Option 3' } + ], + defaultSelect: null, + datasourceType: 'dic', + params: { itemId: '1978057078528327681' }, + labelField: 'name', + valueField: 'value', + apiConfig: { + path: 'CodeGeneration/selection', + method: 'GET', + apiId: '93d735dcb7364a0f8102188ec4d77ac7' + }, + dicOptions: [], + required: false, + rules: [], + events: {}, + isShow: true, + itemId: '1978057078528327681', + style: { width: '100%' } + } + }, + { + key: 'e15f5901160a49e9969fdd7d61e00053', + field: 'note', + label: '备注', + type: 'textarea', + component: 'InputTextArea', + colProps: { span: 24 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: false, + respNewRow: true, + placeholder: '请输入备注', + maxlength: null, + rows: 4, + autoSize: false, + showCount: false, + disabled: false, + showLabel: true, + allowClear: false, + required: false, + isShow: true, + rules: [], + events: {}, + style: { width: '100%' } + } + } + ], + showActionButtonGroup: false, + buttonLocation: 'center', + actionColOptions: { span: 24 }, + showResetButton: false, + showSubmitButton: false, + hiddenComponent: [] +}; diff --git a/src/views/mdm/Port/index.vue b/src/views/mdm/Port/index.vue index cbc607d..e6bc5b5 100644 --- a/src/views/mdm/Port/index.vue +++ b/src/views/mdm/Port/index.vue @@ -1,356 +1,353 @@ \ No newline at end of file + :deep(.ant-table-selection-col) { + width: 50px; + } + .show { + display: flex; + } + .hide { + display: none !important; + } +