提交 1ae5c553 编写于 作者: ibizdev's avatar ibizdev

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

上级 abddddc3
......@@ -10,6 +10,9 @@
</div>
<div class='content-container'>
<div style="margin-bottom:6px;">
<div class="quick-group-container">
<app-quick-group :items="quickGroupModel" @valuechange="quickGroupValueChange"></app-quick-group>
</div>
<i-input v-show='!this.isExpandSearchForm ' v-model='query' search @on-search='onSearch' placeholder="图书名称" class='pull-left' style='max-width: 400px;margin-top:6px;' />
<div class='pull-right'>
<div class='toolbar-container'>
......@@ -634,7 +637,7 @@ export default class IBIZBOOKDataViewBase extends Vue {
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
_this.loadQuickGroupModel();
}
......@@ -1084,6 +1087,100 @@ export default class IBIZBOOKDataViewBase extends Vue {
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof IBIZBOOKDataViewBase
*/
public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/**
* 快速分组数据对象
*
* @memberof IBIZBOOKDataViewBase
*/
public quickGroupData:any;
/**
* 快速分组是否有抛值
*
* @memberof IBIZBOOKDataViewBase
*/
public isEmitQuickGroupValue:boolean = false;
/**
* 快速分组模型
*
* @memberof IBIZBOOKDataViewBase
*/
public quickGroupModel:Array<any> = [];
/**
* 加载快速分组模型
*
* @memberof IBIZBOOKDataViewBase
*/
public loadQuickGroupModel(){
let quickGroupCodeList:any = {tag:'Bookgroup',codelistType:'STATIC'};
if(quickGroupCodeList.tag && Object.is(quickGroupCodeList.codelistType,"STATIC")){
const codelist = this.$store.getters.getCodeList(quickGroupCodeList.tag);
if (codelist) {
this.quickGroupModel = [...this.handleDynamicData(JSON.parse(JSON.stringify(codelist.items)))];
} else {
console.log(`----${quickGroupCodeList.tag}----代码表不存在`);
}
}else if(quickGroupCodeList.tag && Object.is(quickGroupCodeList.codelistType,"DYNAMIC")){
this.codeListService.getItems(quickGroupCodeList.tag,{},{}).then((res:any) => {
this.quickGroupModel = res;
}).catch((error:any) => {
console.log(`----${quickGroupCodeList.tag}----代码表不存在`);
});
}
}
/**
* 处理快速分组模型动态数据部分(%xxx%)
*
* @memberof IBIZBOOKDataViewBase
*/
public handleDynamicData(inputArray:Array<any>){
if(inputArray.length >0){
inputArray.forEach((item:any) =>{
if(item.data && Object.keys(item.data).length >0){
Object.keys(item.data).forEach((name:any) =>{
let value: any = item.data[name];
if (value && typeof(value)=='string' && value.startsWith('%') && value.endsWith('%')) {
const key = (value.substring(1, value.length - 1)).toLowerCase();
if (this.context[key]) {
value = this.context[key];
} else if(this.viewparams[key]){
value = this.viewparams[key];
}
}
item.data[name] = value;
})
}
})
}
return inputArray;
}
/**
* 快速分组值变化
*
* @memberof IBIZBOOKDataViewBase
*/
public quickGroupValueChange($event:any){
if($event){
this.quickGroupData = $event.data;
if(this.isEmitQuickGroupValue){
this.onSearch($event);
}
}
this.isEmitQuickGroupValue = true;
}
}
</script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册