Showing
1 changed file
with
96 additions
and
29 deletions
| ... | @@ -8,41 +8,96 @@ | ... | @@ -8,41 +8,96 @@ |
| 8 | <div class="assist"> | 8 | <div class="assist"> |
| 9 | <b-button v-b-toggle.collapse-predict variant="outline-primary">Pick Assistant</b-button> | 9 | <b-button v-b-toggle.collapse-predict variant="outline-primary">Pick Assistant</b-button> |
| 10 | <b-collapse id="collapse-predict"> | 10 | <b-collapse id="collapse-predict"> |
| 11 | - <h1>the world of sound</h1> | 11 | + |
| 12 | - <span v-for="champion in championList"> | 12 | + <b-button v-b-toggle.collapse-team variant="outline-primary">Team</b-button> |
| 13 | - <img v-bind:src="splashLoader(champion)"> | 13 | + <b-collapse id="collapse-team"> |
| 14 | - </span> | 14 | + <h1>Team Combination</h1> |
| 15 | + <h1 v-if="teamData">{{ teamData }}</h1> | ||
| 16 | + <span v-for="championId in championList"> | ||
| 17 | + <button v-on:click="inputTeamData(championId)"> | ||
| 18 | + <img v-bind:src="splashLoader(championId)"> | ||
| 19 | + </button> | ||
| 20 | + </span> | ||
| 21 | + </b-collapse> | ||
| 22 | + | ||
| 23 | + <b-button v-b-toggle.collapse-enemy variant="outline-primary">Enemy</b-button> | ||
| 24 | + <b-collapse id="collapse-enemy"> | ||
| 25 | + <h1>Enemy Combination</h1> | ||
| 26 | + <h1 v-if="enemyData">{{ enemyData }}</h1> | ||
| 27 | + <span v-for="championId in championList"> | ||
| 28 | + <button v-on:click="inputEnemyData(championId)"> | ||
| 29 | + <img v-bind:src="splashLoader(championId)"> | ||
| 30 | + </button> | ||
| 31 | + </span> | ||
| 32 | + </b-collapse> | ||
| 33 | + | ||
| 34 | + <b-button v-on:click="makePredict(userPk)">Predict</b-button> | ||
| 35 | + <div v-for="result in predictResult"> | ||
| 36 | + <b-card :title="nameTranslator(result['champion'])" :img-src="splashLoader(result['champion'])"></b-card> | ||
| 37 | + </div> | ||
| 38 | + | ||
| 15 | </b-collapse> | 39 | </b-collapse> |
| 16 | </div> | 40 | </div> |
| 17 | 41 | ||
| 18 | - <div class="team"> | 42 | + <b-button v-b-toggle.collapse-team_combination variant="outline-primary">Best Team Combination</b-button> |
| 19 | - <div class="team_summary"> | 43 | + <b-collapse id="collapse-team_combination"> |
| 20 | - <div class="team_best"> | 44 | + <div class="team"> |
| 21 | - <h1>Best : {{ nameTranslator(inference_team[0]['id']) }}</h1> | 45 | + <div class="team_summary"> |
| 22 | - <img v-bind:src="splashLoader(inference_team[0]['id'])"> | 46 | + <div class="team_best"> |
| 47 | + <h1>Best : {{ nameTranslator(inference_team[0]['id']) }}</h1> | ||
| 48 | + <img v-bind:src="splashLoader(inference_team[0]['id'])"> | ||
| 49 | + </div> | ||
| 50 | + <div class="team_worst"> | ||
| 51 | + <h1>Worst {{ nameTranslator(inference_team[inference_team.length - 1]['id']) }}</h1> | ||
| 52 | + <img v-bind:src="splashLoader(inference_team[inference_team.length - 1]['id'])"> | ||
| 53 | + </div> | ||
| 23 | </div> | 54 | </div> |
| 24 | - <div class="team_worst"> | 55 | + <b-button v-b-toggle.collapse-1 variant="primary">More</b-button> |
| 25 | - <h1>Worst {{ nameTranslator(inference_team[inference_team.length - 1]['id']) }}</h1> | 56 | + <b-collapse id="collapse-1"> |
| 26 | - <img v-bind:src="splashLoader(inference_team[inference_team.length - 1]['id'])"> | 57 | + <b-container fluid class="wrap"> |
| 58 | + <b-row class="items flex-row flex-nowrap"> | ||
| 59 | + <template v-for="team, index in inference_team"> | ||
| 60 | + <b-card class="card"> | ||
| 61 | + <img v-bind:src="splashLoader(team['id'])"> | ||
| 62 | + <h3>{{ index + 1 }}. {{ nameTranslator(team['id']) }}</h3> | ||
| 63 | + </b-card> | ||
| 64 | + </template> | ||
| 65 | + </b-row> | ||
| 66 | + </b-container> | ||
| 67 | + </b-collapse> | ||
| 68 | + </div> | ||
| 69 | + </b-collapse> | ||
| 70 | + | ||
| 71 | + <b-button v-b-toggle.collapse-enemy_combination variant="outline-primary">Best Enemy Counterpart</b-button> | ||
| 72 | + <b-collapse id="collapse-enemy_combination"> | ||
| 73 | + <div class="enemy"> | ||
| 74 | + <div class="enemy_summary"> | ||
| 75 | + <div class="enemy_best"> | ||
| 76 | + <h1>Best : {{ nameTranslator(inference_enemy[0]['id']) }}</h1> | ||
| 77 | + <img v-bind:src="splashLoader(inference_enemy[0]['id'])"> | ||
| 78 | + </div> | ||
| 79 | + <div class="enemy_worst"> | ||
| 80 | + <h1>Worst {{ nameTranslator(inference_enemy[inference_enemy.length - 1]['id']) }}</h1> | ||
| 81 | + <img v-bind:src="splashLoader(inference_enemy[inference_enemy.length - 1]['id'])"> | ||
| 82 | + </div> | ||
| 27 | </div> | 83 | </div> |
| 84 | + <b-button v-b-toggle.collapse-1 variant="primary">More</b-button> | ||
| 85 | + <b-collapse id="collapse-1"> | ||
| 86 | + <b-container fluid class="wrap"> | ||
| 87 | + <b-row class="items flex-row flex-nowrap"> | ||
| 88 | + <template v-for="enemy, index in inference_enemy"> | ||
| 89 | + <b-card class="card"> | ||
| 90 | + <img v-bind:src="splashLoader(enemy['id'])"> | ||
| 91 | + <h3>{{ index + 1 }}. {{ nameTranslator(enemy['id']) }}</h3> | ||
| 92 | + </b-card> | ||
| 93 | + </template> | ||
| 94 | + </b-row> | ||
| 95 | + </b-container> | ||
| 96 | + </b-collapse> | ||
| 28 | </div> | 97 | </div> |
| 29 | - <b-button v-b-toggle.collapse-1 variant="primary">More</b-button> | 98 | + </b-collapse> |
| 30 | - <b-collapse id="collapse-1"> | 99 | + |
| 31 | - <b-container fluid class="wrap"> | ||
| 32 | - <b-row class="items flex-row flex-nowrap"> | ||
| 33 | - <template v-for="team, index in inference_team"> | ||
| 34 | - <b-card class="card"> | ||
| 35 | - <img v-bind:src="splashLoader(team['id'])"> | ||
| 36 | - <h3>{{ index + 1 }}. {{ nameTranslator(team['id']) }}</h3> | ||
| 37 | - </b-card> | ||
| 38 | - </template> | ||
| 39 | - </b-row> | ||
| 40 | - </b-container> | ||
| 41 | - </b-collapse> | ||
| 42 | - </div> | ||
| 43 | 100 | ||
| 44 | - <div class="myPick"> | ||
| 45 | - </div> | ||
| 46 | </div> | 101 | </div> |
| 47 | </div> | 102 | </div> |
| 48 | </template> | 103 | </template> |
| ... | @@ -61,7 +116,10 @@ export default { | ... | @@ -61,7 +116,10 @@ export default { |
| 61 | inference_secondary: [], | 116 | inference_secondary: [], |
| 62 | myPick: [], | 117 | myPick: [], |
| 63 | splash: [], | 118 | splash: [], |
| 64 | - championList: Array.from(Array(145).keys()) | 119 | + championList: Array.from(Array(145).keys()), |
| 120 | + teamData: [], | ||
| 121 | + enemyData: [], | ||
| 122 | + predictResult: {} | ||
| 65 | } | 123 | } |
| 66 | }, | 124 | }, |
| 67 | created () { | 125 | created () { |
| ... | @@ -97,6 +155,15 @@ export default { | ... | @@ -97,6 +155,15 @@ export default { |
| 97 | splashLoader: function (championId) { | 155 | splashLoader: function (championId) { |
| 98 | const path = require('../assets/splash/' + String(championId) + '.png') | 156 | const path = require('../assets/splash/' + String(championId) + '.png') |
| 99 | return path | 157 | return path |
| 158 | + }, | ||
| 159 | + inputTeamData: function (championId) { this.teamData.push(championId) }, | ||
| 160 | + inputEnemyData: function (championId) { this.enemyData.push(championId) }, | ||
| 161 | + makePredict: function (pk) { | ||
| 162 | + this.axios.post('http://127.0.0.1:8000/GameData/' + String(pk) + '/predict/', { team: this.teamData, enemy: this.enemyData }) | ||
| 163 | + .then((response) => { | ||
| 164 | + console.log(response.data) | ||
| 165 | + this.predictResult = response.data | ||
| 166 | + }) | ||
| 100 | } | 167 | } |
| 101 | } | 168 | } |
| 102 | } | 169 | } | ... | ... |
-
Please register or login to post a comment