# sorterView **Repository Path**: lventou/sorter-view ## Basic Information - **Project Name**: sorterView - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: feat - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-11-14 - **Last Updated**: 2024-12-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 配置说明 1. IP地址和websocket地址,本地环境和线上环境分别在`.env.production`,`.env.production` 中配置 2. 执行`.\rsync_git.sh`可同步代码到线上代码仓库 --- 解释一下部分混乱逻辑,用于维护数据 数据格式为 ```js { // 小车 car: [ { color: '#ff0000', index: 0, remark: '', showName: 0, tag: '1' }, { color: '#ff0000', index: 1, remark: '', showName: 0 + 1, tag: '2' }, { color: '#31dca0', index: 2, remark: '', showName: 0 + 2, tag: '3' }, { color: '#31dca0', index: 3, remark: '', showName: 0 + 3, tag: '4' }, { color: '#31dca0', index: 4, remark: '', showName: 0 + 4, tag: '5' }, { color: '#ff0000', index: 5, remark: '', showName: 0 + 5, tag: '6' }, { color: '#31dca0', index: 6, remark: '', showName: 0 + 6, tag: '7' }, { color: '#31dca0', index: 7, remark: '', showName: 0 + 7, tag: '8' }, { color: '#31dca0', index: 8, remark: '', showName: 0 + 8, tag: '9' }, { color: '#31dca0', index: 9, remark: '', showName: 0 + 9, tag: '10' }, { color: '#31dca0', index: 10, remark: '', showName: 0 + 10, tag: '11' }, ], // 格口 export: [ { color: '#ff0000', index: 0, remark: '', showName: '0' }, { color: '#ff0000', index: 1, remark: '', showName: '1' }, { color: '#037dd3', index: 2, remark: '', showName: '2' }, ], // 供包台 entrance: [ { color: '#ff0000', index: 0, remark: '', showName: '0', tag: 'entrance1' }, { color: 'red', index: 1, remark: '', showName: '1', tag: 'entrance1' }, { color: 'green', index: 2, remark: '', showName: '2', tag: 'entrance1' }, ], // 急停 // alarm: [ // { color: '#66CD00', index: 0, remark: '', showName: '0' }, // { color: '#66CD00', index: 1, remark: '', showName: '1' }, // { color: '#66CD00', index: 2, remark: '', showName: '2' }, // { color: '#66CD00', index: 3, remark: '', showName: '3' }, // ], // 电机 electrical: [ { color: '#ff0000', index: 0, remark: '', showName: '0', tag: 'electrical1' }, { color: '#31dca0', index: 1, remark: '', showName: '1', tag: 'electrical1' }, { color: '#31dca0', index: 2, remark: '', showName: '2', tag: 'electrical1' }, { color: '#31dca0', index: 3, remark: '', showName: '3', tag: 'electrical1' }, ], }; ``` 变色需要基于tag和showName一致才变色,remark是显示的文本,目前index没有使用到。 特别强调,目前小车和格口是将多个节点生成为单个节点,为了方便统一拖动,因为是用下标来变色,所以是通过`对象键`来赋值,也就是通过查询 `body${index}`,`body2`,来处理 而其他是基于`data下的index`来判断是否相同 另外,antv/x6的body似乎是必须的,所以数据可能会有`body`,`body0`,`body1`的情况出现,有些的body是用不上的,只是作为说明,目前来看不会有额外的维护开销