|
@@ -0,0 +1,162 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="activity-audio-management">
|
|
|
|
+ <div class="part-box-head">
|
|
|
|
+ <div class="part-box-head-left">
|
|
|
|
+ <h1>
|
|
|
|
+ 语音播报
|
|
|
|
+ <span v-if="examInfo"
|
|
|
|
+ >-- {{ examInfo.examName }}({{ examInfo.examCode }}) --
|
|
|
|
+ 场次代码({{ examInfo.activityCode }})</span
|
|
|
|
+ >
|
|
|
|
+ </h1>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="part-box-head-right">
|
|
|
|
+ <el-button type="primary" @click="handleCurrentChange(0)"
|
|
|
|
+ >查询</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button type="primary" icon="icon icon-add" @click="add"
|
|
|
|
+ >新增</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button type="primary" icon="el-icon-back" @click="$router.back()"
|
|
|
|
+ >返回</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <el-table :data="tableData">
|
|
|
|
+ <el-table-column width="100" prop="id" label="ID"> </el-table-column>
|
|
|
|
+ <el-table-column label="语音内容">
|
|
|
|
+ <span slot-scope="scope">{{ scope.row.content }}</span>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="播报时间">
|
|
|
|
+ <span slot-scope="scope">{{ scope.row.type }}</span>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column width="80" label="状态">
|
|
|
|
+ <span slot-scope="scope">{{
|
|
|
|
+ scope.row.enable | zeroOneEnableDisableFilter
|
|
|
|
+ }}</span>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column width="100" label="语音">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <audio :src="scope.row.attachmentPath"></audio>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column width="120" label="操作人">
|
|
|
|
+ <span slot-scope="scope">{{ scope.row.updateName }}</span>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column sortable width="170" label="更新时间">
|
|
|
|
+ <span slot-scope="scope">{{
|
|
|
|
+ scope.row.updateTime | datetimeFilter
|
|
|
|
+ }}</span>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column :context="_self" label="操作" width="210" fixed="right">
|
|
|
|
+ <div slot-scope="scope">
|
|
|
|
+ <el-button size="mini" type="primary" plain @click="edit(scope.row)">
|
|
|
|
+ 编辑
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ @click="enableAudio(scope.row)"
|
|
|
|
+ >
|
|
|
|
+ {{ !scope.row.enable | booleanEnableDisableFilter }}
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ <div class="part-page">
|
|
|
|
+ <el-pagination
|
|
|
|
+ background
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
|
+ :current-page="currentPage"
|
|
|
|
+ :page-size="pageSize"
|
|
|
|
+ :page-sizes="[10, 20, 50, 100, 200, 300]"
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
+ :total="total"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <ActivityAudioDialog
|
|
|
|
+ ref="ActivityAudioDialog"
|
|
|
|
+ :activity="selectedAudio"
|
|
|
|
+ @reload="searchForm"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import {
|
|
|
|
+ searchActivityAudios,
|
|
|
|
+ toggleEnableActivityAudio,
|
|
|
|
+} from "@/api/examwork-activity";
|
|
|
|
+import ActivityAudioDialog from "./ActivityAudioDialog";
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ name: "ActivityAudioManagement",
|
|
|
|
+ components: {
|
|
|
|
+ ActivityAudioDialog,
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ activityId() {
|
|
|
|
+ return this.$route.params.activityId;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ examInfo: null,
|
|
|
|
+ tableData: [],
|
|
|
|
+ currentPage: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ total: 10,
|
|
|
|
+ selectedAudio: {},
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ async created() {
|
|
|
|
+ const examInfo = window.sessionStorage.getItem("examInfo");
|
|
|
|
+ this.examInfo = examInfo ? JSON.parse(examInfo) : null;
|
|
|
|
+ this.searchForm();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ async searchForm() {
|
|
|
|
+ const res = await searchActivityAudios({
|
|
|
|
+ activityId: this.activityId,
|
|
|
|
+ pageNumber: this.currentPage,
|
|
|
|
+ pageSize: this.pageSize,
|
|
|
|
+ });
|
|
|
|
+ this.tableData = res.data.data.records;
|
|
|
|
+ this.total = res.data.data.total;
|
|
|
|
+ if (this.total > 0 && this.tableData.length === 0) {
|
|
|
|
+ this.handleCurrentChange(this.currentPage - 1);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleCurrentChange(val) {
|
|
|
|
+ this.currentPage = val;
|
|
|
|
+ this.searchForm();
|
|
|
|
+ },
|
|
|
|
+ handleSizeChange(val) {
|
|
|
|
+ this.pageSize = val;
|
|
|
|
+ this.currentPage = 1;
|
|
|
|
+ this.searchForm();
|
|
|
|
+ },
|
|
|
|
+ add() {
|
|
|
|
+ this.selectedAudio = {
|
|
|
|
+ activityId: this.activityId,
|
|
|
|
+ };
|
|
|
|
+ this.$refs.ActivityAudioDialog.openDialog();
|
|
|
|
+ },
|
|
|
|
+ edit(row) {
|
|
|
|
+ this.selectedAudio = row;
|
|
|
|
+ this.$refs.ActivityAudioDialog.openDialog();
|
|
|
|
+ },
|
|
|
|
+ async enableAudio(row) {
|
|
|
|
+ await toggleEnableActivityAudio({
|
|
|
|
+ audioId: row.id,
|
|
|
|
+ enable: row.enable === 0 ? 1 : 0,
|
|
|
|
+ });
|
|
|
|
+ this.searchForm();
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|