Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
csbr-daop
/
fe-data-trusted-space
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
b288dae2
authored
2025-01-09 23:25:03 +0800
by
xukangle
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix
1 parent
858dbda3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
src/views/data_inventory/configureRules.vue
src/views/data_inventory/configureRules.vue
View file @
b288dae
...
...
@@ -185,12 +185,12 @@ const tempRowData = ref<any>([]);
// 编辑行
const
editRow
=
(
row
)
=>
{
//
console.log('编辑:', row);
//
//
暂存编辑前的数据 用于取消编辑时恢复原始数据,先判断是否已经暂存过tempRowData通过fieldGuid
//
if (!tempRowData.value.find((item) => item.fieldGuid === row.fieldGuid)) {
//
tempRowData.value.push({ ...row });
//
}
console
.
log
(
'编辑:'
,
row
);
// 暂存编辑前的数据 用于取消编辑时恢复原始数据,先判断是否已经暂存过tempRowData通过fieldGuid
if
(
!
tempRowData
.
value
.
find
((
item
)
=>
item
.
fieldGuid
===
row
.
fieldGuid
))
{
tempRowData
.
value
.
push
({
...
row
});
}
console
.
log
(
'tempRowData:'
,
tempRowData
.
value
);
// console.log('tempRowData:', tempRowData.value);
// if (row.fieldLengthCondition) {
// const arr = row.fieldLengthCondition.split('#'); // 按 '#' 分割
...
...
@@ -404,9 +404,20 @@ const cancel = () => {
// 点击取消
const
cancelEdit
=
(
row
)
=>
{
// console.log('取消编辑:', row, tempRowData.value);
// // 可在此恢复原始数据逻辑,要查找暂存的数据 tempRowData 中 fieldGuid 与当前行的 fieldGuid 相同的数据
// const tempRow = tempRowData.value.find((item) => item.fieldGuid === row.fieldGuid);
// Object.assign(row, tempRow);
// 可在此恢复原始数据逻辑,要查找暂存的数据 tempRowData 中 fieldGuid 与当前行的 fieldGuid 相同的数据
const
tempRow
=
tempRowData
.
value
.
find
((
item
)
=>
item
.
fieldGuid
===
row
.
fieldGuid
);
// 遍历tableData.value,找到当前行并恢复原始数据
tableData
.
value
.
forEach
((
item
)
=>
{
if
(
item
.
fieldGuid
===
tempRow
.
fieldGuid
)
{
// 恢复原始数据
row
.
fieldLengthCondition
=
item
.
fieldLengthCondition
;
row
.
fieldPrecision
=
item
.
fieldPrecision
;
row
.
isUnique
=
item
.
isUnique
;
row
.
notNull
=
item
.
notNull
;
row
.
fieldValueRange
=
item
.
fieldValueRange
;
}
});
row
.
isEdit
=
false
;
// 退出编辑状态
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment