From 531aa7aafbfe9a404fd122db39e31166e4117830 Mon Sep 17 00:00:00 2001 From: gaoyuanwei <2826352639@qq.com> Date: Wed, 27 Jul 2022 16:19:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E5=8F=B0=E4=B8=8A=E6=9E=B6-=E9=A2=84?= =?UTF-8?q?=E8=A7=88bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/capacityOnTheShelf/Algorithm.vue | 43 +++++++++++++++---- .../capacityOnTheShelf/BusinessComponent.vue | 34 +++++++++++---- .../DevelopmentComponents.vue | 34 +++++++++++---- .../capacityOnTheShelf/LayerServices.vue | 34 +++++++++++---- .../Algorithm/AlgorithmNavigation.vue | 6 ++- 5 files changed, 113 insertions(+), 38 deletions(-) diff --git a/front/src/views/capacityOnTheShelf/Algorithm.vue b/front/src/views/capacityOnTheShelf/Algorithm.vue index b0b418cd..4e9898e7 100644 --- a/front/src/views/capacityOnTheShelf/Algorithm.vue +++ b/front/src/views/capacityOnTheShelf/Algorithm.vue @@ -474,15 +474,40 @@ } // 预览 const preview = () => { - dataFrom.value.infoList = dataFrom.value.infoList.filter( - (item) => item.attrValue !== '' - ) - console.log('预览==============>', dataFrom.value) - window.sessionStorage.setItem('preview', JSON.stringify(dataFrom.value)) - const newpage = router.resolve({ - path: '/details', - }) - window.open(newpage.href, '_blank') + notFilled.value = [] + console.log(dataFrom.value, 'dataFrom.value.name') + if ( + dataFrom.value.infoList.filter((val) => val.attrType === '使用方式')[0] && + dataFrom.value.infoList.filter((val) => val.attrType === '使用方式')[0] + .attrValue == '调用接口' + ) { + if ( + !dataFrom.value.infoList.filter( + (val) => val.attrType === '服务接口' + )[0] || + !dataFrom.value.infoList.filter((val) => val.attrType === '服务接口')[0] + .attrValue + ) { + notFilled.value.push('服务接口') + } + if (!dataFrom.value.apiMethodType) { + notFilled.value.push('接口请求方式') + } + } + if (notFilled.value.length > 0) { + message.warning('请填写必填字段') + console.log(notFilled.value) + } else { + dataFrom.value.infoList = dataFrom.value.infoList.filter( + (item) => item.attrValue !== '' + ) + console.log('预览==============>', dataFrom.value) + window.sessionStorage.setItem('preview', JSON.stringify(dataFrom.value)) + const newpage = router.resolve({ + path: '/details', + }) + window.open(newpage.href, '_blank') + } } const submit = () => { notFilled.value = [] diff --git a/front/src/views/capacityOnTheShelf/BusinessComponent.vue b/front/src/views/capacityOnTheShelf/BusinessComponent.vue index 4ac1e145..607718da 100644 --- a/front/src/views/capacityOnTheShelf/BusinessComponent.vue +++ b/front/src/views/capacityOnTheShelf/BusinessComponent.vue @@ -435,15 +435,31 @@ } // 预览 const preview = () => { - dataFrom.value.infoList = dataFrom.value.infoList.filter( - (item) => item.attrValue !== '' - ) - console.log('预览==============>', dataFrom.value) - window.sessionStorage.setItem('preview', JSON.stringify(dataFrom.value)) - const newpage = router.resolve({ - path: '/details', - }) - window.open(newpage.href, '_blank') + notFilled.value = [] + console.log(dataFrom.value, 'dataFrom.value.name') + if ( + !dataFrom.value.infoList.filter( + (val) => val.attrType === '组件地址' + )[0] || + !dataFrom.value.infoList.filter((val) => val.attrType === '组件地址')[0] + .attrValue + ) { + notFilled.value.push('组件地址') + } + if (notFilled.value.length > 0) { + message.warning('请填写必填字段') + console.log(notFilled.value) + } else { + dataFrom.value.infoList = dataFrom.value.infoList.filter( + (item) => item.attrValue !== '' + ) + console.log('预览==============>', dataFrom.value) + window.sessionStorage.setItem('preview', JSON.stringify(dataFrom.value)) + const newpage = router.resolve({ + path: '/details', + }) + window.open(newpage.href, '_blank') + } } const submit = () => { notFilled.value = [] diff --git a/front/src/views/capacityOnTheShelf/DevelopmentComponents.vue b/front/src/views/capacityOnTheShelf/DevelopmentComponents.vue index 1572dc75..b3533225 100644 --- a/front/src/views/capacityOnTheShelf/DevelopmentComponents.vue +++ b/front/src/views/capacityOnTheShelf/DevelopmentComponents.vue @@ -434,15 +434,31 @@ } // 预览 const preview = () => { - dataFrom.value.infoList = dataFrom.value.infoList.filter( - (item) => item.attrValue !== '' - ) - console.log('预览==============>', dataFrom.value) - window.sessionStorage.setItem('preview', JSON.stringify(dataFrom.value)) - const newpage = router.resolve({ - path: '/details', - }) - window.open(newpage.href, '_blank') + notFilled.value = [] + console.log(dataFrom.value, 'dataFrom.value.name') + if ( + !dataFrom.value.infoList.filter( + (val) => val.attrType === '组件地址' + )[0] || + !dataFrom.value.infoList.filter((val) => val.attrType === '组件地址')[0] + .attrValue + ) { + notFilled.value.push('组件地址') + } + if (notFilled.value.length > 0) { + message.warning('请填写必填字段') + console.log(notFilled.value) + } else { + dataFrom.value.infoList = dataFrom.value.infoList.filter( + (item) => item.attrValue !== '' + ) + console.log('预览==============>', dataFrom.value) + window.sessionStorage.setItem('preview', JSON.stringify(dataFrom.value)) + const newpage = router.resolve({ + path: '/details', + }) + window.open(newpage.href, '_blank') + } } // 特殊字段处理 const refPutOnTheShelf = ref(null) diff --git a/front/src/views/capacityOnTheShelf/LayerServices.vue b/front/src/views/capacityOnTheShelf/LayerServices.vue index 0038a0e0..bca26c23 100644 --- a/front/src/views/capacityOnTheShelf/LayerServices.vue +++ b/front/src/views/capacityOnTheShelf/LayerServices.vue @@ -334,15 +334,31 @@ } // 预览 const preview = () => { - dataFrom.value.infoList = dataFrom.value.infoList.filter( - (item) => item.attrValue !== '' - ) - console.log('预览==============>', dataFrom.value) - window.sessionStorage.setItem('preview', JSON.stringify(dataFrom.value)) - const newpage = router.resolve({ - path: '/details', - }) - window.open(newpage.href, '_blank') + notFilled.value = [] + console.log(dataFrom.value, 'dataFrom.value.name') + if ( + !dataFrom.value.infoList.filter( + (val) => val.attrType === '服务地址' + )[0] || + !dataFrom.value.infoList.filter((val) => val.attrType === '服务地址')[0] + .attrValue + ) { + notFilled.value.push('服务地址') + } + if (notFilled.value.length > 0) { + message.warning('请填写必填字段') + console.log(notFilled.value) + } else { + dataFrom.value.infoList = dataFrom.value.infoList.filter( + (item) => item.attrValue !== '' + ) + console.log('预览==============>', dataFrom.value) + window.sessionStorage.setItem('preview', JSON.stringify(dataFrom.value)) + const newpage = router.resolve({ + path: '/details', + }) + window.open(newpage.href, '_blank') + } } // 特殊字段处理 const refPutOnTheShelf = ref(null) diff --git a/front/src/views/detailsAll/components/Algorithm/AlgorithmNavigation.vue b/front/src/views/detailsAll/components/Algorithm/AlgorithmNavigation.vue index 7c1de008..5a49469a 100644 --- a/front/src/views/detailsAll/components/Algorithm/AlgorithmNavigation.vue +++ b/front/src/views/detailsAll/components/Algorithm/AlgorithmNavigation.vue @@ -111,7 +111,8 @@ item.attrType === '技术文档' || item.attrType === '服务商' || item.attrType === '服务商联系人' || - item.attrType === '服务商联系电话' + item.attrType === '服务商联系电话' || + item.attrType === '服务接口' ) { list.value.push('使用方式') } @@ -164,7 +165,8 @@ item.attrType === '技术文档' || item.attrType === '服务商' || item.attrType === '服务商联系人' || - item.attrType === '服务商联系电话' + item.attrType === '服务商联系电话' || + item.attrType === '服务接口' ) { list.value.push('使用方式') }