134 Commits

Author SHA1 Message Date
harukin-expo-dev-env
cd585b8206 Merge commit 'bb1ee2666e5c91819bc3330128a9636b5e2ad753' 2025-12-31 09:52:36 +00:00
harukin-expo-dev-env
bb1ee2666e 6.1.9.4 2025-12-31 09:51:57 +00:00
harukin-expo-dev-env
5b715f2dc5 レイアウト整理 2025-12-31 09:50:22 +00:00
harukin-expo-dev-env
2888c41301 増解結の暫定的対応を作成 2025-12-31 08:57:58 +00:00
harukin-expo-dev-env
2a70a0e34b 列車の進行方向情報を修正 2025-12-31 06:46:38 +00:00
harukin-expo-dev-env
f9c6e6dd97 Merge commit '3b85ab9776eb449cc0fd6cd3f7162f330366da5c' into patch/6.x 2025-12-30 02:47:40 +00:00
harukin-expo-dev-env
3b85ab9776 本家モードでアイコンの表示を調整 2025-12-29 18:40:06 +00:00
harukin-expo-dev-env
fa1eec4569 Merge commit 'fd3e488c34d22225fb4bd52bf16c15c81ae8ccbe' into patch/6.x 2025-12-28 15:59:27 +00:00
harukin-expo-dev-env
fd3e488c34 アイコンを最初と最後だけ表示するように修正 2025-12-28 15:56:27 +00:00
harukin-expo-dev-env
f475680665 Merge commit 'b6dd05419ba07bc5ceb1a779ced0e2dd836195b2' into patch/6.x 2025-12-27 11:09:53 +00:00
harukin-expo-dev-env
b6dd05419b アイコンの本家モードでの挙動修正 2025-12-27 11:08:39 +00:00
harukin-expo-dev-env
0d7658eba1 アイコンが無いときに表示されているバグの修正(未確認) 2025-12-27 09:57:15 +00:00
harukin-expo-dev-env
927c73567a Merge commit '0bf345ff6ac492e66da91e71db0118adb58cb28a' 2025-12-20 10:14:56 +00:00
harukin-expo-dev-env
0bf345ff6a Merge commit '342afea34c6fafa8e420501640e50f2349a9cf03' into patch/6.x 2025-12-20 10:14:47 +00:00
harukin-expo-dev-env
342afea34c 6.1.9.3 2025-12-20 10:14:40 +00:00
harukin-expo-dev-env
f8dfa77e97 ブラウザ側に複数アイコン対応 2025-12-20 10:04:30 +00:00
harukin-expo-dev-env
f261ff981a アプリ側に複数アイコン化対応 2025-12-20 10:04:14 +00:00
harukin-expo-dev-env
b40280d099 列車の運用無効化対応 2025-12-20 06:17:01 +00:00
harukin-expo-dev-env
09170c6636 Merge commit '24f32335c48eda61d312eceaf6bdd1e442c63f60' 2025-12-12 19:27:28 +00:00
harukin-expo-dev-env
8705f69725 Merge commit '2975e9094e17963b726753d954ba347226af98e2' 2025-12-05 15:25:11 +00:00
harukin-expo-dev-env
9562e04ffe Merge commit '6f74f5dfa26369dc4ce15435eccb9af51b5842e3' 2025-11-06 01:41:13 +00:00
harukin-expo-dev-env
2ffb47b60c Merge commit '09f700fb667a9dc0b05488e05c3d9cd3c31ffaae' 2025-11-06 01:33:37 +00:00
harukin-expo-dev-env
1208a78831 Merge commit 'efd9b77cadfbff4205e17388e7b2a6cad637ba9f' 2025-09-29 18:43:34 +00:00
harukin-expo-dev-env
493ef92bd6 Merge commit 'dfaf5b05b93f8fdcddb17da2a4981faffc28e0ac' 2025-09-29 06:08:16 +00:00
harukin-expo-dev-env
a51ffe4a82 Merge commit 'fa1562f870e8f5fa26db931785dd297eeb834c56' 2025-09-28 19:50:05 +00:00
harukin-expo-dev-env
0ea25f1e97 Merge commit '19f9b58497df949ff20cbad00a344118ac5740cd' 2025-09-27 17:51:11 +00:00
harukin-expo-dev-env
16bd0fe192 Merge commit '59e7ba5290bd4f175c9dafbc0dd664b75417bf2f' 2025-09-25 03:00:42 +00:00
harukin-expo-dev-env
d75a495b19 Merge commit '0d9c1cdb186a2cecc2e0aec441d9af9ab6ff56a6' 2025-09-11 05:55:26 +00:00
harukin-expo-dev-env
a346a1477c Merge commit 'bc4cb450a3dfb0005d7e815019b6317953478a9f' 2025-09-09 16:16:57 +00:00
harukin-expo-dev-env
c93ca94a61 Merge commit '9b4c0735b0475659aa7fe1f688b8daef13b714f1' 2025-08-27 01:20:09 +00:00
harukin-expo-dev-env
4480c161d1 Merge commit '087f6c882968bdef782bfe2aa0005a67fe436c7c' 2025-08-24 11:30:06 +00:00
harukin-expo-dev-env
deb9b40949 Merge commit 'ddaad38ccc2d23121f7fb6e3678417e7ac9ed593' 2025-08-24 04:49:29 +00:00
harukin-expo-dev-env
fced009607 Merge commit 'eabb2499fa43ba6a5adb3ae71e18067d86d63e35' 2025-08-19 19:19:24 +00:00
harukin-expo-dev-env
0890c1b9ff Merge commit '7bbb5b972fdb2eb429e5f71d6dd30e279b47ad10' 2025-08-13 12:50:56 +00:00
harukin-expo-dev-env
4b3816940b Merge commit 'ff4eb2c95f72581771b09ea820e9413540684e7b' 2025-08-08 10:54:00 +00:00
harukin-expo-dev-env
9ea23d6eba Merge commit '3dbaa6bfbf2bf18d01464c5e367c95593250dc85' 2025-07-27 04:12:01 +00:00
harukin-expo-dev-env
31ea303b88 Merge commit '9b266c15f80301e0b7a47cfc702c52beec36f4c4' 2025-07-27 03:54:24 +00:00
harukin-expo-dev-env
7716cb516c Merge commit 'dc7cc555c990fd4a2cd5cf47089339c887eecc75' 2025-07-18 15:42:20 +00:00
harukin-expo-dev-env
70976c0554 Merge commit '8a7285bb20c76d6e99cafd96193957829906f9ac' 2025-07-08 16:44:25 +00:00
harukin-expo-dev-env
5616c7ed96 Merge commit '8212148fb298dc678b811aadf0344731b43e8cf7' 2025-05-04 12:56:37 +00:00
harukin-expo-dev-env
13580a57d4 Merge commit 'bd2248e1a943e574ccc44892122cd9da4df14b68' 2025-04-20 17:22:59 +00:00
harukin-expo-dev-env
c9481fb0c2 Merge commit 'b64138178c4ca99bfcbb4f115403a18674ce8136' 2025-04-14 19:10:10 +00:00
harukin-expo-dev-env
5cda45740c Merge commit '67f40b55c19ff2e94b1168865486bcde7d457cab' 2025-04-10 16:38:21 +00:00
harukin-expo-dev-env
84d1305796 Merge commit 'fdefbc82bd39c8cba29911273db2f96fa39c0e3f' 2025-04-10 15:55:13 +00:00
harukin-expo-dev-env
336e3510fa Merge commit 'af8f3333cd68ea507675ad02ec59ccf2f7959e00' 2025-03-30 02:52:30 +00:00
harukin-expo-dev-env
25780e1664 Merge commit '0a364021ce2fed98257e80cc780ac4020cecb9c1' 2025-03-25 07:27:06 +00:00
harukin-expo-dev-env
e6fab84393 Merge commit 'de2b94292dc97df6e290e91976d01cea24c98ced' 2025-03-22 12:33:34 +00:00
harukin-expo-dev-env
390acdeab7 Merge commit '8c75e06ac18e33588b5bf200d7fccf05d3c34c22' 2025-03-22 11:34:25 +00:00
harukin-expo-dev-env
ff7a5624e6 Merge commit '45500e7a4ae614debd93404339958465db88f71d' 2025-03-19 15:49:36 +00:00
harukin-expo-dev-env
9b79f224d3 Merge commit '2c5023568a0442679b476bd84651eca3fcc90ee1' 2025-03-16 05:56:14 +00:00
harukin-expo-dev-env
2f76e3776f Merge commit '8a48bc48e6eb82921fcda3a84e07db2eca51e614' 2025-03-15 04:23:16 +00:00
harukin-expo-dev-env
026da47d82 Merge commit '23fb2d715a461cb0ebfca1e1944757febd315fec' 2025-03-14 18:29:20 +00:00
harukin-expo-dev-env
29be052bf6 Merge commit 'ab883827e13b5c99556857395ac950ee00c53b83' 2025-03-11 05:26:18 +00:00
harukin-expo-dev-env
2fb7d97d33 Merge commit '31618aab496a7979a39e534d023cb69103b06721' 2025-03-10 15:51:25 +00:00
harukin-expo-dev-env
76ebf8055b Merge commit '26cf84705abd4c9a69ac56fcade483a373089bf8' 2025-03-06 03:52:42 +00:00
harukin-expo-dev-env
7b572cd657 Merge commit 'fa882223d49fec390177131371b99a3101976759' 2025-03-05 11:51:51 +00:00
harukin-expo-dev-env
61fa0f8484 Merge commit 'ede2884c4a7b8a508cfd9f4f7cc87da4efe3db08' 2025-03-04 16:17:50 +00:00
harukin-expo-dev-env
935aaf2610 Merge commit '098cae50533368eec9cfdb933900c503ae46e850' 2025-03-04 15:01:08 +00:00
harukin-expo-dev-env
8ec53d6e06 Merge commit '0aaf171477659e632a23aeb6af39e83d5acf70c2' 2025-02-09 03:21:16 +00:00
harukin-expo-dev-env
e8b1a21a3b Merge commit '4a01c529b47cd85420a4c1feeac87164730dee94' 2025-01-15 12:38:58 +00:00
harukin-expo-dev-env
e6b89842a3 Merge commit '2776f17681ac2bf76a70c268c4db8921c5888a4f' 2025-01-14 07:42:06 +00:00
harukin-expo-dev-env
1fc5220405 Merge commit '58d3eae1d7797a74febc752f4185337a6eb95dad' 2025-01-09 09:56:21 +00:00
harukin-expo-dev-env
5489406578 Merge commit 'a7c4f689bc0762a63b662901f943a62827b765eb' 2024-11-22 05:40:18 +00:00
harukin-expo-dev-env
2b217e98c7 Merge commit 'd8108e2c9c60a60ba7f933af12af996b3cc0491c' 2024-11-22 05:19:00 +00:00
harukin-expo-dev-env
2c2e61a2fa Merge commit '6d3e6623a0774cb489efa3b81335db319fad2b2d' 2024-10-31 12:27:16 +00:00
harukin-expo-dev-env
c222b303df Merge commit '1346909bb74c80bedf1841aefda66a67adb98443' 2024-09-30 13:00:12 +00:00
harukin-expo-dev-env
8f8c095ecd Merge commit 'ab2a18b562c5fe18087f3140449fc7764b969df6' 2024-09-28 20:45:33 +00:00
harukin-expo-dev-env
e31e84ff34 Merge commit '9b91c4a50e1df914f66c6c5b33007caf4b0c9c32' 2024-09-20 15:18:49 +00:00
harukin-expo-dev-env
2c2b355a3e Merge commit '63209ac88878f70d0896dca429277d09ef1bf492' 2024-09-16 16:34:11 +00:00
harukin-expo-dev-env
5461087ca0 Merge commit 'c9a90809c6b178d5b85d51d47521d2541bbed7f6' 2024-09-16 16:31:31 +00:00
harukin-expo-dev-env
57c7285b6e Merge commit '628d2a42c94801ea42c939dd702ebd448176e62f' 2024-09-16 16:10:05 +00:00
harukin-expo-dev-env
5c134c95cc Merge commit '801b3dc3b0dde2f8a46962cfbca1599fb31cb6a4' 2024-09-02 02:29:04 +00:00
harukin-expo-dev-env
8781653fe8 Merge commit '9b4b4bd0d6572d0d0ffdb35ec72559bf035d07a3' 2024-06-05 10:27:22 +00:00
harukin-expo-dev-env
67ccc37c17 Merge commit '35e05e92f50ebca5d4666b9a008915b7f437f86c' 2024-06-05 09:16:05 +00:00
harukin-expo-dev-env
92caab03f5 Merge commit '52c2da333a97234bb27a25baf8af8479d53c3422' 2024-06-03 12:40:26 +00:00
harukin-expo-dev-env
dd3a57b3ae Merge commit 'b9b983a177d37db717b551f8b18d5f6c87aa0e23' 2024-06-03 12:20:23 +00:00
harukin-expo-dev-env
8df32b9c1d Merge commit '7eea78027649dec4dd7492efd8edfb0e61df5eea' 2024-04-28 10:33:20 +00:00
harukin-expo-dev-env
4b901d5015 Merge commit '5d711d37550d288142e3e768a2a0f42a7279d434' 2024-04-18 03:32:42 +00:00
harukin-expo-dev-env
fc5c62685a Merge commit '85e2ad329d89e57be4c094067de48525fe7673e3' 2024-04-18 03:21:26 +00:00
harukin-expo-dev-env
fbc98b2ff7 Merge commit '05167c810a8b727ed6527dbb07c0b9c1de53c171' 2024-04-06 17:19:41 +00:00
harukin-expo-dev-env
3502043176 Merge commit '0efab93a1451818339bfbed97545e6782eafcb9c' 2024-04-06 17:19:32 +00:00
harukin-expo-dev-env
2d0ad8d59e Merge commit 'dd7da102c43348a5420a4b616509d37c8d03a65f' 2024-03-27 15:52:25 +00:00
harukin-expo-dev-env
b5172df7a9 Merge commit '548d5d3747e6491ae421a716e85f7d60be4e41e4' 2024-03-27 15:02:35 +00:00
harukin-expo-dev-env
740d414d2d Merge commit '7e59b8c7bd7d01b35b5b0d6c5be93baed222f660' 2024-03-26 12:59:20 +00:00
harukin-expo-dev-env
8db3e6c218 Merge commit '736f9a65e92257237f347bbe2d02fe88f0e409d6' 2024-03-26 12:54:31 +00:00
harukin-expo-dev-env
fb35b01d2e Merge commit '720b627011a108979ce07a103aff2d728e68cab0' 2024-03-18 12:50:34 +00:00
harukin-expo-dev-env
5fa6b1f73e Merge commit '481ca0158d93b90af0306ed3d54786d61d6281e2' 2024-03-18 04:17:25 +00:00
harukin-expo-dev-env
c16f7401ea Merge commit '5864e821120ec726c6e96fbc8edc6a7172d5bbd7' 2024-03-18 04:04:16 +00:00
harukin-expo-dev-env
f260c5d2dd Merge commit 'a769ccb9512d8c246be82cb1f16673b13b39d4e6' 2024-03-15 18:04:11 +00:00
harukin-expo-dev-env
80e9f1a869 Merge commit 'd8ce2a7f8aac23e1001bbe16690d37c57d1c704f' 2024-03-13 13:27:05 +00:00
harukin-expo-dev-env
26096ba244 Merge commit '5806e2a259e03182d082fe454f4a1932ad9c5e53' 2024-03-13 13:10:22 +00:00
harukin-expo-dev-env
435a910ef9 Merge commit 'f2aed4b945d3e86381ebb964787fcb5aff35fdbd' 2024-03-12 16:47:26 +00:00
harukin-expo-dev-env
68b9236d65 Merge commit '7bd7d951048357c4c0b81d9048906275066e8526' 2024-03-12 16:36:37 +00:00
harukin-expo-dev-env
0148c12e08 Merge commit '75952f4edea5d59554322a5c611483a0052e4e97' 2024-03-12 14:37:09 +00:00
harukin-expo-dev-env
34dc62aee6 Merge commit 'c0cdad36837f27dee7c22930834272052d53d090' 2024-03-09 15:48:41 +00:00
harukin-OneMix4
54ae681f00 Merge commit '8a94b81052a4cf6b833bf298abcd89ed93a0ada2' 2024-01-27 01:37:29 +09:00
harukin-OneMix4
db40351fec Merge commit '431c4c9c0b426250adefbb42db7893233fabb55b' 2024-01-27 01:04:19 +09:00
harukin-OneMix4
2dd8e62f85 Merge commit '485102b5917eaa819c615dbaf47ee27f81a5751f' 2024-01-12 14:04:37 +09:00
harukin-OneMix4
0937fbb619 Merge commit '65080e68f2197f31b8a4ed4bf94ad325aa77e923' 2024-01-09 18:31:30 +09:00
harukin-OneMix4
32edab3289 Merge commit '87129c6815233ea6e42575b83a26c0a2c34a6e5c' 2024-01-09 18:21:41 +09:00
harukin-OneMix4
fa96e68770 Merge commit 'b54f2f6f7e1478cee3f1f3cacf2bc3949d45583f' 2024-01-04 02:38:22 +09:00
harukin-OneMix4
1681be4437 Merge commit '0e06b6636862fa4728d36bb9b934490087cadf02' 2024-01-04 00:47:55 +09:00
harukin-OneMix4
7f96c44e88 Merge commit '0f0d69b22d4e8b3aea9bec06855d38751881055a' 2024-01-03 01:35:33 +09:00
harukin-OneMix4
7d485c466c Merge commit '29c84bcc1ce7bd1d2512b65ef812a313507d8650' 2024-01-03 01:07:31 +09:00
harukin-OneMix4
7869cbee6d Merge commit 'a4e85ff2e6bccb35ecf04f6bdf51ac193585b765' 2023-12-29 03:50:28 +09:00
harukin-OneMix4
c2ad681891 Merge commit '57459d975bbe3a1b4e145331b57a638b2c2fead5' 2023-12-29 02:09:44 +09:00
harukin-OneMix4
163f9ead18 Merge commit 'b23b59eab349139656b2d32c4b19f744a937aa59' 2023-12-25 17:09:41 +09:00
harukin-OneMix4
611fc9953f Merge commit 'e38f550b94a6c89fd2840ff95af392e8e9f49589' 2023-12-25 15:46:35 +09:00
harukin-OneMix4
fd95e99874 Merge commit '9b70843e9c6ed45ebce609952b0202f5ebf877d7' 2023-12-25 05:47:23 +09:00
harukin-OneMix4
f5d0f993db update three month update 2023-12-13 15:56:40 +09:00
harukin-OneMix4
b7e763d265 update three month update 2023-09-17 15:44:19 +09:00
harukin-OneMix4
0afa6f402b 4.5.4.1 2023-07-16 23:00:26 +09:00
harukin-OneMix4
eacce53775 Merge commit '84d36b88cc71ed591c9a50f086ab38cd08177758' 2023-07-16 23:00:05 +09:00
harukin-OneMix4
47b1eb325e なんかマージミスった? 2023-07-16 19:40:44 +09:00
harukin-OneMix4
a145e2c24f Merge commit '711f0bbe9f00200c02fb70757d7c0ca2d0060ed4' 2023-07-16 19:36:57 +09:00
harukin-OneMix4
862742cd3e update build number 2023-06-19 14:03:37 +09:00
harukin-OneMix4
d5f2d367dd Merge commit 'a3e8e3cbbe13e4fc137937493a91708b1dff7cae' 2023-06-18 21:05:04 +09:00
harukin-OneMix4
b1f72f18b5 Merge commit '81f394d6ca2ae418c89452acabe11196e4b7e940' 2023-05-10 17:19:18 +09:00
harukin-OneMix4
d4d86fb7eb 4.5.3 2023-05-10 17:13:10 +09:00
harukin-OneMix4
056a059a68 Merge commit 'bb115afe358eb7f2fb724beb1da13b2be24780b4' 2023-05-10 17:11:56 +09:00
harukin-DeskMini
12676d59cf 4.5.2リリース(本開放/ニュース更新) 2023-03-30 03:28:34 +09:00
harukin-DeskMini
bca2b300d3 4.5.2リリース(封印開放) 2023-03-30 03:25:28 +09:00
harukin-DeskMini
406808ee58 Merge commit '47d84777e2a26235d5442a68ae3b6bcb07f580cb' 2023-03-30 03:21:25 +09:00
harukin-DeskMini
a8aadb7f08 4.5.1 2023-03-27 07:01:47 +09:00
harukin-DeskMini
b810405573 Merge commit '65dd6dd0fdd41f06cfb686d578f9d604185510d3' 2023-03-27 07:01:20 +09:00
harukin-DeskMini
6f62418426 Merge commit '9eca67901906b8852f1f1f2dfa814ed658514b4b' 2023-03-27 01:06:04 +09:00
harukin-DeskMini
88621dd1c8 Merge commit '98b22db4dbea611907c4d7a6a60b7323dbec7a76' 2023-03-27 01:02:57 +09:00
harukin-DeskMini
12d9c1f49d 封印忘れ物 2023-03-26 21:45:04 +09:00
harukin-DeskMini
30c2b8a2f9 4.5.0-リリース用一部封印 2023-03-26 21:42:49 +09:00
harukin-DeskMini
8bc7069c4e Merge commit '816d96d37be6537c9ebcf0be30c74fd154b80dc5' 2023-03-26 21:09:24 +09:00
harukin-OneMix4
737cd25539 Merge commit '64538e33f317c6fe395859673922f63c2e3b0514' 2023-03-02 17:37:40 +09:00
harukin-DeskMini
2c50e5af67 Merge commit 'e93fe7095ef717bd0ddebeb18f28038a374d83f6' 2023-02-01 17:16:10 +09:00
harukin-DeskMini
ea677b4da5 Merge commit '40fb55c8cf5462a40a499ddcc69cb5313e559f84' 2023-01-29 22:10:09 +09:00
harukin-DeskMini
4525443e39 Merge commit 'e35ab09002641b3813d2055ff8107bd8088c4629' 2023-01-29 09:11:58 +09:00
12 changed files with 346 additions and 134 deletions

