king
2021-11-01 0d58c560feeddd8409a34ef0bd1e16f0be3f9758
2021-11-01
13个文件已修改
118 ■■■■ 已修改文件
src/menu/datasource/index.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/settingform/index.jsx 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/components/menubar/normal-menubar/index.jsx 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/components/menubar/normal-menubar/index.scss 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/components/menubar/normal-menubar/menucomponent/index.jsx 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/components/menubar/normal-menubar/menucomponent/options.jsx 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/components/menubar/normal-menubar/options.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/subtable/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/dragaction/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/index.jsx 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/index.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mobdesign/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/index.jsx
@@ -189,6 +189,8 @@
        })
      }
      let maxScript = 0
      if (window.GLOB.funcs && window.GLOB.funcs.length > 0) {
        window.GLOB.funcs.forEach(m => {
          let reg = new RegExp('\\$ex@' + m.func_code + '@ex\\$', 'ig')
@@ -197,10 +199,20 @@
          }
          res.scripts.forEach(item => {
            item.sql = item.sql.replace(reg, `/*$ex@${m.func_code}-begin*/\n${m.key_sql}\n/*@ex$-end*/`)
            if (item.status === 'false') return
            if (/exec\s/ig.test(item.sql)) {
              maxScript = 100
            } else if (item.sql.length > maxScript) {
              maxScript = item.sql.length
            }
          })
        })
      }
      res.setting.maxScript = maxScript
      this.setState({loading: false, visible: false})
      this.props.updateConfig({...config, ...res})
    }, () => {
src/menu/datasource/verifycard/settingform/index.jsx
@@ -59,6 +59,7 @@
    return new Promise((resolve, reject) => {
      this.props.form.validateFieldsAndScroll((err, values) => {
        if (!err) {
          values.sync = values.sync || 'false'
          // 数据源前端验证
          if (values.interType === 'system' && values.execute !== 'false' && !values.dataresource) {
            notification.warning({
@@ -369,7 +370,7 @@
                </Radio.Group>)}
              </Form.Item>
            </Col> : null}
            {config.type !== 'navbar' && config.type !== 'balcony' ? <Col span={8}>
            {!['navbar', 'balcony', 'menubar'].includes(config.type) ? <Col span={8}>
              <Form.Item label={
                <Tooltip placement="topLeft" title={'该组件如果受其他组件控制,请选项相应的组件,没有时选“无”。'}>
                  <Icon type="question-circle" />
@@ -420,7 +421,7 @@
              </Form.Item>
            </Col> : null}
            {/* 1、不分页且不存在上级模块 */}
            {config.type !== 'navbar' && (!config.pageable || (config.pageable && laypage === 'false')) && (!supModule || supModule.length === 0 || supModule[0] === 'empty') ? <Col span={8}>
            {!['navbar', 'menubar'].includes(config.type) && (!config.pageable || (config.pageable && laypage === 'false')) && (!supModule || supModule.length === 0 || supModule[0] === 'empty') ? <Col span={8}>
              <Form.Item label={
                <Tooltip placement="topLeft" title={'初始化加载时,是否与其他组件一同加载数据,注:仅在使用系统函数,且初始化加载数据时有效,分页请求时无效。'}>
                  <Icon type="question-circle" />
@@ -437,7 +438,7 @@
                )}
              </Form.Item>
            </Col> : null}
            {config.type !== 'navbar' && config.type !== 'balcony' ? <Col span={8}>
            {!['navbar', 'balcony', 'menubar'].includes(config.type) ? <Col span={8}>
              <Form.Item label={
                <Tooltip placement="topLeft" title={'优先使用同级的搜索条件组件,同级搜索不存在时,依次向上选取,与当前组件的搜索条件一同用作数据过滤(当前组件的搜索条件优先)。'}>
                  <Icon type="question-circle" />
@@ -454,7 +455,7 @@
                )}
              </Form.Item>
            </Col> : null}
            {config.type !== 'navbar' && config.type !== 'balcony' && useMSearch === 'true' ? <Col span={8}>
            {!['navbar', 'balcony', 'menubar'].includes(config.type) && useMSearch === 'true' ? <Col span={8}>
              <Form.Item label={
                <Tooltip placement="topLeft" title={'外层搜索条件改变时,是否刷新当前组件数据。'}>
                  <Icon type="question-circle" />
@@ -482,7 +483,7 @@
                </Radio.Group>)}
              </Form.Item>
            </Col>
            {config.type !== 'navbar' && config.type !== 'balcony' ? <Col span={8}>
            {!['navbar', 'balcony', 'menubar'].includes(config.type) ? <Col span={8}>
              <Form.Item label="初始化数据">
                {getFieldDecorator('onload', {
                  initialValue: setting.onload || 'true'
src/mob/components/menubar/normal-menubar/index.jsx
@@ -19,6 +19,7 @@
const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent'))
const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent'))
const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader'))
const SettingComponent = asyncIconComponent(() => import('@/menu/datasource'))
const { confirm } = Modal
@@ -45,10 +46,14 @@
        floor: card.floor,
        tabId: '',
        parentId: '',
        format: 'object',   // 组件属性 - 数据格式
        pageable: false,    // 组件属性 - 是否可分页
        switchable: false,  // 组件属性 - 数据是否可切换
        dataName: card.dataName || '',
        width: card.width || 24,
        name: card.name,
        subtype: card.subtype,
        setting: { interType: 'system' },
        wrap: { name: card.name, width: card.width || 24, title: '' },
        style: { marginLeft: '0px', marginRight: '0px', marginTop: '8px', marginBottom: '8px' },
        headerStyle: { fontSize: '16px', borderBottomWidth: '1px', borderBottomColor: '#e8e8e8' },
@@ -227,7 +232,16 @@
  }
  updateWrap = (res) => {
    this.updateComponent({...this.state.card, wrap: res})
    let card = {...this.state.card, wrap: res}
    if (res.datatype === 'dynamic' && !card.format) {
      card.format = 'object'
      card.pageable = false
      card.switchable = false
      card.setting = { interType: 'system' }
      card.columns = []
      card.scripts = []
    }
    this.updateComponent(card)
  }
  clickComponent = (e) => {
@@ -268,6 +282,8 @@
            <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" />
            <UserComponent config={card}/>
            <Icon className="close" title="删除组件" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} />
            {card.wrap.datatype === 'dynamic' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : null}
            {card.wrap.datatype !== 'dynamic' ? <Icon style={{color: '#eeeeee', cursor: 'not-allowed'}} type="setting"/> : null}
          </div>
        } trigger="hover">
          <Icon type="tool" />
src/mob/components/menubar/normal-menubar/index.scss
@@ -41,6 +41,7 @@
      text-overflow: ellipsis;
    }
    .menu-sign {
      position: relative;
      text-align: center;
      .anticon {
        border-radius: 15%;
@@ -48,6 +49,14 @@
      img {
        border-radius: 15%;
      }
      .am-badge-text {
        position: absolute;
        height: 8px;
        width: 8px;
        border-radius: 100%;
        background: #ff5b05;
        z-index: 1;
      }
    }
  }
}
src/mob/components/menubar/normal-menubar/menucomponent/index.jsx
@@ -80,9 +80,10 @@
  }
  getSettingForms = () => {
    const { cards } = this.props
    const { card } = this.state
    return getSettingForm(card.setting)
    return getSettingForm(card.setting, cards.columns || [])
  }
  updateSetting = (res) => {
@@ -150,8 +151,10 @@
                color: card.setting.color,
                borderRadius: card.setting.borderRadius || '15%'
              }} type={card.setting.icon}/>
              {card.setting.tip ? <sup className="am-badge-text"></sup> : null}
            </div> : <div className="menu-sign">
              <img style={{width: card.setting.imgWidth, height: card.setting.imgWidth, borderRadius: card.setting.borderRadius || '15%'}} src={card.setting.url} alt=""/>
              {card.setting.tip ? <sup className="am-badge-text"></sup> : null}
            </div>}
            <div className="menu-name">{card.setting.name}</div>
          </div>
src/mob/components/menubar/normal-menubar/menucomponent/options.jsx
@@ -1,7 +1,7 @@
/**
 * @description Setting表单配置信息
 */
export default function (setting) {
export default function (setting, columns) {
  let menulist = sessionStorage.getItem('appMenus')
  if (menulist) {
@@ -180,6 +180,15 @@
      precision: 0,
      required: false
    },
    {
      type: 'select',
      field: 'tip',
      label: '提示',
      initval: setting.tip || '',
      tooltip: '绑定提示字段后,会在菜单右上角显示红色标记。',
      required: false,
      options: columns
    },
  ]
  return menuWrapForm
src/mob/components/menubar/normal-menubar/options.jsx
@@ -28,6 +28,18 @@
      max: 24,
      precision: 0,
      required: true
    },
    {
      type: 'radio',
      field: 'datatype',
      label: '数据来源',
      initval: wrap.datatype || 'static',
      tooltip: '选择静态值,无需配置数据源。',
      required: false,
      options: [
        {value: 'dynamic', label: '动态'},
        {value: 'static', label: '静态'},
      ]
    }
  ]
src/tabviews/subtable/index.jsx
@@ -916,11 +916,14 @@
  changeTableLine = (ContainerId, tableId, id, data) => {
    const { Tab } = this.props
    const { setting } = this.state
    if (!Tab.supMenu || tableId !== Tab.supMenu) return
    this.setState({BData: data, BID: id})
    if (!setting) return
    if (id !== this.state.BID || id !== '') {
      MKEmitter.emit('resetTable', this.props.Tab.uuid) // 列表重置
      this.setState({
src/templates/sharecomponent/actioncomponent/dragaction/index.jsx
@@ -55,8 +55,7 @@
    copycard.copyType = 'action'
    copycard.focus = true
    copycard.originCard = card
    copycard.originCard.appkey = window.GLOB.appkey
    copycard.originCard = {...card, appkey: window.GLOB.appkey}
    if (copycard.OpenType === 'popview') { // 待完善
      copycard.linkTab = ''
src/templates/sharecomponent/settingcomponent/index.jsx
@@ -120,12 +120,21 @@
  resetSetting = (s) => {
    let setting = fromJS(s).toJS()
    let maxScript = 0
    if (window.GLOB.funcs && window.GLOB.funcs.length > 0) {
      window.GLOB.funcs.forEach(m => {
        let reg = new RegExp('\\$ex@' + m.func_code + '@ex\\$', 'ig')
        setting.scripts.forEach(item => {
          item.sql = item.sql.replace(reg, `/*$ex@${m.func_code}-begin*/\n${m.key_sql}\n/*@ex$-end*/`)
          if (item.status === 'false') return
          if (/exec\s/ig.test(item.sql)) {
            maxScript = 100
          } else if (item.sql.length > maxScript) {
            maxScript = item.sql.length
          }
        })
        setting.preScripts.forEach(item => {
          item.sql = item.sql.replace(reg, `/*$ex@${m.func_code}-begin*/\n${m.key_sql}\n/*@ex$-end*/`)
@@ -139,6 +148,8 @@
      })
    }
    setting.maxScript = maxScript
    return setting
  }
src/templates/zshare/formconfig.jsx
@@ -874,6 +874,10 @@
    })
  }
  if (card.OpenType === 'blank') {
    card.OpenType = 'tab'
  }
  return [
    {
      type: 'select',
@@ -2739,11 +2743,11 @@
      label: '光标',
      initVal: card.cursor || 'left',
      options: [{
        value: 'right',
        text: '右对齐'
      }, {
        value: 'left',
        text: '左对齐'
      }, {
        value: 'right',
        text: '右对齐'
      }],
      forbid: appType !== 'mob'
    },
src/templates/zshare/verifycard/index.jsx
@@ -35,6 +35,7 @@
  state = {
    initsql: '',            // sql验证时变量声明及赋值
    notes: [],              // 短信模板
    setting: null,
    verify: {},
    fields: [],
    usefulfields: '',
@@ -572,6 +573,7 @@
    }
    this.setState({
      setting: config.setting || {},
      verify: _verify
    })
@@ -1316,6 +1318,7 @@
  handleConfirm = () => {
    const { card } = this.props
    const { setting } = this.state
    let verify = fromJS(this.state.verify).toJS()
    
    // 表单提交时检查输入值是否正确
@@ -1334,6 +1337,13 @@
          duration: 5
        })
        return
      } else if (verify.invalid === 'true' && setting.maxScript && setting.maxScript >= 100) {
        notification.warning({
          top: 92,
          message: '数据源中自定义脚本过于复杂,不能使用失效验证!',
          duration: 5
        })
        return
      }
      let msg = ''
src/views/mobdesign/index.jsx
@@ -1135,6 +1135,7 @@
        if (['propcard', 'brafteditor', 'sandbox', 'tabbar', 'stepform', 'tabform'].includes(item.subtype) && item.wrap.datatype === 'static') return
        if (['balcony'].includes(item.type) && item.wrap.datatype === 'static') return
        if (['menubar'].includes(item.type) && item.wrap.datatype !== 'dynamic') return
        if (item.setting) {
          if (item.setting.interType === 'system' && item.setting.execute !== 'false' && !item.setting.dataresource) {
@@ -1143,7 +1144,7 @@
            error = `组件《${item.name}》未设置数据源!`
          } else if (!item.setting.primaryKey) {
            error = `组件《${item.name}》未设置主键!`
          } else if (!item.setting.supModule && item.type !== 'navbar' && item.type !== 'balcony') {
          } else if (!item.setting.supModule && !['navbar', 'balcony', 'menubar'].includes(item.type)) {
            error = `组件《${item.name}》未设置上级组件!`
          }
        }