|  |  | 
 |  |  |         <el-upload | 
 |  |  |           class="upload-box" | 
 |  |  |           drag | 
 |  |  |           action="debug/api/push/upload" | 
 |  |  |           :action="uploadUrl" | 
 |  |  |           name="file" | 
 |  |  |           :on-success="successHook" | 
 |  |  |           :on-error="errorHook" | 
 |  |  |           > | 
 |  |  |           <i class="el-icon-upload"></i> | 
 |  |  |           <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> | 
 |  |  | 
 |  |  |         </el-upload> | 
 |  |  |       </div> | 
 |  |  |     </el-dialog> | 
 |  |  |     <ShowErrorData ref="showErrorData" :gbIds="errorGBIds" :streams="errorStreams" ></ShowErrorData> | 
 |  |  |   </div> | 
 |  |  | </template> | 
 |  |  |  | 
 |  |  | <script> | 
 |  |  |  | 
 |  |  | import ShowErrorData from './importChannelShowErrorData.vue' | 
 |  |  |  | 
 |  |  | export default { | 
 |  |  |   name: "importChannel", | 
 |  |  |   computed: {}, | 
 |  |  |   components: { | 
 |  |  |     ShowErrorData, | 
 |  |  |   }, | 
 |  |  |   created() {}, | 
 |  |  |   data() { | 
 |  |  |     return { | 
 |  |  | 
 |  |  |       showDialog: false, | 
 |  |  |       isLoging: false, | 
 |  |  |       isEdit: false, | 
 |  |  |       errorStreams: [], | 
 |  |  |       errorGBIds: [], | 
 |  |  |       uploadUrl: process.env.NODE_ENV === 'development'?`debug/api/push/upload`:`api/push/upload`, | 
 |  |  |     }; | 
 |  |  |   }, | 
 |  |  |   methods: { | 
 |  |  | 
 |  |  |       console.log(this.form); | 
 |  |  |       this.$axios({ | 
 |  |  |         method:"post", | 
 |  |  |         url:`/api/platform/catalog/${!this.isEdit? "add":"edit"}`, | 
 |  |  |         url:`./api/platform/catalog/${!this.isEdit? "add":"edit"}`, | 
 |  |  |         data: this.form | 
 |  |  |       }) | 
 |  |  |         .then((res)=> { | 
 |  |  | 
 |  |  |     }, | 
 |  |  |     close: function () { | 
 |  |  |       this.showDialog = false; | 
 |  |  |       this.$refs.form.resetFields(); | 
 |  |  |     }, | 
 |  |  |     successHook: function(response, file, fileList){ | 
 |  |  |       if (response.code === 0) { | 
 |  |  |         this.$message({ | 
 |  |  |           showClose: true, | 
 |  |  |           message: response.msg, | 
 |  |  |           type: "success", | 
 |  |  |         }); | 
 |  |  |       }else if (response.code === 1) { | 
 |  |  |         this.errorGBIds = response.data.gbId | 
 |  |  |         this.errorStreams = response.data.stream | 
 |  |  |         console.log(this.$refs) | 
 |  |  |         console.log(this.$refs.showErrorData) | 
 |  |  |         this.$refs.showErrorData.openDialog() | 
 |  |  |       }else { | 
 |  |  |         this.$message({ | 
 |  |  |           showClose: true, | 
 |  |  |           message: response.msg, | 
 |  |  |           type: "error", | 
 |  |  |         }); | 
 |  |  |       } | 
 |  |  |     }, | 
 |  |  |     errorHook: function (err, file, fileList) { | 
 |  |  |       this.$message({ | 
 |  |  |         showClose: true, | 
 |  |  |         message: err, | 
 |  |  |         type: "error", | 
 |  |  |       }); | 
 |  |  |     } | 
 |  |  |   }, | 
 |  |  | }; | 
 |  |  | </script> | 
 |  |  | 
 |  |  | .upload-box{ | 
 |  |  |   text-align: center; | 
 |  |  | } | 
 |  |  | .errDataBox{ | 
 |  |  |   max-height: 15rem; | 
 |  |  |   overflow: auto; | 
 |  |  | } | 
 |  |  | </style> |