feat: 一键编辑标签下渠道重定向

This commit is contained in:
CalciumIon
2024-11-19 01:42:46 +08:00
parent 807385d3d1
commit 6e6e390f6f
3 changed files with 15 additions and 11 deletions

View File

@@ -691,7 +691,7 @@ const ChannelsTable = () => {
}
setSearching(true);
const res = await API.get(
`/api/channel/search?keyword=${searchKeyword}&group=${searchGroup}&model=${searchModel}`
`/api/channel/search?keyword=${searchKeyword}&group=${searchGroup}&model=${searchModel}&id_sort=${idSort}`
);
const { success, message, data } = res.data;
if (success) {

View File

@@ -8,7 +8,8 @@ const EditTagModal = (props) => {
const [loading, setLoading] = useState(false);
const originInputs = {
tag: '',
newTag: null,
new_tag: null,
model_mapping: null,
}
const [inputs, setInputs] = useState(originInputs);
@@ -18,11 +19,13 @@ const EditTagModal = (props) => {
let data = {
tag: tag,
}
let shouldSave = true;
if (inputs.newTag === tag) {
setLoading(false);
return;
}
if (inputs.model_mapping !== null) {
data.model_mapping = inputs.model
}
data.newTag = inputs.newTag;
if (data.newTag === '') {
Modal.confirm({
@@ -80,8 +83,8 @@ const EditTagModal = (props) => {
<TextInput
label="新标签(留空则解散标签,不会删除标签下的渠道)"
name="newTag"
value={inputs.newTag}
onChange={(value) => setInputs({ ...inputs, newTag: value })}
value={inputs.new_tag}
onChange={(value) => setInputs({ ...inputs, new_tag: value })}
placeholder="请输入新标签"
/>
</Spin>