mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
资源面板改版完成。
This commit is contained in:
parent
17a7c8c36e
commit
26b5f3c696
@ -236,7 +236,16 @@ Application.prototype.upload = function () {
|
||||
input.type = 'file';
|
||||
input.style.display = 'none';
|
||||
input.addEventListener('change', event => {
|
||||
|
||||
Ajax.post(url, {
|
||||
file: event.target.files[0],
|
||||
}, json => {
|
||||
var obj = JSON.parse(json);
|
||||
if (obj.Code === 200) {
|
||||
callback(obj);
|
||||
} else {
|
||||
app.toast(obj.Msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
document.body.appendChild(input);
|
||||
}
|
||||
|
||||
@ -21,6 +21,8 @@ class AnimationPanel extends React.Component {
|
||||
};
|
||||
|
||||
this.handleClick = this.handleClick.bind(this);
|
||||
|
||||
this.handleAdd = this.handleAdd.bind(this);
|
||||
this.handleEdit = this.handleEdit.bind(this);
|
||||
this.handleDelete = this.handleDelete.bind(this);
|
||||
|
||||
@ -45,6 +47,7 @@ class AnimationPanel extends React.Component {
|
||||
<SearchField
|
||||
data={categoryData}
|
||||
placeholder={L_SEARCH_CONTENT}
|
||||
onAdd={this.handleAdd}
|
||||
onInput={this.handleSearch.bind(this)}></SearchField>
|
||||
<ImageList
|
||||
data={imageListData}
|
||||
@ -107,6 +110,17 @@ class AnimationPanel extends React.Component {
|
||||
app.call(`selectAnimation`, this, data);
|
||||
}
|
||||
|
||||
// ------------------------------- 上传 ---------------------------------------
|
||||
|
||||
handleAdd() {
|
||||
app.upload(`${app.options.server}/api/Animation/Add`, obj => {
|
||||
if (obj.Code === 200) {
|
||||
this.update();
|
||||
}
|
||||
app.toast(obj.Msg);
|
||||
});
|
||||
}
|
||||
|
||||
// ------------------------------- 编辑 ---------------------------------------
|
||||
|
||||
handleEdit(data) {
|
||||
|
||||
@ -21,6 +21,8 @@ class AudioPanel extends React.Component {
|
||||
};
|
||||
|
||||
this.handleClick = this.handleClick.bind(this);
|
||||
|
||||
this.handleAdd = this.handleAdd.bind(this);
|
||||
this.handleEdit = this.handleEdit.bind(this);
|
||||
this.handleDelete = this.handleDelete.bind(this);
|
||||
|
||||
@ -45,6 +47,7 @@ class AudioPanel extends React.Component {
|
||||
<SearchField
|
||||
data={categoryData}
|
||||
placeholder={L_SEARCH_CONTENT}
|
||||
onAdd={this.handleAdd}
|
||||
onInput={this.handleSearch.bind(this)}></SearchField>
|
||||
<ImageList
|
||||
data={imageListData}
|
||||
@ -107,6 +110,17 @@ class AudioPanel extends React.Component {
|
||||
app.call(`selectAudio`, this, data);
|
||||
}
|
||||
|
||||
// ------------------------------- 上传 ---------------------------------------
|
||||
|
||||
handleAdd() {
|
||||
app.upload(`${app.options.server}/api/Audio/Add`, obj => {
|
||||
if (obj.Code === 200) {
|
||||
this.update();
|
||||
}
|
||||
app.toast(obj.Msg);
|
||||
});
|
||||
}
|
||||
|
||||
// ------------------------------- 编辑 ---------------------------------------
|
||||
|
||||
handleEdit(data) {
|
||||
|
||||
@ -45,6 +45,7 @@ class CharacterPanel extends React.Component {
|
||||
<SearchField
|
||||
data={categoryData}
|
||||
placeholder={L_SEARCH_CONTENT}
|
||||
addHidden={true}
|
||||
onInput={this.handleSearch.bind(this)}></SearchField>
|
||||
<ImageList
|
||||
data={imageListData}
|
||||
|
||||
@ -20,6 +20,8 @@ class MapPanel extends React.Component {
|
||||
};
|
||||
|
||||
this.handleClick = this.handleClick.bind(this);
|
||||
|
||||
this.handleAdd = this.handleAdd.bind(this);
|
||||
this.handleEdit = this.handleEdit.bind(this);
|
||||
this.handleDelete = this.handleDelete.bind(this);
|
||||
|
||||
@ -43,6 +45,7 @@ class MapPanel extends React.Component {
|
||||
<SearchField
|
||||
data={categoryData}
|
||||
placeholder={L_SEARCH_CONTENT}
|
||||
onAdd={this.handleAdd}
|
||||
onInput={this.handleSearch.bind(this)}></SearchField>
|
||||
<ImageList
|
||||
data={imageListData}
|
||||
@ -105,6 +108,17 @@ class MapPanel extends React.Component {
|
||||
app.call(`selectMap`, this, data);
|
||||
}
|
||||
|
||||
// ------------------------------- 上传 ---------------------------------------
|
||||
|
||||
handleAdd() {
|
||||
app.upload(`${app.options.server}/api/Map/Add`, obj => {
|
||||
if (obj.Code === 200) {
|
||||
this.update();
|
||||
}
|
||||
app.toast(obj.Msg);
|
||||
});
|
||||
}
|
||||
|
||||
// ------------------------------- 编辑 ---------------------------------------
|
||||
|
||||
handleEdit(data) {
|
||||
|
||||
@ -45,6 +45,7 @@ class MaterialPanel extends React.Component {
|
||||
<SearchField
|
||||
data={categoryData}
|
||||
placeholder={L_SEARCH_CONTENT}
|
||||
addHidden={true}
|
||||
onInput={this.handleSearch.bind(this)}></SearchField>
|
||||
<ImageList
|
||||
data={imageListData}
|
||||
|
||||
@ -145,7 +145,12 @@ class ModelPanel extends React.Component {
|
||||
// ------------------------------- 上传 ---------------------------------------
|
||||
|
||||
handleAdd() {
|
||||
|
||||
app.upload(`${app.options.server}/api/Mesh/Add`, obj => {
|
||||
if (obj.Code === 200) {
|
||||
this.update();
|
||||
}
|
||||
app.toast(obj.Msg);
|
||||
});
|
||||
}
|
||||
|
||||
// ------------------------------- 编辑 ---------------------------------------
|
||||
|
||||
@ -45,6 +45,7 @@ class ParticlePanel extends React.Component {
|
||||
<SearchField
|
||||
data={categoryData}
|
||||
placeholder={L_SEARCH_CONTENT}
|
||||
addHidden={true}
|
||||
onInput={this.handleSearch.bind(this)}></SearchField>
|
||||
<ImageList
|
||||
data={imageListData}
|
||||
|
||||
@ -45,6 +45,7 @@ class PrefabPanel extends React.Component {
|
||||
<SearchField
|
||||
data={categoryData}
|
||||
placeholder={L_SEARCH_CONTENT}
|
||||
addHidden={true}
|
||||
onInput={this.handleSearch.bind(this)}></SearchField>
|
||||
<ImageList
|
||||
data={imageListData}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user