import React from 'react'
import { commonSettings, switchSettings, elementSettings } from './otherSettings'
import IconPack from '../../components/IconPack'

// const disabled = '{{formData.tableTypeParent === "物联设备表" && formData.IsSystemField}}'
const disabled = '{{formData.tableTypeParent === "物联设备表" && formData.$id === "编码"}}'

const groupStyle = {
  groupStyle: {
    title: '控件样式',
    type: 'object',
    properties: {}
  },
  width: {
    title: '控件占比',
    type: 'string',
    widget: 'RadioGroupW',
  },
}

const layoutWidgets = [
  {
    text: '分组标题',
    name: '分组标题',
    icon: <IconPack.Group />,
    schema: {
      title: '分组标题',
      type: 'object',
      width: '100%',
    },
    setting: {
      title: {
        title: '展示名称',
        type: 'string',
        required: true,
        disabled: '{{formData.title === "物联数据"}}',
      },
    },
  },
  {
    text: '描述说明',
    name: '描述说明',
    icon: <IconPack.Describe />,
    schema: {
      title: '',
      type: 'html',
      widget: 'TextHTML',
      placeholder: '',
      width: '100%',
      labelWidth: 1,
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      isText: {
        title: '是否为纯文本',
        type: 'boolean',
        widget: 'IsText',
        default: false,
      },
      contentText: {
        title: '纯文本内容',
        type: 'string',
        widget: 'ContentText',
        hidden: "{{!formData.isText}}",
        dependencies: ['IsText'],
      },
      contentHTML: {
        title: '富文本内容',
        type: 'string',
        widget: 'ContentHTML',
        hidden: "{{formData.isText}}",
        dependencies: ['IsText'],
      },
      hideKey:{
        title: '跟随字段同步隐藏',
        type: 'string',
        widget: 'FollowFieldHide',
      },
      styleHTML: {
        title: '控件样式',
        type: 'object',
        widget: 'StyleHTML',
      },
    },
  },
]

