king
2021-03-31 682a74e858e5a6cd24d36183931d3afafd6443d7
2021-03-31
18个文件已修改
261 ■■■■ 已修改文件
src/assets/css/viewstyle.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/normal-form/index.jsx 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/modalconfig/index.jsx 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/normal-table/index.jsx 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/subtable/index.jsx 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.scss 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/dragelement/card.jsx 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/dragelement/index.scss 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/index.jsx 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/menudesign/menuform/index.scss 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mobdesign/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mobdesign/menuform/index.scss 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pcdesign/menuform/index.scss 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/css/viewstyle.scss
@@ -373,6 +373,9 @@
  .mk-water-mark {
    color: $color4;
  }
  .mk-form-split-line {
    color: $color6;
  }
}
body.hidden-split-line #root { // 去除登录页分割线
src/menu/components/form/normal-form/index.jsx
@@ -45,7 +45,8 @@
    visible: false,
    editform: null,
    formlist: null,
    sqlVerifing: false
    sqlVerifing: false,
    standardform: null
  }
  UNSAFE_componentWillMount () {
@@ -429,8 +430,9 @@
    group.fields.push(newcard)
    this.setState({group})
    this.handleForm(newcard)
    this.setState({group}, () => {
      this.handleForm(newcard)
    })
  }
  editModalCancel = () => {
@@ -453,6 +455,7 @@
      value: '',
      text: '空'
    }]
    let standardform = null
    _inputfields = group.fields.filter(item => item.type === 'text' || item.type === 'number' || item.type === 'textarea' || item.type === 'color')
    _tabfields = group.fields.filter(item => _form.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type))
