BUG 27986
This commit is contained in:
@@ -1,12 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="AiSelect">
|
<section class="AiSelect">
|
||||||
<div class="display" v-if="$slots.default" @tap="handleShowOptions">
|
<picker :range="options" range-key="label" @change="handleConfirm" :disabled="disabled" :mode="mode">
|
||||||
<slot/>
|
<div class="display" v-if="$slots.default">
|
||||||
</div>
|
<slot/>
|
||||||
<div v-else class="display" @tap="handleShowOptions">
|
</div>
|
||||||
<u-icon :label="selectedLabel||placeholder" label-pos="left" name="arrow-right" color="#ddd"/>
|
<div v-else class="display">
|
||||||
</div>
|
<u-icon v-if="selectedLabel" :label="selectedLabel" label-pos="left" name="arrow-right" color="#ddd"/>
|
||||||
<u-select v-model="show" :list="options" :mode="mode" @confirm="handleConfirm"/>
|
<u-icon v-else :label="placeholder" label-pos="left" name="arrow-right" color="#ddd" label-color="#999"/>
|
||||||
|
</div>
|
||||||
|
</picker>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -21,14 +23,14 @@ export default {
|
|||||||
value: String,
|
value: String,
|
||||||
placeholder: {default: "请选择"},
|
placeholder: {default: "请选择"},
|
||||||
list: {default: () => []},
|
list: {default: () => []},
|
||||||
mode: {default: "single-column"},
|
mode: {default: "selector"},
|
||||||
dict: {default: ""},
|
dict: {default: ""},
|
||||||
disabled: Boolean
|
disabled: Boolean
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
selectedLabel() {
|
selectedLabel() {
|
||||||
let label = this.options.find(e => e.value == this.value)?.label
|
let label = this.options.find(e => e.value == this.value)?.label
|
||||||
return this.selected?.map(e => e.label)?.join(",") || label
|
return this.selected?.label || label
|
||||||
},
|
},
|
||||||
options() {
|
options() {
|
||||||
return this.dictKey ? this.$dict.getDict(this.dict).map(e => ({
|
return this.dictKey ? this.$dict.getDict(this.dict).map(e => ({
|
||||||
@@ -39,26 +41,23 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
show: false,
|
|
||||||
dictKey: '',
|
dictKey: '',
|
||||||
selected: []
|
selected: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
mounted() {
|
|
||||||
this.dict && this.$dict.load(this.dict).then(() => {
|
this.dict && this.$dict.load(this.dict).then(() => {
|
||||||
this.dictKey = this.dict
|
this.dictKey = this.dict
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleConfirm(v) {
|
handleConfirm(v) {
|
||||||
this.selected = v
|
if (this.mode == "selector") {
|
||||||
this.$emit("data", this.selected)
|
this.selected = this.options?.[v.detail?.value] || {}
|
||||||
this.$emit("input", v[0].value)
|
this.$emit("data", this.selected)
|
||||||
this.$forceUpdate()
|
this.$emit("input", this.selected.value)
|
||||||
},
|
}
|
||||||
handleShowOptions() {
|
|
||||||
if (!this.disabled) this.show = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="returnHomeRegister" v-if="pageShow">
|
<div class="returnHomeRegister">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<h2>全部记录</h2>
|
<h2>全部记录</h2>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<AiEmpty v-if="!list.length && isMore"></AiEmpty>
|
<AiEmpty v-if="!list.length && !isMore"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-wrapper">
|
<div class="btn-wrapper">
|
||||||
<div class="btn" @click="toReport" hover-class="text-hover">添加返乡记录</div>
|
<div class="btn" @click="toReport" hover-class="text-hover">添加返乡记录</div>
|
||||||
@@ -81,10 +81,11 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
getList() {
|
getList() {
|
||||||
if (this.isMore) return
|
if (this.isMore) return uni.hideLoading()
|
||||||
|
|
||||||
this.$instance.post(`/app/appepidemicbackhomerecord/list?openId=${this.user.openId}`, null, {
|
this.$instance.post(`/app/appepidemicbackhomerecord/list`, null, {
|
||||||
params: {
|
params: {
|
||||||
|
openId: this.user.openId,
|
||||||
current: this.current,
|
current: this.current,
|
||||||
size: 15
|
size: 15
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user