king
2021-01-15 40436544f55558d2c8d1c14c68cce79546c60dff
2021-01-15
11个文件已修改
2个文件已添加
107 ■■■■ 已修改文件
package-lock.json 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/editor/index.jsx 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/editor/index.scss 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/bgcontroller/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/stylecontroller/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/controller/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/contupdate/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/popupbutton/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/fileupload/index.jsx 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
package-lock.json
@@ -4201,9 +4201,9 @@
      }
    },
    "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",
package.json
@@ -20,7 +20,7 @@
    "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",
src/components/editor/index.jsx
New file
@@ -0,0 +1,41 @@
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
src/components/editor/index.scss
src/menu/bgcontroller/index.jsx
@@ -116,7 +116,7 @@
            <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>
src/menu/stylecontroller/index.jsx
@@ -415,7 +415,7 @@
                    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}
src/mob/controller/index.jsx
@@ -375,7 +375,7 @@
                  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>
src/mob/contupdate/index.jsx
@@ -110,7 +110,7 @@
        {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' ?
src/tabviews/zshare/actionList/popupbutton/index.jsx
@@ -185,7 +185,7 @@
        <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}
src/tabviews/zshare/fileupload/index.jsx
@@ -18,6 +18,7 @@
class FileUpload extends Component {
  static propTpyes = {
    value: PropTypes.array,    // 文件数组
    accept: PropTypes.any,     // 文件格式
    maxFile: PropTypes.any,    // 最大文件数
    fileType: PropTypes.string // 文件显示类型
  }
@@ -122,6 +123,27 @@
  }
  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
@@ -231,7 +253,7 @@
  }
  render() {
    const { value, maxFile, fileType } = this.props
    const { value, maxFile, fileType, accept } = this.props
    const { showprogress, percent } = this.state
    let uploadable = 'fileupload-form-container '
@@ -246,6 +268,7 @@
      listType: fileType,
      fileList: value,
      action: null,
      accept: accept || '',
      method: 'post',
      multiple: false,
      onChange: this.onChange,
src/tabviews/zshare/mutilform/index.jsx
@@ -8,15 +8,17 @@
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 = {
@@ -1122,7 +1124,7 @@
                  }
                ]
              })(
                <FileUpload maxFile={item.maxfile} fileType={item.fileType || 'text'} />
                <FileUpload accept={item.suffix} maxFile={item.maxfile} fileType={item.fileType || 'text'} />
              )}
            </Form.Item>
          </Col>
@@ -1341,6 +1343,7 @@
              return item
            })
          }
          resolve(search)
        } else {
          reject(err)
@@ -1370,6 +1373,7 @@
    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>
    )
  }
src/templates/zshare/formconfig.jsx
@@ -2318,6 +2318,15 @@
      }]
    },
    {
      type: 'text',
      key: 'suffix',
      label: '后缀名',
      tooltip: '可以上传文件的后缀名,多个类型用逗号分隔,空值时不校验。',
      initVal: card.suffix || '',
      required: false,
      readonly: false
    },
    {
      type: 'radio',
      key: 'encryption',
      label: '加密传输',
src/templates/zshare/modalform/index.jsx
@@ -22,7 +22,7 @@
  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'],