| | |
| | | } |
| | | }, |
| | | "braft-extensions": { |
| | | "version": "0.1.0", |
| | | "resolved": "https://registry.npmjs.org/braft-extensions/-/braft-extensions-0.1.0.tgz", |
| | | "integrity": "sha512-i7/GjJY2FCJUKqdHiFeohasWQvY1BMK1BU4KGDZo+K+d3i55sIsiBmmRRDrOazDLWBVqYi1rBu2uqFQvxJu1jw==", |
| | | "version": "0.1.1", |
| | | "resolved": "https://registry.npmjs.org/braft-extensions/-/braft-extensions-0.1.1.tgz", |
| | | "integrity": "sha512-lmqGA6TIMqejQfeQ5NvqNsD+pbyqJjWPh6CMcRL2hKd+3yo5Oc9dv6uTWx+f8ICnxXJEs6LZHYOA58zcP2cnJQ==", |
| | | "requires": { |
| | | "@babel/runtime": "^7.0.0", |
| | | "braft-convert": "^2.1.10", |
| | |
| | | "babel-plugin-named-asset-import": "^0.3.3", |
| | | "babel-preset-react-app": "9.0.0", |
| | | "braft-editor": "^2.3.9", |
| | | "braft-extensions": "^0.1.0", |
| | | "braft-extensions": "^0.1.1", |
| | | "browserslist": "^4.13.0", |
| | | "camelcase": "^5.2.0", |
| | | "caniuse-lite": "^1.0.30001102", |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import 'braft-editor/dist/index.css' |
| | | import 'braft-extensions/dist/table.css' |
| | | import BraftEditor from 'braft-editor' |
| | | import Table from 'braft-extensions/dist/table' |
| | | |
| | | import './index.scss' |
| | | |
| | | BraftEditor.use(Table()) |
| | | |
| | | class NormalEditor extends Component { |
| | | static propTpyes = { |
| | | card: PropTypes.object, // 条码设置 |
| | | value: PropTypes.any, // 条码值 |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) |
| | | } |
| | | |
| | | handleEditorChange = () => { |
| | | |
| | | } |
| | | |
| | | submitContent = () => { |
| | | |
| | | } |
| | | |
| | | render() { |
| | | |
| | | return ( |
| | | <div className="normal-braft-editor"> |
| | | <BraftEditor value={'<p></p>'} onChange={this.handleEditorChange} onSave={this.submitContent}/> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default NormalEditor |
| | |
| | | <ColorSketch value={backgroundColor} onChange={this.changeBackgroundColor} /> |
| | | </Form.Item> |
| | | <Form.Item colon={false} label="图片"> |
| | | <FileUpload value={bgimages} maxFile={2} fileType="text" onChange={this.imgChange}/> |
| | | <FileUpload accept=".jpg,.png,.gif,.svg" value={bgimages} maxFile={2} fileType="text" onChange={this.imgChange}/> |
| | | <Input placeholder="" value={backgroundImage} autoComplete="off" onChange={this.changeImage}/> |
| | | </Form.Item> |
| | | </Form> |
| | |
| | | label={<Icon title="背景图片" type="picture" />} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <FileUpload value={bgimages} maxFile={2} fileType="text" onChange={this.imgChange}/> |
| | | <FileUpload accept=".jpg,.png,.gif,.svg" value={bgimages} maxFile={2} fileType="text" onChange={this.imgChange}/> |
| | | <Input placeholder="" value={backgroundImage} autoComplete="off" onChange={this.changeBackgroundImageInput} /> |
| | | </Form.Item> |
| | | </Col> : null} |
| | |
| | | label={<Icon title="背景图片" type="picture" />} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <FileUpload value={bgimages} maxFile={2} fileType="text" onChange={this.imgChange}/> |
| | | <FileUpload accept=".jpg,.png,.gif,.svg" value={bgimages} maxFile={2} fileType="text" onChange={this.imgChange}/> |
| | | <Input placeholder="" value={backgroundImage} autoComplete="off" onBlur={this.submitBackgroundImage} onPressEnter={this.submitBackgroundImage} onChange={this.changeBackgroundImageInput} /> |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | {deletable !== false ? <Icon type="delete" onClick={this.deleteElement} /> : null} |
| | | <Popover content={ |
| | | <div> |
| | | {element.eleType === 'img' ? <FileUpload value={images} maxFile={1} fileType="text" onChange={this.imgChange}/> : null} |
| | | {element.eleType === 'img' ? <FileUpload accept=".jpg,.png,.gif,.svg" value={images} maxFile={1} fileType="text" onChange={this.imgChange}/> : null} |
| | | {getFieldDecorator('content', { |
| | | initialValue: element.content |
| | | })(element.eleType !== 'textarea' ? |
| | |
| | | <Modal |
| | | className={'popview-modal ' + (btn.$type === 'CustomPage' ? 'custom-popview' : '')} |
| | | title={btn.label} |
| | | width={'80vw'} |
| | | width={'85vw'} |
| | | maskClosable={false} |
| | | visible={this.state.visible} |
| | | onCancel={this.popclose} |
| | |
| | | class FileUpload extends Component { |
| | | static propTpyes = { |
| | | value: PropTypes.array, // 文件数组 |
| | | accept: PropTypes.any, // 文件格式 |
| | | maxFile: PropTypes.any, // 最大文件数 |
| | | fileType: PropTypes.string // 文件显示类型 |
| | | } |
| | |
| | | } |
| | | |
| | | beforeUpload = (file) => { |
| | | const { accept } = this.props |
| | | |
| | | if (accept && file.name) { |
| | | let types = accept.split(',') |
| | | let pass = false |
| | | types.forEach(type => { |
| | | if (new RegExp(type + '$', 'ig').test(file.name)) { |
| | | pass = true |
| | | } |
| | | }) |
| | | |
| | | if (!pass) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '文件格式错误!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | showprogress: true, |
| | | percent: 0 |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { value, maxFile, fileType } = this.props |
| | | const { value, maxFile, fileType, accept } = this.props |
| | | const { showprogress, percent } = this.state |
| | | |
| | | let uploadable = 'fileupload-form-container ' |
| | |
| | | listType: fileType, |
| | | fileList: value, |
| | | action: null, |
| | | accept: accept || '', |
| | | method: 'post', |
| | | multiple: false, |
| | | onChange: this.onChange, |
| | |
| | | import options from '@/store/options.js' |
| | | import { formRule } from '@/utils/option.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import CustomSwitch from './customSwitch' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import CheckCard from './checkCard' |
| | | import './index.scss' |
| | | |
| | | const {MonthPicker} = DatePicker |
| | | const { MonthPicker } = DatePicker |
| | | const { TextArea } = Input |
| | | |
| | | const CheckCard = asyncComponent(() => import('./checkCard')) |
| | | const CustomSwitch = asyncComponent(() => import('./customSwitch')) |
| | | const FileUpload = asyncComponent(() => import('../fileupload')) |
| | | const ColorSketch = asyncComponent(() => import('@/mob/colorsketch')) |
| | | // const Editor = asyncComponent(() => import('@/components/editor')) |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <FileUpload maxFile={item.maxfile} fileType={item.fileType || 'text'} /> |
| | | <FileUpload accept={item.suffix} maxFile={item.maxfile} fileType={item.fileType || 'text'} /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | return item |
| | | }) |
| | | } |
| | | |
| | | resolve(search) |
| | | } else { |
| | | reject(err) |
| | |
| | | return ( |
| | | <Form {...formItemLayout} className="ant-advanced-search-form main-form-field" id="main-form-box"> |
| | | <Row className={'cols' + cols} gutter={24}>{this.getFields()}</Row> |
| | | {/* <Editor /> */} |
| | | </Form> |
| | | ) |
| | | } |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'suffix', |
| | | label: '后缀名', |
| | | tooltip: '可以上传文件的后缀名,多个类型用逗号分隔,空值时不校验。', |
| | | initVal: card.suffix || '', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'encryption', |
| | | label: '加密传输', |
| | |
| | | checkcard: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'linkSubField', 'fieldlength', 'display', 'tooltip', 'width', 'multiple'], |
| | | multiselect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'entireLine', 'tooltip'], |
| | | link: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'setAll', 'linkField', 'entireLine', 'tooltip', 'emptyText', 'enter'], |
| | | fileupload: ['readonly', 'required', 'readin', 'fieldlength', 'maxfile', 'fileType', 'entireLine', 'tooltip'], |
| | | fileupload: ['readonly', 'required', 'readin', 'fieldlength', 'maxfile', 'fileType', 'entireLine', 'tooltip', 'suffix'], |
| | | switch: ['initval', 'openVal', 'closeVal', 'openText', 'closeText', 'readonly', 'hidden', 'readin', 'entireLine', 'tooltip'], |
| | | date: ['initval', 'readonly', 'required', 'hidden', 'readin', 'entireLine', 'tooltip'], |
| | | datemonth: ['initval', 'readonly', 'required', 'hidden', 'readin', 'entireLine', 'tooltip'], |