前台必填项设置

This commit is contained in:
gaoyuanwei 2022-07-26 10:07:39 +08:00
parent b7fd109210
commit 73ed69f315
8 changed files with 812 additions and 355 deletions

View File

@ -37,6 +37,8 @@
'部门联系人', '部门联系人',
'部门联系人电话', '部门联系人电话',
]" ]"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
<put-on-the-shelf <put-on-the-shelf
v-else-if="showView === '算法优势'" v-else-if="showView === '算法优势'"
@ -46,6 +48,8 @@
:configure="sfys" :configure="sfys"
@next="next()" @next="next()"
@back="back()" @back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
<put-on-the-shelf <put-on-the-shelf
v-else-if="showView === '应用场景'" v-else-if="showView === '应用场景'"
@ -55,6 +59,8 @@
:configure="yycj" :configure="yycj"
@next="next()" @next="next()"
@back="back()" @back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
<put-on-the-shelf <put-on-the-shelf
v-else-if="showView === '部署与使用'" v-else-if="showView === '部署与使用'"
@ -68,6 +74,8 @@
:configure="bs" :configure="bs"
@submit="submit()" @submit="submit()"
@back="back()" @back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
<!-- <algorithm-essential-information <!-- <algorithm-essential-information
v-if="showView === '基本信息' && refData.name" v-if="showView === '基本信息' && refData.name"
@ -356,6 +364,25 @@
type: '组件服务', type: '组件服务',
deptId: '', deptId: '',
}) })
const required = ref([
'归属部门',
'部门联系人',
'部门联系人电话',
'应用领域',
'共享条件',
'算法名称',
'算法描述',
'图层名称',
'图层描述',
'组件名称',
'组件描述',
'组件地址',
'服务地址',
'服务接口',
'接口请求方式',
'算法类别',
])
const notFilled = ref([])
getUser().then((res) => { getUser().then((res) => {
dataFrom.value.deptId = res.data.data.deptId dataFrom.value.deptId = res.data.data.deptId
}) })
@ -374,18 +401,58 @@
}) })
} }
const next = () => { const next = () => {
let i = -1 notFilled.value = []
navList.value.forEach((val, index) => { console.log(dataFrom.value, 'dataFrom.value.name')
if (val.key === showView.value && index < navList.value.length - 1) { if (!dataFrom.value.name) {
i = index + 1 notFilled.value.push('算法名称')
}
if (!dataFrom.value.description) {
notFilled.value.push('算法描述')
}
if (!dataFrom.value.shareCondition) {
notFilled.value.push('共享条件')
}
if (!dataFrom.value.deptContacts) {
notFilled.value.push('部门联系人')
}
if (!dataFrom.value.deptPhone) {
notFilled.value.push('部门联系人电话')
}
if (
!dataFrom.value.infoList.filter(
(val) => val.attrType === '算法类别'
)[0] ||
!dataFrom.value.infoList.filter((val) => val.attrType === '算法类别')[0]
.attrValue
) {
notFilled.value.push('算法类别')
}
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 {
let i = -1
navList.value.forEach((val, index) => {
if (val.key === showView.value && index < navList.value.length - 1) {
i = index + 1
}
})
if (i !== -1) {
showView.value = navList2.value[i]
refData.value = data.value.filter(
(item) => item.name === showView.value
)[0]
console.log('表单数据=============>', dataFrom.value, refData.value)
} }
})
if (i !== -1) {
showView.value = navList2.value[i]
refData.value = data.value.filter(
(item) => item.name === showView.value
)[0]
console.log('表单数据=============>', dataFrom.value, refData.value)
} }
} }
// //
@ -401,40 +468,65 @@
window.open(newpage.href, '_blank') window.open(newpage.href, '_blank')
} }
const submit = () => { const submit = () => {
console.log('提交数据=============>', dataFrom.value) notFilled.value = []
if (submitFlag.value) { console.log(dataFrom.value, 'dataFrom.value.name')
submitFlag.value = false if (
dataFrom.value.infoList = dataFrom.value.infoList.filter( dataFrom.value.infoList.filter((val) => val.attrType === '使用方式')[0] &&
(item) => item.attrValue !== '' dataFrom.value.infoList.filter((val) => val.attrType === '使用方式')[0]
) .attrValue == '调用接口'
shangjiainsert(dataFrom.value).then((res) => { ) {
const instanceId = res.data.data if (
dataFrom.value.id = res.data.data !dataFrom.value.infoList.filter(
getUser().then((res6) => { (val) => val.attrType === '服务接口'
getUserInfo(res6.data.data.id).then((res2) => { )[0] ||
const deptId = dataFrom.value.deptId !dataFrom.value.infoList.filter((val) => val.attrType === '服务接口')[0]
const userId = res2.data.data.id .attrValue
const userName = res2.data.data.realName ) {
const params = { notFilled.value.push('服务接口')
instanceId: instanceId, }
deptId: deptId, if (!dataFrom.value.apiMethodType) {
userId: userId, notFilled.value.push('接口请求方式')
userName: userName, }
resourceDTO: [dataFrom.value], }
} if (notFilled.value.length > 0) {
shangjiaapply(params).then((res3) => { message.warning('请填写必填字段')
console.log('res3', res3) console.log(notFilled.value)
if (res3.data.code == 0) { } else {
message.success('上架申请提交成功,请注意查看消息通知!') console.log('提交数据=============>', dataFrom.value)
window.setTimeout(() => { if (submitFlag.value) {
window.close() submitFlag.value = false
submitFlag.value = true dataFrom.value.infoList = dataFrom.value.infoList.filter(
}, 1000) (item) => item.attrValue !== ''
)
shangjiainsert(dataFrom.value).then((res) => {
const instanceId = res.data.data
dataFrom.value.id = res.data.data
getUser().then((res6) => {
getUserInfo(res6.data.data.id).then((res2) => {
const deptId = dataFrom.value.deptId
const userId = res2.data.data.id
const userName = res2.data.data.realName
const params = {
instanceId: instanceId,
deptId: deptId,
userId: userId,
userName: userName,
resourceDTO: [dataFrom.value],
} }
shangjiaapply(params).then((res3) => {
console.log('res3', res3)
if (res3.data.code == 0) {
message.success('上架申请提交成功,请注意查看消息通知!')
window.setTimeout(() => {
window.close()
submitFlag.value = true
}, 1000)
}
})
}) })
}) })
}) })
}) }
} }
} }
const init = () => { const init = () => {

View File

@ -36,6 +36,8 @@
'部门联系人', '部门联系人',
'部门联系人电话', '部门联系人电话',
]" ]"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
<put-on-the-shelf <put-on-the-shelf
v-else-if="showView === '功能介绍'" v-else-if="showView === '功能介绍'"
@ -45,6 +47,8 @@
:configure="gnjs" :configure="gnjs"
@next="next()" @next="next()"
@back="back()" @back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
<put-on-the-shelf <put-on-the-shelf
v-else-if="showView === '关联组件'" v-else-if="showView === '关联组件'"
@ -54,6 +58,8 @@
:configure="glzj" :configure="glzj"
@next="next()" @next="next()"
@back="back()" @back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
<put-on-the-shelf <put-on-the-shelf
ref="refPutOnTheShelf" ref="refPutOnTheShelf"
@ -64,6 +70,8 @@
:configure="bs" :configure="bs"
@submit="submit()" @submit="submit()"
@back="back()" @back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
<!-- <application-essential-information <!-- <application-essential-information
v-if="showView === '基本信息' && refData.name" v-if="showView === '基本信息' && refData.name"
@ -260,6 +268,18 @@
], ],
}, },
]) ])
const required = ref([
'归属部门',
'部门联系人',
'部门联系人电话',
'应用领域',
'共享条件',
'应用名称',
'应用描述',
'应用状态',
'应用类型',
])
const notFilled = ref([])
getUser().then((res) => { getUser().then((res) => {
dataFrom.value.deptId = res.data.data.deptId dataFrom.value.deptId = res.data.data.deptId
}) })
@ -275,18 +295,73 @@
}) })
} }
const next = () => { const next = () => {
let i = -1 notFilled.value = []
navList.value.forEach((val, index) => { console.log(dataFrom.value, notFilled.value, 'dataFrom.value.name')
if (val.key === showView.value && index < navList.value.length - 1) { if (!dataFrom.value.name) {
i = index + 1 notFilled.value.push('应用名称')
}
if (!dataFrom.value.description) {
notFilled.value.push('应用描述')
}
if (!dataFrom.value.deptContacts) {
notFilled.value.push('部门联系人')
}
if (!dataFrom.value.deptPhone) {
notFilled.value.push('部门联系人电话')
}
if (
!dataFrom.value.infoList.filter(
(val) => val.attrType === '应用领域'
)[0] ||
!dataFrom.value.infoList.filter((val) => val.attrType === '应用领域')[0]
.attrValue
) {
notFilled.value.push('应用领域')
}
if (
!dataFrom.value.infoList.filter(
(val) => val.attrType === '应用状态'
)[0] ||
!dataFrom.value.infoList.filter((val) => val.attrType === '应用状态')[0]
.attrValue
) {
notFilled.value.push('应用状态')
}
if (
!dataFrom.value.infoList.filter(
(val) => val.attrType === '应用类型'
)[0] ||
!dataFrom.value.infoList.filter((val) => val.attrType === '应用类型')[0]
.attrValue
) {
notFilled.value.push('应用类型')
}
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 {
let i = -1
navList.value.forEach((val, index) => {
if (val.key === showView.value && index < navList.value.length - 1) {
i = index + 1
}
})
if (i !== -1) {
showView.value = navList2.value[i]
refData.value = data.value.filter(
(item) => item.name === showView.value
)[0]
console.log('表单数据=============>', dataFrom.value, refData.value)
} }
})
if (i !== -1) {
showView.value = navList2.value[i]
refData.value = data.value.filter(
(item) => item.name === showView.value
)[0]
console.log('表单数据=============>', dataFrom.value, refData.value)
} }
} }
const submit = () => { const submit = () => {

View File

@ -37,6 +37,8 @@
'部门联系人', '部门联系人',
'部门联系人电话', '部门联系人电话',
]" ]"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
<put-on-the-shelf <put-on-the-shelf
v-else-if="showView === '功能介绍'" v-else-if="showView === '功能介绍'"
@ -46,6 +48,8 @@
:configure="gnjs" :configure="gnjs"
@next="next()" @next="next()"
@back="back()" @back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
<put-on-the-shelf <put-on-the-shelf
v-else-if="showView === '应用场景'" v-else-if="showView === '应用场景'"
@ -55,6 +59,8 @@
:configure="yycj" :configure="yycj"
@next="next()" @next="next()"
@back="back()" @back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
<put-on-the-shelf <put-on-the-shelf
v-else-if="showView === '部署与使用'" v-else-if="showView === '部署与使用'"
@ -67,6 +73,8 @@
:configure="bs" :configure="bs"
@submit="submit()" @submit="submit()"
@back="back()" @back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
</div> </div>
<div class="btn" :class="showView === '基本信息' ? 'first' : ''"> <div class="btn" :class="showView === '基本信息' ? 'first' : ''">
@ -327,6 +335,25 @@
type: '组件服务', type: '组件服务',
deptId: '', deptId: '',
}) })
const required = ref([
'归属部门',
'部门联系人',
'部门联系人电话',
'应用领域',
'共享条件',
'算法名称',
'算法描述',
'图层名称',
'图层描述',
'组件名称',
'组件描述',
'组件地址',
'服务地址',
'服务接口',
'接口请求方式',
'算法类别',
])
const notFilled = ref([])
const close = () => { const close = () => {
window.close() window.close()
@ -346,18 +373,49 @@
}) })
} }
const next = () => { const next = () => {
let i = -1 notFilled.value = []
navList.value.forEach((val, index) => { console.log(dataFrom.value, 'dataFrom.value.name')
if (val.key === showView.value && index < navList.value.length - 1) { if (!dataFrom.value.name) {
i = index + 1 notFilled.value.push('组件名称')
}
if (!dataFrom.value.description) {
notFilled.value.push('组件描述')
}
if (!dataFrom.value.shareCondition) {
notFilled.value.push('共享条件')
}
if (!dataFrom.value.deptContacts) {
notFilled.value.push('部门联系人')
}
if (!dataFrom.value.deptPhone) {
notFilled.value.push('部门联系人电话')
}
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 {
let i = -1
navList.value.forEach((val, index) => {
if (val.key === showView.value && index < navList.value.length - 1) {
i = index + 1
}
})
if (i !== -1) {
showView.value = navList2.value[i]
refData.value = data.value.filter(
(item) => item.name === showView.value
)[0]
console.log('表单数据=============>', dataFrom.value, refData.value)
} }
})
if (i !== -1) {
showView.value = navList2.value[i]
refData.value = data.value.filter(
(item) => item.name === showView.value
)[0]
console.log('表单数据=============>', dataFrom.value, refData.value)
} }
} }
// //
@ -373,40 +431,56 @@
window.open(newpage.href, '_blank') window.open(newpage.href, '_blank')
} }
const submit = () => { const submit = () => {
console.log('提交数据=============>', dataFrom.value) notFilled.value = []
if (submitFlag.value) { console.log(dataFrom.value, 'dataFrom.value.name')
submitFlag.value = false if (
dataFrom.value.infoList = dataFrom.value.infoList.filter( !dataFrom.value.infoList.filter(
(item) => item.attrValue !== '' (val) => val.attrType === '组件地址'
) )[0] ||
shangjiainsert(dataFrom.value).then((res) => { !dataFrom.value.infoList.filter((val) => val.attrType === '组件地址')[0]
const instanceId = res.data.data .attrValue
dataFrom.value.id = res.data.data ) {
getUser().then((res6) => { notFilled.value.push('组件地址')
getUserInfo(res6.data.data.id).then((res2) => { }
const deptId = dataFrom.value.deptId if (notFilled.value.length > 0) {
const userId = res2.data.data.id message.warning('请填写必填字段')
const userName = res2.data.data.realName console.log(notFilled.value)
const params = { } else {
instanceId: instanceId, console.log('提交数据=============>', dataFrom.value)
deptId: deptId, if (submitFlag.value) {
userId: userId, submitFlag.value = false
userName: userName, dataFrom.value.infoList = dataFrom.value.infoList.filter(
resourceDTO: [dataFrom.value], (item) => item.attrValue !== ''
} )
shangjiaapply(params).then((res3) => { shangjiainsert(dataFrom.value).then((res) => {
console.log('res3', res3) const instanceId = res.data.data
if (res3.data.code == 0) { dataFrom.value.id = res.data.data
message.success('上架申请提交成功,请注意查看消息通知!') getUser().then((res6) => {
window.setTimeout(() => { getUserInfo(res6.data.data.id).then((res2) => {
window.close() const deptId = dataFrom.value.deptId
submitFlag.value = true const userId = res2.data.data.id
}, 1000) const userName = res2.data.data.realName
const params = {
instanceId: instanceId,
deptId: deptId,
userId: userId,
userName: userName,
resourceDTO: [dataFrom.value],
} }
shangjiaapply(params).then((res3) => {
console.log('res3', res3)
if (res3.data.code == 0) {
message.success('上架申请提交成功,请注意查看消息通知!')
window.setTimeout(() => {
window.close()
submitFlag.value = true
}, 1000)
}
})
}) })
}) })
}) })
}) }
} }
} }
// //

