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

update

上级 5f5eadfe
<template>
<div class="app-data-view">
<div class="app-data-view-group">
<#if ctrl.render??>
${ctrl.render.code}
<#else>
<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">
{{ getGroupText(group) }}
</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 }}
</div>
</draggable>
......@@ -207,7 +207,7 @@ draggable,
* @type {string}
* @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,
}
});
}
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,
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
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;
}
......
......@@ -6,6 +6,31 @@
</#if>
</#list>
</#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 {
height: 100%;
overflow-y: auto;
......@@ -137,6 +162,7 @@
align-items: center;
}
}
</#if>
<#ibizinclude>
../@MACRO/CSS/DEFAULT.less.ftl
</#ibizinclude>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册