Roxas 4 years ago
parent
commit
b429321569

+ 1
- 1
lib/components/AudioPlayer/index.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
lib/components/Editor/Upload.js.map
File diff suppressed because it is too large
View File


+ 13
- 2
lib/components/Editor/index.js View File

129
       value: props.value || "", // 编辑器里面的值
129
       value: props.value || "", // 编辑器里面的值
130
       fileList: props.fileList || [], // 图片列表
130
       fileList: props.fileList || [], // 图片列表
131
       fileMap: {}, // 已经上传的图片路径和 uid 的映射 { uid: path }
131
       fileMap: {}, // 已经上传的图片路径和 uid 的映射 { uid: path }
132
-      uploadVisible: false
132
+      uploadVisible: false // 上传图片弹窗是否可视
133
     };
133
     };
134
     _this.handleChange = _this.handleChange.bind(_this);
134
     _this.handleChange = _this.handleChange.bind(_this);
135
     _this.handleClickEmoji = _this.handleClickEmoji.bind(_this);
135
     _this.handleClickEmoji = _this.handleClickEmoji.bind(_this);
150
     value: function componentDidMount() {
150
     value: function componentDidMount() {
151
       var _props = this.props,
151
       var _props = this.props,
152
           app = _props.app,
152
           app = _props.app,
153
-          onRef = _props.onRef;
153
+          onRef = _props.onRef,
154
+          uploadDefaultShow = _props.uploadDefaultShow;
154
 
155
 
155
       if (app.currentUser && (app.currentUser.user_id > 0 || app.currentUser.id > 0)) {
156
       if (app.currentUser && (app.currentUser.user_id > 0 || app.currentUser.id > 0)) {
156
         app.sOssSts();
157
         app.sOssSts();
158
       if ((0, _helper.isFunction)(onRef)) {
159
       if ((0, _helper.isFunction)(onRef)) {
159
         onRef(this);
160
         onRef(this);
160
       }
161
       }
162
+      if (uploadDefaultShow) {
163
+        var uploadFileList = this.props.fileList || this.state.fileList;
164
+        if (uploadFileList.length > 0) {
165
+          this.setState({
166
+            uploadVisible: true
167
+          });
168
+        }
169
+      }
161
     }
170
     }
162
   }, {
171
   }, {
163
     key: "handleEmojiScroll",
172
     key: "handleEmojiScroll",
666
   button: _propTypes2.default.node,
675
   button: _propTypes2.default.node,
667
   emojiToolIcon: _propTypes2.default.node,
676
   emojiToolIcon: _propTypes2.default.node,
668
   imageToolIcon: _propTypes2.default.node,
677
   imageToolIcon: _propTypes2.default.node,
678
+  uploadDefaultShow: _propTypes2.default.bool,
669
   showError: _propTypes2.default.bool,
679
   showError: _propTypes2.default.bool,
670
   onError: _propTypes2.default.func,
680
   onError: _propTypes2.default.func,
671
   maxLength: _propTypes2.default.number,
681
   maxLength: _propTypes2.default.number,
680
   // placeholder: "说点什么吧",
690
   // placeholder: "说点什么吧",
681
   showEmoji: true,
691
   showEmoji: true,
682
   showUpload: true,
692
   showUpload: true,
693
+  uploadDefaultShow: true,
683
   multiple: true,
694
   multiple: true,
684
   emojiPopoverPlacement: "bottomLeft",
695
   emojiPopoverPlacement: "bottomLeft",
685
   closeUploadWhenBlur: false,
696
   closeUploadWhenBlur: false,

+ 1
- 1
lib/components/Editor/index.js.map
File diff suppressed because it is too large
View File


+ 2
- 1
package.json View File

16
   "dependencies": {
16
   "dependencies": {
17
     "antd": "^3.19.3",
17
     "antd": "^3.19.3",
18
     "axios": "^0.18.0",
18
     "axios": "^0.18.0",
19
+    "babel-plugin-transform-class-properties": "^6.24.1",
19
     "dayjs": "^1.8.25",
20
     "dayjs": "^1.8.25",
20
     "js-cookie": "^2.2.0",
21
     "js-cookie": "^2.2.0",
21
     "prop-types": "^15.6.2",
22
     "prop-types": "^15.6.2",
42
     "lib": "babel ./src --out-dir ./lib --source-maps --copy-files"
43
     "lib": "babel ./src --out-dir ./lib --source-maps --copy-files"
43
   },
44
   },
44
   "devDependencies": {
45
   "devDependencies": {
45
-    "cross-env": "^5.2.0",
46
     "babel-cli": "^6.26.0",
46
     "babel-cli": "^6.26.0",
47
     "babel-plugin-import": "^1.8.0",
47
     "babel-plugin-import": "^1.8.0",
48
     "babel-plugin-transform-object-rest-spread": "^6.26.0",
48
     "babel-plugin-transform-object-rest-spread": "^6.26.0",
49
     "babel-preset-env": "^1.7.0",
49
     "babel-preset-env": "^1.7.0",
50
     "babel-preset-es2015": "^6.24.1",
50
     "babel-preset-es2015": "^6.24.1",
51
     "babel-preset-react": "^6.24.1",
51
     "babel-preset-react": "^6.24.1",
52
+    "cross-env": "^5.2.0",
52
     "husky": "^0.14.3",
53
     "husky": "^0.14.3",
53
     "lint-staged": "^7.2.0",
54
     "lint-staged": "^7.2.0",
54
     "node-sass": "^4.9.4",
55
     "node-sass": "^4.9.4",