|
|
@@ -5,7 +5,7 @@
|
|
|
<b-row>
|
|
|
<b-col md="6">
|
|
|
<b-img
|
|
|
- :src="'/images/profile-picture/' + user.user_id + '.jpg'"
|
|
|
+ :src="avatar(user.user_id)"
|
|
|
blank-color="#ccc"
|
|
|
fluid
|
|
|
alt="placeholder"
|
|
|
@@ -36,18 +36,12 @@
|
|
|
報到狀態
|
|
|
</b-card-text>
|
|
|
<b-card-text>
|
|
|
- {{ checkin_status(user.is_checked_in) }}
|
|
|
+ {{ checkinStatus(user.is_checked_in) }}
|
|
|
</b-card-text>
|
|
|
</div>
|
|
|
</b-col>
|
|
|
</b-row>
|
|
|
- <div>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- </div>
|
|
|
+
|
|
|
|
|
|
</b-card>
|
|
|
</b-col>
|
|
|
@@ -77,59 +71,6 @@
|
|
|
|
|
|
</b-col>
|
|
|
</b-row>
|
|
|
- <!-- <b-row>
|
|
|
- <b-col md="6">
|
|
|
- <b-card title="報到人員" style="height: 65vh;">
|
|
|
- <b-media no-body>
|
|
|
- <b-media-aside>
|
|
|
- <b-img
|
|
|
- :src="'/images/profile-picture/' + user.user_id + '.jpg'"
|
|
|
- blank-color="#ccc"
|
|
|
- fluid
|
|
|
- alt="placeholder"
|
|
|
- style="width:42vh;"
|
|
|
- onerror="this.src='/images/error.png'" />
|
|
|
- </b-media-aside>
|
|
|
-
|
|
|
- <b-media-body class="ml-1" style="font-size: 2rem;">
|
|
|
- <h2 class="mt-1">
|
|
|
- 姓名
|
|
|
- </h2>
|
|
|
- <b-card-text>
|
|
|
- {{ user.name }}
|
|
|
- </b-card-text>
|
|
|
- <h2 class="mt-0">
|
|
|
- 工號
|
|
|
- </h2>
|
|
|
- <b-card-text>
|
|
|
- {{ user.user_id }}
|
|
|
- </b-card-text>
|
|
|
- <h2 class="mt-0">
|
|
|
- 部門
|
|
|
- </h2>
|
|
|
- <b-card-text>
|
|
|
- {{ user.department }}
|
|
|
- </b-card-text>
|
|
|
- </b-media-body>
|
|
|
-
|
|
|
- </b-media>
|
|
|
-
|
|
|
- </b-card>
|
|
|
- </b-col>
|
|
|
- <b-col md="6">
|
|
|
- <b-card title="報到輸入" style="height: 65vh;">
|
|
|
- <b-form-input v-model="input" @keydown.native="test_keydown_handler"></b-form-input>
|
|
|
- <br>
|
|
|
- <b-button
|
|
|
- v-ripple.400="'rgba(113, 102, 240, 0.15)'"
|
|
|
- variant="outline-primary"
|
|
|
- @click="showMsgBoxTwo">
|
|
|
- 報到
|
|
|
- </b-button>
|
|
|
- </b-card>
|
|
|
-
|
|
|
- </b-col>
|
|
|
- </b-row> -->
|
|
|
</template>
|
|
|
<script>
|
|
|
import { BRow, BCol, BCard, BCardText, BButton, BMedia, BFormInput, BImg, BMediaAside, BMediaBody, BInputGroup, BInputGroupAppend } from 'bootstrap-vue'
|
|
|
@@ -137,6 +78,7 @@ import Ripple from 'vue-ripple-directive'
|
|
|
import Pusher from 'pusher-js';
|
|
|
import useJwt from '@/auth/jwt/useJwt'
|
|
|
import ToastificationContent from '@core/components/toastification/ToastificationContent.vue'
|
|
|
+import { avatarText } from '@core/utils/filter';
|
|
|
|
|
|
export default {
|
|
|
name: "websocket",
|
|
|
@@ -199,7 +141,11 @@ export default {
|
|
|
searchData() {
|
|
|
useJwt.postData('/api/checkin/show', { 'user_id': this.input, 'activity_id': this.$route.params.activity_id }).then(response => {
|
|
|
console.log(response.data.user);
|
|
|
- this.user = response.data.user;
|
|
|
+ if (response.data.user) {
|
|
|
+ this.user = response.data.user;
|
|
|
+ } else {
|
|
|
+ this.user = { name: "查無此人", user_id: " ", department: " " };
|
|
|
+ }
|
|
|
this.input = "";
|
|
|
}).catch(error => {
|
|
|
console.log(error)
|
|
|
@@ -208,7 +154,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
showMsgBoxTwo() {
|
|
|
- this.user = {name: " ", user_id: " ", department: " " };
|
|
|
+ this.user = { name: " ", user_id: " ", department: " " };
|
|
|
},
|
|
|
showToast(variant) {
|
|
|
useJwt.postData('/api/check_in/update', { 'user_id': this.user.user_id }).then(response => {
|
|
|
@@ -229,11 +175,17 @@ export default {
|
|
|
|
|
|
|
|
|
},
|
|
|
- checkin_status(status) {
|
|
|
+ checkinStatus(status) {
|
|
|
|
|
|
return status == true ? "已經報到" : "尚未報到";
|
|
|
+ },
|
|
|
+ avatar(user_id) {
|
|
|
+ if (this.user && this.user.department == "來賓") {
|
|
|
+ return '/images/vip.jpg';
|
|
|
+ } else {
|
|
|
+ return '/images/profile-picture/' + user_id + '.jpg';
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
watch: {
|
|
|
|
|
|
@@ -245,6 +197,4 @@ export default {
|
|
|
|
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
-
|
|
|
-</style>
|
|
|
+<style></style>
|