import { IPlatformApp, IApp } from '@cloudbase/cals';

export const textBinding: IApp = {
  name: 'demo_app',
  description: '测试应用',
  main: 'index',
  items: [
    {
      type: 'PAGE',
      id: 'index',
      component: 'page',
      items: [
        {
          component: 'Container',
          id: '0',
          module: '',
          items: [
            {
              id: '1',
              component: 'Text',
              module: '',
              attributes: {
                level: '1',
                ':text': '$page.dataset.state.binding.text',
              },
            },
          ],
        },
      ],
      dataset: {
        state: {
          binding: {
            label: 'binding',
            varType: 'state',
            dataType: 'object',
            initialValue: {
              text: '绑定的文本数据',
            },
          },
        },
      },
    },
  ],
};

export const classBinding: IApp = {
  name: 'demo_app',
  description: '测试应用',
  main: 'index',
  items: [
    {
      type: 'PAGE',
      id: 'index',
      component: 'page',
      items: [
        {
          id: '0',
          component: 'Text',
          module: '',
          attributes: {
            level: '1',
            text: 'class属性',
          },
          directives: { ':if': true },
        },
        {
          id: '1',
          component: 'Text',
          module: '',
          attributes: {
            level: '1',
            text: 'static multiStatic',
            class: 'static multiStatic',
          },
        },
        {
          id: '2',
          component: 'Text',
          module: '',
          attributes: {
            level: '1',
            text: 'dynamic',
          },
          ':class': '$page.dataset.state.class',
        },
        {
          id: '3',
          component: 'Text',
          module: '',
          attributes: {
            level: '1',
            text: 'static with multi dynamic',
            class: 'withStatic',
          },
          ':class': '["multiDynamic","withDynamic"]',
        },
      ],
      dataset: {
        state: {
          class: {
            label: 'class',
            varType: 'state',
            dataType: 'string',
            initialValue: 'dynamic',
          },
        },
      },
    },
  ],
};

export const styleBinding: IApp = {
  name: 'demo_app',
  description: '测试应用',
  main: 'index',
  items: [
    {
      type: 'PAGE',
      id: 'index',
      component: 'page',
      items: [
        {
          id: '0',
          component: 'Text',
          module: '',
          attributes: {
            level: '1',
            text: 'style属性',
          },
          directives: { ':if': true },
        },
        {
          id: '1',
          component: 'Container',
          module: '',
          attributes: {
            title: 'static',
            style: {
              background: 'red',
            },
          },
          extra: {
            commonStyle: {
              background: {
                bgType: 'color',
                color: 'blue',
              },
            },
          },
        },
        {
          id: '1.5',
          component: 'Container',
          module: '',
          attributes: {
            title: 'static commonStyle',
          },
          extra: {
            commonStyle: {
              background: {
                bgType: 'color',
                color: 'red',
              },
            },
          },
        },
        {
          id: '2',
          component: 'Container',
          module: '',
          attributes: {
            title: 'dynamic',
          },
          ':style': '{background: "red"}',
        },
        {
          id: '3',
          component: 'Container',
          module: '',
          attributes: {
            title: 'static with multi dynamic',
            style: {
              background: 'blue',
              borderColor: 'red',
            },
          },
          ':style': '$page.dataset.state.style',
        },
      ],
      dataset: {
        state: {
          style: {
            label: 'style',
            varType: 'state',
            dataType: 'object',
            initialValue: {
              position: 'absolute',
              background: 'red',
            },
          },
        },
      },
    },
  ],
};

export const ifBinding: IApp = {
  name: 'demo_app',
  description: '测试应用',
  main: 'index',
  items: [
    {
      type: 'PAGE',
      id: 'index',
      component: 'page',
      items: [
        {
          id: '0',
          component: 'Text',
          module: '',
          attributes: {
            level: '1',
            text: '基础条件绑定',
          },
          directives: { ':if': true },
        },
        {
          id: '1',
          component: 'Text',
          module: '',
          attributes: {
            level: '1',
            text: '动态不显示',
          },
          directives: {
            ':if': '$page.dataset.state.visible',
          },
        },
        {
          id: '2',
          component: 'Text',
          module: '',
          attributes: {
            level: '1',
            text: '动态显示',
          },
          directives: {
            ':if': '!$page.dataset.state.visible',
          },
        },
        {
          id: '3',
          component: 'Text',
          module: '',
          attributes: {
            level: '1',
            text: '静态显示',
          },
          directives: {
            ':if': true,
          },
        },
        {
          id: '4',
          component: 'Text',
          module: '',
          attributes: {
            level: '1',
            text: '静态不显示',
          },
          directives: {
            ':if': false,
          },
        },
      ],
      dataset: {
        state: {
          visible: {
            label: 'visible',
            varType: 'state',
            dataType: 'boolean',
            initialValue: false,
          },
        },
      },
    },
  ],
};

