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

update

上级 3babfa48
...@@ -4,11 +4,17 @@ ...@@ -4,11 +4,17 @@
${ctrl.render.code} ${ctrl.render.code}
<#else> <#else>
<template v-for="(group, index) of groups"> <template v-for="(group, index) of groups">
<draggable :key="group + index" :list="getGroupItems(group)" class="dataview-group-content"> <draggable :key="group + index" :list="group.items" group="${ctrl.name}" class="dataview-group-content">
<div slot="header" class="dataview-group-header"> <div slot="header" class="dataview-group-header">
{{ getGroupText(group) }} {{ getGroupText(group.name) }}
<Poptip trigger="hover" content="content">
<Icon type="md-more" />
<div slot="content" class="group-action">
</div>
</Poptip>
</div> </div>
<div v-for="(item, i) in getGroupItems(group)" :key="i" class="dataview-group-item"> <div v-for="(item, i) in group.items" :key="i" class="dataview-group-item">
{{ item.srfmajortext }} {{ item.srfmajortext }}
</div> </div>
</draggable> </draggable>
...@@ -529,8 +535,12 @@ draggable, ...@@ -529,8 +535,12 @@ draggable,
if(Object.is(this.groupMode, 'AUTO')) { if(Object.is(this.groupMode, 'AUTO')) {
this.groups = []; this.groups = [];
this.items.forEach(item => { this.items.forEach(item => {
if(this.groups.indexOf(item[this.groupField]) < 0) { let group: any = this.groups.find((group: any) => Object.is(group.name, item[this.groupField]));
this.groups.push(item[this.groupField]); if(!group) {
this.groups.push({
name: item[this.groupField],
items: this.getGroupItems(item[this.groupField])
})
} }
}); });
} }
...@@ -539,7 +549,10 @@ draggable, ...@@ -539,7 +549,10 @@ draggable,
let codelist: any = this.$store.getters.getCodeList(this.groupCodelist); let codelist: any = this.$store.getters.getCodeList(this.groupCodelist);
if(codelist) { if(codelist) {
codelist.items.forEach((item: any) => { codelist.items.forEach((item: any) => {
this.groups.push(item.value) this.groups.push({
name: item.value,
items: this.getGroupItems(item.value)
})
}) })
} }
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册