提交 6839c21f 编写于 作者: KK's avatar KK

zk——解决下拉多选最后一项数据无法删除

上级 2a9265a6
<template> <template>
<div class="app-picker-select-view"> <div class="app-picker-select-view">
<Dropdown :visible="visible" trigger="custom" style="left:0px;width: 100%" @on-clickoutside="() => {triggerMenu(false);}" > <Dropdown :visible="visible" trigger="custom" style="left:0px;width: 100%" @on-clickoutside="() => {triggerMenu(false);}" >
<Input v-if="isSingleSelect" v-model="queryValue" class="tree-input" type="text" :placeholder="placeholder ? placeholder : $t('components.appPickerSelectView.placeholder')" :disabled="disabled" @on-change="OnInputChange" @on-focus="()=>{triggerMenu(true);}" > <Input v-if="isSingleSelect" v-model="queryValue" class="tree-input" type="text" :placeholder="placeholder ? placeholder : $t('components.AppPickerSelectViewSelectView.placeholder')" :disabled="disabled" @on-change="OnInputChange" @on-focus="()=>{triggerMenu(true);}" >
<template v-slot:suffix> <template v-slot:suffix>
<i v-if="queryValue && !disabled" class='el-icon-circle-close' @click="onClear"></i> <i v-if="queryValue && !disabled" class='el-icon-circle-close' @click="onClear"></i>
<Icon :type="visible ? 'ios-arrow-up' : 'ios-arrow-down'" class="icon-arrow" @click="() => {triggerMenu();}"></Icon> <Icon :type="visible ? 'ios-arrow-up' : 'ios-arrow-down'" class="icon-arrow" @click="() => {triggerMenu();}"></Icon>
...@@ -34,7 +34,7 @@ import { ViewTool } from '@/utils/view-tool/view-tool'; ...@@ -34,7 +34,7 @@ import { ViewTool } from '@/utils/view-tool/view-tool';
@Component({ @Component({
}) })
export default class AppPickerSelectView extends Vue { export default class AppPickerSelectViewSelectView extends Vue {
/** /**
* 视图上下文 * 视图上下文
* *
...@@ -256,7 +256,7 @@ export default class AppPickerSelectView extends Vue { ...@@ -256,7 +256,7 @@ export default class AppPickerSelectView extends Vue {
*/ */
public handlePublicParams(arg: any): boolean { public handlePublicParams(arg: any): boolean {
if (!this.data) { if (!this.data) {
this.$Notice.error({ title: (this.$t('components.appPickerSelectView.error') as any), desc: (this.$t('components.appPickerSelectView.formdataException') as any) }); this.$Notice.error({ title: (this.$t('components.AppPickerSelectViewSelectView.error') as any), desc: (this.$t('components.AppPickerSelectViewSelectView.formdataException') as any) });
return false; return false;
} }
// 合并表单参数 // 合并表单参数
...@@ -306,7 +306,7 @@ export default class AppPickerSelectView extends Vue { ...@@ -306,7 +306,7 @@ export default class AppPickerSelectView extends Vue {
if(this.isSingleSelect){ if(this.isSingleSelect){
this.queryValue = newVal; this.queryValue = newVal;
if (!this.data || !this.valueitem || !this.data[this.valueitem]) { if (!this.data || !this.valueitem || !this.data[this.valueitem]) {
this.$Notice.error({ title: (this.$t('components.appPickerSelectView.error') as any), desc: (this.$t('components.appPickerSelectView.editor') as any)+this.name+(this.$t('components.appPickerSelectView.valueitemException') as any) }); this.$Notice.error({ title: (this.$t('components.AppPickerSelectViewSelectView.error') as any), desc: (this.$t('components.AppPickerSelectViewSelectView.editor') as any)+this.name+(this.$t('components.AppPickerSelectViewSelectView.valueitemException') as any) });
}else{ }else{
let _viewparam = JSON.parse(this.viewparam); let _viewparam = JSON.parse(this.viewparam);
_viewparam.selectedData = [{srfkey: this.data[this.valueitem], srfmajortext: this.value }]; _viewparam.selectedData = [{srfkey: this.data[this.valueitem], srfmajortext: this.value }];
...@@ -324,10 +324,10 @@ export default class AppPickerSelectView extends Vue { ...@@ -324,10 +324,10 @@ export default class AppPickerSelectView extends Vue {
this.items.push({ srfmajortext : item.srfmajortext, srfkey: item.srfkey }); this.items.push({ srfmajortext : item.srfmajortext, srfkey: item.srfkey });
} }
}); });
let _viewparam = JSON.parse(this.viewparam);
_viewparam.selectedData = this.selectItems;
this.viewparam = JSON.stringify(_viewparam);
} }
let _viewparam = JSON.parse(this.viewparam);
_viewparam.selectedData = this.selectItems;
this.viewparam = JSON.stringify(_viewparam);
} }
this.$forceUpdate(); this.$forceUpdate();
} }
...@@ -418,7 +418,7 @@ export default class AppPickerSelectView extends Vue { ...@@ -418,7 +418,7 @@ export default class AppPickerSelectView extends Vue {
*/ */
public openLinkView($event: any): void { public openLinkView($event: any): void {
if (!this.data || !this.valueitem || !this.data[this.valueitem]) { if (!this.data || !this.valueitem || !this.data[this.valueitem]) {
console.error({ title: (this.$t('components.appPickerSelectView.error') as any), desc: (this.$t('components.appPickerSelectView.editor') as any)+this.name+(this.$t('components.appPickerSelectView.valueitemException') as any) }); console.error({ title: (this.$t('components.AppPickerSelectViewSelectView.error') as any), desc: (this.$t('components.AppPickerSelectViewSelectView.editor') as any)+this.name+(this.$t('components.AppPickerSelectViewSelectView.valueitemException') as any) });
return; return;
} }
// 公共参数处理 // 公共参数处理
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册