提交 33b3a3bc 编写于 作者: tony001's avatar tony001

Merge branch 'dev'

...@@ -19,8 +19,26 @@ ...@@ -19,8 +19,26 @@
<#elseif ctrl.itemRender??> <#elseif ctrl.itemRender??>
${ctrl.itemRender.code} ${ctrl.itemRender.code}
<#else> <#else>
<div class="app-list-item-content">{{item.srfmajortext}}</div> <div class="app-list-item-content">
<div calss="app-list-item-action"> <div class="item-icon">
<template v-if="item.srficon">
<img :src="item.srficon" />
</template>
<template v-else>
<img src="/assets/img/noimage.png"/>
</template>
</div>
<template>
<div class="item-content-text">
<span class="item-text">{{item.srfmajortext}}</span>
<span v-if="item.srfdescription" class="item-subtext">{{ item.srfdescription }}</span>
</div>
</template>
</div>
<div class="app-list-item-date">
<span class="date">{{ item.createdate }}</span>
</div>
<div class="app-list-item-action">
<template v-for="(action,index) in Object.keys(ActionModel)"> <template v-for="(action,index) in Object.keys(ActionModel)">
<a :key="index" style="display: inline-block;margin: 0 12px;" @click="uiAction(item, action, $event)"> <a :key="index" style="display: inline-block;margin: 0 12px;" @click="uiAction(item, action, $event)">
<i :class="ActionModel[action].icon" style="margin-right:2px;"></i> <i :class="ActionModel[action].icon" style="margin-right:2px;"></i>
...@@ -101,6 +119,14 @@ import CodeListService from "@/codelist/codelist-service"; ...@@ -101,6 +119,14 @@ import CodeListService from "@/codelist/codelist-service";
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/** /**
* 获取多项数据 * 获取多项数据
* *
...@@ -209,6 +235,14 @@ import CodeListService from "@/codelist/codelist-service"; ...@@ -209,6 +235,14 @@ import CodeListService from "@/codelist/codelist-service";
*/ */
public groupField: string = "<#if ctrl.getGroupPSDEField?? && ctrl.getGroupPSDEField()??>${ctrl.getGroupPSDEField().getCodeName()?lower_case}</#if>"; public groupField: string = "<#if ctrl.getGroupPSDEField?? && ctrl.getGroupPSDEField()??>${ctrl.getGroupPSDEField().getCodeName()?lower_case}</#if>";
/**
* 分组属性代码表
*
* @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>};
/** /**
* 分组数据 * 分组数据
* *
...@@ -241,29 +275,14 @@ import CodeListService from "@/codelist/codelist-service"; ...@@ -241,29 +275,14 @@ import CodeListService from "@/codelist/codelist-service";
</#if> </#if>
<#if ctrl.getGroupMode?? && ctrl.getGroupMode() == 'CODELIST'> <#if ctrl.getGroupMode?? && ctrl.getGroupMode() == 'CODELIST'>
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/** /**
* 分组代码表标识 * 分组代码表
* *
* @type {string} * @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public tag: string = "<#if ctrl.getGroupPSCodeList?? && ctrl.getGroupPSCodeList()??>${ctrl.getGroupPSCodeList().getCodeName()}</#if>"; public groupCodelist: any = {<#if ctrl.getGroupPSCodeList?? && ctrl.getGroupPSCodeList()??>type:'${ctrl.getGroupPSCodeList().getCodeListType()}',tag:'${ctrl.getGroupPSCodeList().getCodeName()}'</#if>};
/**
* 分组代码表类型
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public codelistType: string = "<#if ctrl.getGroupPSCodeList?? && ctrl.getGroupPSCodeList()??>${ctrl.getGroupPSCodeList().getCodeListType()}</#if>";
/** /**
* 根据分组代码表绘制分组列表 * 根据分组代码表绘制分组列表
...@@ -272,14 +291,17 @@ import CodeListService from "@/codelist/codelist-service"; ...@@ -272,14 +291,17 @@ import CodeListService from "@/codelist/codelist-service";
*/ */
public async drawCodelistGroup(){ public async drawCodelistGroup(){
let groups: Array<any> = []; let groups: Array<any> = [];
let fields: Array<any> = [];
let groupTree:Array<any> = []; let groupTree:Array<any> = [];
let data:Array<any> = [...this.items]; let data:Array<any> = [...this.items];
// 动态代码表 if(Object.keys(this.groupCodelist).length > 0){
if (Object.is(this.codelistType, "DYNAMIC")) { let groupCodelist: any = await this.codeListService.getDataItems(this.groupCodelist);
groups = await this.codeListService.getItems(this.tag); groups = Util.deepCopy(groupCodelist);
// 静态代码表
} else if(Object.is(this.codelistType, "STATIC")){ }
groups = this.$store.getters.getCodeListItems(this.tag); if(Object.keys(this.groupFieldCodelist).length > 0){
let fieldCodelist: any = await this.codeListService.getDataItems(this.groupFieldCodelist);
fields = Util.deepCopy(fieldCodelist);
} }
if(groups.length == 0){ if(groups.length == 0){
console.warn("分组数据无效"); console.warn("分组数据无效");
...@@ -287,7 +309,12 @@ import CodeListService from "@/codelist/codelist-service"; ...@@ -287,7 +309,12 @@ import CodeListService from "@/codelist/codelist-service";
groups.forEach((group: any,i: number)=>{ groups.forEach((group: any,i: number)=>{
let children:Array<any> = []; let children:Array<any> = [];
data.forEach((item: any,j: number)=>{ data.forEach((item: any,j: number)=>{
if(Object.is(group.label,item[this.groupField])){ 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)) {
children.push(item);
}
}else if(Object.is(group.label,item[this.groupField])){
children.push(item); children.push(item);
} }
}); });
...@@ -299,7 +326,15 @@ import CodeListService from "@/codelist/codelist-service"; ...@@ -299,7 +326,15 @@ import CodeListService from "@/codelist/codelist-service";
}); });
let child:Array<any> = []; let child:Array<any> = [];
data.forEach((item: any)=>{ data.forEach((item: any)=>{
let i = groups.findIndex((group: any)=>Object.is(group.label,item[this.groupField])); 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{
i = groups.findIndex((group: any)=>Object.is(group.label,item[this.groupField]));
}
if(i < 0){ if(i < 0){
child.push(item); child.push(item);
} }
...@@ -321,13 +356,23 @@ import CodeListService from "@/codelist/codelist-service"; ...@@ -321,13 +356,23 @@ import CodeListService from "@/codelist/codelist-service";
* *
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public drawGroup(){ public async drawGroup(){
let data:Array<any> = [...this.items]; let data:Array<any> = [...this.items];
let groups:Array<any> = []; 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)=>{ data.forEach((item: any)=>{
if(item.hasOwnProperty(this.groupField)){ 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)]; groups = [...new Set(groups)];
if(groups.length == 0){ if(groups.length == 0){
......
...@@ -12,20 +12,47 @@ ...@@ -12,20 +12,47 @@
} }
.app-list-item { .app-list-item {
line-height: 34px; line-height: 34px;
border-radius:5px; padding: 12px 6px;
padding: 6px;
margin: 6px;
box-shadow: 0px 0px 2px 1px rgb(209, 208, 208);
background: #f7f7fa;
min-height: 24px; min-height: 24px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
border-bottom: 1px solid #f0f0f0;
.app-list-item-content {
display: flex;
align-items: center;
.item-icon {
width: 40px;
height: 40px;
margin-right: 14px;
img {
width: 40px;
height: 40px;
border-radius: 50%;
}
}
.item-content-text {
display: flex;
flex-direction: column;
.item-text {
font-size: 18px;
font-weight: bold;
}
.item-subtext {
color: #8c8c8c;
}
}
}
.app-list-item-date {
position: relative;
left: 28%;
color: #8c8c8c;
}
} }
.app-list-item.isSelect { .app-list-item.isSelect {
background: #ecf5ff; background: #ecf5ff;
border-left: 5px solid #2d8cf0; border-radius: 2px;
box-shadow: 0px 0px 3px 1px #82bff7; border-color: rgb(197, 197, 197);
} }
.app-list-item:hover { .app-list-item:hover {
background: #ecf5ff; background: #ecf5ff;
......
...@@ -90,9 +90,9 @@ ...@@ -90,9 +90,9 @@
} }
} }
.el-card{ .el-card{
background-color: #f6f6f6; background-color: #fff;
color: #666666; color: #666666;
box-shadow: 0 2px 12px 0 #909399; box-shadow: 0 2px 12px 0 #b1b3b8;
} }
.single-card-data{ .single-card-data{
height: 100%; height: 100%;
...@@ -100,7 +100,11 @@ ...@@ -100,7 +100,11 @@
cursor: pointer; cursor: pointer;
border: 2px solid transparent; border: 2px solid transparent;
.data-view-item{ .data-view-item{
display: flex;
margin-bottom: 36px;
.single-card-default { .single-card-default {
display: flex;
flex-direction: column;
.ivu-tooltip{ .ivu-tooltip{
.ivu-tooltip-rel{ .ivu-tooltip-rel{
width: 150px; width: 150px;
...@@ -115,11 +119,15 @@ ...@@ -115,11 +119,15 @@
} }
} }
.single-card-img { .single-card-img {
width: 150px; width: 50px;
height: calc(100% - 32px); height: 50px;
border-radius: 50%;
margin-right: 20px;
} }
} }
.data-view-item-action{ .data-view-item-action{
display: flex;
justify-content: space-around;
button{ button{
margin: 0 3px; margin: 0 3px;
cursor: pointer; cursor: pointer;
......
...@@ -11,8 +11,10 @@ import ${srfclassname('${_appde.getCodeName()}')}Service from '@/service/${srffi ...@@ -11,8 +11,10 @@ import ${srfclassname('${_appde.getCodeName()}')}Service from '@/service/${srffi
</#list> </#list>
<#if ctrl.getAggMode() == "ALL" && ctrl.getAggPSAppDataEntity()??> <#if ctrl.getAggMode() == "ALL" && ctrl.getAggPSAppDataEntity()??>
<#assign aggAppDataEntity = ctrl.getAggPSAppDataEntity() > <#assign aggAppDataEntity = ctrl.getAggPSAppDataEntity() >
<#if aggAppDataEntity.getId() != appde.getId()>
import ${srfclassname('${aggAppDataEntity.getCodeName()}')}Service from '@/service/${srffilepath2(aggAppDataEntity.getCodeName())}/${srffilepath2(aggAppDataEntity.getCodeName())}-service'; import ${srfclassname('${aggAppDataEntity.getCodeName()}')}Service from '@/service/${srffilepath2(aggAppDataEntity.getCodeName())}/${srffilepath2(aggAppDataEntity.getCodeName())}-service';
</#if> </#if>
</#if>
</#assign> </#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/SERVICE/SERVICE_HEADER.ts.ftl ../@MACRO/SERVICE/SERVICE_HEADER.ts.ftl
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册