提交 0f516d52 编写于 作者: zcdtk's avatar zcdtk

优化部分代码逻辑

上级 412b232d
<template>
<!-- <div :class="[{'hidden':this.refvalue !=''},'app-select-drop-down']">
<van-dropdown-menu>
<van-dropdown-item
@open="(query) => this.onSearch(query, true)"
v-model="refvalue"
:options="items"
:disabled="disabled ? disabled : false"
/>
</van-dropdown-menu>
<van-icon :style="{display :this.refvalue ==''? 'none' : 'block'}" @click="onClear" class="close_icon" name="cross" />
</div> -->
<div class="app-mobile-select-drop-down">
<ion-icon v-if="curvalue" name="close-circle-outline" @click="clear"></ion-icon>
<ion-select :value="curvalue" :disabled="disabled " @ionChange="change" interface="popover">
......@@ -300,25 +288,20 @@ export default class AppSelectDropDown extends Vue {
}
this.inputState = false;
Object.assign(_param, { query: query });
if(!this.service){
this.$notify({ type: 'danger', message: '错误,缺少参数service!' });
} else if(!this.acParams.serviceName) {
this.$notify({ type: 'danger', message: '错误,缺少参数serviceName!' });
} else if(!this.acParams.interfaceName) {
this.$notify({ type: 'danger', message: '错误,缺少参数interfaceName!' });
if (!this.acParams.serviceName || !this.acParams.interfaceName) {
this.$notify({ type: 'danger', message: '请在对应实体属性中配置关联实体与数据集!' });
return ;
}
const appEntityServiceConstructor = window.appEntityServiceConstructor;
const entityService: any = await appEntityServiceConstructor.getService(this.acParams.serviceName);
if (entityService[this.acParams.interfaceName] && entityService[this.acParams.interfaceName] instanceof Function) {
entityService[this.acParams.interfaceName](_context, _param).then((response: any) => {
if (response && response.status === 200) {
this.items = response.data;
this.result(this.items);
}
}).catch((response: any) => {
if (entityService && entityService[this.acParams.interfaceName] && entityService[this.acParams.interfaceName] instanceof Function) {
const response = await entityService[this.acParams.interfaceName](_context, _param);
if (response && response.status === 200) {
this.items = response.data;
this.result(this.items);
} else {
this.$notify({ type: 'danger', message: '错误,请求异常!' });
});
}
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册