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

update

上级 5f5eadfe
<template> <template>
<div class="app-data-view"> <div class="app-data-view-group">
<#if ctrl.render??> <#if ctrl.render??>
${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)"> <draggable :key="group + index" :list="getGroupItems(group)" class="dataview-group-content">
<div slot="header" class="dataview-group-header"> <div slot="header" class="dataview-group-header">
{{ getGroupText(group) }} {{ getGroupText(group) }}
</div> </div>
<div v-for="(item, i) in getGroupItems(group)" :key="i" class="dataview-group-item"> <div v-for="(item, i) in getGroupItems(group)" :key="i" class="dataview-group-item" class="dataview-group-item">
{{ item.srfmajortext }} {{ item.srfmajortext }}
</div> </div>
</draggable> </draggable>
...@@ -207,7 +207,7 @@ draggable, ...@@ -207,7 +207,7 @@ draggable,
* @type {string} * @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public groupCodelist: string = '<#if ctrl.getGroupPSCodeList()??>${ctrl.getGroupPSCodeList().getCodeName()?lower_case}</#if>' public groupCodelist: string = '<#if ctrl.getGroupPSCodeList()??>${ctrl.getGroupPSCodeList().getCodeName()}</#if>'
/** /**
* 排序点击事件 * 排序点击事件
...@@ -534,6 +534,15 @@ draggable, ...@@ -534,6 +534,15 @@ draggable,
} }
}); });
} }
if(Object.is(this.groupMode, 'CODELIST') && this.groupCodelist) {
this.groups = [];
let codelist: any = this.$store.getters.getCodeList(this.groupCodelist);
if(codelist) {
codelist.items.forEach((item: any) => {
this.groups.push(item.value)
})
}
}
} }
/** /**
...@@ -559,8 +568,17 @@ draggable, ...@@ -559,8 +568,17 @@ draggable,
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public getGroupText(name: string) { public getGroupText(name: string) {
if(Object.is(this.groupMode, 'CODELIST')) { if(Object.is(this.groupMode, 'CODELIST') && this.groupCodelist) {
let codelist: any = this.$store.getters.getCodeList(this.groupCodelist);
if(codelist) {
if(!name) {
return codelist.emptytext;
}
let item = codelist.items.find((item: any) => Object.is(item.value, name));
if(item) {
return item.text;
}
}
} }
return name; return name;
} }
......
...@@ -6,6 +6,31 @@ ...@@ -6,6 +6,31 @@
</#if> </#if>
</#list> </#list>
</#if> </#if>
<#if ctrl.isEnableGroup()>
.app-data-view-group {
height: 100%;
display: flex;
.dataview-group-content {
border: 1px solid #ddd;
flex-grow: 1;
border-left: 0;
.dataview-group-header {
height: 36px;
line-height: 36px;
border-bottom: 1px solid #ddd;
padding: 0 8px;
}
.dataview-group-item {
margin: 8px 8px 0 8px;
border: 1px solid #ddd;
padding: 8px;
}
}
.dataview-group-content:nth-child(1) {
border-left: 1px solid #ddd;
}
}
<#else>
.app-data-view { .app-data-view {
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
...@@ -137,6 +162,7 @@ ...@@ -137,6 +162,7 @@
align-items: center; align-items: center;
} }
} }
</#if>
<#ibizinclude> <#ibizinclude>
../@MACRO/CSS/DEFAULT.less.ftl ../@MACRO/CSS/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册