提交 c8a6d0dc 编写于 作者: JunZai's avatar JunZai

update

上级 fe3a7492
......@@ -203,44 +203,44 @@ export default class IBizGroupPicker extends Vue {
* @memberof IBizGroupPicker
*/
public groupSelect(event: any) {
// if (!event || !event.selects) {
// return;
// }
// if(!this.multiple) {
// this.selects = [];
// }
// if(event.rselect) {
// let index: number = this.selects.findIndex((item: any) => Object.is(event.rselect, item.id));
// if(index >= 0) {
// this.selects.splice(index, 1);
// }
// } else {
// event.selects.forEach((key: string) => {
// let index: number = this.selects.findIndex((item: any) => Object.is(key, item.id));
// if(index >= 0) {
// return;
// }
// let item: any = this.cardItems.find((item: any) => Object.is(key, item.id));
// if (item) {
// this.selects.push(item);
// }
// });
// }
// 测试 start
if (!event || !event.selects) {
return;
}
if(!this.multiple) {
this.selects = [];
}
event.forEach((key: string) => {
let index: number = this.selects.findIndex((item: any) => Object.is(key, item.id));
if(event.rselect) {
let index: number = this.selects.findIndex((item: any) => Object.is(event.rselect, item.id));
if(index >= 0) {
return;
this.selects.splice(index, 1);
}
let item: any = this.cardItems.find((item: any) => Object.is(key, item.id));
if (item) {
this.selects.push(item);
}
});
} else {
event.selects.forEach((key: string) => {
let index: number = this.selects.findIndex((item: any) => Object.is(key, item.id));
if(index >= 0) {
return;
}
let item: any = this.cardItems.find((item: any) => Object.is(key, item.id));
if (item) {
this.selects.push(item);
}
});
}
// 测试 start
// if(!this.multiple) {
// this.selects = [];
// }
// event.forEach((key: string) => {
// let index: number = this.selects.findIndex((item: any) => Object.is(key, item.id));
// if(index >= 0) {
// return;
// }
// let item: any = this.cardItems.find((item: any) => Object.is(key, item.id));
// if (item) {
// this.selects.push(item);
// }
// });
// 测试 end
}
......
......@@ -7,11 +7,12 @@
<template v-else v-for="(select, index) of selects">
<div :key="index" class="ibiz-group-item">
{{ select.label }}
<i class="el-icon-close" @click="remove(select)"></i>
<i v-if="!disabled" class="el-icon-close" @click="remove(select)"></i>
</div>
</template>
</div>
<div class="ibiz-group-open">
<div v-if="!disabled" class="ibiz-group-open">
<i v-if="!disabled && !multiple && selects.length > 0" class="el-icon-close" @click="remove(selects[0])"></i>
<i class="el-icon-search" @click="openView"></i>
</div>
</div>
......@@ -118,6 +119,7 @@ export default class IBizGroupSelect extends Vue {
if(this.valueitem) {
vals2 = this.data[this.valueitem].split(',');
}
console.log(this.data[this.valueitem])
vals.forEach((val: string, index: number) => {
this.selects.push({
label: val,
......@@ -254,10 +256,10 @@ export default class IBizGroupSelect extends Vue {
}
}
.ibiz-group-open {
width: 20px;
display: flex;
text-align: center;
align-items: center;
padding: 0 5px;
}
}
.ibiz-group-select:hover {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册