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

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

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