|
@@ -3,9 +3,9 @@
|
|
|
<ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listVideo2imageApi">
|
|
|
<!-- 表格 header 按钮 -->
|
|
|
<template #tableHeader="scope">
|
|
|
- <el-button type="primary" v-auth="['demo:video2image:add']" icon="CirclePlus" @click="openDialog(1, '视频转图片新增')"> 新增 </el-button>
|
|
|
- <el-button type="primary" v-auth="['demo:video2image:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
|
|
|
- <el-button type="primary" v-auth="['demo:video2image:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
|
|
|
+ <el-button type="primary" v-auth="['demo:video2image:add']" icon="CirclePlus" @click="openDialog(1, '新增')"> 新增 </el-button>
|
|
|
+ <el-button type="primary" v-auth="['demo:video2image:import']" icon="Upload" plain @click="batchAdd" v-if="false"> 导入 </el-button>
|
|
|
+ <el-button type="primary" v-auth="['demo:video2image:export']" icon="Download" plain @click="downloadFile" v-if="false"> 导出 </el-button>
|
|
|
<el-button
|
|
|
type="danger"
|
|
|
v-auth="['demo:video2image:remove']"
|
|
@@ -19,17 +19,16 @@
|
|
|
</template>
|
|
|
<!-- 表格操作 -->
|
|
|
<template #operation="scope">
|
|
|
- <el-button type="primary" link icon="View" v-auth="['demo:video2image:query']" @click="openDialog(3, '视频转图片查看', scope.row)">
|
|
|
- 查看
|
|
|
- </el-button>
|
|
|
- <el-button type="primary" link icon="EditPen" v-auth="['demo:video2image:edit']" @click="openDialog(2, '视频转图片编辑', scope.row)">
|
|
|
- 编辑
|
|
|
+ <el-button type="primary" link icon="View" v-auth="['demo:video2image:start']" @click="startVideo2image(scope.row)"> 图片提取 </el-button>
|
|
|
+ <el-button type="primary" link icon="View" v-auth="['demo:video2image:download']" @click="dowloadVideo2image(scope.row)">
|
|
|
+ 下载图片
|
|
|
</el-button>
|
|
|
+ <el-button type="primary" link icon="View" v-auth="['demo:video2image:query']" @click="openDialog(3, '查看', scope.row)"> 查看 </el-button>
|
|
|
+ <el-button type="primary" link icon="EditPen" v-auth="['demo:video2image:edit']" @click="openDialog(2, '编辑', scope.row)"> 编辑 </el-button>
|
|
|
<el-button type="primary" link icon="Delete" v-auth="['demo:video2image:remove']" @click="deleteVideo2image(scope.row)"> 删除 </el-button>
|
|
|
</template>
|
|
|
</ProTable>
|
|
|
- <FormDialog ref="formDialogRef" />
|
|
|
- <ImportExcel ref="dialogRef" />
|
|
|
+ <FormDialog ref="formDialogRef"> </FormDialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -37,7 +36,7 @@
|
|
|
import { ref, reactive } from 'vue'
|
|
|
import { useHandleData } from '@/hooks/useHandleData'
|
|
|
import { useDownload } from '@/hooks/useDownload'
|
|
|
-import { ElMessageBox } from 'element-plus'
|
|
|
+import { ElMessageBox, ElMessage } from 'element-plus'
|
|
|
import ProTable from '@/components/ProTable/index.vue'
|
|
|
import ImportExcel from '@/components/ImportExcel/index.vue'
|
|
|
import FormDialog from '@/components/FormDialog/index.vue'
|
|
@@ -50,8 +49,24 @@ import {
|
|
|
importTemplateApi,
|
|
|
importVideo2imageDataApi,
|
|
|
exportVideo2imageApi,
|
|
|
- getVideo2imageApi
|
|
|
+ getVideo2imageApi,
|
|
|
+ startVideo2imageApi,
|
|
|
+ downloadVideo2imageApi
|
|
|
} from '@/api/modules/demo/video2image'
|
|
|
+import FileUpload from '@/components/Upload/File.vue'
|
|
|
+
|
|
|
+const startVideo2image = async (params: any) => {
|
|
|
+ const res = await startVideo2imageApi(params.id)
|
|
|
+ if (res.code === 200) {
|
|
|
+ ElMessage.success('开始视频转图片已经开始,请等待完成!')
|
|
|
+ } else {
|
|
|
+ ElMessage.error('开始视频转图片开始失败,请检查!')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const dowloadVideo2image = async (params: any) => {
|
|
|
+ await useDownload(downloadVideo2imageApi, params.name, params.id, true, '.zip')
|
|
|
+}
|
|
|
|
|
|
// ProTable 实例
|
|
|
const proTable = ref<ProTableInstance>()
|
|
@@ -104,7 +119,8 @@ const openDialog = async (type: number, title: string, row?: any) => {
|
|
|
itemsOptions: itemsOptions,
|
|
|
model: type == 1 ? {} : res.data,
|
|
|
api: type == 1 ? addVideo2imageApi : updateVideo2imageApi,
|
|
|
- getTableList: proTable.value?.getTableList
|
|
|
+ getTableList: proTable.value?.getTableList,
|
|
|
+ showVideoUpload: true
|
|
|
}
|
|
|
formDialogRef.value?.openDialog(params)
|
|
|
}
|
|
@@ -209,62 +225,6 @@ const setItemsOptions = () => {
|
|
|
placeholder: '请输入视频名称'
|
|
|
}
|
|
|
},
|
|
|
- {
|
|
|
- label: '任务状态',
|
|
|
- prop: 'status',
|
|
|
- rules: [{ required: true, message: '任务状态不能为空', trigger: 'blur' }],
|
|
|
- compOptions: {
|
|
|
- placeholder: '请输入任务状态'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '切割好的图片的保存路径',
|
|
|
- prop: 'outPath',
|
|
|
- rules: [{ required: true, message: '切割好的图片的保存路径不能为空', trigger: 'blur' }],
|
|
|
- compOptions: {
|
|
|
- type: 'textarea',
|
|
|
- clearable: true,
|
|
|
- placeholder: '请输入内容'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '开始时间',
|
|
|
- prop: 'startTime',
|
|
|
- rules: [{ required: true, message: '开始时间不能为空', trigger: 'change' }],
|
|
|
- compOptions: {
|
|
|
- elTagName: 'date-picker',
|
|
|
- type: 'date',
|
|
|
- placeholder: '请选择开始时间'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '结束时间',
|
|
|
- prop: 'endTime',
|
|
|
- rules: [{ required: true, message: '结束时间不能为空', trigger: 'change' }],
|
|
|
- compOptions: {
|
|
|
- elTagName: 'date-picker',
|
|
|
- type: 'date',
|
|
|
- placeholder: '请选择结束时间'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '耗时',
|
|
|
- prop: 'costSecond',
|
|
|
- rules: [{ required: true, message: '耗时不能为空', trigger: 'blur' }],
|
|
|
- compOptions: {
|
|
|
- placeholder: '请输入耗时'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '日志',
|
|
|
- prop: 'log',
|
|
|
- rules: [{ required: true, message: '日志不能为空', trigger: 'blur' }],
|
|
|
- compOptions: {
|
|
|
- type: 'textarea',
|
|
|
- clearable: true,
|
|
|
- placeholder: '请输入内容'
|
|
|
- }
|
|
|
- },
|
|
|
{
|
|
|
label: '备注',
|
|
|
prop: 'remarks',
|
|
@@ -274,21 +234,25 @@ const setItemsOptions = () => {
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- label: '视频本身保存路径',
|
|
|
- prop: 'path',
|
|
|
- rules: [{ required: true, message: '视频本身保存路径不能为空', trigger: 'blur' }],
|
|
|
- compOptions: {
|
|
|
- placeholder: '请输入视频本身保存路径'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '切割帧率,默认1',
|
|
|
+ label: '切割帧率',
|
|
|
prop: 'fps',
|
|
|
- rules: [{ required: true, message: '切割帧率,默认1不能为空', trigger: 'blur' }],
|
|
|
+ rules: [
|
|
|
+ { required: true, message: '切割帧率不能为空', trigger: 'blur' }
|
|
|
+ // {
|
|
|
+ // type: 'number',
|
|
|
+ // message: '切割帧率必须为数字',
|
|
|
+ // trigger: 'blur'
|
|
|
+ // },
|
|
|
+ // { min: 1, message: '切割帧率必须大于等于1', trigger: 'blur' },
|
|
|
+ // { max: 60, message: '切割帧率必须小于等于60', trigger: 'blur' }
|
|
|
+ ],
|
|
|
compOptions: {
|
|
|
- placeholder: '请输入切割帧率,默认1'
|
|
|
+ type: 'number',
|
|
|
+ placeholder: '请输入切割帧率,范围:1-60'
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
</script>
|
|
|
+
|
|
|
+<style scoped></style>
|