增加了自动化视频以及修复了一些已知漏洞 (#1554)

* 解决bug:为角色添加权限时,如果有重复api权限,该角色所有权限均添加失败(包括登录)

* 支持视频上传和选用。视频首帧作为封面预览。

* 增加自动化代码视频选项

* 媒体库可上传视频
SelectImage组件增加参数file-type="image|video" 方便用户对媒体库可选内容做限制

* 自动化代码bug修复

---------

Co-authored-by: liuyahui <liuyahui@wjacloud.com>
Co-authored-by: Alan <alan.cd@qq.com>
This commit is contained in:
奇淼(piexlmax
2023-09-24 15:49:58 +08:00
committed by GitHub
parent c1c37901b5
commit 809e2496c0
12 changed files with 248 additions and 50 deletions

View File

@@ -139,6 +139,18 @@
</div>
</template>
</el-table-column>
{{- else if eq .FieldType "video" }}
<el-table-column label="{{.FieldDesc}}" width="200">
<template #default="scope">
<video
style="width: 100px; height: 100px"
muted
preload="metadata"
>
<source :src="getUrl(scope.row.{{.FieldJson}}) + '#t=1'">
</video>
</template>
</el-table-column>
{{- else if eq .FieldType "richtext" }}
<el-table-column label="{{.FieldDesc}}" width="200">
<template #default="scope">
@@ -215,11 +227,24 @@
</el-select>
{{- end }}
{{- if eq .FieldType "picture" }}
<SelectImage v-model="formData.{{ .FieldJson }}" />
<SelectImage
v-model="formData.{{ .FieldJson }}"
file-type="image"
/>
{{- end }}
{{- if eq .FieldType "pictures" }}
<SelectImage v-model="formData.{{ .FieldJson }}" multiple />
<SelectImage
multiple
v-model="formData.{{ .FieldJson }}"
file-type="image"
/>
{{- end }}
{{- if eq .FieldType "video" }}
<SelectImage
v-model="formData.{{ .FieldJson }}"
file-type="video"
/>
{{- end }}
{{- if eq .FieldType "file" }}
<SelectFile v-model="formData.{{ .FieldJson }}" />
{{- end }}
@@ -244,6 +269,14 @@
{{"{{"}} filterDict(formData.{{.FieldJson}},{{.DictType}}Options) {{"}}"}}
{{- else if eq .FieldType "picture" }}
<el-image style="width: 50px; height: 50px" :preview-src-list="ReturnArrImg(formData.{{ .FieldJson }})" :src="getUrl(formData.{{ .FieldJson }})" fit="cover" />
{{- else if eq .FieldType "video" }}
<video
style="width: 50px; height: 50px"
muted
preload="metadata"
>
<source :src="getUrl(formData.{{ .FieldJson }}) + '#t=1'">
</video>
{{- else if eq .FieldType "pictures" }}
<el-image style="width: 50px; height: 50px; margin-right: 10px" :preview-src-list="ReturnArrImg(formData.{{ .FieldJson }})" :initial-index="index" v-for="(item,index) in formData.{{ .FieldJson }}" :key="index" :src="getUrl(item)" fit="cover" />
{{- else if eq .FieldType "file" }}
@@ -332,6 +365,9 @@ const formData = ref({
{{- if eq .FieldType "picture" }}
{{.FieldJson}}: "",
{{- end }}
{{- if eq .FieldType "video" }}
{{.FieldJson}}: "",
{{- end }}
{{- if eq .FieldType "pictures" }}
{{.FieldJson}}: [],
{{- end }}
@@ -341,6 +377,7 @@ const formData = ref({
{{- end }}
})
// 验证规则
const rule = reactive({
{{- range .Fields }}