박현우

fully functional

...@@ -8,13 +8,39 @@ ...@@ -8,13 +8,39 @@
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 + <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>
14 </span> 31 </span>
15 </b-collapse> 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 +
39 + </b-collapse>
16 </div> 40 </div>
17 41
42 + <b-button v-b-toggle.collapse-team_combination variant="outline-primary">Best Team Combination</b-button>
43 + <b-collapse id="collapse-team_combination">
18 <div class="team"> 44 <div class="team">
19 <div class="team_summary"> 45 <div class="team_summary">
20 <div class="team_best"> 46 <div class="team_best">
...@@ -40,9 +66,38 @@ ...@@ -40,9 +66,38 @@
40 </b-container> 66 </b-container>
41 </b-collapse> 67 </b-collapse>
42 </div> 68 </div>
69 + </b-collapse>
43 70
44 - <div class="myPick"> 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>
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>
45 </div> 97 </div>
98 + </b-collapse>
99 +
100 +
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 }
......