king
2020-08-17 a4ba5d208b8335c634dffd612c2bf310b1dea607
2020-08-17
15个文件已修改
1个文件已添加
196 ■■■■ 已修改文件
src/assets/img/calendar.jpg 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/en-US/model.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/zh-CN/model.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/calendar/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/calendar/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/calendarconfig/index.jsx 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/editthdmenu/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/datasourcecomponent/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/datasourcecomponent/verifycard/index.jsx 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/datasourcecomponent/verifycard/index.scss 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/datasourcecomponent/verifycard/settingform/index.jsx 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/fieldscomponent/editcard/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/fieldscomponent/index.jsx 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/source.jsx 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/editcard/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/option.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/calendar.jpg
src/locales/en-US/model.js
@@ -65,7 +65,8 @@
  'header.menu.action.configurable': 'Button Configurable',
  'header.menu.tab.configurable': 'Tab Configurable',
  'header.menu.column': 'Column',
  'header.menu.column.add': 'Add columns',
  'model.menu.column.add': 'Add columns',
  'model.menu.field.add': 'Add fields',
  'header.menu.page.configurable': 'Configuration Page',
  'header.menu.viewName': 'The name of the page',
  'header.menu.tabName': 'Tag name',
src/locales/zh-CN/model.js
@@ -65,7 +65,8 @@
  'header.menu.action.configurable': '按钮配置',
  'header.menu.tab.configurable': '标签配置',
  'header.menu.column': '显示列',
  'header.menu.column.add': '添加显示列',
  'model.menu.column.add': '添加显示列',
  'model.menu.field.add': '添加字段',
  'header.menu.page.configurable': '页面配置',
  'header.menu.viewName': '页面名称',
  'header.menu.tabName': '标签名称',
