Bladeren bron

page validation

sunmingan 4 jaren geleden
bovenliggende
commit
a517ea7882

+ 0 - 2
UI/src/components/File/BirdUpload.js

@@ -109,7 +109,6 @@ class BirdUpload extends React.Component {
     let fileArr = [];
     let fileNameMap = self.state.fileNameMap;
     let paths = value.split(',').filter(p => !util.string.isEmpty(p));
-    console.log(this.state)
     fileArr = paths.map((p) => {
       let ext = p.substring(p.lastIndexOf('.'));
       return {
@@ -178,7 +177,6 @@ class BirdUpload extends React.Component {
   }
 
   render() {
-    console.log(this.props.action)
     let fileProps = {
       action: this.props.action || config.api.upload,
       multiple: this.props.multiple,

+ 0 - 1
UI/src/components/Form/AutoField.js

@@ -234,7 +234,6 @@ class AutoField extends React.Component {
         case "imgs":
         case "file":
         case "files":
-          console.log(JSON.stringify(field))
           let fileProps = {
             multiple: field.fieldType === 'imgs' || field.fieldType === 'files',
             disabled: field.disabled,

+ 30 - 25
UI/src/pages/sellmanage/portManagement.js

@@ -37,7 +37,8 @@ class AddminiFans extends Component {
       formOption3: { modal: "", title: "" },
       formOption4: { modal: "", title: "" },
       formOption5: { modal: "", title: "" },
-      formOption6: { modal: "", title: "" }
+      formOption6: { modal: "", title: "" },
+      initValue1: {}
     };
   }
  //点击编辑
@@ -62,8 +63,9 @@ class AddminiFans extends Component {
     });
   }
   /* 弹出框取消事件 */
-  cancelClick() {
+  cancelClick() { 
     this.setState({
+      initValue1: {},
       formVisiable: false,
       formConfirmLoading: false
     });
@@ -133,7 +135,17 @@ class AddminiFans extends Component {
     }).then(function(result) {
       console.log(result)
       if (result.success === 1) {
-        message.success("保存成功");
+        message.success("操作成功");
+
+        // 成功之后
+        self.refs.gridResource.reload();
+        self.setState({
+          formVisiable: false,
+          formConfirmLoading: false,
+          editVisiable: false,
+          editConfirmLoading: false
+        });
+        
       } else {
         if (result.message) {
           message.error(result.message);
@@ -142,15 +154,8 @@ class AddminiFans extends Component {
         }
       }
       if (callback) callback(result);
-      self.setState({
-        formVisiable: false,
-        formConfirmLoading: false,
-        editVisiable: false,
-        editConfirmLoading: false
-      });
       //self.refs.tg.getGrid().reload();
       //self.refs.gridOptionResource.reload();
-      self.refs.gridResource.reload();
     });
   }
   render() {
@@ -228,14 +233,13 @@ class AddminiFans extends Component {
           name: '编辑',
           onClick: (data) => {
             this.changeEdit(data)
-            console.log(data)
-            const fields = [{ title: "端口名称", data: "portName", key:"portName" ,type: "text",  editor: { tips: "填写一个方便记忆的名称,以免公众号/企业微信等同名" },query: true},
+            const fields = [{ title: "端口名称", data: "portName", key:"portName" ,type: "text",  editor: { tips: "填写一个方便记忆的名称,以免公众号/企业微信等同名" , isRequired: true  },query: true},
             { title: "公众号图标",data: "headImg", type: "img",value: WXMpAPI + "/wx/file/upload", editor: { tips: "请上传1:1尺寸的图标",action: WXMpAPI + "/wx/file/upload"}, query: true },
-            { title: "公众号名称",data: "name", type: "text", editor: { tips: "微信公众号名称"}, query: true},
-            { title: "AppID", data: "appId", type: "text", editor: { tips: "微信公众号AppID" }, query: true },
-            { title: "AppSecret", data: "secret", type: "text", editor: { tips: "微信公众号AppSecret" },query: true },
-            { title: "token", data: "token", type: "text", editor: { tips: "微信公众号token" }, query: true },
-            { title: "aesKey", data: "aesKey", type: "text", editor: { tips: "微信公众号aesKey" },query: true }
+            { title: "公众号名称",data: "name", type: "text", editor: { tips: "微信公众号名称" , isRequired: true }, query: true},
+            { title: "AppID", data: "appId", type: "text", editor: { tips: "微信公众号AppID" , isRequired: true }, query: true },
+            { title: "AppSecret", data: "secret", type: "text", editor: { tips: "微信公众号AppSecret" , isRequired: true},query: true },
+            { title: "token", data: "token", type: "text", editor: { tips: "微信公众号token" , isRequired: true}, query: true },
+            { title: "aesKey", data: "aesKey", type: "text", editor: { tips: "微信公众号aesKey" , isRequired: true},query: true }
           ];
           const fields2 = [ { title: "端口名称",data: "text4",type: "text",editor: {},query: true} ];
           const fields3 = [ { title: "端口名称",data: "text5",type: "text",editor: {},query: true},
@@ -267,13 +271,13 @@ class AddminiFans extends Component {
         {
           name: "添加端口",
           onClick: function() {
-            const fields = [{ title: "端口名称", data: "portName", type: "text",  editor: { tips: "填写一个方便记忆的名称,以免公众号/企业微信等同名" },query: true},
+            const fields = [{ title: "端口名称", data: "portName", type: "text",  editor: { tips: "填写一个方便记忆的名称,以免公众号/企业微信等同名",isRequired: true },query: true},
               { title: "公众号图标",data: "headImg", type: "img", editor: { tips: "请上传1:1尺寸的图标",action: WXMpAPI + "/wx/file/upload"}, query: true },
-              { title: "公众号名称",data: "name", type: "text", editor: { tips: "微信公众号名称"}, query: true},
-              { title: "AppID", data: "appId", type: "text", editor: { tips: "微信公众号AppID" }, query: true },
-              { title: "AppSecret", data: "secret", type: "text", editor: { tips: "微信公众号AppSecret" },query: true },
-              { title: "token", data: "token", type: "text", editor: { tips: "微信公众号token" }, query: true },
-              { title: "aesKey", data: "aesKey", type: "text", editor: { tips: "微信公众号aesKey" },query: true }
+              { title: "公众号名称",data: "name", type: "text", editor: { tips: "微信公众号名称" , isRequired: true}, query: true},
+              { title: "AppID", data: "appId", type: "text", editor: { tips: "微信公众号AppID" , isRequired: true }, query: true },
+              { title: "AppSecret", data: "secret", type: "text", editor: { tips: "微信公众号AppSecret" , isRequired: true },query: true },
+              { title: "token", data: "token", type: "text", editor: { tips: "微信公众号token" , isRequired: true }, query: true },
+              { title: "aesKey", data: "aesKey", type: "text", editor: { tips: "微信公众号aesKey" , isRequired: true },query: true }
             ];
             const fields2 = [ { title: "端口名称",data: "text4",type: "text",editor: {},query: true} ];
             const fields3 = [ { title: "端口名称",data: "text5",type: "text",editor: {},query: true},
@@ -284,7 +288,7 @@ class AddminiFans extends Component {
               { title: "通讯录同步",data: "text9",type: "text", editor: {tips: "企业微信后台,“管理工具-通讯录同步”中获取"},query: true},
               { title: "客户信息查询",data: "text10",type: "text",editor: { tips: "企业微信后台,“应用管理-自建-客户信息查询”中获取" }, query: true }
             ];
-            let formOption = { model: "add",title: "添加端口", fields: fields, value: {}, extraParams: [] };
+            let formOption = { model: "add",title: "添加公众号端口", fields: fields, value: {}, extraParams: [] };
             let formOption2 = {  model: "add", title: "基础设置", fields: fields2, value: {}, extraParams: [] };
             let formOption3 = { model: "add", title: "基础设置", fields: fields3, value: {}, extraParams: [] };
             self.setState({
@@ -292,6 +296,7 @@ class AddminiFans extends Component {
               formOption: formOption,
               formOption2: formOption2,
               formOption3: formOption3,
+              initValue1: {"aafd":"asdfas"},
               mode: '0'
             });
           }
@@ -315,7 +320,7 @@ class AddminiFans extends Component {
             this.setState({ type: key });
           }}>
             <TabPane tab="公众号" key="0">
-              <AutoForm formOption={this.state.formOption} ref="autoForm1" />
+              <AutoForm formOption={this.state.formOption} initValue={this.state.initValue1} ref="autoForm1" />
             </TabPane>
             {/**
              <TabPane tab="小程序" key="2">