fix: BUG修改

This commit is contained in:
kun 2023-06-21 16:13:54 +08:00
parent 422824d7e1
commit fd4b04dff7
3 changed files with 31 additions and 13 deletions

View File

@ -52,7 +52,8 @@
<div class="imgPage">
<div class="imgTable" v-if="videoData.records.length">
<div class="img_item" v-for="item in videoData.records" :key="item.id">
<el-image style="width: 100%; height: 182px" :src="item.videoUrl" fit="fill" />
<!-- <el-image style="width: 100%; height: 182px" :src="item.videoUrl" fit="fill" /> -->
<video style="width: 100%; height: 182px; object-fit: fill" controls :src="item.videoUrl"></video>
<div class="page_text flx-justify-column">
<div class="img_title">
<span>{{ item.title }}</span>
@ -118,6 +119,7 @@
multiple
:limit="1"
:on-success="uploadSuccess"
:before-upload="beforeUpload"
style="width: 100%"
>
<el-button class="uploadBtn" type="primary">点击上传</el-button>
@ -234,6 +236,16 @@ const searchSn = ref("");
//
const searchName = ref<string>("");
//
const beforeUpload = file => {
console.log(file);
const type = file.type;
if (type != "video/mp4") {
ElMessage.error("请上传视频文件");
return false;
}
};
// div
const onSearch = async (params: ResAiProjectPage | ResAiEngineerPage) => {
const { result } = await getUnmannedPage(

View File

@ -193,7 +193,7 @@
width: 200px;
}
// 表单
:deep(.el-form) {
:deep() {
.el-form-item__content > :not(button) {
width: 160px;
}

View File

@ -29,7 +29,8 @@
<div class="imgPage">
<div class="imgTable" v-if="videoData.records.length">
<div class="img_item" v-for="item in videoData.records" :key="item.id">
<el-image style="width: 100%; height: 182px" :src="item.videoUrl" fit="fill" />
<!-- <el-image style="width: 100%; height: 182px" :src="item.videoUrl" fit="fill" /> -->
<video style="width: 100%; height: 182px; object-fit: fill" controls :src="item.videoUrl"></video>
<div class="page_text flx-justify-column">
<div class="img_title">
<span>{{ item.title }}</span>
@ -94,6 +95,7 @@
multiple
:limit="1"
:on-success="uploadSuccess"
:before-upload="beforeUpload"
style="width: 100%"
>
<el-button class="uploadBtn" type="primary">点击上传</el-button>
@ -193,6 +195,15 @@ const form = ref({
startTime: "",
endTime: ""
});
//
const beforeUpload = file => {
console.log(file);
const type = file.type;
if (type != "video/mp4") {
ElMessage.error("请上传视频文件");
return false;
}
};
//
const deleteAccount = async (params: jxj_User.ResUserList) => {
await useHandleData(videoDataDelete, { id: params.id }, `删除`);
@ -206,7 +217,9 @@ const handleEditItem = (index: number, row: any) => {
title.value = "编辑录像";
formData.value = { ...row };
console.log(formData.value);
fileList.value = reactive([{ name: "文件", url: row.videoUrl }]);
if (row.videoUrl) {
fileList.value = reactive([{ name: "文件", url: row.videoUrl }]);
}
visible.value = true;
};
const getVideoData = async () => {
@ -215,18 +228,10 @@ const getVideoData = async () => {
console.log(videoData.value);
console.log(res);
};
const handleExceed: UploadProps["onExceed"] = files => {
// console.log(1111);
// upload.value!.clearFiles();
// const file = files[0] as UploadRawFile;
// file.uid = genFileId();
// // fileList.value = file;
// upload.value!.handleStart(file);
// upload.value?.submit();
};
const uploadSuccess = (response: any) => {
ElMessage.success("上传成功");
console.log(response.result);
formData.value.videoUrl = response.result.url;
fileList.value = [{ name: response.result.originalFilename, url: response.result.downloadPath }];
};
@ -247,6 +252,7 @@ const addVideoData = () => {
visible.value = true;
};
const confirm = async (formEl: FormInstance | undefined, form: any) => {
console.log(form);
//
if (!formEl) return;
await formEl.validate(async (valid, fields) => {