src/tabviews/calendar/index.jsx
@@ -607,6 +607,7 @@
          destroyOnClose
        >
          {config.tab ? <SubTabTable
            type="calendar"
            BID={triggerTime}
            Tab={config.tab}
            SupMenuID={this.props.MenuID}
src/tabviews/zshare/calendar/index.jsx
@@ -64,8 +64,10 @@
  UNSAFE_componentWillReceiveProps(nextProps) {
    if (!is(fromJS(this.props.data), fromJS(nextProps.data))) {
      let datelist = this.mountdata(this.state.datelist, nextProps.data || [])
      let datelist = this.getDateList(this.state.selectYear)
      let monthlist = null
      datelist = this.mountdata(datelist, nextProps.data || [])
      if (this.state.levels.includes('month') || this.state.levels.includes('year')) {
        monthlist = datelist.filter(item => item.month === this.state.selectMonth)[0]
@@ -83,7 +85,7 @@
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
    return !is(fromJS(this.props.loading), fromJS(nextProps.loading)) || !is(fromJS(this.state), fromJS(nextState))
  }
  mountdata = (datelist, data) => {
src/templates/calendarconfig/index.jsx
@@ -779,15 +779,6 @@
    })
  }
  /**
   * @description 批量添加,更新配置信息
   */
  updatefield = (config) => {
    this.setState({
      config: config
    })
  }
  // 年切换时重新生成数据
  changeDate = (year) => {
    this.setState({
@@ -830,7 +821,7 @@
                  config={config}
                  type="search"
                  tableFields={this.state.tableFields}
                  updatefield={this.updatefield}
                  updatefield={this.updateconfig}
                />
              </Panel>
            </Collapse>
@@ -850,10 +841,10 @@
              </div>
            } style={{ width: '100%' }}>
              <SettingComponent
                type="subtable"
                config={config}
                MenuID={config.uuid}
                menuformRef={this.menuformRef}
                tableFields={this.state.tableFields}
                permFuncField={this.props.permFuncField}
                updateConfig={this.updateconfig}
              />
src/templates/menuconfig/editthdmenu/index.jsx
@@ -12,6 +12,7 @@
import enUS from '@/locales/en-US/model.js'
import mainsubtable from '@/assets/img/mainsubtable.jpg'
import treepage from '@/assets/img/treepage.jpg'
import calendar from '@/assets/img/calendar.jpg'
import Preview from './preview'
import MenuForm from './menuform'
@@ -41,7 +42,7 @@
const illust = { // 模板图片,用于已使用模板
  CommonTable: mainsubtable,
  TreePage: treepage,
  CalendarPage: treepage
  CalendarPage: calendar
}
class EditMenu extends Component {
src/templates/sharecomponent/datasourcecomponent/index.jsx
@@ -11,6 +11,9 @@
class DataSource extends Component {
  static propTpyes = {
    config: PropTypes.any,
    MenuID: PropTypes.string,
    tableFields: PropTypes.any,
    permFuncField: PropTypes.any,
    updateConfig: PropTypes.func
  }
@@ -75,6 +78,8 @@
          <VerifyCard
            dict={dict}
            config={config}
            tableFields={this.props.tableFields}
            permFuncField={this.props.permFuncField}
            menuId={this.props.config.uuid}
            searches={config.search}
            wrappedComponentRef={(inst) => this.verifyRef = inst}
src/templates/sharecomponent/datasourcecomponent/verifycard/index.jsx
@@ -7,6 +7,7 @@
import Api from '@/api'
import Utils from '@/utils/utils.js'
import asyncComponent from '@/utils/asyncComponent'
import ColForm from './columnform'
import CustomScriptsForm from './customscript'
import SettingForm from './settingform'
@@ -16,12 +17,16 @@
const { TabPane } = Tabs
const { Paragraph } = Typography
const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent'))
class VerifyCard extends Component {
  static propTpyes = {
    dict: PropTypes.object,     // 字典项
    config: PropTypes.object,   // 数据源信息
    menuId: PropTypes.string,   // 菜单Id
    searches: PropTypes.array,  // 搜索条件
    dict: PropTypes.object,          // 字典项
    tableFields: PropTypes.any,      // 数据源信息
    permFuncField: PropTypes.any,    // 数据源信息
    config: PropTypes.object,        // 数据源信息
    menuId: PropTypes.string,        // 菜单Id
    searches: PropTypes.array,       // 搜索条件
  }
  state = {
@@ -453,6 +458,12 @@
    }
  }
  updatefields = (columns) => {
    this.setState({
      columns: columns
    })
  }
  /**
   * @description 组件销毁,清除state更新
   */
@@ -473,6 +484,7 @@
            <SettingForm
              menuId={this.props.menuId}
              dict={this.props.dict}
              permFuncField={this.props.permFuncField}
              columns={columns}
              setting={setting}
              scripts={scripts}
@@ -485,6 +497,12 @@
              columnChange={this.columnChange}
              wrappedComponentRef={(inst) => this.contrastForm = inst}
            />
            <FieldsComponent
              config={{...this.props.config, columns}}
              type="fields"
              tableFields={this.props.tableFields}
              updatefield={this.updatefields}
            />
            <Table
              bordered
              rowKey="uuid"
src/templates/sharecomponent/datasourcecomponent/verifycard/index.scss
@@ -16,6 +16,13 @@
      word-wrap: break-word;
      word-break: break-word;
    }
    .quickly-add {
      position: relative;
      width: 100px;
      float: right;
      top: -5px;
      z-index: 2;
    }
    .verify-form {
      .ant-input-number {
        width: 100%;
src/templates/sharecomponent/datasourcecomponent/verifycard/settingform/index.jsx
@@ -4,17 +4,19 @@
import moment from 'moment'
import Api from '@/api'
import { formRule } from '@/utils/option.js'
import Utils from '@/utils/utils.js'
import CodeMirror from '@/templates/zshare/codemirror'
import './index.scss'
class SettingForm extends Component {
  static propTpyes = {
    dict: PropTypes.object,      // 字典项
    menuId: PropTypes.string,    // 菜单Id
    setting: PropTypes.object,   // 数据源配置
    columns: PropTypes.array,    // 列设置
    scripts: PropTypes.array,    // 自定义脚本
    dict: PropTypes.object,       // 字典项
    menuId: PropTypes.string,     // 菜单Id
    permFuncField: PropTypes.any, // 菜单Id
    setting: PropTypes.object,    // 数据源配置
    columns: PropTypes.array,     // 列设置
    scripts: PropTypes.array,     // 自定义脚本
  }
  state = {
@@ -121,7 +123,7 @@
  }
  render() {
    const { setting } = this.props
    const { setting, permFuncField } = this.props
    const { getFieldDecorator } = this.props.form
    const { interType } = this.state
@@ -134,6 +136,20 @@
        xs: { span: 24 },
        sm: { span: 16 }
      }
    }
    let tooltip = null
    let rules = []
    if (permFuncField && permFuncField.length > 0) {
      tooltip = '开头可用字符:' + permFuncField.join(', ')
      let str = '^(' + permFuncField.join('|') + ')'
      let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g')
      rules.push({
        pattern: _patten,
        message: formRule.func.innerMessage
      })
    }
    return (
@@ -171,12 +187,15 @@
              </Form.Item>
            </Col>
            {interType === 'inner' ? <Col span={8}>
              <Form.Item label="内部函数">
              <Form.Item label={tooltip ?
                <Tooltip placement="topLeft" title={tooltip}>
                  <Icon type="question-circle" />
                  内部函数
                </Tooltip> : '内部函数'
              }>
                {getFieldDecorator('innerFunc', {
                  initialValue: setting.innerFunc || '',
                  rules: [
                  ]
                  rules: rules
                })(<Input placeholder={''} autoComplete="off" />)}
              </Form.Item>
            </Col> : null}
src/templates/sharecomponent/fieldscomponent/editcard/index.jsx
@@ -129,7 +129,7 @@
      <div className="common-modal-edit-card">
        <Row className="search-row">
          <Col span={8}>
            {!loading ? <Search placeholder={dict['form.required.input'] + dict['header.form.field']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null}
            {!loading ? <Search placeholder={dict['form.required.input'] + dict['model.form.field']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null}
          </Col>
          <Col span={8}>
            <Button onClick={this.reset}>
src/templates/sharecomponent/fieldscomponent/index.jsx
@@ -60,6 +60,13 @@
          columns.set(item.field, {...item, selected: true, datatype: _datatype})
        }
      })
    } else if (type === 'fields') {
      config.columns.forEach(item => {
        if (columns.has(item.field)) {
          let _datatype = columns.get(item.field).datatype
          columns.set(item.field, {...item, selected: true, datatype: _datatype})
        }
      })
    }
    // 显示字段集弹窗
@@ -183,18 +190,60 @@
          items.push(newcard)
        }
      })
    } else if (type === 'fields') {
      config.columns.forEach(item => {
        if (columnsMap.has(item.field)) {
          let cell = columnsMap.get(item.field)
          if (cell.selected) {
            items.push(item)
          }
          columnsMap.delete(item.field)
        } else {
          items.push(item)
        }
      })
      let _columns = [...columnsMap.values()]
      _columns.forEach(item => {
        if (item.selected) {
          let newcard = {
            uuid: Utils.getuuid(),
            label: item.label,
            field: item.field,
            datatype: item.type === 'number' ? 'Decimal(18,0)' : 'Nvarchar(50)'
          }
          items.push(newcard)
        }
      })
    }
    let _config = null
    if (type === 'search') {
      _config = {...this.props.config, search: items}
      this.props.updatefield(_config)
      notification.success({
        top: 92,
        message: '操作成功',
        duration: 2
      })
    } else if (type === 'columns') {
      _config = {...this.props.config, columns: items}
    }
    if (_config) {
      this.props.updatefield(_config)
      notification.success({
        top: 92,
        message: '操作成功',
        duration: 2
      })
    } else if (type === 'fields') {
      this.props.updatefield(items)
      notification.success({
        top: 92,
@@ -225,11 +274,13 @@
    if (type === 'search') {
      label = dict['header.menu.search.add']
    } else if (type === 'columns') {
      label = dict['header.menu.column.add']
      label = dict['model.menu.column.add']
    } else if (type === 'fields') {
      label = dict['model.menu.field.add']
    }
    return (
      <div>
      <div className="quickly-add">
        <Button type="primary" block onClick={this.queryField}>{label}</Button>
        {/* 根据字段名添加显示列及搜索条件 */}
        <Modal
src/templates/subtableconfig/source.jsx
@@ -248,12 +248,6 @@
    },
    {
      type: 'action',
      label: CommonDict['model.form.popview'],
      subType: 'popview',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['model.form.prompt'],
      subType: 'prompt',
      url: ''
@@ -278,6 +272,24 @@
    },
    {
      type: 'action',
      label: CommonDict['model.form.popview'],
      subType: 'popview',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['model.form.tab'],
      subType: 'tab',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['model.form.newpage'],
      subType: 'innerpage',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['model.form.funcbutton'],
      subType: 'funcbutton',
      url: ''
src/templates/zshare/editcard/index.jsx
@@ -129,7 +129,7 @@
      <div className="common-modal-edit-card">
        <Row className="search-row">
          <Col span={8}>
            {!loading ? <Search placeholder={dict['form.required.input'] + dict['header.form.field']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null}
            {!loading ? <Search placeholder={dict['form.required.input'] + dict['model.form.field']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null}
          </Col>
          <Col span={8}>
            <Button onClick={this.reset}>
src/utils/option.js
@@ -3,6 +3,7 @@
import nortable from '@/assets/img/normaltable.jpg'
import mainsubtable from '@/assets/img/mainsubtable.jpg'
import treepage from '@/assets/img/treepage.jpg'
import calendar from '@/assets/img/calendar.jpg'
import rolemanage from '@/assets/img/rolemanage.jpg'
const _dict =  sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
@@ -72,7 +73,7 @@
  {
    title: '日历',
    type: 'CalendarPage',
    url: treepage,
    url: calendar,
    baseconfig: '',
    isSystem: true
  },