Commit dea4e41f authored by 黄奎's avatar 黄奎

组件修改

parent 2d7d0c82
<template>
<div style="max-width:300px">
<div style="width:300px" :id="id">
<q-select filled v-model="resultObj" :options="selectList" clearable @clear="clearData()" :label="tipText"
:multiple="multiple" emit-value map-options>
<template v-slot:option="scope">
......@@ -61,6 +61,7 @@
},
data() {
return {
id: 'selectTree' + (Math.floor((Math.random() * 10000) + 1)),
//下拉框列表
selectList: [{
value: "",
......@@ -87,9 +88,9 @@
this.defaultArray.forEach(item => {
if (item != '') {
if (this.multiple) {
this.chooseTreeNodeArray.push(item)
this.chooseTreeNodeArray.push(Number(item))
} else {
this.chooseTreeNodeArray = [item];
this.chooseTreeNodeArray = [Number(item)];
}
}
})
......@@ -99,7 +100,15 @@
immediate: true
},
resultObj(val) {
this.$emit('getChild', this.resultObj);
var resultStr = "";
if (this.resultObj && this.resultObj.length > 0) {
if (this.multiple) {
resultStr = this.resultObj.toString();
} else {
resultStr = this.resultObj[0]
}
}
this.$emit('getChild', resultStr);
}
},
mounted() {},
......@@ -129,8 +138,10 @@
});
if (this.multiple) {
this.resultObj.push(item.value);
this.$forceUpdate();
} else {
this.resultObj = [item.value];
this.$forceUpdate();
}
}
})
......@@ -142,11 +153,13 @@
label: ""
}];
}
console.log("this.selectList ", this.selectList);
console.log("resultObj", this.resultObj);
},
//获取所有节点
//获取树中所有节点
findTreeNode(tree) {
var temp = [];
var that = this;
var temp = [];
//获取子节点
var getChildNodes = function (tree) {
if (tree && tree.length > 0) {
......
......@@ -82,7 +82,12 @@
this.objOption.CourseIntro = obj;
},
getChild(obj) {
this.objOption.CateId = obj;
// if (obj == "") {
// this.objOption.CateId = 0;
// } else
// {
// this.objOption.CateId = obj;
// }
},
uploadFile(files) {
UploadSelfFile('course', files[0], res => {
......
......@@ -75,14 +75,9 @@
},
methods: {
getChild(menuArray) {
var tempStr = "";
if (menuArray && Array.isArray(menuArray) && menuArray.length > 0) {
menuArray.forEach(item => {
tempStr += "," + item;
})
}
if (tempStr != '') {
tempStr = tempStr.substring(1, tempStr.length);
var tempStr = "";
if (menuArray && menuArray != '') {
tempStr = menuArray;
}
this.objOption.RoleAuth = tempStr;
},
......
......@@ -61,7 +61,6 @@
</div>
</div>
</template>
<script>
import {
queryCoursePage,
......@@ -179,15 +178,10 @@
});
},
//分类改变
getChild(cateArray) {
getChild(cateObj) {
var tempStr = "";
if (cateArray && Array.isArray(cateArray) && cateArray.length > 0) {
cateArray.forEach(item => {
tempStr += "," + item;
})
}
if (tempStr != '') {
tempStr = tempStr.substring(1, tempStr.length);
if (cateObj && cateObj != '') {
tempStr = cateObj;
}
this.msg.QCateIds = tempStr;
this.msg.pageIndex = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment