|
@@ -65,10 +65,10 @@ p {
|
|
|
|
|
|
<template>
|
|
|
<div class="transfer">
|
|
|
+
|
|
|
<div class="transfer-box">
|
|
|
<div class="content-box">
|
|
|
<p class="content-title">兴趣分类</p>
|
|
|
-
|
|
|
<div class="content">
|
|
|
<p>
|
|
|
<input type="checkbox" class="select_all" @change="checkAllBox" v-model="checkAll" /> 全选
|
|
@@ -94,12 +94,14 @@ p {
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
<div
|
|
|
class="content-box"
|
|
|
:style="{borderRight:!showClass?'0px':'1px solid #dadfe3'}"
|
|
|
v-show="showCityData"
|
|
|
>
|
|
|
<p class="content-title">二级分类</p>
|
|
|
+
|
|
|
<div class="content">
|
|
|
<!-- <p>
|
|
|
<input
|
|
@@ -157,6 +159,14 @@ import $ from 'jquery'
|
|
|
export default {
|
|
|
name: 'ByteDanceUserOrientationTemplateList',
|
|
|
components: {},
|
|
|
+ props: {
|
|
|
+ dataValue: {
|
|
|
+ type: Array,
|
|
|
+ default() {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
showClass: false,
|
|
@@ -179,6 +189,27 @@ export default {
|
|
|
mounted() {
|
|
|
this.$nextTick(() => {
|
|
|
this.getData()
|
|
|
+ if (this.dataValue.length > 0) {
|
|
|
+ this.checkData = this.dataValue
|
|
|
+ this.checkMatched = this.dataValue.filter(item => {
|
|
|
+ if (item.value < 10090) {
|
|
|
+ return item.value
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.checkMatched = this.checkMatched.map(item => {
|
|
|
+ return item.value
|
|
|
+ })
|
|
|
+ this.checkMatchedCity = this.dataValue.filter(item => {
|
|
|
+ if (item.value > 10090) {
|
|
|
+ return item.value
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.checkMatchedCity = this.checkMatchedCity.map(item => {
|
|
|
+ return item.value
|
|
|
+ })
|
|
|
+ console.log(this.checkMatchedCity)
|
|
|
+ this.$emit('update:checkData', this.checkData)
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
@@ -305,18 +336,14 @@ export default {
|
|
|
},
|
|
|
checkOneCity(item, index) {
|
|
|
var allCity = this.checkMatchedCity.filter(v => {
|
|
|
- return v.toString().slice(0, 2) == this.nowProvince.value
|
|
|
+ return v.toString().substr(2, 1) == this.nowProvince.value.toString().substr(4, 1)
|
|
|
})
|
|
|
-
|
|
|
if (allCity.length == this.city.length) {
|
|
|
this.checkMatched.push(this.nowProvince.value)
|
|
|
this.checkData.push(this.nowProvince)
|
|
|
- for (var i = 0; i < this.checkMatchedCity.length; i++) {
|
|
|
+ for (var i = 0; i < allCity.length; i++) {
|
|
|
for (var j = 0; j < this.checkData.length; j++) {
|
|
|
- if (
|
|
|
- this.checkMatchedCity[i] == this.checkData[j].value &&
|
|
|
- this.checkMatchedCity[i].toString().slice(0, 2) == this.nowProvince.value
|
|
|
- ) {
|
|
|
+ if (allCity[i] == this.checkData[j].value) {
|
|
|
this.checkData.splice(j, 1)
|
|
|
j--
|
|
|
}
|