Browse Source

解决页面初始化时编辑器图片覆盖新闻大图

dev01 2 years ago
parent
commit
604ea4725c
2 changed files with 16 additions and 13 deletions
  1. 15 12
      js/component/administration/business/firmList.jsx
  2. 1 1
      package.json

+ 15 - 12
js/component/administration/business/firmList.jsx

@@ -392,6 +392,7 @@ const FirmList = Form.create()(
       });
       this.edit(record);
     },
+
     edit(record, index) {
       this.setState({
         editvisible: true,
@@ -415,14 +416,7 @@ const FirmList = Form.create()(
               id: thisdata.id,
               title: thisdata.title,
               publisher: thisdata.publisher,
-              type: thisdata.type,
-              pictureUrl: thisdata.pictureUrl
-                ? splitUrl(
-                  thisdata.pictureUrl,
-                  ",",
-                  globalConfig.avatarUploadHost
-                )
-                : [],
+              type: thisdata.type, 
               sort: thisdata.sort,
               keywords: thisdata.keywords,
               editorcontext: thisdata.content,
@@ -431,9 +425,11 @@ const FirmList = Form.create()(
                 ? thisdata.releaseTimeConvert
                 : thisdata.createTimeConvert,
             });
-            // window.setTimeout(() => {
-            //   console.log(this.state);
-            // }, 100);
+            window.setTimeout(() => {
+              this.setState({
+                pictureUrl: thisdata.pictureUrl ? splitUrl(thisdata.pictureUrl, ",", globalConfig.avatarUploadHost) : [],
+              })
+            }, 100);
           }
         }.bind(this),
       }).always(
@@ -444,9 +440,11 @@ const FirmList = Form.create()(
         }.bind(this)
       );
     },
+
     getOrgCodeUrl(e) {
       this.setState({ pictureUrl: e });
     },
+
     // 新增新闻
     addNew(flag) {
       let theorgCodeUrl = [];
@@ -907,7 +905,7 @@ const FirmList = Form.create()(
                     <FormItem
                       labelCol={{ span: 4 }}
                       wrapperCol={{ span: 18 }}
-                      label="企业简介"
+                      label="企业简介0"
                     >
                       <Editors
                         textContent={this.state.editorcontext}
@@ -927,7 +925,12 @@ const FirmList = Form.create()(
                           this.setState({
                             editorcontext: value,
                           });
+                          console.log("")
                           if (srcArr.length > 0) {
+                            // 复制过来的图片可能带https前缀
+                            if (srcArr[0].indexOf("http") != -1) {
+                              return
+                            }
                             let purl = srcArr[0].replace(globalConfig.avatarUploadHost, "")
                             if (splitUrl(purl, ",", globalConfig.avatarUploadHost) == this.state.pictureUrl) {
                               return

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "afanti",
-  "version": "1.0.10",
+  "version": "1.0.11",
   "description": "",
   "main": "index.js",
   "scripts": {