地区选择器增加组

This commit is contained in:
aixianling
2022-06-16 15:52:44 +08:00
parent 393e780440
commit aea629e58a
2 changed files with 70 additions and 40 deletions

View File

@@ -49,7 +49,8 @@ export default {
}, },
valueLevel() { valueLevel() {
return this.$route.query.valueLevel || 5 return this.$route.query.valueLevel || 5
} },
extra: v => v.$route.query.extra
}, },
methods: { methods: {
getOptionsByRoot() { getOptionsByRoot() {
@@ -77,8 +78,17 @@ export default {
this.selectList.push(row) this.selectList.push(row)
this.options = res.data.map(e => ({...e, isChecked: !!this.selected[e.id]})) this.options = res.data.map(e => ({...e, isChecked: !!this.selected[e.id]}))
} }
row.locked = false }).finally(() => row.locked = false)
}) } else if (this.extra && !row.locked) {
row.locked = true
this.$http.post("/admin/appresident/queryAreaIdGroup", null, {
params: {currentAreaId: id}
}).then(res => {
if (res?.data) {
this.selectList.push(row)
this.options = res.data.map(id => ({id, name: id, isChecked: !!this.selected[id]}))
}
}).finally(() => row.locked = false)
} }
}, },
selectListClick(row, index) { selectListClick(row, index) {

View File

@@ -3,7 +3,7 @@
<div class="select-content"> <div class="select-content">
<div class="area-flex"> <div class="area-flex">
<p class="title">地区</p> <p class="title">地区</p>
<AiAreaPicker v-model="areaList" multiple class="value"> <AiAreaPicker v-model="areaList" multiple class="value" extra>
<span class="label" v-if="areaList.length">已选择</span> <span class="label" v-if="areaList.length">已选择</span>
<span v-else style="color:#999;">请选择</span> <span v-else style="color:#999;">请选择</span>
<u-icon name="arrow-right" color="#999" size="24" style="margin-left:8px;"/> <u-icon name="arrow-right" color="#999" size="24" style="margin-left:8px;"/>
@@ -30,7 +30,9 @@
<div class="type-list" v-for="(item, index) in tagList" :key="index"> <div class="type-list" v-for="(item, index) in tagList" :key="index">
<p>{{ item.name }}</p> <p>{{ item.name }}</p>
<div class="list"> <div class="list">
<div class="item" :class="items.isCheck ? 'active' : ''" v-for="(items, indexs) in item.tagList" :key="indexs" @click="typeClick(index, indexs)">{{items.name}}</div> <div class="item" :class="items.isCheck ? 'active' : ''" v-for="(items, indexs) in item.tagList" :key="indexs" @click="typeClick(index, indexs)">
{{ items.name }}
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -166,55 +168,67 @@ export default {
line-height: 44px; line-height: 44px;
margin-bottom: 16px; margin-bottom: 16px;
background-color: #fff; background-color: #fff;
.title { .title {
width: 150px; width: 150px;
margin-bottom: 0; margin-bottom: 0;
} }
.value { .value {
width: calc(100% - 150px); width: calc(100% - 150px);
text-align: right; text-align: right;
} }
} }
.area-content { .area-content {
padding: 16px 32px 32px; padding: 16px 32px 32px;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
.area-item { .area-item {
display: inline-block; display: inline-block;
margin-right: 16px; margin-right: 16px;
.u-icon { .u-icon {
margin-left: 4px; margin-left: 4px;
} }
} }
} }
.title { .title {
line-height: 44px; line-height: 44px;
margin-bottom: 16px; margin-bottom: 16px;
font-size: 32px; font-size: 32px;
color: #666; color: #666;
.tips { .tips {
font-size: 34px; font-size: 34px;
color: #f46; color: #f46;
vertical-align: middle; vertical-align: middle;
} }
} }
.local-icon { .local-icon {
width: 32px; width: 32px;
height: 32px; height: 32px;
margin-right: 4px; margin-right: 4px;
} }
.type-list { .type-list {
padding-left: 16px; padding-left: 16px;
margin-bottom: 16px; margin-bottom: 16px;
padding: 34px 32px 32px; padding: 34px 32px 32px;
background-color: #fff; background-color: #fff;
p { p {
line-height: 44px; line-height: 44px;
margin-bottom: 24px; margin-bottom: 24px;
font-size: 30px; font-size: 30px;
color: #666; color: #666;
} }
.list { .list {
overflow: hidden; overflow: hidden;
.item { .item {
padding: 12px 32px; padding: 12px 32px;
float: left; float: left;
@@ -226,6 +240,7 @@ export default {
border-radius: 4px; border-radius: 4px;
margin: 0 16px 16px 0; margin: 0 16px 16px 0;
} }
.active { .active {
background-color: #3192F4; background-color: #3192F4;
color: #fff; color: #fff;
@@ -233,9 +248,11 @@ export default {
} }
} }
} }
.bg-144 { .bg-144 {
height: 144px; height: 144px;
} }
.footer { .footer {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
@@ -247,16 +264,19 @@ export default {
display: flex; display: flex;
font-size: 36px; font-size: 36px;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
.confirm { .confirm {
color: #fff; color: #fff;
background: #1365dd; background: #1365dd;
} }
div { div {
flex: 1; flex: 1;
text-align: center; text-align: center;
color: #333; color: #333;
} }
} }
::v-deep .u-icon__label { ::v-deep .u-icon__label {
font-size: 28px !important; font-size: 28px !important;
} }