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
00b73e2a
authored
2024-12-31 09:19:05 +0800
by
xukangle
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: 规则配置上移下移
1 parent
a0632be9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
19 deletions
src/views/data_inventory/configureRules.vue
src/views/data_inventory/configureRules.vue
View file @
00b73e2
...
...
@@ -53,10 +53,10 @@ onMounted(async () => {
const
tableData1
=
ref
([
{
databaseChName
:
router
.
currentRoute
.
value
.
query
.
databaseChName
,
tableName
:
router
.
currentRoute
.
value
.
query
.
tableName
,
tableChName
:
router
.
currentRoute
.
value
.
query
.
tableChName
,
description
:
router
.
currentRoute
.
value
.
query
.
description
,
databaseChName
:
router
.
currentRoute
.
value
.
query
.
databaseChName
||
'--'
,
tableName
:
router
.
currentRoute
.
value
.
query
.
tableName
||
'--'
,
tableChName
:
router
.
currentRoute
.
value
.
query
.
tableChName
||
'--'
,
description
:
router
.
currentRoute
.
value
.
query
.
description
||
'--'
,
},
])
// 表格数据
...
...
@@ -87,7 +87,7 @@ const moveUp = () => {
return
;
}
selectedRows
.
value
.
forEach
((
row
:
any
)
=>
{
const
index
=
tableData
.
value
.
findIndex
((
item
)
=>
item
.
guid
===
row
.
guid
);
const
index
=
tableData
.
value
.
findIndex
((
item
)
=>
item
.
tableData
===
row
.
tableData
);
if
(
index
>
0
)
{
[
tableData
.
value
[
index
-
1
],
tableData
.
value
[
index
]]
=
[
tableData
.
value
[
index
],
...
...
@@ -105,7 +105,7 @@ const moveDown = () => {
}
// 倒序遍历选中行
[...
selectedRows
.
value
].
reverse
().
forEach
((
row
:
any
)
=>
{
const
index
=
tableData
.
value
.
findIndex
((
item
)
=>
item
.
guid
===
row
.
guid
);
const
index
=
tableData
.
value
.
findIndex
((
item
)
=>
item
.
tableData
===
row
.
tableData
);
if
(
index
<
tableData
.
value
.
length
-
1
)
{
[
tableData
.
value
[
index
],
tableData
.
value
[
index
+
1
]]
=
[
tableData
.
value
[
index
+
1
],
...
...
@@ -114,6 +114,30 @@ const moveDown = () => {
}
});
};
// 删除行
const
deleteRow
=
(
index
)
=>
{
// confirm 弹窗
proxy
.
$confirm
(
'是否删除该行数据?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}).
then
(()
=>
{
tableData
.
value
.
splice
(
index
,
1
)
}).
catch
(()
=>
{
proxy
.
$message
({
type
:
'info'
,
message
:
'已取消删除'
});
});
}
// 批量删除功能
const
batchDelete
=
()
=>
{
selectedRows
.
value
.
forEach
((
row
:
any
)
=>
{
const
index
=
tableData
.
value
.
findIndex
((
item
)
=>
item
.
tableData
===
row
.
tableData
);
if
(
index
!==
-
1
)
tableData
.
value
.
splice
(
index
,
1
);
});
selectedRows
.
value
=
[];
};
// 编辑行
const
editRow
=
(
row
)
=>
{
...
...
@@ -141,19 +165,6 @@ const saveRow = (row) => {
}
row
.
isEdit
=
false
}
// 删除行
const
deleteRow
=
(
index
)
=>
{
tableData
.
value
.
splice
(
index
,
1
)
}
// 批量删除功能
const
batchDelete
=
()
=>
{
selectedRows
.
value
.
forEach
((
row
:
any
)
=>
{
const
index
=
tableData
.
value
.
findIndex
((
item
)
=>
item
.
id
===
row
.
id
);
if
(
index
!==
-
1
)
tableData
.
value
.
splice
(
index
,
1
);
});
selectedRows
.
value
=
[];
};
const
data
=
[
{
value
:
'1'
,
...
...
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