king
2023-09-26 3140b58a56be4b1693766121dacb83fe6f6f21df
2023-09-26
14个文件已修改
183 ■■■■ 已修改文件
src/menu/components/table/base-table/columns/index.jsx 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/base-table/index.jsx 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/index.jsx 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/index.scss 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/debug/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/components/search/single-search/options.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/searchconfig/settingform/index.jsx 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/cardcellList/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/exceloutbutton/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/fieldscomponent/editcard/index.jsx 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/fieldscomponent/editcard/index.scss 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/fieldscomponent/index.jsx 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/base-table/columns/index.jsx
@@ -3,7 +3,7 @@
import { is, fromJS } from 'immutable'
import { DndProvider, DragSource, DropTarget } from 'react-dnd'
import { Table, Popover, Modal, message, notification } from 'antd'
import { PlusOutlined, PlusSquareOutlined, EditOutlined, CopyOutlined, DeleteOutlined, FontColorsOutlined, CloseCircleOutlined, AntDesignOutlined, InfoOutlined } from '@ant-design/icons'
import { PlusOutlined, PlusSquareOutlined, EditOutlined, CopyOutlined, DeleteOutlined, FontColorsOutlined, CloseCircleOutlined, AntDesignOutlined } from '@ant-design/icons'
import asyncComponent from '@/utils/asyncComponent'
import asyncIconComponent from '@/utils/asyncIconComponent'
@@ -615,26 +615,26 @@
    })
  }
  copyFields = () => {
    const { config } = this.props
    let m = []
    let n = []
  // copyFields = () => {
  //   const { config } = this.props
  //   let m = []
  //   let n = []
    config.columns.forEach(col => {
      m.push(`${col.field} ${col.datatype}`)
      n.push(col.field)
    })
  //   config.columns.forEach(col => {
  //     m.push(`${col.field} ${col.datatype}`)
  //     n.push(col.field)
  //   })
    let oInput = document.createElement('input')
    oInput.value = `/*${m.join(',')}*/
      ${n.join(',')}`
    document.body.appendChild(oInput)
    oInput.select()
    document.execCommand('Copy')
    document.body.removeChild(oInput)
  //   let oInput = document.createElement('input')
  //   oInput.value = `/*${m.join(',')}*/
  //     ${n.join(',')}`
  //   document.body.appendChild(oInput)
  //   oInput.select()
  //   document.execCommand('Copy')
  //   document.body.removeChild(oInput)
    message.success('复制成功。')
  }
  //   message.success('复制成功。')
  // }
  componentDidMount () {
    MKEmitter.addListener('plusColumns', this.plusColumns)
@@ -680,7 +680,7 @@
          <FieldsComponent config={config} type="columns" />
          <CopyOutlined title="复制显示列" onClick={this.copycolumn} />
          <MarkColumn columns={fields} type="line" marks={lineMarks} onSubmit={this.updateLineMarks} />
          <InfoOutlined title="复制字段" style={{color: 'orange'}} onClick={this.copyFields}/>
          {/* <InfoOutlined title="复制字段" style={{color: 'orange'}} onClick={this.copyFields}/> */}
        </div>
        <DndProvider>
          {groups ? groups.map((group, i) => {
src/menu/components/table/base-table/index.jsx
@@ -259,12 +259,23 @@
    config.cols.forEach(col => {
      if (!col.field) return
      if (['text', 'picture', 'video', 'textarea'].includes(col.type)) {
        let datatype = `Nvarchar(${col.fieldlength || 50})`
        let type = 'text'
        if (col.type === 'text') {
          if (col.textFormat === 'YYYY-MM-DD') {
            datatype = 'date'
          } else if (col.textFormat === 'YYYY-MM-DD HH:mm:ss') {
            datatype = 'datetime'
          }
        }
        config.columns.push({
          datatype: `Nvarchar(${col.fieldlength || 50})`,
          datatype: datatype,
          field: col.field,
          fieldlength: col.fieldlength || 50,
          label: col.label,
          type: 'text',
          type: type,
          uuid: col.uuid
        })
      } else if (col.type === 'link') {
src/menu/datasource/verifycard/index.jsx
@@ -216,6 +216,27 @@
    columns.reverse()
    subColumns.reverse()
    columns.forEach(col => {
      if (!col.datatype) return
      if (/^nvarchar/.test(col.datatype)) {
        col.datatype = col.datatype.replace(/^nvarchar/, 'Nvarchar')
      } else if (/^decimal/.test(col.datatype)) {
        col.datatype = col.datatype.replace(/^decimal/, 'Decimal')
      } else if (/^int/.test(col.datatype)) {
        col.datatype = col.datatype.replace(/^int/, 'Int')
      }
    })
    subColumns.forEach(col => {
      if (!col.datatype) return
      if (/^nvarchar/.test(col.datatype)) {
        col.datatype = col.datatype.replace(/^nvarchar/, 'Nvarchar')
      } else if (/^decimal/.test(col.datatype)) {
        col.datatype = col.datatype.replace(/^decimal/, 'Decimal')
      } else if (/^int/.test(col.datatype)) {
        col.datatype = col.datatype.replace(/^int/, 'Int')
      }
    })
    this.setState({
      scripts,
      columns: columns,
@@ -844,11 +865,25 @@
    const { columns } = this.state
    let m = []
    let n = []
    let s = []
    columns.forEach(col => {
      m.push(`${col.field} ${col.datatype}`)
      n.push(col.field)
      m.unshift(`${col.field} ${col.datatype}`)
      n.unshift(col.field)
      if (/decimal|int/ig.test(col.datatype)) {
        s.unshift(`${Math.round(Math.random() * 10)} as ${col.field}`)
      } else if (/datetime/.test(col.datatype)) {
        s.unshift(`'${moment().format('YYYY-MM-DD HH:mm:ss')}' as ${col.field}`)
      } else if (/date/.test(col.datatype)) {
        s.unshift(`'${moment().format('YYYY-MM-DD')}' as ${col.field}`)
      } else {
        s.unshift(`'${col.label}' as ${col.field}`)
      }
    })
    if (window.debugger) {
      console.info('select ' + s.join(', '))
    }
    let oInput = document.createElement('input')
    oInput.value = `/*${m.join(',')}*/
@@ -1016,7 +1051,15 @@
              updatefield={this.updatefields}
            />
            <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} searchKey={searchKey} type="datasourcefield" wrappedComponentRef={(inst) => this.datasource = inst} data={columns} columns={colColumns} onChange={(columns) => this.setState({columns})}/>
          </TabPane> : null}
          </TabPane> : <TabPane tab={
            <span>
              字段集
              {columns.length ? <span className="count-tip">{columns.length}</span> : null}
            </span>
          } key="columns">
            <div className="base-table-columns"></div>
            <EditTable actions={[]} searchKey={searchKey} type="datasourcefield" data={columns} columns={colColumns}/>
          </TabPane>}
          {config.subtype === 'dualdatacard' ? <TabPane tab={
            <span>
              子表字段集
src/menu/datasource/verifycard/index.scss
@@ -5,6 +5,14 @@
    top: 220px;
    z-index: 1;
  }
  .base-table-columns {
    height: 15px;
  }
  .base-table-columns + .modal-edit-table {
    .editable-row > td:last-child {
      padding: 14px 10px;
    }
  }
  .data-source-card-box {
    .ant-tabs-nav-scroll {
      text-align: center;
src/menu/debug/index.jsx
@@ -615,8 +615,6 @@
      }
  
      columns.forEach(col => {
        if (col.field === 'works_flow_param') return
        if (col.type === 'colspan' || col.type === 'old_colspan') {
          col.subcols.forEach(cell => {
            setField(cell)
src/mob/components/search/single-search/options.jsx
@@ -42,6 +42,7 @@
      field: 'initval',
      label: '初始值',
      initval: wrap.initval || '',
      tooltip: '可使用@username@、@fullName@',
      required: false
    },
    {
src/mob/searchconfig/settingform/index.jsx
@@ -127,7 +127,12 @@
            </Form.Item>
          </Col> : null}
          {type === 'search' ? <Col span={12}>
            <Form.Item label="初始值">
            <Form.Item label={
              <Tooltip placement="topLeft" title="可使用@username@、@fullName@。">
                <QuestionCircleOutlined className="mk-form-tip" />
                初始值
              </Tooltip>
            }>
              {getFieldDecorator('initval', {
                initialValue: config.setting.initval,
                rules: [
src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -76,7 +76,7 @@
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props.data), fromJS(nextProps.data)) || (nextProps.syncData && !is(fromJS(this.props.syncData), fromJS(nextProps.syncData)))
    return !is(fromJS(this.props.data), fromJS(nextProps.data)) || (nextProps.syncData ? !is(fromJS(this.props.syncData), fromJS(nextProps.syncData)) : false)
  }
  /**
src/tabviews/zshare/actionList/exceloutbutton/index.jsx
@@ -813,8 +813,11 @@
      _orderBy = btn.verify.order || ''
    } else {
      _setting = {...setting}
      _setting.$name = btn.logLabel
      _setting.laypage = pagination
      _setting.arr_field = _setting.all_field || _setting.arr_field
      delete _setting.sub_field
    }
    let primaryId = ''
src/templates/sharecomponent/fieldscomponent/editcard/index.jsx
@@ -13,11 +13,12 @@
    let _type = props.card.type
    if (!props.card.origin) {
      if (props.type === 'columns') {
        if (_type !== 'number') {
          _type = 'text'
        }
      } else if (props.type === 'search') {
      // if (props.type === 'columns') {
      //   if (_type !== 'number') {
      //     _type = 'text'
      //   }
      // }
      if (props.type === 'search') {
        if (_type === 'date' || _type === 'datetime') {
          _type = 'date'
        } else if (_type !== 'select') {
@@ -74,8 +75,11 @@
  render() {
    const { card, type } = this.state
    let hasPadding = type === 'search' || type === 'form'
    return (
      <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '')  + (card.origin ? ' fixed' : '')} >
      <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '')  + (card.origin ? ' fixed' : '') + (hasPadding ? ' has-padding' : '')} >
        <div className="base" onClick={this.changeSelect}>
          <CheckOutlined />
          <p title={card.field}>字段: <span>{card.field}</span></p>
@@ -88,12 +92,12 @@
            <Radio value="date">date</Radio>
          </Radio.Group> : null
        }
        {type === 'columns' ?
        {/* {type === 'columns' ?
          <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected || card.origin}>
            <Radio value="text">text</Radio>
            <Radio value="number">number</Radio>
          </Radio.Group> : null
        }
        } */}
        {type === 'form' ?
          <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected || card.origin}>
            <Radio value="text">text</Radio>
src/templates/sharecomponent/fieldscomponent/editcard/index.scss
@@ -4,7 +4,7 @@
  .ant-col {
    padding: 10px;
    .ant-card {
      padding: 0px 10px 10px;
      padding: 0px;
      p {
        margin-bottom: 5px;
        overflow: hidden;
@@ -25,10 +25,16 @@
        opacity: 0.4;
      }
      .base {
        padding-top: 10px;
        padding: 10px;
        cursor: pointer;
      }
    }
    .ant-card.has-padding {
      padding: 0px 10px 10px;
      .base {
        padding: 10px 0 0;
      }
    }
    .ant-card.selected, .ant-card.fixed {
      border-color: #1890ff;
      box-shadow: 0px 0px 4px #1890ff;
src/templates/sharecomponent/fieldscomponent/index.jsx
@@ -58,6 +58,7 @@
            if (res.FDName && res.FDName.length > 0) {
              tabmsg.columns = res.FDName.map(item => {
                let _type = item.FieldType.toLowerCase()
                let _datatype = item.FieldType.toLowerCase()
                let _decimal = 0
                let _length = 50
                if (/^nvarchar/.test(_type)) {
@@ -80,6 +81,14 @@
                } else {
                  _type = 'text'
                }
                if (/^nvarchar/.test(_datatype)) {
                  _datatype = _datatype.replace(/^nvarchar/, 'Nvarchar')
                } else if (/^decimal/.test(_datatype)) {
                  _datatype = _datatype.replace(/^decimal/, 'Decimal')
                } else if (/^int/.test(_datatype)) {
                  _datatype = _datatype.replace(/^int/, 'Int')
                }
    
                return {
                  field: item.FieldName || '',
@@ -88,7 +97,7 @@
                  datatype: _type,
                  decimal: _decimal,
                  length: _length,
                  $datatype: item.FieldType.toLowerCase()
                  $datatype: _datatype
                }
              })
            }
@@ -232,7 +241,7 @@
          field: item.field,
          Hide: 'false',
          IsSort: 'true',
          type: item.type,
          type: item.type === 'number' ? 'number' : 'text',
          Width: item.type === 'number' ? 80 : 120
        }
@@ -240,6 +249,12 @@
          newcard.decimal = item.decimal
        } else {
          newcard.fieldlength = item.length || 50
        }
        if (item.type === 'date') {
          newcard.textFormat = 'YYYY-MM-DD'
        } else if (item.type === 'datetime') {
          newcard.textFormat = 'YYYY-MM-DD HH:mm:ss'
        }
        items.push(newcard)
@@ -257,6 +272,7 @@
          field: item.field,
          datatype: _t
        }
        items.unshift(newcard)
        keys.push(item.field.toLowerCase())
      })
src/templates/zshare/formconfig.jsx
@@ -448,7 +448,7 @@
      type: 'text',
      key: 'initval',
      label: '初始值',
      tooltip: '类型为下拉菜单时,初始值应为数据的Value值(使用数据源时,应为《值·字段》的值);类型为数值(区间)时,初始值使用逗号拼接,例如 3,10',
      tooltip: '类型为下拉菜单时,初始值应为数据的Value值(使用数据源时,应为《值·字段》的值);类型为数值(区间)时,初始值使用逗号拼接,例如 3,10;文本与下拉菜单中可使用@username@、@fullName@',
      initVal: card.initval,
      required: false
    },
src/utils/utils.js
@@ -407,6 +407,10 @@
      }
      if (item.type === 'text' || item.type === 'select') {
        if (/@username@|@fullName@/ig.test(item.initval)) {
          item.initval = item.initval.replace(/@username@/ig, sessionStorage.getItem('User_Name') || '').replace(/@fullName@/ig, sessionStorage.getItem('Full_Name') || '')
          item.oriInitval = item.initval
        }
        if (/,/.test(item.field)) {
          item.field.split(',').forEach(field => {
            keys.push(field.toLowerCase())
@@ -1557,8 +1561,6 @@
    }
    columns.forEach(col => {
      if (col.field === 'works_flow_param') return
      if (col.type === 'colspan' || col.type === 'old_colspan') {
        col.subcols.forEach(cell => {
          setField(cell)