Skip to content

feat: Added an adaptation layer to simplify dashboard operation logic - #25

Closed
by-night wants to merge 1 commit into
Milesight-IoT:mainfrom
by-night:feat/adapter
Closed

feat: Added an adaptation layer to simplify dashboard operation logic#25
by-night wants to merge 1 commit into
Milesight-IoT:mainfrom
by-night:feat/adapter

Conversation

@by-night

Copy link
Copy Markdown
Contributor

New Adapter Layer Added

  1. Directly Reference Hooks in the View for Quick Data Handling
const { data } = useModel({
      viewProps: props,
      adapter: {
          model: 'entityStatus',
      },
  });
  const { value } = data || {};
  1. Alternatively, Use config.json to Introduce Quick Components Without Writing View Layer Code
{
  "view": [
      {
          "tag": "div",
          "class": "line-chart-wrapper",
          "style": "display: flex; flex-direction: column; min-width: 100%; height: 100%; padding: 16px; background: var(--main-background);",
          "children": [
              {
                  "tag": "Tooltip",
                  "class": "name",
                  "style": "font-size: 16px; font-weight: bold;",
                  "props": {
                      "autoEllipsis": true
                  },
                  "params": ["title"]
              },
              {
                  "tag": "div",
                  "class": "area-chart-content",
                  "style": "display: flex; flex: 1; align-items: center; justify-content: center; overflow: hidden;",
                  "children": [
                      {
                          "tag": "AreaChart",
                          "style": "flex: 1; width: 100%;",
                          "adapter": {
                              "model": "getHistory"
                          }
                      }
                  ]
              }
          ]
      }
  ]
}
  1. You Can Also Implement Quick Calls by Customizing Charts

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants