前台上架-预览bug修复

This commit is contained in:
gaoyuanwei 2022-07-27 16:19:34 +08:00
parent ef980d77c3
commit 531aa7aafb
5 changed files with 113 additions and 38 deletions

View File

@ -474,15 +474,40 @@
} }
// //
const preview = () => { const preview = () => {
dataFrom.value.infoList = dataFrom.value.infoList.filter( notFilled.value = []
(item) => item.attrValue !== '' console.log(dataFrom.value, 'dataFrom.value.name')
) if (
console.log('预览==============>', dataFrom.value) dataFrom.value.infoList.filter((val) => val.attrType === '使用方式')[0] &&
window.sessionStorage.setItem('preview', JSON.stringify(dataFrom.value)) dataFrom.value.infoList.filter((val) => val.attrType === '使用方式')[0]
const newpage = router.resolve({ .attrValue == '调用接口'
path: '/details', ) {
}) if (
window.open(newpage.href, '_blank') !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 = () => { const submit = () => {
notFilled.value = [] notFilled.value = []

View File

@ -435,15 +435,31 @@
} }
// //
const preview = () => { const preview = () => {
dataFrom.value.infoList = dataFrom.value.infoList.filter( notFilled.value = []
(item) => item.attrValue !== '' console.log(dataFrom.value, 'dataFrom.value.name')
) if (
console.log('预览==============>', dataFrom.value) !dataFrom.value.infoList.filter(
window.sessionStorage.setItem('preview', JSON.stringify(dataFrom.value)) (val) => val.attrType === '组件地址'
const newpage = router.resolve({ )[0] ||
path: '/details', !dataFrom.value.infoList.filter((val) => val.attrType === '组件地址')[0]
}) .attrValue
window.open(newpage.href, '_blank') ) {
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 = () => { const submit = () => {
notFilled.value = [] notFilled.value = []

View File

@ -434,15 +434,31 @@
} }
// //
const preview = () => { const preview = () => {
dataFrom.value.infoList = dataFrom.value.infoList.filter( notFilled.value = []
(item) => item.attrValue !== '' console.log(dataFrom.value, 'dataFrom.value.name')
) if (
console.log('预览==============>', dataFrom.value) !dataFrom.value.infoList.filter(
window.sessionStorage.setItem('preview', JSON.stringify(dataFrom.value)) (val) => val.attrType === '组件地址'
const newpage = router.resolve({ )[0] ||
path: '/details', !dataFrom.value.infoList.filter((val) => val.attrType === '组件地址')[0]
}) .attrValue
window.open(newpage.href, '_blank') ) {
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) const refPutOnTheShelf = ref(null)

View File

@ -334,15 +334,31 @@
} }
// //
const preview = () => { const preview = () => {
dataFrom.value.infoList = dataFrom.value.infoList.filter( notFilled.value = []
(item) => item.attrValue !== '' console.log(dataFrom.value, 'dataFrom.value.name')
) if (
console.log('预览==============>', dataFrom.value) !dataFrom.value.infoList.filter(
window.sessionStorage.setItem('preview', JSON.stringify(dataFrom.value)) (val) => val.attrType === '服务地址'
const newpage = router.resolve({ )[0] ||
path: '/details', !dataFrom.value.infoList.filter((val) => val.attrType === '服务地址')[0]
}) .attrValue
window.open(newpage.href, '_blank') ) {
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) const refPutOnTheShelf = ref(null)

View File

@ -111,7 +111,8 @@
item.attrType === '技术文档' || item.attrType === '技术文档' ||
item.attrType === '服务商' || item.attrType === '服务商' ||
item.attrType === '服务商联系人' || item.attrType === '服务商联系人' ||
item.attrType === '服务商联系电话' item.attrType === '服务商联系电话' ||
item.attrType === '服务接口'
) { ) {
list.value.push('使用方式') list.value.push('使用方式')
} }
@ -164,7 +165,8 @@
item.attrType === '技术文档' || item.attrType === '技术文档' ||
item.attrType === '服务商' || item.attrType === '服务商' ||
item.attrType === '服务商联系人' || item.attrType === '服务商联系人' ||
item.attrType === '服务商联系电话' item.attrType === '服务商联系电话' ||
item.attrType === '服务接口'
) { ) {
list.value.push('使用方式') list.value.push('使用方式')
} }