|
@@ -64,6 +64,11 @@ export default defineComponent({
|
|
|
isPreview: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
+ },
|
|
|
+ // 只预览
|
|
|
+ isOnlyUpload: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
}
|
|
|
},
|
|
|
emits: ['preview'],
|
|
@@ -196,7 +201,7 @@ export default defineComponent({
|
|
|
return (
|
|
|
<div class={[styles.colUpload, 'w-full']}>
|
|
|
<ElUpload
|
|
|
- disabled={this.disabled || this.isPreview}
|
|
|
+ disabled={this.disabled || this.isPreview || this.isOnlyUpload}
|
|
|
action={this.ossUploadUrl}
|
|
|
data={this.dataObj}
|
|
|
httpRequest={this.handleSuccess}
|
|
@@ -229,7 +234,8 @@ export default defineComponent({
|
|
|
<div
|
|
|
class={[
|
|
|
styles.uploadFile,
|
|
|
- this.disabled && 'cursor-not-allowed'
|
|
|
+ this.disabled && 'cursor-not-allowed',
|
|
|
+ this.isOnlyUpload && styles.isOnlyUpload,
|
|
|
]}
|
|
|
onClick={() => {
|
|
|
if(this.isPreview) {
|
|
@@ -248,7 +254,7 @@ export default defineComponent({
|
|
|
)}
|
|
|
</ElIcon>
|
|
|
<span
|
|
|
- class={["whitespace-nowrap overflow-hidden text-ellipsis flex-1", this.isPreview && styles.isPreview]}
|
|
|
+ class={["whitespace-nowrap overflow-hidden text-ellipsis flex-1", this.isPreview && styles.isPreview]}
|
|
|
style={{ lineHeight: '1.2' }}
|
|
|
>
|
|
|
{this.fileName(this.modelValue)}
|