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

Merge branch 'dev'

......@@ -19,8 +19,26 @@
<#elseif ctrl.itemRender??>
${ctrl.itemRender.code}
<#else>
<div class="app-list-item-content">{{item.srfmajortext}}</div>
<div calss="app-list-item-action">
<div class="app-list-item-content">
<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)">
<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>
......@@ -101,6 +119,14 @@ import CodeListService from "@/codelist/codelist-service";
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#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";
*/
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";
</#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>";
*/
public groupCodelist: any = {<#if ctrl.getGroupPSCodeList?? && ctrl.getGroupPSCodeList()??>type:'${ctrl.getGroupPSCodeList().getCodeListType()}',tag:'${ctrl.getGroupPSCodeList().getCodeName()}'</#if>};
/**
* 根据分组代码表绘制分组列表
......@@ -272,14 +291,17 @@ import CodeListService from "@/codelist/codelist-service";
*/
public async drawCodelistGroup(){
let groups: Array<any> = [];
let fields: 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 = this.$store.getters.getCodeListItems(this.tag);
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("分组数据无效");
......@@ -287,7 +309,12 @@ import CodeListService from "@/codelist/codelist-service";
groups.forEach((group: any,i: number)=>{
let children:Array<any> = [];
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);
}
});
......@@ -299,7 +326,15 @@ import CodeListService from "@/codelist/codelist-service";
});
let child:Array<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){
child.push(item);
}
......@@ -321,12 +356,22 @@ import CodeListService from "@/codelist/codelist-service";
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public drawGroup(){
public async drawGroup(){
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)){
groups.push(item[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 = [...new Set(groups)];
......
......@@ -12,20 +12,47 @@
}
.app-list-item {
line-height: 34px;
border-radius:5px;
padding: 6px;
margin: 6px;
box-shadow: 0px 0px 2px 1px rgb(209, 208, 208);
background: #f7f7fa;
padding: 12px 6px;
min-height: 24px;
display: flex;
justify-content: space-between;
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 {
background: #ecf5ff;
border-left: 5px solid #2d8cf0;
box-shadow: 0px 0px 3px 1px #82bff7;
border-radius: 2px;
border-color: rgb(197, 197, 197);
}
.app-list-item:hover {
background: #ecf5ff;
......
......@@ -90,9 +90,9 @@
}
}
.el-card{
background-color: #f6f6f6;
background-color: #fff;
color: #666666;
box-shadow: 0 2px 12px 0 #909399;
box-shadow: 0 2px 12px 0 #b1b3b8;
}
.single-card-data{
height: 100%;
......@@ -100,7 +100,11 @@
cursor: pointer;
border: 2px solid transparent;
.data-view-item{
display: flex;
margin-bottom: 36px;
.single-card-default {
display: flex;
flex-direction: column;
.ivu-tooltip{
.ivu-tooltip-rel{
width: 150px;
......@@ -115,11 +119,15 @@
}
}
.single-card-img {
width: 150px;
height: calc(100% - 32px);
width: 50px;
height: 50px;
border-radius: 50%;
margin-right: 20px;
}
}
.data-view-item-action{
display: flex;
justify-content: space-around;
button{
margin: 0 3px;
cursor: pointer;
......
......@@ -11,8 +11,10 @@ import ${srfclassname('${_appde.getCodeName()}')}Service from '@/service/${srffi
</#list>
<#if ctrl.getAggMode() == "ALL" && 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';
</#if>
</#if>
</#assign>
<#ibizinclude>
../@MACRO/SERVICE/SERVICE_HEADER.ts.ftl
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册