提交 94a61565 编写于 作者: Neuromancer255's avatar Neuromancer255

数据选择(下拉视图)调整

上级 11e996fe
<template> <template>
<div v-if="overload" class="app-mobile-select-drop-down"> <div class="app-mobile-select-drop-down">
<div class="cancel-icon" v-if="curvalue"><ion-icon name="close-circle-outline" @click="clear"></ion-icon></div> <div class="cancel-icon" v-if="curvalue"><ion-icon name="close-circle-outline" @click="clear"></ion-icon></div>
<div v-if="curvalue== null || curvalue==''" class="ion-select-icon"></div> <div v-if="curvalue== null || curvalue==''" class="ion-select-icon"></div>
<ion-select :value="curvalue" :disabled="disabled " @click="onSearch(null)" @ionChange="change" interface="action-sheet" :cancel-text="$t('app.button.cancel')"> <ion-select :value="curvalue" :disabled="disabled " @click="onSearch(null)" @ionChange="change" interface="action-sheet" :cancel-text="$t('app.button.cancel')">
...@@ -169,23 +169,6 @@ export default class AppSelectDropDown extends Vue { ...@@ -169,23 +169,6 @@ export default class AppSelectDropDown extends Vue {
*/ */
@Prop({ default: {} }) protected navigateContext?: any; @Prop({ default: {} }) protected navigateContext?: any;
/**
* 表单请求完成
*
* @type {*}
* @memberof AppSelectDropDown
*/
@Prop() public dataOverLoad?: any;
/**
* 监听表单请求完成
* @memberof AppSelectDropDown
*/
@Watch("dataOverLoad")
onDataOverLoadChange(newVal: any, oldVal: any){
this.onSearch();
}
/** /**
* 当前值 * 当前值
* *
...@@ -239,8 +222,13 @@ export default class AppSelectDropDown extends Vue { ...@@ -239,8 +222,13 @@ export default class AppSelectDropDown extends Vue {
* @memberof AppSelectDropDown * @memberof AppSelectDropDown
*/ */
get refvalue() { get refvalue() {
if (this.valueitem && this.data) { if (this.valueitem && this.data && this.items.length > 0) {
return this.data[this.valueitem]; let index = this.items.indexOf(this.data[this.valueitem])
if(index !== -1){
return this.data[this.valueitem];
} else {
return this.curvalue;
}
} }
return this.curvalue; return this.curvalue;
} }
...@@ -279,14 +267,6 @@ export default class AppSelectDropDown extends Vue { ...@@ -279,14 +267,6 @@ export default class AppSelectDropDown extends Vue {
} }
} }
/**
* 加载完成
*
* @type {*}
* @memberof AppSelectDropDown
*/
public overload: boolean = false;
/** /**
* vue 生命周期 * vue 生命周期
* *
...@@ -336,7 +316,6 @@ export default class AppSelectDropDown extends Vue { ...@@ -336,7 +316,6 @@ export default class AppSelectDropDown extends Vue {
if (entityService && entityService[this.acParams.interfaceName] && entityService[this.acParams.interfaceName] instanceof Function) { if (entityService && entityService[this.acParams.interfaceName] && entityService[this.acParams.interfaceName] instanceof Function) {
const response = await entityService[this.acParams.interfaceName](_context, _param); const response = await entityService[this.acParams.interfaceName](_context, _param);
if (response && response.status === 200) { if (response && response.status === 200) {
this.overload = true;
this.items = response.data; this.items = response.data;
this.result(this.items); this.result(this.items);
} else { } else {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册