Compare commits

...

2 Commits

Author SHA1 Message Date
gaoyuanwei 837641ba79 Merge branch 'hi-ucs-dev' of http://15.2.21.221:3000/wuhongjian/hi-ucs into hi-ucs-dev 2022-07-26 10:09:16 +08:00
gaoyuanwei 73ed69f315 前台必填项设置 2022-07-26 10:07:39 +08:00
8 changed files with 740 additions and 338 deletions

View File

@ -37,6 +37,8 @@
'部门联系人',
'部门联系人电话',
]"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
<put-on-the-shelf
v-else-if="showView === '算法优势'"
@ -46,6 +48,8 @@
:configure="sfys"
@next="next()"
@back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
<put-on-the-shelf
v-else-if="showView === '应用场景'"
@ -55,6 +59,8 @@
:configure="yycj"
@next="next()"
@back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
<put-on-the-shelf
v-else-if="showView === '部署与使用'"
@ -68,6 +74,8 @@
:configure="bs"
@submit="submit()"
@back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
<!-- <algorithm-essential-information
v-if="showView === '基本信息' && refData.name"
@ -356,6 +364,25 @@
type: '组件服务',
deptId: '',
})
const required = ref([
'归属部门',
'部门联系人',
'部门联系人电话',
'应用领域',
'共享条件',
'算法名称',
'算法描述',
'图层名称',
'图层描述',
'组件名称',
'组件描述',
'组件地址',
'服务地址',
'服务接口',
'接口请求方式',
'算法类别',
])
const notFilled = ref([])
getUser().then((res) => {
dataFrom.value.deptId = res.data.data.deptId
})
@ -374,18 +401,58 @@
})
}
const next = () => {
let i = -1
navList.value.forEach((val, index) => {
if (val.key === showView.value && index < navList.value.length - 1) {
i = index + 1
notFilled.value = []
console.log(dataFrom.value, 'dataFrom.value.name')
if (!dataFrom.value.name) {
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')
}
const submit = () => {
console.log('提交数据=============>', dataFrom.value)
if (submitFlag.value) {
submitFlag.value = false
dataFrom.value.infoList = dataFrom.value.infoList.filter(
(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)
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 {
console.log('提交数据=============>', dataFrom.value)
if (submitFlag.value) {
submitFlag.value = false
dataFrom.value.infoList = dataFrom.value.infoList.filter(
(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 = () => {

View File

@ -37,6 +37,8 @@
'部门联系人电话',
'共享条件',
]"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
<put-on-the-shelf
v-else-if="showView === '功能介绍'"
@ -46,6 +48,8 @@
:configure="gnjs"
@next="next()"
@back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
<put-on-the-shelf
v-else-if="showView === '关联组件'"
@ -55,6 +59,8 @@
:configure="glzj"
@next="next()"
@back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
<put-on-the-shelf
ref="refPutOnTheShelf"
@ -65,6 +71,8 @@
:configure="bs"
@submit="submit()"
@back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
<!-- <application-essential-information
v-if="showView === '基本信息' && refData.name"
@ -261,6 +269,18 @@
],
},
])
const required = ref([
'归属部门',
'部门联系人',
'部门联系人电话',
'应用领域',
'共享条件',
'应用名称',
'应用描述',
'应用状态',
'应用类型',
])
const notFilled = ref([])
getUser().then((res) => {
dataFrom.value.deptId = res.data.data.deptId
})
@ -276,18 +296,73 @@
})
}
const next = () => {
let i = -1
navList.value.forEach((val, index) => {
if (val.key === showView.value && index < navList.value.length - 1) {
i = index + 1
notFilled.value = []
console.log(dataFrom.value, notFilled.value, 'dataFrom.value.name')
if (!dataFrom.value.name) {
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 = () => {

View File

@ -37,6 +37,8 @@
'部门联系人',
'部门联系人电话',
]"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
<put-on-the-shelf
v-else-if="showView === '功能介绍'"
@ -46,6 +48,8 @@
:configure="gnjs"
@next="next()"
@back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
<put-on-the-shelf
v-else-if="showView === '应用场景'"
@ -55,6 +59,8 @@
:configure="yycj"
@next="next()"
@back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
<put-on-the-shelf
v-else-if="showView === '部署与使用'"
@ -67,6 +73,8 @@
:configure="bs"
@submit="submit()"
@back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
</div>
<div class="btn" :class="showView === '基本信息' ? 'first' : ''">
@ -327,6 +335,25 @@
type: '组件服务',
deptId: '',
})
const required = ref([
'归属部门',
'部门联系人',
'部门联系人电话',
'应用领域',
'共享条件',
'算法名称',
'算法描述',
'图层名称',
'图层描述',
'组件名称',
'组件描述',
'组件地址',
'服务地址',
'服务接口',
'接口请求方式',
'算法类别',
])
const notFilled = ref([])
const close = () => {
window.close()
@ -346,18 +373,49 @@
})
}
const next = () => {
let i = -1
navList.value.forEach((val, index) => {
if (val.key === showView.value && index < navList.value.length - 1) {
i = index + 1
notFilled.value = []
console.log(dataFrom.value, 'dataFrom.value.name')
if (!dataFrom.value.name) {
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')
}
const submit = () => {
console.log('提交数据=============>', dataFrom.value)
if (submitFlag.value) {
submitFlag.value = false
dataFrom.value.infoList = dataFrom.value.infoList.filter(
(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)
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 {
console.log('提交数据=============>', dataFrom.value)
if (submitFlag.value) {
submitFlag.value = false
dataFrom.value.infoList = dataFrom.value.infoList.filter(
(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)
}
})
})
})
})
})
}
}
}
//

View File

@ -37,6 +37,8 @@
'部门联系人',
'部门联系人电话',
]"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
<put-on-the-shelf
v-else-if="showView === '功能介绍'"
@ -46,6 +48,8 @@
:configure="gnjs"
@next="next()"
@back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
<put-on-the-shelf
v-else-if="showView === '应用场景'"
@ -55,6 +59,8 @@
:configure="yycj"
@next="next()"
@back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
<put-on-the-shelf
v-else-if="showView === '部署与使用'"
@ -66,6 +72,8 @@
:configure="bs"
@submit="submit()"
@back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
</div>
<div class="btn" :class="showView === '基本信息' ? 'first' : ''">
@ -326,6 +334,25 @@
type: '组件服务',
deptId: '',
})
const required = ref([
'归属部门',
'部门联系人',
'部门联系人电话',
'应用领域',
'共享条件',
'算法名称',
'算法描述',
'图层名称',
'图层描述',
'组件名称',
'组件描述',
'组件地址',
'服务地址',
'服务接口',
'接口请求方式',
'算法类别',
])
const notFilled = ref([])
const close = () => {
window.close()
@ -345,18 +372,49 @@
})
}
const next = () => {
let i = -1
navList.value.forEach((val, index) => {
if (val.key === showView.value && index < navList.value.length - 1) {
i = index + 1
notFilled.value = []
console.log(dataFrom.value, 'dataFrom.value.name')
if (!dataFrom.value.name) {
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)
}
const submit = () => {
console.log('提交数据=============>', dataFrom.value)
if (submitFlag.value) {
submitFlag.value = false
dataFrom.value.infoList = dataFrom.value.infoList.filter(
(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)
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 {
console.log('提交数据=============>', dataFrom.value)
if (submitFlag.value) {
submitFlag.value = false
dataFrom.value.infoList = dataFrom.value.infoList.filter(
(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 = () => {

View File

@ -37,12 +37,16 @@
'部门联系人',
'部门联系人电话',
]"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
<put-on-the-shelf
v-else-if="showView === '图层信息'"
ref="refPutOnTheShelf"
:refData="refData"
:dataFrom="dataFrom"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
<put-on-the-shelf
v-else-if="showView === '应用场景'"
@ -50,6 +54,8 @@
:refData="refData"
:dataFrom="dataFrom"
:configure="yycj"
:required="required"
:notFilled="notFilled"
@next="next()"
@back="back()"
></put-on-the-shelf>
@ -63,6 +69,8 @@
:configure="bs"
@submit="submit()"
@back="back()"
:required="required"
:notFilled="notFilled"
></put-on-the-shelf>
</div>
<div class="btn" :class="showView === '基本信息' ? 'first' : ''">
@ -224,6 +232,26 @@
type: '组件服务',
deptId: '',
})
const required = ref([
'归属部门',
'部门联系人',
'部门联系人电话',
'应用领域',
'共享条件',
'算法名称',
'算法描述',
'图层名称',
'图层描述',
'组件名称',
'组件描述',
'组件地址',
'服务地址',
'服务接口',
'接口请求方式',
'算法类别',
])
const notFilled = ref([])
getUser().then((res) => {
dataFrom.value.deptId = res.data.data.deptId
})
@ -243,18 +271,49 @@
window.close()
}
const next = () => {
let i = -1
navList.value.forEach((val, index) => {
if (val.key === showView.value && index < navList.value.length - 1) {
i = index + 1
notFilled.value = []
console.log(dataFrom.value, 'dataFrom.value.name')
if (!dataFrom.value.name) {
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)
}
const submit = () => {
console.log('提交数据=============>', dataFrom.value)
if (submitFlag.value) {
submitFlag.value = false
dataFrom.value.infoList = dataFrom.value.infoList.filter(
(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)
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 {
console.log('提交数据=============>', dataFrom.value)
if (submitFlag.value) {
submitFlag.value = false
dataFrom.value.infoList = dataFrom.value.infoList.filter(
(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 = () => {

View File

@ -122,130 +122,128 @@
tip="支持图片类型大小不超过100M"
v-else-if="val.type == 'image'"
></upload> -->
</div>
</div>
<!-- <div class="add" @click="add(title.name)">
添加更多{{ title.name }}
</div> -->
<div style="font-size: 0.18rem; font-weight: 600">
<span>{{ title.name }}-{{ data[title.name].length + 1 }}</span>
</div>
<div
class="form"
v-for="(val, index) in props.configure.filter(
(item) => item.name === title.name
)[0].list"
:key="'key3' + val.name + index"
>
<span>{{ val.name }}</span>
<a-input
v-model:value="val.note1"
:maxlength="24"
:placeholder="'请填写' + val.name + ',不超过24个字符'"
v-if="val.type == 'input'"
/>
<template v-if="val.type == 'input2'">
<a-input
v-model:value="val.note1"
:placeholder="'请填写' + val.name"
/>
<span style="width: 0.5rem; padding-left: 0.1rem">
{{
numType == '一次性买断'
? '元'
: numType == '按调用次数'
? '元/次'
: numType == '按并发路数'
? '元/路'
: numType == '按年计费'
? '元/年'
: ''
}}
</span>
</template>
<a-textarea
v-model:value="val.note1"
:showCount="true"
:maxlength="200"
:placeholder="'请填写' + val.name"
v-else-if="val.type == 'textArea'"
/>
<a-input-number
v-model:value="val.note1"
:min="0"
:max="9999"
:step="0.01"
string-mode
:placeholder="'请填写' + val.name"
v-else-if="val.type == 'number'"
/>
<a-radio-group
v-model:value="val.note1"
:options="val.options"
@change="radioChange"
v-else-if="val.type == 'radio'"
/>
<upload
:key="showKey"
type="图片"
btnName="上传图片"
:maxCount="1"
:data="val"
:list="[]"
tip="支持图片类型大小不超过100M"
v-else-if="val.type == 'image'"
></upload>
</div>
<div class="submit">
<a-button type="primary" @click="add(title.name)">
添加更多{{ title.name }}
</a-button>
</div>
</div>
</a-form>
<!-- <div class="add" @click="add(title.name)">
添加更多{{ title.name }}
</div> -->
<div style="font-size: 0.18rem; font-weight: 600">
<span>{{ title.name }}-{{ data[title.name].length + 1 }}</span>
</div>
<div
class="form"
v-for="(val, index) in props.configure.filter(
(item) => item.name === title.name
)[0].list"
:key="'key3' + val.name + index"
>
<span>{{ val.name }}</span>
<a-input
v-model:value="val.note1"
:maxlength="24"
:placeholder="'请填写' + val.name + ',不超过24个字符'"
v-if="val.type == 'input'"
/>
<template v-if="val.type == 'input2'">
<a-input
v-model:value="val.note1"
:placeholder="'请填写' + val.name"
/>
<span style="width: 0.5rem; padding-left: 0.1rem">
{{
numType == '一次性买断'
? '元'
: numType == '按调用次数'
? '元/次'
: numType == '按并发路数'
? '元/路'
: numType == '按年计费'
? '元/年'
: ''
}}
</span>
</template>
<a-textarea
v-model:value="val.note1"
:showCount="true"
:maxlength="200"
:placeholder="'请填写' + val.name"
v-else-if="val.type == 'textArea'"
/>
<a-input-number
v-model:value="val.note1"
:min="0"
:max="9999"
:step="0.01"
string-mode
:placeholder="'请填写' + val.name"
v-else-if="val.type == 'number'"
/>
<a-radio-group
v-model:value="val.note1"
:options="val.options"
@change="radioChange"
v-else-if="val.type == 'radio'"
/>
<upload
:key="showKey"
type="图片"
btnName="上传图片"
:maxCount="1"
:data="val"
:list="[]"
tip="支持图片类型大小不超过100M"
v-else-if="val.type == 'image'"
></upload>
</div>
<div class="submit">
<a-button type="primary" @click="add(title.name)">
添加更多{{ title.name }}
</a-button>
</div>
</div>
</template>
<template v-else>
<a-form>
<div class="bottom">
<div
class="form"
v-for="item in title.children"
:key="item.id"
v-show="
!(
(showType == '调用接口' && item.name == '平台地址') ||
(showType == '调用接口' && item.name == 'SDK安装包') ||
(showType == '平台对接' && item.name == 'SDK安装包') ||
(showType == '平台对接' && item.name == '接口请求方式') ||
(showType == '平台对接' && item.name == '服务接口') ||
(showType == 'SDK' && item.name == '平台地址') ||
(showType == 'SDK' && item.name == '接口请求方式') ||
(showType == 'SDK' && item.name == '服务接口')
)
"
>
<span v-if="item.name.indexOf('名称') == -1">
{{ item.name }}
</span>
<div class="bottom">
<div
class="form item"
v-for="item in title.children"
:key="item.id"
v-show="
!(
(showType == '调用接口' && item.name == '平台地址') ||
(showType == '调用接口' && item.name == 'SDK安装包') ||
(showType == '平台对接' && item.name == 'SDK安装包') ||
(showType == '平台对接' && item.name == '接口请求方式') ||
(showType == '平台对接' && item.name == '服务接口') ||
(showType == 'SDK' && item.name == '平台地址') ||
(showType == 'SDK' && item.name == '接口请求方式') ||
(showType == 'SDK' && item.name == '服务接口')
)
"
>
<div class="box">
<div>
<b class="required" v-if="required.indexOf(item.name) > -1">
*
</b>
{{ item.name }}
</div>
<a-input
v-if="item.type == 'input' && item.name.indexOf('名称') == -1"
v-model:value="item.note1"
:placeholder="'请输入' + item.name"
@change="changeIiem(name, data.note1)"
/>
<a-form-item
<a-input
v-else-if="
item.type == 'input' && item.name.indexOf('名称') != -1
"
:label="item.name"
name="username"
:rules="[{ required: true, message: '请输入名称' }]"
>
<a-input
:maxLength="50"
v-model:value="item.note1"
:placeholder="'请输入' + item.name + '不超过50个字符'"
/>
</a-form-item>
: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"
@ -374,6 +372,7 @@
style="width: 2.4rem"
v-model:value="item.note1"
:placeholder="'请选择' + item.name"
@change="changeIiem(name, data.note1)"
>
<a-select-option
v-for="(itemSelect, indexSelect) in item.options"
@ -393,7 +392,7 @@
:filter-option="filterOption"
@focus="handleFocus"
@blur="handleBlur"
@change="handleChange2"
@change="changeIiem(name, data.note1)"
></a-select>
<div
v-else-if="item.type == 'checkBox'"
@ -416,49 +415,27 @@
</div>
</div>
</div>
<!-- 来源应用 -->
<div class="AssociatedApplication">
<a-modal
v-model:visible="visibleAssociatedApplication"
:title="titleName"
@ok="handleOk"
@cancel="handleCancel"
style="width: 9.6rem"
>
<div>
<a-transfer
v-model:target-keys="targetKeys"
v-model:selected-keys="selectedKeys"
:data-source="mockData"
:titles="titles"
:render="(item) => item.title"
@change="handleChange"
@selectChange="handleSelectChange"
/>
</div>
</a-modal>
<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="AssociatedApplication">
<a-modal
v-model:visible="visibleAssociatedApplicationOther"
:title="titleName"
@ok="handleOk"
@cancel="handleCancel"
style="width: 960px"
>
<div>
<a-transfer
v-model:target-keys="targetKeysOther"
v-model:selected-keys="selectedKeysOther"
:data-source="mockDataOther"
:titles="titles"
:render="(item) => item.title"
@change="handleChangeOther"
@selectChange="handleSelectChangeOther"
/>
</div>
</a-modal>
<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>
</a-form>
@ -479,7 +456,6 @@
import upload from '@/views/components/upload'
import { message } from 'ant-design-vue'
import { getUserInfo, getDeptAll } from '@/api/user'
import VueTemplateDemo from '@/views/personalCenter/VueTemplateDemo.vue'
import {
getCategoryTreePage,
queryApplicationRelByResourceId,
@ -490,6 +466,7 @@
const router = useRouter()
const abilityToType = router.currentRoute.value.query.abilityToType
const componentTypeValue = router.currentRoute.value.query.componentTypeValue
const changeField = ref([])
const props = defineProps({
//
refData: { type: Object, default: null },
@ -508,6 +485,8 @@
externalField: { type: Array, default: null },
//
configure: { type: Array, default: null },
required: { type: Array, default: null },
notFilled: { type: Array, default: null },
// [{
// name:'',
// list:[
@ -564,6 +543,15 @@
const radioChange = (e) => {
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) => {
if (item.name == '基本信息') {
item.children.map((val) => {
@ -992,9 +980,6 @@
}
})
})
const handleChange2 = (value) => {
console.log(`selected ${value}`)
}
const applicationsChange = (value) => {
data.value.list.map((item) => {
if (item.name === '来源应用') {
@ -1288,4 +1273,31 @@
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>

View File

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

View File

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