|
|
@@ -201,6 +201,7 @@
|
|
|
const majorOptions = ref([]) //专业
|
|
|
const courseOptions = ref([]) //课程
|
|
|
const userRelateIdss = ref([])
|
|
|
+ const myHot = ref({})
|
|
|
// 上传资源模态框
|
|
|
const uploadModalVisible = ref(true)
|
|
|
// 用户选择模态框
|
|
|
@@ -299,20 +300,46 @@
|
|
|
}
|
|
|
|
|
|
const handleRemoveKeyword = (keywordName, index) => {
|
|
|
- console.log(keywordName, index)
|
|
|
- // 1. 从显示列表中删除
|
|
|
- formState.keywordValue = formState.keywordValue.filter((name) => name !== keywordName)
|
|
|
- // 2. 更新checkbox的绑定值
|
|
|
- formState.keyword = HotKeywordsOptions.value
|
|
|
- .filter((option) => formState.keywordValue.includes(option.label))
|
|
|
- .map((item) => item.value)
|
|
|
+ console.log(keywordName, index,myHot.value)
|
|
|
+ // // 1. 从显示列表中删除
|
|
|
+ // formState.keywordValue = formState.keywordValue.filter((name) => name !== keywordName)
|
|
|
+ // // console.log('看看点击取消了什么',' formState.keywordValue ',formState.keywordValue)
|
|
|
+ // // formState.keyword
|
|
|
+ // // 2. 更新checkbox的绑定值
|
|
|
+ // formState.keyword = HotKeywordsOptions.value
|
|
|
+ // .filter((option) => formState.keywordValue.includes(option.label))
|
|
|
+ // .map((item) => item.value)
|
|
|
+ // // formState.keyword = formState.keyword.filter((item, i) => i !== index)
|
|
|
+ // // console.log('看看点123123',' formState.keyword ',formState.keyword,' index ',index)
|
|
|
+
|
|
|
+ let myId = myHot.value[keywordName]
|
|
|
+ // console.log('换算出来',formState.keyword,index)
|
|
|
+
|
|
|
+ for (let i = formState.keyword.length-1; i > 0 ; i--) {
|
|
|
+ // console.log('看看',formState.keyword[i] , i , index)
|
|
|
+ if( i == index){
|
|
|
+ formState.keyword.splice(i,1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // console.log('换算出来 结果',formState.keyword)
|
|
|
+
|
|
|
+ // formState.keyword.filter((item, i) => item != keywordName)
|
|
|
+ // formState.keyword = [{'专业' : 1}]
|
|
|
+ // formState.keyword.filter((item, i) => item != index)
|
|
|
+ // formState.keyword.filter((option) => formState.keywordValue.includes(option.value))
|
|
|
+ // .map((item) => item.label)
|
|
|
+ // console.log('换算出来 剩下',formState.keyword)
|
|
|
+ // console.log('还有吗',formState.keywordValue)
|
|
|
+
|
|
|
}
|
|
|
const getHotKeywords = () => {
|
|
|
+ myHot.value = {}
|
|
|
resourceAuditApi
|
|
|
.HotKeywords()
|
|
|
.then((res) => {
|
|
|
console.log(res.data, '获取热门关键词')
|
|
|
HotKeywordsOptions.value = res.data.map((it) => {
|
|
|
+ myHot.value[it.wordName] = it.id
|
|
|
return {
|
|
|
value: it.id,
|
|
|
label: it.wordName
|
|
|
@@ -337,9 +364,11 @@
|
|
|
}
|
|
|
const handleChangeKeyword = (checkedValues) => {
|
|
|
formState.keyword = checkedValues
|
|
|
+ console.log('点击checkbox',checkedValues )
|
|
|
formState.keywordValue = HotKeywordsOptions.value
|
|
|
.filter((option) => checkedValues.includes(option.value))
|
|
|
.map((item) => item.label)
|
|
|
+ console.log('点击checkbox 123 ',formState.keywordValue )
|
|
|
}
|
|
|
const setPublicStatus = (status) => {
|
|
|
formState.authType = status
|