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