提交 4fc1f538 编写于 作者: ibizdev's avatar ibizdev

ShineKOT 发布系统代码 [后台服务,演示应用]

上级 0c0358d2
......@@ -33,41 +33,29 @@
</row>
</div>
<row class="data-view-container" v-if="items.length > 0" :gutter="20" type="flex" justify="start" style="margin:0px;">
<el-collapse>
<el-collapse-item v-for="(group,index) in groupData" :key="index">
<template slot="title">
<div style="margin: 0 0 0 12px;"><b>{{group.group}}</b></div>
</template>
<div v-if="group.children.length > 0">
<a v-for="(item,i) in group.children" :key="i" :href="item.starturl">
<i-col style="min-height: 170px;margin-bottom: 10px;">
<el-card shadow="always" :class="[ item.isselected === true ? 'isselected' : false, 'single-card-data' ]" @click.native="handleClick(item)" @dblclick.native="handleDblClick(item)">
<div class="data-view-item">
<img v-if="item.srficonpath" :src="item.srficonpath" class="single-card-img" />
<img v-else src="/assets/img/noimage.png" class="single-card-img" />
<div class="single-card-default">
<Tooltip :content="item.srfmajortext">
{{item.srfmajortext}}
</Tooltip>
</div>
</div>
<div class="data-view-item-action">
<template v-for="(action,index) in Object.keys(ActionModel)">
<button type="info" :key="index" @click="uiAction(item, action, $event)">
<i :class="ActionModel[action].icon" style="margin-right:2px;"></i>
<span>{{ActionModel[action].caption}}</span>
</button>
</template>
</div>
</el-card>
</i-col>
</a>
</div>
<div v-else style="text-align: center;">
{{ $t('entities.ibizbook.usr_dataview.nodata') }}
</div>
</el-collapse-item>
</el-collapse>
<a v-for="(item,index) in items" :key="index" :href = "item.starturl">
<i-col style="min-height: 170px;margin-bottom: 10px;">
<el-card shadow="always" :class="[ item.isselected === true ? 'isselected' : false, 'single-card-data' ]" @click.native="handleClick(item)" @dblclick.native="handleDblClick(item)">
<div class="data-view-item">
<img v-if="item.srficonpath" :src="item.srficonpath" class="single-card-img" />
<img v-else src="/assets/img/noimage.png" class="single-card-img" />
<div class="single-card-default">
<Tooltip :content="item.srfmajortext">
{{item.srfmajortext}}
</Tooltip>
</div>
</div>
<div class="data-view-item-action">
<template v-for="(action,index) in Object.keys(ActionModel)">
<button type="info" :key="index" @click="uiAction(item, action, $event)">
<i :class="ActionModel[action].icon" style="margin-right:2px;"></i>
<span>{{ActionModel[action].caption}}</span>
</button>
</template>
</div>
</el-card>
</i-col>
</a>
</row>
<div v-else class="app-data-empty">
{{ $t('entities.ibizbook.usr_dataview.nodata') }}
......@@ -519,75 +507,8 @@ export default class UsrBase extends Vue implements ControlInterface {
*/
public thisRef: any = this;
/**
* 分组属性
*
* @type {string}
* @memberof UsrBase
*/
public groupField: string = "type";
/**
* 分组数据
*
* @type {Array<any>}
* @memberof UsrBase
*/
public groupData: Array<any> = [];
/**
* 分组模式
*
* @type {string}
* @memberof UsrBase
*/
public groupMode: string = "AUTO";
/**
* 分组方法
*
* @memberof UsrBase
*/
public group(){
let _this:any = this;
if(_this.drawGroup && _this.drawGroup instanceof Function && Object.is(_this.groupMode,"AUTO")){
_this.drawGroup();
}else if(_this.drawCodelistGroup && _this.drawCodelistGroup instanceof Function && Object.is(_this.groupMode,"CODELIST")){
_this.drawCodelistGroup();
}
}
/**
* 绘制分组列表
*
* @memberof UsrBase
*/
public drawGroup(){
let data:Array<any> = [...this.items];
let groups:Array<any> = [];
data.forEach((item: any)=>{
if(item.hasOwnProperty(this.groupField)){
groups.push(item[this.groupField]);
}
});
groups = [...new Set(groups)];
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.groupField])){
children.push(item);
}
});
const tree: any ={
group: group,
children: children
}
groupTree.push(tree);
});
this.groupData = [...groupTree];
}
/**
* 是否单选
*
......@@ -949,7 +870,6 @@ export default class UsrBase extends Vue implements ControlInterface {
this.handleClick(this.items[0]);
}
}
this.group();
}, (response: any) => {
if (response && response.status === 401) {
return;
......@@ -1026,7 +946,6 @@ export default class UsrBase extends Vue implements ControlInterface {
this.items.some((item:any,index:number)=>{
if(Object.is(item.srfkey,data.srfkey)){
this.items.splice(index,1);
this.group();
return true;
}
});
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册