123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281 |
- <template>
- <div :class="classes">
- <div class="student-video" title="点击放大播放" @click="toLargeView">
- <flv-media
- ref="ThirdViewVideo"
- :live-url="data.liveUrl"
- v-if="data.liveUrl"
- ></flv-media>
- </div>
- <div class="student-info">
- <div class="student-info-header">
- <h6 class="student-info-name">
- <span>{{ data.name }}</span
- ><i class="icon icon-net-break"></i>
- </h6>
- <div class="student-info-tips">
- <div
- :class="['student-info-audio', { 'is-active': !this.muted }]"
- @click="toMuted"
- >
- <i class="icon icon-audio"></i>
- </div>
- <div class="student-info-time">
- <i class="icon icon-alarm-clock"></i>
- <span>{{ data.remainTime }}</span>
- </div>
- </div>
- </div>
- <div class="student-info-body">
- <div class="student-info-content">
- <p>证件号:{{ data.identity }}</p>
- <p>答题进度:{{ data.progress || 0 }}%</p>
- </div>
- <div class="student-info-detail">
- <el-button type="primary" size="mini" round @click="toDetail"
- >详情</el-button
- >
- </div>
- </div>
- </div>
- <!-- InvigilationStudentMediaDialog -->
- <InvigilationStudentMediaDialog
- ref="InvigilationStudentMediaDialog"
- :data="data"
- destroy-on-close
- @close="dialogClose"
- />
- </div>
- </template>
- <script>
- import FlvMedia from "./FlvMedia";
- import InvigilationStudentMediaDialog from "./InvigilationStudentMediaDialog.vue";
- export default {
- name: "invigilation-student",
- components: { FlvMedia, InvigilationStudentMediaDialog },
- props: {
- data: {
- type: Object,
- default() {
- return {};
- },
- },
- },
- data() {
- return {
- muted: true,
- };
- },
- computed: {
- classes() {
- return [
- "invigilation-student",
- {
- "invigilation-student-breach": !this.data.breachStatus,
- "invigilation-student-netbreak": this.data.statusCode === "BREAK_OFF",
- },
- ];
- },
- },
- methods: {
- toDetail() {
- this.$router.push({
- name: "WarningDetail",
- params: { recordId: this.data.examRecordId },
- });
- },
- toLargeView() {
- this.muted = true;
- this.$emit("muted", false);
- this.$refs.ThirdViewVideo.destroyPlayer();
- this.$refs.InvigilationStudentMediaDialog.open();
- },
- toMuted() {
- console.log(this.muted);
- const nextMuted = !this.muted;
- this.$emit("muted", nextMuted);
- const res = this.mutedPlayer(nextMuted);
- if (res) this.muted = nextMuted;
- },
- mutedPlayer(muted) {
- return this.$refs.ThirdViewVideo.mutedPlayer(muted);
- },
- dialogClose() {
- this.$refs.ThirdViewVideo.reloadVideo();
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .invigilation-student {
- padding: 10px;
- position: relative;
- margin-bottom: 20px;
- border: 1px solid #f0f4f9;
- border-radius: 10px;
- &-breach {
- &::before {
- content: "";
- display: block;
- position: absolute;
- top: 0;
- left: 0;
- width: 50px;
- height: 50px;
- background-image: url(../../../assets/bg-discipline.png);
- background-size: 100% 100%;
- z-index: 99;
- }
- &::after {
- content: "";
- display: block;
- position: absolute;
- top: 4px;
- right: 4px;
- width: 12px;
- height: 12px;
- border: 2px solid #fff;
- border-radius: 50%;
- background: #fe5863;
- z-index: 99;
- }
- }
- &-netbreak {
- .icon-net-break {
- display: inline-block !important;
- }
- .student-time {
- background-color: #fe5863 !important;
- }
- }
- &-none {
- height: 100%;
- background: #606060;
- border-radius: 6px;
- font-size: 50px;
- text-align: center;
- padding-top: 90px;
- color: #202b4b;
- }
- }
- .student-video {
- height: 150px;
- border-radius: 6px;
- background: #626a82;
- margin-bottom: 15px;
- position: relative;
- cursor: pointer;
- // &::before {
- // content: "";
- // display: block;
- // position: absolute;
- // top: 50%;
- // left: 50%;
- // width: 32px;
- // height: 20px;
- // margin-left: -16px;
- // margin-top: -10px;
- // background-image: url(../../../assets/icon-video.png);
- // background-size: 100% 100%;
- // }
- }
- .student-info {
- position: relative;
- padding: 0 10px 10px;
- &-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 5px;
- }
- &-audio {
- display: inline-block;
- vertical-align: middle;
- width: 24px;
- height: 24px;
- text-align: center;
- line-height: 24px;
- background: #abb8c9;
- border-radius: 50%;
- margin-right: 5px;
- cursor: pointer;
- &:hover {
- background: #1886fe;
- }
- &.is-active {
- background: #1886fe;
- }
- .icon {
- width: 14px;
- height: 12px;
- margin-top: -2px;
- }
- }
- &-time {
- display: inline-block;
- vertical-align: middle;
- height: 24px;
- padding: 4px 12px;
- border-radius: 12px;
- background: #abb8c9;
- color: #fff;
- line-height: 16px;
- font-size: 12px;
- > i {
- margin-right: 5px;
- width: 12px;
- height: 12px;
- }
- > span {
- display: inline-block;
- vertical-align: middle;
- }
- }
- &-name {
- font-size: 18px;
- margin-bottom: 0;
- > .icon {
- margin-top: -4px;
- margin-left: 8px;
- display: none;
- }
- }
- &-body {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- &-content {
- flex-grow: 2;
- overflow: hidden;
- > p {
- font-size: 14px;
- font-weight: 400;
- color: #626a82;
- line-height: 20px;
- margin: 0;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
- &-detail {
- margin-left: 5px;
- flex-grow: 0;
- flex-shrink: 0;
- }
- }
- </style>
|