From 08c2fa45f7f5e6626f83270363a0d16f7d752d4c Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期二, 14 三月 2023 16:56:13 +0800
Subject: [PATCH] Merge pull request #771 from mrjackwang/wvp-28181-2.0
---
web_src/src/components/dialog/importChannel.vue | 46 +++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 43 insertions(+), 3 deletions(-)
diff --git a/web_src/src/components/dialog/importChannel.vue b/web_src/src/components/dialog/importChannel.vue
index ac5ce05..d511fe8 100644
--- a/web_src/src/components/dialog/importChannel.vue
+++ b/web_src/src/components/dialog/importChannel.vue
@@ -16,6 +16,8 @@
drag
:action="uploadUrl"
name="file"
+ :on-success="successHook"
+ :on-error="errorHook"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
@@ -23,14 +25,19 @@
</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 {
@@ -38,6 +45,8 @@
showDialog: false,
isLoging: false,
isEdit: false,
+ errorStreams: [],
+ errorGBIds: [],
uploadUrl: process.env.NODE_ENV === 'development'?`debug/api/push/upload`:`api/push/upload`,
};
},
@@ -51,7 +60,7 @@
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)=> {
@@ -73,8 +82,35 @@
},
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>
@@ -82,4 +118,8 @@
.upload-box{
text-align: center;
}
+.errDataBox{
+ max-height: 15rem;
+ overflow: auto;
+}
</style>
--
Gitblit v1.8.0