Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
22
议题
22
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7
提交
1a045582
提交
1a045582
编写于
9月 09, 2020
作者:
Shine-zwj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
列表分组
上级
c077d13d
变更
3
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
152 行增加
和
3 行删除
+152
-3
CONTROL-BASE.vue.ftl
@CONTROL/列表/CONTROL-BASE.vue.ftl
+148
-1
en-US.ts.ftl
APP/src/locale/lang/en-US.ts.ftl
+2
-1
zh-CN.ts.ftl
APP/src/locale/lang/zh-CN.ts.ftl
+2
-1
未找到文件。
@CONTROL/列表/CONTROL-BASE.vue.ftl
浏览文件 @
1a045582
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<div v-if="items.length > 0">
<div v-if="items.length > 0">
<#if ctrl.render??>
<#if ctrl.render??>
${ctrl.render.code}
${ctrl.render.code}
<#else>
<#else
if ctrl.isEnableGroup?? && ctrl.isEnableGroup() === false
>
<div v-for = "item in items" :key="item.srfkey" :class="['app-list-item', {'isSelect': item.isselected === true ? true : false}]" @click="handleClick(item)" @dblclick="handleDblClick(item)">
<div v-for = "item in items" :key="item.srfkey" :class="['app-list-item', {'isSelect': item.isselected === true ? true : false}]" @click="handleClick(item)" @dblclick="handleDblClick(item)">
<#if ctrl.getItemPSLayoutPanel()??>
<#if ctrl.getItemPSLayoutPanel()??>
<#assign panel = ctrl.getItemPSLayoutPanel()>
<#assign panel = ctrl.getItemPSLayoutPanel()>
...
@@ -16,6 +16,28 @@
...
@@ -16,6 +16,28 @@
{{item.srfmajortext}}
{{item.srfmajortext}}
</#if>
</#if>
</div>
</div>
<#else ctrl.isEnableGroup?? && ctrl.isEnableGroup() === true>
<el-collapse>
<el-collapse-item v-for="(group,index) in items" :key="index" :title="group.group" >
<div v-if="group.children.length > 0">
<div v-for="item in group.children" :key="item.srfkey" :class="['app-list-item', {'isSelect': item.isselected === true ? true : false}]" @click="handleClick(item)" @dblclick="handleDblClick(item)">
<#if ctrl.getItemPSLayoutPanel()??>
<#assign panel = ctrl.getItemPSLayoutPanel()>
<@ibizindent blank=16>
${P.getCtrlCode(panel, 'CONTROL.html').code}
</@ibizindent>
<#elseif ctrl.itemRender??>
${ctrl.itemRender.code}
<#else>
{{item.srfmajortext}}
</#if>
</div>
</div>
<div v-else>
{{ $t('app.commonWords.noData') }}
</div>
</el-collapse-item>
</el-collapse>
</#if>
</#if>
<template v-if="isScorll">
<template v-if="isScorll">
<div v-if="totalRecord>items.length" class="loadmore">{{ this.$t('app.commonWords.loadmore') }}</div>
<div v-if="totalRecord>items.length" class="loadmore">{{ this.$t('app.commonWords.loadmore') }}</div>
...
@@ -28,6 +50,11 @@
...
@@ -28,6 +50,11 @@
<el-backtop target=".content-container .app-list"></el-backtop>
<el-backtop target=".content-container .app-list"></el-backtop>
</div>
</div>
</template>
</template>
<#if ctrl.getGroupMode?? && ctrl.getGroupMode() == 'CODELIST'>
<#assign import_block>
import CodeListService from "@service/app/codelist-service";
</#assign>
</#if>
<#ibizinclude>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
</#ibizinclude>
...
@@ -131,6 +158,121 @@
...
@@ -131,6 +158,121 @@
*/
*/
public thisRef: any = this;
public thisRef: any = this;
<#if ctrl.isEnableGroup?? && ctrl.isEnableGroup() === true>
/**
* 分组属性
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public groupProperty: string = "<#if ctrl.getGroupPSDEField?? && ctrl.getGroupPSDEField()??>${ctrl.getGroupPSDEField().getCodeName()?lower_case}</#if>";
</#if>
<#if ctrl.getGroupMode?? && ctrl.getGroupMode() == 'CODELIST'>
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/**
* 分组代码表标识
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public tag: string = "<#if ctrl.getGroupPSCodeList?? && ctrl.getGroupPSCodeList()??>${ctrl.getGroupPSCodeList().getCodeName()}</#if>";
/**
* 分组代码表类型
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public codelistType: string = "<#if ctrl.getGroupPSCodeList?? && ctrl.getGroupPSCodeList()??>${ctrl.getGroupPSCodeList().getCodeListType()}</#if>";
/**
* 根据分组代码表绘制分组列表
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public async drawCodelistGroup(){
let groups: Array<any> = [];
let groupTree:Array<any> = [];
let data:Array<any> = [...this.items];
// 动态代码表
if (Object.is(this.codelistType, "DYNAMIC")) {
groups = await this.codeListService.getItems(this.tag);
// 静态代码表
} else if(Object.is(this.codelistType, "STATIC")){
groups = await this.$store.getters.getCodeListItems(this.tag);
}
groups.forEach((group: any,i: number)=>{
let children:Array<any> = [];
data.forEach((item: any,j: number)=>{
if(Object.is(group,item[this.groupProperty])){
children.push(item);
}
});
const tree: any ={
group: group,
children: children
}
groupTree.push(tree);
});
let child:Array<any> = [];
data.forEach((item: any)=>{
let i = groups.findIndex((group: any)=>Object.is(group,item[this.groupProperty]));
if(i < 0){
child.push(item);
}
})
const Tree: any = {
group: this.$t('app.commonWords.other'),
children: child
}
groupTree.push(Tree);
this.items = [...groupTree];
}
</#if>
<#if ctrl.getGroupMode?? && ctrl.getGroupMode() == 'AUTO'>
/**
* 绘制分组列表
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public drawGroup(){
let data:Array<any> = [...this.items];
let groups:Array<any> = [];
data.forEach((item: any)=>{
if(item.hasOwnProperty(this.groupProperty)){
groups.push(item[this.groupProperty]);
}
});
groups = [...new Set(groups)];
let groupItems:Array<any> = [];
let groupTree:Array<any> = [];
groups.forEach((group: any,i: number)=>{
let children:Array<any> = [];
data.forEach((item: any,j: number)=>{
if(Object.is(group,item[this.groupProperty])){
console.log(item);
children.push(item);
}
});
const tree: any ={
group: group,
children: children
}
groupTree.push(tree);
});
this.items = [...groupTree];
}
</#if>
/**
/**
* 当前页
* 当前页
*
*
...
@@ -391,6 +533,11 @@
...
@@ -391,6 +533,11 @@
if(this.isSelectFirstDefault){
if(this.isSelectFirstDefault){
this.handleClick(this.items[0]);
this.handleClick(this.items[0]);
}
}
<#if ctrl.getGroupMode?? && ctrl.getGroupMode() == 'AUTO'>
this.drawGroup();
<#elseif ctrl.getGroupMode?? && ctrl.getGroupMode() == 'CODELIST'>
this.drawCodelistGroup();
</#if>
}, (response: any) => {
}, (response: any) => {
if (response && response.status === 401) {
if (response && response.status === 401) {
return;
return;
...
...
APP/src/locale/lang/en-US.ts.ftl
浏览文件 @
1a045582
...
@@ -33,7 +33,8 @@ export default {
...
@@ -33,7 +33,8 @@ export default {
noData: "No data",
noData: "No data",
startsuccess:"Start successful",
startsuccess:"Start successful",
loadmore:"Load more",
loadmore:"Load more",
nomore:"No more"
nomore:"No more",
other:"other"
},
},
local:{
local:{
new: "New",
new: "New",
...
...
APP/src/locale/lang/zh-CN.ts.ftl
浏览文件 @
1a045582
...
@@ -33,7 +33,8 @@ export default {
...
@@ -33,7 +33,8 @@ export default {
noData: "暂无数据",
noData: "暂无数据",
startsuccess:"启动成功",
startsuccess:"启动成功",
loadmore:"加载更多",
loadmore:"加载更多",
nomore:"没有更多了"
nomore:"没有更多了",
other:"其他"
},
},
local:{
local:{
new: "新建",
new: "新建",
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录