king
2023-03-11 34e7681fd12b1c4e4994d3bea1a553870e10bc50
src/pc/components/login/normal-login/options.jsx
@@ -41,6 +41,100 @@
      required: true
    },
    {
      type: 'select',
      field: 'linkmenu',
      label: '关联菜单',
      initval: wrap.linkmenu || '',
      required: true,
      options: menulist
    },
    {
      type: 'number',
      field: 'width',
      label: '宽度',
      initval: wrap.width || 24,
      tooltip: '栅格布局,每行等分为24列。',
      min: 1,
      max: 24,
      precision: 0,
      required: true
    },
    // {
    //   type: 'number',
    //   field: 'maxWidth',
    //   label: '最大宽度',
    //   initval: wrap.maxWidth || '',
    //   tooltip: '登录框的最大宽度值。',
    //   min: 100,
    //   max: 2000,
    //   precision: 0,
    //   required: false
    // },
    // {
    //   type: 'styleInput',
    //   field: 'height',
    //   label: '最小高度',
    //   initval: wrap.height || '',
    //   tooltip: '组件占用的最小高度,用于页面布局。',
    //   required: false,
    //   options: ['px', 'vh', 'vw', '%']
    // },
    // {
    //   type: 'styleInput',
    //   field: 'maxWidth',
    //   label: '最大宽度',
    //   initval: wrap.maxWidth || '',
    //   tooltip: '组件占用的最大宽度,用于页面布局。',
    //   required: false,
    //   options: ['px', 'vh', 'vw', '%']
    // },
    {
      type: 'radio',
      field: 'topTip',
      label: '顶部提示',
      initval: wrap.topTip || 'show',
      tooltip: '登录或注册方式提示信息。',
      required: false,
      options: [
        {value: 'show', label: '显示'},
        {value: 'hidden', label: '隐藏'}
      ]
    },
    {
      type: 'styleInput',
      field: 'borderRadius',
      label: '圆角',
      initval: wrap.borderRadius || '',
      tooltip: '登录或注册时,确定按钮的圆角。',
      required: false,
      options: ['px', 'vh', 'vw', '%']
    },
    {
      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: '登录方式',
@@ -57,67 +151,15 @@
      ]
    },
    {
      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,
      dropdown: 'false',
      options: msgTemps
    },
    {
      type: 'number',
      field: 'width',
      label: '宽度',
      initval: wrap.width || 24,
      tooltip: '栅格布局,每行等分为24列。',
      min: 1,
      max: 24,
      precision: 0,
      required: true
    },
    {
      type: 'number',
      field: 'maxWidth',
      label: '最大宽度',
      initval: wrap.maxWidth || '',
      tooltip: '登录框的最大宽度值。',
      min: 100,
      max: 2000,
      precision: 0,
      required: false
    },
    {
      type: 'styleInput',
      field: 'height',
      label: '高度',
      initval: wrap.height || '',
      tooltip: '组件占用的最小高度,用于页面布局。',
      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: 'shortcut',
@@ -131,56 +173,87 @@
        {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 || [],
      tooltip: '微信授权只在小程序中有效。',
      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,
      dropdown: 'false',
      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