king
2023-08-24 0c1a33a33b45fc3265cb7fef20beb48407cd6c98
src/menu/datasource/verifycard/settingform/index.jsx
@@ -27,16 +27,24 @@
    modules: [],
    innerRules: [],
    innertip: '',
    MenuType: '',
    ismain: false
  }
  UNSAFE_componentWillMount () {
    const { config, setting } = this.props
    let modules = MenuUtils.getSupModules(window.GLOB.customMenu.components, config.uuid, window.GLOB.customMenu.interfaces)
    let menu = window.GLOB.customMenu
    let MenuType = ''
    if (menu.parentId === 'BillPrintTemp') {
      MenuType = 'billPrint'
    }
    let modules = MenuUtils.getSupModules(menu.components, config.uuid, menu.interfaces)
    let ismain = false
    if (window.GLOB.customMenu.Template === 'BaseTable') {
    if (menu.Template === 'BaseTable') {
      ismain = config.name === '主表'
    }
@@ -82,7 +90,7 @@
      }
    }
    this.setState({modules, innerRules, innertip, setting: _setting, ismain})
    this.setState({modules, innerRules, innertip, setting: _setting, ismain, MenuType})
  }
  handleConfirm = () => {
@@ -95,6 +103,10 @@
          if (['navbar', 'balcony', 'menubar', 'interface'].includes(config.type)) {
            values.onload = 'true'
          }
          if (values.interType === 'system' && values.onload === 'false') {
            values.sync = 'false'
          }
          // 数据源前端验证
@@ -127,6 +139,14 @@
              notification.warning({
                top: 92,
                message: '数据源中,不可出现字符 -- ,注释请用 /*内容*/',
                duration: 5
              })
              reject()
              return
            } else if (/,,/ig.test(values.dataresource)) {
              notification.warning({
                top: 92,
                message: '数据源中,不可出现连续的英文逗号(,,)',
                duration: 5
              })
              reject()
@@ -169,7 +189,7 @@
  render() {
    const { columns, config } = this.props
    const { getFieldDecorator } = this.props.form
    const { setting, modules, innerRules, innertip } = this.state
    const { setting, modules, innerRules, innertip, MenuType } = this.state
    const formItemLayout = {
      labelCol: {
@@ -337,7 +357,7 @@
            </Col> : null}
            {setting.interType === 'system' ? <Col span={24} className="data-source" style={{paddingLeft: '7px'}}>
              <Form.Item labelCol={{xs: { span: 24 }, sm: { span: 2 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 22 }} } label={
                <Tooltip placement="topLeft" title={`使用系统函数时,需填写数据源。注:数据权限替换符 $@ -> /* 或 ''、 @$ -> */ 或 '';查询替换符 $select@ -> /* 或 ''、 @select$ -> */ 或 '';统计替换符 $sum@ -> /* 或 ''、 @sum$ -> */ 或 ''。`}>
                <Tooltip placement="topLeft" title={`使用系统函数时,需填写数据源。注:数据权限替换符 $@ -> /* 或 ''、 @$ -> */ 或 ''。`}>
                  <QuestionCircleOutlined className="mk-form-tip" />
                  数据源
                </Tooltip>
@@ -386,7 +406,12 @@
            </Col>
            {/* 数组数据,需设置排序规则 */}
            {config.format === 'array' ? <Col span={8}>
              <Form.Item label="默认排序">
              <Form.Item label={
                <Tooltip placement="topLeft" title="如果在自定义脚本中使用了@pageSize@或@orderBy@,请在数据源中单独写排序语句。">
                  <QuestionCircleOutlined className="mk-form-tip" />
                  默认排序
                </Tooltip>
              }>
                {getFieldDecorator('order', {
                  initialValue: setting.order || 'ID desc',
                  rules: [
@@ -409,7 +434,7 @@
                </Radio.Group>)}
              </Form.Item>
            </Col> : null}
            {!['navbar', 'balcony', 'menubar'].includes(config.type) && (!config.wrap || config.wrap.supType !== 'multi') ? <Col span={8}>
            {!['navbar', 'balcony', 'menubar'].includes(config.type) && (!config.wrap || config.wrap.supType !== 'multi') && MenuType !== 'billPrint' ? <Col span={8}>
              <Form.Item label={
                <Tooltip placement="topLeft" title={'该组件如果受其他组件控制,请选项相应的组件,没有时选“无”。'}>
                  <QuestionCircleOutlined className="mk-form-tip" />
@@ -460,9 +485,9 @@
              </Form.Item>
            </Col> : null}
            {/* 1、不分页且不存在上级模块 */}
            {!['navbar', 'interface'].includes(config.type) && !['editable', 'basetable', 'dualdatacard'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') && setting.interType === 'system' ? <Col span={8}>
            {!['navbar', 'interface', 'calendar'].includes(config.type) && !['editable', 'basetable', 'dualdatacard'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') && setting.interType === 'system' && setting.onload !== 'false' ? <Col span={8}>
              <Form.Item label={
                <Tooltip placement="topLeft" title={'初始化加载时,是否与其他组件一同加载数据,注:仅在使用系统函数,且初始化加载数据时有效,分页请求时无效。'}>
                <Tooltip placement="topLeft" title={'初始化加载时,是否与其他组件一同加载数据,注:如菜单未使用后端缓存,则查询语句大于8000字符时无效。'}>
                  <QuestionCircleOutlined className="mk-form-tip" />
                  同步查询
                </Tooltip>
@@ -516,14 +541,31 @@
                {getFieldDecorator('onload', {
                  initialValue: setting.onload || 'true'
                })(
                  <Radio.Group>
                  <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'onload')}}>
                    <Radio value="true">加载</Radio>
                    <Radio value="false">不加载</Radio>
                  </Radio.Group>
                )}
              </Form.Item>
            </Col> : null}
            {config.type === 'interface' ? <Col span={8}>
            {config.type === 'interface' && ((setting.supModule && setting.supModule[0] === 'empty') || MenuType === 'billPrint') ? <Col span={8}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="初始化加载将在页面加载前执行。">
                  <QuestionCircleOutlined className="mk-form-tip" />
                  加载方式
                </Tooltip>
              }>
                {getFieldDecorator('loadlevel', {
                  initialValue: setting.loadlevel || 'default'
                })(
                  <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'loadlevel')}}>
                    <Radio value="default">默认</Radio>
                    <Radio value="init">初始化</Radio>
                  </Radio.Group>
                )}
              </Form.Item>
            </Col> : null}
            {config.type === 'interface' && MenuType !== 'billPrint' ? <Col span={8}>
              <Form.Item label="定时器">
                {getFieldDecorator('timer', {
                  initialValue: setting.timer || ''