修改:文件管理

Signed-off-by: skyselang <215817969@qq.com>
This commit is contained in:
skyselang 2021-11-23 18:32:36 +08:00
parent 342123e0f1
commit ac240ec9ec
10 changed files with 55 additions and 24 deletions

View File

@ -1002,13 +1002,14 @@ export default {
this.recoverCheckAll = false
this.recoverCheckAllInd = false
},
// /
//
fileCancel() {
this.checkedIds = []
this.$emit('file-lists', null)
this.$emit('fileCancel')
},
//
fileSubmit(row) {
if (row.length === 0) {
if (!row.length) {
this.recoverCheckAlert('请选择文件')
} else {
const files = []
@ -1023,7 +1024,7 @@ export default {
}
}
this.checkedIds = []
this.$emit('file-lists', files, this.fileType)
this.$emit('fileSubmit', files, this.fileType)
}
}
}

View File

@ -67,7 +67,7 @@
</el-col>
</el-row>
<el-dialog :title="fileTitle" :visible.sync="fileDialog" width="80%" top="1vh">
<file-manage file-type="image" @file-lists="fileLists" />
<file-manage file-type="image" @fileCancel="fileCancel" @fileSubmit="fileSubmit" />
</el-dialog>
</el-card>
</template>
@ -146,7 +146,10 @@ export default {
this.fileTitle = title
this.fileDialog = true
},
fileLists(filelists) {
fileCancel() {
this.fileDialog = false
},
fileSubmit(filelists) {
this.fileDialog = false
this.fileTitle = ''
if (this.fileField === 'logo') {

View File

@ -36,7 +36,7 @@
</el-row>
</el-card>
<el-dialog title="上传头像" :visible.sync="fileDialog" width="80%" top="1vh">
<file-manage file-type="image" @file-lists="fileLists" />
<file-manage file-type="image" @fileCancel="fileCancel" @fileSubmit="fileSubmit" />
</el-dialog>
</div>
</template>
@ -104,7 +104,10 @@ export default {
fileUpload() {
this.fileDialog = true
},
fileLists(filelists) {
fileCancel() {
this.fileDialog = false
},
fileSubmit(filelists) {
this.fileDialog = false
this.model.avatar_id = filelists[0]['file_id']
this.model.avatar_url = filelists[0]['file_url']

View File

@ -185,7 +185,7 @@
</div>
</el-dialog>
<el-dialog title="上传头像" :visible.sync="fileDialog" width="80%" top="1vh">
<file-manage file-type="image" @file-lists="fileLists" />
<file-manage file-type="image" @fileCancel="fileCancel" @fileSubmit="fileSubmit" />
</el-dialog>
</div>
</template>
@ -366,7 +366,10 @@ export default {
fileUpload() {
this.fileDialog = true
},
fileLists(filelists) {
fileCancel() {
this.fileDialog = false
},
fileSubmit(filelists) {
this.fileDialog = false
this.model.avatar_id = filelists[0]['file_id']
this.model.avatar_url = filelists[0]['file_url']

View File

@ -99,7 +99,7 @@
</div>
</el-dialog>
<el-dialog title="上传图片" :visible.sync="fileDialog" width="80%" top="1vh">
<file-manage file-type="image" @file-lists="fileLists" />
<file-manage file-type="image" @fileCancel="fileCancel" @fileSubmit="fileSubmit" />
</el-dialog>
</div>
</template>
@ -302,7 +302,10 @@ export default {
fileUpload() {
this.fileDialog = true
},
fileLists(filelists) {
fileCancel() {
this.fileDialog = false
},
fileSubmit(filelists) {
this.fileDialog = false
const file_len = filelists.length
if (filelists) {

View File

@ -285,10 +285,10 @@
<pagination v-show="recoverCount > 0" :total="recoverCount" :page.sync="recoverQuery.page" :limit.sync="recoverQuery.limit" @pagination="recoverList" />
</el-dialog>
<el-dialog :title="fileTitle" :visible.sync="fileDialog" width="80%" top="1vh">
<file-manage :file-type="fileType" @file-lists="fileLists" />
<file-manage :file-type="fileType" @fileCancel="fileCancel" @fileSubmit="fileSubmit" />
</el-dialog>
<el-dialog :title="fileTitle" :visible.sync="editorDialog" width="80%" top="1vh">
<file-manage :file-type="editorFileType" @file-lists="fileListsEd" />
<file-manage :file-type="editorFileType" @fileCancel="fileCancelEd" @fileSubmit="fileSubmitEd" />
</el-dialog>
</div>
</template>
@ -614,7 +614,10 @@ export default {
this.fileTitle = fileTitle
this.fileDialog = true
},
fileLists(filelists, filetype) {
fileCancel() {
this.fileDialog = false
},
fileSubmit(filelists, filetype) {
this.fileDialog = false
this.fileTitle = ''
const file_len = filelists.length
@ -630,7 +633,10 @@ export default {
}
}
},
fileListsEd(filelists, filetype) {
fileCancelEd() {
this.editorDialog = false
},
fileSubmitEd(filelists, filetype) {
this.editorDialog = false
this.fileTitle = ''
const file_len = filelists.length

View File

@ -87,7 +87,7 @@
</el-row>
</el-card>
<el-dialog :title="fileTitle" :visible.sync="fileDialog" width="80%" top="1vh">
<file-manage file-type="image" @file-lists="fileLists" />
<file-manage file-type="image" @fileCancel="fileCancel" @fileSubmit="fileSubmit" />
</el-dialog>
</div>
</template>
@ -176,7 +176,10 @@ export default {
this.fileTitle = title
this.fileDialog = true
},
fileLists(filelists) {
fileCancel() {
this.fileDialog = false
},
fileSubmit(filelists) {
this.fileDialog = false
this.fileTitle = ''
if (this.fileField === 'logo') {

View File

@ -191,7 +191,7 @@
</div>
</el-dialog>
<el-dialog title="上传头像" :visible.sync="fileDialog" width="80%" top="1vh">
<file-manage file-type="image" @file-lists="fileLists" />
<file-manage file-type="image" @fileCancel="fileCancel" @fileSubmit="fileSubmit" />
</el-dialog>
</div>
</template>
@ -375,7 +375,10 @@ export default {
fileUpload() {
this.fileDialog = true
},
fileLists(filelists) {
fileCancel() {
this.fileDialog = false
},
fileSubmit(filelists) {
this.fileDialog = false
this.model.avatar_id = filelists[0]['file_id']
this.model.avatar_url = filelists[0]['file_url']

View File

@ -47,7 +47,7 @@
</el-row>
</el-card>
<el-dialog title="上传二维码" :visible.sync="fileDialog" width="80%" top="1vh">
<file-manage file-type="image" @file-lists="fileLists" />
<file-manage file-type="image" @fileCancel="fileCancel" @fileSubmit="fileSubmit" />
</el-dialog>
</div>
</template>
@ -122,7 +122,10 @@ export default {
fileUpload() {
this.fileDialog = true
},
fileLists(filelists) {
fileCancel() {
this.fileDialog = false
},
fileSubmit(filelists) {
this.fileDialog = false
this.model.qrcode_id = filelists[0]['file_id']
this.model.qrcode_url = filelists[0]['file_url']

View File

@ -67,7 +67,7 @@
</el-row>
</el-card>
<el-dialog title="上传二维码" :visible.sync="fileDialog" width="80%" top="1vh">
<file-manage file-type="image" @file-lists="fileLists" />
<file-manage file-type="image" @fileCancel="fileCancel" @fileSubmit="fileSubmit" />
</el-dialog>
</div>
</template>
@ -151,7 +151,10 @@ export default {
fileUpload() {
this.fileDialog = true
},
fileLists(filelists) {
fileCancel() {
this.fileDialog = false
},
fileSubmit(filelists) {
this.fileDialog = false
this.model.qrcode_id = filelists[0]['file_id']
this.model.qrcode_url = filelists[0]['file_url']