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

页面修改

parent dea4e41f
<template> <template>
<div style="width:300px" :id="id"> <div style="width:300px" :id="id">
<template v-if="multiple">
<q-select filled v-model="resultObj" :options="selectList" clearable @clear="clearData()" :label="tipText" <q-select filled v-model="resultObj" :options="selectList" clearable @clear="clearData()" :label="tipText"
:multiple="multiple" emit-value map-options> :multiple="multiple" emit-value map-options>
<template v-slot:option="scope"> <template v-slot:option="scope">
...@@ -13,6 +14,23 @@ ...@@ -13,6 +14,23 @@
</q-item> </q-item>
</template> </template>
</q-select> </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> </div>
</template> </template>
<script> <script>
...@@ -88,9 +106,9 @@ ...@@ -88,9 +106,9 @@
this.defaultArray.forEach(item => { this.defaultArray.forEach(item => {
if (item != '') { if (item != '') {
if (this.multiple) { if (this.multiple) {
this.chooseTreeNodeArray.push(Number(item)) this.chooseTreeNodeArray.push(item)
} else { } else {
this.chooseTreeNodeArray = [Number(item)]; this.chooseTreeNodeArray = [item];
} }
} }
}) })
...@@ -105,7 +123,7 @@ ...@@ -105,7 +123,7 @@
if (this.multiple) { if (this.multiple) {
resultStr = this.resultObj.toString(); resultStr = this.resultObj.toString();
} else { } else {
resultStr = this.resultObj[0] resultStr = this.resultObj[0];
} }
} }
this.$emit('getChild', resultStr); this.$emit('getChild', resultStr);
...@@ -153,8 +171,6 @@ ...@@ -153,8 +171,6 @@
label: "" label: ""
}]; }];
} }
console.log("this.selectList ", this.selectList);
console.log("resultObj", this.resultObj);
}, },
//获取树中所有节点 //获取树中所有节点
findTreeNode(tree) { findTreeNode(tree) {
......
...@@ -82,12 +82,11 @@ ...@@ -82,12 +82,11 @@
this.objOption.CourseIntro = obj; this.objOption.CourseIntro = obj;
}, },
getChild(obj) { getChild(obj) {
// if (obj == "") { if (obj == "") {
// this.objOption.CateId = 0; this.objOption.CateId = 0;
// } else } else {
// { this.objOption.CateId = obj;
// this.objOption.CateId = obj; }
// }
}, },
uploadFile(files) { uploadFile(files) {
UploadSelfFile('course', files[0], res => { 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