From 814985200bc5dd73368a603a594a6f3469a8befd Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期五, 30 十二月 2022 16:57:00 +0800
Subject: [PATCH] 修复树组件多选的bug
---
src/components/subComponents/FileUpload/btn.vue | 39 +++++++++++++++++++++++++++------------
1 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/src/components/subComponents/FileUpload/btn.vue b/src/components/subComponents/FileUpload/btn.vue
index 7ea24ff..ca7ccc5 100644
--- a/src/components/subComponents/FileUpload/btn.vue
+++ b/src/components/subComponents/FileUpload/btn.vue
@@ -5,9 +5,9 @@
</template>
<script>
-import { uploaderMixin, supportMixin } from './common/mixins'
+import { uploaderMixin, supportMixin } from "./common/mixins";
-const COMPONENT_NAME = 'uploader-btn'
+const COMPONENT_NAME = "uploader-btn";
export default {
name: COMPONENT_NAME,
@@ -15,25 +15,40 @@
props: {
directory: {
type: Boolean,
- default: false
+ default: false,
},
single: {
type: Boolean,
- default: false
+ default: false,
},
attrs: {
type: Object,
default() {
- return {}
- }
- }
+ return {};
+ },
+ },
+ sourceType: {
+ type: Number,
+ },
},
+
mounted() {
this.$nextTick(() => {
- this.uploader.uploader.assignBrowse(this.$refs.btn, this.directory, this.single, this.attrs)
- })
- }
-}
+ let props = { accept: "" };
+ if (this.sourceType == 1) {
+ props.accept = ".mp4";
+ } else if (this.sourceType == 2) {
+ props.accept = ".jpg,.jpeg,.png";
+ }
+ this.uploader.uploader.assignBrowse(
+ this.$refs.btn,
+ this.directory,
+ this.single,
+ props
+ );
+ });
+ },
+};
</script>
<style>
@@ -51,6 +66,6 @@
outline: none;
}
.uploader-btn:hover {
- background-color: rgba(0, 0, 0, 0.08);
+ /* background-color: rgba(0, 0, 0, 0.08); */
}
</style>
--
Gitblit v1.8.0