Lonbon Smart Elderly Care Cloud Platform

website·Indexed 32 days ago

https://nbtest.lonbon.com/resource/notes

Development documentation and technical notes for the Lonbon smart elderly care ecosystem. Includes guides for the lonbon-map, lonbon-device, and lonbon-common-plus plugins, as well as implementation details for Vue, uni-app, and React integrations, micro-frontend architectures using JD MicroApp, and specialized components for elderly care management platforms.

Tokens
20.9K
Snippets
89
Records
135
Agent score
50%

What's inside Lonbon

  1. Overview of FormAdjust custom component

    FormAdjust is a component built with sortablejs and jquery. It is designed to provide layout, sorting, and show/hide functionality for existing form elements. To use it, existing business forms must be slightly modified to comply with the component's structure requirements.
  2. AI Operational Guidance System Technical Stack

    The AI operational guidance system is built using the following technology stack:

    • Language: Node.js, TypeScript
    • Backend Framework: NestJS
    • Crawler: PuppeteerJS
    • AI Frameworks: LangGraphJS, LangChainJS
    • Primary Database: PostgreSQL
    • Vector Database: PGVector
    • LLM: Configurable (defaulting to Tongyi Qianwen)
  3. Implement Lonbon frontend coding standards

    General coding rules to ensure maintainability and prevent style pollution. Key constraints include limiting loop nesting and restricting global variable usage.
    // 1. Style Isolation: Use 'scoped' attribute in Vue components or a unique root class.
    // 2. Loop Limit: Maximum 2 levels of for-loops; encapsulate deeper logic into methods.
    // 3. API Calls: Use async/await. A single method must not contain 2 or more API calls.
    // 4. Data Formatting: Do not format server values directly; assign to a new variable.
    // Example: item.timeStr = this.$transTime(item.time);
    // 5. Global State: 
    //    - window, localStorage, sessionStorage are FORBIDDEN for custom storage.
    //    - Use window._globalProperties for global variables/methods.
    //    - Use window.accountStorage for synchronous value passing (requires await).
  4. Install and set up better-mock for uni-app

    To implement mock data in uni-app, use the better-mock library. This allows frontend developers to interface with page APIs without waiting for the backend implementation to be completed.
    npm i better-mock
  5. Integrate NetEase Yunxin for video calling

    Integration workflow for NetEase Yunxin:

    1. Create an application in the console to obtain the appKey.
    2. Integrate the SDK into the client.
    3. Integrate the SDK into the server to generate token for authentication (can pass null during testing).
    4. Use token, uid, channelName, and appKey on the client to join a channel for video calling.
  6. Migrate legacy table pages to lb-list-box

    When migrating old page code to the lb-list-box component, follow these technical requirements to ensure the layout renders correctly:

    1. Input Wrapping: In the search-field slot, wrap each search input/label pair in a div to prevent unexpected line breaks.
    2. Table Height: Set the height attribute of the el-table to 100% to allow the component's flex layout to manage the vertical space.
    3. Loading State: Move the v-loading directive from the internal table to a higher-level element or directly onto the lb-list-box component.
  7. Import Less files using absolute paths in Vue style blocks

    When importing Less or other style files using absolute module paths within a <style> block in Vue, you must prefix the path with a tilde (~). This tells the loader to treat the path as a module resolution path rather than a relative file system path.
    @import '~@cms/components/common/less/flex.less';
  8. Fix missing npm command after NVM installation

    If npm -v returns a 'command not found' error after installing Node.js via NVM (often caused by process locks during installation), you can manually install npm by following these steps:

    1. Download the npm source files for the corresponding Node.js version.
    2. Extract the files into the NVM installation directory for that specific Node.js version.
    3. Place the extracted files into the /node_modules/npm/ directory within the Node.js version folder.
    4. Copy the following four files from the npm bin folder (npm.cmd, npm, npx.cmd, and npx) directly into the root of the Node.js version folder in NVM.
  9. Load and use the Plugin Center micro-component

    The pluginCenter micro-component provides access to hardware peripherals such as IC card readers, barcode scanners, and ID card readers.
    const pluginCenter = await loadMicroComponent({
        component: 'pluginCenter'
    });
  10. Integrate video calling in WeChat Mini Programs

    To implement video calling functionality within a WeChat Mini Program, you must use the live-player and live-pusher components. Note that these components require specific category applications (permissions) to be approved by WeChat before they can be used in a production environment.
  11. Prevent race conditions in UI using Axios request cancellation

    When implementing features like rapid table pagination or remote search inputs, asynchronous requests may resolve out of order (a slower first request finishing after a faster second request), leading to the UI rendering stale data. While debouncing, throttling, or full-screen loading overlays are common solutions, using Axios request cancellation allows for a better user experience by explicitly ending outdated requests. Note that cancelling a request only ends the client-side connection; it does not stop the server from processing the request or reduce server resource consumption.
  12. Manage SVN commits and branches for Lonbon

    SVN commits must follow a specific format to link requirements and bugs. Development must occur in branches, not directly in dev.
    Commit Formats:
    - Bug fix: fix:[#ReqID/(Front/Back)] #BugID description
    - Feature: feature:(Front/Back) #ReqID description
    - Refactor: refactor:(Front/Back) description
    
    Branching Rules:
    - Personal branches: /branches/own[Initials][Code]
    - Privatization branches: /tags/pvt_[ProjectInitials]
    - /dev: Used only for merging and packaging for tests.