diff --git a/package/components/SchemaComponents/SchemaJson.js b/package/components/SchemaComponents/SchemaJson.js
index e48e80f..1084b65 100644
--- a/package/components/SchemaComponents/SchemaJson.js
+++ b/package/components/SchemaComponents/SchemaJson.js
@@ -29,6 +29,8 @@ import LocaleProvider from '../LocalProvider/index.js';
import utils from '../../utils';
import MockSelect from '../MockSelect/index.js';
+
+// 添加字段类型是字段还是数组
const mapping = (name, data, showEdit, showAdv) => {
switch (data.type) {
case 'array':
@@ -43,6 +45,7 @@ const mapping = (name, data, showEdit, showAdv) => {
}
};
+
class SchemaArray extends PureComponent {
constructor(props, context) {
super(props);
@@ -220,6 +223,10 @@ SchemaArray.contextTypes = {
isMock: PropTypes.bool
};
+
+
+
+// 内容Schema
class SchemaItem extends PureComponent {
constructor(props, context) {
super(props);
@@ -312,6 +319,43 @@ class SchemaItem extends PureComponent {
this.Model.addFieldAction({ prefix, name });
};
+
+ // 向上
+ handleUpItem = () => {
+ const { prefix, name, data } = this.props;
+ let nameArray = this.getPrefix();
+ let requiredArr = data.required;
+ let itemIndex = requiredArr.indexOf(name);
+ console.log(prefix);
+ console.log(data.required);
+ console.log(data.properties);
+
+ if(itemIndex === 0){
+ return false;
+ }
+
+ this.Model.upItemAction({ key: nameArray });
+ // this.Model.enableRequireAction({ prefix, name, up:true }); // required:true
+ }
+
+ // 向下
+ handleDownItem = () => {
+ const { prefix, name, data } = this.props;
+ let nameArray = this.getPrefix();
+ let requiredArr = data.required;
+ let itemIndex = requiredArr.indexOf(name);
+ let len = requiredArr.length;
+ console.log(prefix);
+ console.log(data.required)
+ console.log(data.properties);
+
+ if(itemIndex === len-1){
+ return false;
+ }
+
+ this.Model.downItemAction({ key: nameArray });
+ }
+
// 控制三角形按钮
handleClickIcon = () => {
let prefix = this.getPrefix();
@@ -341,7 +385,7 @@ class SchemaItem extends PureComponent {
@@ -376,7 +420,6 @@ class SchemaItem extends PureComponent {
-