内外部会议

This commit is contained in:
zyn
2023-10-13 16:56:05 +08:00
parent 24ab3d3eef
commit 912c68a8cd
5 changed files with 960 additions and 0 deletions
@@ -0,0 +1,62 @@
<template>
<!--导出文件改名字模态框-->
<el-dialog :visible.sync="exportModelFlag" title="导出文件" width="300px">
<el-form :inline="true" class="label-input-form search-area">
<el-form-item label="导出名称" class="search-item">
<el-input v-model="exportName" placeholder="请输入导出文件名称" :maxlength="30" clearable label="导出名称"/>
</el-form-item>
</el-form>
<span slot="footer" class="demo-drawer-footer">
<el-button class="common-button-default" icon="el-icon-close" @click="cancel">取消</el-button>
<el-button type="primary" round class="common-button-primary" icon="el-icon-check" @click="submit">提交</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
name: "exportDialog",
data () {
return {
exportModelFlag: false,
exportName: ''
}
},
methods: {
openModel () {
this.exportName = ''
this.exportModelFlag = true
},
cancel () {
this.exportModelFlag = false
},
submit () {
// 导出文件名
this.$emit('exportName', this.exportName)
}
}
}
</script>
<style scoped>
/deep/ .label-input-form .add-form-item .el-form-item__content .el-input .el-input__inner {
width: 280px;
}
/deep/ .el-dialog .el-dialog__header {
width: 100%;
font-size: 14px;
color: #17233d;
font-weight: bold;
border-bottom: 1px solid #e5e5e5;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/deep/ .el-dialog .el-dialog__body {
padding: 15px 20px;
}
/deep/ .el-dialog .el-dialog__footer .el-button {
height: 32px;
padding: 8px 23px;
}
</style>
+106
View File
@@ -0,0 +1,106 @@
<template>
<div>
<!-- 导入模态窗 -->
<el-dialog width='400px' v-if="visible" :visible="visible" @close="onClose" title="导入文件">
<el-upload
multiple
drag
:action="action"
ref="importfile"
name="file"
accept=".ZIP, .zip"
:before-upload="beginImportFile"
:on-success="importFileSuccess"
:show-file-list="true"
>
<div style="padding: 20px 0">
<i class="el-icon-upload" style="color: #3399ff"></i>
<p>点击或拖拽上传文件</p>
</div>
</el-upload>
</el-dialog>
<!-- 导入失败-->
<el-dialog :visible.sync="importFailed" :close-on-click-modal="false" width="400px">
<p slot="title" style="color:#f60">
<span>导入失败</span>
</p>
<div style="max-height: 300px;overflow: auto;padding: 10px 0;">
<p v-html="importForm.content"></p>
</div>
<div slot="footer" class="demo-drawer-footer">
<el-button type="primary" round class="common-button-default" icon="el-icon-check" @click="importFailed = false">
确认
</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: "importZip",
data () {
return {
importFailed: false,
importForm: {}
}
},
props: {
action: {
type: String,
required: true
},
visible: {
type: Boolean,
default: false
}
},
methods: {
onClose () {
this.$emit('update:visible', false)
},
// 导入按钮 上传之前的钩子
beginImportFile(file) {
var filename = file.name
var index1 = filename.lastIndexOf('.')
var index2 = filename.length
var fileSuffix = filename.substring(index1, index2)
// 判断上传文件格式
if (fileSuffix === '.ZIP' || fileSuffix === '.zip') {
return true
} else {
this.$message.error('文件' + file.name + '格式不正确,请上传ZIP压缩文件')
return false
}
// 判断文件上传大小
// eslint-disable-next-line no-unreachable
if (file.size / 1024 / 1024 <= 200) {
return true
} else {
this.$message.error('文件' + file.name + '大小不超过200M')
return false
}
return true
},
// 导入标准数据成功后执行
importFileSuccess(response, file) {
if (response.ok) {
this.$emit('update:visible', false)
// this.visible = false
this.$message({
message: response.message,
type: 'success'
})
this.getData()
} else {
this.importFailed = true
this.importForm.content = response.message
}
},
}
}
</script>
<style scoped>
</style>