king
2025-01-22 871597aaf2c838946723ee44fc7fa12487b56d34
2025-01-22
14个文件已修改
152 ■■■■ 已修改文件
src/components/normalform/modalform/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/code/sandbox/codecontent/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/editor/braft-editor/index.jsx 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/editor/braft-editor/options.jsx 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/simple-form/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/step-form/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/tab-form/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/components/formdragelement/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/editor/braft-editor/index.jsx 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/share/braftContent/index.jsx 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/share/braftContent/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/dragelement/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/fieldscomponent/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/normalform/modalform/index.jsx
@@ -22,6 +22,7 @@
// const MKColor = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkColor'))
const MkEditIcon = asyncComponent(() => import('@/components/mkIcon'))
const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent'))
const CodeMirror = asyncComponent(() => import('@/templates/zshare/codemirror'))
class ModalForm extends Component {
  static propTpyes = {
@@ -362,6 +363,8 @@
        return
      } else if (item.type === 'printTemps') {
        content = <MkPrintTemps onChange={(val) => this.recordChange({[item.field]: val})}/>
      } else if (item.type === 'codemirror') {
        content = <CodeMirror mode="text/javascript" theme="cobalt" onChange={(val) => this.recordChange({[item.field]: val})}/>
      }
      if (!content) return
src/menu/components/code/sandbox/codecontent/index.scss
@@ -18,7 +18,7 @@
      background-color: #f0f0f0;
    }
    td, th {
      padding: 5px 14px;
      padding: 5px 10px;
      font-size: 16px;
      border: 1px solid #ddd;
    }
src/menu/components/editor/braft-editor/index.jsx
@@ -200,7 +200,7 @@
        <NormalHeader hideSearch="true" config={card} updateComponent={this.updateComponent}/>
        <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
          <div className="mk-popover-control">
            <NormalForm title="富文本设置" width={850} update={this.updateWrap} getForms={this.getWrapForms}>
            <NormalForm title="富文本设置" width={900} update={this.updateWrap} getForms={this.getWrapForms}>
              <EditOutlined style={{color: '#1890ff'}} title="编辑"/>
            </NormalForm>
            <CopyComponent type="editor" card={card}/>
@@ -212,10 +212,7 @@
        } trigger="hover">
          <ToolOutlined />
        </Popover>
        <BraftContent
          value={card.wrap.datatype !== 'static' ? '<p class="empty-content">富文本</p>' : card.html}
          encryption="false"
        />
        <BraftContent value={card.wrap.datatype !== 'static' ? '<p class="empty-content">富文本</p>' : card.html}/>
        <div className="component-name">
          <div className="center">
            <div className="title">{card.name}</div>
src/menu/components/editor/braft-editor/options.jsx
@@ -167,6 +167,28 @@
    },
    {
      type: 'radio',
      field: 'loaded',
      label: '布局调整',
      initval: wrap.loaded || 'false',
      required: false,
      options: [
        {value: 'false', label: '关闭'},
        {value: 'true', label: '开启'},
      ],
      controlFields: [
        {field: 'loadedfunc', values: ['true']},
      ]
    },
    {
      type: 'codemirror',
      field: 'loadedfunc',
      label: '处理脚本',
      initval: wrap.loadedfunc || '',
      required: true,
      span: 24
    },
    {
      type: 'radio',
      field: 'permission',
      label: '权限验证',
      initval: wrap.permission || 'false',
src/menu/components/form/simple-form/index.jsx
@@ -325,6 +325,7 @@
      orderType: 'asc',
      readonly: 'false',
      required: 'true',
      readin: 'top',
      focus: true
    }
src/menu/components/form/step-form/index.jsx
@@ -425,6 +425,7 @@
      orderType: 'asc',
      readonly: 'false',
      required: 'true',
      readin: 'top',
      focus: true
    }
src/menu/components/form/tab-form/index.jsx
@@ -431,6 +431,7 @@
      orderType: 'asc',
      readonly: 'false',
      required: 'true',
      readin: 'top',
      focus: true
    }
