[쇼룸] 업체목록 yaml

셀렉트 쇼룸의 업체목록 페이지 YAML 코드입니다.

궁금한 점은 댓글이나 이메일, 서비스 내 채팅, 슬랙 등으로 편하게 문의주세요.

menus:
  - path: properties
    name: 업체목록

  - path: properties/{{property_id}}
    placement: page-only
  
pages:
  - path: properties
    class: container
    blocks:
    - type: query
      resource: mysql.qa
      sqlType: select
      sql: >
        SELECT *
        FROM properties
      showDownload: false
      tableOptions:
        fixed: true
        striped: true
        sortable: false
        bordered: false
      paginationOptions: 
        enabled: true
        perPage: 10
      columns:
        id:
          label: ID
        name: 
          openPage: properties/{{id}}
          label: 이름
        memo:
          label: 메모
        category:
          label: 카테고리
        created_at:
          label: 생성일
        star:
          label: 별점
        selling_status:
          label: 판매여부
          valueAs:
            open: 판매
            close: 종료
            pending: 대기중
          color:
            open: blue
            close: gray
            pending: yellow
        updated_at:
          label: 수정일   
        thumbnail_url:
          label: 대표이미지 URL
          format: image
          thumbnail: true
      title: 업체목록

  - path: properties/{{id}}
    class: container
    blocks:
      - type: header
        items:
          - label: 업체목록
            path: properties
          - label: 업체상세

      - type: query
        resource: mysql.qa
        sqlType: select
        sql: >
          SELECT *
          FROM properties
          WHERE id = :id
        paginationOptions: 
          enabled: true
          perPage: 10
        params:
          - key: id
            valueFromRow: id
        display: form
        title: 업체상세
        columns:
          id:
            label: ID
          name:
            editable: true
            label: 이름
          memo:
            editable: true
            label: 메모
          category:
            editable: true
            label: 카테고리
          created_at:
            label: 생성일
          star:
            editable: true
            label: 별점
          selling_status:
            editable: true
            label: 판매여부
          thumbnail_url:
            label: 대표이미지 URL
            format: image
            thumbnail: true 
          updated_at:
            label: 수정일
        updateOptions:
          type: query
          resource: mysql.qa
          sql: >
            UPDATE properties
            SET name = :name
              , memo = :memo
              , category = :category
              , star = :star
              , selling_status = :selling_status
              , thumbnail_url = :thumbnail_url
              , updated_at = NOW()
            WHERE id = :id
          toast: |
            예시: 입력한 내용으로 수정됩니다.
          params:
            - key: id
              valueFromRow: id
            - key: name
              label: 이름
            - key: memo
              label: 메모
            - key: category
              label: 카테고리
            - key: star
              label: 별점
            - key: thumbnail_url
              label: 대표이미지 URL
            - key: selling_status
              label: 판매여부
              dropdown:
                - 판매
                - 미판매