Skip to content

Commit

Permalink
上传录像
Browse files Browse the repository at this point in the history
  • Loading branch information
putianyi889 committed May 27, 2024
1 parent 30b23f5 commit dfc76e3
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 54 deletions.
33 changes: 27 additions & 6 deletions front_end/src/i18n/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ export type LocaleConfig = LocaleMessage<VueMessageType> & {
noGuess: string,
recursive: string
}
time: string
prop: {
action: string,
designator: string,
fileName: string,
level: string,
status: string,
time: string,
}
},
forgetPassword: {
title: string,
Expand Down Expand Up @@ -72,7 +79,25 @@ export type LocaleConfig = LocaleMessage<VueMessageType> & {
modeRecord: string
}
videos: string,
upload: string
upload: {
title: string,
dragOrClick: string,
uploadAll: string,
cancelAll: string,
constraintNote: string,
error: {
collision: string,
custom: string,
designator: string,
fail: string,
fileext: string,
filename: string,
filesize: string,
pass: string,
process: string,
upload: string,
}
}
},
register: {
title: string,
Expand All @@ -87,8 +112,4 @@ export type LocaleConfig = LocaleMessage<VueMessageType> & {
termsAndConditions: string,
confirm: string
},
example: {
// 占位符配置示例 TODO 删除占位符配置示例
placeholder: string
}
}
33 changes: 29 additions & 4 deletions front_end/src/i18n/locales/dev.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//import { LocaleConfig } from '@/i18n/config'
import { LocaleConfig } from '@/i18n/config'

