king
2021-08-26 e9c48bd7356462ba9257540b130a47a65ad1861d
src/pc/components/login/wrapsetting/settingform/index.jsx
@@ -13,25 +13,13 @@
  }
  state = {
    roleList: [],
    msgTemps: [],
    appMenus: [],
    link: this.props.wrap.link || 'menu'
  }
  UNSAFE_componentWillMount () {
    let roleList = sessionStorage.getItem('sysRoles')
    let msgTemps = sessionStorage.getItem('msgTemplate')
    if (roleList) {
      try {
        roleList = JSON.parse(roleList)
      } catch {
        roleList = []
      }
    } else {
      roleList = []
    }
    if (msgTemps) {
      try {
@@ -54,7 +42,7 @@
      appMenus = []
    }
    this.setState({roleList, msgTemps, appMenus})
    this.setState({msgTemps, appMenus})
  }
  handleConfirm = () => {
@@ -89,7 +77,7 @@
  render() {
    const { wrap } = this.props
    const { getFieldDecorator } = this.props.form
    const { roleList, msgTemps, appMenus, link } = this.state
    const { msgTemps, appMenus, link } = this.state
    const formItemLayout = {
      labelCol: {
@@ -137,8 +125,9 @@
                })(
                  <Checkbox.Group
                    options={[
                      { label: '账号密码', value: 'uname_pwd' },
                      { label: '短信验证码', value: 'sms_vcode' },
                      { label: '账号', value: 'uname_pwd' },
                      { label: '短信', value: 'sms_vcode' },
                      { label: '扫码', value: 'app_scan' },
                    ]}
                  />
                )}
@@ -238,23 +227,6 @@
                  >
                    {msgTemps.map(option =>
                      <Select.Option key={option.ID} value={option.ID}>{option.SignName + ' - ' + option.TemplateCode}</Select.Option>
                    )}
                  </Select>
                )}
              </Form.Item>
            </Col>
            <Col span={12}>
              <Form.Item label="黑名单">
                {getFieldDecorator('blacklist', {
                  initialValue: wrap.blacklist || []
                })(
                  <Select
                    showSearch
                    mode="multiple"
                    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                  >
                    {roleList.map(option =>
                      <Select.Option key={option.uuid} value={option.value}>{option.text}</Select.Option>
                    )}
                  </Select>
                )}