Commit 538b33e2 authored by 黄奎's avatar 黄奎

页面修改

parent dea4e41f
<template>
<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">
<q-item v-if="scope.index==0">
<q-item-section class="text-grey">
<q-tree :nodes="treeData" :node-key="nodeKey" :label-key="labelKey" :children-key="childrenKey"
tick-strategy="strict" :default-expand-all="defaultExpandAll" no-connectors
:ticked.sync="chooseTreeNodeArray">
</q-tree>
</q-item-section>
</q-item>
</template>
</q-select>
<template v-if="multiple">
<q-select filled v-model="resultObj" :options="selectList" clearable @clear="clearData()" :label="tipText"
:multiple="multiple" emit-value map-options>
<template v-slot:option="scope">
<q-item v-if="scope.index==0">
<q-item-section class="text-grey">
<q-tree :nodes="treeData" :node-key="nodeKey" :label-key="labelKey" :children-key="childrenKey"
tick-strategy="strict" :default-expand-all="defaultExpandAll" no-connectors
:ticked.sync="chooseTreeNodeArray">
</q-tree>
</q-item-section>
</q-item>
</template>
</q-select>
</template>
<template v-else>
<q-select filled v-model="resultObj[0]" :options="selectList" clearable @clear="clearData()" :label="tipText"
:multiple="multiple" emit-value map-options>
<template v-slot:option="scope">
<q-item v-if="scope.index==0">
<q-item-section class="text-grey">
<q-tree :nodes="treeData" :node-key="nodeKey" :label-key="labelKey" :children-key="childrenKey"
tick-strategy="strict" :default-expand-all="defaultExpandAll" no-connectors
:ticked.sync="chooseTreeNodeArray">
</q-tree>
</q-item-section>
</q-item>
</template>
</q-select>
</template>
</div>
</template>
<script>
......@@ -88,9 +106,9 @@
this.defaultArray.forEach(item => {
if (item != '') {
if (this.multiple) {
this.chooseTreeNodeArray.push(Number(item))
this.chooseTreeNodeArray.push(item)
} else {
this.chooseTreeNodeArray = [Number(item)];
this.chooseTreeNodeArray = [item];
}
}
})
......@@ -105,7 +123,7 @@
if (this.multiple) {
resultStr = this.resultObj.toString();
} else {
resultStr = this.resultObj[0]
resultStr = this.resultObj[0];
}
}
this.$emit('getChild', resultStr);
......@@ -153,8 +171,6 @@
label: ""
}];
}
console.log("this.selectList ", this.selectList);
console.log("resultObj", this.resultObj);
},
//获取树中所有节点
findTreeNode(tree) {
......
......@@ -82,12 +82,11 @@
this.objOption.CourseIntro = obj;
},
getChild(obj) {
// if (obj == "") {
// this.objOption.CateId = 0;
// } else
// {
// this.objOption.CateId = obj;
// }
if (obj == "") {
this.objOption.CateId = 0;
} else {
this.objOption.CateId = obj;
}
},
uploadFile(files) {
UploadSelfFile('course', files[0], res => {
......
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