diff --git a/src/router/index.js b/src/router/index.js index 9a50da39..088fb7da 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -144,7 +144,6 @@ const routes = [ name: 'officialWebsiteBanner', component: () => import('../views/officialWebsite/banner.vue') }, - // 官网修改 { path: '/officialWebsiteCase', name: 'officialWebsiteCase', @@ -157,6 +156,10 @@ const routes = [ path: '/officialWebsiteProduct', name: 'officialWebsiteProduct', component: () => import('../views/officialWebsite/product.vue') + }, { + path: '/officialWebsiteDetail', + name: 'officialWebsiteDetail', + component: () => import('../views/officialWebsite/detail.vue') }, ] }, diff --git a/src/views/index.vue b/src/views/index.vue index 9172d318..8fd57435 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -104,7 +104,7 @@ export default { // { name: '设备菜单', router: '', routerList: [], img: require('../assets/image/header-img5.png') }, //systemManage systemManage // manage - { name: '管理', router: 'manage', routerList: ['manage','dataDevice','deviceStatusSet','officialWebsiteBanner','officialWebsiteProduct','officialWebsiteCase','officialWebsiteNews','deviceSet','deviceInfoManage','weatherData','mobileControl','userInfoControl','deviceManage','videoManage'], img: require('../assets/image/header-img6.png') }, + { name: '管理', router: 'manage', routerList: ['manage','dataDevice','deviceStatusSet','officialWebsiteBanner','officialWebsiteProduct','officialWebsiteCase','officialWebsiteDetail','officialWebsiteNews','deviceSet','deviceInfoManage','weatherData','mobileControl','userInfoControl','deviceManage','videoManage'], img: require('../assets/image/header-img6.png') }, { name: '大数据', router: 'largeScreen', routerList: ['largeScreen'], img: require('../assets/image/header-img8.png') } ], @@ -139,6 +139,7 @@ export default { 'userInfoControl', 'officialWebsiteCase', 'officialWebsiteNews', +'officialWebsiteDetail', 'officialWebsiteProduct', 'deviceManage', 'videoManage', @@ -411,6 +412,7 @@ export default { {deviceTypeName:'官网顶部轮播图管理',router:'officialWebsiteBanner',index:8}, {deviceTypeName:'官网产品管理',router:'officialWebsiteProduct',index:11}, {deviceTypeName:'官网案例管理',router:'officialWebsiteCase',index:9}, + {deviceTypeName:'官网公司简介',router:'officialWebsiteDetail',index:12}, {deviceTypeName:'官网新闻管理',router:'officialWebsiteNews',index:10}, // {deviceTypeName:'摄像头信息管理',router:'videoManage',index:8}, ] }, diff --git a/src/views/officialWebsite/banner.vue b/src/views/officialWebsite/banner.vue index f24c77c6..990466a0 100644 --- a/src/views/officialWebsite/banner.vue +++ b/src/views/officialWebsite/banner.vue @@ -199,13 +199,20 @@ export default { } }, changeAddModel() { - this.Addloading = this.$loading({ + if(this.loading){ + this.$message.error("图片还未上传成功,请耐心等待。"); + return + } + if(!this.nowData.homepaeImage){ + this.$message.error("图片还未上传。"); + return + } + this.Addloading = this.$loading({ lock: true, text: "加载中", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }); - if (this.modelName == "编辑") { var data = { ...this.nowData,id:this.nowData.id.toString() }; this.api.website_updateows(data).then((res) => { @@ -221,6 +228,7 @@ export default { }); } else { var data = { ...this.nowData}; + this.api.website_addows(data).then((res) => { this.Addloading.close(); if (res.data.code == 200) { @@ -268,6 +276,9 @@ export default { } else { this.$message.error(res.data.msg); } + }).catch((err) => { + this.loading = false; + this.$message.error("插入图片失败"); }); }; reader.readAsArrayBuffer(file); diff --git a/src/views/officialWebsite/case.vue b/src/views/officialWebsite/case.vue index 08ecd033..9d1ed91a 100644 --- a/src/views/officialWebsite/case.vue +++ b/src/views/officialWebsite/case.vue @@ -209,15 +209,25 @@ detailedIntroductionTextEnTitle:'', } }, changeAddModel() { - this.Addloading = this.$loading({ + + if(this.loading){ + this.$message.error("图片还未上传成功,请耐心等待。"); + return + } + if(!this.nowData.detailedIntroductionImage){ + this.$message.error("图片还未上传。"); + return + } + this.Addloading = this.$loading({ lock: true, text: "加载中", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }); - if (this.modelName == "编辑") { var data = { ...this.nowData,id:this.nowData.id.toString() }; + + this.api.website_updateops(data).then((res) => { this.Addloading.close(); if (res.data.code == 200) { @@ -278,6 +288,9 @@ detailedIntroductionTextEnTitle:'', } else { this.$message.error(res.data.msg); } + }).catch((err) => { + this.loading = false; + this.$message.error("插入图片失败"); }); }; reader.readAsArrayBuffer(file); diff --git a/src/views/officialWebsite/detail.vue b/src/views/officialWebsite/detail.vue new file mode 100644 index 00000000..2c1e3c31 --- /dev/null +++ b/src/views/officialWebsite/detail.vue @@ -0,0 +1,299 @@ + + + \ No newline at end of file diff --git a/src/views/officialWebsite/new.vue b/src/views/officialWebsite/new.vue index 5a691cc6..b6ced882 100644 --- a/src/views/officialWebsite/new.vue +++ b/src/views/officialWebsite/new.vue @@ -378,13 +378,20 @@ export default { }, changeAddModel() { - this.Addloading = this.$loading({ + if(this.loading){ + this.$message.error("图片还未上传成功,请耐心等待。"); + return + } + if(!this.nowData.detailedIntroductionImage){ + this.$message.error("图片还未上传。"); + return + } + this.Addloading = this.$loading({ lock: true, text: "加载中", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }); - if (this.modelName == "编辑") { var data = { ...this.nowData, id: this.nowData.id.toString() }; this.api.website_updateops(data).then((res) => { @@ -447,6 +454,9 @@ export default { } else { this.$message.error(res.data.msg); } + }).catch((err) => { + this.loading = false; + this.$message.error("插入图片失败"); }); }; reader.readAsArrayBuffer(file); diff --git a/src/views/officialWebsite/product.vue b/src/views/officialWebsite/product.vue index 5b7faa32..b984eab3 100644 --- a/src/views/officialWebsite/product.vue +++ b/src/views/officialWebsite/product.vue @@ -428,13 +428,20 @@ productId: "", }, // 产品详情 changeAddModel() { - this.Addloading = this.$loading({ + if(this.loading){ + this.$message.error("图片还未上传成功,请耐心等待。"); + return + } + if(!this.nowData.detailedIntroductionImage){ + this.$message.error("图片还未上传。"); + return + } + this.Addloading = this.$loading({ lock: true, text: "加载中", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }); - if (this.modelName == "编辑") { var data = { ...this.nowData, id: this.nowData.id.toString() }; this.api.website_updateops(data).then((res) => { @@ -465,13 +472,20 @@ productId: "", }, // 产品列表 changeAddModel1() { - this.Addloading = this.$loading({ + if(this.loading){ + this.$message.error("图片还未上传成功,请耐心等待。"); + return + } + if(!this.nowData1.detailedIntroductionImage){ + this.$message.error("图片还未上传。"); + return + } + this.Addloading = this.$loading({ lock: true, text: "加载中", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }); - if (this.modelName1 == "编辑") { var data = { ...this.nowData1, id: this.nowData1.id.toString() }; this.api.website_updateowp(data).then((res) => { @@ -515,6 +529,7 @@ productId: "", if (file.size > maxSize) { this.$message.error("图片大小不能超过2MB"); this.$refs.fileInput.value = ""; + this.loading = false return; } @@ -534,6 +549,9 @@ productId: "", } else { this.$message.error(res.data.msg); } + }).catch((err) => { + this.loading = false; + this.$message.error("插入图片失败"); }); }; reader.readAsArrayBuffer(file); @@ -573,6 +591,9 @@ productId: "", } else { this.$message.error(res.data.msg); } + }).catch((err) => { + this.loading = false; + this.$message.error("插入图片失败"); }); }; reader.readAsArrayBuffer(file);