# draw-editor **Repository Path**: unrelight/draw-editor ## Basic Information - **Project Name**: draw-editor - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-11-14 - **Last Updated**: 2023-11-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Getting Started with Create React App This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). ## Available Scripts In the project directory, you can run: ### `npm start` Runs the app in the development mode.\ Open [http://localhost:3000](http://localhost:3000) to view it in your browser. The page will reload when you make changes.\ You may also see any lint errors in the console. ### `npm run build` Builds the app for production to the `build` folder.\ It correctly bundles React in production mode and optimizes the build for the best performance. ## `Interface function` ```javascript // 1.加载配置参数 /** * @param data {{language, mode, roomList, vConsole}} * language string --js/flutter * mode string -- view/edit * roomList array -- 房型模板 * vConsole boolean --手机端log */ loadDrawConfig(data); /**例子: roomList: 绑定的房间列表,例如 const _suiteRoomList = [ { suiteRoomId: '1', suiteRoomName: '主卧', }, { suiteRoomId: '2', suiteRoomName: '次卧', }, { suiteRoomId: '3', suiteRoomName: '主卧1', }, { suiteRoomId: '4', suiteRoomName: '主卧2', }, ] */ const data = { language: 'js', mode: 'edit', roomList: _suiteRoomList, vConsole: false }; // 2.加载数据信息 loadDrawObject(data); /**参数:例如 const data = { drawUrl: "", // 图纸地址 startPosition: { direction: 'S', coordinate: [265, 145], // 站点坐标 }, stations: [ { stationId: "", planPointId: "", coordinate: [517, 402], // 站点坐标 seqNo: "1", suiteRoomId: "1", // 户型里房间的Id,比如说主卧、次卧 suiteRoomName: '主卧', isFinished: true, // 是否已测站点 }, { stationId: "", planPointId: "", coordinate: [579, 819], // 站点坐标 seqNo: "2", suiteRoomId: "2", // 户型里房间的Id,比如说主卧、次卧 suiteRoomName: '次卧', isFinished: false, // 是否已测站点 }, ] }*/ // 3. 点亮停靠点 pointHighLight(data) 参数: /** * 高亮已停靠点 * @param stationId 站点id * @param highlight 是否高亮 */ 示例:const data = { stationId, highlight } // 3. 保存数据回调 // 回调函数 --用于监听 saveCanvasData() // 4. 页面初始化完成 initViewFinish() ```