View File

@@ -0,0 +1,64 @@
import React, { FC } from "react";
import { View, Text, TouchableWithoutFeedback, Alert } from "react-native";
import { useAllTrainDiagram } from "@/stateBox/useAllTrainDiagram";
export const DataConnectedButton: FC<{
i: string;
openTrainInfo: (trainNum: string) => void;
}> = ({ i, openTrainInfo }) => {
const [station, se, time] = i.split(",");
const { keyList } = useAllTrainDiagram();
// 列番が有効かどうかをチェックする関数
const isValidTrainNumber = (trainNum: string): boolean => {
return keyList.includes(trainNum);
};
return (
<TouchableWithoutFeedback
onPress={() => {
// timeの文字列が列番として有効かを検証する
if (!isValidTrainNumber(time)) {
Alert.alert(
"列番が見つかりません",
`列番「${time}」は時刻表に存在しません。`,
[{ text: "OK" }]
);
return;
}
openTrainInfo(time);
}}
key={station + time}
>
<View style={{ flexDirection: "row", backgroundColor: "#f5f5f5" }}>
<View
style={{
padding: 8,
flexDirection: "row",
borderBottomWidth: 1,
borderBottomColor: "#f0f0f0",
flex: 1,
}}
>
<View
style={{
width: 35,
position: "relative",
marginHorizontal: 15,
flexDirection: "row",
height: "10%",
}}
/>
<Text style={{ fontSize:16, fontFamily: "DiaPro" }}>
{se === "連" ? "⬐" : "↳"}
</Text>
<Text style={{ fontSize: 20, color: "#0000EE" }}>{time}</Text>
<View style={{ flex: 1 }} />
<Text style={{ fontSize: 18, width: 50 }}>
{se === "連" ? "連結" : "解結"}
</Text>
</View>
</View>
</TouchableWithoutFeedback>
);
};