src/mob/components/formdragelement/index.jsx
@@ -94,6 +94,7 @@
      newcard.options = []
      newcard.readonly = 'false'
      newcard.required = 'true'
      newcard.readin = 'top'
      newcard.span = 24
      newcard.focus = true
src/tabviews/custom/components/editor/braft-editor/index.jsx
@@ -73,7 +73,7 @@
    }
    this.setState({
      data: _data,
      data: this.decodeHtml(_data, _config.wrap),
      BID: BID || '',
      config: _config,
    })
@@ -130,7 +130,7 @@
    let _data = window.GLOB.SyncData.get(config.dataName) || []
    this.setState({data: _data})
    this.setState({data: this.decodeHtml(_data, config.wrap)})
    window.GLOB.SyncData.delete(config.dataName)
@@ -158,7 +158,7 @@
        _data = [_data]
      }
      this.setState({data: _data})
      this.setState({data: this.decodeHtml(_data, config.wrap)})
    }
  }
@@ -224,7 +224,7 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      this.setState({
        data: result.data || [],
        data: this.decodeHtml(result.data, config.wrap),
        loading: false
      })
      
@@ -236,6 +236,35 @@
      
      UtilsDM.queryFail(result)
    }
  }
  decodeHtml = (data, wrap) => {
    if (!data || data.length === 0) return []
    data.forEach(item => {
      item.$html = item[wrap.field] || ''
      if (item.$html) {
        if (wrap.encryption === 'true') {
          try {
            item.$html = window.decodeURIComponent(window.atob(item.$html))
          } catch (e) {
            item.$html = item[wrap.field] || ''
          }
        }
        delete item[wrap.field]
        if (/\$[\s\S]+\$/.test(item.$html)) {
          Object.keys(item).forEach(key => {
            if (/^\$/.test(key)) return
            let reg = new RegExp('\\$' + key + '\\$', 'ig')
            item.$html = item.$html.replace(reg, item[key])
          })
        }
      }
    })
    return data
  }
  render() {
@@ -254,11 +283,10 @@
        <NormalHeader config={config}/>
        {config.wrap.datatype === 'static' ? <BraftContent
          value={config.html}
          encryption={'false'}
        /> : data.map((item, index) => <BraftContent
          key={index}
          value={item[config.wrap.field] || ''}
          encryption={config.wrap.encryption}
          value={item.$html}
          script={config.wrap.loaded === 'true' ? config.wrap.loadedfunc : ''}
        />)}
      </div>
    )
