Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
22
议题
22
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7
提交
6843074b
提交
6843074b
编写于
12月 07, 2020
作者:
Shine-zwj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化列表,数据视图,表格分组
上级
5f7c2fae
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
22 行增加
和
65 行删除
+22
-65
CONTROL-BASE.vue.ftl
@CONTROL/列表/CONTROL-BASE.vue.ftl
+8
-25
CONTROL-BASE.vue.ftl
@CONTROL/数据视图/CONTROL-BASE.vue.ftl
+8
-26
CONTROL-BASE.vue.ftl
@CONTROL/表格/CONTROL-BASE.vue.ftl
+6
-14
未找到文件。
@CONTROL/列表/CONTROL-BASE.vue.ftl
浏览文件 @
6843074b
...
...
@@ -243,7 +243,7 @@ import CodeListService from "@/codelist/codelist-service";
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public groupFieldCodelist:
any = {<#if ctrl.getGroupPSDEField()?? && ctrl.getGroupPSDEField().getPSCodeList?? && ctrl.getGroupPSDEField().getPSCodeList()??>type: '${ctrl.getGroupPSDEField().getPSCodeList().getCodeListType()}',tag: '${ctrl.getGroupPSDEField().getPSCodeList().getCodeName()}'</#if>}
;
public groupFieldCodelist:
boolean = '<#if ctrl.getGroupPSDEField()?? && ctrl.getGroupPSDEField().getPSCodeList?? && ctrl.getGroupPSDEField().getPSCodeList()??>true<#else>false</#if>'
;
/**
* 分组数据
...
...
@@ -301,22 +301,17 @@ import CodeListService from "@/codelist/codelist-service";
groups = Util.deepCopy(groupCodelist);
}
if(Object.keys(this.groupFieldCodelist).length > 0){
let fieldCodelist: any = await this.codeListService.getDataItems(this.groupFieldCodelist);
fields = Util.deepCopy(fieldCodelist);
}
if(groups.length == 0){
console.warn("分组数据无效");
}
groups.forEach((group: any,i: number)=>{
let children:Array<any> = [];
data.forEach((item: any,j: number)=>{
if(fields && fields.length > 0){
const arr:Array<any> = fields.filter((field:any)=>{return field.value == item[this.groupField]});
if(arr && arr.length>0 && Object.is(group.label,arr[0].label)) {
if(this.groupFieldCodelist){
if(Object.is(group.label,item[this.groupField])) {
children.push(item);
}
}else if(Object.is(group.
label
,item[this.groupField])){
}else if(Object.is(group.
value
,item[this.groupField])){
children.push(item);
}
});
...
...
@@ -329,13 +324,10 @@ import CodeListService from "@/codelist/codelist-service";
let child:Array<any> = [];
data.forEach((item: any)=>{
let i: number = 0;
if(fields && fields.length > 0){
const arr:Array<any> = fields.filter((field:any)=>{return field.value == item[this.groupField]});
if(arr && arr.length>0) {
i = groups.findIndex((group: any)=>Object.is(group.label,arr[0].label));
}
}else{
if(this.groupFieldCodelist){
i = groups.findIndex((group: any)=>Object.is(group.label,item[this.groupField]));
}else{
i = groups.findIndex((group: any)=>Object.is(group.value,item[this.groupField]));
}
if(i < 0){
child.push(item);
...
...
@@ -362,18 +354,9 @@ import CodeListService from "@/codelist/codelist-service";
let data:Array<any> = [...this.items];
let groups:Array<any> = [];
let fields: Array<any> = [];
if(Object.keys(this.groupFieldCodelist).length > 0){
let fieldCodelist: any = await this.codeListService.getDataItems(this.groupFieldCodelist);
fields = Util.deepCopy(fieldCodelist);
}
data.forEach((item: any)=>{
if(item.hasOwnProperty(this.groupField)){
if(fields && fields.length > 0){
const arr:Array<any> = fields.filter((field:any)=>{return field.value == item[this.groupField]});
groups.push(arr[0].label);
}else{
groups.push(item[this.groupField]);
}
groups.push(item[this.groupField]);
}
});
groups = [...new Set(groups)];
...
...
@CONTROL/数据视图/CONTROL-BASE.vue.ftl
浏览文件 @
6843074b
...
...
@@ -263,7 +263,7 @@ import CodeListService from "@/codelist/codelist-service";
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public groupFieldCodelist:
any = {<#if ctrl.getGroupPSDEField()?? && ctrl.getGroupPSDEField().getPSCodeList?? && ctrl.getGroupPSDEField().getPSCodeList()??>type: '${ctrl.getGroupPSDEField().getPSCodeList().getCodeListType()}',tag: '${ctrl.getGroupPSDEField().getPSCodeList().getCodeName()}'</#if>}
;
public groupFieldCodelist:
boolean = '<#if ctrl.getGroupPSDEField()?? && ctrl.getGroupPSDEField().getPSCodeList?? && ctrl.getGroupPSDEField().getPSCodeList()??>true<#else>false</#if>'
;
/**
* 分组数据
...
...
@@ -358,11 +358,6 @@ import CodeListService from "@/codelist/codelist-service";
if(Object.keys(this.groupCodelist).length > 0){
let groupCodelist: any = await this.codeListService.getDataItems(this.groupCodelist);
groups = Util.deepCopy(groupCodelist);
}
if(Object.keys(this.groupFieldCodelist).length > 0){
let fieldCodelist: any = await this.codeListService.getDataItems(this.groupFieldCodelist);
fields = Util.deepCopy(fieldCodelist);
}
if(groups.length == 0){
console.warn("分组数据无效");
...
...
@@ -370,12 +365,11 @@ import CodeListService from "@/codelist/codelist-service";
groups.forEach((group: any,i: number)=>{
let children:Array<any> = [];
data.forEach((item: any,j: number)=>{
if(fields && fields.length > 0){
const arr:Array<any> = fields.filter((field:any)=>{return field.value == item[this.groupField]});
if(arr && arr.length>0 && Object.is(group.label,arr[0].label)) {
if(this.groupFieldCodelist){
if(Object.is(group.label,item[this.groupField])) {
children.push(item);
}
}else if(Object.is(group.
label
,item[this.groupField])){
}else if(Object.is(group.
value
,item[this.groupField])){
children.push(item);
}
});
...
...
@@ -388,13 +382,10 @@ import CodeListService from "@/codelist/codelist-service";
let child:Array<any> = [];
data.forEach((item: any)=>{
let i: number = 0;
if(fields && fields.length > 0){
const arr:Array<any> = fields.filter((field:any)=>{return field.value == item[this.groupField]});
if(arr && arr.length>0) {
i = groups.findIndex((group: any)=>Object.is(group.label,arr[0].label));
}
}else{
if(this.groupFieldCodelist){
i = groups.findIndex((group: any)=>Object.is(group.label,item[this.groupField]));
}else{
i = groups.findIndex((group: any)=>Object.is(group.value,item[this.groupField]));
}
if(i < 0){
child.push(item);
...
...
@@ -421,18 +412,9 @@ import CodeListService from "@/codelist/codelist-service";
let data:Array<any> = [...this.items];
let groups:Array<any> = [];
let fields: Array<any> = [];
if(Object.keys(this.groupFieldCodelist).length > 0){
let fieldCodelist: any = await this.codeListService.getDataItems(this.groupFieldCodelist);
fields = Util.deepCopy(fieldCodelist);
}
data.forEach((item: any)=>{
if(item.hasOwnProperty(this.groupField)){
if(fields && fields.length > 0){
const arr:Array<any> = fields.filter((field:any)=>{return field.value == item[this.groupField]});
groups.push(arr[0].label);
}else{
groups.push(item[this.groupField]);
}
groups.push(item[this.groupField]);
}
});
groups = [...new Set(groups)];
...
...
@CONTROL/表格/CONTROL-BASE.vue.ftl
浏览文件 @
6843074b
...
...
@@ -1485,6 +1485,7 @@ ${gridColumn.getName()}
}
return codelist;
}
/**
* 根据分组代码表绘制分组列表
*
...
...
@@ -1505,13 +1506,12 @@ ${gridColumn.getName()}
let children:Array<any> = [];
this.items.forEach((item: any,j: number)=>{
if(allGroupField && allGroupField.length > 0){
const arr:Array<any> = allGroupField.filter((field:any)=>{return field.value == item[this.groupAppField]});
if(Object.is(group.label,arr[0].label)){
if(Object.is(group.label,item[this.groupAppField])){
item.groupById = Number((i+1) * 100 + (j+1) * 1);
item.group = '';
children.push(item);
}
}else if(Object.is(group.
label
,item[this.groupAppField])){
}else if(Object.is(group.
value
,item[this.groupAppField])){
item.groupById = Number((i+1) * 100 + (j+1) * 1);
item.group = '';
children.push(item);
...
...
@@ -1550,10 +1550,9 @@ ${gridColumn.getName()}
this.items.forEach((item: any,index: number)=>{
let i: number = 0;
if(allGroupField && allGroupField.length > 0){
const arr:Array<any> = allGroupField.filter((field:any)=>{return field.value == item[this.groupAppField]});
i = allGroup.findIndex((group: any)=>Object.is(group.label,arr[0].label));
}else{
i = allGroup.findIndex((group: any)=>Object.is(group.label,item[this.groupAppField]));
}else{
i = allGroup.findIndex((group: any)=>Object.is(group.value,item[this.groupAppField]));
}
if(i < 0){
item.groupById = Number((allGroup.length+1) * 100 + (index+1) * 1);
...
...
@@ -1613,16 +1612,9 @@ ${gridColumn.getName()}
if(!this.isEnableGroup) return;
// 分组
let allGroup: Array<any> = [];
let allGroupField: Array<any> =[];
allGroupField = this.getGroupCodelist(this.groupAppFieldCodelistType,this.groupAppFieldCodelistTag);
this.items.forEach((item: any)=>{
if(item.hasOwnProperty(this.groupAppField)){
if(allGroupField && allGroupField.length > 0){
const arr:Array<any> = allGroupField.filter((field:any)=>{return field.value == item[this.groupAppField]});
allGroup.push(arr[0].label);
}else{
allGroup.push(item[this.groupAppField]);
}
allGroup.push(item[this.groupAppField]);
}
});
let groupTree:Array<any> = [];
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录