Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4e2368f8
authored
Nov 30, 2024
by
Calcium-Ion
Committed by
GitHub
Nov 30, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #586 from Calcium-Ion/channel-tag
fix: tag channel copy
parents
20483652
bc6c7ea1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
10 deletions
+18
-10
web/src/components/ChannelsTable.js
+18
-10
No files found.
web/src/components/ChannelsTable.js
View file @
4e2368f8
...
@@ -317,7 +317,7 @@ const ChannelsTable = () => {
...
@@ -317,7 +317,7 @@ const ChannelsTable = () => {
position
=
{
'left'
}
position
=
{
'left'
}
onConfirm
=
{()
=>
{
onConfirm
=
{()
=>
{
manageChannel
(
record
.
id
,
'delete'
,
record
).
then
(()
=>
{
manageChannel
(
record
.
id
,
'delete'
,
record
).
then
(()
=>
{
removeRecord
(
record
.
id
);
removeRecord
(
record
);
});
});
}}
}}
>
>
...
@@ -365,7 +365,7 @@ const ChannelsTable = () => {
...
@@ -365,7 +365,7 @@ const ChannelsTable = () => {
okType
=
{
'danger'
}
okType
=
{
'danger'
}
position
=
{
'left'
}
position
=
{
'left'
}
onConfirm
=
{
async
()
=>
{
onConfirm
=
{
async
()
=>
{
copySelectedChannel
(
record
.
id
);
copySelectedChannel
(
record
);
}}
}}
>
>
<
Button
theme
=
"light"
type
=
"primary"
style
=
{{
marginRight
:
1
}}
>
<
Button
theme
=
"light"
type
=
"primary"
style
=
{{
marginRight
:
1
}}
>
...
@@ -441,10 +441,21 @@ const ChannelsTable = () => {
...
@@ -441,10 +441,21 @@ const ChannelsTable = () => {
const
[
showEditPriority
,
setShowEditPriority
]
=
useState
(
false
);
const
[
showEditPriority
,
setShowEditPriority
]
=
useState
(
false
);
const
removeRecord
=
(
i
d
)
=>
{
const
removeRecord
=
(
recor
d
)
=>
{
let
newDataSource
=
[...
channels
];
let
newDataSource
=
[...
channels
];
if
(
id
!=
null
)
{
if
(
record
.
id
!=
null
)
{
let
idx
=
newDataSource
.
findIndex
((
data
)
=>
data
.
id
===
id
);
let
idx
=
newDataSource
.
findIndex
((
data
)
=>
{
if
(
data
.
children
!==
undefined
)
{
for
(
let
i
=
0
;
i
<
data
.
children
.
length
;
i
++
)
{
if
(
data
.
children
[
i
].
id
===
record
.
id
)
{
data
.
children
.
splice
(
i
,
1
);
return
false
;
}
}
}
else
{
return
data
.
id
===
record
.
id
}
});
if
(
idx
>
-
1
)
{
if
(
idx
>
-
1
)
{
newDataSource
.
splice
(
idx
,
1
);
newDataSource
.
splice
(
idx
,
1
);
...
@@ -566,11 +577,8 @@ const ChannelsTable = () => {
...
@@ -566,11 +577,8 @@ const ChannelsTable = () => {
setLoading
(
false
);
setLoading
(
false
);
};
};
const
copySelectedChannel
=
async
(
id
)
=>
{
const
copySelectedChannel
=
async
(
record
)
=>
{
const
channelToCopy
=
channels
.
find
(
const
channelToCopy
=
record
(
channel
)
=>
String
(
channel
.
id
)
===
String
(
id
)
);
console
.
log
(
channelToCopy
);
channelToCopy
.
name
+=
'_复制'
;
channelToCopy
.
name
+=
'_复制'
;
channelToCopy
.
created_time
=
null
;
channelToCopy
.
created_time
=
null
;
channelToCopy
.
balance
=
0
;
channelToCopy
.
balance
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment