fix(数据集): 删除包含计算字段的节点报错

This commit is contained in:
dataeaseShu
2025-06-13 09:26:32 +08:00
committed by xuwei-fit2cloud
parent 175bdb59b7
commit 36bcc92508
7 changed files with 10 additions and 10 deletions

View File

@@ -40,7 +40,7 @@ const setNameIdTrans = (from, to, originName, name2Auto?: string[]) => {
pre[next[from]] = next[to]
return pre
}, {})
const on = originName.match(/\[(.+?)\]/g)
const on = originName.match(/\[(.+?)\]/g) || []
if (on) {
on.forEach(itm => {
const ele = itm.slice(1, -1)

View File

@@ -370,7 +370,7 @@ const jumpTargetAdaptor = () => {
const assignment = content => {
if (content) {
const on = content?.match(/\[(.+?)\]/g)
const on = content?.match(/\[(.+?)\]/g) || []
if (on) {
const thresholdStyleInfo = conditionAdaptor(state.viewDataInfo)
on.forEach(itm => {

View File

@@ -660,7 +660,7 @@ export function setIdValueTrans(from, to, content, colList) {
pre[next[from]] = next[to]
return pre
}, {})
const on = content?.match(/\[(.+?)\]/g)
const on = content?.match(/\[(.+?)\]/g) || []
if (on) {
on.forEach(itm => {
const ele = itm.slice(1, -1)

View File

@@ -81,7 +81,7 @@ const setNameIdTrans = (from, to, originName, name2Auto?: string[]) => {
pre[next[from]] = next[to]
return pre
}, {})
const on = originName.match(/\[(.+?)\]/g)
const on = originName.match(/\[(.+?)\]/g) || []
if (on) {
on.forEach(itm => {
const ele = itm.slice(1, -1)

View File

@@ -140,7 +140,7 @@ const setNameIdTrans = (from, to, originName, name2Auto?: string[]) => {
pre[next[from]] = next[to]
return pre
}, {})
const on = originName.match(/\[(.+?)\]/g)
const on = originName.match(/\[(.+?)\]/g) || []
if (on) {
on.forEach(itm => {
const ele = itm.slice(1, -1)

View File

@@ -374,7 +374,7 @@ const confirmEditUnion = () => {
if (!!ids.length) {
const idArr = allfields.value.reduce((pre, next) => {
if (next.extField === 2) {
let idMap = next.originName.match(/\[(.+?)\]/g)
let idMap = next.originName.match(/\[(.+?)\]/g) || []
idMap = idMap.filter(
itx => !next.params?.map(element => element.id).includes(itx.slice(1, -1))
)
@@ -462,7 +462,7 @@ const handleCommand = (ele, command) => {
if (!!fakeDelId.length) {
const idArr = allfields.value.reduce((pre, next) => {
if (next.extField === 2) {
const idMap = next.originName.match(/\[(.+?)\]/g)
const idMap = next.originName.match(/\[(.+?)\]/g) || []
const result = idMap.map(itm => {
return itm.slice(1, -1)
})

View File

@@ -493,7 +493,7 @@ const delFieldById = arr => {
const allfieldsId = allfields.value.map(ele => ele.id).concat(paramsId)
allfields.value = allfields.value.filter(ele => {
if (![2, 3].includes(ele.extField)) return true
const idMap = ele.originName.match(/\[(.+?)\]/g)
const idMap = ele.originName.match(/\[(.+?)\]/g) || []
if (!idMap) return true
const result = idMap.every(itm => {
const id = itm.slice(1, -1)
@@ -518,7 +518,7 @@ const delFieldByIdFake = (arr, fakeAllfields) => {
const allfieldsId = fakeAllfields.map(ele => ele.id)
fakeAllfields = fakeAllfields.filter(ele => {
if (![2, 3].includes(ele.extField)) return true
const idMap = ele.originName.match(/\[(.+?)\]/g)
const idMap = ele.originName.match(/\[(.+?)\]/g) || []
if (
!idMap ||
idMap.every(itx => ele.params?.map(element => element.id).includes(itx.slice(1, -1)))
@@ -971,7 +971,7 @@ const confirmEditUnion = () => {
if (!!idList.length) {
const idArr = allfields.value.reduce((pre, next) => {
if (idList.includes(next.id)) {
const idMap = next.originName.match(/\[(.+?)\]/g)
const idMap = next.originName.match(/\[(.+?)\]/g) || []
const result = idMap.map(itm => {
return itm.slice(1, -1)
})