Unverified Commit 019230f8 authored by Prurite's avatar Prurite Committed by GitHub
Browse files

Merge pull request #197 from SUSTech-CRA/campus-bus-new-schedule-20251124

Merge 2025.11.24 new bus route info
parents f662a119 f6800de5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
.DS_Store
docs/.vuepress/dist
node_modules/
.vscode

package-lock.json
yarn.lock
 No newline at end of file

.vscode/settings.json

deleted100644 → 0
+0 −7
Original line number Diff line number Diff line
{
    "markdown.extension.toc.updateOnSave": false,
    "search.exclude": {
        "**/docs/.vuepress/.temp/*": true,
        "**/docs/.vuepress/.cache/*":true
    }
}
 No newline at end of file
+11 −11
Original line number Diff line number Diff line
@@ -15,19 +15,19 @@
        <div class="legend-grid">
          <div class="legend-item">
            <div class="legend-color line1-color"></div>
            <span>1号线 Line 1</span>
            <span>线 Loop Line</span>
          </div>
          <div class="legend-item">
            <div class="legend-color shuttle1-color"></div>
            <span>电瓶车1 Shuttle 1</span>
            <span>环线电瓶车 Shuttle Loop Line</span>
          </div>
          <div class="legend-item">
            <div class="legend-color line2-color"></div>
            <span>2号线 Line 2</span>
            <span>环线大站快车 Rapid Loop</span>
          </div>
          <div class="legend-item">
            <div class="legend-color shuttle2-color"></div>
            <span>电瓶车2 Shuttle 2</span>
            <span>电瓶环线大站快车 Shuttle Rapid Loop</span>
          </div>
          <div class="legend-item">
            <div class="legend-color en-route-color"></div>
@@ -54,8 +54,8 @@
          animated
          @change="onLineGroupChange"
      >
        <a-tab-pane key="group1" tab="1号线 · Line 1" />
        <a-tab-pane key="group2" tab="2号线 · Line 2" />
        <a-tab-pane key="group1" tab="欣园环线 Joy Highland Loop Line" />
        <a-tab-pane key="group2" tab="环线大站快车 Rapid Loop Line" />
      </a-tabs>

      <!-- Direction toggle -->
@@ -98,7 +98,7 @@
      </a-spin>
    </a-config-provider>
  </div>
  <div class="current-time">Effective: 2025-09-06, refreshed at {{ currentTime }}.</div>
  <div class="current-time">Effective: 2025-11-24, refreshed at {{ currentTime }}.</div>
</template>

<script>
@@ -147,7 +147,7 @@ export default {
        group1: {
          directions: [
            {
              title: '欣园总站 → 工学院 / Joy Highland → COE',
              title: '顺时针 / ClockWise',
              lines: [
                {
                  type: 'line1',
@@ -162,7 +162,7 @@ export default {
              ]
            },
            {
              title: '工学院 → 欣园总站 / COE → Joy Highland',
              title: '逆时针 / Counter Clockwise',
              lines: [
                {
                  type: 'line1',
@@ -181,7 +181,7 @@ export default {
        group2: {
          directions: [
            {
              title: '欣园 → 科研楼 / Joy Highland → Research Bldg.',
              title: '顺时针大站快车 / Rapid ClockWise',
              lines: [
                {
                  type: 'line2',
@@ -196,7 +196,7 @@ export default {
              ]
            },
            {
              title: '科研楼 → 欣园 / Research Bldg. → Joy Highland',
              title: '逆时针大站快车 / Rapid Counter Clockwise',
              lines: [
                {
                  type: 'line2',
+4 −13
Original line number Diff line number Diff line
@@ -31,8 +31,6 @@ export default {
      // --- Data Placeholders ---
      // 在这里填入你的线路GeoJSON坐标数据
      geojson_XYBS1: [],
      geojson_XYBS2: [],
      geojson_SEV1: [],

      // --- State Management ---
      busLocations: [],
@@ -172,17 +170,11 @@ export default {

    async loadGeoJSONLines() {
      try {
        const [XYBS1Res, XYBS2Res, SEV1Res] = await Promise.all([
          axios.get('https://bus.sustcra.com/static/lines/XYBS1.json'),
          axios.get('https://bus.sustcra.com/static/lines/XYBS2.json'),
          axios.get('https://bus.sustcra.com/static/lines/SEV1.json'),
        const [XYBS1Res] = await Promise.all([
          axios.get('https://bus.sustcra.com/static/lines/XYBS1_clockwise.json')
        ]);
        // console.log('XYBS1:', XYBS1Res.data);
        // console.log('XYBS2:', XYBS2Res.data);
        // console.log('SEV1:', SEV1Res.data);
        this.geojson_XYBS1 = XYBS1Res.data;
        this.geojson_XYBS2 = XYBS2Res.data;
        this.geojson_SEV1 = SEV1Res.data;
      } catch (error) {
        console.error("Failed to fetch GeoJSON lines:", error);
      }
@@ -192,8 +184,7 @@ export default {
    setupMapLayers() {
      // 添加线路图层
      this.addRouteLayer('line1', this.geojson_XYBS1, '#f7911d');
      this.addRouteLayer('line2', this.geojson_XYBS2, '#29abe2');
      this.addRouteLayer('line3', this.geojson_SEV1, '#7030a1');
      console.log("XYBS1 route layer added.");

      // 添加站点、建筑和校门图层
      this.addSymbolLayer('stations', this.allStationsGeoJSON, 'bus-station-icon', 0.075, [0, 1.25]);
@@ -316,7 +307,7 @@ export default {

    // --- 4. Event Handlers & Interaction ---
    setupMapListeners() {
      this.map.on('click', 'stations-layer', this.onStationClick);
      // this.map.on('click', 'stations-layer', this.onStationClick);
      this.map.on('mouseenter', 'stations-layer', () => this.map.getCanvas().style.cursor = 'pointer');
      this.map.on('mouseleave', 'stations-layer', () => this.map.getCanvas().style.cursor = '');
    },
+5 −4
Original line number Diff line number Diff line
@@ -15,16 +15,17 @@
      <div v-if="currentSelect === 'bus-location'">
        <div class="bus-location-hint" v-if="showMapChart">
          <b>位置每5秒自动刷新。</b>Location refreshes automatically every 5 seconds.<br>
          <b>(测试中)图上点击对应的站点,可查看实时到站时间预测。</b>Click on the station on the map to see the realtime ETA. (testing)
          <b>由于线路调整,实时到站时间功能暂时停用。请参考时刻表计划行程。</b>Arrival estimates are not available now due to route adjustments. Please refer to the timetable to plan your trip.<br>>
        </div>
        <RealtimeMapv2 v-if="showMapChart" />
        <BusETAdemo />
        <BusChartVue />
        <!-- <BusETAdemo /> -->
        <!-- <BusChartVue /> -->
      </div>

<!--       第二个 div 根据 value 控制显示与隐藏 -->
      <div v-if="currentSelect === 'timetable'">
        <BusTable></BusTable>
        <!-- <BusTable></BusTable> -->
         时刻表信息尚在更新中,敬请谅解。Update in progess
<!--        <BusTable_img />-->
      </div>
    </div>
Loading