From 26b5f3c696a44400abb2d10a0c7e8ded4638c00a Mon Sep 17 00:00:00 2001
From: tengge1 <930372551@qq.com>
Date: Mon, 8 Jul 2019 20:27:46 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E9=9D=A2=E6=9D=BF=E6=94=B9?=
=?UTF-8?q?=E7=89=88=E5=AE=8C=E6=88=90=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ShadowEditor.Web/src/Application.js | 11 ++++++++++-
.../src/editor2/assets/AnimationPanel.jsx | 14 ++++++++++++++
ShadowEditor.Web/src/editor2/assets/AudioPanel.jsx | 14 ++++++++++++++
.../src/editor2/assets/CharacterPanel.jsx | 1 +
ShadowEditor.Web/src/editor2/assets/MapPanel.jsx | 14 ++++++++++++++
.../src/editor2/assets/MaterialPanel.jsx | 1 +
ShadowEditor.Web/src/editor2/assets/ModelPanel.jsx | 7 ++++++-
.../src/editor2/assets/ParticlePanel.jsx | 1 +
.../src/editor2/assets/PrefabPanel.jsx | 1 +
9 files changed, 62 insertions(+), 2 deletions(-)
diff --git a/ShadowEditor.Web/src/Application.js b/ShadowEditor.Web/src/Application.js
index 42749723..c72f28a1 100644
--- a/ShadowEditor.Web/src/Application.js
+++ b/ShadowEditor.Web/src/Application.js
@@ -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);
}
diff --git a/ShadowEditor.Web/src/editor2/assets/AnimationPanel.jsx b/ShadowEditor.Web/src/editor2/assets/AnimationPanel.jsx
index 3b3c03d2..4c782b6d 100644
--- a/ShadowEditor.Web/src/editor2/assets/AnimationPanel.jsx
+++ b/ShadowEditor.Web/src/editor2/assets/AnimationPanel.jsx
@@ -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 {
{
+ if (obj.Code === 200) {
+ this.update();
+ }
+ app.toast(obj.Msg);
+ });
+ }
+
// ------------------------------- 编辑 ---------------------------------------
handleEdit(data) {
diff --git a/ShadowEditor.Web/src/editor2/assets/AudioPanel.jsx b/ShadowEditor.Web/src/editor2/assets/AudioPanel.jsx
index 80608172..f2f6508e 100644
--- a/ShadowEditor.Web/src/editor2/assets/AudioPanel.jsx
+++ b/ShadowEditor.Web/src/editor2/assets/AudioPanel.jsx
@@ -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 {
{
+ if (obj.Code === 200) {
+ this.update();
+ }
+ app.toast(obj.Msg);
+ });
+ }
+
// ------------------------------- 编辑 ---------------------------------------
handleEdit(data) {
diff --git a/ShadowEditor.Web/src/editor2/assets/CharacterPanel.jsx b/ShadowEditor.Web/src/editor2/assets/CharacterPanel.jsx
index d1e621ac..9dbc7691 100644
--- a/ShadowEditor.Web/src/editor2/assets/CharacterPanel.jsx
+++ b/ShadowEditor.Web/src/editor2/assets/CharacterPanel.jsx
@@ -45,6 +45,7 @@ class CharacterPanel extends React.Component {
{
+ if (obj.Code === 200) {
+ this.update();
+ }
+ app.toast(obj.Msg);
+ });
+ }
+
// ------------------------------- 编辑 ---------------------------------------
handleEdit(data) {
diff --git a/ShadowEditor.Web/src/editor2/assets/MaterialPanel.jsx b/ShadowEditor.Web/src/editor2/assets/MaterialPanel.jsx
index a6a37af3..1a353c8e 100644
--- a/ShadowEditor.Web/src/editor2/assets/MaterialPanel.jsx
+++ b/ShadowEditor.Web/src/editor2/assets/MaterialPanel.jsx
@@ -45,6 +45,7 @@ class MaterialPanel extends React.Component {
{
+ if (obj.Code === 200) {
+ this.update();
+ }
+ app.toast(obj.Msg);
+ });
}
// ------------------------------- 编辑 ---------------------------------------
diff --git a/ShadowEditor.Web/src/editor2/assets/ParticlePanel.jsx b/ShadowEditor.Web/src/editor2/assets/ParticlePanel.jsx
index 961dca60..f8954012 100644
--- a/ShadowEditor.Web/src/editor2/assets/ParticlePanel.jsx
+++ b/ShadowEditor.Web/src/editor2/assets/ParticlePanel.jsx
@@ -45,6 +45,7 @@ class ParticlePanel extends React.Component {