提交 5316e69c 编写于 作者: zhujiamin's avatar zhujiamin

debug移动端 新建待办时,直接返回,选择项仍然存在

上级 d746b0c8
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="app-mobile-check-list"> <div class="app-mobile-check-list">
<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 ref="checkList" @ionChange="change" multiple="true" @click="load" :ok-text="$t('app.button.confirm')" :cancel-text="$t('app.button.cancel')"> <ion-select ref="checkList" @ionChange="change" multiple="true" @click="load" :ok-text="$t('app.button.confirm')" :cancel-text="$t('app.button.cancel')" @ionCancel="cancel">
<ion-select-option v-for="option of options" :key="option.value" :value="option.value">{{option.text}} <ion-select-option v-for="option of options" :key="option.value" :value="option.value">{{option.text}}
</ion-select-option> </ion-select-option>
</ion-select> </ion-select>
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
valueChange(newValue: string, oldValue: string) { valueChange(newValue: string, oldValue: string) {
if (newValue) { if (newValue) {
this.load(); this.load();
this.$store.commit('setSelectStatus',true);
} }
} }
...@@ -143,6 +144,7 @@ ...@@ -143,6 +144,7 @@
*/ */
public mounted() { public mounted() {
this.load(); this.load();
this.$store.commit('setSelectStatus',true);
} }
/** /**
...@@ -152,6 +154,7 @@ ...@@ -152,6 +154,7 @@
* @memberof AppSelect * @memberof AppSelect
*/ */
public async load(): Promise<any> { public async load(): Promise<any> {
this.$store.commit('setSelectStatus',false);
if (this.tag && this.type) { if (this.tag && this.type) {
if (Object.is(this.type, "static")) { if (Object.is(this.type, "static")) {
return; return;
...@@ -185,10 +188,21 @@ ...@@ -185,10 +188,21 @@
* @memberof AppCheckList * @memberof AppCheckList
*/ */
public change(value: any) { public change(value: any) {
this.$store.commit('setSelectStatus',true);
this.curValue = value.detail.value.toString(); this.curValue = value.detail.value.toString();
this.$emit('change', this.curValue); this.$emit('change', this.curValue);
} }
/**
* 取消选择
*
* @type {*}
* @memberof AppCheckList
*/
public cancel(){
this.$store.commit('setSelectStatus',true);
}
/** /**
* 处理额外参数 * 处理额外参数
*/ */
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="cancel-icon" v-if="curvalue"><ion-icon name="close-circle-outline" @click="onClear"></ion-icon></div> <div class="cancel-icon" v-if="curvalue"><ion-icon name="close-circle-outline" @click="onClear"></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-input class="select_text" readonly="true" :value="curvalue" :ref="name+'input'" style="height: 43px;" @ionFocus="openSelect"/> <ion-input class="select_text" readonly="true" :value="curvalue" :ref="name+'input'" style="height: 43px;" @ionFocus="openSelect"/>
<ion-select :selected-text="selectValue" :ref="name+'select'" v-show="false" :disabled="disabled " @ionChange="change" interface="action-sheet" :cancel-text="$t('app.button.cancel')"> <ion-select :selected-text="selectValue" :ref="name+'select'" v-show="false" :disabled="disabled " @ionChange="change" interface="action-sheet" :cancel-text="$t('app.button.cancel')" @ionCancel="cancel">
<ion-select-option v-for="option of items" :key="option.value" :value="option.value">{{option.text}}</ion-select-option> <ion-select-option v-for="option of items" :key="option.value" :value="option.value">{{option.text}}</ion-select-option>
</ion-select> </ion-select>
</div> </div>
...@@ -265,6 +265,7 @@ export default class AppSelectDropDown extends Vue { ...@@ -265,6 +265,7 @@ export default class AppSelectDropDown extends Vue {
this.items.push({ text: newVal, value: value }); this.items.push({ text: newVal, value: value });
} }
this.onSearch(newVal, false); this.onSearch(newVal, false);
this.$store.commit('setSelectStatus',true);
} }
} }
...@@ -275,6 +276,7 @@ export default class AppSelectDropDown extends Vue { ...@@ -275,6 +276,7 @@ export default class AppSelectDropDown extends Vue {
*/ */
public mounted() { public mounted() {
this.onSearch(null, true); this.onSearch(null, true);
this.$store.commit('setSelectStatus',true);
} }
/** /**
...@@ -285,6 +287,7 @@ export default class AppSelectDropDown extends Vue { ...@@ -285,6 +287,7 @@ export default class AppSelectDropDown extends Vue {
this.open = flag; this.open = flag;
if (this.open) { if (this.open) {
this.onSearch(this.curvalue, true); this.onSearch(this.curvalue, true);
this.$store.commit('setSelectStatus',true);
} }
} }
/** /**
...@@ -318,6 +321,7 @@ export default class AppSelectDropDown extends Vue { ...@@ -318,6 +321,7 @@ export default class AppSelectDropDown extends Vue {
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.items = response.data; this.items = response.data;
this.$store.commit('setSelectStatus',false);
this.result(this.items); this.result(this.items);
} else { } else {
this.$notice.error(`${this.$t('error_request')}` ); this.$notice.error(`${this.$t('error_request')}` );
...@@ -761,9 +765,20 @@ export default class AppSelectDropDown extends Vue { ...@@ -761,9 +765,20 @@ export default class AppSelectDropDown extends Vue {
* @memberof AppSelect * @memberof AppSelect
*/ */
public change(value: any) { public change(value: any) {
this.$store.commit('setSelectStatus',true);
this.curvalue = value.detail.value; this.curvalue = value.detail.value;
} }
/**
* 取消选择
*
* @type {*}
* @memberof AppSelect
*/
public cancel(){
this.$store.commit('setSelectStatus',true);
}
/** /**
* 清空值 * 清空值
* @memberof AppSelect * @memberof AppSelect
...@@ -781,6 +796,7 @@ export default class AppSelectDropDown extends Vue { ...@@ -781,6 +796,7 @@ export default class AppSelectDropDown extends Vue {
*/ */
public openSelect(){ public openSelect(){
this.onSearch(null); this.onSearch(null);
this.$store.commit('setSelectStatus',true);
let select :any= this.$refs[this.name+'select']; let select :any= this.$refs[this.name+'select'];
if(select){ if(select){
setTimeout(() => { setTimeout(() => {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="app-mobile-select" data-tap-disabled="true"> <div class="app-mobile-select" data-tap-disabled="true">
<div class="cancel-icon" v-if="curValue || curValue === 0"><ion-icon name="close-circle-outline" @click="clear"></ion-icon></div> <div class="cancel-icon" v-if="curValue || curValue === 0"><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 ? 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')" @ionCancel="cancel">
<template v-if="codeListType == 'DYNAMIC'"> <template v-if="codeListType == 'DYNAMIC'">
<ion-select-option v-for="option of options" :key="option.value" :value="option.value" class="mob-select-text">{{($t('userCustom.'+tag+'.'+option.value)!== ('userCustom.'+tag+'.'+option.value))?$t('userCustom.'+tag+'.'+option.value) : option.text}}</ion-select-option> <ion-select-option v-for="option of options" :key="option.value" :value="option.value" class="mob-select-text">{{($t('userCustom.'+tag+'.'+option.value)!== ('userCustom.'+tag+'.'+option.value))?$t('userCustom.'+tag+'.'+option.value) : option.text}}</ion-select-option>
</template> </template>
...@@ -58,6 +58,7 @@ export default class AppSelect extends Vue { ...@@ -58,6 +58,7 @@ export default class AppSelect extends Vue {
* @memberof AppSelect * @memberof AppSelect
*/ */
public change(value: any) { public change(value: any) {
this.$store.commit('setSelectStatus',true);
let devalue:any = value.detail.value; let devalue:any = value.detail.value;
if (devalue !== '') { if (devalue !== '') {
for(let key in this.options){ for(let key in this.options){
...@@ -177,6 +178,7 @@ export default class AppSelect extends Vue { ...@@ -177,6 +178,7 @@ export default class AppSelect extends Vue {
onDataChange(newVal: any, oldVal: any) { onDataChange(newVal: any, oldVal: any) {
if (newVal) { if (newVal) {
this.load(); this.load();
this.$store.commit('setSelectStatus',true);
} }
} }
...@@ -189,10 +191,21 @@ export default class AppSelect extends Vue { ...@@ -189,10 +191,21 @@ export default class AppSelect extends Vue {
} else { } else {
if (this.curValue) { if (this.curValue) {
this.load(); this.load();
this.$store.commit('setSelectStatus',true);
} }
} }
} }
/**
* 取消选择
*
* @type {*}
* @memberof AppSelect
*/
public cancel(){
this.$store.commit('setSelectStatus',true);
}
/** /**
* 加载 * 加载
* *
...@@ -200,6 +213,7 @@ export default class AppSelect extends Vue { ...@@ -200,6 +213,7 @@ export default class AppSelect extends Vue {
* @memberof AppSelect * @memberof AppSelect
*/ */
public async load(): Promise<any> { public async load(): Promise<any> {
this.$store.commit('setSelectStatus',false);
if (Object.is(this.codeListType, "STATIC")) { if (Object.is(this.codeListType, "STATIC")) {
return; return;
} }
......
...@@ -253,3 +253,12 @@ export const updateZIndex = (state: any, zIndex: number) => { ...@@ -253,3 +253,12 @@ export const updateZIndex = (state: any, zIndex: number) => {
export const setNoticeStatus = (state: any, status: boolean) => { export const setNoticeStatus = (state: any, status: boolean) => {
state.noticeStatus = status; state.noticeStatus = status;
} }
/**
* 是否能弹出选择框
*
* @param state
*/
export const setSelectStatus = (state: any, status: boolean) => {
state.selectStatus = status;
}
\ No newline at end of file
...@@ -14,4 +14,5 @@ export const rootstate: any = { ...@@ -14,4 +14,5 @@ export const rootstate: any = {
localdata: {}, localdata: {},
zIndex: 300, zIndex: 300,
noticeStatus:true, noticeStatus:true,
selectStatus:true,
} }
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册