重构赛事的树状图
This commit is contained in:
parent
1977b791e5
commit
2762a8b5f1
420
node_modules/.package-lock.json
generated
vendored
420
node_modules/.package-lock.json
generated
vendored
@ -930,6 +930,14 @@
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/commander": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/commander/-/commander-7.2.0.tgz",
|
||||
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/convert-source-map": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-2.0.0.tgz",
|
||||
@ -986,6 +994,376 @@
|
||||
"resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz",
|
||||
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="
|
||||
},
|
||||
"node_modules/d3": {
|
||||
"version": "7.9.0",
|
||||
"resolved": "https://registry.npmmirror.com/d3/-/d3-7.9.0.tgz",
|
||||
"integrity": "sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==",
|
||||
"dependencies": {
|
||||
"d3-array": "3",
|
||||
"d3-axis": "3",
|
||||
"d3-brush": "3",
|
||||
"d3-chord": "3",
|
||||
"d3-color": "3",
|
||||
"d3-contour": "4",
|
||||
"d3-delaunay": "6",
|
||||
"d3-dispatch": "3",
|
||||
"d3-drag": "3",
|
||||
"d3-dsv": "3",
|
||||
"d3-ease": "3",
|
||||
"d3-fetch": "3",
|
||||
"d3-force": "3",
|
||||
"d3-format": "3",
|
||||
"d3-geo": "3",
|
||||
"d3-hierarchy": "3",
|
||||
"d3-interpolate": "3",
|
||||
"d3-path": "3",
|
||||
"d3-polygon": "3",
|
||||
"d3-quadtree": "3",
|
||||
"d3-random": "3",
|
||||
"d3-scale": "4",
|
||||
"d3-scale-chromatic": "3",
|
||||
"d3-selection": "3",
|
||||
"d3-shape": "3",
|
||||
"d3-time": "3",
|
||||
"d3-time-format": "4",
|
||||
"d3-timer": "3",
|
||||
"d3-transition": "3",
|
||||
"d3-zoom": "3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-array": {
|
||||
"version": "3.2.4",
|
||||
"resolved": "https://registry.npmmirror.com/d3-array/-/d3-array-3.2.4.tgz",
|
||||
"integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==",
|
||||
"dependencies": {
|
||||
"internmap": "1 - 2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-axis": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/d3-axis/-/d3-axis-3.0.0.tgz",
|
||||
"integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-brush": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/d3-brush/-/d3-brush-3.0.0.tgz",
|
||||
"integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==",
|
||||
"dependencies": {
|
||||
"d3-dispatch": "1 - 3",
|
||||
"d3-drag": "2 - 3",
|
||||
"d3-interpolate": "1 - 3",
|
||||
"d3-selection": "3",
|
||||
"d3-transition": "3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-chord": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/d3-chord/-/d3-chord-3.0.1.tgz",
|
||||
"integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==",
|
||||
"dependencies": {
|
||||
"d3-path": "1 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-color": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/d3-color/-/d3-color-3.1.0.tgz",
|
||||
"integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-contour": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/d3-contour/-/d3-contour-4.0.2.tgz",
|
||||
"integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==",
|
||||
"dependencies": {
|
||||
"d3-array": "^3.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-delaunay": {
|
||||
"version": "6.0.4",
|
||||
"resolved": "https://registry.npmmirror.com/d3-delaunay/-/d3-delaunay-6.0.4.tgz",
|
||||
"integrity": "sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==",
|
||||
"dependencies": {
|
||||
"delaunator": "5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-dispatch": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/d3-dispatch/-/d3-dispatch-3.0.1.tgz",
|
||||
"integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-drag": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/d3-drag/-/d3-drag-3.0.0.tgz",
|
||||
"integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==",
|
||||
"dependencies": {
|
||||
"d3-dispatch": "1 - 3",
|
||||
"d3-selection": "3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-dsv": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/d3-dsv/-/d3-dsv-3.0.1.tgz",
|
||||
"integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==",
|
||||
"dependencies": {
|
||||
"commander": "7",
|
||||
"iconv-lite": "0.6",
|
||||
"rw": "1"
|
||||
},
|
||||
"bin": {
|
||||
"csv2json": "bin/dsv2json.js",
|
||||
"csv2tsv": "bin/dsv2dsv.js",
|
||||
"dsv2dsv": "bin/dsv2dsv.js",
|
||||
"dsv2json": "bin/dsv2json.js",
|
||||
"json2csv": "bin/json2dsv.js",
|
||||
"json2dsv": "bin/json2dsv.js",
|
||||
"json2tsv": "bin/json2dsv.js",
|
||||
"tsv2csv": "bin/dsv2dsv.js",
|
||||
"tsv2json": "bin/dsv2json.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-ease": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/d3-ease/-/d3-ease-3.0.1.tgz",
|
||||
"integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-fetch": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/d3-fetch/-/d3-fetch-3.0.1.tgz",
|
||||
"integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==",
|
||||
"dependencies": {
|
||||
"d3-dsv": "1 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-force": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/d3-force/-/d3-force-3.0.0.tgz",
|
||||
"integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==",
|
||||
"dependencies": {
|
||||
"d3-dispatch": "1 - 3",
|
||||
"d3-quadtree": "1 - 3",
|
||||
"d3-timer": "1 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-format": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/d3-format/-/d3-format-3.1.0.tgz",
|
||||
"integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-geo": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/d3-geo/-/d3-geo-3.1.1.tgz",
|
||||
"integrity": "sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q==",
|
||||
"dependencies": {
|
||||
"d3-array": "2.5.0 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-hierarchy": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz",
|
||||
"integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-interpolate": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/d3-interpolate/-/d3-interpolate-3.0.1.tgz",
|
||||
"integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==",
|
||||
"dependencies": {
|
||||
"d3-color": "1 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-path": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/d3-path/-/d3-path-3.1.0.tgz",
|
||||
"integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-polygon": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/d3-polygon/-/d3-polygon-3.0.1.tgz",
|
||||
"integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-quadtree": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/d3-quadtree/-/d3-quadtree-3.0.1.tgz",
|
||||
"integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-random": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/d3-random/-/d3-random-3.0.1.tgz",
|
||||
"integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-scale": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/d3-scale/-/d3-scale-4.0.2.tgz",
|
||||
"integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==",
|
||||
"dependencies": {
|
||||
"d3-array": "2.10.0 - 3",
|
||||
"d3-format": "1 - 3",
|
||||
"d3-interpolate": "1.2.0 - 3",
|
||||
"d3-time": "2.1.1 - 3",
|
||||
"d3-time-format": "2 - 4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-scale-chromatic": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz",
|
||||
"integrity": "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==",
|
||||
"dependencies": {
|
||||
"d3-color": "1 - 3",
|
||||
"d3-interpolate": "1 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-selection": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/d3-selection/-/d3-selection-3.0.0.tgz",
|
||||
"integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-shape": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/d3-shape/-/d3-shape-3.2.0.tgz",
|
||||
"integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==",
|
||||
"dependencies": {
|
||||
"d3-path": "^3.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-time": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/d3-time/-/d3-time-3.1.0.tgz",
|
||||
"integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==",
|
||||
"dependencies": {
|
||||
"d3-array": "2 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-time-format": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/d3-time-format/-/d3-time-format-4.1.0.tgz",
|
||||
"integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==",
|
||||
"dependencies": {
|
||||
"d3-time": "1 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-timer": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/d3-timer/-/d3-timer-3.0.1.tgz",
|
||||
"integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-transition": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/d3-transition/-/d3-transition-3.0.1.tgz",
|
||||
"integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==",
|
||||
"dependencies": {
|
||||
"d3-color": "1 - 3",
|
||||
"d3-dispatch": "1 - 3",
|
||||
"d3-ease": "1 - 3",
|
||||
"d3-interpolate": "1 - 3",
|
||||
"d3-timer": "1 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"d3-selection": "2 - 3"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-zoom": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/d3-zoom/-/d3-zoom-3.0.0.tgz",
|
||||
"integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==",
|
||||
"dependencies": {
|
||||
"d3-dispatch": "1 - 3",
|
||||
"d3-drag": "2 - 3",
|
||||
"d3-interpolate": "1 - 3",
|
||||
"d3-selection": "2 - 3",
|
||||
"d3-transition": "2 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.0.tgz",
|
||||
@ -1043,6 +1421,14 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/delaunator": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/delaunator/-/delaunator-5.0.1.tgz",
|
||||
"integrity": "sha512-8nvh+XBe96aCESrGOqMp/84b13H9cdKbG5P2ejQCh4d4sK9RL4371qou9drQjMhvnPmhWl5hnmqbEE0fXr9Xnw==",
|
||||
"dependencies": {
|
||||
"robust-predicates": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
@ -1440,6 +1826,17 @@
|
||||
"node": ">=18.18.0"
|
||||
}
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/immediate": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmmirror.com/immediate/-/immediate-3.0.6.tgz",
|
||||
@ -1450,6 +1847,14 @@
|
||||
"resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
},
|
||||
"node_modules/internmap": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmmirror.com/internmap/-/internmap-2.0.3.tgz",
|
||||
"integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/is-docker": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/is-docker/-/is-docker-3.0.0.tgz",
|
||||
@ -1893,6 +2298,11 @@
|
||||
"integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/robust-predicates": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/robust-predicates/-/robust-predicates-3.0.2.tgz",
|
||||
"integrity": "sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg=="
|
||||
},
|
||||
"node_modules/rollup": {
|
||||
"version": "4.40.1",
|
||||
"resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.40.1.tgz",
|
||||
@ -1944,11 +2354,21 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/rw": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmmirror.com/rw/-/rw-1.3.3.tgz",
|
||||
"integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ=="
|
||||
},
|
||||
"node_modules/safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
},
|
||||
"node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz",
|
||||
|
32
node_modules/.vite/deps/_metadata.json
generated
vendored
32
node_modules/.vite/deps/_metadata.json
generated
vendored
@ -1,43 +1,49 @@
|
||||
{
|
||||
"hash": "3498b3cb",
|
||||
"configHash": "9c7a641a",
|
||||
"lockfileHash": "c997fc3c",
|
||||
"browserHash": "38ceb684",
|
||||
"hash": "caa31cd8",
|
||||
"configHash": "8bd3ff55",
|
||||
"lockfileHash": "296e7a14",
|
||||
"browserHash": "748422e9",
|
||||
"optimized": {
|
||||
"axios": {
|
||||
"src": "../../axios/index.js",
|
||||
"file": "axios.js",
|
||||
"fileHash": "97de2fb4",
|
||||
"fileHash": "17dc0739",
|
||||
"needsInterop": false
|
||||
},
|
||||
"jszip": {
|
||||
"src": "../../jszip/dist/jszip.min.js",
|
||||
"file": "jszip.js",
|
||||
"fileHash": "3cd8a10a",
|
||||
"fileHash": "73a56b11",
|
||||
"needsInterop": true
|
||||
},
|
||||
"mitt": {
|
||||
"src": "../../mitt/dist/mitt.mjs",
|
||||
"file": "mitt.js",
|
||||
"fileHash": "72a77428",
|
||||
"needsInterop": false
|
||||
},
|
||||
"vue": {
|
||||
"src": "../../vue/dist/vue.runtime.esm-bundler.js",
|
||||
"file": "vue.js",
|
||||
"fileHash": "74f3ac3b",
|
||||
"fileHash": "dd9d6977",
|
||||
"needsInterop": false
|
||||
},
|
||||
"vue-router": {
|
||||
"src": "../../vue-router/dist/vue-router.mjs",
|
||||
"file": "vue-router.js",
|
||||
"fileHash": "d2d7abce",
|
||||
"fileHash": "1b493d5a",
|
||||
"needsInterop": false
|
||||
},
|
||||
"xlsx": {
|
||||
"src": "../../xlsx/xlsx.mjs",
|
||||
"file": "xlsx.js",
|
||||
"fileHash": "dbbdc859",
|
||||
"fileHash": "e65d0089",
|
||||
"needsInterop": false
|
||||
},
|
||||
"mitt": {
|
||||
"src": "../../mitt/dist/mitt.mjs",
|
||||
"file": "mitt.js",
|
||||
"fileHash": "ac6eb5ab",
|
||||
"d3": {
|
||||
"src": "../../d3/src/index.js",
|
||||
"file": "d3.js",
|
||||
"fileHash": "89f27bc8",
|
||||
"needsInterop": false
|
||||
}
|
||||
},
|
||||
|
@ -92,6 +92,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 对话框组件 -->
|
||||
<SuccessDialog
|
||||
:visible="successDialog.visible"
|
||||
:message="successDialog.message"
|
||||
@close="successDialog.visible = false"
|
||||
/>
|
||||
<ErrorDialog
|
||||
:visible="errorDialog.visible"
|
||||
:message="errorDialog.message"
|
||||
@close="errorDialog.visible = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -99,6 +111,8 @@
|
||||
import { ref, computed, onMounted, watch, nextTick, onUnmounted } from 'vue';
|
||||
import { getSignUpResultList, updateSignUpResult, getTournamentList } from '@/api/tournament';
|
||||
import * as d3 from 'd3';
|
||||
import SuccessDialog from '@/components/SuccessDialog.vue';
|
||||
import ErrorDialog from '@/components/ErrorDialog.vue';
|
||||
|
||||
const props = defineProps({
|
||||
tournamentId: {
|
||||
@ -121,6 +135,10 @@ const runnerUp = ref(null);
|
||||
const thirdPlace = ref(null);
|
||||
const loading = ref(false);
|
||||
|
||||
// Dialog state
|
||||
const successDialog = ref({ visible: false, message: '' });
|
||||
const errorDialog = ref({ visible: false, message: '' });
|
||||
|
||||
// Store zoom behaviors for both brackets
|
||||
let winnersZoomBehavior = null;
|
||||
let winnerssvgSelection = null;
|
||||
@ -218,7 +236,7 @@ const generateDoubleEliminationBracket = () => {
|
||||
|
||||
const totalPlayers = participants.value.length;
|
||||
if (totalPlayers < 4) {
|
||||
alert('双败淘汰赛至少需要4名参赛者');
|
||||
errorDialog.value = { visible: true, message: '双败淘汰赛至少需要4名参赛者' };
|
||||
return;
|
||||
}
|
||||
|
||||
@ -690,7 +708,10 @@ const drawD3Connections = (g, bracket, bracketType, matchWidth, matchHeight, rou
|
||||
};
|
||||
|
||||
const confirmScore = async (match, bracketType, rIndex, mIndex) => {
|
||||
if (match.score1 === match.score2) return alert('不能平局');
|
||||
if (match.score1 === match.score2) {
|
||||
errorDialog.value = { visible: true, message: '不能平局' };
|
||||
return;
|
||||
}
|
||||
match.decided = true;
|
||||
match.winner = match.score1 > match.score2 ? match.participant1 : match.participant2;
|
||||
match.loser = match.score1 > match.score2 ? match.participant2 : match.participant1;
|
||||
@ -916,7 +937,10 @@ const resetZoomLosers = () => {
|
||||
|
||||
const confirmFinal = async () => {
|
||||
const match = finalMatch.value;
|
||||
if (!match || match.score1 === match.score2) return alert('决赛不能平局');
|
||||
if (!match || match.score1 === match.score2) {
|
||||
errorDialog.value = { visible: true, message: '决赛不能平局' };
|
||||
return;
|
||||
}
|
||||
|
||||
match.decided = true;
|
||||
match.winner = match.score1 > match.score2 ? match.participant1 : match.participant2;
|
||||
@ -929,7 +953,7 @@ const confirmFinal = async () => {
|
||||
// 如果败者组冠军(participant2)在决赛中获胜,则需要重置比赛
|
||||
if (match.winner === match.participant2) {
|
||||
// Bracket Reset: 败者组冠军获胜,需要再打一场
|
||||
alert('败者组冠军获胜!比赛重置,将进行最终决赛!');
|
||||
successDialog.value = { visible: true, message: '败者组冠军获胜!比赛重置,将进行最终决赛!' };
|
||||
finalMatch.value = {
|
||||
participant1: match.participant2, // 原败者组冠军
|
||||
participant2: match.participant1, // 原胜者组冠军
|
||||
@ -1067,7 +1091,7 @@ const updatePlayerStats = async (p1, p2, s1, s2, bracketType = 'winners') => {
|
||||
await loadTournamentData();
|
||||
} catch (err) {
|
||||
console.error('更新选手数据失败:', err);
|
||||
alert('更新选手数据失败');
|
||||
errorDialog.value = { visible: true, message: '更新选手数据失败' };
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -48,6 +48,18 @@
|
||||
<svg id="d3-bracket" class="d3-bracket"></svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 对话框组件 -->
|
||||
<SuccessDialog
|
||||
:visible="successDialog.visible"
|
||||
:message="successDialog.message"
|
||||
@close="successDialog.visible = false"
|
||||
/>
|
||||
<ErrorDialog
|
||||
:visible="errorDialog.visible"
|
||||
:message="errorDialog.message"
|
||||
@close="errorDialog.visible = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -55,6 +67,8 @@
|
||||
import { ref, computed, onMounted, watch, nextTick, onUnmounted } from 'vue';
|
||||
import { getSignUpResultList, updateSignUpResult, getTournamentList } from '@/api/tournament';
|
||||
import * as d3 from 'd3';
|
||||
import SuccessDialog from '@/components/SuccessDialog.vue';
|
||||
import ErrorDialog from '@/components/ErrorDialog.vue';
|
||||
|
||||
const props = defineProps({
|
||||
tournamentId: {
|
||||
@ -67,6 +81,10 @@ const participants = ref([]);
|
||||
const loading = ref(false);
|
||||
const finalRanking = ref(null);
|
||||
|
||||
// Dialog state
|
||||
const successDialog = ref({ visible: false, message: '' });
|
||||
const errorDialog = ref({ visible: false, message: '' });
|
||||
|
||||
// Store zoom behavior for external control
|
||||
let zoomBehavior = null;
|
||||
let svgSelection = null;
|
||||
@ -500,11 +518,11 @@ async function confirmScore(match) {
|
||||
const s1 = Number(match.score1);
|
||||
const s2 = Number(match.score2);
|
||||
if (isNaN(s1) || isNaN(s2)) {
|
||||
alert('请输入有效的比分');
|
||||
errorDialog.value = { visible: true, message: '请输入有效的比分' };
|
||||
return;
|
||||
}
|
||||
if (s1 === s2) {
|
||||
alert('比分不能平局');
|
||||
errorDialog.value = { visible: true, message: '比分不能平局' };
|
||||
return;
|
||||
}
|
||||
match.score1 = s1;
|
||||
@ -558,7 +576,7 @@ async function confirmScore(match) {
|
||||
tournament.value.participants = [...participants.value];
|
||||
}
|
||||
} catch (err) {
|
||||
alert('更新数据失败');
|
||||
errorDialog.value = { visible: true, message: '更新数据失败' };
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@ -720,9 +738,29 @@ watch(() => props.tournamentId, (newId) => {
|
||||
}
|
||||
|
||||
.tournament-bracket-root button {
|
||||
background: #409EFF;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 10px 15px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
margin-top: 10px;
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
transition: all 0.3s;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.tournament-bracket-root button:disabled {
|
||||
background: #cccccc;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.tournament-bracket-root button:hover:not(:disabled) {
|
||||
background: #66b1ff;
|
||||
}
|
||||
|
||||
.tournament-bracket-root input[type=number]::-webkit-inner-spin-button,
|
||||
.tournament-bracket-root input[type=number]::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
|
@ -100,6 +100,18 @@
|
||||
<button type="button" class="cancel-btn" @click="handleCancel">取消</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- 对话框组件 -->
|
||||
<SuccessDialog
|
||||
:visible="successDialog.visible"
|
||||
:message="successDialog.message"
|
||||
@close="successDialog.visible = false"
|
||||
/>
|
||||
<ErrorDialog
|
||||
:visible="errorDialog.visible"
|
||||
:message="errorDialog.message"
|
||||
@close="errorDialog.visible = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -108,6 +120,8 @@ import { ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { addTournament, addSignUp, getTournamentList } from '@/api/tournament'
|
||||
import * as XLSX from 'xlsx'
|
||||
import SuccessDialog from '@/components/SuccessDialog.vue'
|
||||
import ErrorDialog from '@/components/ErrorDialog.vue'
|
||||
|
||||
const router = useRouter()
|
||||
const showExcelDialog = ref(false)
|
||||
@ -129,6 +143,10 @@ const formData = ref({
|
||||
description: ''
|
||||
})
|
||||
|
||||
// Dialog state
|
||||
const successDialog = ref({ visible: false, message: '' })
|
||||
const errorDialog = ref({ visible: false, message: '' })
|
||||
|
||||
// Excel赛事信息字段与表单字段的映射
|
||||
const excelFieldMap = {
|
||||
'赛事名称': 'name',
|
||||
@ -190,11 +208,11 @@ const handleSubmit = async () => {
|
||||
// 调用API添加赛事
|
||||
await addTournament(tournamentData)
|
||||
|
||||
alert('添加赛事成功!')
|
||||
successDialog.value = { visible: true, message: '添加赛事成功!' }
|
||||
router.push('/competition')
|
||||
} catch (error) {
|
||||
console.error('提交失败:', error)
|
||||
alert(error.response?.data?.message || '添加赛事失败,请重试')
|
||||
errorDialog.value = { visible: true, message: error.response?.data?.message || '添加赛事失败,请重试' }
|
||||
}
|
||||
}
|
||||
|
||||
@ -310,7 +328,7 @@ const processExcelFile = (file) => {
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
alert('Excel文件格式错误,请检查文件内容')
|
||||
errorDialog.value = { visible: true, message: 'Excel文件格式错误,请检查文件内容' }
|
||||
}
|
||||
}
|
||||
reader.readAsArrayBuffer(file)
|
||||
@ -340,7 +358,7 @@ const confirmImport = async () => {
|
||||
|
||||
try {
|
||||
await addTournament(tournamentData)
|
||||
alert('赛事导入成功!')
|
||||
successDialog.value = { visible: true, message: '赛事导入成功!' }
|
||||
|
||||
const tournamentList = await getTournamentList()
|
||||
console.log('获取到的赛事列表:', tournamentList)
|
||||
@ -377,16 +395,16 @@ const confirmImport = async () => {
|
||||
await addSignUp(signUpData)
|
||||
} catch (error) {
|
||||
console.error('报名失败:', error)
|
||||
alert(`报名失败: ${row['队伍名称或者个人参赛名称']},${error.message}`)
|
||||
errorDialog.value = { visible: true, message: `报名失败: ${row['队伍名称或者个人参赛名称']},${error.message}` }
|
||||
}
|
||||
}
|
||||
alert('选手报名表导入完成!')
|
||||
successDialog.value = { visible: true, message: '选手报名表导入完成!' }
|
||||
}
|
||||
|
||||
router.push('/competition')
|
||||
} catch (error) {
|
||||
console.error('导入失败:', error)
|
||||
alert(error.response?.data?.message || '赛事导入失败,请重试')
|
||||
errorDialog.value = { visible: true, message: error.response?.data?.message || '赛事导入失败,请重试' }
|
||||
}
|
||||
closeExcelDialog()
|
||||
}
|
||||
|
@ -213,6 +213,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 对话框组件 -->
|
||||
<SuccessDialog
|
||||
:visible="successDialog.visible"
|
||||
:message="successDialog.message"
|
||||
@close="successDialog.visible = false"
|
||||
/>
|
||||
<ErrorDialog
|
||||
:visible="errorDialog.visible"
|
||||
:message="errorDialog.message"
|
||||
@close="errorDialog.visible = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -231,6 +243,8 @@ import {
|
||||
deleteSignUpResult
|
||||
} from '@/api/tournament'
|
||||
import { getStoredUser } from '@/utils/jwt'
|
||||
import SuccessDialog from '@/components/SuccessDialog.vue'
|
||||
import ErrorDialog from '@/components/ErrorDialog.vue'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
@ -295,6 +309,10 @@ const playerEditForm = ref({ // 玩家编辑表单
|
||||
tournament_id: ''
|
||||
})
|
||||
|
||||
// Dialog state
|
||||
const successDialog = ref({ visible: false, message: '' })
|
||||
const errorDialog = ref({ visible: false, message: '' })
|
||||
|
||||
// 格式化日期
|
||||
const formatDate = (date) => {
|
||||
if (!date) return ''
|
||||
@ -379,12 +397,12 @@ const handleUpdate = async () => {
|
||||
}
|
||||
|
||||
await updateTournament(tournamentId, updateData)
|
||||
alert('更新成功!')
|
||||
successDialog.value = { visible: true, message: '更新成功!' }
|
||||
closeEditDialog()
|
||||
fetchTournamentDetail() // 刷新数据
|
||||
} catch (error) {
|
||||
console.error('更新失败:', error)
|
||||
alert(error.response?.data?.message || '更新失败,请重试')
|
||||
errorDialog.value = { visible: true, message: error.response?.data?.message || '更新失败,请重试' }
|
||||
} finally {
|
||||
isUpdating.value = false
|
||||
}
|
||||
@ -396,11 +414,11 @@ const handleDelete = async () => {
|
||||
isDeleting.value = true
|
||||
const tournamentId = route.query.id
|
||||
await deleteTournament(tournamentId)
|
||||
alert('删除成功!')
|
||||
successDialog.value = { visible: true, message: '删除成功!' }
|
||||
router.push('/competition')
|
||||
} catch (error) {
|
||||
console.error('删除失败:', error)
|
||||
alert(error.response?.data?.message || '删除失败,请重试')
|
||||
errorDialog.value = { visible: true, message: error.response?.data?.message || '删除失败,请重试' }
|
||||
} finally {
|
||||
isDeleting.value = false
|
||||
showDeleteConfirm.value = false
|
||||
@ -449,12 +467,12 @@ const fetchTournamentDetail = async () => {
|
||||
}
|
||||
} else {
|
||||
console.log('未找到赛事')
|
||||
alert('未找到赛事信息')
|
||||
errorDialog.value = { visible: true, message: '未找到赛事信息' }
|
||||
router.push('/competition')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取赛事详情失败:', error)
|
||||
alert('获取赛事详情失败,请重试')
|
||||
errorDialog.value = { visible: true, message: '获取赛事详情失败,请重试' }
|
||||
} finally {
|
||||
isLoading.value = false
|
||||
}
|
||||
@ -485,10 +503,10 @@ const handleRemovePlayer = async (playerId) => {
|
||||
try {
|
||||
await deleteSignUpResult(playerId)
|
||||
await fetchRegisteredPlayers() // 刷新列表
|
||||
alert('移除成功!')
|
||||
successDialog.value = { visible: true, message: '移除成功!' }
|
||||
} catch (error) {
|
||||
console.error('移除玩家失败:', error)
|
||||
alert(error.response?.data?.message || '移除失败,请重试')
|
||||
errorDialog.value = { visible: true, message: error.response?.data?.message || '移除失败,请重试' }
|
||||
}
|
||||
}
|
||||
|
||||
@ -530,7 +548,7 @@ const handleStatusUpdate = async () => {
|
||||
|
||||
console.log('更新赛事状态,发送数据:', updateData)
|
||||
await updateTournament(tournamentId, updateData)
|
||||
alert('状态更新成功!')
|
||||
successDialog.value = { visible: true, message: '状态更新成功!' }
|
||||
closeStatusDialog()
|
||||
fetchTournamentDetail() // 刷新数据
|
||||
} catch (error) {
|
||||
@ -540,7 +558,7 @@ const handleStatusUpdate = async () => {
|
||||
response: error.response?.data,
|
||||
status: error.response?.status
|
||||
})
|
||||
alert(error.message || '状态更新失败,请重试')
|
||||
errorDialog.value = { visible: true, message: error.message || '状态更新失败,请重试' }
|
||||
} finally {
|
||||
isUpdating.value = false
|
||||
}
|
||||
@ -591,7 +609,7 @@ const handlePlayerUpdate = async () => {
|
||||
await updateSignUpResult(playerEditForm.value.id, updateData)
|
||||
await fetchRegisteredPlayers() // 刷新列表
|
||||
closePlayerEditDialog()
|
||||
alert('更新成功!')
|
||||
successDialog.value = { visible: true, message: '更新成功!' }
|
||||
} catch (error) {
|
||||
console.error('更新玩家信息失败:', error)
|
||||
console.error('错误详情:', {
|
||||
@ -599,7 +617,7 @@ const handlePlayerUpdate = async () => {
|
||||
response: error.response?.data,
|
||||
status: error.response?.status
|
||||
})
|
||||
alert(error.response?.data?.detail || error.message || '更新失败,请重试')
|
||||
errorDialog.value = { visible: true, message: error.response?.data?.detail || error.message || '更新失败,请重试' }
|
||||
} finally {
|
||||
isUpdating.value = false
|
||||
}
|
||||
@ -611,11 +629,11 @@ const saveChanges = async () => {
|
||||
isSaving.value = true
|
||||
// TODO: 调用保存对阵图的API
|
||||
// await saveTournamentBracket(route.query.id, tournamentRounds.value)
|
||||
alert('保存成功!')
|
||||
successDialog.value = { visible: true, message: '保存成功!' }
|
||||
isEditMode.value = false
|
||||
} catch (error) {
|
||||
console.error('保存失败:', error)
|
||||
alert('保存失败,请重试')
|
||||
errorDialog.value = { visible: true, message: '保存失败,请重试' }
|
||||
} finally {
|
||||
isSaving.value = false
|
||||
}
|
||||
|
@ -124,6 +124,18 @@
|
||||
<button class="btn-submit" @click="handleSubmit">提交报名</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 对话框组件 -->
|
||||
<SuccessDialog
|
||||
:visible="successDialog.visible"
|
||||
:message="successDialog.message"
|
||||
@close="successDialog.visible = false"
|
||||
/>
|
||||
<ErrorDialog
|
||||
:visible="errorDialog.visible"
|
||||
:message="errorDialog.message"
|
||||
@close="errorDialog.visible = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -131,6 +143,8 @@
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { addSignUp } from '@/api/tournament'
|
||||
import SuccessDialog from '@/components/SuccessDialog.vue'
|
||||
import ErrorDialog from '@/components/ErrorDialog.vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'CompetitionSignUp'
|
||||
@ -158,6 +172,10 @@ const signupForm = ref({
|
||||
qq: ''
|
||||
})
|
||||
|
||||
// Dialog state
|
||||
const successDialog = ref({ visible: false, message: '' })
|
||||
const errorDialog = ref({ visible: false, message: '' })
|
||||
|
||||
const formatDate = (date) => {
|
||||
if (!date) return ''
|
||||
// 将年/月/日格式转换为年-月-日格式显示
|
||||
@ -190,12 +208,12 @@ const handleSubmit = async () => {
|
||||
// 根据报名类型验证必填字段
|
||||
if (signupForm.value.type === 'teamname') {
|
||||
if (!signupForm.value.teamName || !signupForm.value.username) {
|
||||
alert('请填写完整的队伍信息')
|
||||
errorDialog.value = { visible: true, message: '请填写完整的队伍信息' }
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if (!signupForm.value.username) {
|
||||
alert('请填写完整的个人信息')
|
||||
errorDialog.value = { visible: true, message: '请填写完整的个人信息' }
|
||||
return
|
||||
}
|
||||
}
|
||||
@ -203,37 +221,37 @@ const handleSubmit = async () => {
|
||||
// 验证 sign_name
|
||||
const signName = signupForm.value.username.trim()
|
||||
if (!signName) {
|
||||
alert('参赛人员名称不能为空')
|
||||
errorDialog.value = { visible: true, message: '参赛人员名称不能为空' }
|
||||
return
|
||||
}
|
||||
if (signName.length < 2) {
|
||||
alert('参赛人员名称至少需要2个字符')
|
||||
errorDialog.value = { visible: true, message: '参赛人员名称至少需要2个字符' }
|
||||
return
|
||||
}
|
||||
if (signName.length > 20) {
|
||||
alert('参赛人员名称不能超过20个字符')
|
||||
errorDialog.value = { visible: true, message: '参赛人员名称不能超过20个字符' }
|
||||
return
|
||||
}
|
||||
// 只允许中文、英文、数字和下划线
|
||||
if (!/^[\u4e00-\u9fa5a-zA-Z0-9_]+$/.test(signName)) {
|
||||
alert('参赛人员名称只能包含中文、英文、数字和下划线')
|
||||
errorDialog.value = { visible: true, message: '参赛人员名称只能包含中文、英文、数字和下划线' }
|
||||
return
|
||||
}
|
||||
// 不允许纯数字
|
||||
if (/^\d+$/.test(signName)) {
|
||||
alert('参赛人员名称不能为纯数字')
|
||||
errorDialog.value = { visible: true, message: '参赛人员名称不能为纯数字' }
|
||||
return
|
||||
}
|
||||
// 不允许纯下划线
|
||||
if (/^_+$/.test(signName)) {
|
||||
alert('参赛人员名称不能为纯下划线')
|
||||
errorDialog.value = { visible: true, message: '参赛人员名称不能为纯下划线' }
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
// 确保所有必需字段都存在
|
||||
if (!competitionInfo.value.id || !competitionInfo.value.name) {
|
||||
alert('比赛信息不完整,请返回重试')
|
||||
errorDialog.value = { visible: true, message: '比赛信息不完整,请返回重试' }
|
||||
return
|
||||
}
|
||||
|
||||
@ -252,7 +270,7 @@ const handleSubmit = async () => {
|
||||
console.log('报名结果:', result)
|
||||
|
||||
if (result.signup && result.result) {
|
||||
alert('报名成功!')
|
||||
successDialog.value = { visible: true, message: '报名成功!' }
|
||||
router.push('/competition')
|
||||
} else {
|
||||
console.error('报名结果不完整:', result)
|
||||
@ -268,13 +286,13 @@ const handleSubmit = async () => {
|
||||
|
||||
// 显示具体的错误信息
|
||||
if (error.message.includes('返回数据为空')) {
|
||||
alert('服务器返回数据为空,请稍后重试')
|
||||
errorDialog.value = { visible: true, message: '服务器返回数据为空,请稍后重试' }
|
||||
} else if (error.message.includes('数据不完整')) {
|
||||
alert('报名数据不完整,请重试')
|
||||
errorDialog.value = { visible: true, message: '报名数据不完整,请重试' }
|
||||
} else if (error.message.includes('网络连接')) {
|
||||
alert('网络连接失败,请检查网络后重试')
|
||||
errorDialog.value = { visible: true, message: '网络连接失败,请检查网络后重试' }
|
||||
} else {
|
||||
alert(error.message || '报名失败,请稍后重试')
|
||||
errorDialog.value = { visible: true, message: error.message || '报名失败,请稍后重试' }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user