king
2022-04-26 5046d0d13dc6a8563b8e54e31913bc44cfa1072f
src/pc/createview/settingform/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Select, Input, Tooltip } from 'antd'
import { Form, Row, Col, Select, Input, Tooltip, Radio } from 'antd'
import { QuestionCircleOutlined } from '@ant-design/icons'
import './index.scss'
@@ -11,7 +11,8 @@
  }
  state = {
    appMenus: []
    appMenus: [],
    copymenuId: ''
  }
  UNSAFE_componentWillMount () {
@@ -19,6 +20,14 @@
    if (appMenus) {
      try {
        appMenus = JSON.parse(appMenus)
        appMenus = appMenus.map(item => {
          item.name = item.MenuName
          if (item.MenuNo && item.MenuNo !== item.MenuName) {
            item.name = item.MenuName + `(${item.MenuNo})`
          }
          return item
        })
      } catch (e) {
        appMenus = []
      }
@@ -44,7 +53,7 @@
  render() {
    const { getFieldDecorator } = this.props.form
    const { appMenus } = this.state
    const { appMenus, copymenuId } = this.state
    const formItemLayout = {
      labelCol: {
@@ -113,14 +122,36 @@
              {getFieldDecorator('copymenuId', {
                initialValue: ''
              })(
                <Select allowClear showSearch filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}>
                <Select
                  allowClear
                  showSearch
                  onChange={(val) => this.setState({copymenuId: val})}
                  filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                >
                  {appMenus.map(option =>
                    <Select.Option key={option.MenuID} value={option.MenuID}>{option.MenuName}</Select.Option>
                    <Select.Option key={option.MenuID} value={option.MenuID}>{option.name}</Select.Option>
                  )}
                </Select>
              )}
            </Form.Item>
          </Col>
          {copymenuId ? <Col span={20}>
            <Form.Item label={
              <Tooltip placement="topLeft" title="复制菜单时,是否清空原页面中的关联菜单。">
                <QuestionCircleOutlined className="mk-form-tip" />
                清空关联菜单
              </Tooltip>
            }>
              {getFieldDecorator('clearMenu', {
                initialValue: 'true'
              })(
                <Radio.Group>
                  <Radio value={'true'}>是</Radio>
                  <Radio value={'false'}>否</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col> : null}
        </Row>
      </Form>
    )