delete: 注释语音交互的导出

This commit is contained in:
zhanghao 2025-10-15 16:23:28 +08:00
parent de09c4cef9
commit e7986ec2eb
5 changed files with 59 additions and 23 deletions

View File

@ -95,7 +95,7 @@
>删除</el-button >删除</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
plain plain
@ -104,7 +104,7 @@
v-hasPermi="['vi:corpus:export']" v-hasPermi="['vi:corpus:export']"
>导出</el-button >导出</el-button
> >
</el-col> </el-col> -->
<right-toolbar <right-toolbar
v-model:showSearch="showSearch" v-model:showSearch="showSearch"
@queryTable="getList" @queryTable="getList"

View File

@ -95,7 +95,7 @@
>删除</el-button >删除</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
plain plain
@ -104,7 +104,7 @@
v-hasPermi="['vi:corpus:export']" v-hasPermi="['vi:corpus:export']"
>导出</el-button >导出</el-button
> >
</el-col> </el-col> -->
<right-toolbar <right-toolbar
v-model:showSearch="showSearch" v-model:showSearch="showSearch"
@queryTable="getList" @queryTable="getList"
@ -148,14 +148,6 @@
v-hasPermi="['vi:corpus:remove']" v-hasPermi="['vi:corpus:remove']"
>删除</el-button >删除</el-button
> >
<el-button
link
type="primary"
icon="VideoPlay"
@click="handlePlay(row)"
v-hasPermi="['vi:corpus:play']"
>试听</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -170,7 +162,7 @@
</div> </div>
<!-- 添加或修改语料库对话框 --> <!-- 添加或修改语料库对话框 -->
<el-dialog :title="title" v-model="open" width="740px" append-to-body> <el-dialog :title="title" v-model="open" width="1000px" append-to-body>
<el-form <el-form
ref="corpusRef" ref="corpusRef"
:inline="true" :inline="true"
@ -233,6 +225,24 @@
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="minioUrl" label="音频地址">
<template #default="{ row, $index }">
<el-form-item
:prop="`tableData[${$index}].minioUrl`"
class="tableFormItem"
>
<el-tooltip
class="box-item"
effect="dark"
:content="row.minioUrl"
placement="top-start"
>
<span class="minioUrl" v-if="row.minioUrl">{{ row.minioUrl }}</span>
</el-tooltip>
<UploadFile @success="(data) => uploadSuccess(data, row)" @error="uploadError" />
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="audioPath" label="音频文件"> <el-table-column prop="audioPath" label="音频文件">
<template #default="{ row, $index }"> <template #default="{ row, $index }">
<el-form-item <el-form-item
@ -267,7 +277,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template #default="{ _row, $index }"> <template #default="{ row, $index }">
<el-button <el-button
:icon="Plus" :icon="Plus"
circle circle
@ -281,6 +291,13 @@
size="small" size="small"
@click="deleteRow($index)" @click="deleteRow($index)"
></el-button> ></el-button>
<el-button
circle
v-if="row.minioUrl"
size="small"
:icon="VideoPlay"
@click="handlePlay(row.minioUrl)"
></el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -296,7 +313,7 @@
</template> </template>
<script setup> <script setup>
import { Plus, Minus } from "@element-plus/icons-vue"; import { Plus, Minus, VideoPlay } from "@element-plus/icons-vue";
import { import {
getBatchCorpus, getBatchCorpus,
deleteBatchCorpus, deleteBatchCorpus,
@ -304,6 +321,8 @@ import {
batchUpdateCorpus, batchUpdateCorpus,
} from "@/api/vi/corpus"; } from "@/api/vi/corpus";
import { useContainerHeight } from "@/hooks/tableHeight"; import { useContainerHeight } from "@/hooks/tableHeight";
import UploadFile from "../../../components/UploadFile.vue";
import { usePlayAudio } from '@/hooks/usePlayAudio'
const topContainerRef = ref(); const topContainerRef = ref();
const containerHeight = useContainerHeight(topContainerRef); const containerHeight = useContainerHeight(topContainerRef);
@ -484,8 +503,17 @@ function handleDelete(row) {
.catch(() => {}); .catch(() => {});
} }
const handlePlay = () => { const uploadSuccess = (data, row) => {
console.log("播放"); row.minioUrl = data
}
const uploadError = () => {
console.log("uploadError")
}
const handlePlay = (url) => {
const { playAudio } = usePlayAudio()
playAudio(url)
}; };
/** 导出按钮操作 */ /** 导出按钮操作 */
@ -519,4 +547,12 @@ onMounted(() => {
.tableFormItem { .tableFormItem {
margin-bottom: 0; margin-bottom: 0;
} }
.minioUrl {
display: inline-block;
width: 50px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
</style> </style>

View File

@ -95,7 +95,7 @@
>删除</el-button >删除</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
plain plain
@ -104,7 +104,7 @@
v-hasPermi="['vi:corpus:export']" v-hasPermi="['vi:corpus:export']"
>导出</el-button >导出</el-button
> >
</el-col> </el-col> -->
<right-toolbar <right-toolbar
v-model:showSearch="showSearch" v-model:showSearch="showSearch"
@queryTable="getList" @queryTable="getList"

View File

@ -125,7 +125,7 @@
>删除</el-button >删除</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
plain plain
@ -135,7 +135,7 @@
v-hasPermi="['system:project:export']" v-hasPermi="['system:project:export']"
>导出</el-button >导出</el-button
> >
</el-col> </el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
</div> </div>

View File

@ -65,7 +65,7 @@
>删除</el-button >删除</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
plain plain
@ -74,7 +74,7 @@
v-hasPermi="['system:scheme:export']" v-hasPermi="['system:scheme:export']"
>导出</el-button >导出</el-button
> >
</el-col> </el-col> -->
<right-toolbar <right-toolbar
v-model:showSearch="showSearch" v-model:showSearch="showSearch"
@queryTable="getList" @queryTable="getList"