From 21c4c065d8be9a02686e56b7aca5ea6e448829ac Mon Sep 17 00:00:00 2001 From: biybuy <1368735060@qq.com> Date: Mon, 3 Nov 2025 19:39:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=89=8D=E7=AB=AF=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vite/deps/_metadata.json | 8 + .vite/deps/package.json | 3 + .../api/InterfaceServices/systemInterface.ts | 17 + src/api/InterfaceServices/index.ts | 2 + src/api/InterfaceServices/interface.ts | 108 +++ .../serviceProviderInterface.ts | 42 +- src/api/InterfaceServices/systemInterface.ts | 42 +- src/components/ModalForm/index.vue | 19 +- src/views/demo/interface-config.vue | 8 +- src/views/interface/config.vue | 8 +- .../components/entrance-arguments-map.vue | 77 +- .../components/exit-arguments-map.vue | 6 +- .../system/interface/config/form-config.ts | 95 ++- src/views/system/interface/index.vue | 60 +- .../system/interface/interface-config.vue | 32 +- src/views/system/newList/adhibition-list.vue | 78 +- .../system/newList/createApplication.vue | 4 +- .../ServiceProviderInterfaceModal.vue | 34 +- .../serviceProvidersList/comps/Entering.vue | 5 +- .../comps/ReturnConfig.vue | 10 +- .../system/serviceProvidersList/index.vue | 20 + .../system/serviceProvidersList/new-port.vue | 8 +- .../trajectoryMapping/Pull.vue | 692 ++++++++++++------ .../trajectoryMapping/Push.vue | 105 ++- 24 files changed, 1072 insertions(+), 411 deletions(-) create mode 100644 .vite/deps/_metadata.json create mode 100644 .vite/deps/package.json create mode 100644 itfx-front/src/api/InterfaceServices/systemInterface.ts create mode 100644 src/api/InterfaceServices/interface.ts diff --git a/.vite/deps/_metadata.json b/.vite/deps/_metadata.json new file mode 100644 index 0000000..f06e37d --- /dev/null +++ b/.vite/deps/_metadata.json @@ -0,0 +1,8 @@ +{ + "hash": "756e9009", + "configHash": "5e7a16b4", + "lockfileHash": "134c49f5", + "browserHash": "c06415c9", + "optimized": {}, + "chunks": {} +} \ No newline at end of file diff --git a/.vite/deps/package.json b/.vite/deps/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/.vite/deps/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/itfx-front/src/api/InterfaceServices/systemInterface.ts b/itfx-front/src/api/InterfaceServices/systemInterface.ts new file mode 100644 index 0000000..c4b3d13 --- /dev/null +++ b/itfx-front/src/api/InterfaceServices/systemInterface.ts @@ -0,0 +1,17 @@ +// @ts-ignore +/* eslint-disable */ +// Backwards-compat shims for previously generated SystemInterface module +// Map old function names to the new ones generated in `./interface` + +export { + // 获取接口明细(旧名:getInterfaceGetSystemInterfaceById) + getInterfaceGetInterfaceById as getInterfaceGetSystemInterfaceById, + // 获取接口下拉(旧名:getInterfaceGetSystemInterfaceDropdownList) + getInterfaceGetInterfaceDropdownList as getInterfaceGetSystemInterfaceDropdownList, + // 接口分页列表(旧名:postInterfaceSystemInterfacePaginatedList) + postInterfaceInterfacePaginatedList as postInterfaceSystemInterfacePaginatedList, + // 批量删除接口(旧名:postInterfaceBatchDeleteSystemInterfaceByIds) + postInterfaceBatchDeleteInterfaceByIds as postInterfaceBatchDeleteSystemInterfaceByIds, + // 保存接口(旧名:postInterfaceSaveSystemInterface) + postInterfaceSaveInterface as postInterfaceSaveSystemInterface, +} from './interface'; diff --git a/src/api/InterfaceServices/index.ts b/src/api/InterfaceServices/index.ts index 68fc2ab..ea6de9e 100644 --- a/src/api/InterfaceServices/index.ts +++ b/src/api/InterfaceServices/index.ts @@ -6,9 +6,11 @@ import * as interfaceCategory from './interfaceCategory'; import * as interfaceReturnConfig from './interfaceReturnConfig'; import * as serviceProviderInterface from './serviceProviderInterface'; import * as systemInterface from './systemInterface'; +import * as interfaceApi from './interface'; export default { interfaceCategory, interfaceReturnConfig, serviceProviderInterface, systemInterface, + interface: interfaceApi, }; diff --git a/src/api/InterfaceServices/interface.ts b/src/api/InterfaceServices/interface.ts new file mode 100644 index 0000000..cbee3ee --- /dev/null +++ b/src/api/InterfaceServices/interface.ts @@ -0,0 +1,108 @@ +// @ts-ignore +/* eslint-disable */ +import request from '@/utils/request'; + +/** 批量删除接口 POST /Interface/BatchDeleteInterfaceByIds */ +export async function postInterfaceBatchDeleteInterfaceByIds( + // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) + params: API.postInterfaceBatchDeleteInterfaceByIdsParams, + body: number[], + options?: { [key: string]: any } +) { + return request(`api/Interface/BatchDeleteInterfaceByIds`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json-patch+json', + }, + params: { + ...params, + }, + data: body, + ...(options || {}), + }); +} + +/** 获取接口明细 GET /Interface/GetInterfaceById */ +export async function getInterfaceGetInterfaceById( + // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) + params: API.getInterfaceGetInterfaceByIdParams, + options?: { [key: string]: any } +) { + return request(`api/Interface/GetInterfaceById`, { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 获取接口下拉列表 GET /Interface/GetInterfaceDropdownList */ +export async function getInterfaceGetInterfaceDropdownList( + // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) + params: API.getInterfaceGetInterfaceDropdownListParams, + options?: { [key: string]: any } +) { + return request( + `api/Interface/GetInterfaceDropdownList`, + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + } + ); +} + +/** 接口树形列表 POST /Interface/GetInterfaceTreeListAsync */ +export async function postInterfaceGetInterfaceTreeListAsync( + body: API.InterfaceTreeListInputObjectValue, + options?: { [key: string]: any } +) { + return request( + `api/Interface/GetInterfaceTreeListAsync`, + { + method: 'POST', + headers: { + 'Content-Type': 'application/json-patch+json', + }, + data: body, + ...(options || {}), + } + ); +} + +/** 接口分页列表 POST /Interface/InterfacePaginatedList */ +export async function postInterfaceInterfacePaginatedList( + body: API.InterfacePaginatedInputObjectValue, + options?: { [key: string]: any } +) { + return request( + `api/Interface/InterfacePaginatedList`, + { + method: 'POST', + headers: { + 'Content-Type': 'application/json-patch+json', + }, + data: body, + ...(options || {}), + } + ); +} + +/** 保存接口 用OptionType来区分操作目的,1:新增,2:删除,3:修改 +
tips:新增时,参数id由调用者伪造,以表现层级关系,不能小于1,你必须真实的表达id和pid的关系 POST /Interface/SaveInterface */ +export async function postInterfaceSaveInterface( + body: API.SaveInterfaceInput, + options?: { [key: string]: any } +) { + return request(`api/Interface/SaveInterface`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json-patch+json', + }, + data: body, + ...(options || {}), + }); +} diff --git a/src/api/InterfaceServices/serviceProviderInterface.ts b/src/api/InterfaceServices/serviceProviderInterface.ts index cb21960..91525c2 100644 --- a/src/api/InterfaceServices/serviceProviderInterface.ts +++ b/src/api/InterfaceServices/serviceProviderInterface.ts @@ -2,32 +2,33 @@ /* eslint-disable */ import request from '@/utils/request'; -/** 批量删除服务商接口 POST /Interface/BatchDeleteServiceProviderInterfaceByIds */ +/** 批量删除服务商接口(切换至通用删除接口) POST /Interface/BatchDeleteInterfaceByIds */ export async function postInterfaceBatchDeleteServiceProviderInterfaceByIds( body: number[], options?: { [key: string]: any } ) { return request( - `api/Interface/BatchDeleteServiceProviderInterfaceByIds`, + `api/Interface/BatchDeleteInterfaceByIds`, { method: 'POST', headers: { 'Content-Type': 'application/json-patch+json', }, + params: { isUpstream: false }, data: body, ...(options || {}), } ); } -/** 获取服务商接口明细 GET /Interface/GetServiceProviderInterfaceById */ +/** 获取服务商接口明细(已切换至通用接口明细) GET /Interface/GetInterfaceById */ export async function getInterfaceGetServiceProviderInterfaceById( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) params: API.getInterfaceGetServiceProviderInterfaceByIdParams, options?: { [key: string]: any } ) { - return request( - `api/Interface/GetServiceProviderInterfaceById`, + return request( + `api/Interface/GetInterfaceById`, { method: 'GET', params: { @@ -73,36 +74,35 @@ export async function postInterfaceGetServiceProviderInterfaceTreeListAsync( }); } -/** 保存服务商接口 用OptionType来区分操作目的,1:新增,2:删除,3:修改 -
tips:新增时,参数id由调用者伪造,以表现层级关系,不能小于1,你必须真实的表达id和pid的关系 POST /Interface/SaveServiceProviderInterface */ +/** 保存服务商接口(已切换至通用保存接口) 用OptionType来区分操作目的,1:新增,2:删除,3:修改 +
tips:新增时,参数id由调用者伪造,以表现层级关系,不能小于1,你必须真实的表达id和pid的关系 POST /Interface/SaveInterface */ export async function postInterfaceSaveServiceProviderInterface( body: API.ServiceProviderInterfaceInput, options?: { [key: string]: any } ) { - return request(`api/Interface/SaveServiceProviderInterface`, { + return request(`api/Interface/SaveInterface`, { method: 'POST', headers: { 'Content-Type': 'application/json-patch+json', }, - data: body, + // 透传原有参数,并强制 isUpstream = false + data: { ...(body as any), isUpstream: false }, ...(options || {}), }); } -/** 服务商接口分页列表 POST /Interface/ServiceProviderInterfacePaginatedList */ +/** 服务商接口分页列表(已切换至通用接口列表) POST /Interface/InterfacePaginatedList */ export async function postInterfaceServiceProviderInterfacePaginatedList( body: API.ServiceProviderInterfacePaginatedInputObjectValue, options?: { [key: string]: any } ) { - return request( - `api/Interface/ServiceProviderInterfacePaginatedList`, - { - method: 'POST', - headers: { - 'Content-Type': 'application/json-patch+json', - }, - data: body, - ...(options || {}), - } - ); + return request(`api/Interface/InterfacePaginatedList`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json-patch+json', + }, + // 透传原有查询条件,并强制 isUpstream = false + data: { ...(body as any), isUpstream: false }, + ...(options || {}), + }); } diff --git a/src/api/InterfaceServices/systemInterface.ts b/src/api/InterfaceServices/systemInterface.ts index 8a683c6..517c93e 100644 --- a/src/api/InterfaceServices/systemInterface.ts +++ b/src/api/InterfaceServices/systemInterface.ts @@ -2,29 +2,30 @@ /* eslint-disable */ import request from '@/utils/request'; -/** 批量删除系统接口 POST /Interface/BatchDeleteSystemInterfaceByIds */ +/** 批量删除系统接口(切换至通用删除接口) POST /Interface/BatchDeleteInterfaceByIds */ export async function postInterfaceBatchDeleteSystemInterfaceByIds( body: number[], options?: { [key: string]: any } ) { - return request(`api/Interface/BatchDeleteSystemInterfaceByIds`, { + return request(`api/Interface/BatchDeleteInterfaceByIds`, { method: 'POST', headers: { 'Content-Type': 'application/json-patch+json', }, + params: { isUpstream: true }, data: body, ...(options || {}), }); } -/** 获取系统接口明细 GET /Interface/GetSystemInterfaceById */ +/** 获取系统接口明细(已切换至通用接口明细) GET /Interface/GetInterfaceById */ export async function getInterfaceGetSystemInterfaceById( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) params: API.getInterfaceGetSystemInterfaceByIdParams, options?: { [key: string]: any } ) { - return request( - `api/Interface/GetSystemInterfaceById`, + return request( + `api/Interface/GetInterfaceById`, { method: 'GET', params: { @@ -66,36 +67,35 @@ export async function postInterfaceGetSystemInterfaceTreeListAsync( ); } -/** 保存系统接口 用OptionType来区分操作目的,1:新增,2:删除,3:修改 -
注意!新增时,参数id由调用者伪造,以表现层级关系,不能小于1,你必须真实的表达id和pid的关系 POST /Interface/SaveSystemInterface */ +/** 保存系统接口(已切换至通用保存接口) 用OptionType来区分操作目的,1:新增,2:删除,3:修改 +
注意!新增时,参数id由调用者伪造,以表现层级关系,不能小于1,你必须真实的表达id和pid的关系 POST /Interface/SaveInterface */ export async function postInterfaceSaveSystemInterface( body: API.SystemInterfaceInput, options?: { [key: string]: any } ) { - return request(`api/Interface/SaveSystemInterface`, { + return request(`api/Interface/SaveInterface`, { method: 'POST', headers: { 'Content-Type': 'application/json-patch+json', }, - data: body, + // 透传原有参数,并强制 isUpstream = true + data: { ...(body as any), isUpstream: true }, ...(options || {}), }); } -/** 系统接口分页列表 POST /Interface/SystemInterfacePaginatedList */ +/** 系统接口分页列表(已切换至通用接口列表) POST /Interface/InterfacePaginatedList */ export async function postInterfaceSystemInterfacePaginatedList( body: API.SystemInterfacePaginatedInputObjectValue, options?: { [key: string]: any } ) { - return request( - `api/Interface/SystemInterfacePaginatedList`, - { - method: 'POST', - headers: { - 'Content-Type': 'application/json-patch+json', - }, - data: body, - ...(options || {}), - } - ); + return request(`api/Interface/InterfacePaginatedList`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json-patch+json', + }, + // 透传原有查询条件,并强制 isUpstream = true + data: { ...(body as any), isUpstream: true }, + ...(options || {}), + }); } diff --git a/src/components/ModalForm/index.vue b/src/components/ModalForm/index.vue index a154d51..d36779d 100644 --- a/src/components/ModalForm/index.vue +++ b/src/components/ModalForm/index.vue @@ -41,7 +41,10 @@ }; }, }, - + beforeSubmit: { + type: Function as PropType<(data: any) => any>, + default: null, + }, }); const formRef = ref(null); @@ -145,7 +148,13 @@ console.log(formValue, 'formValue'); // 清理表单数据,避免空字符串传递给API - const cleanedFormValue = cleanFormData(formValue); + let cleanedFormValue = cleanFormData(formValue); + + // 如果有beforeSubmit钩子,执行数据转换 + if (props.beforeSubmit && isFunction(props.beforeSubmit)) { + cleanedFormValue = props.beforeSubmit(cleanedFormValue) || cleanedFormValue; + } + const form = { ...formData.value, ...cleanedFormValue }; const { addApi, editApi, apiParams } = props; @@ -207,7 +216,11 @@
- + + +
diff --git a/src/views/demo/interface-config.vue b/src/views/demo/interface-config.vue index d9213b1..5cc9b42 100644 --- a/src/views/demo/interface-config.vue +++ b/src/views/demo/interface-config.vue @@ -6,10 +6,8 @@ import { Message, Modal } from '@arco-design/web-vue'; import { cloneDeep, random } from 'lodash'; import FormPro from '@/components/FormPro/index.vue'; - import { - getInterfaceGetServiceProviderInterfaceById, - postInterfaceSaveServiceProviderInterface, - } from '@/api/InterfaceServices/serviceProviderInterface'; + import { getInterfaceGetInterfaceById } from '@/api/InterfaceServices/interface'; + import { postInterfaceSaveServiceProviderInterface } from '@/api/InterfaceServices/serviceProviderInterface'; import type { InterfaceParameterOutputValueObject, ServiceProviderInterfaceInput, @@ -550,7 +548,7 @@ const getInterfaceDetail = async (id: number) => { try { loading.value = true; - const res = await getInterfaceGetServiceProviderInterfaceById({ id }); + const res = await getInterfaceGetInterfaceById({ id }); if (res) { Object.assign(tableForm, { interfaceName: res.name || '', diff --git a/src/views/interface/config.vue b/src/views/interface/config.vue index e672d2e..e626f83 100644 --- a/src/views/interface/config.vue +++ b/src/views/interface/config.vue @@ -12,10 +12,8 @@ import { postParameterParse, postParameterValidateParameter, } from '@/api/ParameterServices/parameter'; -import { - getInterfaceGetSystemInterfaceById, - postInterfaceSaveSystemInterface, -} from '@/api/InterfaceServices/systemInterface'; +import { getInterfaceGetInterfaceById } from '@/api/InterfaceServices/interface'; +import { postInterfaceSaveSystemInterface } from '@/api/InterfaceServices/systemInterface'; import { getDictionaryGetList } from '@/api/ApplicationServices/dictionary'; import { paramColumns } from './config/interface-config'; @@ -204,7 +202,7 @@ const init = async () => { flag.value = true; } - const { data } = await getInterfaceGetSystemInterfaceById({ id }); + const { data } = await getInterfaceGetInterfaceById({ id }); // Set form data Object.assign(formData, data); diff --git a/src/views/system/interface/components/entrance-arguments-map.vue b/src/views/system/interface/components/entrance-arguments-map.vue index cd0cc6a..1a965bf 100644 --- a/src/views/system/interface/components/entrance-arguments-map.vue +++ b/src/views/system/interface/components/entrance-arguments-map.vue @@ -4,7 +4,9 @@ import { IconDragDotVertical } from '@arco-design/web-vue/es/icon'; import Sortable from 'sortablejs'; import XEUtils from 'xe-utils'; - import { getInterfaceGetSystemInterfaceById } from '@/api/InterfaceServices/systemInterface'; + import { ref, reactive, nextTick, onMounted } from 'vue'; + import { useRouter } from 'vue-router'; + import { getInterfaceGetInterfaceById } from '@/api/InterfaceServices/interface'; import { getParameterGetParameterList, @@ -22,7 +24,7 @@ import TablePro from '@/components/TablePro/index.vue'; import ModalPro from '@/components/ModalPro/index.vue'; import SelectPro from '@/components/SelectPro/index.vue'; - import { translateTitle as t } from '@/utils/i18n'; + import { useI18n } from 'vue-i18n'; import { entrancePrarm, exitPrarm, @@ -31,6 +33,7 @@ const $modal = Modal; const $message = Message; + const { t } = useI18n(); defineOptions({ name: 'EntranceArgumentsMap', @@ -135,7 +138,7 @@ editConfig: { trigger: 'click', mode: 'row' }, showIndex: false, }, - data: [], + data: [] as any[], }); const dialogTableRules = ref({ name: [ @@ -248,7 +251,7 @@ async function getInterfaceGetSystemInterface() { const id = Number(props.addId); - const { data } = (await getInterfaceGetSystemInterfaceById({ + const { data } = (await getInterfaceGetInterfaceById({ id: id || Number(props.upStreamId), })) as unknown as TypeAs; dialogTableProps.data = data.inParameterList; @@ -257,7 +260,7 @@ // onMounted(async () => { // const id = Number(props.addId) - // const { data } = (await getInterfaceGetSystemInterfaceById({ + // const { data } = (await getInterfaceGetInterfaceById({ // id: id || Number(props.upStreamId), // })) as unknown as TypeAs // dialogTableProps.data = data.inParameterList @@ -327,17 +330,17 @@ type CommonParameterInputType = API.ParameterInput & { id: number }; dialogTableRef.value?.validate().then(async (res: boolean) => { if (res) { - registerMethods.changeOkLoading(true); + (registerMethods as any).changeOkLoading(true); let fc = cloneDeep(dialogTableProps.data) as CommonParameterInputType[]; parameterList.value.forEach((item: any) => { const idx = fc.findIndex((i) => i.id === item.id); if (idx > -1) fc[idx] = item; else fc.push(item); - if (backSort.value?.length) { - const index = backSort.value?.findIndex((i) => i.id === item.id); + if (backSortArr?.length) { + const index = backSortArr?.findIndex((i) => i.id === item.id); console.log(item, 'index'); - if (index > -1) backSort.value[index].optionType = item?.optionType; + if (index > -1) backSortArr[index].optionType = item?.optionType; } }); fc.forEach((el: any) => { @@ -345,7 +348,7 @@ el.children = undefined; el._X_ROW_CHILD = undefined; }); - backSort.value.forEach((el: any) => { + backSortArr.forEach((el: any) => { el.Id = undefined; el.children = undefined; el._X_ROW_CHILD = undefined; @@ -358,15 +361,15 @@ isRequired: !!item.isRequired, }; }); - const { code } = await postParameterSave({ + const { code } = (await postParameterSave({ isInPara: true, interfaceId: props.interfaceMapId ? Number(props.upStreamId) : Number(props.addId), parameterList: isIDReturn(props.id, fc).outParameterList, - }); + })) as any; if (code === '200') { - registerMethods.changeOkLoading(false); + (registerMethods as any).changeOkLoading(false); $message.success('保存成功'); savePort(isIDReturn(props.id, fc).outParameterList); dialogVisible.value = false; @@ -376,7 +379,7 @@ getInterfaceGetSystemInterface(); tableRef.value?.reload(); } else { - registerMethods.changeOkLoading(false); + (registerMethods as any).changeOkLoading(false); $message.error('保存失败'); } } @@ -401,11 +404,11 @@ function isIDReturn(id: any, fc: any[]) { if (id) { return { - outParameterList: backSort.value.length ? backSort.value : fc.reverse(), + outParameterList: backSortArr.length ? backSortArr : fc.reverse(), }; } return { - outParameterList: fc.length ? fc.reverse() : backSort.value, + outParameterList: fc.length ? fc.reverse() : backSortArr, }; } @@ -429,8 +432,8 @@ if ( tableRef.value ?.getTableData() - .tableData.some( - (node) => node.isRequired === true && !node.mapId && !node.fixedValue + .tableData.some( + (node: any) => node.isRequired === true && !node.mapId && !node.fixedValue ) ) return $message.error( @@ -438,7 +441,7 @@ ); // const arr: Array = [] - tableRef.value?.getTableData().tableData.forEach((item) => { + tableRef.value?.getTableData().tableData.forEach((item: any) => { const obj: Indexable = {}; obj.interfaceMapDetailId = item.interfaceMapDetailId; obj.mappedParaId = item.mapId; @@ -569,7 +572,7 @@ let sortable: any = null; // 参数拖拽 // 返回参数排序 - const backSort = ref([]); + let backSortArr: any[] = []; function restore( wrapperElem: any, targetTrElem: any, @@ -594,7 +597,7 @@ function isDraggedDown(targetTrElem: any, alternativeTrElem: any) { const targetTrElemId = targetTrElem.getAttribute('rowid'); const alternativeTrElemId = alternativeTrElem.getAttribute('rowid'); - const treeArray = XEUtils.toTreeArray(dialogTableProps.data); // 按先序遍历输出树节点(与表格中从上到下行的排列顺序一致) + const treeArray = XEUtils.toTreeArray(dialogTableProps.data) as any[]; // 按先序遍历输出树节点(与表格中从上到下行的排列顺序一致) return treeArray.some((value, index) => { // 若targetTrElem拖拽前在alternativeTrElem之前(即向下拖拽),返回true if ( @@ -666,7 +669,7 @@ console.log(tableTreeData, 'tableTreeData'); const targetRowNode = xTable?.getRowNode(targetTrElem); const selfRow = targetRowNode?.item; - const selfNode = XEUtils.findTree( + const selfNode: any = XEUtils.findTree( tableTreeData, (row) => row === selfRow, options @@ -678,14 +681,14 @@ const prevRow = prevRowNode?.item; let preTrElemIsOnSameLevelWidthTargetTrElemBeforeMove = false; - const preNode = xe.findTree( + const preNode: any = xe.findTree( tableTreeData, (row) => { return row.id === Number(prevTrElem.getAttribute('rowid')); }, options ); - const preRow = preNode?.item; + const preRow: any = preNode?.item; console.log(selfRow, 'selfRow'); console.log(preRow, 'preRow'); if (selfRow?.pId === preRow?.pId || selfRow?.pId === preRow?.id) @@ -717,7 +720,7 @@ const ac = tableTreeData.find((i) => i.id === pidData.id); selfNode.items.unshift(selfRow); // 在数组头部新增节点 ac.children = []; - selfNode.items.forEach((item) => { + selfNode.items.forEach((item: any) => { ac.children.push(item); }); console.log(selfNode.items, 'selfNode.itemsselfNode.items'); @@ -747,7 +750,7 @@ let nextTrElemIsOnSameLevelWidthTargetTrElemBeforeMove = true; console.log(nextTrElem, 'nextTrElem'); if (nextTrElem) { - const nextNode = xe.findTree( + const nextNode: any = xe.findTree( tableTreeData, (row) => { return ( @@ -756,7 +759,7 @@ }, options ); - const nextRow = nextNode.item; + const nextRow: any = nextNode.item; console.log(nextRow, 'nextRow'); console.log(selfRow, 'selfRow'); console.log(prevRow, 'prevRow'); @@ -795,7 +798,7 @@ while (oldIndex < wrapperElem.children.length) { const trElem = wrapperElem.children[oldIndex]; const isSiblingNodes = selfNode.items.some( - (value) => value.id === trElem.getAttribute('rowid') + (value: any) => value.id === trElem.getAttribute('rowid') ); if (isSiblingNodes) { // 如果当前节点是节点拖拽前的兄弟节点,说明子节点已经全部访问完了, 停止迭代 @@ -824,18 +827,18 @@ const newArr = tableTreeData?.filter((item) => !item.pId) || []; // console.log(newArr, 'asdasddsa') // console.log(flattenArray(newArr)) - // backSort.value = flattenArray(newArr) + // backSortArr = flattenArray(newArr) // 如果变动了树层级,需要刷新数据 dialogTableProps.data = [...flattenArray(newArr)]; setTimeout(() => { - backSort.value = flattenArray(newArr).map((item) => { + backSortArr = (flattenArray(newArr).map((item: any) => { return { ...item, sort: getRowSeq(item, dialogTableRef.value), }; - }); + }) as any[]); - console.log(backSort.value); + console.log(backSortArr); }, 300); }, } @@ -1065,6 +1068,7 @@ display: flex; justify-content: space-between; width: 100%; + margin-bottom: 12px; } .main-box { @@ -1080,4 +1084,13 @@ .cursor-move { cursor: move; } + + /* 提升上下行的垂直间距,避免行与行过于贴近 */ + :deep(.vxe-table .vxe-body--row > td) { + padding-top: 8px !important; + padding-bottom: 8px !important; + } + :deep(.vxe-table .vxe-body--row) { + height: 44px !important; + } diff --git a/src/views/system/interface/components/exit-arguments-map.vue b/src/views/system/interface/components/exit-arguments-map.vue index abe1934..1129de8 100644 --- a/src/views/system/interface/components/exit-arguments-map.vue +++ b/src/views/system/interface/components/exit-arguments-map.vue @@ -1,7 +1,7 @@