export const swiperForBinding: IApp = {
  name: 'demo_app',
  description: '测试应用',
  main: 'index',
  items: [
    {
      type: 'PAGE',
      id: 'index',
      component: 'page',
      items: [
        {
          id: '0',
          component: 'Text',
          module: '',
          attributes: {
            level: '1',
            text: 'swiper测试',
          },
          directives: { ':if': true },
        },
        {
          id: 'id1',
          module: '',
          component: 'Swiper',
          attributes: {
            autoplay: true,
            circular: true,
            current: 0,
            duration: 500,
            indicatorActiveColor: 'rgba(0, 0, 0, 0.9)',
            indicatorColor: 'rgba(200, 200, 200, 0.9)',
            indicatorDots: true,
            interval: 5000,
            vertical: false,
          },
          items: [
            {
              id: 'id2',
              module: '',
              component: 'Image',
              attributes: {
                ':alt': '$for.id2',
                fit: 'cover',
                imgPreview: '',
                lazyLoad: false,
                maskClosable: true,
                mode: 'heightFix',
                showMenuByLongpress: '',
                ':src': '$for.id2',
              },
              directives: {
                ':for':
                  "id2 in ['https://main.qcloudimg.com/raw/828ee6644f137d166b063ad7f5dda842.png','https://main.qcloudimg.com/raw/880b5277dc7d8f62fd6b5f964bee3af4.png','https://main.qcloudimg.com/raw/af8d7dff73fea17aa099876bc3a811fa.png']",
              },
              extra: {
                commonStyle: {
                  size: { width: '100%', height: '320' },
                },
                xIndex: 0,
              },
            },
          ],
          directives: { ':if': true },
          extra: { xIndex: 0 },
        },
      ],
      dataset: {
        state: {},
      },
    },
  ],
};