const baseWidgets = [
  {
    text: '单行文本',
    name: '单行文本',
    icon: <IconPack.TextInput />,
    schema: {
      title: '单行文本',
      type: 'string',
      widget: 'TextInput',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
        disabled: disabled,
        dependencies: ['tableTypeParent', 'IsSystemField'],
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
        disabled: disabled,
        dependencies: ['tableTypeParent', 'IsSystemField'],
      },
      placeholder: {
        title: '提示语',
        type: 'string',
        disabled: disabled,
        dependencies: ['tableTypeParent', 'IsSystemField'],
      },
      description: {
        title: '字段说明',
        type: 'string',
        disabled: disabled,
        dependencies: ['tableTypeParent', 'IsSystemField'],
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        disabled: disabled,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        disabled: disabled,
        hidden: "{{formData.isHidden}}",
        dependencies: ['tableTypeParent', 'IsSystemField', 'isHidden'],
      },
      presetValue: {
        title: '默认值',
        type: 'string',
        widget: 'InputDefault',
        disabled: disabled,
        dependencies: ['tableTypeParent', 'IsSystemField'],
      },
      calculateRule: {
        title: '计算规则',
        type: 'string',
        widget: 'CalculateRule',
      },
      maxLength: {
        title: '最大长度',
        type: 'number',
        widget: 'number',
        default: 200,
        disabled: disabled,
        dependencies: ['tableTypeParent', 'IsSystemField'],
      },
      rules: {
        title: '正则校验',
        type: 'array',
        default: [],
        widget: 'VerifyTextInput',
        disabled: disabled,
        dependencies: ['tableTypeParent', 'IsSystemField'],
      },
      uniqueVerify: {
        title: '唯一值校验',
        type: 'string',
        widget: 'select',
        enum: ['表名/字段名'],
        default: null,
        enumNames: ['表名/字段名'],
        props: {
          allowClear: true
        },
        disabled: disabled,
        dependencies: ['tableTypeParent', 'IsSystemField'],
      },
      tableName: {
        title: '表名',
        type: 'string',
        hidden: "{{formData.uniqueVerify !== '表名/字段名'}}",
        disabled: disabled,
        dependencies: ['uniqueVerify', 'tableTypeParent', 'IsSystemField'],
      },
      fieldName: {
        title: '字段名',
        type: 'string',
        hidden: "{{formData.uniqueVerify !== '表名/字段名'}}",
        disabled: disabled,
        dependencies: ['uniqueVerify', 'tableTypeParent', 'IsSystemField'],
      },
      required: {
        title: '必填',
        type: 'boolean',
        default: false,
        width: '33%',
        props: {
          style: {
            marginLeft: '10px',
          }
        },
        disabled: disabled,
        dependencies: ['tableTypeParent', 'IsSystemField'],
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
        disabled: disabled,
        hidden: "{{rootValue.isStoreID}}",
        dependencies: ['tableTypeParent', 'IsSystemField', 'isStoreID'],
      },
      isStoreID: {
        title: '是否存储ID',
        type: 'boolean',
        widget: 'BooleanSwitch',
        default: false,
        displayType: 'row',
        labelWidth: 120,
        // hidden: "{{!['【本人姓名】','【本人部门】'].includes(rootValue.presetValue) }}",
        disabled: disabled,
        dependencies: ['presetValue', 'tableTypeParent', 'IsSystemField'],
      },
      isQRCode: {
        title: '设备二维码',
        type: 'boolean',
        widget: 'BooleanSwitch',
        default: false,
        displayType: 'row',
        labelWidth: 120,
        description: '是否解析为二维码格式(手持端专用)',
        disabled: disabled,
        dependencies: ['presetValue', 'tableTypeParent', 'IsSystemField'],
      },
      isSweep: {
        title: '扫一扫',
        type: 'boolean',
        widget: 'BooleanSwitch',
        default: false,
        displayType: 'row',
        labelWidth: 120,
        description: '是否提供扫一扫功能(手持端专用)',
        disabled: disabled,
      },
      isAccount: {
        title: '是否识别台账',
        type: 'boolean',
        widget: 'BooleanSwitch',
        default: false,
        displayType: 'row',
        labelWidth: 120,
        description: '点击后可以直接查看台账数据(手持端专用)',
        disabled: disabled,
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      addonBefore: {
        title: '前置标签',
        type: 'string',
        widget: 'InputAddon',
        disabled: disabled,
        dependencies: ['presetValue', 'tableTypeParent', 'IsSystemField'],
      },
      addonAfter: {
        title: '后置标签',
        type: 'string',
        widget: 'InputAddon',
        disabled: disabled,
        dependencies: ['tableTypeParent', 'IsSystemField'],
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
        disabled: disabled,
        dependencies: ['tableTypeParent', 'IsSystemField'],
      },
    },
  },
  {
    text: '多行文本',
    name: '多行文本',
    icon: <IconPack.TextArea />,
    schema: {
      title: '多行文本',
      type: 'string',
      widget: 'TextArea',
      placeholder: ''
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 80,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
        widget: 'htmlInput',
        dependencies: ['widget']
      },
      placeholder: {
        title: '提示语',
        type: 'string',
        widget: 'Placeholder',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      calculateRule: {
        title: '计算规则',
        type: 'string',
        widget: 'CalculateRule',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
        widget: 'Placeholder',
      },
      maxLength: {
        title: '最大长度',
        type: 'number',
        widget: 'number',
        default: 500,
        description: '可输入最大字节长度'
      },
      required: {
        title: '必填',
        type: 'boolean',
        default: false,
        width: '40%',
        props: {
          style: {
            marginLeft: '10px'
          }
        }
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '30%',
      },
      // currentAddress: {
      //   title: '获取当前地址',
      //   type: 'boolean',
      //   widget: 'BooleanSwitch',
      //   default: false,
      //   description: '自动获取当前地址(手持端专用)',
      // },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      rows: {
        title: '高度',
        description: '多行文本占据的行数',
        type: 'number',
        widget: 'number',
        max: 10,
        default: 5,
        widget: 'slider',
        props: {
          hideNumber: true,
        },
      },
      width: {
        title: '控件占比',
        description: '默认值100%',
        type: 'string',
        widget: 'RadioGroupW',
        default: '100%',
      },
    },
  },
  {
    text: '数值输入',
    name: '数值输入',
    icon: <IconPack.NumberInput />,
    schema: {
      title: '数值',
      type: 'string',
      widget: 'NumberInput',
      presetValue: '0',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 80,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        type: 'string',
        required: true,
        dependencies: ['widget']
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      rules: {
        title: '正则校验',
        type: 'array',
        default: [
          // {
          //   name: 'number',
          //   pattern: '^[+-]?[0-9]+([.][0-9]+)?$',
          //   message: '数值校验未通过!',
          // }
        ],
        widget: 'VerifyNumberInput',
        disabled: disabled,
        dependencies: ['tableTypeParent', 'IsSystemField'],
      },
      presetValue: {
        title: '默认值',
        type: 'string',
        widget: 'NumerDefault',
      },
      calculateRule: {
        title: '计算规则',
        type: 'string',
        widget: 'CalculateRule',
      },
      required: {
        title: '必填',
        type: 'boolean',
        default: false,
        width: '40%',
        props: {
          style: {
            marginLeft: '10px'
          }
        }
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '30%',
        hidden: '{{Boolean(formData.calculateRule)}}',
        dependencies: ['calculateRule']
      },
      prefix: {
        title: '前缀',
        type: 'string',
        widget: 'htmlInput',
      },
      formatter: {
        title: '数值格式',
        type: 'string',
        widget: 'Formatting',
      },
      // isStoreFormatter: {
      //   title: '存储为转化值',
      //   type: 'boolean',
      //   displayType: 'row',
      //   labelWidth: 120,
      //   hidden: '{{Boolean(formData.formatter !== "${百分比}")}}',
      //   widget: 'BooleanSwitch',
      //   description: '存储格式化后的值(10%会存储为0.1)'
      // },
      decimalDigits: {
        title: '小数位数',
        type: 'string',
        widget: 'DecimalDigits',
        hidden: '{{!["${小数}", "${货币}"].includes(formData.formatter)}}',
        dependencies: ['formatter']
      },
      min: {
        title: '最小值',
        type: 'string',
        widget: 'NumerDefault',
      },
      max: {
        title: '最大值',
        type: 'string',
        widget: 'NumerDefault',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      addonBefore: {
        title: '前置标签',
        type: 'string',
        widget: 'InputAddon',
      },
      addonAfter: {
        title: '后置标签',
        type: 'string',
        widget: 'InputAddon',
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  },
  {
    text: '搜索地址',
    name: '搜索地址',
    icon: <IconPack.SearchLocation />,
    schema: {
      title: '搜索地址',
      type: 'string',
      widget: 'SearchLocation',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        type: 'string',
        required: true,
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      coordSync: {
        title: '坐标同步',
        type: 'string',
        widget: 'CoordSync',
        description: '坐标信息将会同步到下方字段中'
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '25%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  },
  {
    text: '单选框组',
    name: '单选框组',
    icon: <IconPack.RadioButton />,
    schema: {
      title: '单选框组',
      name: '单选框组',
      type: 'string',
      widget: 'RadioButton',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 74,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
        widget: 'htmlInput',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      sourceType: {
        title: '来源方式',
        type: 'string',
        widget: 'SourceType',
        default: '手动输入',
      },
      options: {
        title: '',
        name: '选项',
        type: 'array',
        hidden: '{{formData.sourceType !== "手动输入"}}',
        default: [{ key: '选项一', value: '选项一' }],
        widget: 'SimpleList',
        dependencies: ['sourceType', 'color']
      },
      dictionary: {
        title: '{{formData.sourceType}}',
        name: '{{formData.sourceType}}',
        hidden: '{{formData.sourceType !== "数据字典"}}',
        type: 'string',
        widget: 'Dictionary',
        value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
      },
      tableName: {
        title: '表名',
        name: '表名',
        hidden: '{{formData.sourceType !== "表数据"}}',
        type: 'string',
        widget: 'TableName',
        dependencies: ['sourceType'],
      },
      fieldName: {
        title: '字段名',
        name: '字段名',
        hidden: '{{formData.sourceType !== "表数据"}}',
        type: 'string',
        widget: 'FieldName',
        dependencies: ['sourceType', 'tableName'],
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '40%',
        props: {
          style: {
            marginLeft: '10px',
          }
        }
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '30%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    }
  },
  {
    text: '复选框组',
    name: '复选框组',
    icon: <IconPack.CheckBox />,
    schema: {
      title: '复选框组',
      name: '复选框组',
      type: 'string',
      widget: 'CheckBox',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
        widget: 'htmlInput',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        disabled: disabled,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      sourceType: {
        title: '来源方式',
        type: 'string',
        widget: 'SourceType',
        default: '手动输入',
      },
      options: {
        title: '',
        name: '选项',
        type: 'array',
        hidden: '{{formData.sourceType !== "手动输入"}}',
        default: [{ value: '选项一' }],
        widget: 'SimpleList',
        dependencies: ['sourceType', 'color']
      },
      dictionary: {
        title: '{{formData.sourceType}}',
        name: '{{formData.sourceType}}',
        hidden: '{{formData.sourceType !== "数据字典"}}',
        type: 'string',
        widget: 'Dictionary',
        value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
      },
      tableName: {
        title: '表名',
        name: '表名',
        hidden: '{{formData.sourceType !== "表数据"}}',
        type: 'string',
        widget: 'TableName',
        dependencies: ['sourceType'],
      },
      fieldName: {
        title: '字段名',
        name: '字段名',
        hidden: '{{formData.sourceType !== "表数据"}}',
        type: 'string',
        widget: 'FieldName',
        dependencies: ['sourceType', 'tableName'],
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '40%',
        props: {
          style: {
            marginLeft: '10px',
          }
        }
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '30%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    }
  },
  {
    text: '下拉选择',
    name: '下拉选择',
    icon: <IconPack.ComboBox />,
    schema: {
      title: '下拉选择',
      type: 'string',
      widget: 'ComboBox',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
        widget: 'htmlInput',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
        default: '',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      presetValue: {
        title: '默认值',
        type: 'string',
      },
      sourceType: {
        title: '来源方式',
        name: '下拉框',
        type: 'string',
        widget: 'SourceType',
        default: '手动输入',
      },
      siteSelect: {
        title: '站点选择范围',
        name: '站点选择范围',
        type: 'array',
        widget: 'SiteSelect',
        default: [],
        hidden: "{{formData.sourceType != '站点'}}",
        dependencies: ['sourceType'],
      },
      options: {
        title: '',
        name: '选项',
        type: 'array',
        hidden: '{{formData.sourceType !== "手动输入"}}',
        default: [{ value: '选项一' }],
        widget: 'SimpleList',
        dependencies: ['sourceType', 'color', 'isMultiple']
      },
      dictionary: {
        title: '{{formData.sourceType}}',
        name: '{{formData.sourceType}}',
        hidden: '{{formData.sourceType !== "数据字典"}}',
        type: 'string',
        widget: 'Dictionary',
        value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
        dependencies: ['sourceType']
      },
      tableName: {
        title: '表名',
        name: '表名',
        hidden: '{{formData.sourceType !== "表数据"}}',
        type: 'string',
        widget: 'TableName',
        dependencies: ['sourceType'],
      },
      fieldName: {
        title: '字段名',
        name: '字段名',
        hidden: '{{formData.sourceType !== "表数据"}}',
        type: 'string',
        widget: 'FieldName',
        dependencies: ['sourceType', 'tableName'],
      },
      saveVal: {
        title: '存储值',
        type: 'boolean',
        hidden: '{{formData.sourceType !== "数据字典"}}',
        description: '勾选后可数据字典将显示key存储value',
        widget: 'checkbox',
        default: false,
      },
      isMySite: {
        title: '仅显示本人所属的站点',
        default: false,
        hidden: '{{formData.sourceType !== "站点"}}',
        type: 'boolean',
        widget: 'checkbox',
        props: {
          style: {
            paddingLeft: '10px'
          }
        }
      },
      required: {
        title: '必填',
        type: 'boolean',
        default: false,
        width: '30%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '30%',
      },
      isMultiple: {
        title: '多选',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '30%',
        // hidden: '{{formData.isEdit}}'
      },
      isSearch: {
        title: '搜索',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '30%',
        default: true
      },
      isStoreID: {
        title: '是否存储ID',
        default: false,
        hidden: '{{formData.sourceType !== "站点"}}',
        type: 'boolean',
        widget: 'checkbox',
        width: '40%',
      },
      isEdit: {
        title: '是否可编辑',
        type: 'boolean',
        widget: 'BooleanSwitch',
        displayType: 'row',
        labelWidth: 120,
        description: '勾选后可直接输入选项,可编辑选择仅支持多选',
        hidden: '{{formData.sourceType !== "手动输入"}}'
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    }
  },
  {
    text: '开关按钮',
    name: '开关按钮',
    icon: <IconPack.SwitchSelector />,
    schema: {
      title: '开关按钮',
      name: '开关按钮',
      type: 'string',
      widget: 'SwitchSelector'
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 74,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
        widget: 'htmlInput',
      },
      presetValue: {
        title: '默认值',
        type: 'boolean',
        widget: 'SwitchDefault',
        dependencies: ['showText'],
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      addressSync: {
        title: '地址同步',
        type: 'string',
        widget: 'AddressSync',
        description: '位置信息将会同步到下方字段中',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        disabled: disabled,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '25%',
      },
      showText: {
        title: '显示文字',
        type: 'string',
        widget: 'ShowText',
        default: '开/关',
        description: '示例(开/关)'
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  },
  {
    text: '附件',
    name: '附件',
    icon: <IconPack.FileUpload />,
    schema: {
      title: '附件',
      type: 'string',
      widget: 'FileUpload',
      width: '100%',
      preview: true,
      isUncompressed: true,
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 80,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        type: 'string',
        required: true,
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      presetValue: {
        title: '默认值',
        widget: 'PresetValueFileUpload',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      fileType: {
        title: '文件类型',
        type: 'string',
        widget: 'FileTypeSelect',
        enum: ['全部', '图片', '文档', '音频', '视频'],
        enumNames: ['全部', '图片', '文档', '音频', '视频'],
        default: '全部',
      },
      durationTime: {
        title: "{{formData.fileType+'最大时长'}}",
        type: 'number',
        description: '秒',
        widget: 'slider',
        default: 60,
        min: 1,
        max: 60,
        hidden: "{{!['音频', '视频'].includes(formData.fileType)}}",
        dependencies: ['fileType']
      },
      templateFile: {
        title: '模板文件',
        type: 'string',
        widget: 'TemplateFile',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '50%',
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '50%',
      },
      preview: {
        title: '预览',
        type: 'boolean',
        widget: 'checkbox',
        default: true,
        width: '50%',
      },
      download: {
        title: '下载',
        type: 'boolean',
        widget: 'checkbox',
        default: true,
        width: '50%',
      },
      isUncompressed: {
        title: '压缩',
        type: 'boolean',
        widget: 'BooleanSwitch',
        description: '附件是否压缩(压缩后清晰度会降低)',
      },
      photo: {
        title: '允许从相册选取',
        type: 'boolean',
        widget: 'BooleanSwitch',
        description: '仅支持移动端',
        default: false,
        hidden: "{{!['图片', '视频'].includes(formData.fileType)}}"
      },
      watermark: {
        title: '水印',
        type: 'boolean',
        widget: 'BooleanSwitch',
        description: '图片是否添加水印(仅支持移动端)',
        default: false,
        hidden: "{{!['图片'].includes(formData.fileType)}}"
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  },
  // {
  //   text: '图片',
  //   name: '图片',
  //   icon: <IconPack.FileUpload />,
  //   schema: {
  //     title: '图片',
  //     type: 'string',
  //     widget: 'FileUpload',
  //     width: '100%',
  //     preview: true,
  //     isUncompressed: true,
  //   },
  //   setting: {
  //     widget: {
  //       title: '控件类型',
  //       type: 'string',
  //       widget: 'WidgetType',
  //       displayType: 'row',
  //       labelWidth: 80,
  //     },
  //     $id: {
  //       title: '数据源',
  //       type: 'string',
  //       widget: 'FieldNames',
  //       required: true,
  //     },
  //     title: {
  //       title: '展示名称',
  //       type: 'string',
  //       required: true,
  //     },
  //     placeholder: {
  //       title: '提示语',
  //       type: 'string',
  //     },
  //     description: {
  //       title: '字段说明',
  //       type: 'string',
  //     },
  //     presetValue: {
  //       title: '默认值',
  //       type: 'string',
  //     },
  //     isHidden: {
  //       title: '是否隐藏',
  //       type: 'boolean',
  //       widget: 'IsHidden',
  //       default: false,
  //       displayType: 'row',
  //       labelWidth: 80,
  //     },
  //     hiddenCondition: {
  //       title: '隐藏条件',
  //       type: 'string',
  //       description: '所有形态默认显示',
  //       widget: 'HiddenCondition',
  //       hidden: "{{formData.isHidden}}",
  //       dependencies: ['isHidden'],
  //     },
  //     fileType: {
  //       title: '文件类型',
  //       type: 'string',
  //       widget: 'FileTypeSelect',
  //       enum: ['全部', '图片', '文档', '音频', '视频'],
  //       enumNames: ['全部', '图片', '文档', '音频', '视频'],
  //       default: '全部',
  //     },
  //     durationTime: {
  //       title: "{{formData.fileType+'最大时长'}}",
  //       type: 'number',
  //       description: '秒',
  //       widget: 'slider',
  //       default: 60,
  //       min: 1,
  //       max: 60,
  //       hidden: "{{!['音频', '视频'].includes(formData.fileType)}}",
  //       dependencies: ['fileType']
  //     },
  //     templateFile: {
  //       title: '模板文件',
  //       type: 'string',
  //       widget: 'TemplateFile',
  //     },
  //     disabled: {
  //       title: '只读',
  //       type: 'boolean',
  //       widget: 'checkbox',
  //       default: false,
  //       width: '50%',
  //     },
  //     required: {
  //       title: '必填',
  //       type: 'boolean',
  //       widget: 'checkbox',
  //       default: false,
  //       width: '50%',
  //     },
  //     preview: {
  //       title: '预览',
  //       type: 'boolean',
  //       widget: 'checkbox',
  //       default: true,
  //       width: '50%',
  //     },
  //     download: {
  //       title: '下载',
  //       type: 'boolean',
  //       widget: 'checkbox',
  //       default: true,
  //       width: '50%',
  //     },
  //     isUncompressed: {
  //       title: '压缩',
  //       type: 'boolean',
  //       widget: 'BooleanSwitch',
  //       description: '附件是否压缩(压缩后清晰度会降低)',
  //     },
  //     photo: {
  //       title: '允许从相册选取',
  //       type: 'boolean',
  //       widget: 'BooleanSwitch',
  //       description: '仅支持移动端',
  //       default: false,
  //       hidden: "{{!['图片', '视频'].includes(formData.fileType)}}"
  //     },
  //     watermark: {
  //       title: '水印',
  //       type: 'boolean',
  //       widget: 'BooleanSwitch',
  //       description: '图片是否添加水印(仅支持移动端)',
  //       default: false,
  //       hidden: "{{!['图片'].includes(formData.fileType)}}"
  //     },
  //     groupStyle: {
  //       title: '控件样式',
  //       type: 'object',
  //       properties: {}
  //     },
  //     width: {
  //       title: '控件占比',
  //       type: 'string',
  //       widget: 'RadioGroupW',
  //     },
  //   },
  // },
  {
    text: '日期选择',
    name: '日期选择',
    icon: <IconPack.DateTime />,
    schema: {
      title: '日期选择',
      type: 'string',
      widget: 'DateTime',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      calculateRule: {
        title: '计算规则',
        type: 'string',
        widget: 'CalculateRule',
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '40%',
        props: {
          style: {
            marginLeft: '10px',
          }
        }
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '30%',
      },
      format: {
        title: '日期格式',
        type: 'string',
        enum: ['date', 'dateTime', 'year', 'month', 'week', 'quarter', 'datePeriod'],
        default: 'date',
        enumNames: ['日期', '日期时间', '日期年份', '日期月份', '日期周', '日期季度', '日期时段'],
      },
      options: {
        title: '选项',
        type: 'string',
        widget: 'select',
        enum: ['默认为空', '默认为当前时间', '不超过当前时间'],
        default: '默认为空',
        enumNames: ['默认为空', '默认为当前时间', '不超过当前时间'],
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  },
  {
    text: '时间选择',
    name: '时间选择',
    icon: <IconPack.Time />,
    schema: {
      title: '时间选择',
      type: 'string',
      widget: 'Time',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
        widget: 'htmlInput',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      calculateRule: {
        title: '计算规则',
        type: 'string',
        widget: 'CalculateRule',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
        widget: 'TimeDefault',
        format: '{{formData.format}}',
        description: '勾选默认当前时间此处配置无效'
      },
      options: {
        title: '选项',
        type: 'string',
        widget: 'select',
        enum: ['默认为空', '默认为当前时间', '不超过当前时间'],
        default: '默认为空',
        enumNames: ['默认为空', '默认为当前时间', '不超过当前时间'],
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '50%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '50%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    }
  },
  {
    text: '人员选择',
    name: '人员选择',
    icon: <IconPack.PersonSelector />,
    schema: {
      title: '人员选择',
      type: 'string',
      widget: 'PersonSelector',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 80,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      role: {
        title: '机构角色',
        type: 'string',
        widget: 'GroupAndRole',
      },
      isMySite: {
        title: '本人站点',
        name: '本人站点',
        required: true,
        default: false,
        type: 'boolean',
        widget: 'checkbox',
        width: '50%',
      },
      isStoreID: {
        title: '是否存储ID',
        type: 'boolean',
        default: false,
        width: '50%',
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      isMultiple: {
        title: '多选',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      interactiveType: {
        title: '交互方式',
        type: 'string',
        widget: 'select',
        enum: ['下拉框', '分组模态', '树形模态'],
        default: '下拉框',
        enumNames: ['下拉框', '分组模态', '树形模态'],
        displayType: 'row',
        labelWidth: 80,
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    }
  },
  {
    text: '部门选择',
    name: '部门选择',
    icon: <IconPack.DeptSelector />,
    schema: {
      title: '部门选择',
      type: 'string',
      widget: 'DeptSelector',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 80,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '25%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '25%',
      },
      isMultiple: {
        title: '多选',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '25%',
      },
      isStoreID: {
        title: '是否存储ID',
        type: 'boolean',
        default: false,
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    }
  },
  {
    text: '台账选择',
    name: '台账选择',
    icon: <IconPack.AccountSelector />,
    schema: {
      title: '台账选择',
      type: 'string',
      widget: 'AccountSelector',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        type: 'string',
        required: true,
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      mobileShowType: {
        title: '展示形式',
        type: 'string',
        description: '移动端展示专用',
        widget: 'select',
        enum: ['卡片', '列表'],
        default: '',
        enumNames: ['卡片', '列表'],
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      accountName: {
        title: '台账名称',
        name: '台账名称',
        type: 'string',
        widget: 'AccountName',
      },
      fieldshine: {
        title: '映射字段',
        name: '映射字段',
        type: 'array',
        widget: 'Fieldshine',
        dependencies: ['accountName', '$id'],
        default: [],
        description: '多字段映射仅支持单选',
      },
      fieldList: {
        title: '前端显示字段',
        type: 'array',
        default: [],
        widget: 'FieldList',
        dependencies: ['accountName', '$id'],
        description: '默认获取前端台账字段',
      },
      isStoreID: {
        title: '存储ID',
        name: '存储ID',
        type: 'boolean',
        default: false,
        displayType: 'row',
        labelWidth: 110,
        widget: 'BooleanSwitch',
        description: '开启后将会存储台账的ID',
      },
      siteFilter: {
        title: '站点过滤',
        name: '站点过滤',
        type: 'boolean',
        default: false,
        displayType: 'row',
        labelWidth: 110,
        widget: 'BooleanSwitch',
        description: '开启后只显示自己所属站点数据',
      },
      autofill: {
        title: '默认值自动映射',
        name: '站点过滤',
        type: 'boolean',
        default: false,
        displayType: 'row',
        labelWidth: 160,
        widget: 'BooleanSwitch',
        description: '开启后会将默认值作为台账查询条件将第一行数据映射到表单中',
      },
      isMultiple: {
        title: '多选',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        displayType: 'row',
        labelWidth: 100,
        widget: 'BooleanSwitch',
        hidden: '{{formData.fieldshine.length !== 1}}',
      },
      sql: {
        title: 'SQL过滤',
        name: 'SQL过滤',
        type: 'string',
        widget: 'SqlFilter',
        props: {
          placeholder: '示例:部门="XX部门"'
        }
      },
      required: {
        title: '必填',
        type: 'boolean',
        default: false,
        width: '33%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      ...groupStyle,
    }
  }
]

const selectWidgets = [
  {
    text: '下拉框',
    name: '下拉框',
    icon: <IconPack.ComboBox />,
    schema: {
      title: '下拉框',
      type: 'string',
      widget: 'ComboBox',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
        widget: 'htmlInput',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
        default: '',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      presetValue: {
        title: '默认值',
        type: 'string',
      },
      sourceType: {
        title: '来源方式',
        name: '下拉框',
        type: 'string',
        widget: 'SourceType',
        default: '手动输入',
      },
      options: {
        title: '',
        name: '选项',
        type: 'array',
        hidden: '{{formData.sourceType !== "手动输入"}}',
        default: [{ value: '选项一' }],
        widget: 'SimpleList',
        dependencies: ['sourceType', 'color', 'isMultiple']
      },
      dictionary: {
        title: '{{formData.sourceType}}',
        name: '{{formData.sourceType}}',
        hidden: '{{formData.sourceType !== "数据字典"}}',
        type: 'string',
        widget: 'Dictionary',
        value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
        dependencies: ['sourceType']
      },
      tableName: {
        title: '表名',
        name: '表名',
        hidden: '{{formData.sourceType !== "表数据"}}',
        type: 'string',
        widget: 'TableName',
        dependencies: ['sourceType'],
      },
      fieldName: {
        title: '字段名',
        name: '字段名',
        hidden: '{{formData.sourceType !== "表数据"}}',
        type: 'string',
        widget: 'FieldName',
        dependencies: ['sourceType', 'tableName'],
      },
      isMySite: {
        title: '仅显示本人所属的站点',
        default: false,
        hidden: '{{formData.sourceType !== "站点"}}',
        type: 'boolean',
        widget: 'checkbox',
        props: {
          style: {
            paddingLeft: '10px'
          }
        }
      },
      required: {
        title: '必填',
        type: 'boolean',
        default: false,
        width: '30%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '30%',
      },
      isMultiple: {
        title: '多选',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '30%',
        // hidden: '{{formData.isEdit}}'
      },
      isSearch: {
        title: '搜索',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '30%',
        default: true
      },
      isStoreID: {
        title: '是否存储ID',
        default: false,
        hidden: '{{formData.sourceType !== "站点"}}',
        type: 'boolean',
        widget: 'checkbox',
        width: '40%',
      },
      isEdit: {
        title: '是否可编辑',
        type: 'boolean',
        widget: 'BooleanSwitch',
        displayType: 'row',
        labelWidth: 120,
        description: '勾选后可直接输入选项,可编辑选择仅支持多选',
        hidden: '{{formData.sourceType !== "手动输入"}}'
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    }
  },
  {
    text: '单选框',
    name: '单选框',
    icon: <IconPack.RadioButton />,
    schema: {
      title: '单选框',
      name: '单选框',
      type: 'string',
      widget: 'RadioButton',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 74,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
        widget: 'htmlInput',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      sourceType: {
        title: '来源方式',
        type: 'string',
        widget: 'SourceType',
        default: '手动输入',
      },
      options: {
        title: '',
        name: '选项',
        type: 'array',
        hidden: '{{formData.sourceType !== "手动输入"}}',
        default: [{ key: '选项一', value: '选项一' }],
        widget: 'SimpleList',
        dependencies: ['sourceType', 'color']
      },
      dictionary: {
        title: '{{formData.sourceType}}',
        name: '{{formData.sourceType}}',
        hidden: '{{formData.sourceType !== "数据字典"}}',
        type: 'string',
        widget: 'Dictionary',
        value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
      },
      tableName: {
        title: '表名',
        name: '表名',
        hidden: '{{formData.sourceType !== "表数据"}}',
        type: 'string',
        widget: 'TableName',
        dependencies: ['sourceType'],
      },
      fieldName: {
        title: '字段名',
        name: '字段名',
        hidden: '{{formData.sourceType !== "表数据"}}',
        type: 'string',
        widget: 'FieldName',
        dependencies: ['sourceType', 'tableName'],
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '40%',
        props: {
          style: {
            marginLeft: '10px',
          }
        }
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '30%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    }
  },
  {
    text: '复选框',
    name: '复选框',
    icon: <IconPack.CheckBox />,
    schema: {
      title: '复选框',
      name: '复选框',
      type: 'string',
      widget: 'CheckBox',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
        widget: 'htmlInput',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        disabled: disabled,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      sourceType: {
        title: '来源方式',
        type: 'string',
        widget: 'SourceType',
        default: '手动输入',
      },
      options: {
        title: '',
        name: '选项',
        type: 'array',
        hidden: '{{formData.sourceType !== "手动输入"}}',
        default: [{ value: '选项一' }],
        widget: 'SimpleList',
        dependencies: ['sourceType', 'color']
      },
      dictionary: {
        title: '{{formData.sourceType}}',
        name: '{{formData.sourceType}}',
        hidden: '{{formData.sourceType !== "数据字典"}}',
        type: 'string',
        widget: 'Dictionary',
        value: '{{formData.sourceType !== "数据字典" ? null : ""}}',
      },
      tableName: {
        title: '表名',
        name: '表名',
        hidden: '{{formData.sourceType !== "表数据"}}',
        type: 'string',
        widget: 'TableName',
        dependencies: ['sourceType'],
      },
      fieldName: {
        title: '字段名',
        name: '字段名',
        hidden: '{{formData.sourceType !== "表数据"}}',
        type: 'string',
        widget: 'FieldName',
        dependencies: ['sourceType', 'tableName'],
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '40%',
        props: {
          style: {
            marginLeft: '10px',
          }
        }
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '30%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    }
  },
  {
    text: '开关按钮',
    name: '开关按钮',
    icon: <IconPack.SwitchSelector />,
    schema: {
      title: '开关按钮',
      name: '开关按钮',
      type: 'string',
      widget: 'SwitchSelector'
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 74,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
        widget: 'htmlInput',
      },
      presetValue: {
        title: '默认值',
        type: 'boolean',
        widget: 'SwitchDefault',
        dependencies: ['showText'],
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        disabled: disabled,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '25%',
      },
      showText: {
        title: '显示文字',
        type: 'string',
        widget: 'ShowText',
        default: '开/关',
        description: '示例(开/关)'
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  },
  {
    text: '关联选择',
    name: '关联选择',
    icon: <IconPack.RelevanceSelect />,
    schema: {
      title: '关联选择',
      name: '关联选择',
      type: 'string',
      widget: 'RelevanceSelect',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
        widget: 'htmlInput',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
        widget: 'CascadeDefault',
        dependencies: ['sourceType'],
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      fieldParent: {
        title: '父字段名',
        type: 'string',
        // required: true,
        widget: 'FieldNames',
        dependencies: ['$id'],
      },
      dictionary: {
        title: '数据字典',
        name: '数据字典',
        // required: true,
        type: 'string',
        widget: 'Dictionary',
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      ...groupStyle,
    }
  },
  {
    text: '级联选择',
    name: '级联选择',
    icon: <IconPack.CascadeSelector />,
    schema: {
      title: '级联选择',
      name: '级联选择',
      type: 'string',
      widget: 'CascadeSelector',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
        widget: 'htmlInput',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
        widget: 'CascadeDefault',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      sourceType: {
        title: '来源方式',
        name: '来源方式',
        type: 'string',
        widget: 'select',
        default: '城市数据',
        enum: ['城市数据'],
        enumNames: ['城市数据'],
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '40%',
        props: {
          style: {
            marginLeft: '10px',
          }
        }
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '30%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  }
]

const businessWidgets = [
  {
    text: '人员选择',
    name: '人员选择',
    icon: <IconPack.PersonSelector />,
    schema: {
      title: '人员选择',
      type: 'string',
      widget: 'PersonSelector',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 80,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      role: {
        title: '机构角色',
        type: 'string',
        widget: 'GroupAndRole',
      },
      isMySite: {
        title: '本人站点',
        name: '本人站点',
        required: true,
        default: false,
        type: 'boolean',
        widget: 'checkbox',
        width: '50%',
      },
      isStoreID: {
        title: '是否存储ID',
        type: 'boolean',
        default: false,
        width: '50%',
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      isMultiple: {
        title: '多选',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      interactiveType: {
        title: '交互方式',
        type: 'string',
        widget: 'select',
        enum: ['下拉框', '分组模态', '树形模态'],
        default: '下拉框',
        enumNames: ['下拉框', '分组模态', '树形模态'],
        displayType: 'row',
        labelWidth: 80,
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    }
  },
  {
    text: '部门选择',
    name: '部门选择',
    icon: <IconPack.DeptSelector />,
    schema: {
      title: '部门选择',
      type: 'string',
      widget: 'DeptSelector',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 80,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '25%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '25%',
      },
      isMultiple: {
        title: '多选',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '25%',
      },
      isStoreID: {
        title: '是否存储ID',
        type: 'boolean',
        default: false,
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    }
  },
  {
    text: '台账选择',
    name: '台账选择',
    icon: <IconPack.AccountSelector />,
    schema: {
      title: '台账选择',
      type: 'string',
      widget: 'AccountSelector',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        type: 'string',
        required: true,
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      accountName: {
        title: '台账名称',
        name: '台账名称',
        type: 'string',
        widget: 'AccountName',
      },
      fieldshine: {
        title: '映射字段',
        name: '映射字段',
        type: 'array',
        widget: 'Fieldshine',
        dependencies: ['accountName', '$id'],
        default: [],
        description: '多字段映射仅支持单选',
      },
      fieldList: {
        title: '前端显示字段',
        type: 'array',
        default: [],
        widget: 'FieldList',
        dependencies: ['accountName', '$id'],
        description: '默认获取前端台账字段',
      },
      isStoreID: {
        title: '存储ID',
        name: '存储ID',
        type: 'boolean',
        default: false,
        displayType: 'row',
        labelWidth: 110,
        widget: 'BooleanSwitch',
        description: '开启后将会存储台账的ID',
      },
      siteFilter: {
        title: '站点过滤',
        name: '站点过滤',
        type: 'boolean',
        default: false,
        displayType: 'row',
        labelWidth: 110,
        widget: 'BooleanSwitch',
        description: '开启后只显示自己所属站点数据',
      },
      autofill: {
        title: '默认值自动映射',
        name: '站点过滤',
        type: 'boolean',
        default: false,
        displayType: 'row',
        labelWidth: 160,
        widget: 'BooleanSwitch',
        description: '开启后会将默认值作为台账查询条件将第一行数据映射到表单中',
      },
      isMultiple: {
        title: '多选',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        displayType: 'row',
        labelWidth: 100,
        widget: 'BooleanSwitch',
        hidden: '{{formData.fieldshine.length !== 1}}',
      },
      sql: {
        title: 'SQL过滤',
        name: 'SQL过滤',
        type: 'string',
        widget: 'SqlFilter',
        props: {
          placeholder: '示例:部门="XX部门"'
        }
      },
      required: {
        title: '必填',
        type: 'boolean',
        default: false,
        width: '33%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      ...groupStyle,
    }
  }
]

const dateWidgets = [
  {
    text: '日期选择',
    name: '日期选择',
    icon: <IconPack.DateTime />,
    schema: {
      title: '日期选择',
      type: 'string',
      widget: 'DateTime',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      calculateRule: {
        title: '计算规则',
        type: 'string',
        widget: 'CalculateRule',
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '40%',
        props: {
          style: {
            marginLeft: '10px',
          }
        }
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '30%',
      },
      format: {
        title: '日期格式',
        type: 'string',
        enum: ['date', 'dateTime', 'year', 'month', 'week', 'quarter', 'datePeriod'],
        default: 'date',
        enumNames: ['日期', '日期时间', '日期年份', '日期月份', '日期周', '日期季度', '日期时段'],
      },
      options: {
        title: '选项',
        type: 'string',
        widget: 'select',
        enum: ['默认为空', '默认为当前时间', '不超过当前时间'],
        default: '默认为空',
        enumNames: ['默认为空', '默认为当前时间', '不超过当前时间'],
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  },
  {
    text: '时间选择',
    name: '时间选择',
    icon: <IconPack.Time />,
    schema: {
      title: '时间选择',
      type: 'string',
      widget: 'Time',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
        widget: 'htmlInput',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      calculateRule: {
        title: '计算规则',
        type: 'string',
        widget: 'CalculateRule',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
        widget: 'TimeDefault',
        format: '{{formData.format}}',
        description: '勾选默认当前时间此处配置无效'
      },
      options: {
        title: '选项',
        type: 'string',
        widget: 'select',
        enum: ['默认为空', '默认为当前时间', '不超过当前时间'],
        default: '默认为空',
        enumNames: ['默认为空', '默认为当前时间', '不超过当前时间'],
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '50%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '50%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    }
  },
]

const fileWidgets = [
  {
    text: '附件',
    name: '附件',
    icon: <IconPack.FileUpload />,
    schema: {
      title: '附件',
      type: 'string',
      widget: 'FileUpload',
      width: '100%',
      preview: true,
      isUncompressed: true,
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 80,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        type: 'string',
        required: true,
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      fileType: {
        title: '文件类型',
        type: 'string',
        widget: 'FileTypeSelect',
        enum: ['全部', '图片', '文档', '音频', '视频'],
        enumNames: ['全部', '图片', '文档', '音频', '视频'],
        default: '全部',
      },
      durationTime: {
        title: "{{formData.fileType+'最大时长'}}",
        type: 'number',
        description: '秒',
        widget: 'slider',
        default: 60,
        min: 1,
        max: 60,
        hidden: "{{!['音频', '视频'].includes(formData.fileType)}}",
        dependencies: ['fileType']
      },
      templateFile: {
        title: '模板文件',
        type: 'string',
        widget: 'TemplateFile',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '50%',
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '50%',
      },
      preview: {
        title: '预览',
        type: 'boolean',
        widget: 'checkbox',
        default: true,
        width: '50%',
      },
      download: {
        title: '下载',
        type: 'boolean',
        widget: 'checkbox',
        default: true,
        width: '50%',
      },
      isUncompressed: {
        title: '压缩',
        type: 'boolean',
        widget: 'BooleanSwitch',
        description: '附件是否压缩(压缩后清晰度会降低)',
      },
      photo: {
        title: '允许从相册选取',
        type: 'boolean',
        widget: 'BooleanSwitch',
        description: '仅支持移动端',
        default: false,
        hidden: "{{!['图片', '视频'].includes(formData.fileType)}}"
      },
      watermark: {
        title: '水印',
        type: 'boolean',
        widget: 'BooleanSwitch',
        description: '图片是否添加水印(仅支持移动端)',
        default: false,
        hidden: "{{!['图片'].includes(formData.fileType)}}"
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  },
]

const mapWidgets = [
  {
    text: '地图坐标',
    name: '地图坐标',
    icon: <IconPack.Coordinate />,
    schema: {
      title: '地图坐标',
      type: 'string',
      widget: 'Coordinate',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        type: 'string',
        required: true,
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      currentAddress: {
        title: '自动获取',
        type: 'boolean',
        widget: 'BooleanSwitch',
        description: '自动获取当前地址(手持端专用)'
      },
      addressSync: {
        title: '地址同步',
        type: 'string',
        widget: 'AddressSync',
        description: '位置信息将会同步到下方字段中',
      },
      screenShot: {
        title: '是否显示缩略图',
        type: 'boolean',
        widget: 'BooleanSwitch',
        default: false,
        description: '只读情况下会显示缩略图'
      },
      areaSync: {
        title: '区域同步',
        type: 'string',
        widget: 'AreaSync',
        description: '坐标对应最小区域会同步到下方字段中',
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '25%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  },
  {
    text: '设备选择',
    name: '设备选择',
    icon: <IconPack.Device />,
    schema: {
      title: '设备选择',
      type: 'string',
      widget: 'Device',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      fieldshine: {
        title: '映射字段',
        name: '映射字段',
        type: 'array',
        widget: 'DeviceFieldshine',
        default: [],
      },
      addressSync: {
        title: '地址同步',
        type: 'string',
        widget: 'AddressSync',
        description: '位置信息将会同步到下方字段中',
      },
      screenShot: {
        title: '是否显示缩略图',
        type: 'boolean',
        widget: 'BooleanSwitch',
        default: false,
        description: '只读情况下会显示缩略图'
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '25%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  },
  {
    text: '绘制路径',
    name: '绘制路径',
    icon: <IconPack.DrawPath />,
    schema: {
      title: '绘制路径',
      type: 'string',
      widget: 'DrawPath',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        disabled: disabled,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        disabled: disabled,
        hidden: "{{formData.isHidden}}",
        dependencies: ['tableTypeParent', 'IsSystemField', 'isHidden'],
      },
      screenShot: {
        title: '是否显示缩略图',
        type: 'boolean',
        widget: 'BooleanSwitch',
        default: false,
        description: '只读情况下会显示缩略图'
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '25%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  },
  {
    text: '绘制区域',
    name: '绘制区域',
    icon: <IconPack.DrawArea />,
    schema: {
      title: '绘制区域',
      type: 'string',
      widget: 'DrawArea',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      screenShot: {
        title: '是否显示缩略图',
        type: 'boolean',
        widget: 'BooleanSwitch',
        default: false,
        description: '只读情况下会显示缩略图'
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '25%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  },
  {
    text: '区域任务',
    name: '区域任务',
    icon: <IconPack.AreaTask />,
    schema: {
      title: '区域任务',
      type: 'string',
      widget: 'AreaTask',
      placeholder: '',
      width: '100%',
      labelWidth: 1,
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        type: 'string',
        widget: 'htmlInput',
        default: '区域任务',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      areaTaskShine: {
        title: '巡检对象',
        name: '巡检对象',
        type: 'array',
        widget: 'AreaTaskShine',
        default: [],
      },
      fieldList: {
        title: '前端显示字段',
        name: '前端显示字段',
        type: 'array',
        default: [],
        widget: 'TaskFieldList',
        description: '用于区域控件列表显示',
        dependencies: ['areaTaskShine']
      },
      taskSummary: {
        title: '任务摘要',
        name: '任务摘要',
        type: 'array',
        default: [],
        widget: 'TaskFieldList',
        description: '用于任务对象显示',
        dependencies: ['areaTaskShine']
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '25%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  },
  {
    text: '自定义地图',
    name: '自定义地图',
    icon: <IconPack.AreaTask />,
    schema: {
      title: '自定义地图',
      type: 'string',
      widget: 'CustomMap',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        type: 'string',
        widget: 'htmlInput',
        default: '区域任务',
      },
      mapName: {
        title: '地图名称',
        type: 'string',
        default: "阀门地图"
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      addressSync: {
        title: '数据同步',
        type: 'string',
        widget: 'AddressSync',
        description: '地图数据信息将同步到下方字段中',
        otherProps: {
          mode: "multiple"
        }
      },
      height: {
        title: '控件高度',
        type: 'string',
        default: 200
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
        default: "100%"
      },
    },
  },
  {
    text: '区域到位',
    name: '区域到位',
    icon: <IconPack.AreaTask />,
    schema: {
      title: '区域到位',
      type: 'string',
      widget: 'PunchInMap',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      rings: {
        title: '到位区域',
        type: 'string',
        description: '默认边界范围或手绘到位范围',
        widget: 'DrawMap'
      },
      allowedLimit: {
        title: '允许偏差范围(米)',
        type: 'number',
        description: '点位允许距离范围内的误差',
        widget: 'number',
        default: 0,
      },
      isValid: {
        title: '开启距离校验',
        type: 'boolean',
        widget: 'SwitchDefault'
      },
      required: {
        title: '必填',
        type: 'boolean',
        default: false,
        width: '50%',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  },
]

const advancedWidgets = [
  {
    text: '富文本',
    name: '富文本',
    icon: <IconPack.RichText />,
    schema: {
      title: '富文本',
      type: 'string',
      widget: 'RichText',
      width: '100%',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 80,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
        widget: 'htmlInput',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      presetValue: {
        title: '默认值',
        type: 'string',
        widget: 'RichTextDefault',
      },
      required: {
        title: '必填',
        type: 'boolean',
        default: false,
        width: '50%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '50%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  },
  {
    text: '编码',
    name: '编码',
    icon: <IconPack.Coding />,
    schema: {
      title: '编码',
      type: 'string',
      widget: 'Coding',
      disabled: true,
      required: false,
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 80,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
        disabled: disabled,
        dependencies: ['tableTypeParent', 'IsSystemField'],
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
        widget: 'htmlInput',
        disabled: disabled,
        dependencies: ['tableTypeParent', 'IsSystemField'],
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      description: {
        title: '字段说明',
        type: 'string',
        disabled: disabled,
        dependencies: ['tableTypeParent', 'IsSystemField'],
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      prefixion: {
        title: '前缀',
        type: 'string',
        disabled: disabled,
        dependencies: ['tableTypeParent', 'IsSystemField'],
      },
      codingType: {
        title: '编码方式',
        type: 'string',
        widget: 'select',
        enum: ['1', '2', '3'],
        default: '3',
        enumNames: ['前缀-年份-六位编码', '前缀-年份月份-六位编码', '前缀-八位编码'],
        description: '{{rootValue.codingType === "1" ?"示例:XJ-2019-000001" : (rootValue.codingType === "2" ? "示例: XJ-201909-000001" : "示例: XJ00000001")}}',
        disabled: disabled,
        dependencies: ['tableTypeParent', 'IsSystemField'],
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
        disabled: disabled,
        dependencies: ['tableTypeParent', 'IsSystemField'],
      },
    },
  },
  {
    text: '关联选择',
    name: '关联选择',
    icon: <IconPack.RelevanceSelect />,
    schema: {
      title: '关联选择',
      name: '关联选择',
      type: 'string',
      widget: 'RelevanceSelect',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
        widget: 'htmlInput',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
        widget: 'CascadeDefault',
        dependencies: ['sourceType'],
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      sourceType: {
        title: '来源方式',
        type: 'string',
        widget: 'select',
        default: '数据字典',
        props: {
          options: [
            { label: '数据字典', value: '数据字典' },
            { label: '表数据', value: '表数据' },
            { label: '手动输入', value: '手动输入' },
          ]
        }
      },
      fieldParent: {
        title: '父字段名',
        type: 'string',
        // required: true,
        widget: 'FieldNames',
        hidden: "{{formData.sourceType != '数据字典' && formData.sourceType != '手动输入'}}",
        dependencies: ['$id'],
      },
      dictionary: {
        title: '数据字典',
        name: '数据字典',
        // required: true,
        type: 'string',
        hidden: "{{formData.sourceType != '数据字典'}}",
        widget: 'Dictionary',
      },
      tableName: {
        title: '表名',
        name: '表名',
        hidden: '{{formData.sourceType !== "表数据"}}',
        type: 'string',
        widget: 'TableName',
        dependencies: ['sourceType'],
      },
      displayName: {
        title: '展示字段名',
        name: '展示字段名',
        hidden: '{{formData.sourceType !== "表数据"}}',
        type: 'string',
        widget: 'FieldName',
        dependencies: ['tableName'],
      },
      fieldName: {
        title: '存储字段名',
        name: '存储字段名',
        hidden: '{{formData.sourceType !== "表数据"}}',
        type: 'string',
        widget: 'FieldName',
        dependencies: ['tableName'],
      },
      fieldTableKey:{
        title: '联动父级字段',
        type: 'string',
        description: '跟随父级字段值变化加载数据',
        hidden: "{{formData.sourceType != '表数据'}}",
        widget: 'FollowFieldHide',
      },
      whereType: {
        title: '联动条件',
        type: 'string',
        widget: 'select',
        props: {
          options: [
            { label: '等于', value: '等于' },
            { label: '包含', value: '包含' }
          ]
        },
        hidden: "{{formData.sourceType != '表数据'}}",
      },
      whereField: {
        title: '联动字段名',
        name: '联动字段名',
        hidden: '{{formData.sourceType !== "表数据"}}',
        type: 'string',
        widget: 'FieldName',
        dependencies: ['tableName'],
      },
      selectSource:{
        title: '选择项',
        hidden: '{{formData.sourceType !== "手动输入"}}',
        type: 'string',
        widget: 'DataSelect',
        dependencies: ['fieldParent']
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      ...groupStyle,
    }
  },
  {
    text: '级联选择',
    name: '级联选择',
    icon: <IconPack.CascadeSelector />,
    schema: {
      title: '级联选择',
      name: '级联选择',
      type: 'string',
      widget: 'CascadeSelector',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        required: true,
        type: 'string',
        widget: 'htmlInput',
      },
      placeholder: {
        title: '提示语',
        type: 'string',
      },
      presetValue: {
        title: '默认值',
        type: 'string',
        widget: 'CascadeDefault',
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      sourceType: {
        title: '来源方式',
        name: '来源方式',
        type: 'string',
        widget: 'select',
        default: '城市数据',
        enum: ['城市数据'],
        enumNames: ['城市数据'],
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '40%',
        props: {
          style: {
            marginLeft: '10px',
          }
        }
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '30%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  },
  {
    text: '关联表单',
    name: '关联表单',
    icon: <IconPack.RelationForm />,
    schema: {
      title: '',
      type: 'string',
      widget: 'RelationForm',
      width: '100%',
      controlShow: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 80,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      titleShow: {
        title: '展示名称',
        type: 'string',
        widget: 'htmlInput',
        default: '关联表单',
      },
      description: {
        title: '字段说明',
        type: 'string',
        widget: 'htmlInput',
      },
      '台账名称': {
        title: '台账名称',
        type: 'string',
        widget: 'AccountName',
      },
      '映射字段': {
        title: '映射字段',
        type: 'array',
        widget: 'MappedField',
        default: [],
        dependencies: ['台账名称'],
      },
      fieldList: {
        title: '前端显示字段',
        type: 'array',
        default: [],
        widget: 'FieldList',
        dependencies: ['accountName', '$id'],
        description: '默认获取前端台账字段',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      mobileShowType: {
        title: '展示形式',
        type: 'string',
        description: '移动端展示专用',
        widget: 'select',
        enum: ['卡片', '列表'],
        default: '',
        enumNames: ['卡片', '列表'],
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      isEdit: {
        title: '表格可编辑',
        description: '表格字段变为可编辑与添加字段集',
        type: 'boolean',
        widget: 'BooleanSwitch',
        default: false,
      },
      otherSource: {
        title: '数据来源',
        type: 'object',
        widget: 'OtherSource',
        dependencies: ['台账名称']
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  },
  {
    text: '手写签名',
    name: '手写签名',
    icon: <IconPack.Signature />,
    schema: {
      title: '手写签名',
      type: 'string',
      widget: 'Signature',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 80,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        type: 'string',
        widget: 'htmlInput',
        default: '关联表单',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
        displayType: 'row',
        labelWidth: 80,
      },
      showDate: {
        title: '是否显示签名日期',
        type: 'boolean',
        widget: 'switch',
        default: false,
        displayType: 'row',
        labelWidth: 137,
        checkedTxt: '显示',
        unCheckedTxt: '隐藏'
      },
      isShowSave: {
        title: '是否隐藏保存电子签章选项',
        type: 'boolean',
        widget: 'switch',
        default: false,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      description: {
        title: '字段说明',
        type: 'string',
        widget: 'htmlInput',
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
      },
    },
  },
  {
    text: '身份证识别',
    name: '身份证识别',
    icon: <IconPack.IDCard />,
    schema: {
      title: '身份证',
      type: 'string',
      widget: 'IDCard',
      width: '100%',
      preview: true,
      showField: ['身份号码', '姓名', '名族', '住址', '出生', '性别', '失效日期', '签发机关', '签发日期'],
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 80,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        type: 'string',
        required: true,
      },
      description: {
        title: '字段说明',
        type: 'string',
      },
      showField: {
        title: '身份信息',
        type: 'array',
        widget: 'CheckBoxGroup',
      },
      // hiddenCondition: {
      //   title: '隐藏条件',
      //   type: 'string',
      //   description: '所有形态默认显示',
      //   widget: 'HiddenCondition'
      // },
      // options: {
      //   title: '',
      //   name: '选项',
      //   type: 'array',
      //   default: [{ value: '选项一' }],
      //   widget: 'SimpleList',
      //   dependencies: ['sourceType', 'color', 'isMultiple']
      // },
      // fileType: {
      //   title: '文件类型',
      //   type: 'string',
      //   widget: 'FileTypeSelect',
      //   enum: ['图片'],
      //   enumNames: ['图片'],
      //   default: '全部',
      // },
      durationTime: {
        title: "{{formData.fileType+'最大时长'}}",
        type: 'number',
        description: '秒',
        widget: 'slider',
        default: 60,
        min: 1,
        max: 60,
        hidden: "{{!['音频', '视频'].includes(formData.fileType)}}",
        dependencies: ['fileType']
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '50%',
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '50%',
      },
      // preview: {
      //   title: '预览',
      //   type: 'boolean',
      //   widget: 'checkbox',
      //   default: true,
      //   width: '33%',
      // },
      // download: {
      //   title: '下载',
      //   type: 'boolean',
      //   widget: 'checkbox',
      //   default: true,
      //   width: '33%',
      // },
      photo: {
        title: '允许从相册选取',
        type: 'boolean',
        widget: 'BooleanSwitch',
        description: '仅支持移动端',
        default: false,
        hidden: "{{!['图片', '视频'].includes(formData.fileType)}}"
      },
      watermark: {
        title: '水印',
        type: 'boolean',
        widget: 'BooleanSwitch',
        description: '图片是否添加水印(仅支持移动端)',
        default: false,
        hidden: "{{!['图片'].includes(formData.fileType)}}"
      },
      groupStyle: {
        title: '控件样式',
        type: 'object',
        properties: {}
      },
      width: {
        title: '元素宽度',
        type: 'string',
        widget: 'percentSlider',
      },
      labelWidth: {
        title: '标签宽度',
        description: '默认值110',
        default: 110,
        type: 'number',
        widget: 'slider',
        max: 400,
        props: {
          hideNumber: true,
        },
      },
    },
  },
  {
    text: '设备指标',
    name: '设备指标',
    icon: <IconPack.IDCard />,
    schema: {
      title: '设备指标',
      name: '设备指标',
      type: 'string',
      widget: 'IndicatorCard',
      placeholder: '',
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 80,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      title: {
        title: '展示名称',
        type: 'string',
      },
      dataType: {
        title: '指标数据类型',
        type: "string",
        widget: "select",
        enum: ["real" , "history"],
        enumNames: ["实时值", "历史值"],
        required: true,
        default: "real"
      },
      fieldName: {
        title: '映射字段',
        name: '映射字段',
        type: 'string',
        widget: 'FieldName',
        required: true,
        hidden: '{{formData.dataType !== "history"}}',
      },
      timeInterval: {
        title: "时间间隔",
        type: 'string',
        hidden: '{{formData.dataType !== "history"}}',
        widget: "TimeInterval",
        required: true,
      },
      deviceType: {
        title: '设备类型',
        type: 'string',
        required: true,
        widget: "DeviceType"
      },
      deviceCode: {
        title: '设备选择',
        widget: "IndicatorDevice",
        type: 'string',
        required: true,
        hidden: "{{!formData.deviceType}}",
      },
      indicatorType: {
        title: '指标类型',
        widget: "IndicatorType",
        type: 'string',
        required: true,
        hidden: "{{!formData.deviceCode && !formData.deviceCode}}",
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
        default: "100%"
      },
    },
  },
  {
    text: '数据表格',
    name: '数据表格',
    icon: <IconPack.AreaTask />,
    schema: {
      title: '数据表格',
      type: 'number',
      widget: 'DataTable',
      placeholder: '',
      width: '100%',
      labelWidth: 1,
    },
    setting: {
      widget: {
        title: '控件类型',
        type: 'string',
        widget: 'WidgetType',
        displayType: 'row',
        labelWidth: 75,
      },
      $id: {
        title: '数据源',
        type: 'string',
        widget: 'FieldNames',
        required: true,
      },
      title: {
        title: '展示名称',
        type: 'string',
        widget: 'htmlInput',
        default: '关阀任务',
      },
      isHidden: {
        title: '是否隐藏',
        type: 'boolean',
        widget: 'IsHidden',
        default: false,
      },
      defaultTable: {
        title: '默认数据表',
        type: 'string',
        widget: 'htmlInput',
      },
      pagination: {
        title: '是否启用分页(关闭分页后,需要配制滚动)',
        type: 'boolean',
        widget: "switch",
        default: true,
      },
      scrollX: {
        title: 'x轴滚动',
        type: 'number',
        widget: "inputNumber",
        hidden: '{{formData.pagination}}',
      },
      scrollY: {
        title: 'y轴滚动',
        type: 'number',
        widget: "inputNumber",
        hidden: '{{formData.pagination}}',
      },
      optionWidth: {
        title: "操作栏宽度",
        type: "number",
        default: 120
      },
      optionFixed: {
        title: "操作栏固定",
        type: "string",
        default: "false",
        widget: 'select',
        enum: ['false', 'left', 'right'],
        enumNames: ['关闭固定', '靠左', '靠右'],
      },
      optionRender: {
        title: '',
        name: '操作栏内容配置',
        type: 'array',
        default: [
          {  type: "icon", value: 'DeleteOutlined' , action: "delete"},
        ],
        widget: 'OptionRender',
      },
      isOpenRowEvent: {
        title: '是否启动行点击事件',
        type: 'boolean',
        widget: "switch",
        default: true,
      },
      hiddenCondition: {
        title: '隐藏条件',
        type: 'string',
        description: '所有形态默认显示',
        widget: 'HiddenCondition',
        hidden: "{{formData.isHidden}}",
        dependencies: ['isHidden'],
      },
      areaTaskShine: {
        title: '任务对象',
        name: '任务对象',
        type: 'array',
        widget: 'AreaTaskShine',
        default: [],
      },
      fieldList: {
        title: '前端显示字段',
        name: '前端显示字段',
        type: 'array',
        default: [],
        widget: 'TaskFieldList',
        description: '用于区域控件列表显示',
        dependencies: ['areaTaskShine']
      },
      statusOption: {
        title: '',
        name: '字段样式配置',
        type: 'array',
        hidden: '{{formData.fieldList.length === 0}}',
        default: [],
        widget: 'StatusOption',
      },
      disabled: {
        title: '只读',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '25%',
      },
      required: {
        title: '必填',
        type: 'boolean',
        widget: 'checkbox',
        default: false,
        width: '33%',
      },
      width: {
        title: '控件占比',
        type: 'string',
        widget: 'RadioGroupW',
        default: "100%"
      },
    },
  },
]

const settings = [
  {
    title: '布局控件',
    widgets: layoutWidgets
  },
  {
    title: '基础控件',
    widgets: baseWidgets
  },
  // {
  //   title: '选择器控件',
  //   widgets: selectWidgets,
  // },
  // {
  //   title: '业务控件',
  //   widgets: businessWidgets,
  // },
  // {
  //   title: '时间控件',
  //   widgets: dateWidgets,
  // },
  // {
  //   title: '附件控件',
  //   widgets: fileWidgets,
  // },
  {
    title: 'GIS控件',
    widgets: mapWidgets,
  },
  {
    title: '高级控件',
    widgets: advancedWidgets,
  },
]

export default settings