|
@@ -21,30 +21,7 @@ export default {
|
|
|
props: {
|
|
props: {
|
|
|
localData: {
|
|
localData: {
|
|
|
type: Array,
|
|
type: Array,
|
|
|
- default: [{
|
|
|
|
|
- text: "一年级",
|
|
|
|
|
- value: "1-0",
|
|
|
|
|
- children: [{
|
|
|
|
|
- text: "1.1班",
|
|
|
|
|
- value: "1-1"
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- text: "1.2班",
|
|
|
|
|
- value: "1-2"
|
|
|
|
|
- }]
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- text: "二年级",
|
|
|
|
|
- value: "2-0",
|
|
|
|
|
- children: [{
|
|
|
|
|
- text: "2.1班",
|
|
|
|
|
- value: "2-1"
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- text: "2.2班",
|
|
|
|
|
- value: "2-2"
|
|
|
|
|
- }]
|
|
|
|
|
- }]
|
|
|
|
|
|
|
+ default: []
|
|
|
},
|
|
},
|
|
|
label: {
|
|
label: {
|
|
|
type: String,
|
|
type: String,
|
|
@@ -88,6 +65,7 @@ export default {
|
|
|
this.setValue()
|
|
this.setValue()
|
|
|
},
|
|
},
|
|
|
'inputValue': function () {
|
|
'inputValue': function () {
|
|
|
|
|
+ console.log(this.inputValue)
|
|
|
if(this.valueType==='1'){
|
|
if(this.valueType==='1'){
|
|
|
this.$emit('input', this.inputValue.join(','))
|
|
this.$emit('input', this.inputValue.join(','))
|
|
|
}else {
|
|
}else {
|
|
@@ -98,22 +76,24 @@ export default {
|
|
|
methods: {
|
|
methods: {
|
|
|
setValue(){
|
|
setValue(){
|
|
|
let value=this.value
|
|
let value=this.value
|
|
|
- if(typeof value==='string'){
|
|
|
|
|
|
|
+ if(!value){
|
|
|
|
|
+ value=[]
|
|
|
|
|
+ }else if(typeof value==='string'){
|
|
|
value=value.split(',')
|
|
value=value.split(',')
|
|
|
}
|
|
}
|
|
|
if(this.inputValue!==value){
|
|
if(this.inputValue!==value){
|
|
|
this.inputValue=value
|
|
this.inputValue=value
|
|
|
this.optionName = "";
|
|
this.optionName = "";
|
|
|
this.localData.forEach((one)=>{
|
|
this.localData.forEach((one)=>{
|
|
|
- if(one.value===this.inputValue[0]){
|
|
|
|
|
|
|
+ if(one.value+''===this.inputValue[0]+''){
|
|
|
this.optionName += one.text + " ";
|
|
this.optionName += one.text + " ";
|
|
|
if(one.children){
|
|
if(one.children){
|
|
|
one.children.forEach((two)=>{
|
|
one.children.forEach((two)=>{
|
|
|
- if(two.value===this.inputValue[1]){
|
|
|
|
|
|
|
+ if(two.value+''===this.inputValue[1]+''){
|
|
|
this.optionName += two.text + " ";
|
|
this.optionName += two.text + " ";
|
|
|
if(two.children){
|
|
if(two.children){
|
|
|
two.children.forEach((three)=>{
|
|
two.children.forEach((three)=>{
|
|
|
- if(three.value===this.inputValue[2]){
|
|
|
|
|
|
|
+ if(three.value+''===this.inputValue[2]+''){
|
|
|
this.optionName += three.text + " ";
|
|
this.optionName += three.text + " ";
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -130,7 +110,6 @@ export default {
|
|
|
this.showPicker = false;
|
|
this.showPicker = false;
|
|
|
},
|
|
},
|
|
|
showPickerObj() {
|
|
showPickerObj() {
|
|
|
- console.log(this.$refs.pickerObj)
|
|
|
|
|
this.$refs.pickerObj.show();
|
|
this.$refs.pickerObj.show();
|
|
|
this.showPicker = true;
|
|
this.showPicker = true;
|
|
|
},
|
|
},
|
|
@@ -158,7 +137,9 @@ export default {
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
@import url("../../static/css/en-common.css");
|
|
@import url("../../static/css/en-common.css");
|
|
|
-
|
|
|
|
|
|
|
+::v-deep .selected-item-active{
|
|
|
|
|
+ border-bottom: 2px solid #FF0000 !important;
|
|
|
|
|
+}
|
|
|
.box {
|
|
.box {
|
|
|
.input-box {
|
|
.input-box {
|
|
|
display: flex;
|
|
display: flex;
|