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

update

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