提交 6abf383b 编写于 作者: KK's avatar KK

解显示问题--fix

上级 ce23cf04
<template> <template>
<div class="app-mobile-select"> <div v-if="overload" class="app-mobile-select">
<ion-icon v-if="curValue" name="close-circle-outline" @click="clear"></ion-icon> <ion-icon v-if="curValue" name="close-circle-outline" @click="clear"></ion-icon>
<ion-select :value="curValue" :disabled="disabled ? disabled : false" @ionChange="change" interface="action-sheet" @click="load" :cancel-text="$t('app.button.cancel')"> <ion-select :value="curValue" :disabled="disabled ? disabled : false" @ionChange="change" interface="action-sheet" @click="load" :cancel-text="$t('app.button.cancel')">
<template v-if="codeListType == 'DYNAMIC'"> <template v-if="codeListType == 'DYNAMIC'">
...@@ -45,6 +45,9 @@ export default class AppSelect extends Vue { ...@@ -45,6 +45,9 @@ export default class AppSelect extends Vue {
return this.value return this.value
} }
set curValue(value:any){
this.$emit("change", value.detail.value);
}
/** /**
* change事件 * change事件
...@@ -133,7 +136,7 @@ export default class AppSelect extends Vue { ...@@ -133,7 +136,7 @@ export default class AppSelect extends Vue {
* 视图参数 * 视图参数
* *
* @type {*} * @type {*}
* @memberof AppMobMpicker * @memberof AppSelect
*/ */
@Prop() public viewparams!: any; @Prop() public viewparams!: any;
...@@ -145,6 +148,14 @@ export default class AppSelect extends Vue { ...@@ -145,6 +148,14 @@ export default class AppSelect extends Vue {
*/ */
public isCached: boolean = false; public isCached: boolean = false;
/**
* 加载完成
*
* @type {*}
* @memberof AppSelect
*/
public overload: boolean = false;
/** /**
* 监听表单数据 * 监听表单数据
* *
...@@ -160,25 +171,17 @@ export default class AppSelect extends Vue { ...@@ -160,25 +171,17 @@ export default class AppSelect extends Vue {
} }
/** /**
* vue 生命周期 * mounted
*
* @memberof AppSelect
*/ */
public created() { public mounted() {
if (Object.is(this.codeListType, "STATIC")) { if (Object.is(this.codeListType, "STATIC")) {
this.overload = true;
this.options = this.$store.getters.getCodeListItems(this.tag); this.options = this.$store.getters.getCodeListItems(this.tag);
} else { } else {
this.load(); this.load();
} }
} }
/**
* mounted
*/
public mounted() {
this.load();
}
/** /**
* 加载 * 加载
* *
...@@ -203,11 +206,13 @@ export default class AppSelect extends Vue { ...@@ -203,11 +206,13 @@ export default class AppSelect extends Vue {
Loading.hidden(); Loading.hidden();
} }
if (response && response.status === 200) { if (response && response.status === 200) {
this.overload = true;
this.options = response.data; this.options = response.data;
if (this.isCache) { if (this.isCache) {
this.isCached = true; this.isCached = true;
} }
} else { } else {
this.overload = true;
this.options = []; this.options = [];
} }
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册