|
@@ -26,6 +26,7 @@ import {
|
|
|
|
|
|
import customIndicatorDialog from '../dialog/customIndicatorDialog.vue'
|
|
|
import TableQueryForm from './TableQueryForm.vue'
|
|
|
+import VideoPreviewDialog from '@/components/dialog/VideoPreviewDialog.vue'
|
|
|
|
|
|
type TableQueryForm = InstanceType<typeof TableQueryForm>
|
|
|
type CustomIndicatorDialog = InstanceType<typeof customIndicatorDialog>
|
|
@@ -57,6 +58,14 @@ const customIndicatorDialogRef = ref<CustomIndicatorDialog>()
|
|
|
// 表格上方查询表单
|
|
|
const tableQueryFormRef = ref<TableQueryForm>()
|
|
|
|
|
|
+const videoDialogInfo = ref<{
|
|
|
+ visible: boolean
|
|
|
+ url: string
|
|
|
+}>({
|
|
|
+ visible: false,
|
|
|
+ url: '',
|
|
|
+})
|
|
|
+
|
|
|
// 当前滚动条是否固定状态,这个主要用于在给sizeOb使用
|
|
|
// 如果是固定状态,那么在表格大小改变的时候,left需要重置到表格的最左侧的left位置
|
|
|
// 如果不是,那么设为0即可
|
|
@@ -547,6 +556,22 @@ const batchDel = () => {
|
|
|
console.log('批量删除')
|
|
|
}
|
|
|
|
|
|
+const getPreviewSrcList = (type: TableFieldType, src: string) => {
|
|
|
+ if (type === TableFieldType.Video) return []
|
|
|
+ return [src]
|
|
|
+}
|
|
|
+
|
|
|
+const handlePreview = (type: TableFieldType, row: any) => {
|
|
|
+ if (type === TableFieldType.Img) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ videoDialogInfo.value.visible = true
|
|
|
+ videoDialogInfo.value = {
|
|
|
+ visible: true,
|
|
|
+ url: row['download'],
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
onUnmounted(() => {
|
|
|
cleanup()
|
|
|
})
|
|
@@ -575,7 +600,7 @@ defineExpose({
|
|
|
>添加账户
|
|
|
</el-button>
|
|
|
</slot>
|
|
|
- <el-button class="w120">批量操作</el-button>
|
|
|
+ <!-- <el-button class="w120">批量操作</el-button>-->
|
|
|
</div>
|
|
|
<div class="tableOperationRight">
|
|
|
<slot name="exportData" v-if="props.needExport">
|
|
@@ -650,6 +675,12 @@ defineExpose({
|
|
|
width="55"
|
|
|
:fixed="true"
|
|
|
></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="序号"
|
|
|
+ type="index"
|
|
|
+ width="55"
|
|
|
+ :fixed="true"
|
|
|
+ ></el-table-column>
|
|
|
<template v-for="item in tableFieldsInfo" :key="item.name">
|
|
|
<el-table-column
|
|
|
v-if="item.name === 'action'"
|
|
@@ -690,11 +721,15 @@ defineExpose({
|
|
|
item.type === TableFieldType.Video
|
|
|
"
|
|
|
>
|
|
|
+ <!-- :preview-src-list="[scope.row[item.name]]"-->
|
|
|
<el-image
|
|
|
class="tableFieldImg"
|
|
|
- :preview-src-list="[scope.row[item.name]]"
|
|
|
:src="scope.row[item.name]"
|
|
|
:preview-teleported="true"
|
|
|
+ :preview-src-list="
|
|
|
+ getPreviewSrcList(item.type, scope.row[item.name])
|
|
|
+ "
|
|
|
+ @click="handlePreview(item.type, scope.row)"
|
|
|
>
|
|
|
<template #error>
|
|
|
<el-image
|
|
@@ -764,6 +799,10 @@ defineExpose({
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
+ <video-preview-dialog
|
|
|
+ v-model:video-url="videoDialogInfo.url"
|
|
|
+ v-model="videoDialogInfo.visible"
|
|
|
+ ></video-preview-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|