export const forBinding: IApp = {
  name: 'demo_app',
  description: '测试应用',
  main: 'index',
  items: [
    {
      type: 'PAGE',
      id: 'index',
      component: 'page',
      items: [
        {
          id: '0',
          component: 'Text',
          module: '',
          attributes: {
            level: '1',
            text: '基础绑定测试',
          },
          directives: { ':if': true },
        },
        {
          id: 'id9',
          module: '',
          component: 'Container',
          attributes: { title: 'card-containe', class: 'card-container' },
          items: [
            {
              id: 'id11',
              module: '',
              component: 'Image',
              attributes: {
                alt: '[图片]',
                fit: 'cover',
                imgPreview: false,
                lazyLoad: false,
                maskClosable: true,
                mode: 'scaleToFill',
                showMenuByLongpress: '',
                ':src': '$for.id9.imageUrl',
              },
              directives: { ':if': true },
              extra: {
                commonStyle: {
                  size: { width: '100%', height: '360' },
                  custom: [],
                },
                xIndex: 0,
                staticResourceAttribute: ['src'],
              },
            },
            {
              id: 'id12',
              module: '',
              component: 'Container',
              attributes: { title: '' },
              items: [
                {
                  id: 'id14',
                  module: '',
                  component: 'Container',
                  attributes: { title: '' },
                  items: [
                    {
                      id: 'id16',
                      module: '',
                      component: 'Image',
                      attributes: {
                        alt: '[图片]',
                        fit: 'cover',
                        imgPreview: false,
                        lazyLoad: false,
                        maskClosable: true,
                        mode: 'scaleToFill',
                        ':src': '$for.id9.avatar',
                      },
                      directives: { ':if': true },
                      extra: {
                        commonStyle: {
                          self: { width: '60', height: '60' },
                          size: { width: '60', height: '60' },
                        },
                        xIndex: 0,
                        staticResourceAttribute: ['src'],
                      },
                    },
                    {
                      id: 'id17',
                      module: '',
                      component: 'Text',
                      attributes: {
                        maxLines: 1,
                        space: false,
                        ':text': '$for.id9.userName',
                        userSelect: true,
                      },
                      directives: { ':if': true },
                      extra: {
                        commonStyle: {
                          self: {
                            maxWidth: '280px',
                            fontFamily: '"PingFang SC"',
                            whiteSpace: 'pre-line',
                          },
                          text: {
                            color: 'rgb(0, 0, 0)',
                            weight: '400',
                            opacity: 60.00000238418579,
                            fontSize: '24',
                          },
                          custom: [],
                          margin: { left: '24' },
                          maxWidth: '280',
                          fontFamily: '"PingFang SC"',
                          whiteSpace: 'pre-line',
                        },
                        xIndex: 1,
                      },
                    },
                  ],
                  directives: { ':if': true },
                  extra: {
                    commonStyle: {
                      custom: [],
                      display: 'flex',
                      flexConfig: { alignItems: 'center' },
                    },
                    xIndex: 0,
                  },
                },
                {
                  id: 'id15',
                  module: '',
                  component: 'Container',
                  attributes: { title: '' },
                  items: [
                    {
                      id: 'id19',
                      module: '',
                      component: 'Text',
                      attributes: {
                        maxLines: 1,
                        space: false,
                        ':text': '$for.id9.like',
                        userSelect: true,
                      },
                      directives: { ':if': true },
                      extra: {
                        commonStyle: {
                          self: {
                            maxWidth: '180px',
                            fontFamily: '"PingFang SC"',
                            whiteSpace: 'pre-line',
                          },
                          text: {
                            color: 'rgb(0, 0, 0)',
                            weight: '400',
                            opacity: 60.00000238418579,
                            fontSize: '24',
                          },
                          custom: [],
                          maxWidth: '180',
                          position: {
                            bottom: '6',
                            position: 'relative',
                          },
                          fontFamily: '"PingFang SC"',
                          whiteSpace: 'pre-line',
                        },
                        xIndex: 1,
                      },
                    },
                  ],
                  directives: { ':if': true },
                  extra: {
                    commonStyle: {
                      custom: [],
                      display: 'flex',
                      flexConfig: { alignItems: 'center' },
                    },
                    xIndex: 1,
                  },
                },
              ],
              directives: { ':if': true },
              extra: {
                commonStyle: {
                  custom: [],
                  margin: {
                    top: '0',
                    left: '16',
                    right: '16',
                    bottom: '24',
                  },
                  display: 'flex',
                  flexConfig: { justifyContent: 'space-between' },
                },
                xIndex: 2,
              },
            },
            {
              id: 'id13',
              module: '',
              component: 'Text',
              attributes: {
                maxLines: 1,
                space: false,
                ':text': '$for.id9.title',
                userSelect: true,
              },
              directives: { ':if': true },
              extra: {
                commonStyle: {
                  self: { fontFamily: '"PingFang SC"' },
                  text: {
                    color: 'rgba(0, 0, 0, 0.9)',
                    weight: '500',
                    opacity: 100,
                    fontSize: '32',
                  },
                  custom: [],
                  margin: {
                    top: '24',
                    left: '16',
                    right: '16',
                    bottom: '24',
                  },
                  fontFamily: '"PingFang SC"',
                },
                xIndex: 1,
              },
            },
            {
              id: 'id133',
              module: '',
              component: 'Text',
              attributes: {
                maxLines: 1,
                space: false,
                ':text': '$for.id133',
                userSelect: true,
              },
              ':class': '["inner", $for.id133]',
              directives: { ':if': true, ':for': 'id133 in $for.id9.innerList' },
              extra: {
                commonStyle: {
                  self: { fontFamily: '"PingFang SC"' },
                  text: {
                    color: 'rgba(0, 0, 0, 0.9)',
                    weight: '500',
                    opacity: 100,
                    fontSize: '32',
                  },
                  custom: [],
                  margin: {
                    top: '24',
                    left: '16',
                    right: '16',
                    bottom: '24',
                  },
                  fontFamily: '"PingFang SC"',
                },
                xIndex: 1,
              },
            },
          ],
          directives: {
            ':for': 'id9 in $page.dataset.state.cardList',
          },
          extra: {
            commonStyle: {
              self: { flexGrow: '1' },
              size: { width: '656', height: '540' },
              custom: [],
              flexGrow: '1',
            },
            xIndex: 0,
          },
        },
      ],
      dataset: {
        state: {
          cardList: {
            label: 'cardList',
            varType: 'state',
            dataType: 'array',
            initialValue: [
              {
                like: '456',
                title: '北京向南·河南向北·假期自驾北京·保定',
                avatar: 'https://main.qcloudimg.com/raw/47084d09196fcbb8570a45ad73d0cfc3.png',
                imageUrl: 'https://main.qcloudimg.com/raw/73515abe0ba6ced28d3045cc77414895.png',
                userName: '甜甜圈',
                innerList: ['1,2,3'],
              },
              {
                like: '1136',
                title: '北京周边的打卡地～太舞小镇',
                avatar: 'https://main.qcloudimg.com/raw/eb9ba2e28859b087ad5e1a71b5743d75.png',
                imageUrl: 'https://main.qcloudimg.com/raw/178c359c5788447ec13c4420ed1e6439.png',
                userName: '山今宿',
                innerList: [],
              },
            ],
          },
        },
      },
    },
  ],
};

