|
@@ -110,7 +110,12 @@
|
|
|
<div class="input">
|
|
|
<div class="mat-select">
|
|
|
<span>图片/视频</span>
|
|
|
- <span class="select" @click="imageSelect">+从媒体库上传</span>
|
|
|
+ <span
|
|
|
+ class="select"
|
|
|
+ @click="imageSelect"
|
|
|
+ v-if="imageCount - tagging.images.length > 0"
|
|
|
+ >+从媒体库上传</span
|
|
|
+ >
|
|
|
</div>
|
|
|
<ui-input
|
|
|
type="file"
|
|
@@ -118,7 +123,7 @@
|
|
|
height="225px"
|
|
|
preview
|
|
|
placeholder="上传图片/视频"
|
|
|
- othPlaceholder="支持JPG、PNG、MP4等格式,单张不超过5MB,最多支持上传9张。"
|
|
|
+ othPlaceholder="支持JPG、PNG、MP4、MOV等格式,单个不超过100MB,最多支持上传10张。"
|
|
|
:accept="imageFormat.map((u) => `.${u}`).join(',')"
|
|
|
:disable="true"
|
|
|
:multiple="true"
|
|
@@ -171,9 +176,9 @@ export type EditProps = {
|
|
|
data: Tagging;
|
|
|
};
|
|
|
|
|
|
-const imageSize = 50 * 1024 * 1024;
|
|
|
-const imageCount = 9;
|
|
|
-const imageFormat = ["jpg", "png", "mp4"];
|
|
|
+const imageSize = 100 * 1024 * 1024;
|
|
|
+const imageCount = 10;
|
|
|
+const imageFormat = ["jpg", "png", "mp4", "mov"];
|
|
|
const audioSize = 30 * 1024 * 1024;
|
|
|
const audioCount = 1;
|
|
|
const audioFormat = ["mp3", "wav"];
|
|
@@ -184,9 +189,9 @@ const tagging = ref<Tagging>({ ...props.data, images: [...props.data.images] });
|
|
|
const activeStyle = computed(() => getTaggingStyle(tagging.value.styleId));
|
|
|
// 去除默认
|
|
|
if (!activeStyle.value && defaultStyle.value) {
|
|
|
- tagging.value.styleId = defaultStyle.value.id;
|
|
|
+ // tagging.value.styleId = defaultStyle.value.id;
|
|
|
}
|
|
|
-const type = ref(activeStyle.value ? activeStyle.value.typeId : styleTypes[0].id);
|
|
|
+const type = ref(activeStyle.value ? activeStyle.value.typeId : defStyleType.id);
|
|
|
|
|
|
const submitHandler = () => {
|
|
|
if (activeStyle.value?.typeId !== type.value) {
|
|
@@ -205,8 +210,10 @@ const submitHandler = () => {
|
|
|
const styles = computed(() => {
|
|
|
const fStyles = taggingStyles.value.filter((item) => item.typeId === type.value);
|
|
|
console.log(fStyles);
|
|
|
- return fStyles.sort((a, b) =>
|
|
|
- a.default
|
|
|
+ return fStyles.sort((a, b) => {
|
|
|
+ if (a.default && b.default) return 0;
|
|
|
+
|
|
|
+ return a.default
|
|
|
? -1
|
|
|
: b.default
|
|
|
? 1
|
|
@@ -218,8 +225,8 @@ const styles = computed(() => {
|
|
|
? -1
|
|
|
: isTemploraryID(b.id)
|
|
|
? 1
|
|
|
- : 0
|
|
|
- );
|
|
|
+ : 0;
|
|
|
+ });
|
|
|
});
|
|
|
watchEffect(() => {
|
|
|
if (type.value && activeStyle.value?.typeId !== type.value && styles.value.length) {
|