@@ -346,7 +383,6 @@ import apiDict from "@/api/modules/dict.js";
import apiType from "@/api/modules/type.js";
import { cutFullName } from "@/utils/tools.js";
import apiPlace from "@/api/phase2/place.js"
-import TypeNav from "../../../components/TypeNav.vue";
export default {
name: "index",
components: {
@@ -355,11 +391,11 @@ export default {
portalFloatTools,
interactBar,
timeShow,
- author,
- TypeNav
+ author
},
data() {
return {
+ twoId:'',
treeList:[],
caseType:process.env.VUE_APP_CASE_TYPE,//类型
caseYears:[],
@@ -413,6 +449,9 @@ export default {
notInIds: [],//重复的id
orderField: "id",
orderAsc: false,//排序
+ sysType1:'',
+ sysType2:'',
+ sysType3:''
},
keyWord: "",
anking: 2,
@@ -478,6 +517,29 @@ export default {
list.push(item);
}
});
+ this.treeList.forEach(one => {
+ var twoChildChecked = false;//是否有下级
+ one.children && one.children.forEach(two => {
+ if (two.checked) {
+ twoChildChecked = true;
+ }
+ var threeChildChecked = false;
+ two.children && two.children.forEach(three => {
+ if (three.checked) {
+ list.push(three);
+ threeChildChecked = true;
+ }
+ });
+ if (two.checked && !threeChildChecked) {
+ list.push(two);
+ }
+ });
+ if (one.checked && !twoChildChecked) {
+ list.push(one);
+ }
+ })
+ console.log(list,'计算属性');
+
return list;
},
oneTagAll() {
@@ -644,32 +706,60 @@ export default {
},
methods: {
handleOptionClick(treeItem){
- console.log(treeItem);
this.treeList.forEach(one => {
one.checked = false;
if (one.id == treeItem.id) {
one.checked = true;
+ this.queryCondition.sysType2 = ''
+ this.queryCondition.sysType3 = ''
+ this.queryCondition.sysType1 = one.id
}
- one.children && one.children.forEach(two => {
+ one.children.forEach(two => {
two.checked = false;
if (two.id == treeItem.id) {
two.checked = true
+ this.queryCondition.sysType1 = ''
+ this.queryCondition.sysType3 = ''
+ this.queryCondition.sysType2 = two.id
}
- two.children && two.children.forEach(three => {
+ two.children.forEach(three => {
three.checked = false;
if (three.id == treeItem.id) {
three.checked = true
+ this.queryCondition.sysType1 = ''
+ this.queryCondition.sysType2 = ''
+ this.queryCondition.sysType3 = three.id
}
})
})
})
+ this.getCaseData()
+ },
+ // 移入
+ changeIndex(twoId) {
+ this.twoId = twoId
+ },
+ // 移除
+ leaveIndex() {
+ this.twoId = ''
},
// 加载分类
async loadTypeData() {
try {
const { result, status } = await apiType.tree(1);
if (status === 200) {
- console.log(result,'三级');
+ result.forEach(one => {
+ one.checked = false;
+ if(!one.children) one.children = []
+ one.children && one.children.forEach(two => {
+ two.checked = false;
+ if(!two.children) two.children = []
+ two.children && two.children.forEach(three => {
+ three.checked = false;
+ if(!three.children) three.children = []
+ })
+ })
+ })
this.treeList = result
}
} catch (error) {
@@ -1266,7 +1356,16 @@ export default {
// }
// },
tagsClose(tag, index) {
- tag.fielclass = false;
+ // 课程分类
+ if(tag.hasOwnProperty('checked')){
+ tag.checked = false;
+ this.queryCondition.sysType1 =''
+ this.queryCondition.sysType2 =''
+ this.queryCondition.sysType3 =''
+ }else{
+ // 案例分类
+ tag.fielclass = false;
+ }
if (tag.type == 0) {
this.keyWord = '';
}
@@ -1368,6 +1467,77 @@ export default {