Browse Source

修复富文本样式错误

HW 4 years ago
parent
commit
90a51d879e

+ 7 - 4
js/component/administration/authentication/techDemand.less

@@ -19,7 +19,7 @@
         .ant-switch {
             margin-left: 10px;
         }
-        
+
         .search-more {
             margin: 10px 0;
             span {
@@ -38,8 +38,8 @@
 
 }
  .breakWord  span {
-    word-break: break-all;  
-    word-wrap: break-word; 
+    word-break: break-all;
+    word-wrap: break-word;
     white-space: pre-wrap;
 }
 button:focus,button:active{
@@ -111,4 +111,7 @@ button:focus,button:active{
     }
 }
 .a{border: 1px solid;}
-.newsImg{width: 150px;}
+.newsImg{width: 150px;}
+.ql-editor{
+    height: 400px!important;
+}

+ 0 - 1
js/component/administration/business/advertisementList.jsx

@@ -159,7 +159,6 @@ const AdvertisementList = Form.create()(
         maximg: "",
         timesArr: [],
         locations: [],
-        locationSearch:'',
         indeterminate:false,
         pagination: {
           defaultCurrent: 1,

+ 4 - 10
js/component/administration/business/firmList.jsx

@@ -15,20 +15,11 @@ import {
   Modal,
   Upload,
   Popconfirm,
-  Cascader,
-  InputNumber,
-  Radio,
-  TimePicker,
   Tabs,
   Tag, Checkbox, Tooltip
 } from "antd";
-import { areaSelect, getProvince } from "@/NewDicProvinceList"; //省市区
 import {
-  getGameState,
   splitUrl,
-  getprovince,
-  getStatuslist,
-  getLvl,
   beforeUploadFile,
   getPicPath
 } from "@/tools.js";
@@ -42,7 +33,7 @@ const PicturesWall = React.createClass({
     return {
       previewVisible: false,
       previewImage: "",
-      fileList: this.props.pictureUrl,
+      fileList: [],
     };
   },
   getDefaultProps() {
@@ -65,6 +56,9 @@ const PicturesWall = React.createClass({
     this.props.fileList(fileList);
   },
   componentWillReceiveProps(nextProps) {
+    this.setState({
+      fileList: nextProps.pictureUrl
+    })
   },
   render() {
     const { previewVisible, previewImage, fileList } = this.state;

+ 16 - 9
js/component/richTextEditors.jsx

@@ -27,9 +27,9 @@ function uploadImg(s) {
             } else {
                 const cursorPosition = s.quill.getSelection().index
                 s.quill.insertEmbed(
-                  cursorPosition,
-                  "image",
-                  globalConfig.avatarUploadHost + data.data
+                    cursorPosition,
+                    "image",
+                    globalConfig.avatarUploadHost + data.data
                 );
                 s.quill.setSelection(cursorPosition + 1)
             };
@@ -104,10 +104,10 @@ const Editors = React.createClass({
         RichTextUploadSign = this.props.uploadSign;
     },
     componentWillReceiveProps(nextProps) {
-            this.state.theBool = true;
-            // if(nextProps.textContent){
-                this.state.value = nextProps.textContent || '';
-            // }
+        this.state.theBool = true;
+        // if(nextProps.textContent){
+        this.state.value = nextProps.textContent || '';
+        // }
     },
     render() {
         const modules = {
@@ -140,9 +140,16 @@ const Editors = React.createClass({
         ];
         return (
             <div>
-                <ReactQuill theme="snow" value={this.state.value} modules={modules} formats={formats} placeholder='请填写内容!' onChange={this.handleRichText} />
+                <ReactQuill
+                    theme="snow"
+                    value={this.state.value}
+                    modules={modules}
+                    formats={formats}
+                    placeholder='请填写内容!'
+                    onChange={this.handleRichText}
+                />
                 <input type="file" name="fileToUpload" id="fileToUpload" placeholder='请填写内容!' style={{ "display": "none" }} />
-                 <input type="file" name="fileToUploadVideo" id="fileToUploadVideo" placeholder='请填写视频!' style={{ "display": "none" }} />
+                <input type="file" name="fileToUploadVideo" id="fileToUploadVideo" placeholder='请填写视频!' style={{ "display": "none" }} />
             </div>
         )
     },

+ 1 - 1
package.json

@@ -58,7 +58,7 @@
     "prop-types": "^15.5.10",
     "react": "^15.4.1",
     "react-dom": "^15.4.1",
-    "react-quill": "^1.0.0",
+    "react-quill": "1.1.0",
     "react-router-dom": "^4.2.2"
   }
 }

+ 8 - 16
yarn.lock

@@ -30,13 +30,6 @@
     lodash "^4.17.19"
     to-fast-properties "^2.0.0"
 
-"@types/quill@1.3.10":
-  version "1.3.10"
-  resolved "https://registry.yarnpkg.com/@types/quill/-/quill-1.3.10.tgz#dc1f7b6587f7ee94bdf5291bc92289f6f0497613"
-  integrity sha512-IhW3fPW+bkt9MLNlycw8u8fWb7oO7W5URC9MfZYHBlA24rex9rs23D5DETChu1zvgVdc5ka64ICjJOgQMr6Shw==
-  dependencies:
-    parchment "^1.1.2"
-
 abab@^1.0.0:
   version "1.0.4"
   resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e"
@@ -2677,7 +2670,7 @@ file-loader@^0.10.1:
   dependencies:
     loader-utils "^1.0.2"
 
-"file-saver@github:eligrey/FileSaver.js#1.3.8":
+file-saver@eligrey/FileSaver.js#1.3.8:
   version "1.3.8"
   resolved "https://codeload.github.com/eligrey/FileSaver.js/tar.gz/e865e37af9f9947ddcced76b549e27dc45c1cb2e"
 
@@ -4705,7 +4698,7 @@ param-case@2.1.x:
   dependencies:
     no-case "^2.2.0"
 
-parchment@^1.1.2, parchment@^1.1.4:
+parchment@^1.1.4:
   version "1.1.4"
   resolved "https://registry.yarnpkg.com/parchment/-/parchment-1.1.4.tgz#aeded7ab938fe921d4c34bc339ce1168bc2ffde5"
   integrity sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==
@@ -5341,7 +5334,7 @@ quill-delta@^3.6.2:
     extend "^3.0.2"
     fast-diff "1.1.2"
 
-quill@^1.3.7:
+quill@^1.2.6:
   version "1.3.7"
   resolved "https://registry.yarnpkg.com/quill/-/quill-1.3.7.tgz#da5b2f3a2c470e932340cdbf3668c9f21f9286e8"
   integrity sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==
@@ -5833,16 +5826,15 @@ react-lifecycles-compat@^3.0.4:
   resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
   integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==
 
-react-quill@^1.0.0:
-  version "1.3.5"
-  resolved "https://registry.yarnpkg.com/react-quill/-/react-quill-1.3.5.tgz#8c4ad759da03365b17c79c6c52afa9772259844e"
-  integrity sha512-/W/rNCW+6QpGz8yQ9tFK5Ka/h/No1RqrcOOvCIOR092OiKzRFlU2xbPEwiP3Wgy/Dx13pi1YhjReDMX/5uotJg==
+react-quill@1.1.0:
+  version "1.1.0"
+  resolved "https://registry.yarnpkg.com/react-quill/-/react-quill-1.1.0.tgz#348dbd36252607fd31cad140f1c95e969da18d53"
+  integrity sha1-NI29NiUmB/0xytFA8clelp2hjVM=
   dependencies:
-    "@types/quill" "1.3.10"
     create-react-class "^15.6.0"
     lodash "^4.17.4"
     prop-types "^15.5.10"
-    quill "^1.3.7"
+    quill "^1.2.6"
     react-dom-factories "^1.0.0"
 
 react-router-dom@^4.2.2: