| | |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :close-on-click-modal="false" |
| | | :destroy-on-close="true" |
| | | :title="title" |
| | | :visible.sync="visible" |
| | | width="40%" |
| | |
| | | </ul> |
| | | <Divider left="30px" text="选择文件后会自动上传"></Divider> |
| | | <el-upload |
| | | :name="fileName" |
| | | :action="fileUrl" |
| | | :before-upload="beforeUpload" |
| | | :data="fileData" |
| | |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | fileName: { |
| | | type: String, |
| | | default: () => "file" |
| | | }, |
| | | // 对话框头部名称 |
| | | title: { |
| | | type: String, |
| | |
| | | }, |
| | | // 请求地址 携带参数 |
| | | fileData: { |
| | | type: Array, |
| | | default: () => [] |
| | | type: Object, |
| | | default: () => {} |
| | | }, |
| | | // 导入提示文字 tipList:["导入模板中标明红色字体的为必输项","部门列上下级关系必须按照反斜杠隔开(/)"] |
| | | tipList:{ |
| | |
| | | return true; |
| | | }, |
| | | // 文件上传成功 |
| | | onSuccess(resbonse) { |
| | | console.log(resbonse); |
| | | if (resbonse.code === 200) { |
| | | onSuccess(response) { |
| | | if (response.code === 200) { |
| | | this.$message.success("导入成功!"); |
| | | this.visible = false; |
| | | this.$emit('updata'); |
| | | this.$emit('updata',response); |
| | | } else { |
| | | this.$message.error(resbonse.msg); |
| | | this.$emit('upfaildata',response); |
| | | this.$message.error(response.msg); |
| | | } |
| | | }, |
| | | //文件上传失败 |
| | |
| | | }, |
| | | //文件状态改变 |
| | | uploadChange(file) { |
| | | console.log( this.pageLoading); |
| | | if (file.status === "success" || file.status === "error") { |
| | | this.pageLoading.close(); |
| | | } |