|
@@ -116,7 +116,8 @@
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
<!-- 选择成员 -->
|
|
<!-- 选择成员 -->
|
|
|
<userSelection
|
|
<userSelection
|
|
|
- v-if="userReleaseVisible"
|
|
|
|
|
|
|
+ :visible="userReleaseVisible"
|
|
|
|
|
+ :userRelateIds="userRelateIdss"
|
|
|
@close="userReleaseVisible = false"
|
|
@close="userReleaseVisible = false"
|
|
|
@confirm="confirmUser"
|
|
@confirm="confirmUser"
|
|
|
></userSelection>
|
|
></userSelection>
|
|
@@ -179,7 +180,7 @@
|
|
|
keywordValue: [], // 添加关键词
|
|
keywordValue: [], // 添加关键词
|
|
|
keyword: [], // 热门关键词
|
|
keyword: [], // 热门关键词
|
|
|
authType: '0', // 资源是否公开
|
|
authType: '0', // 资源是否公开
|
|
|
- userRelateIds: [], //资源公开人员id
|
|
|
|
|
|
|
+ userRelateIds: null, //资源公开人员id
|
|
|
isRecommend: 0, // 资源是否推荐
|
|
isRecommend: 0, // 资源是否推荐
|
|
|
isHot: 0 // 资源是否热门
|
|
isHot: 0 // 资源是否热门
|
|
|
})
|
|
})
|
|
@@ -192,6 +193,7 @@
|
|
|
const resourceName = ref([]) //资源回显
|
|
const resourceName = ref([]) //资源回显
|
|
|
const majorOptions = ref([]) //专业
|
|
const majorOptions = ref([]) //专业
|
|
|
const courseOptions = ref([]) //课程
|
|
const courseOptions = ref([]) //课程
|
|
|
|
|
+ const userRelateIdss = ref([])
|
|
|
// 上传资源模态框
|
|
// 上传资源模态框
|
|
|
const uploadModalVisible = ref(true)
|
|
const uploadModalVisible = ref(true)
|
|
|
// 用户选择模态框
|
|
// 用户选择模态框
|
|
@@ -393,13 +395,14 @@
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
const confirmUser = (userIds) => {
|
|
const confirmUser = (userIds) => {
|
|
|
|
|
+ console.log(userIds, '用户id')
|
|
|
|
|
+ userReleaseVisible.value = false
|
|
|
formState.userRelateIds = userIds.join(',')
|
|
formState.userRelateIds = userIds.join(',')
|
|
|
}
|
|
}
|
|
|
// 确认上传
|
|
// 确认上传
|
|
|
const handleUploadOk = async () => {
|
|
const handleUploadOk = async () => {
|
|
|
try {
|
|
try {
|
|
|
await formRef.value.validate()
|
|
await formRef.value.validate()
|
|
|
-
|
|
|
|
|
if (!formState.userfileIds) {
|
|
if (!formState.userfileIds) {
|
|
|
Modal.error({ content: '请先上传文件!' })
|
|
Modal.error({ content: '请先上传文件!' })
|
|
|
return
|
|
return
|
|
@@ -419,7 +422,9 @@
|
|
|
isHot: formState.isHot,
|
|
isHot: formState.isHot,
|
|
|
isRecommend: formState.isRecommend,
|
|
isRecommend: formState.isRecommend,
|
|
|
coverImage: formState.coverImage,
|
|
coverImage: formState.coverImage,
|
|
|
- publicStatus: formState.publicStatus
|
|
|
|
|
|
|
+ publicStatus: formState.publicStatus,
|
|
|
|
|
+ authType: formState.authType,
|
|
|
|
|
+ userRelateIds: formState.authType == 1 ? formState.userRelateIds : null
|
|
|
}
|
|
}
|
|
|
resourceAuditApi
|
|
resourceAuditApi
|
|
|
.edit(formData)
|
|
.edit(formData)
|
|
@@ -445,8 +450,11 @@
|
|
|
isHot: formState.isHot,
|
|
isHot: formState.isHot,
|
|
|
isRecommend: formState.isRecommend,
|
|
isRecommend: formState.isRecommend,
|
|
|
coverImage: formState.coverImage,
|
|
coverImage: formState.coverImage,
|
|
|
- publicStatus: formState.publicStatus
|
|
|
|
|
|
|
+ publicStatus: formState.publicStatus,
|
|
|
|
|
+ authType: formState.authType,
|
|
|
|
|
+ userRelateIds: formState.authType == 1 ? formState.userRelateIds : null
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log(formData, '上传数据')
|
|
|
resourceAuditApi
|
|
resourceAuditApi
|
|
|
.add(formData)
|
|
.add(formData)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
@@ -474,6 +482,8 @@
|
|
|
resourceAuditApi.detail({ id: props.resourcesId }).then((res) => {
|
|
resourceAuditApi.detail({ id: props.resourcesId }).then((res) => {
|
|
|
console.log(res.data, '资源详情')
|
|
console.log(res.data, '资源详情')
|
|
|
formState.userfileIds = res.data.fileId
|
|
formState.userfileIds = res.data.fileId
|
|
|
|
|
+ formState.userRelateIds = res.data.userRelateIdList?.join(',')
|
|
|
|
|
+ userRelateIdss.value = res.data.userRelateIdList
|
|
|
formState.resourceType = res.data.resourceType
|
|
formState.resourceType = res.data.resourceType
|
|
|
formState.resourceTwoType = res.data.resourceTwoType
|
|
formState.resourceTwoType = res.data.resourceTwoType
|
|
|
formState.collegeId = res.data.collegeId
|
|
formState.collegeId = res.data.collegeId
|
|
@@ -481,12 +491,12 @@
|
|
|
coverImagePath.value = res.data.coverImagePath
|
|
coverImagePath.value = res.data.coverImagePath
|
|
|
formState.collegeTwoId = res.data.collegeTwoId
|
|
formState.collegeTwoId = res.data.collegeTwoId
|
|
|
formState.collegeThreeId = res.data.collegeThreeId
|
|
formState.collegeThreeId = res.data.collegeThreeId
|
|
|
- majorIdName.value = res.data.collegeAllId.split(',')
|
|
|
|
|
- resourceName.value = res.data.resourceALLTypeName.split(',')
|
|
|
|
|
|
|
+ majorIdName.value = res.data.collegeAllId?.split(',')
|
|
|
|
|
+ resourceName.value = res.data.resourceALLTypeName?.split(',')
|
|
|
getCollegeMajor(majorIdName.value[majorIdName.value.length - 1])
|
|
getCollegeMajor(majorIdName.value[majorIdName.value.length - 1])
|
|
|
formState.resourceDesc = res.data.resourceDesc
|
|
formState.resourceDesc = res.data.resourceDesc
|
|
|
// formState.majorId = res.data.majorId
|
|
// formState.majorId = res.data.majorId
|
|
|
- formState.keywordValue = res.data.keywordValue.split(',')
|
|
|
|
|
|
|
+ formState.keywordValue = res.data.keywordValue?.split(',')
|
|
|
formState.keyword = res.data.keyword.split(',').filter(Boolean).map(Number)
|
|
formState.keyword = res.data.keyword.split(',').filter(Boolean).map(Number)
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -495,17 +505,19 @@
|
|
|
resourceAuditApi.recentlyRecord().then((res) => {
|
|
resourceAuditApi.recentlyRecord().then((res) => {
|
|
|
console.log(res.data, '历史表单数据')
|
|
console.log(res.data, '历史表单数据')
|
|
|
formState.resourceType = res.data.resourceType
|
|
formState.resourceType = res.data.resourceType
|
|
|
|
|
+ formState.userRelateIds = res.data.userRelateIdList?.join(',')
|
|
|
|
|
+ userRelateIdss.value = res.data.userRelateIdList
|
|
|
formState.resourceTwoType = res.data.resourceTwoType
|
|
formState.resourceTwoType = res.data.resourceTwoType
|
|
|
formState.collegeId = res.data.collegeId
|
|
formState.collegeId = res.data.collegeId
|
|
|
formState.collegeTwoId = res.data.collegeTwoId
|
|
formState.collegeTwoId = res.data.collegeTwoId
|
|
|
formState.collegeThreeId = res.data.collegeThreeId
|
|
formState.collegeThreeId = res.data.collegeThreeId
|
|
|
- majorIdName.value = res.data.collegeAllId.split(',')
|
|
|
|
|
- resourceName.value = res.data.resourceAllType.split(',')
|
|
|
|
|
|
|
+ majorIdName.value = res.data.collegeAllId?.split(',')
|
|
|
|
|
+ resourceName.value = res.data.resourceAllType?.split(',')
|
|
|
getCollegeMajor(majorIdName.value[majorIdName.value.length - 1])
|
|
getCollegeMajor(majorIdName.value[majorIdName.value.length - 1])
|
|
|
formState.resourceDesc = res.data.resourceDesc
|
|
formState.resourceDesc = res.data.resourceDesc
|
|
|
// formState.majorId = res.data.majorId
|
|
// formState.majorId = res.data.majorId
|
|
|
- formState.keywordValue = res.data.keywordValue.split(',')
|
|
|
|
|
- formState.keyword = res.data.keyword.split(',').filter(Boolean).map(Number)
|
|
|
|
|
|
|
+ formState.keywordValue = res.data.keywordValue?.split(',')
|
|
|
|
|
+ formState.keyword = res.data.keyword?.split(',').filter(Boolean).map(Number)
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
// 上传前的钩子函数
|
|
// 上传前的钩子函数
|