src/tabviews/custom/components/share/braftContent/index.jsx
@@ -1,13 +1,12 @@
import React, {Component} from 'react'
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import './index.scss'
class BraftContent extends Component {
  static propTpyes = {
    value: PropTypes.any,       // 内容
    encryption: PropTypes.any,  // 是否解码
    script: PropTypes.any       // 自定义脚本
  }
  state = {
@@ -15,34 +14,42 @@
  }
  UNSAFE_componentWillMount () {
    const { encryption, value } = this.props
    let html = value
    if (encryption === 'true' && html) {
      try {
        html = window.decodeURIComponent(window.atob(html))
      } catch (e) {
        html = value
      }
    }
    const { value } = this.props
    
    this.setState({html})
    this.setState({html: value})
  }
  componentDidMount() {
    this.loadScript()
  }
  UNSAFE_componentWillReceiveProps(nextProps) {
    if (!is(fromJS(this.props), fromJS(nextProps))) {
      const { encryption, value } = nextProps
      let html = value
    if (this.props.value !== nextProps.value) {
      this.setState({html: nextProps.value}, () => {
        this.loadScript()
      })
    }
  }
      if (encryption === 'true' && html) {
        try {
          html = window.decodeURIComponent(window.atob(html))
        } catch (e) {
          html = value
        }
  loadScript = () => {
    const { script } = this.props
    const { html } = this.state
    if (script && html) {
      const that = this
      let _html = ''
      try {
        // eslint-disable-next-line
        let func = new Function('that', 'html', script)
        _html = func(that, html)
      } catch (e) {
        _html = ''
        console.warn(e)
      }
      this.setState({html})
      if (_html) {
        this.setState({html: _html})
      }
    }
  }
src/tabviews/custom/components/share/braftContent/index.scss
@@ -36,7 +36,7 @@
      background-color: #f0f0f0;
    }
    td, th {
      padding: 5px 14px;
      padding: 5px 10px;
      font-size: 16px;
      border: 1px solid #ddd;
    }
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -4121,13 +4121,14 @@
   */
  getModels = () => {
    const { BID, btn, BData } = this.props
    const { btnconfig, visible, dict, confirmLoading, submitType } = this.state
    const { btnconfig, visible, dict, confirmLoading, submitType, loadingNumber, loadingTotal } = this.state
    if (!btnconfig || !btnconfig.setting) return null
    let title = btn.label
    let width = btnconfig.setting.width > 100 ? btnconfig.setting.width : btnconfig.setting.width + 'vw'
    let clickouter = btnconfig.setting.clickouter === 'close'
    let num = loadingNumber && !loadingTotal ? `(${loadingNumber}) ` : ''
    if (btnconfig.setting.display === 'drawer') {
      let height = '100vh'
@@ -4196,9 +4197,9 @@
          onCancel={this.handleCancel}
          footer={[
            <Button key="cancel" onClick={this.handleCancel}>{dict['cancel'] || '取消'}</Button>,
            btn.extBtn === 'true' ? <Button key="extend" className={'extend-btn ' + (btn.extStyle || '')} disabled={confirmLoading && submitType !== btn.extValue} loading={confirmLoading && submitType === btn.extValue} onClick={() => this.handleOk(btn.extValue)}>{btn.extLabel}</Button> : null,
            btn.extBtn === 'true' ? <Button key="confirm" className={'confirm-btn ' + (btn.confStyle || '')} disabled={confirmLoading && submitType !== ''} loading={confirmLoading && submitType === ''} onClick={() => this.handleOk()}>{btn.confLabel || dict['ok'] || '确定'}</Button> : null,
            btn.extBtn !== 'true' ? <Button key="confirm" type="primary" loading={confirmLoading} onClick={() => this.handleOk()}>{dict['ok'] || '确定'}</Button> : null
            btn.extBtn === 'true' ? <Button key="extend" className={'extend-btn ' + (btn.extStyle || '')} disabled={confirmLoading && submitType !== btn.extValue} loading={confirmLoading && submitType === btn.extValue} onClick={() => this.handleOk(btn.extValue)}>{submitType === btn.extValue ? num : ''}{btn.extLabel}</Button> : null,
            btn.extBtn === 'true' ? <Button key="confirm" className={'confirm-btn ' + (btn.confStyle || '')} disabled={confirmLoading && submitType !== ''} loading={confirmLoading && submitType === ''} onClick={() => this.handleOk()}>{submitType === '' ? num : ''}{btn.confLabel || dict['ok'] || '确定'}</Button> : null,
            btn.extBtn !== 'true' ? <Button key="confirm" type="primary" loading={confirmLoading} onClick={() => this.handleOk()}>{num}{dict['ok'] || '确定'}</Button> : null
          ]}
          destroyOnClose
        >
src/templates/modalconfig/dragelement/index.jsx
@@ -94,6 +94,7 @@
      newcard.options = []
      newcard.readonly = 'false'
      newcard.required = 'true'
      newcard.readin = 'top'
      newcard.focus = true
      if (item.subType === 'linkMain') {
src/templates/sharecomponent/fieldscomponent/index.jsx
@@ -305,7 +305,8 @@
          decimal: item.decimal,
          orderType: 'asc',
          readonly: 'false',
          required: 'true'
          required: 'true',
          readin: 'top'
        }
        if (/^icon|images?$/ig.test(item.field)) {