export const dataContainerBinding: IApp = {
  name: 'demo_app',
  description: '测试应用',
  main: 'index',
  items: [
    {
      type: 'PAGE',
      id: 'index',
      component: 'page',
      items: [
        {
          id: 'id56',
          component: 'ListView',
          module: '',
          attributes: {
            datasource: {
              name: 'customer',
              type: 'datamodal',
              extra: {
                params: {},
                viewId: 'view-2oameaoqk0',
                methodName: 'wedaGetRecords',
              },
            },
            orderType: 'asc',
            where: [{}],
          },
          items: [
            {
              id: 'id58',
              component: 'Container',
              module: '',
              attributes: {},
              items: [
                {
                  id: 'id59',
                  component: 'Container',
                  attributes: {},
                  module: '',
                  items: [
                    {
                      id: 'id60',
                      component: 'Container',
                      module: '',
                      attributes: {},
                      items: [
                        {
                          id: 'id61',
                          component: 'Text',
                          module: '',
                          attributes: {
                            maxLines: 1,
                            ':text': '$for.id58.updatedAt',
                          },
                          extra: {
                            commonStyle: {
                              self: {
                                overflow: 'hidden',
                                textOverflow: 'ellipsis',
                                WebkitBoxOrient: 'vertical',
                                WebkitLineClamp: '1',
                              },
                              size: {
                                width: 'auto',
                              },
                              text: {
                                color: 'rgba(0, 0, 0, 0.9)',
                                weight: '600',
                                lineHeight: '20PX',
                              },
                              custom: [],
                              display: '-webkit-box',
                              overflow: 'hidden',
                              textOverflow: 'ellipsis',
                              WebkitBoxOrient: 'vertical',
                              WebkitLineClamp: '1',
                            },
                            xIndex: 0,
                          },
                        },
                        {
                          id: 'id62',
                          component: 'Text',
                          module: '',
                          attributes: {
                            maxLines: 1,
                            text: '这是简单列表内容。',
                            textColor: 'rgb(0, 0,0)',
                          },
                          extra: {
                            commonStyle: {
                              self: {
                                overflow: 'hidden',
                                textOverflow: 'ellipsis',
                                WebkitBoxOrient: 'vertical',
                                WebkitLineClamp: '2',
                              },
                              size: {
                                width: 'auto',
                              },
                              text: {
                                color: 'rgba(0, 0, 0, 0.4)',
                                opacity: 40,
                                fontSize: '12PX',
                                lineHeight: '20PX',
                              },
                              custom: [],
                              margin: {
                                top: '12PX',
                              },
                              display: '-webkit-box',
                              overflow: 'hidden',
                              textOverflow: 'ellipsis',
                              WebkitBoxOrient: 'vertical',
                              WebkitLineClamp: '2',
                            },
                            xIndex: 1,
                          },
                        },
                      ],
                      extra: {
                        commonStyle: {
                          flex: '1',
                          self: {
                            flex: '1',
                            wordBreak: 'break-all',
                          },
                          text: {
                            fontSize: '16PX',
                          },
                          custom: [],
                          wordBreak: 'break-all',
                        },
                        xIndex: 0,
                      },
                    },
                  ],
                  extra: {
                    commonStyle: {
                      self: {
                        boxSizing: 'border-box',
                      },
                      size: {
                        width: '100%',
                      },
                      custom: [],
                      display: 'flex',
                      position: {
                        position: 'relative',
                      },
                      boxSizing: 'border-box',
                      flexConfig: {
                        alignItems: 'center',
                      },
                    },
                    xIndex: 0,
                  },
                },
              ],
              directives: {
                ':for': 'id58 in $context.id56.data',
              },
              extra: {
                commonStyle: {
                  self: {
                    boxSizing: 'border-box',
                    borderBottom: '1px dashed #acacac',
                  },
                  size: {
                    width: '100%',
                  },
                  custom: [],
                  padding: {
                    top: '15PX',
                    left: '19PX',
                    right: '18PX',
                    bottom: '14PX',
                  },
                  position: {
                    position: 'relative',
                  },
                  boxSizing: 'border-box',
                  background: {
                    color: 'rgb(255, 255, 255)',
                    bgType: 'color',
                  },
                  borderBottom: '1px dashed #acacac',
                },
                xIndex: 1,
              },
            },
          ],
        },
      ],
    },
  ],
};

