king
2021-06-24 95afd40fc2741ac0ce59c2091f6cfce1f98877d4
src/templates/zshare/formconfig.jsx
@@ -298,6 +298,59 @@
    roleList = []
  }
  let typeOptions = []
  if (sessionStorage.getItem('appType') === 'mob') {
    typeOptions = [{
      value: 'text',
      text: Formdict['model.form.text']
    }, {
      value: 'checkcard',
      text: '选项卡'
    }, {
      value: 'date',
      text: Formdict['model.form.dateday']
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
    }]
    if (!['text', 'checkcard', 'date', 'datemonth'].includes(card.type)) {
      card.type = 'text'
    }
  } else {
    typeOptions = [{
      value: 'text',
      text: Formdict['model.form.text']
    }, {
      value: 'select',
      text: Formdict['model.form.select']
    }, {
      value: 'multiselect',
      text: Formdict['model.form.multiselect']
    }, {
      value: 'link',
      text: Formdict['model.form.link']
    }, {
      value: 'checkcard',
      text: '选项卡'
    }, {
      value: 'date',
      text: Formdict['model.form.dateday']
    }, {
      value: 'dateweek',
      text: Formdict['model.form.dateweek']
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
    }, {
      value: 'daterange',
      text: Formdict['model.form.daterange']
    }, {
      value: 'group',
      text: Formdict['model.form.dategroup']
    }]
  }
  return [
    {
      type: 'text',
@@ -322,34 +375,7 @@
      label: Formdict['model.form.type'],
      initVal: card.type,
      required: true,
      options: [{
        value: 'text',
        text: Formdict['model.form.text']
      }, {
        value: 'select',
        text: Formdict['model.form.select']
      }, {
        value: 'multiselect',
        text: Formdict['model.form.multiselect']
      }, {
        value: 'link',
        text: Formdict['model.form.link']
      }, {
        value: 'date',
        text: Formdict['model.form.dateday']
      }, {
        value: 'dateweek',
        text: Formdict['model.form.dateweek']
      }, {
        value: 'datemonth',
        text: Formdict['model.form.datemonth']
      }, {
        value: 'daterange',
        text: Formdict['model.form.daterange']
      }, {
        value: 'group',
        text: Formdict['model.form.dategroup']
      }]
      options: typeOptions
    },
    {
      type: 'text',
@@ -395,6 +421,75 @@
      }]
    },
    {
      type: 'radio',
      key: 'display',
      label: '显示',
      initVal: card.display || 'text',
      required: true,
      options: [{
        value: 'text',
        text: '文本'
      }, {
        value: 'picture',
        text: '图片'
      }]
    },
    {
      type: 'number',
      key: 'width',
      min: 1,
      max: 24,
      precision: 0,
      label: '卡片宽度',
      initVal: card.width || 4,
      tooltip: '栅格布局,每行等分为24列。',
      required: true
    },
    {
      type: 'text',
      key: 'cardValField',
      label: Formdict['header.form.valueField'],
      initVal: card.cardValField || 'Value',
      required: true,
      readonly: false
    },
    {
      type: 'text',
      key: 'urlField',
      label: '地址字段',
      initVal: card.urlField || '',
      required: true,
      readonly: false
    },
    {
      type: 'radio',
      key: 'picratio',
      label: '图片比例',
      initVal: card.picratio || '1:1',
      required: true,
      options: [{
        value: '1:1',
        text: '1:1'
      }, {
        value: '3:2',
        text: '3:2'
      }, {
        value: '4:3',
        text: '4:3'
      }, {
        value: '16:9',
        text: '16:9'
      }]
    },
    {
      type: 'fields',
      key: 'fields',
      label: '字段集',
      initVal: card.fields || [],
      required: true,
      readonly: false
    },
    {
      type: 'textarea',
      key: 'dataSource',
      label: Formdict['header.form.datasource'],
@@ -405,7 +500,7 @@
    {
      type: 'options',
      key: 'options',
      label: '',
      label: '选项',
      initVal: card.options || [],
      required: true,
      readonly: false
@@ -531,6 +626,20 @@
    },
    {
      type: 'radio',
      key: 'multiple',
      label: '可多选',
      initVal: card.multiple || 'false',
      required: true,
      options: [{
        value: 'true',
        text: '是'
      }, {
        value: 'false',
        text: '否'
      }]
    },
    {
      type: 'radio',
      key: 'required',
      label: Formdict['model.required'],
      initVal: card.required || 'false',
@@ -596,6 +705,20 @@
      }]
    },
    {
      type: 'color',
      key: 'backgroundColor',
      label: '背景色',
      initVal: card.backgroundColor || '',
      required: false
    },
    {
      type: 'color',
      key: 'borderColor',
      label: '边框颜色',
      initVal: card.borderColor || '',
      required: false
    },
    {
      type: 'multiselect',
      key: 'blacklist',
      label: Formdict['header.form.blacklist'],