fix vote page

This commit is contained in:
nurafrinaalimi16
2024-04-23 22:08:43 +08:00
parent e6ecfb9c7c
commit 38840174b2
@@ -12,18 +12,11 @@
<b> - {{ getSelectedNomineeName(nominee_id) }}</b> <b> - {{ getSelectedNomineeName(nominee_id) }}</b>
</li> </li>
</ul> </ul>
<ul class="list-group">
<li class="list-group-item" v-for="nominee_id in selected[0].nominee_id">
<b> - {{ getSelectedNomineeName(nominee_id) }}</b>
</li>
</ul>
<li class="list-group-item"> <li class="list-group-item">
<center> <center>
<button class="btn btn-success" @click="util.showModal('#vote-modal')">Hantar</button> <button class="btn btn-success" @click="util.showModal('#vote-modal')">Hantar</button>
<!-- <button class="btn btn-default" @click="reset()">Reset</button> --> <!-- <button class="btn btn-default" @click="reset()">Reset</button> -->
<button class="btn btn-success" @click="util.showModal('#vote-modal')">Hantar</button>
<!-- <button class="btn btn-default" @click="reset()">Reset</button> -->
</center> </center>
</li> </li>
</ul> </ul>
@@ -44,9 +37,6 @@
<th>Bil.</th> <th>Bil.</th>
<th></th> <th></th>
<th>Nama</th> <th>Nama</th>
<th>Bil.</th>
<th></th>
<th>Nama</th>
<th>Unit</th> <th>Unit</th>
</tr> </tr>
</thead> </thead>
@@ -59,10 +49,6 @@
<td><img @click="view(i)" :src="createBase64ImageUrl(nominee.photo)" class="thumbnail" <td><img @click="view(i)" :src="createBase64ImageUrl(nominee.photo)" class="thumbnail"
style="height: 60px;width: 60px;" /> style="height: 60px;width: 60px;" />
</td> </td>
<td>{{ nominee.no_calon }}</td>
<td><img @click="view(i)" :src="createBase64ImageUrl(nominee.photo)" class="thumbnail"
style="height: 60px;width: 60px;" />
</td>
<td>{{ nominee.name }}</td> <td>{{ nominee.name }}</td>
<td>{{ nominee.unit }}</td> <td>{{ nominee.unit }}</td>
</tr> </tr>
@@ -77,7 +63,6 @@
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel"></h5>
<h5 class="modal-title" id="exampleModalLabel"></h5> <h5 class="modal-title" id="exampleModalLabel"></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
@@ -85,13 +70,10 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<h5>Nota: Sila pastikan anda telah membuat undian dengan betul.</h5> <h5>Nota: Sila pastikan anda telah membuat undian dengan betul.</h5>
<h5>Nota: Sila pastikan anda telah membuat undian dengan betul.</h5>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button> <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="button" class="btn btn-primary" @click="submit()">Hantar</button> <button type="button" class="btn btn-primary" @click="submit()">Hantar</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="button" class="btn btn-primary" @click="submit()">Hantar</button>
</div> </div>
</div> </div>
</div> </div>
@@ -152,7 +134,6 @@ export default {
vm.data.result = response.data.result; vm.data.result = response.data.result;
vm.$router.push({ name: 'Voter Home' }); vm.$router.push({ name: 'Voter Home' });
$('.modal').modal('hide'); $('.modal').modal('hide');
$('.modal').modal('hide');
} }
}) })
.catch(error => { .catch(error => {
@@ -200,11 +181,9 @@ export default {
console.log(this.selected[0]) console.log(this.selected[0])
}, },
getSelectedNomineeName: function (id) {
getSelectedNomineeName: function (id) { getSelectedNomineeName: function (id) {
return this.getNominee(id); return this.getNominee(id);
}, },
},
getName: function (id) { getName: function (id) {
let positions = this.data.positions; let positions = this.data.positions;
@@ -221,7 +200,6 @@ export default {
let nominees = this.data.nominees; let nominees = this.data.nominees;
for (var i in nominees) for (var i in nominees)
if (nominees[i]['id'] == id) return nominees[i].name; if (nominees[i]['id'] == id) return nominees[i].name;
if (nominees[i]['id'] == id) return nominees[i].name;
return ''; return '';
}, },
@@ -247,15 +225,6 @@ export default {
return "data:image/png;base64," + base64ImageData; return "data:image/png;base64," + base64ImageData;
} }
view: function (index) {
this.x = this.data.nominees[index];
this.util.showModal('#nominee-information-modal');
},
createBase64ImageUrl: function (base64ImageData) {
return "data:image/png;base64," + base64ImageData;
}
// uncheck: function (checkedName) { // uncheck: function (checkedName) {
// this.checkedName = this.checkedNames.filter(name => name !== checkedName); // this.checkedName = this.checkedNames.filter(name => name !== checkedName);
// } // }