@@ -460,7 +463,11 @@
    let uniq = new Map()
    uniq.set(_form.field, true)
    group.fields.forEach(item => {
    let index = null
    group.fields.forEach((item, i) => {
      if (_form.uuid === item.uuid) {
        index = i
      }
      if (item.type !== 'select' && item.type !== 'link' && item.type !== 'radio') return
      if (item.field && !uniq.has(item.field)) {
        uniq.set(item.field, true)
@@ -475,6 +482,13 @@
        })
      }
    })
    if (index !== null) {
      if (index === 0) {
        standardform = group.fields[index + 1] || null
      } else {
        standardform = group.fields[index - 1] || null
      }
    }
    card.columns.forEach(col => {
      if (col.field && !uniq.has(col.field)) {
@@ -493,6 +507,7 @@
    }
    this.setState({
      standardform,
      visible: true,
      editform: _form,
      formlist: getModalForm(_form, _inputfields, _tabfields, _linkableFields, _linksupFields, false)
@@ -673,6 +688,7 @@
            card={this.state.editform}
            formlist={this.state.formlist}
            inputSubmit={this.handleSubmit}
            standardform={this.state.standardform}
            wrappedComponentRef={(inst) => this.formRef = inst}
          />
        </Modal>
src/menu/modalconfig/index.jsx
@@ -53,7 +53,8 @@
    sources: null,         // 表单类型
    sqlVerifing: false,    // sql验证
    openEdition: '',       // 编辑版本标记,防止多人操作
    showField: false       // 显示表单字段值
    showField: false,      // 显示表单字段值
    standardform: null
  }
  /**
@@ -120,6 +121,7 @@
      value: '',
      text: '空'
    }]
    let standardform = null
    _inputfields = config.fields.filter(item => item.type === 'text' || item.type === 'number' || item.type === 'textarea' || item.type === 'color')
    _tabfields = config.fields.filter(item => card.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type))
@@ -127,7 +129,11 @@
    let uniq = new Map()
    uniq.set(card.field, true)
    config.fields.forEach(item => {
    let index = null
    config.fields.forEach((item, i) => {
      if (card.uuid === item.uuid) {
        index = i
      }
      if (item.type !== 'select' && item.type !== 'link' && item.type !== 'radio') return
      if (item.field && !uniq.has(item.field)) {
        uniq.set(item.field, true)
@@ -142,6 +148,13 @@
        })
      }
    })
    if (index !== null) {
      if (index === 0) {
        standardform = config.fields[index + 1] || null
      } else {
        standardform = config.fields[index - 1] || null
      }
    }
    componentConfig.columns.forEach(col => {
      if (col.field && !uniq.has(col.field)) {
@@ -160,6 +173,7 @@
    }
    this.setState({
      standardform,
      visible: true,
      card: card,
      formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields, !!this.props.editTab)
@@ -462,6 +476,7 @@
            card={this.state.card}
            formlist={this.state.formlist}
            inputSubmit={this.handleSubmit}
            standardform={this.state.standardform}
            wrappedComponentRef={(inst) => this.formRef = inst}
          />
        </Modal>
src/tabviews/commontable/index.jsx
@@ -717,8 +717,9 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      let data = fromJS(this.state.data).toJS()
      let selectedData = fromJS(this.state.selectedData).toJS()
      if (result.data && result.data[0]) {
        let _data = result.data[0]
        let _data = result.data[0] || {}
        if (absFields.length) {
          absFields.forEach(field => {
@@ -728,18 +729,23 @@
            _data[field] = Math.abs(_data[field])
          })
        }
        _data.$$uuid = _data[setting.primaryKey] || ''
        _data.$$BID = BID || ''
        try {
          data = data.map(item => {
            if (item[setting.primaryKey] === _data[setting.primaryKey]) {
            if (item.$$uuid === _data.$$uuid) {
              _data.key = item.key
              _data.$$uuid = _data[setting.primaryKey] || ''
              _data.$$BID = BID || ''
              return _data
            } else {
              return item
            }
          })
          selectedData = selectedData.map(item => {
            if (_data.$$uuid === item.$$uuid) {
              return _data
            }
            return item
          })
        } catch {
          console.warn('数据查询错误')
@@ -747,7 +753,8 @@
      }
      this.setState({
        data: data,
        data,
        selectedData,
        loading: false
      })
    } else {
src/tabviews/custom/components/table/normal-table/index.jsx
@@ -227,19 +227,25 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      let data = fromJS(this.state.data).toJS()
      let selectedData = fromJS(this.state.selectedData).toJS()
      if (result.data && result.data[0]) {
        let _data = result.data[0]
        let _data = result.data[0] || {}
        _data.$$uuid = _data[setting.primaryKey] || ''
        _data.$$BID = BID || ''
        try {
          data = data.map(item => {
            if (item[setting.primaryKey] === _data[setting.primaryKey]) {
            if (item.$$uuid === _data.$$uuid) {
              _data.key = item.key
              _data.$$uuid = _data[setting.primaryKey] || ''
              _data.$$BID = BID || ''
              return _data
            } else {
              return item
            }
          })
          selectedData = selectedData.map(item => {
            if (_data.$$uuid === item.$$uuid) {
              return _data
            }
            return item
          })
        } catch {
          console.warn('数据查询错误')
@@ -247,7 +253,8 @@
      }
      this.setState({
        data: data,
        data,
        selectedData,
        loading: false
      })
    } else {
src/tabviews/subtable/index.jsx
@@ -656,8 +656,9 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      let data = fromJS(this.state.data).toJS()
      let selectedData = fromJS(this.state.selectedData).toJS()
      if (result.data && result.data[0]) {
        let _data = result.data[0]
        let _data = result.data[0] || {}
        if (absFields.length) {
          absFields.forEach(field => {
@@ -668,17 +669,23 @@
          })
        }
        _data.$$uuid = _data[setting.primaryKey] || ''
        _data.$$BID = BID || ''
        try {
          data = data.map(item => {
            if (item[setting.primaryKey] === _data[setting.primaryKey]) {
            if (item.$$uuid === _data.$$uuid) {
              _data.key = item.key
              _data.$$uuid = _data[setting.primaryKey] || ''
              _data.$$BID = BID || ''
              return _data
            } else {
              return item
            }
          })
          selectedData = selectedData.map(item => {
            if (_data.$$uuid === item.$$uuid) {
              return _data
            }
            return item
          })
        } catch {
          console.warn('数据查询错误')
@@ -686,7 +693,8 @@
      }
      this.setState({
        data: data,
        data,
        selectedData,
        loading: false
      })
    } else {
src/tabviews/zshare/mutilform/index.jsx
@@ -232,7 +232,7 @@
      formlist
    }, () => {
      if (action.setting && action.setting.focus) {
        this.selectInput(action.setting.focus, 'init')
        this.selectInput(action.setting.focus)
      }
      // 用来更新state,防止受控表单初始时不显示
      this.setState({
@@ -242,7 +242,7 @@
    })
  }
  selectInput = (selectId, type) => {
  selectInput = (selectId) => {
    try {
      let _form = document.getElementById('main-form-box')
      let _inputs = _form.getElementsByTagName('input')
@@ -250,7 +250,7 @@
      _inputs.forEach(input => {
        if (!input || input.id !== selectId) return
        if (input.className === 'ant-select-search__field' && type !== 'init') {
        if (input.className === 'ant-select-search__field') {
          let div = input.parentNode
          while (div && div.parentNode) {
            div = div.parentNode
@@ -711,7 +711,7 @@
      if (item.type === 'split') {
        fields.push(
          <Col span={24} key={index}>
            <p>{item.label}</p>
            <p className="mk-form-split-line">{item.label}</p>
          </Col>
        )
      } else if (item.type === 'hint') {
src/tabviews/zshare/mutilform/index.scss
@@ -5,6 +5,8 @@
    display: inline-block;
    float: none;
    vertical-align: top;
    padding-left: 1.2%!important;
    padding-right: 1.2%!important;
  }
  .ant-form-item-label .anticon-question-circle {
    color: #c49f47;
@@ -89,7 +91,9 @@
  }
  p {
    color: #1890ff;
    border-bottom: 1px solid #d9d9d9;
    font-size: 15px;
    padding-left: 10px;
    border-bottom: 1px solid #e9e9e9;
  }
  .ant-input-disabled {
    color: rgba(0, 0, 0, 0.65)!important;
src/templates/modalconfig/dragelement/card.jsx
@@ -62,29 +62,6 @@
      selectval = card.emptyText || '空'
    }
  }
  // let labelCol = 'ant-col-sm-8'
  // let wrapCol = 'ant-col-sm-16'
  // let isEntireLine = false
  // if (card.entireLine === 'true' || ['textarea', 'hint', 'checkcard', 'brafteditor'].includes(card.type)) {
  //   isEntireLine = true
  // }
  // if (isEntireLine) {
  //   if (cols === '2') {
  //     labelCol = 'ant-col-sm-4'
  //     wrapCol = 'ant-col-sm-20'
  //   } else if (cols === '3') {
  //     labelCol = 'ant-col-cuslabel'
  //     wrapCol = 'ant-col-cuswrap'
  //   } else if (cols === '4') {
  //     labelCol = 'ant-col-sm-2'
  //     wrapCol = 'ant-col-sm-22'
  //   }
  //   if (card.hidelabel === 'true') {
  //     wrapCol = 'ant-col-sm-24'
  //   }
  // }
  let formItem = null
  if (card.type === 'text') {
@@ -157,21 +134,11 @@
            required={card.required === 'true'}
            extra={card.extra || null}
            labelCol={card.labelwidth ? {style: {width: card.labelwidth + '%'}} : null}
            wrapperCol={card.labelwidth ? {style: {width: (100 - card.labelwidth) + '%'}} : null}
          >
            {formItem}
            {showField ? <div className="field-name">{card.field}</div> : ''}
          </Form.Item>}
          {/* <div className="ant-row ant-form-item">
            {card.hidelabel !== 'true' ? <div className={'ant-col ant-form-item-label ant-col-xs-24 ' + labelCol}>
              {card.label ? <label className={card.required === 'true' ? 'required' : ''}>{card.tooltip ?
                <Icon type="question-circle" /> : null}
                {card.label}</label> : null}
            </div> : null}
            <div className={'ant-col ant-form-item-control-wrapper ant-col-xs-24 ' + wrapCol}>
              {formItem}
              {showField ? card.field : ''}
            </div>
          </div> */}
        </div>
      </div>
    </Popover>
src/templates/modalconfig/dragelement/index.scss
@@ -15,14 +15,18 @@
}
.modal-fields-row {
  padding-bottom: 35px;
  .ant-col {
    padding-left: 12px;
    padding-right: 12px;
  }
  >.ant-col {
    display: inline-block;
    float: none;
    vertical-align: top;
    padding-left: 1.2%;
    padding-right: 1.2%;
  }
  .split-line {
    color: #1890ff;
    font-size: 15px;
    padding-left: 10px;
    border-bottom: 1px solid #e9e9e9;
  }
  .ant-form-item {
    cursor: move;
src/templates/modalconfig/index.jsx
@@ -205,6 +205,7 @@
      value: '',
      text: '空'
    }]
    let standardform = null
    _inputfields = config.fields.filter(item => item.type === 'text' || item.type === 'number' || item.type === 'textarea' || item.type === 'color')
    _tabfields = config.fields.filter(item => card.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type))
