king
2022-07-28 7ae8fae255456f723b1993044265592c11ef7a36
src/pc/components/login/normal-login/options.jsx
@@ -41,37 +41,12 @@
      required: true
    },
    {
      type: 'checkbox',
      field: 'loginWays',
      label: '登录方式',
      initval: wrap.loginWays || [],
      required: true,
      options: [
        { label: '账号', value: 'uname_pwd' },
        { label: '短信', value: 'sms_vcode' },
        { label: '扫码', value: 'app_scan', disabled: appType === 'mob' },
      ],
      controlFields: [
        {field: 'tempId', values: ['sms_vcode']},
        {field: 'shortcut', values: ['uname_pwd']},
      ]
    },
    {
      type: 'select',
      field: 'linkmenu',
      label: '关联菜单',
      initval: wrap.linkmenu || '',
      required: true,
      options: menulist
    },
    {
      type: 'select', // $验证码$  $mob$  $send_type$
      field: 'tempId',
      label: '短信模板',
      initval: wrap.tempId || '',
      tooltip: '短信模板可在 云系统->应用服务->开发者中心->短信模板 处添加。',
      required: true,
      options: msgTemps
    },
    {
      type: 'number',
@@ -104,20 +79,56 @@
      required: false,
      options: ['px', 'vh', 'vw', '%']
    },
    // {
    //   type: 'radio',
    //   field: 'link',
    //   label: '链接',
    //   initval: wrap.link || 'menu',
    //   required: false,
    //   options: [
    //     {value: 'menu', label: '菜单'},
    //     {value: 'linkmenu', label: '关联菜单'},
    //   ],
    //   controlFields: [
    //     {field: 'linkmenu', values: ['linkmenu']}
    //   ]
    // },
    {
      type: 'radio',
      field: 'classify',
      label: '组件类型',
      initval: wrap.classify || 'login',
      tooltip: '注册登录都存在时,在公众号与小程序中优先显示注册,APP与H5中优先显示登录。',
      required: true,
      options: [
        { label: '登录', value: 'login' },
        { label: '注册', value: 'signin' },
        { label: '注册/登录', value: 'all' },
      ],
      controlFields: [
        {field: 'loginWays', values: ['login', 'all']},
        {field: 'logintip', values: ['login', 'all']},
        {field: 'signWays', values: ['signin', 'all']},
        {field: 'protocol', values: ['signin', 'all']},
        {field: 'signtip', values: ['signin', 'all']},
      ]
    },
    {
      type: 'hint',
      field: 'logintip',
      label: '登录配置'
    },
    {
      type: 'checkbox',
      field: 'loginWays',
      label: '登录方式',
      initval: wrap.loginWays || [],
      required: true,
      options: [
        { label: '账号', value: 'uname_pwd' },
        { label: '短信', value: 'sms_vcode' },
        { label: '扫码', value: 'app_scan', disabled: appType === 'mob' },
      ],
      controlFields: [
        {field: 'tempId', values: ['sms_vcode']},
        {field: 'shortcut', values: ['uname_pwd']},
      ]
    },
    {
      type: 'select', // $验证码$  $mob$  $send_type$
      field: 'tempId',
      label: '短信模板',
      initval: wrap.tempId || '',
      tooltip: '短信模板可在 云系统->应用服务->开发者中心->短信模板 处添加。',
      required: true,
      options: msgTemps
    },
    {
      type: 'radio',
      field: 'shortcut',
@@ -131,56 +142,85 @@
        {value: 'autologon', label: '自动登录'},
      ]
    },
    // {
    //   type: 'radio',
    //   field: 'protocol',
    //   label: '协议',
    //   initval: wrap.protocol || 'false',
    //   required: false,
    //   options: [
    //     {value: 'false', label: '无'},
    //     {value: 'true', label: '有'},
    //   ],
    //   controlFields: [
    //     {field: 'tip', values: ['true']},
    //     {field: 'groups', values: ['true']},
    //   ]
    // },
    // {
    //   type: 'text',
    //   field: 'tip',
    //   label: '提示文字',
    //   initval: wrap.tip || '我已阅读并同意',
    //   required: true
    // },
    // {
    //   type: 'table',
    //   field: 'groups',
    //   label: '协议组',
    //   initval: wrap.groups || [],
    //   required: true,
    //   span: 24,
    //   columns: [
    //     {
    //       title: '文本',
    //       dataIndex: 'label',
    //       inputType: 'input',
    //       editable: true,
    //       unique: true,
    //       required: true,
    //       width: '35%'
    //     },
    //     {
    //       title: '链接',
    //       dataIndex: 'link',
    //       inputType: 'input',
    //       editable: true,
    //       unique: true,
    //       required: true,
    //       width: '40%'
    //     },
    //   ]
    // }
    {
      type: 'hint',
      field: 'signtip',
      label: '注册配置'
    },
    {
      type: 'checkbox',
      field: 'signWays',
      label: '注册方式',
      initval: wrap.signWays || [],
      required: true,
      options: [
        { label: '账号', value: 'uname_pwd' },
        { label: '短信', value: 'sms_vcode' },
        { label: '微信', value: 'weixin', disabled: appType !== 'mob' },
      ],
      controlFields: [
        {field: 'signTempId', values: ['sms_vcode']}
      ]
    },
    {
      type: 'select', // $验证码$  $mob$  $send_type$
      field: 'signTempId',
      label: '短信模板',
      initval: wrap.signTempId || '',
      tooltip: '短信模板可在 云系统->应用服务->开发者中心->短信模板 处添加。',
      required: true,
      options: msgTemps
    },
    {
      type: 'radio',
      field: 'protocol',
      label: '协议',
      initval: wrap.protocol || 'false',
      required: false,
      options: [
        {value: 'false', label: '无'},
        {value: 'true', label: '有'},
      ],
      controlFields: [
        {field: 'tip', values: ['true']},
        {field: 'groups', values: ['true']},
      ]
    },
    {
      type: 'text',
      field: 'tip',
      label: '提示文字',
      initval: wrap.tip || '我已阅读并同意',
      required: true
    },
    {
      type: 'table',
      field: 'groups',
      label: '协议组',
      initval: wrap.groups || [],
      required: true,
      span: 24,
      columns: [
        {
          title: '文本',
          dataIndex: 'label',
          inputType: 'input',
          editable: true,
          unique: true,
          required: true,
          width: '35%'
        },
        {
          title: '链接',
          dataIndex: 'link',
          inputType: 'input',
          editable: true,
          unique: true,
          required: true,
          width: '40%'
        },
      ]
    }
  ]
  return wrapForm