king
2022-06-02 94fe37551855f542d1cbad8b7af7fe3311daeddb
src/menu/components/card/cardcellcomponent/formconfig.jsx
@@ -8,7 +8,7 @@
 * @param {*} card
 * @param {*} type
 */
export function getCardCellForm (card, type, subtype, cardCell) {
export function getCardCellForm (card, type, subtype, cardCell, anchors) {
  let _options = [
    { value: 'text', text: '文本'},
    { value: 'number', text: '数值'},
@@ -43,16 +43,8 @@
    }
  }
  let dataTypes = [
    { value: 'dynamic', text: '动态' },
    { value: 'static', text: '静态' }
  ]
  let tooltip = ''
  if (cardCell.$cardType === 'extendCard') {
    // card.datatype = 'static'
    // dataTypes = [
    //   { value: 'static', text: '静态' }
    // ]
    tooltip = '在扩展卡片中,动态数据显示值为获取到的第一行数据。'
  }
@@ -79,7 +71,10 @@
      initVal: card.datatype || 'static',
      tooltip,
      required: true,
      options: dataTypes
      options: [
        { value: 'dynamic', text: '动态' },
        { value: 'static', text: '静态' }
      ]
    },
    {
      type: 'select',
@@ -129,6 +124,42 @@
      ]
    },
    {
      type: 'number',
      key: 'startTime',
      precision: 0,
      label: '开始时间',
      initVal: card.startTime || 0,
      tooltip: '视频开始播放的时间,用于调整视频初始化展示的界面。',
      required: false
    },
    {
      type: 'radio',
      key: 'posterType',
      label: '预览图',
      initVal: card.posterType || '',
      required: false,
      options: [
        { value: '', text: '无' },
        { value: 'dynamic', text: '动态' },
        { value: 'static', text: '静态' }
      ]
    },
    {
      type: 'file',
      key: 'posterUrl',
      label: '预览地址',
      initVal: card.posterUrl || '',
      maxfile: 1,
      required: true
    },
    {
      type: 'select',
      key: 'posterField',
      label: '预览地址',
      initVal: card.posterField || '',
      required: true
    },
    {
      type: 'select',
      key: 'format',
      label: '格式化',
@@ -141,6 +172,8 @@
        { value: 'thdSeparator', text: '千分位' },
        { value: 'abs', text: '绝对值' },
        { value: 'YYYY-MM-DD', text: 'YYYY-MM-DD' },
        { value: 'YYYY-MM-DD HH:mm', text: 'YYYY-MM-DD HH:mm' },
        { value: 'YYYY-MM-DD HH:mm:ss', text: 'YYYY-MM-DD HH:mm:ss' },
        { value: 'MM月DD日', text: 'MM月DD日' },
        { value: 'YYYY年MM月DD日', text: 'YYYY年MM月DD日' },
        { value: 'HH:mm', text: '时分(例:16:57)' },
@@ -326,6 +359,15 @@
      options: []
    },
    {
      type: 'cascader',
      key: 'anchors',
      label: '跳转锚点',
      initVal: card.anchors || [],
      tooltip: sessionStorage.getItem('appType') === 'mob' ? '注:小程序中无效' : '',
      required: false,
      options: anchors
    },
    {
      type: 'number',
      key: 'barHeight',
      min: 5,
@@ -406,6 +448,7 @@
      label: '最大宽度',
      initVal: card.maxWidth || '',
      tooltip: '图片宽度的最大值。',
      help: '注:此值存在时,左右外边距为0居中显示。',
      required: false,
    },
    {
@@ -426,7 +469,6 @@
      initVal: card.link || '',
      tooltip: '动态地址为绑定字段值。',
      required: false,
      // forbid: isApp,
      options: [
        { value: '', text: '无' },
        { value: 'dynamic', text: '动态' },
@@ -439,7 +481,6 @@
      label: '链接类型',
      initVal: card.linkType || 'other',
      required: false,
      // forbid: isApp,
      options: [
        { value: 'tel', text: '电话' },
        { value: 'email', text: '邮箱' },
@@ -549,10 +590,22 @@
      ]
    },
    {
      type: 'radio',
      key: 'copyable',
      label: '可复制',
      initVal: card.copyable || 'false',
      tooltip: '元素是否可复制,复制内容包括前缀与后缀。',
      required: false,
      options: [
        { value: 'true', text: '是' },
        { value: 'false', text: '否' }
      ]
    },
    {
      type: 'number',
      key: 'fixSize',
      min: 10,
      max: 100,
      max: 300,
      label: '字体大小',
      initVal: card.fixSize || 14,
      tooltip: '前缀、后缀的字体大小。',