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('使用方式') }