export const dev = {
export const dev: LocaleConfig = {
local: 'dev',
name: 'name',
common: {
Expand All @@ -15,7 +15,14 @@ export const dev = {
noGuess: 'common.mode.noGuess',
recursive: 'common.mode.recursive'
},
time: 'common.time'
prop: {
action: 'common.prop.action',
designator: 'common.prop.designator',
fileName: 'common.prop.fileName',
level: 'common.prop.level',
status: 'common.prop.status',
time: 'common.prop.time',
}
},
forgetPassword: {
title: 'forgetPassword.title',
Expand Down Expand Up @@ -66,7 +73,25 @@ export const dev = {
modeRecord: 'profile.records.modeRecord'
},
videos: 'profile.videos',
upload: 'profile.upload'
upload: {
title: 'profile.upload.title',
dragOrClick: 'profile.upload.dragOrClick',
uploadAll: 'profile.upload.uploadAll',
cancelAll: 'profile.upload.cancelAll',
constraintNote: 'profile.upload.constraintNote',
error: {
collision: 'profile.upload.error.collision',
custom: 'profile.upload.error.custom',
designator: 'profile.upload.error.designator',
fail: 'profile.upload.error.fail',
fileext: 'profile.upload.error.fileext',
filename: 'profile.upload.error.filename',
filesize: 'profile.upload.error.filesize',
pass: 'profile.upload.error.pass',
process: 'profile.upload.error.process',
upload: 'profile.upload.error.upload',
}
}
},
register: {
title: 'register.title',
Expand Down
33 changes: 29 additions & 4 deletions front_end/src/i18n/locales/zh-cn.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//import { LocaleConfig } from '@/i18n/config'
import { LocaleConfig } from '@/i18n/config'

export const zhCn = {
export const zhCn: LocaleConfig = {
local: 'zh-cn',
name: '简体中文',
common: {
Expand All @@ -15,7 +15,14 @@ export const zhCn = {
noGuess: '无猜',
recursive: '递归'
},
time: '用时'
prop: {
action: '操作',
designator: '标识',
fileName: '文件名',
level: '级别',
status: '状态',
time: '用时',
}
},
forgetPassword: {
title: '找回密码',
Expand Down Expand Up @@ -66,7 +73,25 @@ export const zhCn = {
modeRecord: '模式纪录:'
},
videos: '全部录像',
upload: '上传录像'
upload: {
title: '上传录像',
dragOrClick: `将录像拉到此处或 <em>点击此处选择</em>`,
uploadAll: '一键上传({0}个)',
cancelAll: '全部清空',
constraintNote: '*单个文件大小不能超过5M,文件数量不能超过99',
error: {
collision: '录像已存在',
custom: '暂不支持自定义级别',
designator: '标识不匹配',
fail: '不通过',
fileext: '无法识别的文件类型',
filename: '文件名超过了100字节',
filesize: '文件大小超过了5MB',
pass: '通过',
process: '上传中',
upload: '上传失败',
}
}
},
register: {
title: '用户注册',
Expand Down
4 changes: 0 additions & 4 deletions front_end/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,3 @@ export function ms_to_s(ms: number): string {
}






2 changes: 1 addition & 1 deletion front_end/src/views/PlayerView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<el-tab-pane label="全部录像" name="second" :lazy="true">
<PlayerVideosView></PlayerVideosView>
</el-tab-pane>
<el-tab-pane v-if="store.user.id + '' == userid" label="上传录像" name="third" :lazy="true">
<el-tab-pane v-if="store.user.id + '' == userid" :label="$t('profile.upload.title')" name="third" :lazy="true">
<UploadView :designators="designators"></UploadView>
</el-tab-pane>
</el-tabs>
Expand Down
53 changes: 18 additions & 35 deletions front_end/src/views/UploadView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,46 @@
:show-file-list="false" style="background-color: white;" accept=".avf,.evf">

<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text" style="font-size: 18px;">
将录像拉到此处或 <em>点击此处选择</em>
<div class="el-upload__text" style="font-size: 18px;" v-html="$t('profile.upload.dragOrClick')">
</div>

<template #tip>

<div class="el-upload__tip text-red" style="background-color: white;text-align: center;">
<el-button @click="submitUpload()" size="large" type="primary" v-show="video_msgs.length > 0"
style="display: block;margin: 16px auto;font-size: 18px;width: 220px;">一键上传({{ video_msgs.length
}}个)</el-button>
style="display: block;margin: 16px auto;font-size: 18px;width: 220px;">{{ $t('profile.upload.uploadAll', [video_msgs.length]) }}</el-button>
<el-button @click="cancel_all()" size="small" type="info" v-show="video_msgs.length > 0"
style="display: block;margin: 16px auto;width: 120px;" plain>全部清空</el-button>
<span style="font-size: 14px;">*单个文件大小不能超过5M,文件数量不能超过99</span>
style="display: block;margin: 16px auto;width: 120px;" plain>{{ $t('profile.upload.cancelAll') }}</el-button>
<span style="font-size: 14px;">{{ $t('profile.upload.constraintNote') }}</span>
</div>
</template>
</el-upload>
<el-table :data="video_msgs" table-layout="auto">
<el-table-column type="expand">
<template #default="props">
<el-descriptions>
<el-descriptions-item label="文件名">{{ props.row.filename }}</el-descriptions-item>
<el-descriptions-item v-if="props.row.videostat != null" label="标识">{{
<el-descriptions-item :label="$t('common.prop.fileName')">{{ props.row.filename }}</el-descriptions-item>
<el-descriptions-item v-if="props.row.videostat != null" :label="$t('common.prop.designator')">{{
props.row.videostat.designator }}</el-descriptions-item>
<el-descriptions-item v-if="props.row.videostat != null" v-for="key in extfields" :label="key">{{
props.row.extstat[key] }}</el-descriptions-item>
</el-descriptions>
</template>
</el-table-column>
<el-table-column prop="videostat.level" label="级别" sortable></el-table-column>
<el-table-column prop="videostat.timems" label="时间" sortable></el-table-column>
<el-table-column prop="videostat.level" :label="$t('common.prop.level')" sortable>
<template #default="props">
{{ $t('common.level.' + props.row.videostat.level) }}
</template>
</el-table-column>
<el-table-column prop="videostat.timems" :label="$t('common.prop.time')" sortable></el-table-column>
<el-table-column prop="videostat.bbbv" label="3BV" sortable></el-table-column>
<el-table-column prop="videostat.bvs" label="3BV/s" sortable></el-table-column>
<el-table-column label="状态" sortable sort-by="status">
<el-table-column :label="$t('common.prop.status')" sortable sort-by="status">
<template #default="props">
{{ errmsg[props.row.status] }}
{{ $t('profile.upload.error.' + props.row.status) }}
</template>
</el-table-column>
<el-table-column label="操作">
<el-table-column :label="$t('common.prop.action')">
<template #default="props">
<nobr>
<el-button :disabled="props.row.status != 'designator' && props.row.status != 'pass'"
Expand Down Expand Up @@ -72,34 +74,15 @@ import { useUserStore } from '../store'
const store = useUserStore()
import { LoginStatus } from "@/utils/common/structInterface"
import { useI18n } from 'vue-i18n';
const t = useI18n();
const data = defineProps({
designators: { type: Array, default: () => [] }
})
const extfields = ['left', 'right', 'double', 'cl', 'left_s', 'right_s', 'double_s', 'cl_s', 'path', 'flag', 'flag_s', 'stnb', 'rqp', 'ioe', 'thrp', 'corr', 'ce', 'ce_s', 'op', 'isl', 'cell0', 'cell1', 'cell2', 'cell3', 'cell4', 'cell5', 'cell6', 'cell7', 'cell8']
// 状态列相关
const errmsg = {
pass: "通过",
custom: "暂不支持自定义级别",
fileext: "无法识别的文件类型",
filename: "文件名超过了100字节",
filesize: "文件大小超过了5MB",
designator: "标识不匹配",
collision: "录像已存在",
error: "不通过",
process: "上传中",
upload: "上传失败",
}
// 筛选相关。还没做好
// const msgfilter = []
// for (var key in errmsg) {
// msgfilter.push({text: errmsg[key], value: key});
// }
// const filterMsg = (value: string, row: GeneralFile) => {
// return row.status == value;
// }
interface ExtendedVideoStat {
left: number,
right: number,
Expand Down

0 comments on commit dfc76e3

Please sign in to comment.