export const selectableBlock: IApp = {
  name: 'demo_app',
  description: '测试应用',
  main: 'index',
  items: [
    {
      type: 'PAGE',
      id: 'index',
      component: 'page',
      items: [
        {
          id: 'id1',
          component: 'Text',
          module: '',
          attributes: {
            maxLines: 1,
            text: '选区',
          },
          extra: {
            xIndex: 1,
          },
        },
        {
          id: 'id14',
          component: 'ModelTable',
          module: 'CLOUDBASE_BUSSINESS',
          attributes: {
            bindMetadata: {
              t: 1645522775672,
              datasource: {
                name: 'zachsjmxcs_p81v4ay',
                title: 'zach数据模型测试',
              },
              enabledFieldNames: [],
              disabledFieldNames: [],
            },
            buttons: [
              {
                show: true,
                text: '新建',
                type: 'primary',
                action: 'create',
                loading: false,
                tooltip: '',
                disabled: false,
                htmlType: 'button',
              },
              {
                show: true,
                text: '删除',
                type: 'weak',
                action: 'del',
                loading: false,
                tooltip: '',
                disabled: false,
                htmlType: 'button',
              },
              {
                show: true,
                text: '导出',
                type: 'weak',
                action: 'export',
                loading: false,
                tooltip: '',
                disabled: false,
                htmlType: 'button',
                selectableBlock: {
                  id: 2,
                  component: 'modeltable',
                  module: 'cloudbase_bussiness',
                  attributes: {},
                  extra: {},
                },
              },
              {
                show: true,
                text: '按钮标题',
                type: 'primary',
                action: 'custom',
                loading: false,
                tooltip: '',
                disabled: false,
                htmlType: 'button',
                selectableBlock: {
                  id: 3,
                  component: 'modeltable',
                  module: 'cloudbase_bussiness',
                  attributes: {},
                  listeners: [
                    {
                      id: 'wag0h3qlt07g',
                      eventName: 'tap',
                      type: 'platform',
                      handler: {
                        name: 'showModal',
                        module: 'platform',
                        params: {
                          cancelColor: '#000000',
                          cancelText: '取消',
                          confirmColor: '#576B95',
                          confirmText: '确认',
                          content: '请输入弹窗内容',
                          showCancel: true,
                          title: '弹窗标题',
                        },
                      },
                      isCapturePhase: false,
                    },
                  ],
                  extra: {},
                },
              },
            ],
            settings: [
              {
                show: true,
                text: '查看',
                type: 'link',
                action: 'retrieve',
                loading: false,
                tooltip: '',
                disabled: false,
                htmlType: 'button',
              },
              {
                show: true,
                text: '编辑',
                type: 'link',
                action: 'edit',
                loading: false,
                tooltip: '',
                disabled: false,
                htmlType: 'button',
                selectableBlock: {
                  id: 1,
                  component: 'modeltable',
                  module: 'cloudbase_bussiness',
                  attributes: {},
                  extra: {},
                },
              },
              {
                show: true,
                text: '删除',
                type: 'link',
                action: 'del',
                loading: false,
                tooltip: '',
                disabled: false,
                htmlType: 'button',
              },
              {
                show: true,
                text: '按钮标题',
                type: 'link',
                action: 'custom',
                loading: false,
                tooltip: '',
                disabled: false,
                htmlType: 'button',
                selectableBlock: {
                  id: 3,
                  component: 'modeltable',
                  module: 'cloudbase_bussiness5',
                  attributes: {},
                  listeners: [
                    {
                      id: 'waf4lfuu17bg',
                      eventName: 'tap',
                      type: 'platform',
                      handler: {
                        name: 'showModal',
                        module: 'platform',
                        params: {
                          cancelColor: '#000000',
                          cancelText: '取消',
                          confirmColor: '#576B95',
                          confirmText: '确认',
                          content: '请输入弹窗内容',
                          showCancel: true,
                          title: '弹窗标题',
                        },
                      },
                      isCapturePhase: false,
                    },
                  ],
                  extra: {},
                },
              },
            ],
          },
          extra: {
            xIndex: 0,
            attributeExtraData: {},
          },
        },
      ],
    },
  ],
  dataSources: [
    {
      UpdateVersion: 2,
      Schema: '{}',
      CreatedAt: '2022-06-15T07:45:58.000+0000',
      Source: 0,
      Name: 'zachsjmxcs_p81v4ay',
      SubType: 'database',
      UpdatedAt: '2022-07-05T03:36:28.000+0000',
      Type: 'database',
      ViewId: 'view-34hcs8uw8g',
      Methods: '[]',
    } as any,
  ],
};

