mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
删除类别。
This commit is contained in:
parent
09ea17cfb6
commit
eaffe01f48
@ -643,5 +643,6 @@
|
||||
"Cannot deserialize scene data.": "无法解析场景数据!",
|
||||
"Total {{totalPage}} Pages": "共{{totalPage}}页",
|
||||
"Create": "添加",
|
||||
"Please select a record.": "请选择数据"
|
||||
"Please select a record.": "请选择数据",
|
||||
"Delete this category?": "是否删除该类别?"
|
||||
}
|
||||
@ -108,7 +108,33 @@ class CategoryWindow extends React.Component {
|
||||
}
|
||||
|
||||
handleDelete() {
|
||||
const { selected } = this.state;
|
||||
|
||||
if (!selected) {
|
||||
app.toast(_t('Please select a record.'));
|
||||
return;
|
||||
}
|
||||
|
||||
app.confirm({
|
||||
title: _t('Query'),
|
||||
content: _t('Delete this category?'),
|
||||
onOK: () => {
|
||||
fetch(`${app.options.server}/api/Category/Delete?ID=${selected.ID}`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
}).then(response => {
|
||||
response.json().then(json => {
|
||||
if (json.Code === 200) {
|
||||
this.updateUI();
|
||||
} else {
|
||||
app.toast(json.Msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
handleSelect(obj) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user