|
@@ -38,11 +38,14 @@
|
|
|
/>
|
|
/>
|
|
|
</a-form-item> -->
|
|
</a-form-item> -->
|
|
|
<a-form-item label="资源类型" name="resourceType" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
|
|
<a-form-item label="资源类型" name="resourceType" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
|
|
|
- <a-select
|
|
|
|
|
- v-model:value="formState.resourceType"
|
|
|
|
|
- style="width: 200px"
|
|
|
|
|
- :options="courseTypeOptions"
|
|
|
|
|
|
|
+ <a-cascader
|
|
|
|
|
+ style="width: 240px; margin-left: 8px"
|
|
|
|
|
+ v-model:value="resourceName"
|
|
|
|
|
+ :options="resourceTypeOptions"
|
|
|
|
|
+ :fieldNames="{ label: 'name', value: 'id', children: 'children' }"
|
|
|
placeholder="请选择资源类型"
|
|
placeholder="请选择资源类型"
|
|
|
|
|
+ changeOnSelect
|
|
|
|
|
+ @change="changeCollegeResource"
|
|
|
/>
|
|
/>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
<a-form-item
|
|
<a-form-item
|
|
@@ -159,7 +162,8 @@
|
|
|
coverImage: null, //封面id
|
|
coverImage: null, //封面id
|
|
|
// courseId: null, //课程
|
|
// courseId: null, //课程
|
|
|
// majorType: null, //专业
|
|
// majorType: null, //专业
|
|
|
- resourceType: null, //资源类型
|
|
|
|
|
|
|
+ resourceType: null, //资源类型一级
|
|
|
|
|
+ resourceTwoType: null, //资源类型二级
|
|
|
collegeId: null, //院校一级id
|
|
collegeId: null, //院校一级id
|
|
|
collegeTwoId: null, //院校二级id
|
|
collegeTwoId: null, //院校二级id
|
|
|
collegeThreeId: null, //院校三级id
|
|
collegeThreeId: null, //院校三级id
|
|
@@ -174,8 +178,10 @@
|
|
|
})
|
|
})
|
|
|
const formRef = ref() // 添加表单引用
|
|
const formRef = ref() // 添加表单引用
|
|
|
const collegeMajorOptions = ref([]) //院系
|
|
const collegeMajorOptions = ref([]) //院系
|
|
|
|
|
+ const resourceTypeOptions = ref([]) //资源类型下拉数据
|
|
|
const HotKeywordsOptions = ref([]) //热门关键词列表
|
|
const HotKeywordsOptions = ref([]) //热门关键词列表
|
|
|
const majorIdName = ref([]) //院系回显
|
|
const majorIdName = ref([]) //院系回显
|
|
|
|
|
+ const resourceName = ref([]) //资源回显
|
|
|
const majorOptions = ref([]) //专业
|
|
const majorOptions = ref([]) //专业
|
|
|
const courseOptions = ref([]) //课程
|
|
const courseOptions = ref([]) //课程
|
|
|
// 上传资源模态框
|
|
// 上传资源模态框
|
|
@@ -278,6 +284,18 @@
|
|
|
console.log(err)
|
|
console.log(err)
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
+ //资源类型下拉查询
|
|
|
|
|
+ const getResourceTypeTree = () => {
|
|
|
|
|
+ resourceAuditApi
|
|
|
|
|
+ .resourceTypeTree()
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ console.log(res.data, '资源类型下拉')
|
|
|
|
|
+ resourceTypeOptions.value = res.data
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
|
+ console.log(err)
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
const handleChangeKeyword = (checkedValues) => {
|
|
const handleChangeKeyword = (checkedValues) => {
|
|
|
formState.keyword = checkedValues
|
|
formState.keyword = checkedValues
|
|
|
formState.keywordValue = HotKeywordsOptions.value
|
|
formState.keywordValue = HotKeywordsOptions.value
|
|
@@ -332,6 +350,12 @@
|
|
|
getCollegeMajor(lastSelected.id)
|
|
getCollegeMajor(lastSelected.id)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ const changeCollegeResource = (value, selectedOptions) => {
|
|
|
|
|
+ console.log('Selected:', value, selectedOptions)
|
|
|
|
|
+ resourceName.value = selectedOptions.map((it) => it.name).join('/')
|
|
|
|
|
+ formState.resourceType = value[0] || null
|
|
|
|
|
+ formState.resourceTwoType = value[1] || null
|
|
|
|
|
+ }
|
|
|
const getCollegeMajor = (id) => {
|
|
const getCollegeMajor = (id) => {
|
|
|
resourceAuditApi
|
|
resourceAuditApi
|
|
|
.zyselect({ collegeId: id })
|
|
.zyselect({ collegeId: id })
|
|
@@ -357,6 +381,7 @@
|
|
|
id: props.resourcesId,
|
|
id: props.resourcesId,
|
|
|
userfileIds: formState.userfileIds,
|
|
userfileIds: formState.userfileIds,
|
|
|
resourceType: formState.resourceType,
|
|
resourceType: formState.resourceType,
|
|
|
|
|
+ resourceTwoType: formState.resourceTwoType,
|
|
|
collegeId: formState.collegeId,
|
|
collegeId: formState.collegeId,
|
|
|
collegeTwoId: formState.collegeTwoId,
|
|
collegeTwoId: formState.collegeTwoId,
|
|
|
collegeThreeId: formState.collegeThreeId,
|
|
collegeThreeId: formState.collegeThreeId,
|
|
@@ -396,10 +421,12 @@
|
|
|
resourceAuditApi.detail({ id: props.resourcesId }).then((res) => {
|
|
resourceAuditApi.detail({ id: props.resourcesId }).then((res) => {
|
|
|
console.log(res.data, '资源详情')
|
|
console.log(res.data, '资源详情')
|
|
|
formState.resourceType = res.data.resourceType
|
|
formState.resourceType = res.data.resourceType
|
|
|
|
|
+ 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(',')
|
|
majorIdName.value = res.data.collegeAllId.split(',')
|
|
|
|
|
+ resourceName.value.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
|
|
@@ -416,6 +443,7 @@
|
|
|
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(',')
|
|
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
|
|
@@ -476,6 +504,7 @@
|
|
|
getOrgTreeSelector()
|
|
getOrgTreeSelector()
|
|
|
getCourseAllList()
|
|
getCourseAllList()
|
|
|
getHotKeywords()
|
|
getHotKeywords()
|
|
|
|
|
+ getResourceTypeTree()
|
|
|
if (props.isState == 1) {
|
|
if (props.isState == 1) {
|
|
|
getDetail()
|
|
getDetail()
|
|
|
} else {
|
|
} else {
|