@@ -212,7 +213,11 @@
    let uniq = new Map()
    uniq.set(card.field, true)
    config.fields.forEach(item => {
    let index = null
    config.fields.forEach((item, i) => {
      if (card.uuid === item.uuid) {
        index = i
      }
      if (item.type !== 'select' && item.type !== 'link' && item.type !== 'radio') return
      if (item.field && !uniq.has(item.field)) {
        uniq.set(item.field, true)
@@ -227,6 +232,14 @@
        })
      }
    })
    if (index !== null) {
      if (index === 0) {
        standardform = config.fields[index + 1] || null
      } else {
        standardform = config.fields[index - 1] || null
      }
    }
    if (subTabConfig) {
      subTabConfig.columns.forEach(col => {
@@ -269,6 +282,7 @@
    }
    this.setState({
      standardform,
      visible: true,
      card: card,
      formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields, !!this.props.editTab)
@@ -684,6 +698,7 @@
            card={this.state.card}
            formlist={this.state.formlist}
            inputSubmit={this.handleSubmit}
            standardform={this.state.standardform}
            wrappedComponentRef={(inst) => this.formRef = inst}
          />
        </Modal>
src/templates/modalconfig/index.scss
@@ -183,9 +183,6 @@
        > .ant-row {
          min-height: 120px;
        }
        .ant-row .ant-col-6 {
          padding: 0 12px!important;
        }
        .ant-row.ant-form-item .ant-col {
          padding: 0;
        }
src/templates/zshare/formconfig.jsx
@@ -2439,7 +2439,7 @@
      precision: 1,
      label: '名称宽度',
      initVal: card.labelwidth || 33.3,
      tooltip: '名称占据表单宽度的百分比。注:存在多列表单时,当前表单如果想要占据整行可参照以下比例,两列(16.3)、三列(10.5)、四列(8.3)',
      tooltip: '名称占据表单宽度的百分比。注:存在多列表单时,当前表单如果想要占据整行可参照以下比例,两列(16.2)、三列(10.5)、四列(7.7)',
      required: true
    },
    {
src/templates/zshare/modalform/index.jsx
@@ -32,7 +32,7 @@
  hint: ['label', 'type', 'blacklist', 'message', 'span', 'labelwidth'],
  split: ['label', 'type'],
  brafteditor: ['required', 'hidelabel', 'hidden', 'readin', 'fieldlength', 'readonly', 'span', 'labelwidth', 'tooltip', 'extra', 'encryption'],
  funcvar: [],
  funcvar: ['span', 'labelwidth'],
  linkMain: ['readonly', 'required', 'hidden', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra']
}
@@ -40,6 +40,7 @@
  static propTpyes = {
    dict: PropTypes.object,    // 字典项
    formlist: PropTypes.any,
    standardform: PropTypes.any,
    card: PropTypes.object,
    inputSubmit: PropTypes.any
  }
@@ -57,7 +58,6 @@
  UNSAFE_componentWillMount () {
    let formlist = fromJS(this.props.formlist).toJS()
    let type = ''
    let resourceType = ''
    let supField = ''
@@ -364,6 +364,50 @@
    })
  }
  changeVal = (val, type) => {
    if (type !== 'span' || ![24, 12, 8, 6].includes(val)) return
    const { standardform } = this.props
    if (!standardform || ![24, 12, 8, 6].includes(standardform.span) || !standardform.labelwidth) return
    let labelwidth = null
    if (standardform.span === val) {
      labelwidth = standardform.labelwidth
    } else if (standardform.span > val) {
      labelwidth = 33.3
    } else {
      switch(standardform.span) {
        case 12:
          labelwidth = 16.2
          break;
        case 8:
          if (val === 12) {
            labelwidth = 21.6
          } else {
            labelwidth = 10.5
          }
          break;
        case 6:
          if (val === 8) {
            labelwidth = 24.3
          } else if (val === 12) {
            labelwidth = 15.8
          } else {
            labelwidth = 7.7
          }
          break;
        default:
      }
    }
    if (labelwidth) {
      this.props.form.setFieldsValue({labelwidth})
    }
  }
  handleSubmit = (e) => {
    e.preventDefault()
@@ -437,7 +481,7 @@
                      message: this.props.dict['form.required.input'] + item.label + '!'
                    }
                  ]
                })(<InputNumber min={item.min} max={item.max} precision={item.precision} onPressEnter={this.handleSubmit}/>)}
                })(<InputNumber onChange={(value) => this.changeVal(value, item.key)} min={item.min} max={item.max} precision={item.precision} onPressEnter={this.handleSubmit}/>)}
              </Form.Item>
            </Col>
          )
