king
2024-05-16 b69b5f6329ca5f87932436b7a6c1ddfc3377e10f
src/menu/components/card/cardsimplecomponent/options.jsx
@@ -38,16 +38,18 @@
      field: 'condition',
      label: '显示条件',
      initval: setting.condition || 'false',
      tooltip: '当选择“有”时,只有符合条件的数据才会展示。',
      tooltip: '当选择“自定义”时,只有符合条件的数据才会展示。当选择“标题”时,只有首行才会展示',
      required: false,
      options: [
        {value: 'true', label: '有'},
        {value: 'false', label: '无'},
        {value: 'false', label: '始终显示'},
        {value: 'true', label: '自定义'},
        {value: 'title', label: '标题'},
      ],
      controlFields: [
        {field: 'controlField', values: ['true']},
        {field: 'controlType', values: ['true']},
        {field: 'controlValue', values: ['true']},
        {field: 'click', values: ['true', 'false']},
      ]
    },
    {
@@ -83,7 +85,7 @@
      field: 'click',
      label: '点击事件',
      initval: setting.click || '',
      tooltip: '当选择触发按钮时,只有当卡片中只存在一个按钮时有效。',
      // tooltip: '当选择触发按钮时,只有当卡片中只存在一个按钮时有效。',
      required: false,
      options: [
        {value: '', label: '无'},
@@ -95,26 +97,27 @@
        {field: 'menu', values: ['menu']},
        {field: 'linkurl', values: ['link']},
        {field: 'open', values: ['menu', 'link']},
        {field: 'joint', values: ['menu', 'link']},
        {field: 'linkbtn', values: ['button']},
      ]
    },
    {
      type: 'radio',
      field: 'joint',
      label: '参数拼接',
      initval: setting.joint || 'true',
      field: 'open',
      label: '打开方式',
      initval: setting.open || 'blank',
      required: false,
      options: [
        {value: 'true', label: '是'},
        {value: 'false', label: '否'},
        {value: 'blank', label: appType !== 'mob' ? '新窗口' : '新页面'},
        {value: 'self', label: appType !== 'mob' ? '当前窗口' : '当前页面'},
      ],
      forbid: appType !== 'pc' && appType !== 'mob'
    },
    {
      type: appType ? 'select' : 'cascader',
      field: 'menu',
      label: '关联菜单',
      initval: setting.menu || (appType ? '' : []),
      tooltip: `行信息${appType ? '(字段集中前40个长度不超过256的字段)' : ''}将传递至此菜单,可在url变量、表单(关联主表)、静态属性卡、浮动卡中使用。`,
      required: true,
      extendName: 'MenuNo',
      options: appType ? appmenulist : menulist,
@@ -124,21 +127,11 @@
      field: 'linkurl',
      label: '链接',
      initval: setting.linkurl || '',
      tooltip: '在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。',
      toolWidth: 350,
      required: true,
      options: [],
      span: 24
    },
    {
      type: 'radio',
      field: 'open',
      label: '打开方式',
      initval: setting.open || 'blank',
      required: false,
      options: [
        {value: 'blank', label: '新窗口'},
        {value: 'self', label: '当前窗口'},
      ],
      forbid: appType !== 'pc'
    },
    {
      type: 'select',
@@ -198,6 +191,14 @@
    }
  }
  let ops = []
  let adapters = sessionStorage.getItem('adapter') || ''
  if (adapters.indexOf('wxmini') > -1) {
    ops.push({value: 'miniprogram', label: '小程序'})
  } else if (setting.click === 'miniprogram') {
    setting.click = ''
  }
  const cardSettingForm = [
    {
      type: 'text',
@@ -210,6 +211,17 @@
    },
    {
      type: 'radio',
      field: 'layout',
      label: '元素布局',
      initval: setting.layout || 'grid',
      required: false,
      options: [
        {value: 'grid', label: '栅格布局'},
        {value: 'flex', label: '弹性布局'},
      ]
    },
    {
      type: 'radio',
      field: 'click',
      label: '点击事件',
      initval: setting.click || '',
@@ -218,12 +230,15 @@
        {value: '', label: '无'},
        {value: 'menu', label: '菜单'},
        {value: 'link', label: '链接'},
        ...ops
      ],
      controlFields: [
        {field: 'menu', values: ['menu']},
        {field: 'linkurl', values: ['link']},
        {field: 'open', values: ['menu', 'link']},
        {field: 'joint', values: ['menu', 'link']},
        {field: 'joint', values: ['miniprogram']},
        {field: 'miniAppId', values: ['miniprogram']},
        {field: 'miniPath', values: ['miniprogram']},
      ]
    },
    {
@@ -231,18 +246,10 @@
      field: 'menu',
      label: '关联菜单',
      initval: setting.menu || (appType ? '' : []),
      tooltip: `行信息${appType ? '(字段集中前40个长度不超过256的字段)' : ''}将传递至此菜单,可在url变量、表单(关联主表)、静态属性卡、浮动卡中使用。`,
      required: true,
      extendName: 'MenuNo',
      options: appType ? appmenulist : menulist,
    },
    {
      type: 'textarea',
      field: 'linkurl',
      label: '链接',
      initval: setting.linkurl || '',
      required: true,
      options: [],
      span: 24
    },
    {
      type: 'radio',
@@ -251,10 +258,25 @@
      initval: setting.open || 'blank',
      required: false,
      options: [
        {value: 'blank', label: '新窗口'},
        {value: 'self', label: '当前窗口'},
        {value: 'blank', label: appType !== 'mob' ? '新窗口' : '新页面'},
        {value: 'self', label: appType !== 'mob' ? '当前窗口' : '当前页面'},
      ],
      forbid: appType !== 'pc'
      forbid: appType !== 'pc' && appType !== 'mob'
    },
    {
      type: 'text',
      field: 'miniAppId',
      label: '小程序AppID',
      initval: setting.miniAppId || '',
      required: true
    },
    {
      type: 'text',
      field: 'miniPath',
      label: '页面路径',
      initval: setting.miniPath || '',
      tooltip: '可指定跳转小程序页面,为空时打开首页,注:参数拼接在指定页面时有效。',
      required: false
    },
    {
      type: 'radio',
@@ -267,6 +289,17 @@
        {value: 'false', label: '否'},
      ],
    },
    {
      type: 'textarea',
      field: 'linkurl',
      label: '链接',
      initval: setting.linkurl || '',
      tooltip: '在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。',
      toolWidth: 350,
      required: true,
      options: [],
      span: 24
    },
  ]
  return cardSettingForm