View File

@ -37,6 +37,8 @@
'部门联系人', '部门联系人',
'部门联系人电话', '部门联系人电话',
]" ]"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
<put-on-the-shelf <put-on-the-shelf
v-else-if="showView === '功能介绍'" v-else-if="showView === '功能介绍'"
@ -46,6 +48,8 @@
:configure="gnjs" :configure="gnjs"
@next="next()" @next="next()"
@back="back()" @back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
<put-on-the-shelf <put-on-the-shelf
v-else-if="showView === '应用场景'" v-else-if="showView === '应用场景'"
@ -55,6 +59,8 @@
:configure="yycj" :configure="yycj"
@next="next()" @next="next()"
@back="back()" @back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
<put-on-the-shelf <put-on-the-shelf
v-else-if="showView === '部署与使用'" v-else-if="showView === '部署与使用'"
@ -66,6 +72,8 @@
:configure="bs" :configure="bs"
@submit="submit()" @submit="submit()"
@back="back()" @back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
</div> </div>
<div class="btn" :class="showView === '基本信息' ? 'first' : ''"> <div class="btn" :class="showView === '基本信息' ? 'first' : ''">
@ -326,6 +334,25 @@
type: '组件服务', type: '组件服务',
deptId: '', deptId: '',
}) })
const required = ref([
'归属部门',
'部门联系人',
'部门联系人电话',
'应用领域',
'共享条件',
'算法名称',
'算法描述',
'图层名称',
'图层描述',
'组件名称',
'组件描述',
'组件地址',
'服务地址',
'服务接口',
'接口请求方式',
'算法类别',
])
const notFilled = ref([])
const close = () => { const close = () => {
window.close() window.close()
@ -345,18 +372,49 @@
}) })
} }
const next = () => { const next = () => {
let i = -1 notFilled.value = []
navList.value.forEach((val, index) => { console.log(dataFrom.value, 'dataFrom.value.name')
if (val.key === showView.value && index < navList.value.length - 1) { if (!dataFrom.value.name) {
i = index + 1 notFilled.value.push('组件名称')
}
if (!dataFrom.value.description) {
notFilled.value.push('组件描述')
}
if (!dataFrom.value.shareCondition) {
notFilled.value.push('共享条件')
}
if (!dataFrom.value.deptContacts) {
notFilled.value.push('部门联系人')
}
if (!dataFrom.value.deptPhone) {
notFilled.value.push('部门联系人电话')
}
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 {
let i = -1
navList.value.forEach((val, index) => {
if (val.key === showView.value && index < navList.value.length - 1) {
i = index + 1
}
})
if (i !== -1) {
showView.value = navList2.value[i]
refData.value = data.value.filter(
(item) => item.name === showView.value
)[0]
console.log('表单数据=============>', dataFrom.value, refData.value)
} }
})
if (i !== -1) {
showView.value = navList2.value[i]
refData.value = data.value.filter(
(item) => item.name === showView.value
)[0]
console.log('表单数据=============>', dataFrom.value, refData.value)
} }
} }
// //
@ -385,40 +443,56 @@
refPutOnTheShelf.value.add('常见问题', true, type) refPutOnTheShelf.value.add('常见问题', true, type)
} }
const submit = () => { const submit = () => {
console.log('提交数据=============>', dataFrom.value) notFilled.value = []
if (submitFlag.value) { console.log(dataFrom.value, 'dataFrom.value.name')
submitFlag.value = false if (
dataFrom.value.infoList = dataFrom.value.infoList.filter( !dataFrom.value.infoList.filter(
(item) => item.attrValue !== '' (val) => val.attrType === '组件地址'
) )[0] ||
shangjiainsert(dataFrom.value).then((res) => { !dataFrom.value.infoList.filter((val) => val.attrType === '组件地址')[0]
const instanceId = res.data.data .attrValue
dataFrom.value.id = res.data.data ) {
getUser().then((res6) => { notFilled.value.push('组件地址')
getUserInfo(res6.data.data.id).then((res2) => { }
const deptId = dataFrom.value.deptId if (notFilled.value.length > 0) {
const userId = res2.data.data.id message.warning('请填写必填字段')
const userName = res2.data.data.realName console.log(notFilled.value)
const params = { } else {
instanceId: instanceId, console.log('提交数据=============>', dataFrom.value)
deptId: deptId, if (submitFlag.value) {
userId: userId, submitFlag.value = false
userName: userName, dataFrom.value.infoList = dataFrom.value.infoList.filter(
resourceDTO: [dataFrom.value], (item) => item.attrValue !== ''
} )
shangjiaapply(params).then((res3) => { shangjiainsert(dataFrom.value).then((res) => {
console.log('res3', res3) const instanceId = res.data.data
if (res3.data.code == 0) { dataFrom.value.id = res.data.data
message.success('上架申请提交成功,请注意查看消息通知!') getUser().then((res6) => {
window.setTimeout(() => { getUserInfo(res6.data.data.id).then((res2) => {
window.close() const deptId = dataFrom.value.deptId
submitFlag.value = true const userId = res2.data.data.id
}, 1000) const userName = res2.data.data.realName
const params = {
instanceId: instanceId,
deptId: deptId,
userId: userId,
userName: userName,
resourceDTO: [dataFrom.value],
} }
shangjiaapply(params).then((res3) => {
console.log('res3', res3)
if (res3.data.code == 0) {
message.success('上架申请提交成功,请注意查看消息通知!')
window.setTimeout(() => {
window.close()
submitFlag.value = true
}, 1000)
}
})
}) })
}) })
}) })
}) }
} }
} }
const init = () => { const init = () => {

View File

@ -37,12 +37,16 @@
'部门联系人', '部门联系人',
'部门联系人电话', '部门联系人电话',
]" ]"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
<put-on-the-shelf <put-on-the-shelf
v-else-if="showView === '图层信息'" v-else-if="showView === '图层信息'"
ref="refPutOnTheShelf" ref="refPutOnTheShelf"
:refData="refData" :refData="refData"
:dataFrom="dataFrom" :dataFrom="dataFrom"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
<put-on-the-shelf <put-on-the-shelf
v-else-if="showView === '应用场景'" v-else-if="showView === '应用场景'"
@ -50,6 +54,8 @@
:refData="refData" :refData="refData"
:dataFrom="dataFrom" :dataFrom="dataFrom"
:configure="yycj" :configure="yycj"
:required="required"
:notFilled="notFilled"
@next="next()" @next="next()"
@back="back()" @back="back()"
></put-on-the-shelf> ></put-on-the-shelf>
@ -63,6 +69,8 @@
:configure="bs" :configure="bs"
@submit="submit()" @submit="submit()"
@back="back()" @back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf> ></put-on-the-shelf>
</div> </div>
<div class="btn" :class="showView === '基本信息' ? 'first' : ''"> <div class="btn" :class="showView === '基本信息' ? 'first' : ''">
@ -224,6 +232,26 @@
type: '组件服务', type: '组件服务',
deptId: '', deptId: '',
}) })
const required = ref([
'归属部门',
'部门联系人',
'部门联系人电话',
'应用领域',
'共享条件',
'算法名称',
'算法描述',
'图层名称',
'图层描述',
'组件名称',
'组件描述',
'组件地址',
'服务地址',
'服务接口',
'接口请求方式',
'算法类别',
])
const notFilled = ref([])
getUser().then((res) => { getUser().then((res) => {
dataFrom.value.deptId = res.data.data.deptId dataFrom.value.deptId = res.data.data.deptId
}) })
@ -243,18 +271,49 @@
window.close() window.close()
} }
const next = () => { const next = () => {
let i = -1 notFilled.value = []
navList.value.forEach((val, index) => { console.log(dataFrom.value, 'dataFrom.value.name')
if (val.key === showView.value && index < navList.value.length - 1) { if (!dataFrom.value.name) {
i = index + 1 notFilled.value.push('图层名称')
}
if (!dataFrom.value.description) {
notFilled.value.push('图层描述')
}
if (!dataFrom.value.shareCondition) {
notFilled.value.push('共享条件')
}
if (!dataFrom.value.deptContacts) {
notFilled.value.push('部门联系人')
}
if (!dataFrom.value.deptPhone) {
notFilled.value.push('部门联系人电话')
}
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 {
let i = -1
navList.value.forEach((val, index) => {
if (val.key === showView.value && index < navList.value.length - 1) {
i = index + 1
}
})
if (i !== -1) {
showView.value = navList2.value[i]
refData.value = data.value.filter(
(item) => item.name === showView.value
)[0]
console.log('表单数据=============>', dataFrom.value, refData.value)
} }
})
if (i !== -1) {
showView.value = navList2.value[i]
refData.value = data.value.filter(
(item) => item.name === showView.value
)[0]
console.log('表单数据=============>', dataFrom.value, refData.value)
} }
} }
// //
@ -280,40 +339,56 @@
refPutOnTheShelf.value.add('常见问题', true, type) refPutOnTheShelf.value.add('常见问题', true, type)
} }
const submit = () => { const submit = () => {
console.log('提交数据=============>', dataFrom.value) notFilled.value = []
if (submitFlag.value) { console.log(dataFrom.value, 'dataFrom.value.name')
submitFlag.value = false if (
dataFrom.value.infoList = dataFrom.value.infoList.filter( !dataFrom.value.infoList.filter(
(item) => item.attrValue !== '' (val) => val.attrType === '服务地址'
) )[0] ||
shangjiainsert(dataFrom.value).then((res) => { !dataFrom.value.infoList.filter((val) => val.attrType === '服务地址')[0]
const instanceId = res.data.data .attrValue
dataFrom.value.id = res.data.data ) {
getUser().then((res6) => { notFilled.value.push('服务地址')
getUserInfo(res6.data.data.id).then((res2) => { }
const deptId = dataFrom.value.deptId if (notFilled.value.length > 0) {
const userId = res2.data.data.id message.warning('请填写必填字段')
const userName = res2.data.data.realName console.log(notFilled.value)
const params = { } else {
instanceId: instanceId, console.log('提交数据=============>', dataFrom.value)
deptId: deptId, if (submitFlag.value) {
userId: userId, submitFlag.value = false
userName: userName, dataFrom.value.infoList = dataFrom.value.infoList.filter(
resourceDTO: [dataFrom.value], (item) => item.attrValue !== ''
} )
shangjiaapply(params).then((res3) => { shangjiainsert(dataFrom.value).then((res) => {
console.log('res3', res3) const instanceId = res.data.data
if (res3.data.code == 0) { dataFrom.value.id = res.data.data
message.success('上架申请提交成功,请注意查看消息通知!') getUser().then((res6) => {
window.setTimeout(() => { getUserInfo(res6.data.data.id).then((res2) => {
window.close() const deptId = dataFrom.value.deptId
submitFlag.value = true const userId = res2.data.data.id
}, 1000) const userName = res2.data.data.realName
const params = {
instanceId: instanceId,
deptId: deptId,
userId: userId,
userName: userName,
resourceDTO: [dataFrom.value],
} }
shangjiaapply(params).then((res3) => {
console.log('res3', res3)
if (res3.data.code == 0) {
message.success('上架申请提交成功,请注意查看消息通知!')
window.setTimeout(() => {
window.close()
submitFlag.value = true
}, 1000)
}
})
}) })
}) })
}) })
}) }
} }
} }
const init = () => { const init = () => {

View File

@ -204,7 +204,7 @@
<template v-else> <template v-else>
<div class="bottom"> <div class="bottom">
<div <div
class="form" class="form item"
v-for="item in title.children" v-for="item in title.children"
:key="item.id" :key="item.id"
v-show=" v-show="
@ -220,189 +220,221 @@
) )
" "
> >
<span>{{ item.name }}</span> <div class="box">
<a-input <div>
v-if="item.type == 'input' && item.name.indexOf('名称') == -1" <b class="required" v-if="required.indexOf(item.name) > -1">
v-model:value="item.note1" *
:placeholder="'请输入' + item.name" </b>
/> {{ item.name }}
<a-input
v-else-if="
item.type == 'input' && item.name.indexOf('名称') != -1
"
:maxLength="50"
v-model:value="item.note1"
:placeholder="'请输入' + item.name + '不超过50个字符'"
/>
<a-radio-group
v-else-if="item.type == 'radio'"
v-model:value="item.note1"
:options="item.options"
/>
<a-input
v-else-if="item.type == 'AbilityType'"
v-model:value="item.note1"
:placeholder="'请输入' + item.name"
:disabled="true"
/>
<a-input
v-else-if="item.type == 'ComponentType'"
v-model:value="item.note1"
:placeholder="'请输入' + item.name"
:disabled="true"
/>
<a-textarea
v-else-if="item.type == 'textArea'"
v-model:value="item.note1"
:showCount="true"
:maxlength="200"
:placeholder="'请输入' + item.name"
/>
<upload
v-else-if="item.type == 'image'"
type="图片"
btnName="上传图片"
:maxCount="1"
:data="item"
:list="props.imgList"
tip="支持图片类型大小不超过100M"
></upload>
<upload
v-else-if="item.type == 'file' && item.name !== '使用手册'"
type="文件"
btnName="上传附件"
:maxCount="1"
:data="item"
:list="props.fileList"
tip="支持文件类型大小不超过100M"
></upload>
<upload
v-else-if="item.name == '使用手册'"
type="文件"
btnName="上传附件"
:maxCount="1"
:data="item"
:busType="2"
:list="props.fileList2"
tip="支持文件类型大小不超过100M"
></upload>
<upload
v-else-if="item.type == 'package'"
type="压缩包"
btnName="上传安装包"
:maxCount="1"
:data="item"
:list="props.packageList"
tip="支持.zip类型"
></upload>
<div
class="Technical-text"
v-else-if="item.type == 'richText'"
@click="showTextFunction()"
>
编辑富文本
<div
v-if="showText"
class="fuwenbenbianjiqi"
style="position: absolute; z-index: 10000"
>
<VueTemplateDemo :dataFrom="props.dataFrom"></VueTemplateDemo>
</div> </div>
</div> <a-input
<upload v-if="item.type == 'input' && item.name.indexOf('名称') == -1"
v-else-if="item.type == 'video'" v-model:value="item.note1"
type="视频" :placeholder="'请输入' + item.name"
btnName="上传视频" @change="changeIiem(name, data.note1)"
:maxCount="1" />
:data="item" <a-input
:list="props.videoList" v-else-if="
tip="支持视频类型大小不超过100M" item.type == 'input' && item.name.indexOf('名称') != -1
></upload> "
<!-- <a-button :maxLength="50"
v-model:value="item.note1"
:placeholder="'请输入' + item.name + '不超过50个字符'"
@change="changeIiem(name, data.note1)"
/>
<a-radio-group
v-else-if="item.type == 'radio'"
v-model:value="item.note1"
:options="item.options"
/>
<a-input
v-else-if="item.type == 'AbilityType'"
v-model:value="item.note1"
:placeholder="'请输入' + item.name"
:disabled="true"
/>
<a-input
v-else-if="item.type == 'ComponentType'"
v-model:value="item.note1"
:placeholder="'请输入' + item.name"
:disabled="true"
/>
<a-textarea
v-else-if="item.type == 'textArea'"
v-model:value="item.note1"
:showCount="true"
:maxlength="200"
:placeholder="'请输入' + item.name"
/>
<upload
v-else-if="item.type == 'image'"
type="图片"
btnName="上传图片"
:maxCount="1"
:data="item"
:list="props.imgList"
tip="支持图片类型大小不超过100M"
></upload>
<upload
v-else-if="item.type == 'file' && item.name !== '使用手册'"
type="文件"
btnName="上传附件"
:maxCount="1"
:data="item"
:list="props.fileList"
tip="支持文件类型大小不超过100M"
></upload>
<upload
v-else-if="item.name == '使用手册'"
type="文件"
btnName="上传附件"
:maxCount="1"
:data="item"
:busType="2"
:list="props.fileList2"
tip="支持文件类型大小不超过100M"
></upload>
<upload
v-else-if="item.type == 'package'"
type="压缩包"
btnName="上传安装包"
:maxCount="1"
:data="item"
:list="props.packageList"
tip="支持.zip类型"
></upload>
<div
class="Technical-text"
v-else-if="item.type == 'richText'"
@click="showTextFunction()"
>
编辑富文本
<div
v-if="showText"
class="fuwenbenbianjiqi"
style="position: absolute; z-index: 10000"
>
<VueTemplateDemo :dataFrom="props.dataFrom"></VueTemplateDemo>
</div>
</div>
<upload
v-else-if="item.type == 'video'"
type="视频"
btnName="上传视频"
:maxCount="1"
:data="item"
:list="props.videoList"
tip="支持视频类型大小不超过100M"
></upload>
<!-- <a-button
v-else-if="item.type == 'AssociatedApplication'" v-else-if="item.type == 'AssociatedApplication'"
@click="sourceClick" @click="sourceClick"
> >
请选择来源应用 请选择来源应用
</a-button> --> </a-button> -->
<a-select <a-select
v-else-if="item.type == 'select' && item.name == '来源应用'" v-else-if="item.type == 'select' && item.name == '来源应用'"
style="width: 2.4rem" style="width: 2.4rem"
v-model:value="item.note1" v-model:value="item.note1"
show-search show-search
placeholder="请输入关键字" placeholder="请输入关键字"
:options="item.options" :options="item.options"
:filter-option="applicationsOption" :filter-option="applicationsOption"
@focus="applicationsFocus" @focus="applicationsFocus"
@blur="applicationsBlur" @blur="applicationsBlur"
@change="applicationsChange" @change="applicationsChange"
></a-select> ></a-select>
<a-button <a-button
v-else-if="item.type == 'AssociatedComponents'" v-else-if="item.type == 'AssociatedComponents'"
@click="componentsClick" @click="componentsClick"
>
请选择关联组件
</a-button>
<a-select
v-else-if="item.type == 'select' && item.name == '使用方式'"
style="width: 2.4rem"
v-model:value="item.note1"
:placeholder="'请选择' + item.name"
@change="showTypeClick"
>
<a-select-option
v-for="(itemSelect, indexSelect) in item.options"
:key="indexSelect"
:value="itemSelect.dictLabel"
> >
{{ itemSelect.dictLabel }} 请选择关联组件
</a-select-option> </a-button>
</a-select> <a-select
<a-select v-else-if="item.type == 'select' && item.name == '使用方式'"
v-else-if="item.type == 'select' && item.name !== '归属部门'" style="width: 2.4rem"
style="width: 2.4rem" v-model:value="item.note1"
v-model:value="item.note1" :placeholder="'请选择' + item.name"
:placeholder="'请选择' + item.name" @change="showTypeClick"
>
<a-select-option
v-for="(itemSelect, indexSelect) in item.options"
:key="indexSelect"
:value="itemSelect.dictLabel"
> >
{{ itemSelect.dictLabel }} <a-select-option
</a-select-option> v-for="(itemSelect, indexSelect) in item.options"
</a-select> :key="indexSelect"
<a-select :value="itemSelect.dictLabel"
v-else-if="item.name === '归属部门'" >
style="width: 2.4rem" {{ itemSelect.dictLabel }}
v-model:value="item.note1" </a-select-option>
show-search </a-select>
placeholder="请输入关键字" <a-select
:options="item.options" v-else-if="item.type == 'select' && item.name !== '归属部门'"
:filter-option="filterOption" style="width: 2.4rem"
@focus="handleFocus" v-model:value="item.note1"
@blur="handleBlur" :placeholder="'请选择' + item.name"
@change="handleChange2" @change="changeIiem(name, data.note1)"
></a-select> >
<div <a-select-option
v-else-if="item.type == 'checkBox'" v-for="(itemSelect, indexSelect) in item.options"
class="application-Area" :key="indexSelect"
id="application-Area" :value="itemSelect.dictLabel"
:key="showKey" >
> {{ itemSelect.dictLabel }}
</a-select-option>
</a-select>
<a-select
v-else-if="item.name === '归属部门'"
style="width: 2.4rem"
v-model:value="item.note1"
show-search
placeholder="请输入关键字"
:options="item.options"
:filter-option="filterOption"
@focus="handleFocus"
@blur="handleBlur"
@change="changeIiem(name, data.note1)"
></a-select>
<div <div
v-for="(itemson, indexson) in item.options" v-else-if="item.type == 'checkBox'"
:key="indexson" class="application-Area"
class="application-Area-son" id="application-Area"
@click="ApplicationArea(item, itemson)" :key="showKey"
:class="
item.note2.indexOf(itemson.dictLabel) != -1
? 'application-Area-down'
: ''
"
> >
{{ itemson.dictLabel }} <div
v-for="(itemson, indexson) in item.options"
:key="indexson"
class="application-Area-son"
@click="ApplicationArea(item, itemson)"
:class="
item.note2.indexOf(itemson.dictLabel) != -1
? 'application-Area-down'
: ''
"
>
{{ itemson.dictLabel }}
</div>
</div> </div>
</div> </div>
<div
class="requiredTips"
v-show="
notFilled.indexOf(item.name) > -1 &&
(item.type == 'input' || item.type == 'textArea') &&
changeField.indexOf(item.name) == -1
"
>
请填写{{ item.name }}
</div>
<div
class="requiredTips"
v-show="
notFilled.indexOf(item.name) > -1 &&
(item.type == 'select' ||
item.type == 'checkBox' ||
item.type == 'radio') &&
changeField.indexOf(item.name) == -1
"
>
请选择{{ item.name }}
</div>
</div> </div>
<!-- 来源应用 --> <!-- 来源应用 -->
<div class="AssociatedApplication"> <div class="AssociatedApplication">
@ -466,7 +498,6 @@
import upload from '@/views/components/upload' import upload from '@/views/components/upload'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import { getUserInfo, getDeptAll } from '@/api/user' import { getUserInfo, getDeptAll } from '@/api/user'
import VueTemplateDemo from '@/views/personalCenter/VueTemplateDemo.vue'
import { import {
getCategoryTreePage, getCategoryTreePage,
queryApplicationRelByResourceId, queryApplicationRelByResourceId,
@ -477,6 +508,7 @@
const router = useRouter() const router = useRouter()
const abilityToType = router.currentRoute.value.query.abilityToType const abilityToType = router.currentRoute.value.query.abilityToType
const componentTypeValue = router.currentRoute.value.query.componentTypeValue const componentTypeValue = router.currentRoute.value.query.componentTypeValue
const changeField = ref([])
const props = defineProps({ const props = defineProps({
// //
refData: { type: Object, default: null }, refData: { type: Object, default: null },
@ -495,6 +527,8 @@
externalField: { type: Array, default: null }, externalField: { type: Array, default: null },
// //
configure: { type: Array, default: null }, configure: { type: Array, default: null },
required: { type: Array, default: null },
notFilled: { type: Array, default: null },
// [{ // [{
// name:'', // name:'',
// list:[ // list:[
@ -551,6 +585,15 @@
const radioChange = (e) => { const radioChange = (e) => {
numType.value = e.target.value numType.value = e.target.value
} }
const changeIiem = (name, value) => {
if (value && value !== '' && changeField.value.indexOf(name) == -1) {
changeField.value.push(name)
} else if (!value || value == '') {
if (changeField.value.indexOf(name) > -1) {
changeField.value.splice(changeField.value.indexOf(name), 1)
}
}
}
props.refData.children.map((item) => { props.refData.children.map((item) => {
if (item.name == '基本信息') { if (item.name == '基本信息') {
item.children.map((val) => { item.children.map((val) => {
@ -979,9 +1022,6 @@
} }
}) })
}) })
const handleChange2 = (value) => {
console.log(`selected ${value}`)
}
const applicationsChange = (value) => { const applicationsChange = (value) => {
data.value.list.map((item) => { data.value.list.map((item) => {
if (item.name === '来源应用') { if (item.name === '来源应用') {
@ -1275,4 +1315,31 @@
cursor: pointer; cursor: pointer;
} }
} }
.item {
position: relative;
span:first-child {
width: unset;
}
.box {
display: flex;
align-items: center;
// margin: 15px 0;
& > div:nth-of-type(1) {
width: 105px;
display: flex;
align-items: center;
}
.required {
color: #f56c6c;
margin-right: 3px;
}
}
.requiredTips {
font-size: 14px;
color: #f56c6c;
position: absolute;
bottom: -20px;
left: 110px;
}
}
</style> </style>

View File

@ -287,7 +287,7 @@
message.config({ message.config({
top: '100px', // top: '100px', //
}) })
message.error('暂未上传使用手册') message.error('暂未开放使用手册')
} }
} }
function SDKClick() { function SDKClick() {
@ -300,7 +300,7 @@
message.config({ message.config({
top: '100px', // top: '100px', //
}) })
message.error('SDK安装包') message.error('暂未上传SDK安装包')
} }
} }
</script> </script>

View File

@ -204,7 +204,7 @@
message.config({ message.config({
top: '100px', // top: '100px', //
}) })
message.error('暂未上传接口文档') message.error('暂未开放技术文档')
} }
} }
function technicalNew() { function technicalNew() {
@ -228,7 +228,7 @@
message.config({ message.config({
top: '100px', // top: '100px', //
}) })
message.error('暂未上传使用手册') message.error('暂未开放新手指引')
} }
} }
</script> </script>