src/views/menudesign/menuform/index.scss
@@ -7,4 +7,10 @@
  .ant-input-number {
    width: 100%;
  }
  .ant-form-item {
    height: 50px;
    .ant-form-explain {
      font-size: 12px;
    }
  }
}
src/views/mobdesign/index.jsx
@@ -416,7 +416,7 @@
            components: [],
            viewType: 'menu',
            style: {
              backgroundColor: '#ffffff', backgroundImage: '', paddingLeft: '20px', paddingRight: '20px'
              backgroundColor: '#ffffff', backgroundImage: ''
            }
          }
        }
@@ -778,7 +778,7 @@
        EasyCode: '',
        Template: 'webPage',
        TypeCharOne: sessionStorage.getItem('kei_no'),
        Typename: 'pc',
        Typename: 'mob',
        MenuName: config.MenuName || '',
        PageParam: JSON.stringify({Template: 'webPage'}),
        open_edition: config.open_edition,
@@ -848,7 +848,7 @@
                EasyCode: '',
                Template: item.type,
                TypeCharOne: sessionStorage.getItem('kei_no'),
                Typename: 'pc',
                Typename: 'mob',
                MenuName: item.name || '',
                PageParam: JSON.stringify({Template: item.type}),
                open_edition: item.open_edition || '',
src/views/mobdesign/menuform/index.scss
@@ -7,4 +7,10 @@
  .ant-input-number {
    width: 100%;
  }
  .ant-form-item {
    height: 50px;
    .ant-form-explain {
      font-size: 12px;
    }
  }
}
src/views/pcdesign/menuform/index.scss
@@ -7,4 +7,10 @@
  .ant-input-number {
    width: 100%;
  }
  .ant-form-item {
    height: 50px;
    .ant-form-explain {
      font-size: 12px;
    }
  }
}