clrc-schema
Advanced tools
Comparing version 0.1.7 to 0.1.8
@@ -89,2 +89,5 @@ import './src/index.less'; | ||
}, | ||
pics: { | ||
question_bg: '//cdn.withme.cn/withme.back.u.f05d7566b51608580f4e32dfe8b09661.png' | ||
}, | ||
array: [ | ||
@@ -91,0 +94,0 @@ { |
@@ -72,4 +72,2 @@ 'use strict'; | ||
var files = e.target.files; | ||
console.log(files); | ||
// this._checkSize(files[0]); | ||
_this._uploadFile(files[0]); | ||
@@ -96,3 +94,3 @@ }, _this._checkSize = function (file) { | ||
var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(file) { | ||
var Utils, isSizeRight, uptoken, uploader, res, config, imgConfig; | ||
var Utils, isSizeRight, uptoken, uploader, res; | ||
return _regenerator2.default.wrap(function _callee$(_context) { | ||
@@ -129,14 +127,6 @@ while (1) { | ||
res = _context.sent; | ||
config = this._getBoxSize(); | ||
config.width = Math.floor(config.width); | ||
imgConfig = { | ||
src: '' + Utils.assetsHost + res.key, | ||
w: config.width, | ||
h: config.height | ||
}; | ||
this._loadPic('' + Utils.assetsHost + res.key); | ||
this.refs.img.loadPic(imgConfig); | ||
case 18: | ||
case 15: | ||
case 'end': | ||
@@ -161,5 +151,24 @@ return _context.stop(); | ||
}, { | ||
key: '_loadPic', | ||
value: function _loadPic(imgUrl) { | ||
var config = this._getBoxSize(); | ||
config.width = Math.floor(config.width); | ||
var imgConfig = { | ||
src: imgUrl, | ||
w: config.width, | ||
h: config.height | ||
}; | ||
this.refs.img.loadPic(imgConfig); | ||
} | ||
}, { | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
// this.refs.info.warning('ssssss'); | ||
var _props = this.props; | ||
var data = _props.data; | ||
var schema = _props.schema; | ||
if (data) { | ||
this._loadPic(data); | ||
} | ||
this.refs.info.warning('上传(' + schema.size + ')的图片', '#ddd'); | ||
} | ||
@@ -196,7 +205,7 @@ }, { | ||
var WarningText = Utils.getUI('warning-text'); | ||
var _props = this.props; | ||
var data = _props.data; | ||
var schema = _props.schema; | ||
var tag = _props.tag; | ||
var inline = _props.inline; | ||
var _props2 = this.props; | ||
var data = _props2.data; | ||
var schema = _props2.schema; | ||
var tag = _props2.tag; | ||
var inline = _props2.inline; | ||
@@ -224,3 +233,3 @@ var _getBoxSize2 = this._getBoxSize(); | ||
'span', | ||
{ className: 'layer' }, | ||
{ className: 'layer info-layer' }, | ||
React.createElement( | ||
@@ -227,0 +236,0 @@ 'span', |
@@ -41,4 +41,5 @@ 'use strict'; | ||
key: 'warning', | ||
value: function warning(text) { | ||
this.setState({ _text: text }); | ||
value: function warning(text, color) { | ||
color = color || '#FF4400'; | ||
this.setState({ _text: text, _color: color }); | ||
} | ||
@@ -51,6 +52,10 @@ }, { | ||
var _text = _ref._text; | ||
var _color = _ref._color; | ||
var style = { | ||
color: _color | ||
}; | ||
return React.createElement( | ||
'span', | ||
null, | ||
{ style: style }, | ||
_text | ||
@@ -57,0 +62,0 @@ ); |
{ | ||
"name": "clrc-schema", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "clrc schema", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -10,3 +10,2 @@ import { Component, PropTypes } from 'react'; | ||
_onCopy = index => { | ||
@@ -190,5 +189,2 @@ let _data = this.getData(); | ||
return <UIBox title={schema.title} tag={tag} collapse={false}> | ||
@@ -195,0 +191,0 @@ <div className="schema-array"> |
@@ -21,4 +21,2 @@ import { Component, PropTypes } from 'react'; | ||
let files = e.target.files; | ||
console.log(files); | ||
// this._checkSize(files[0]); | ||
this._uploadFile(files[0]); | ||
@@ -53,6 +51,10 @@ }; | ||
let res = await uploader.upload(); | ||
this._loadPic(`${Utils.assetsHost}${res.key}`); | ||
}; | ||
_loadPic(imgUrl) { | ||
let config = this._getBoxSize(); | ||
config.width = Math.floor(config.width); | ||
let imgConfig = { | ||
src: `${Utils.assetsHost}${res.key}`, | ||
src: imgUrl, | ||
w: config.width, | ||
@@ -62,6 +64,10 @@ h: config.height | ||
this.refs.img.loadPic(imgConfig); | ||
}; | ||
} | ||
componentDidMount() { | ||
// this.refs.info.warning('ssssss'); | ||
let { data, schema } = this.props; | ||
if(data) { | ||
this._loadPic(data); | ||
} | ||
this.refs.info.warning(`上传(${schema.size})的图片`, '#ddd'); | ||
} | ||
@@ -102,3 +108,3 @@ | ||
<span className="mask layer"></span> | ||
<span className="layer"> | ||
<span className="layer info-layer"> | ||
<span className="op-cont"> | ||
@@ -105,0 +111,0 @@ <input |
@@ -6,10 +6,14 @@ import { Component, PropTypes } from 'react'; | ||
warning(text) { | ||
this.setState({ _text: text }); | ||
warning(text, color) { | ||
color = color || '#FF4400'; | ||
this.setState({ _text: text, _color: color }); | ||
} | ||
render() { | ||
let { _text } = this.state || { _text: '' }; | ||
return <span>{_text}</span>; | ||
let { _text, _color } = this.state || { _text: '' }; | ||
let style = { | ||
color: _color | ||
}; | ||
return <span style={style}>{_text}</span>; | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
1149184
31
25311
1
62