otherSettings.js 2.74 KB
Newer Older
田翔's avatar
田翔 committed
1
const baseSettings = {}
田翔's avatar
田翔 committed
2 3 4

const commonSettings = {
  $id: {
田翔's avatar
田翔 committed
5
    title: '数据源',
田翔's avatar
田翔 committed
6 7 8 9 10 11 12
    type: 'string',
    widget: 'FieldNames',
    required: true,
    displayType: 'row',
    labelWidth: 80,
  },
  title: {
田翔's avatar
田翔 committed
13
    title: '展示名称',
田翔's avatar
田翔 committed
14 15 16 17 18 19 20 21 22
    required: true,
    type: 'string',
    widget: 'htmlInput',
    displayType: 'row',
    labelWidth: 80,
  },
  placeholder: {
    title: '提示语',
    type: 'string',
田翔's avatar
田翔 committed
23
    widget: 'Placeholder',
田翔's avatar
田翔 committed
24 25
    displayType: 'row',
    labelWidth: 80,
田翔's avatar
田翔 committed
26
    dependencies: ['title']
田翔's avatar
田翔 committed
27 28 29 30 31 32 33 34 35 36 37 38 39
  },
  presetValue: {
    title: '默认值',
    type: 'string',
    displayType: 'row',
    labelWidth: 80,
  },
}

const switchSettings = {
  disabled: {
    title: '只读',
    type: 'boolean',
田翔's avatar
田翔 committed
40 41 42 43 44
    widget: 'checkbox',
    // displayType: 'row',
    // labelWidth: 80,
    default: false,
    width: '33%',
田翔's avatar
田翔 committed
45 46 47 48
  },
  required: {
    title: '必填',
    type: 'boolean',
田翔's avatar
田翔 committed
49 50 51 52 53
    widget: 'checkbox',
    // displayType: 'row',
    // labelWidth: 80,
    default: false,
    width: '33%',
田翔's avatar
田翔 committed
54 55 56 57
  },
  hidden: {
    title: '隐藏',
    type: 'boolean',
田翔's avatar
田翔 committed
58
    widget: 'checkbox',
田翔's avatar
田翔 committed
59
    default: false,
田翔's avatar
田翔 committed
60 61 62
    width: '33%',
    // displayType: 'row',
    // labelWidth: 80,
田翔's avatar
田翔 committed
63 64 65 66
  },
}

const elementSettings = {
田翔's avatar
田翔 committed
67 68 69 70 71 72
  // width: {
  //   title: '元素宽度',
  //   type: 'string',
  //   widget: 'percentSlider',
  //   // default: '33%',
  // },
田翔's avatar
田翔 committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
  labelWidth: {
    title: '标签宽度',
    description: '默认值110',
    default: 110,
    type: 'number',
    widget: 'slider',
    max: 400,
    props: {
      hideNumber: true,
    },
  },
}

const globalSettings = {
  type: 'object',
  properties: {
田翔's avatar
田翔 committed
89 90 91
    tableName: {
      title: '表名',
      type: 'string',
田翔's avatar
田翔 committed
92
      widget: 'TableNames',
田翔's avatar
田翔 committed
93 94
      required: true,
    },
95 96 97 98 99
    tableType: {
      title: '表类型',
      type: 'string',
      disabled: true,
    },
田翔's avatar
田翔 committed
100
    alias: {
田翔's avatar
田翔 committed
101
      title: '展示名称',
田翔's avatar
田翔 committed
102 103
      type: 'string',
    },
田翔's avatar
田翔 committed
104 105 106
    interfaceName: {
      title: '接口',
      type: 'string',
田翔's avatar
田翔 committed
107
    },
田翔's avatar
田翔 committed
108 109 110
    column: {
      title: '整体布局',
      type: 'number',
111
      enum: [2, 3, 4, 5],
田翔's avatar
田翔 committed
112
      default: 3,
113 114 115
      enumNames: ['一行二列', '一行三列', '一行四列', '一行五列'],
      widget: 'RadioGroup',
      isMultiple: true,
田翔's avatar
田翔 committed
116
      props: {
117
        placeholder: '默认一行三列',
田翔's avatar
田翔 committed
118 119 120 121 122 123 124
      },
    },
    displayType: {
      title: '标签展示模式',
      type: 'string',
      default: 'row',
      enum: ['row', 'column'],
125
      enumNames: ['左右', '上下'],
田翔's avatar
田翔 committed
126 127
      widget: 'select',
    },
128 129 130 131 132 133 134 135 136 137
    /*    labelWidth: {
          title: '标签宽度',
          type: 'number',
          widget: 'slider',
          max: 300,
          default: 120,
          props: {
            hideNumber: true,
          },
        }, */
田翔's avatar
田翔 committed
138 139 140 141 142 143 144 145 146 147
  },
}

export {
  baseSettings,
  commonSettings,
  switchSettings,
  elementSettings,
  globalSettings
}