export const pageNodeEvent: IPlatformApp = {
  label: 'demo',
  main: 'index',
  items: [
    {
      id: 'index',
      type: 'PAGE',
      component: 'Page',
      attributes: {
        navigationBarTitleText: '首页',
        src: '',
        title: '首页',
      },
      items: [
        {
          id: 'id1',
          module: '',
          component: 'Container',
          attributes: {
            formauto: 'formRadio',
            title: '',
          },
          items: [
            {
              id: 'id2',
              module: '',
              component: 'Text',
              attributes: {
                formauto: 'formRadio',
                level: '0',
                maxLines: 2,
                space: false,
                ':text': '$page.dataset.state.pageLoad',
                tips: true,
                userSelect: true,
              },
              directives: {
                ':if': true,
              },
              extra: {
                xIndex: 0,
                attributeExtraData: {},
              },
            },
            {
              id: 'id3',
              module: '',
              component: 'Text',
              attributes: {
                formauto: 'formRadio',
                level: '0',
                maxLines: 2,
                space: false,
                ':text': '$page.dataset.state.pageShow',
                tips: true,
                userSelect: true,
              },
              directives: {
                ':if': true,
              },
              extra: {
                xIndex: 1,
                attributeExtraData: {},
              },
            },
            {
              id: 'id4',
              module: '',
              component: 'Text',
              attributes: {
                formauto: 'formRadio',
                level: '0',
                maxLines: 2,
                space: false,
                ':text': '$page.dataset.state.pageReady',
                tips: true,
                userSelect: true,
              },
              directives: {
                ':if': true,
              },
              extra: {
                xIndex: 2,
                attributeExtraData: {},
              },
            },
          ],
          directives: {
            ':if': true,
          },
          extra: {
            xIndex: 0,
            attributeExtraData: {},
          },
        },
        {
          id: 'id5',
          module: '',
          component: 'Text',
          attributes: {
            formauto: 'formRadio',
            level: '0',
            maxLines: 2,
            space: false,
            ':text': '$page.dataset.state.customField',
            tips: true,
            userSelect: true,
          },
          directives: {
            ':if': true,
          },
          extra: {
            xIndex: 1,
            attributeExtraData: {},
          },
        },
        {
          id: 'id6',
          module: '',
          component: 'Text',
          attributes: {
            formauto: 'formRadio',
            level: '0',
            maxLines: 2,
            space: false,
            ':text': '$page.dataset.state.success',
            tips: true,
            userSelect: true,
          },
          directives: {
            ':if': true,
          },
          extra: {
            xIndex: 2,
            attributeExtraData: {},
          },
        },
        {
          id: 'id7',
          module: '',
          component: 'Text',
          attributes: {
            formauto: 'formRadio',
            level: '0',
            maxLines: 2,
            space: false,
            ':text': '$page.dataset.state.fail',
            tips: true,
            userSelect: true,
          },
          directives: {
            ':if': true,
          },
          extra: {
            xIndex: 3,
            attributeExtraData: {},
          },
        },
      ],
      directives: {
        ':if': true,
      },
      resources: [
        {
          code: "\n/*\n* 可通过 $page.computed.xxx 访问这里定义的计算状态\n* 注意：页面级别的计算状态仅在所属的页面有效\n*/\n\nexport default {\n  name() { return 'LowCode' }\n}",
          name: 'computed',
          path: 'index/computed',
          system: true,
          type: 'CODE',
          codeType: 'computed',
        },
        {
          code: "/*\n* 可通过 $page 获取或修改当前页面的 变量 状态 handler lifecycle 等信息\n* 可通过 app 获取或修改全局应用的 变量 状态 等信息\n* 具体可以 console.info 在编辑器Console面板查看更多信息\n* 如果需要 async-await，请在方法前 async\n*/\n\nexport default {\n  onPageLoad(query) {\n    //console.log('---------> LifeCycle onPageLoad', query)\n  },\n  onPageShow() {\n    //console.log('---------> LifeCycle onPageShow')\n  },\n  onPageReady() {\n    //console.log('---------> LifeCycle onPageReady')\n  },\n  onPageHide() {\n    //console.log('---------> LifeCycle onPageHide')\n  },\n  onPageUnload() {\n    //console.log('---------> LifeCycle onPageUnload')\n  },\n}",
          name: 'lifecycle',
          path: 'index/lifecycle',
          system: true,
          type: 'CODE',
          codeType: 'lifecycle',
        },
        {
          code: "/*\n* 可通过 $page.state.xxx 访问这里定义的状态\n* 注意：页面级别的状态仅在所属的页面有效\n* 修改状态时，直接赋值即可。如：$page.state.xxx = 'xxx'\n* 请注意：避免在页面处于后台状态时state，页面在后台时对全局state的修改会丢失！\n*/\n\n\nexport default {\n  name: 'LowCode'\n}\n\n/* 在这里定义页面变量。\n*  页面变量区别于 state 的是：页面变量不会作响应处理，不可被绑定\n*  在 handler 中使用的例子：import { data } from '../state'\n*  \n*/\nexport const data = {\n\n}\n\n\n",
          name: 'state',
          path: 'index/state',
          system: true,
          type: 'CODE',
          codeType: 'state',
        },
        {
          code: '\n  \n    /**\n     * 可以使用theme中定义的 mixin 和 定义变量\n     **/\n  \n.index-class-name {\n  \n  // 使用theme中的变量\n  // color: @example-primary-color;\n\n  // 默认 px 会转换成 rem，含大写字母 PX 和 Px 则不会转换\n  // margin-top: 20px;\n  // 使用theme中的混合（mixins）\n  // .mixins();\n  // 可写嵌套样式\n  .index-nest-class {\n    // color: #fff;\n    // 使用theme中的混合（mixins）\n    // .mixins(green);\n  }\n}\n',
          name: 'style',
          path: 'index/style',
          system: true,
          type: 'CODE',
          codeType: 'style',
        },
        {
          id: 'dfh328zk',
          code: '/**\n * \n * 可通过 $page 获取或修改当前页面的 变量 状态 handler lifecycle 等信息\n * 可通过 app 获取或修改全局应用的 变量 状态 等信息\n * 具体可以console.info 在编辑器Console面板查看更多信息\n * 注意：该方法仅在所属的页面有效\n * 如果需要 async-await，请修改成 export default async function() {}\n **/\n\n/**\n * @param {Object} event - 事件对象.\n * @param {string} event.name - 事件名.\n * @param {string} event.target - 事件的目标节点(触发该事件的节点).\n * @param {string} event.currentTarget - 当前处理该事件的节点。包括冒泡和捕获事件。.\n *\n * @param {Object} data\n * @param {any} data.target - 获取事件传参的数据\n **/\nexport default function({event, data}) {\n  $page.dataset.state.customField = data.target;\n}',
          name: 'setState',
          path: 'index/handler/setState',
          pageId: 'index',
          oldName: 'setState',
          type: 'CODE',
          codeType: 'handler-fn',
        },
        {
          id: '2dukcvif',
          code: "/**\n * \n * 可通过 $page 获取或修改当前页面的 变量 状态 handler lifecycle 等信息\n * 可通过 app 获取或修改全局应用的 变量 状态 等信息\n * 具体可以console.info 在编辑器Console面板查看更多信息\n * 注意：该方法仅在所属的页面有效\n * 如果需要 async-await，请修改成 export default async function() {}\n **/\n\n/**\n * @param {Object} event - 事件对象.\n * @param {string} event.name - 事件名.\n * @param {string} event.target - 事件的目标节点(触发该事件的节点).\n * @param {string} event.currentTarget - 当前处理该事件的节点。包括冒泡和捕获事件。.\n *\n * @param {Object} data\n * @param {any} data.target - 获取事件传参的数据\n **/\nexport default function({event, data}) {\n  throw('故意抛出错误')\n}",
          name: 'error',
          path: 'index/handler/error',
          pageId: 'index',
          oldName: 'error',
          type: 'CODE',
          codeType: 'handler-fn',
        },
        {
          id: 'cju4e35j',
          code: '/**\n * \n * 可通过 $page 获取或修改当前页面的 变量 状态 handler lifecycle 等信息\n * 可通过 app 获取或修改全局应用的 变量 状态 等信息\n * 具体可以console.info 在编辑器Console面板查看更多信息\n * 注意：该方法仅在所属的页面有效\n * 如果需要 async-await，请修改成 export default async function() {}\n **/\n\n/**\n * @param {Object} event - 事件对象.\n * @param {string} event.name - 事件名.\n * @param {string} event.target - 事件的目标节点(触发该事件的节点).\n * @param {string} event.currentTarget - 当前处理该事件的节点。包括冒泡和捕获事件。.\n *\n * @param {Object} data\n * @param {any} data.target - 获取事件传参的数据\n **/\nexport default function({event, data}) {\n\n}',
          name: 'success',
          path: 'index/handler/success',
          type: 'CODE',
          codeType: 'handler-fn',
        },
        {
          id: 'asz3gfe9',
          code: "/**\n * \n * 可通过 $page 获取或修改当前页面的 变量 状态 handler lifecycle 等信息\n * 可通过 app 获取或修改全局应用的 变量 状态 等信息\n * 具体可以console.info 在编辑器Console面板查看更多信息\n * 注意：该方法仅在所属的页面有效\n * 如果需要 async-await，请修改成 export default async function() {}\n **/\n\n/**\n * @param {Object} event - 事件对象.\n * @param {string} event.name - 事件名.\n * @param {string} event.target - 事件的目标节点(触发该事件的节点).\n * @param {string} event.currentTarget - 当前处理该事件的节点。包括冒泡和捕获事件。.\n *\n * @param {Object} data\n * @param {any} data.target - 获取事件传参的数据\n **/\nexport default function({event, data}) {\n  $page.dataset.state.success = 'success';\n}",
          name: 'successCall',
          path: 'index/handler/successCall',
          pageId: 'index',
          oldName: 'successCall',
          type: 'CODE',
          codeType: 'handler-fn',
        },
        {
          id: 'o2bi69ge',
          code: "/**\n * \n * 可通过 $page 获取或修改当前页面的 变量 状态 handler lifecycle 等信息\n * 可通过 app 获取或修改全局应用的 变量 状态 等信息\n * 具体可以console.info 在编辑器Console面板查看更多信息\n * 注意：该方法仅在所属的页面有效\n * 如果需要 async-await，请修改成 export default async function() {}\n **/\n\n/**\n * @param {Object} event - 事件对象.\n * @param {string} event.name - 事件名.\n * @param {string} event.target - 事件的目标节点(触发该事件的节点).\n * @param {string} event.currentTarget - 当前处理该事件的节点。包括冒泡和捕获事件。.\n *\n * @param {Object} data\n * @param {any} data.target - 获取事件传参的数据\n **/\nexport default function({event, data}) {\n$page.dataset.state.fail = 'fail'\n}",
          name: 'failCall',
          path: 'index/handler/failCall',
          pageId: 'index',
          oldName: 'failCall',
          type: 'CODE',
          codeType: 'handler-fn',
        },
      ],
      dataset: {
        state: {
          fail: {
            varType: 'state',
            dataType: 'string',
            initialValue: '',
          },
          success: {
            varType: 'state',
            dataType: 'string',
            initialValue: '',
          },
          pageLoad: {
            varType: 'state',
            dataType: 'string',
            initialValue: '',
          },
          pageShow: {
            varType: 'state',
            dataType: 'string',
            initialValue: '',
          },
          pageReady: {
            varType: 'state',
            dataType: 'string',
            initialValue: '',
          },
          customField: {
            varType: 'state',
            dataType: 'string',
            initialValue: '',
          },
        },
      },
      listeners: [
        {
          id: 'wqd2f9qd2rg',
          eventName: 'load',
          type: 'platform',
          handler: {
            name: '_setStateVal',
            module: 'platform',
            params: {
              val: 'pageLoad',
              varPath: '$page.pageLoad',
            },
          },
          isCapturePhase: false,
        },
        {
          id: 'wh5pne21b7',
          eventName: 'show',
          type: 'platform',
          handler: {
            name: '_setStateVal',
            module: 'platform',
            params: {
              val: 'pageShow',
              varPath: '$page.pageShow',
            },
          },
          isCapturePhase: false,
        },
        {
          id: 'w2147375t8',
          eventName: 'ready',
          type: 'platform',
          handler: {
            name: '_setStateVal',
            module: 'platform',
            params: {
              val: 'pageReady',
              varPath: '$page.pageReady',
            },
          },
          isCapturePhase: false,
        },
        {
          id: 'wrm98l18odg',
          eventName: 'load',
          type: 'rematch',
          handler: {
            name: 'setState',
            module: 'index',
            params: {
              target: 'custom',
            },
          },
          isCapturePhase: false,
        },
        {
          id: 'whs3kph63c8',
          eventName: 'ready',
          type: 'rematch',
          handler: {
            name: 'success',
            module: 'index',
            params: {
              target: '',
            },
          },
          isCapturePhase: false,
        },
        {
          id: 'w9dubirejr',
          eventName: 'whs3kph63c8.success',
          type: 'rematch',
          handler: {
            name: 'successCall',
            module: 'index',
            params: {
              target: '',
            },
          },
          isCapturePhase: false,
        },
        {
          id: 'w2kqcgini48',
          eventName: 'show',
          type: 'rematch',
          handler: {
            name: 'error',
            module: 'index',
            params: {
              target: '',
            },
          },
          isCapturePhase: false,
        },
        {
          id: 'wkq903gt0u8',
          eventName: 'w2kqcgini48.fail',
          type: 'platform',
          handler: {
            name: '_setStateVal',
            module: 'platform',
            params: {
              val: 'fail',
              varPath: '$page.fail',
            },
          },
          isCapturePhase: false,
        },
      ],
      extra: {},
    },
  ],
  resources: [
    {
      code: '@example-primary-color: blue;',
      name: 'theme',
      path: 'global/theme',
      system: true,
      type: 'CODE',
      codeType: 'theme',
    },
    {
      code: "\n/*\n* 可通过 app.computed.xxx 访问这里定义的计算状态\n* \n*/\n\nexport default {\n  name() { return 'LowCode' }\n}",
      name: 'computed',
      path: 'global/computed',
      system: true,
      type: 'CODE',
      codeType: 'computed',
    },
    {
      code: "/**\n * 可通过 app 获取或修改全局应用的 变量 状态 等信息\n * 具体可以console.info 在编辑器Console面板查看更多信息\n * 如果需要 async-await，请在方法前 async\n **/\nexport default {\n  onAppLaunch(launchOpts) {\n    //console.log('---------> LifeCycle onAppLaunch', launchOpts)\n  },\n  onAppShow(appShowOpts) {\n    //console.log('---------> LifeCycle onAppShow', appShowOpts)\n  },\n  onAppHide() {\n    //console.log('---------> LifeCycle onAppHide')\n  },\n  onAppError(options) {\n    //console.log('---------> LifeCycle onAppError', options)\n  },\n  onAppPageNotFound(options) {\n    //console.log('---------> LifeCycle onAppPageNotFound', options)\n  },\n  onAppUnhandledRejection(options) {\n    //console.log('---------> LifeCycle onAppUnhandledRejection', options)\n  }\n}",
      name: 'lifecycle',
      path: 'global/lifecycle',
      system: true,
      type: 'CODE',
      codeType: 'lifecycle',
    },
    {
      code: "/*\n* 可通过 app.state.xxx 访问这里定义的状态\n* \n* 修改状态时，直接赋值即可。如：$app.state.xxx = 'xxx'\n* 请注意：避免在页面处于后台状态时state，页面在后台时对全局state的修改会丢失！\n*/\n\n\nexport default {\n  name: 'LowCode'\n}\n\n/* 在这里定义页面变量。\n*  页面变量区别于 state 的是：页面变量不会作响应处理，不可被绑定\n*  \n*  在 common 中使用的例子：import { data } from '../state'\n*/\nexport const data = {\n\n}\n\n\n",
      name: 'state',
      path: 'global/state',
      system: true,
      type: 'CODE',
      codeType: 'state',
    },
    {
      code: '\n  \n    /**\n     * 可以使用theme中定义的 mixin 和 定义变量\n     **/\n  \n.global-class-name {\n  // 使用样式变量\n  // 使用theme中的变量\n  // color: @example-primary-color;\n\n  // 默认 px 会转换成 rem，含大写字母 PX 和 Px 则不会转换\n  // margin-top: 20px;\n  // 使用theme中的混合（mixins）\n  // .mixins();\n  // 可写嵌套样式\n  .global-nest-class {\n    // color: #fff;\n    // 使用theme中的混合（mixins）\n    // .mixins(green);\n  }\n}\n',
      name: 'style',
      path: 'global/style',
      system: true,
      type: 'CODE',
      codeType: 'style',
    },
    {
      code: "export default {\n  appJson: {\n    // 小程序接口权限相关设置，可选\n    /* permission: {\n      'scope.userLocation': {\n        desc: '你的位置信息将用于小程序位置接口的效果展示',\n      },\n    }, */\n  },\n}\n  ",
      name: 'mp_config',
      path: 'global/common/mp_config',
      system: true,
      type: 'CODE',
      codeType: 'mp_config',
    },
  ],
  extra: {
    npmDependencies: {},
    plugins: [],
    rootPath: '',
    compHiddenConfig: {},
    miniprogramPlugins: [],
    lastDependencies: {},
  },
};