View File

@@ -1,36 +0,0 @@
import React, { FC } from "react";
import { View, Text, TouchableWithoutFeedback } from "react-native";
import { MaterialCommunityIcons } from "@expo/vector-icons";
import { Linking } from "react-native";
export const DataFromButton: FC<{ i: string }> = ({ i }) => {
const [station, se, time] = i.split(",");
return (
<TouchableWithoutFeedback
onPress={() => Linking.openURL(time)}
key={station}
>
<View style={{ flexDirection: "row" }}>
<View
style={{
padding: 8,
flexDirection: "row",
borderBottomWidth: 1,
borderBottomColor: "#f0f0f0",
flex: 1,
}}
>
<Text style={{ fontSize: 20 }}>{station}</Text>
<View style={{ flex: 1 }} />
<Text style={{ fontSize: 18 }}>
<MaterialCommunityIcons
name={"open-in-new"}
color="black"
size={20}
/>
</Text>
</View>
</View>
</TouchableWithoutFeedback>
);
};

View File

@@ -8,7 +8,7 @@ import {
isCanceledSe, isCanceledSe,
isThroughSe, isThroughSe,
isCommunitySe, isCommunitySe,
parseSeString parseSeString,
} from "@/utils/seUtils"; } from "@/utils/seUtils";
import type { SeTypes } from "@/types"; import type { SeTypes } from "@/types";
@@ -96,9 +96,9 @@ export const EachStopList: FC<props> = ({
"StationNumber": "B01", "StationNumber": "B01",
}, },
] */ ] */
const StationNumbers = Stations const StationNumbers = Stations.filter((d) => d.StationNumber != null).map(
.filter((d) => d.StationNumber != null) (d) => d.StationNumber as string
.map((d) => d.StationNumber as string); );
// SE文字列を表示用に変換 // SE文字列を表示用に変換
const [seString, seType] = parseSeString(se); const [seString, seType] = parseSeString(se);
@@ -106,13 +106,26 @@ export const EachStopList: FC<props> = ({
const isThrough = isThroughSe(se); const isThrough = isThroughSe(se);
const isCanceled = isCanceledSe(se); const isCanceled = isCanceledSe(se);
const isCommunity = isCommunitySe(se); const isCommunity = isCommunitySe(se);
const isDelayed = currentTrainData?.delay !== undefined && const isDelayed =
currentTrainData?.delay !== "入線" && currentTrainData?.delay !== undefined &&
currentTrainData?.delay > 0; currentTrainData?.delay !== "入線" &&
currentTrainData?.delay > 0;
const colors = getStopListColors(isThrough, isCommunity, isCanceled, isDelayed, isNotService); const colors = getStopListColors(
isThrough,
isCommunity,
isCanceled,
isDelayed,
isNotService
);
// 打ち消し線用の通常色(遅延していない時の色) // 打ち消し線用の通常色(遅延していない時の色)
const normalColors = getStopListColors(isThrough, isCommunity, isCanceled, false, isNotService); const normalColors = getStopListColors(
isThrough,
isCommunity,
isCanceled,
false,
isNotService
);
// beforeSameStationData用の色設定 // beforeSameStationData用の色設定
// 通過系と編コミュニティはbeforeのseから判定、休運休は現在のseから判定 // 通過系と編コミュニティはbeforeのseから判定、休運休は現在のseから判定
@@ -124,8 +137,20 @@ export const EachStopList: FC<props> = ({
const beforeIsThrough = isThroughSe(beforeSe); const beforeIsThrough = isThroughSe(beforeSe);
const beforeIsCommunity = isCommunitySe(beforeSe); const beforeIsCommunity = isCommunitySe(beforeSe);
// 運休判定は現在のseを使用本体と同じ背景色なので // 運休判定は現在のseを使用本体と同じ背景色なので
const beforeColors = getStopListColors(beforeIsThrough, beforeIsCommunity, isCanceled, isDelayed, isNotService); const beforeColors = getStopListColors(
const beforeNormalColors = getStopListColors(beforeIsThrough, beforeIsCommunity, isCanceled, false, isNotService); beforeIsThrough,
beforeIsCommunity,
isCanceled,
isDelayed,
isNotService
);
const beforeNormalColors = getStopListColors(
beforeIsThrough,
beforeIsCommunity,
isCanceled,
false,
isNotService
);
beforeTimeTextColor = beforeColors.timeText; beforeTimeTextColor = beforeColors.timeText;
beforeNormalTimeTextColor = beforeNormalColors.timeText; beforeNormalTimeTextColor = beforeNormalColors.timeText;
} }
@@ -136,7 +161,7 @@ export const EachStopList: FC<props> = ({
openStationACFromEachTrainInfo && openStationACFromEachTrainInfo &&
openStationACFromEachTrainInfo(station) openStationACFromEachTrainInfo(station)
} }
key={station+se+time} key={station + se + time}
> >
<View <View
style={{ style={{
@@ -182,16 +207,16 @@ export const EachStopList: FC<props> = ({
<View style={{ flex: 1 }} /> <View style={{ flex: 1 }} />
</View> </View>
<View style={{ flex: 1 }} /> <View style={{ flex: 1 }} />
<View style={{ position: "relative", width: 0, alignItems: "flex-end" }}> <View
style={{ position: "relative", width: 0, alignItems: "flex-end" }}
>
{points && ( {points && (
<Text style={{ fontSize: 20, position: "absolute", left: -70 }}> <Text style={{ fontSize: 20, position: "absolute", left: -70 }}>
🚊 🚊
</Text> </Text>
)} )}
</View> </View>
<View <View style={{ flexDirection: "column", alignItems: "flex-end" }}>
style={{ flexDirection: "column", alignItems: "flex-end" }}
>
{beforeSameStationData && ( {beforeSameStationData && (
<TimeText <TimeText
isDouble={!!beforeSameStationData || !!afterSameStationData} isDouble={!!beforeSameStationData || !!afterSameStationData}
@@ -199,7 +224,7 @@ export const EachStopList: FC<props> = ({
currentTrainData={currentTrainData} currentTrainData={currentTrainData}
se={beforeSameStationData[1]} se={beforeSameStationData[1]}
time={beforeSameStationData[2]} time={beforeSameStationData[2]}
key={"before"+beforeSameStationData[2]} key={"before" + beforeSameStationData[2]}
textColor={beforeTimeTextColor} textColor={beforeTimeTextColor}
normalTextColor={beforeNormalTimeTextColor} normalTextColor={beforeNormalTimeTextColor}
/> />
@@ -209,7 +234,7 @@ export const EachStopList: FC<props> = ({
currentTrainData={currentTrainData} currentTrainData={currentTrainData}
se={se} se={se}
time={time} time={time}
key={se+time} key={se + time}
textColor={colors.timeText} textColor={colors.timeText}
normalTextColor={normalColors.timeText} normalTextColor={normalColors.timeText}
/> />
@@ -228,7 +253,15 @@ const TimeText: FC<{
time: string; time: string;
textColor: string; textColor: string;
normalTextColor: string; normalTextColor: string;
}> = ({ isDouble, currentTrainData, se, time, isBefore=false, textColor, normalTextColor }) => { }> = ({
isDouble,
currentTrainData,
se,
time,
isBefore = false,
textColor,
normalTextColor,
}) => {
const [seString, seType] = parseSeString(se); const [seString, seType] = parseSeString(se);
return ( return (
@@ -243,7 +276,7 @@ const TimeText: FC<{
color: normalTextColor, color: normalTextColor,
width: 60, width: 60,
position: "absolute", position: "absolute",
right: isBefore ? 125:120, right: isBefore ? 125 : 120,
textAlign: "right", textAlign: "right",
textDecorationLine: "line-through", textDecorationLine: "line-through",
fontStyle: seType == "community" ? "italic" : "normal", fontStyle: seType == "community" ? "italic" : "normal",

View File

@@ -13,7 +13,7 @@ import { getTrainType } from "../../lib/getTrainType";
import { customTrainDataDetector } from "../custom-train-data"; import { customTrainDataDetector } from "../custom-train-data";
import { useDeviceOrientationChange } from "../../stateBox/useDeviceOrientationChange"; import { useDeviceOrientationChange } from "../../stateBox/useDeviceOrientationChange";
import { EachStopList } from "./EachTrainInfo/EachStopList"; import { EachStopList } from "./EachTrainInfo/EachStopList";
import { DataFromButton } from "./EachTrainInfo/DataFromButton"; import { DataConnectedButton } from "./EachTrainInfo/DataConnectedButton";
import { DynamicHeaderScrollView } from "../DynamicHeaderScrollView"; import { DynamicHeaderScrollView } from "../DynamicHeaderScrollView";
import { LongHeader } from "./EachTrainInfo/LongHeader"; import { LongHeader } from "./EachTrainInfo/LongHeader";
import { ShortHeader } from "./EachTrainInfo/ShortHeader"; import { ShortHeader } from "./EachTrainInfo/ShortHeader";
@@ -47,8 +47,8 @@ export const EachTrainInfoCore = ({
const { isLandscape } = useDeviceOrientationChange(); const { isLandscape } = useDeviceOrientationChange();
const scrollHandlers = actionSheetRef const scrollHandlers = actionSheetRef
//@ts-ignore ? //@ts-ignore
? useScrollHandlers("scrollview-1", actionSheetRef) useScrollHandlers("scrollview-1", actionSheetRef)
: null; : null;
// Custom hooks for data management // Custom hooks for data management
const { trainData, setTrainData, trueTrainID } = useTrainDiagramData( const { trainData, setTrainData, trueTrainID } = useTrainDiagramData(
@@ -244,8 +244,14 @@ export const EachTrainInfoCore = ({
</TouchableOpacity> </TouchableOpacity>
)} )}
{trainDataWithThrough.map((item, index, array) => {trainDataWithThrough.map((item, index, array) =>
item.split(",")[1] === "" ? ( item.split(",")[1] === "連" || item.split(",")[1] === "解" ? (
<DataFromButton i={item} key={`${item}-data`} /> <DataConnectedButton
i={item}
key={`${item}-data`}
openTrainInfo={openTrainInfo}
/>
) : item.split(",")[1].includes(".") ? (
<></>
) : ( ) : (
<EachStopList <EachStopList
i={item} i={item}

View File

@@ -142,7 +142,7 @@ export const HeaderText: FC<Props> = ({
} }
}, [trainData]); }, [trainData]);
const todayOperation = getTodayOperationByTrainId(trainNum); const todayOperation = getTodayOperationByTrainId(trainNum).filter(d=> d.state !== 100);
return ( return (
<View <View
style={{ padding: 10, flexDirection: "row", alignItems: "center" }} style={{ padding: 10, flexDirection: "row", alignItems: "center" }}
@@ -216,13 +216,20 @@ export const HeaderText: FC<Props> = ({
size={20} size={20}
color="white" color="white"
style={{ marginLeft: 5 }} style={{ marginLeft: 5 }}
onPress={() => onPress={() => {
// 列番が奇数か偶数かで表示順を逆転
const trainNumInt = parseInt(trainNum, 10);
const ops = todayOperation ? [...todayOperation] : [];
const displayOps = trainNumInt % 2 === 0 ? ops : ops.reverse();
const directionText = trainNumInt % 2 === 0
? '←進行方向'
: '進行方向→';
alert( alert(
`[このアイコン、列車データはコミュニティによってリアルタイム追加されています。]\n使用車両情報:\n${todayOperation `[このアイコン、列車データはコミュニティによってリアルタイム追加されています。]\n使用車両情報:\n${displayOps
?.map((op) => op.unit_ids) .map((op) => op.unit_ids)
.join("+")}\n投稿者メモ:\n${uwasa || "なし"}` .join("+")}\n${directionText}\n投稿者メモ:\n${uwasa || "なし"}`
) );
} }}
/> />
)} )}

View File

@@ -34,12 +34,54 @@ export const TrainIconStatus: FC<Props> = (props) => {
const { train_info_img: vehicle_info_img, vehicle_info_url } = const { train_info_img: vehicle_info_img, vehicle_info_url } =
customTrainDataDetector(data.trainNum, allCustomTrainData); customTrainDataDetector(data.trainNum, allCustomTrainData);
if (todayOperation.length !== 0) { if (todayOperation.length !== 0) {
const data = const returnData =
todayOperation.map((op) => ({ todayOperation
vehicle_info_img: op.vehicle_img, .sort((a, b) => {
vehicle_info_url: op.vehicle_info_url, // trainIdからカンマ以降の数字を抽出する関数
})) || []; const extractOrderNumber = (trainId: string): number => {
setTrainIcon(data); const parts = trainId.split(',');
if (parts.length > 1) {
const num = parseInt(parts[1].trim(), 10);
return isNaN(num) ? Infinity : num;
}
return Infinity; // カンマなし = 末尾に移動
};
// data.trainNumと一致するtrainIdを探す関数
const findMatchingTrainId = (operation: OperationLogs): string | null => {
const allTrainIds = [
...(operation.train_ids || []),
...(operation.related_train_ids || []),
];
// data.trainNumの接頭辞と一致するものを探す
for (const trainId of allTrainIds) {
const prefix = trainId.split(',')[0]; // カンマ前の部分
if (prefix === data.trainNum) {
return trainId;
}
}
return null;
};
const aTrainId = findMatchingTrainId(a);
const bTrainId = findMatchingTrainId(b);
// マッチしたものがない場合は元の順序を保持
if (!aTrainId || !bTrainId) {
return aTrainId ? -1 : bTrainId ? 1 : 0;
}
const aOrder = extractOrderNumber(aTrainId);
const bOrder = extractOrderNumber(bTrainId);
return aOrder - bOrder;
})
.map((op) => ({
vehicle_info_img: op.vehicle_img || vehicle_info_img,
vehicle_info_url: op.vehicle_info_url,
})) || [];
setTrainIcon(returnData);
} else if (vehicle_info_img) { } else if (vehicle_info_img) {
setTrainIcon([{ vehicle_info_img, vehicle_info_url }]); setTrainIcon([{ vehicle_info_img, vehicle_info_url }]);
} }
@@ -124,10 +166,12 @@ export const TrainIconStatus: FC<Props> = (props) => {
<Image <Image
source={{ uri: trainIcon }} source={{ uri: trainIcon }}
style={{ style={{
height: 30, height: index > 0 ? 15 : 30,
width: 24, width: index > 0 ? 12 : 24,
marginRight: 5, marginRight: 5,
display: index == 0 ? "flex" : "none", //暫定対応:複数アイコンがある場合は最初のアイコンのみ表示 marginLeft: index > 0 ? -10 : 0,
marginTop: index > 0 ? 10 : 0,
//display: index == 0 ? "flex" : "none", //暫定対応:複数アイコンがある場合は最初のアイコンのみ表示
}} }}
resizeMethod="resize" resizeMethod="resize"
/> />

View File

@@ -91,7 +91,7 @@ export const AllTrainDiagramView: FC = () => {
const Item: FC<ItemProps> = ({ id, openTrainInfo }) => { const Item: FC<ItemProps> = ({ id, openTrainInfo }) => {
const { train_info_img, train_name, type, train_num_distance, to_data } = const { train_info_img, train_name, type, train_num_distance, to_data } =
customTrainDataDetector(id, allCustomTrainData); customTrainDataDetector(id, allCustomTrainData);
const todayOperation = getTodayOperationByTrainId(id); const todayOperation = getTodayOperationByTrainId(id).filter(d=> d.state !== 100);
const [typeString, fontAvailable, isOneMan] = getStringConfig(type, id); const [typeString, fontAvailable, isOneMan] = getStringConfig(type, id);
@@ -136,7 +136,7 @@ export const AllTrainDiagramView: FC = () => {
? todayOperation.map((operation, index) => ( ? todayOperation.map((operation, index) => (
<Image <Image
key={index} key={index}
source={{ uri: operation.vehicle_img }} source={{ uri: operation.vehicle_img || train_info_img }}
style={{ style={{
width: 20, width: 20,
height: 22, height: 22,

View File

@@ -17,7 +17,7 @@ import { SwitchArea } from "../atom/SwitchArea";
import { useNotification } from "../../stateBox/useNotifications"; import { useNotification } from "../../stateBox/useNotifications";
import { SheetHeaderItem } from "@/components/atom/SheetHeaderItem"; import { SheetHeaderItem } from "@/components/atom/SheetHeaderItem";
const versionCode = "6.1.9.2"; // Update this version code as needed const versionCode = "6.1.9.4"; // Update this version code as needed
export const SettingTopPage = ({ export const SettingTopPage = ({
testNFC, testNFC,

View File

@@ -15,7 +15,7 @@ export const INTERVALS = {
STORAGE_CHECK: 10000, STORAGE_CHECK: 10000,
/** 遅延情報更新間隔(ミリ秒) */ /** 遅延情報更新間隔(ミリ秒) */
DELAY_UPDATE: 60000, DELAY_UPDATE: 30000,
/** 列車位置更新間隔(ミリ秒) */ /** 列車位置更新間隔(ミリ秒) */
TRAIN_POSITION_UPDATE: 5000, TRAIN_POSITION_UPDATE: 5000,

View File

@@ -91,4 +91,5 @@ export type OperationLogs = {
vehicle_img: string; vehicle_img: string;
vehicle_info_url: string; vehicle_info_url: string;
related_train_ids?: string[]; related_train_ids?: string[];
state: number | null;
}; };

View File

@@ -74,8 +74,8 @@ export const injectJavascriptData: InjectJavascriptData = (
if (data === null) { if (data === null) {
return; return;
} }
else if(!_.isEqual(data, operationList)) { else if(!_.isEqual(data.filter(d=> d.state !== 100), operationList)) {
operationList = data; operationList = data.filter(d=> d.state !== 100);
setReload(); setReload();
} }
}); });
@@ -83,7 +83,47 @@ export const injectJavascriptData: InjectJavascriptData = (
setTimeout(operationListUpdate, ${INTERVALS.DELAY_UPDATE}); setTimeout(operationListUpdate, ${INTERVALS.DELAY_UPDATE});
} }
operationListUpdate(); operationListUpdate();
const sortOperationalList = (a, b,targetTrainID) => {
// trainIdからカンマ以降の数字を抽出する関数
const extractOrderNumber = (trainId) => {
const parts = trainId.split(',');
if (parts.length > 1) {
const num = parseInt(parts[1].trim(), 10);
return isNaN(num) ? Infinity : num;
}
return Infinity; // カンマなし = 末尾に移動
};
// data.trainNumと一致するtrainIdを探す関数
const findMatchingTrainId = (operation)=> {
const allTrainIds = [
...(operation.train_ids || []),
...(operation.related_train_ids || []),
];
// data.trainNumの接頭辞と一致するものを探す
for (const trainId of allTrainIds) {
const prefix = trainId.split(',')[0]; // カンマ前の部分
if (prefix === targetTrainID) {
return trainId;
}
}
return null;
};
const aTrainId = findMatchingTrainId(a);
const bTrainId = findMatchingTrainId(b);
// マッチしたものがない場合は元の順序を保持
if (!aTrainId || !bTrainId) {
return aTrainId ? -1 : bTrainId ? 1 : 0;
}
const aOrder = extractOrderNumber(aTrainId);
const bOrder = extractOrderNumber(bTrainId);
return aOrder - bOrder;
};
let trainDiagramData2 = {}; let trainDiagramData2 = {};
const TrainDiagramData2Update = () =>{ const TrainDiagramData2Update = () =>{
@@ -133,11 +173,18 @@ export const injectJavascriptData: InjectJavascriptData = (
`; `;
// 左か右かを判定してアイコンを設置する // 左か右かを判定してアイコンを設置する
const trainIcon = ` const trainIcon = `
const setStationIcon = (setIconElem,img,hasProblem) =>{ const setStationIcon = (setIconElem,img,hasProblem,backCount = 100) =>{
const position = setIconElem.getAttribute("style").includes("left"); const position = setIconElem.getAttribute("style").includes("left");
const marginData = ${uiSetting === "tokyo" ? `"5px"`: `"2px"`} let marginData = ${uiSetting === "tokyo" ? `"5px"`: `"2px"`};
setIconElem.insertAdjacentHTML('beforebegin', "<img src="+img+" style='float:"+(position ? 'left' : 'right')+";height:22px;margin: "+marginData+";'>"); let backgroundColor = "transparent";
setIconElem.remove(); let heightData = "22px";
if(backCount == 0){
marginData = position ? ${uiSetting === "tokyo" ? `"0px 0px -10px 0px" : "-10px 0px 0px 0px"`: `"0px 2px 0px 0px" : "0px 2px 0px 0px"`};
heightData = "16px";
}
setIconElem.insertAdjacentHTML('beforebegin', "<img src="+img+" style='float:"+(position ? 'left' : 'right')+";height:"+heightData+";margin: "+marginData+";background-color: "+backgroundColor+";'>");
if (backCount == 0 || backCount == 100) setIconElem.remove();
} }
const setTrainIcon = (列番データ) => { const setTrainIcon = (列番データ) => {
@@ -894,18 +941,25 @@ export const injectJavascriptData: InjectJavascriptData = (
} }
isEdit = data.priority == 400; isEdit = data.priority == 400;
isSeason = data.priority == 300; isSeason = data.priority == 300;
operationList.forEach(e => { operationList
if(e.train_ids){ .sort((a,b)=>sortOperationalList(a,b,data.train_id))
if(e.train_ids.includes(data.train_id)){ .forEach(e => {
isEdit = true; if (e.train_ids?.length > 0) {
} const trainIds = e.train_ids.map((x) => x.split(",")[0]);
if (trainIds.includes(data.train_id.toString())) {
//returnData.push(e);
isEdit = true;
} }
else if(e.related_train_ids){ } else if (e.related_train_ids?.length > 0) {
if(e.related_train_ids.includes(data.train_id)){ const trainIds = e.related_train_ids.map(
isEdit = true; (x) => x.split(",")[0]
} );
if (trainIds.includes(data.train_id.toString())) {
//returnData.push(e);
isEdit = true;
} }
}); }
});
if(data.train_name != ""){ if(data.train_name != ""){
trainName = data.train_name; trainName = data.train_name;
if(data.train_num_distance != ""){ if(data.train_num_distance != ""){
@@ -1215,33 +1269,51 @@ const setStrings = () =>{
setTrainMenuDialog(element) setTrainMenuDialog(element)
${iconSetting == "true" ? ` ${iconSetting == "true" ? `
let trainIconUrl = null; let trainIconUrl = [];
operationList.forEach(e => { operationList
if(e.train_ids){ .sort((a,b)=>sortOperationalList(a,b,列番データ.toString()))
if(e.train_ids.includes(列番データ)){ .reverse()
if(e.vehicle_img) trainIconUrl = e.vehicle_img; .forEach(e => {
if (e.train_ids?.length > 0) {
const trainIds = e.train_ids.map((x) => x.split(",")[0]);
if (trainIds.includes(列番データ.toString())) {
if(e.vehicle_img) trainIconUrl.push(e.vehicle_img);
} }
} } else if (e.related_train_ids?.length > 0) {
else if(e.related_train_ids){ const trainIds = e.related_train_ids.map(
if(e.related_train_ids.includes(列番データ)){ (x) => x.split(",")[0]
if(e.vehicle_img) trainIconUrl = e.vehicle_img; );
if (trainIds.includes(列番データ.toString())) {
if(e.vehicle_img) trainIconUrl.push(e.vehicle_img);
} }
} }
}); });
if(trainIconUrl != null){ if(trainIconUrl.length > 0){
setStationIcon(element.querySelector("img"),trainIconUrl,hasProblem); [trainIconUrl[0], trainIconUrl[trainIconUrl.length - 1]].forEach((url,index,array) => {
if(url && url != ""){
setStationIcon(element.querySelector("img"),url,hasProblem,trainIconUrl.length == 1 ? 100 : index);
}
});
} }
else{ else{
if(trainDataList.find(e => e.train_id === 列番データ) !== undefined){ if(trainDataList.find(e => e.train_id === 列番データ) !== undefined){
const trainIconUrl = trainDataList.find(e => e.train_id === 列番データ).train_info_img; const trainIconUrl = [trainDataList.find(e => e.train_id === 列番データ).train_info_img];
if(!!trainIconUrl){ if(trainIconUrl.length > 0){
setStationIcon(element.querySelector("img"),trainIconUrl,hasProblem); trainIconUrl.forEach((url,index,array) => {
if(url && url != ""){
setStationIcon(element.querySelector("img"),url,hasProblem);
}
});
} }
} }
else{ else{
const trainIconUrl = setTrainIcon(列番データ); const trainIconUrl = [setTrainIcon(列番データ)];
if(!!trainIconUrl){ if(trainIconUrl.length > 0){
setStationIcon(element.querySelector("img"),trainIconUrl,hasProblem); if(trainIconUrl[0] && trainIconUrl[0] != ""){
setStationIcon(element.querySelector("img"),trainIconUrl[0],hasProblem);
}
} }
} }
} }

View File

@@ -2,7 +2,13 @@ import trainList from "@/assets/originData/trainList";
import { CustomTrainData, OperationLogs } from "@/lib/CommonTypes"; import { CustomTrainData, OperationLogs } from "@/lib/CommonTypes";
import useInterval from "@/lib/useInterval"; import useInterval from "@/lib/useInterval";
import { AS } from "@/storageControl"; import { AS } from "@/storageControl";
import React, { createContext, FC, useContext, useEffect, useState } from "react"; import React, {
createContext,
FC,
useContext,
useEffect,
useState,
} from "react";
import { API_ENDPOINTS, STORAGE_KEYS } from "@/constants"; import { API_ENDPOINTS, STORAGE_KEYS } from "@/constants";
const initialState = { const initialState = {
allTrainDiagram: {}, allTrainDiagram: {},
@@ -27,9 +33,13 @@ export const useAllTrainDiagram = () => useContext(AllTrainDiagramContext);
type Props = { type Props = {
children: React.ReactNode; children: React.ReactNode;
}; };
export const AllTrainDiagramProvider:FC<Props> = ({ children }) => { export const AllTrainDiagramProvider: FC<Props> = ({ children }) => {
const [allTrainDiagram, setAllTrainDiagram] = useState<{ [key: string]: string }>(trainList); const [allTrainDiagram, setAllTrainDiagram] = useState<{
const [allCustomTrainData, setAllCustomTrainData] = useState<CustomTrainData[]>([]); // カスタム列車データ [key: string]: string;
}>(trainList);
const [allCustomTrainData, setAllCustomTrainData] = useState<
CustomTrainData[]
>([]); // カスタム列車データ
const [keyList, setKeyList] = useState<string[]>([]); // 第二要素 const [keyList, setKeyList] = useState<string[]>([]); // 第二要素
useEffect(() => { useEffect(() => {
if (allTrainDiagram && Object.keys(allTrainDiagram).length > 0) if (allTrainDiagram && Object.keys(allTrainDiagram).length > 0)
@@ -47,7 +57,11 @@ export const AllTrainDiagramProvider:FC<Props> = ({ children }) => {
}); });
//dataのkeyで並び替え //dataのkeyで並び替え
const sortedData = Object.keys(data) const sortedData = Object.keys(data)
.sort((a, b) => parseInt(a.replace(/[D,M]/, "")) - parseInt(b.replace(/[D,M]/, ""))) .sort(
(a, b) =>
parseInt(a.replace(/[D,M]/, "")) -
parseInt(b.replace(/[D,M]/, ""))
)
.reduce((acc, key) => { .reduce((acc, key) => {
acc[key] = data[key]; acc[key] = data[key];
return acc; return acc;
@@ -113,11 +127,18 @@ export const AllTrainDiagramProvider:FC<Props> = ({ children }) => {
const getTodayOperationByTrainId = (train_id: string) => { const getTodayOperationByTrainId = (train_id: string) => {
const returnData: OperationLogs[] = []; const returnData: OperationLogs[] = [];
todayOperation.forEach((operation) => { todayOperation.forEach((operation) => {
if (operation.train_ids?.includes(train_id.toString())) { if (operation.train_ids?.length > 0) {
returnData.push(operation); const trainIds = operation.train_ids.map((x) => x.split(",")[0]);
} if (trainIds.includes(train_id.toString())) {
else if (operation.related_train_ids?.includes(train_id.toString())) { returnData.push(operation);
returnData.push(operation); }
} else if (operation.related_train_ids?.length > 0) {
const trainIds = operation.related_train_ids.map(
(x) => x.split(",")[0]
);
if (trainIds.includes(train_id.toString())) {
returnData.push(operation);
}
} }
}); });
return returnData.length > 0 ? returnData : []; return returnData.length > 0 ? returnData : [];
@@ -131,7 +152,7 @@ export const AllTrainDiagramProvider:FC<Props> = ({ children }) => {
allCustomTrainData, allCustomTrainData,
keyList, keyList,
todayOperation, todayOperation,
getTodayOperationByTrainId getTodayOperationByTrainId,
}} }}
> >
{children} {children}