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

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

上级 33449e2e
......@@ -313,17 +313,17 @@ export default {
uiactions: {
},
},
interfunckanban_kanban: {
haspanelkanban_kanban: {
nodata:"",
uiactions: {
new: "New",
edit: "Edit",
remove: "Remove",
},
},
haspanelkanban_kanban: {
interfunckanban_kanban: {
nodata:"",
uiactions: {
new: "New",
edit: "Edit",
remove: "Remove",
},
},
default_searchform: {
......@@ -474,6 +474,56 @@ export default {
},
groupbycodelistlistviewtoolbar_toolbar: {
},
haspanelkanbanviewtoolbar_toolbar: {
tbitem3: {
caption: "New",
tip: "New",
},
deuiaction2: {
caption: "Save",
tip: "Save",
},
tbitem4: {
caption: "Edit",
tip: "Edit {0}",
},
tbitem6: {
caption: "Copy",
tip: "Copy {0}",
},
deuiaction3: {
caption: "Filter",
tip: "Filter",
},
tbitem7: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "Remove",
tip: "Remove {0}",
},
tbitem9: {
caption: "-",
tip: "",
},
deuiaction1: {
caption: "导入",
tip: "导入",
},
tbitem10: {
caption: "-",
tip: "",
},
tbitem16: {
caption: "其它",
tip: "其它",
},
tbitem21: {
caption: "Export Data Model",
tip: "导出数据模型",
},
},
usr2dataviewtoolbar_toolbar: {
},
newdefaultvaluegridviewtoolbar_toolbar: {
......@@ -892,56 +942,6 @@ export default {
},
haspanellistviewtoolbar_toolbar: {
},
haspanelkanbanviewtoolbar_toolbar: {
tbitem3: {
caption: "New",
tip: "New",
},
deuiaction2: {
caption: "Save",
tip: "Save",
},
tbitem4: {
caption: "Edit",
tip: "Edit {0}",
},
tbitem6: {
caption: "Copy",
tip: "Copy {0}",
},
deuiaction3: {
caption: "Filter",
tip: "Filter",
},
tbitem7: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "Remove",
tip: "Remove {0}",
},
tbitem9: {
caption: "-",
tip: "",
},
deuiaction1: {
caption: "导入",
tip: "导入",
},
tbitem10: {
caption: "-",
tip: "",
},
tbitem16: {
caption: "其它",
tip: "其它",
},
tbitem21: {
caption: "Export Data Model",
tip: "导出数据模型",
},
},
ibizbooktimeline_calendar: {
nodata:"",
uiactions: {
......
......@@ -312,17 +312,17 @@ export default {
uiactions: {
},
},
interfunckanban_kanban: {
haspanelkanban_kanban: {
nodata:"",
uiactions: {
new: "新建",
edit: "编辑",
remove: "删除",
},
},
haspanelkanban_kanban: {
interfunckanban_kanban: {
nodata:"",
uiactions: {
new: "新建",
edit: "编辑",
remove: "删除",
},
},
default_searchform: {
......@@ -473,6 +473,56 @@ export default {
},
groupbycodelistlistviewtoolbar_toolbar: {
},
haspanelkanbanviewtoolbar_toolbar: {
tbitem3: {
caption: "新建",
tip: "新建",
},
deuiaction2: {
caption: "保存",
tip: "保存",
},
tbitem4: {
caption: "编辑",
tip: "编辑",
},
tbitem6: {
caption: "拷贝",
tip: "拷贝",
},
deuiaction3: {
caption: "过滤",
tip: "过滤",
},
tbitem7: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "删除",
tip: "删除",
},
tbitem9: {
caption: "-",
tip: "",
},
deuiaction1: {
caption: "导入",
tip: "导入",
},
tbitem10: {
caption: "-",
tip: "",
},
tbitem16: {
caption: "其它",
tip: "其它",
},
tbitem21: {
caption: "导出数据模型",
tip: "导出数据模型",
},
},
usr2dataviewtoolbar_toolbar: {
},
newdefaultvaluegridviewtoolbar_toolbar: {
......@@ -891,56 +941,6 @@ export default {
},
haspanellistviewtoolbar_toolbar: {
},
haspanelkanbanviewtoolbar_toolbar: {
tbitem3: {
caption: "新建",
tip: "新建",
},
deuiaction2: {
caption: "保存",
tip: "保存",
},
tbitem4: {
caption: "编辑",
tip: "编辑",
},
tbitem6: {
caption: "拷贝",
tip: "拷贝",
},
deuiaction3: {
caption: "过滤",
tip: "过滤",
},
tbitem7: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "删除",
tip: "删除",
},
tbitem9: {
caption: "-",
tip: "",
},
deuiaction1: {
caption: "导入",
tip: "导入",
},
tbitem10: {
caption: "-",
tip: "",
},
tbitem16: {
caption: "其它",
tip: "其它",
},
tbitem21: {
caption: "导出数据模型",
tip: "导出数据模型",
},
},
ibizbooktimeline_calendar: {
nodata:"",
uiactions: {
......
......@@ -1249,7 +1249,7 @@ mock.onGet('v7/main-menuappmenu').reply((config: any) => {
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
appfunctag: 'AppFunc27',
resourcetag: '',
},
],
......
<template>
<div class='view-container dekanbanview ibizbookhas-panel-kan-ban-view'>
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="ibizbookhaspanelkanbanview"></app-studioaction>
<card class='view-card ' :dis-hover="true" :bordered="false">
<div slot='title' class="header-container">
<span class='caption-info'>{{$t(model.srfCaption)}}</span>
</div>
<div class='view-top-messages'>
</div>
<div class='content-container'>
<div style="margin-bottom:6px;">
<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'>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class=' deepskyblueToolBar' @click="toolbar_click({ tag: 'tbitem3' }, $event)">
<i class='fa fa-file-text-o'></i>
<span class='caption'>{{$t('entities.ibizbook.haspanelkanbanviewtoolbar_toolbar.tbitem3.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizbook.haspanelkanbanviewtoolbar_toolbar.tbitem3.tip')}}</div>
</tooltip>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.deuiaction2.visabled" :disabled="toolBarModels.deuiaction2.disabled" class='' @click="toolbar_click({ tag: 'deuiaction2' }, $event)">
<i class='fa fa-save'></i>
<span class='caption'>{{$t('entities.ibizbook.haspanelkanbanviewtoolbar_toolbar.deuiaction2.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizbook.haspanelkanbanviewtoolbar_toolbar.deuiaction2.tip')}}</div>
</tooltip>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem4.visabled" :disabled="toolBarModels.tbitem4.disabled" class='' @click="toolbar_click({ tag: 'tbitem4' }, $event)">
<span class='caption'>{{$t('entities.ibizbook.haspanelkanbanviewtoolbar_toolbar.tbitem4.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizbook.haspanelkanbanviewtoolbar_toolbar.tbitem4.tip')}}</div>
</tooltip>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem6.visabled" :disabled="toolBarModels.tbitem6.disabled" class='' @click="toolbar_click({ tag: 'tbitem6' }, $event)">
<span class='caption'>{{$t('entities.ibizbook.haspanelkanbanviewtoolbar_toolbar.tbitem6.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizbook.haspanelkanbanviewtoolbar_toolbar.tbitem6.tip')}}</div>
</tooltip>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.deuiaction3.visabled" :disabled="toolBarModels.deuiaction3.disabled" class='' @click="toolbar_click({ tag: 'deuiaction3' }, $event)">
<i class='fa fa-filter'></i>
<span class='caption'>{{$t('entities.ibizbook.haspanelkanbanviewtoolbar_toolbar.deuiaction3.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizbook.haspanelkanbanviewtoolbar_toolbar.deuiaction3.tip')}}</div>
</tooltip>
<span class='seperator'>|</span>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem8.visabled" :disabled="toolBarModels.tbitem8.disabled" class='' @click="toolbar_click({ tag: 'tbitem8' }, $event)">
<span class='caption'>{{$t('entities.ibizbook.haspanelkanbanviewtoolbar_toolbar.tbitem8.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizbook.haspanelkanbanviewtoolbar_toolbar.tbitem8.tip')}}</div>
</tooltip>
<span class='seperator'>|</span>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.deuiaction1.visabled" :disabled="toolBarModels.deuiaction1.disabled" class='' @click="toolbar_click({ tag: 'deuiaction1' }, $event)">
<i class='fa fa-upload'></i>
<span class='caption'>{{$t('entities.ibizbook.haspanelkanbanviewtoolbar_toolbar.deuiaction1.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizbook.haspanelkanbanviewtoolbar_toolbar.deuiaction1.tip')}}</div>
</tooltip>
<span class='seperator'>|</span>
<dropdown v-show="toolBarModels.tbitem16.visabled" trigger='click'>
<tooltip :transfer="true" :max-width="600">
<i-button class=''>
<i class=''></i>
<span class='caption'>{{$t('entities.ibizbook.haspanelkanbanviewtoolbar_toolbar.tbitem16.caption')}}</span>
<icon type="ios-arrow-down"></icon>
</i-button>
<div slot='content'>{{$t('entities.ibizbook.haspanelkanbanviewtoolbar_toolbar.tbitem16.tip')}}</div>
</tooltip>
<dropdown-menu slot='list'>
<dropdown-item>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem21.visabled" :disabled="toolBarModels.tbitem21.disabled" class='' @click="toolbar_click({ tag: 'tbitem21' }, $event)">
<i class='fa fa-download'></i>
<span class='caption'>{{$t('entities.ibizbook.haspanelkanbanviewtoolbar_toolbar.tbitem21.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizbook.haspanelkanbanviewtoolbar_toolbar.tbitem21.tip')}}</div>
</tooltip>
</dropdown-item>
</dropdown-menu>
</dropdown>
</div>
</div>
</div>
<view_searchform
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:showBusyIndicator="true"
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
@search="searchform_search($event)"
@load="searchform_load($event)"
@closeview="closeView($event)">
</view_searchform>
<div class='view-body-messages'>
</div>
<view_kanban
:viewState="viewState"
:viewparams="viewparams"
:context="context"
createAction="Create"
removeAction="Remove"
updateAction="Update"
fetchAction="FetchDefault"
updateGroupAction="Update"
:showBusyIndicator="true"
:newdata="newdata"
:opendata="opendata"
name="kanban"
ref='kanban'
@selectionchange="kanban_selectionchange($event)"
@beforeload="kanban_beforeload($event)"
@rowdblclick="kanban_rowdblclick($event)"
@remove="kanban_remove($event)"
@load="kanban_load($event)"
@closeview="closeView($event)">
</view_kanban>
</div>
<div class='view-bottom-messages'>
</div>
</card>
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch,Inject } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import { Subject,Subscription } from 'rxjs';
import IBIZBOOKService from '@/service/ibizbook/ibizbook-service';
import IBIZBOOKAuthService from '@/authservice/ibizbook/ibizbook-auth-service';
import KanBanViewEngine from '@engine/view/kan-ban-view-engine';
import IBIZBOOKUIService from '@/uiservice/ibizbook/ibizbook-ui-service';
import CodeListService from "@/codelist/codelist-service";
@Component({
components: {
},
})
export default class IBIZBOOKHasPanelKanBanViewBase extends Vue {
/**
* 实体服务对象
*
* @type {IBIZBOOKService}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public appEntityService: IBIZBOOKService = new IBIZBOOKService;
/**
* 实体UI服务对象
*
* @type IBIZBOOKUIService
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public appUIService: IBIZBOOKUIService = new IBIZBOOKUIService(this.$store);
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图默认使用
*
* @type {string}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 视图标识
*
* @type {string}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public viewtag: string = 'a6cb9804bfd40d2542ae2c44e0cc3331';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public model: any = {
srfCaption: 'entities.ibizbook.views.haspanelkanbanview.caption',
srfTitle: 'entities.ibizbook.views.haspanelkanbanview.title',
srfSubTitle: 'entities.ibizbook.views.haspanelkanbanview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
@Watch('viewparam',{immediate: true, deep: true})
onParamData(newVal: any, oldVal: any) {
if(newVal){
this.viewparams = {};
if(typeof newVal == 'string') {
Object.assign(this.viewparams, JSON.parse(this.viewparam));
}else{
this.viewparams = Util.deepCopy(this.viewparam);
}
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
@Watch('viewdata')
onViewData(newVal: any, oldVal: any) {
const _this: any = this;
if (!Object.is(newVal, oldVal) && _this.engine) {
this.$nextTick(()=>{
_this.parseViewParam();
_this.engine.load();
});
} else if(!Object.is(newVal, oldVal) && _this.refresh && _this.refresh instanceof Function) {
_this.refresh();
}
}
/**
* 容器模型
*
* @type {*}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public containerModel: any = {
view_toolbar: { name: 'toolbar', type: 'TOOLBAR' },
view_kanban: { name: 'kanban', type: 'KANBAN' },
view_searchform: { name: 'searchform', type: 'SEARCHFORM' },
};
/**
* 视图刷新
*
* @param {*} args
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public refresh(args?: any): void {
const refs: any = this.$refs;
if (refs && refs.kanban) {
refs.kanban.refresh();
}
}
/**
* 计数器刷新
*
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 视图状态订阅对象
*
* @public
* @type {Subject<{action: string, data: any}>}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 工具栏模型
*
* @type {*}
* @memberof IBIZBOOKHasPanelKanBanView
*/
public toolBarModels: any = {
tbitem3: { name: 'tbitem3', actiontarget: 'NONE', caption: '新建', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'New', target: '' } },
deuiaction2: { name: 'deuiaction2', actiontarget: 'NONE', caption: '保存', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Save', target: '' } },
tbitem4: { name: 'tbitem4', actiontarget: 'NONE', caption: '编辑', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Edit', target: 'SINGLEKEY' } },
tbitem6: { name: 'tbitem6', actiontarget: 'NONE', caption: '拷贝', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Copy', target: 'SINGLEKEY' } },
deuiaction3: { name: 'deuiaction3', actiontarget: 'NONE', caption: '过滤', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'ToggleFilter', target: '' } },
tbitem7: { name: 'tbitem7', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem8: { name: 'tbitem8', actiontarget: 'NONE', caption: '删除', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Remove', target: 'MULTIKEY' } },
tbitem9: { name: 'tbitem9', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
deuiaction1: { name: 'deuiaction1', actiontarget: 'NONE', caption: '导入', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'ImportExcel', target: 'NONE' } },
tbitem10: { name: 'tbitem10', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem16: { name: 'tbitem16', caption: '其它', disabled: false, type: 'ITEMS', visabled: true, dataaccaction: '', uiaction: { } },
tbitem21: { name: 'tbitem21', actiontarget: 'NONE', caption: '导出数据模型', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'ExportModel', target: '' } },
};
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public engine: KanBanViewEngine = new KanBanViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
kanban: this.$refs.kanban,
opendata: (args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) => {
this.opendata(args,fullargs, params, $event, xData);
},
newdata: (args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) => {
this.newdata(args,fullargs, params, $event, xData);
},
searchform: this.$refs.searchform,
keyPSDEField: 'ibizbook',
majorPSDEField: 'ibizbookname',
isLoadDefault: true,
});
}
/**
* 应用导航服务
*
* @type {*}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public navDataService = NavDataService.getInstance(this.$store);
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public serviceStateEvent: Subscription | undefined;
/**
* 门户部件状态对象
*
* @type {*}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
@Prop() public portletState?: any;
/**
* 门户部件状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public portletStateEvent: Subscription | undefined;
/**
* 应用上下文
*
* @type {*}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public viewparams:any = {};
/**
* 视图缓存数据
*
* @type {*}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public viewCacheData:any;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 解析视图参数
*
* @public
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public parseViewParam(inputvalue:any = null): void {
for(let key in this.context){
delete this.context[key];
}
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
if(typeof this.viewdata == 'string') {
Object.assign(this.context, JSON.parse(this.viewdata));
}
if(this.context && this.context.srfparentdename){
Object.assign(this.viewparams,{srfparentdename:this.context.srfparentdename});
}
if(this.context && this.context.srfparentkey){
Object.assign(this.viewparams,{srfparentkey:this.context.srfparentkey});
}
this.handleCustomViewData();
return;
}
const path = (this.$route.matched[this.$route.matched.length - 1]).path;
const keys: Array<any> = [];
const curReg = this.$pathToRegExp.pathToRegexp(path, keys);
const matchArray = curReg.exec(this.$route.path);
let tempValue: Object = {};
keys.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item.name, {
enumerable: true,
value: matchArray[index + 1]
});
});
this.$viewTool.formatRouteParams(tempValue,this.$route,this.context,this.viewparams);
if(inputvalue){
Object.assign(this.context,{'ibizbook':inputvalue});
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
//初始化导航数据
this.initNavDataWithRoute();
}
/**
* 处理自定义视图数据
*
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public handleCustomViewData(){
if(Object.keys(this.customViewNavContexts).length > 0){
Object.keys(this.customViewNavContexts).forEach((item:any) =>{
let tempContext:any = {};
let curNavContext:any = this.customViewNavContexts[item];
this.handleCustomDataLogic(curNavContext,tempContext,item);
Object.assign(this.context,tempContext);
})
}
if(Object.keys(this.customViewParams).length > 0){
Object.keys(this.customViewParams).forEach((item:any) =>{
let tempParam:any = {};
let curNavParam:any = this.customViewParams[item];
this.handleCustomDataLogic(curNavParam,tempParam,item);
Object.assign(this.viewparams,tempParam);
})
}
}
/**
* 处理自定义视图数据逻辑
*
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public handleCustomDataLogic(curNavData:any,tempData:any,item:string){
// 直接值直接赋值
if(curNavData.isRawValue){
if(Object.is(curNavData.value,"null") || Object.is(curNavData.value,"")){
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: curNavData.value,
writable : true,
enumerable : true,
configurable : true
});
}
}else{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if(this.context[(curNavData.value).toLowerCase()] != null){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.context[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
if(this.viewparams[(curNavData.value).toLowerCase()] != null){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.viewparams[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}
}
}
}
/**
* 初始化导航数据(路由模式)
*
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'ibizbookhas-panel-kan-ban-view',tag:this.viewtag,srfkey:isNew ? null : this.context.ibizbook,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
/**
* 初始化导航数据(分页模式)
*
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'ibizbookhas-panel-kan-ban-view',tag:this.viewtag,srfkey:this.context.ibizbook,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
}
}
/**
* Vue声明周期
*
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public afterCreated(){
let _this:any = this;
const secondtag = _this.$util.createUUID();
_this.$store.commit('viewaction/createdView', { viewtag: _this.viewtag, secondtag: secondtag });
_this.viewtag = secondtag;
_this.parseViewParam();
_this.serviceStateEvent = _this.navDataService.serviceState.subscribe(({ action,name, data }:{ action:string,name:any,data:any }) => {
if(!Object.is(name,'ibizbookhas-panel-kan-ban-view')){
return;
}
if (Object.is(action, 'viewrefresh')) {
_this.$nextTick(()=>{
_this.parseViewParam(data);
if(_this.engine){
_this.engine.load();
}
});
}
});
if(_this.portletState){
_this.portletStateEvent = _this.portletState.subscribe((res:any) =>{
if(!Object.is(res.name,'IBIZBOOKHasPanelKanBanView')){
return;
}
if(Object.is(res.action,'refresh') && _this.refresh && _this.refresh instanceof Function){
_this.refresh();
}
})
}
}
/**
* 销毁之前
*
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
}
/**
* toolbar 部件 click 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public toolbar_click($event: any, $event2?: any) {
if (Object.is($event.tag, 'tbitem3')) {
this.toolbar_tbitem3_click(null, '', $event2);
}
if (Object.is($event.tag, 'deuiaction2')) {
this.toolbar_deuiaction2_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem4')) {
this.toolbar_tbitem4_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem6')) {
this.toolbar_tbitem6_click(null, '', $event2);
}
if (Object.is($event.tag, 'deuiaction3')) {
this.toolbar_deuiaction3_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem24')) {
this.toolbar_tbitem24_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem25')) {
this.toolbar_tbitem25_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem8')) {
this.toolbar_tbitem8_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem13')) {
this.toolbar_tbitem13_click(null, '', $event2);
}
if (Object.is($event.tag, 'deuiaction1')) {
this.toolbar_deuiaction1_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem11')) {
this.toolbar_tbitem11_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem21')) {
this.toolbar_tbitem21_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem23')) {
this.toolbar_tbitem23_click(null, '', $event2);
}
}
/**
* kanban 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public kanban_selectionchange($event: any, $event2?: any) {
this.engine.onCtrlEvent('kanban', 'selectionchange', $event);
}
/**
* kanban 部件 beforeload 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public kanban_beforeload($event: any, $event2?: any) {
this.engine.onCtrlEvent('kanban', 'beforeload', $event);
}
/**
* kanban 部件 rowdblclick 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public kanban_rowdblclick($event: any, $event2?: any) {
this.engine.onCtrlEvent('kanban', 'rowdblclick', $event);
}
/**
* kanban 部件 remove 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public kanban_remove($event: any, $event2?: any) {
this.engine.onCtrlEvent('kanban', 'remove', $event);
}
/**
* kanban 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public kanban_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('kanban', 'load', $event);
}
/**
* searchform 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public searchform_save($event: any, $event2?: any) {
this.engine.onCtrlEvent('searchform', 'save', $event);
}
/**
* searchform 部件 search 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public searchform_search($event: any, $event2?: any) {
this.engine.onCtrlEvent('searchform', 'search', $event);
}
/**
* searchform 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public searchform_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('searchform', 'load', $event);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem3_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.kanban;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.New(datas, contextJO,paramJO, $event, xData,this,"IBIZBOOK");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_deuiaction2_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.kanban;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Save(datas, contextJO,paramJO, $event, xData,this,"IBIZBOOK");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem4_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.kanban;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Edit(datas, contextJO,paramJO, $event, xData,this,"IBIZBOOK");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem6_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.kanban;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Copy(datas, contextJO,paramJO, $event, xData,this,"IBIZBOOK");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_deuiaction3_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.kanban;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ToggleFilter(datas, contextJO,paramJO, $event, xData,this,"IBIZBOOK");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem24_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.kanban;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ToggleRowEdit(datas, contextJO,paramJO, $event, xData,this,"IBIZBOOK");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem25_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.kanban;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.NewRow(datas, contextJO,paramJO, $event, xData,this,"IBIZBOOK");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem8_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.kanban;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Remove(datas, contextJO,paramJO, $event, xData,this,"IBIZBOOK");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem13_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.kanban;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ExportExcel(datas, contextJO,paramJO, $event, xData,this,"IBIZBOOK");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_deuiaction1_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.kanban;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ImportExcel(datas, contextJO,paramJO, $event, xData,this,"IBIZBOOK");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem11_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.kanban;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Print(datas, contextJO,paramJO, $event, xData,this,"IBIZBOOK");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem21_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.kanban;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ExportModel(datas, contextJO,paramJO, $event, xData,this,"IBIZBOOK");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem23_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.kanban;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Import(datas, contextJO,paramJO, $event, xData,this,"IBIZBOOK");
}
/**
* 打开新建数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof IBIZBOOKHasPanelKanBanView
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
const data: any = {};
if(args[0].srfsourcekey){
data.srfsourcekey = args[0].srfsourcekey;
}
let tempContext = JSON.parse(JSON.stringify(this.context));
delete tempContext.ibizbook;
if(args.length >0){
Object.assign(tempContext,args[0]);
}
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'editview', parameterName: 'editview' },
];
const _this: any = this;
const openIndexViewTab = (data: any) => {
const _data: any = { w: (new Date().getTime()) };
Object.assign(_data, data);
const routePath = this.$viewTool.buildUpRoutePath(this.$route, tempContext, deResParameters, parameters, args, _data);
this.$router.push(routePath);
}
openIndexViewTab(data);
}
/**
* 打开编辑数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof IBIZBOOKHasPanelKanBanView
*/
public opendata(args: any[],fullargs?:any,params?: any, $event?: any, xData?: any) {
if(!this.viewDefaultUsage){
if(Object.is(this.navModel,"route")){
this.initNavDataWithRoute(this.viewCacheData, false, true);
}else{
this.initNavDataWithTab(this.viewCacheData, false, true);
}
}
let localContext:any = null;
let localViewParam:any =null;
const data: any = {};
let tempContext = JSON.parse(JSON.stringify(this.context));
if(args.length >0){
Object.assign(tempContext,args[0]);
}
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'editview', parameterName: 'editview' },
];
const _this: any = this;
if(fullargs && fullargs.copymode){
Object.assign(data,{copymode:true});
}
const openIndexViewTab = (data: any) => {
const routePath = this.$viewTool.buildUpRoutePath(this.$route, tempContext, deResParameters, parameters, args, data);
this.$router.push(routePath);
}
openIndexViewTab(data);
}
/**
* 新建
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public New(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 保存
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public Save(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
// 界面行为容器对象 _this
const _this: any = this;
if (xData && xData.save instanceof Function) {
xData.save().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
_this.$emit('viewdataschange', [{ ...response.data }]);
});
} else if (_this.save && _this.save instanceof Function) {
_this.save();
}
}
/**
* 编辑
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public Edit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
if (args.length === 0) {
return;
}
const _this: any = this;
if (_this.opendata && _this.opendata instanceof Function) {
const data: any = { };
if (args.length > 0) {
Object.assign(data, { ibizbook: args[0].ibizbook })
}
_this.opendata([{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 拷贝
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public Copy(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
if (args.length === 0) {
return;
}
const _this: any = this;
if (_this.opendata && _this.opendata instanceof Function) {
const data: any = { };
if (args.length > 0) {
Object.assign(data, { ibizbook: args[0].ibizbook });
}
if(!params) params = {};
Object.assign(params,{copymode:true});
_this.opendata([{ ...data }], params, $event, xData);
} else {
Object.assign(this.viewparams,{copymode:true});
}
}
/**
* 过滤
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public ToggleFilter(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (_this.hasOwnProperty('isExpandSearchForm')) {
_this.isExpandSearchForm = !_this.isExpandSearchForm;
}
}
/**
* 行编辑
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public ToggleRowEdit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
xData.actualIsOpenEdit = !xData.actualIsOpenEdit;
}
/**
* 新建行
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public NewRow(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
const data: any = {};
if (_this.hasOwnProperty('newRow') && _this.newRow instanceof Function) {
_this.newRow([{ ...data }], params, $event, xData);
} else if(xData.newRow && xData.newRow instanceof Function) {
xData.newRow([{ ...data }], params, $event, xData);
}else{
_this.$Notice.error({ title: '错误', desc: 'newRow 视图处理逻辑不存在,请添加!' });
}
}
/**
* 删除
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public Remove(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (!xData || !(xData.remove instanceof Function)) {
return ;
}
xData.remove(args);
}
/**
* 导出
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public ExportExcel(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (!xData || !(xData.exportExcel instanceof Function) || !$event) {
return ;
}
xData.exportExcel($event.exportparms);
}
/**
* 导入
*
* @param {any[]} args 当前数据
* @param {any} context 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @param {*} [srfParentDeName] 父实体名称
* @returns {Promise<any>}
*/
public async ImportExcel(args: any[], context:any = {} ,params: any={}, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let data: any = {};
let parentContext:any = {};
let parentViewParam:any = {};
const _this: any = actionContext;
const _args: any[] = Util.deepCopy(args);
const actionTarget: string | null = 'NONE';
if(_this.context){
parentContext = _this.context;
}
if(_this.viewparams){
parentViewParam = _this.viewparams;
}
context = UIActionTool.handleContextParam(actionTarget,_args,parentContext,parentViewParam,context);
data = UIActionTool.handleActionParam(actionTarget,_args,parentContext,parentViewParam,params);
context = Object.assign({},actionContext.context,context);
let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null};
Object.assign(data,parentObj);
Object.assign(context,parentObj);
const openPopupApp = (url: string) => {
window.open(url, '_blank');
return null;
}
const url = `../../ibizutil/uploaddedataview.jsp?srfdeid=`;
openPopupApp(url);
}
/**
* 打印
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public Print(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let _this:any = this;
if (!xData || !(xData.print instanceof Function) || !$event) {
return ;
}
xData.print();
}
/**
* 导出数据模型
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public ExportModel(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
this.$Notice.error({ title: '错误', desc: '导出数据模型未支持' });
}
/**
* 数据导入
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public Import(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (!xData || !(xData.importExcel instanceof Function) || !$event) {
return ;
}
xData.importExcel(params);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public closeView(args: any[]): void {
let _view: any = this;
if (_view.viewdata) {
_view.$emit('viewdataschange', [args]);
_view.$emit('close', [args]);
} else if (_view.$tabPageExp) {
_view.$tabPageExp.onClose(_view.$route.fullPath);
}
}
/**
* 销毁视图回调
*
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public afterDestroyed(){
if(this.viewDefaultUsage){
let localStoreLength = Object.keys(localStorage);
if(localStoreLength.length > 0){
localStoreLength.forEach((item:string) =>{
if(item.startsWith(this.context.srfsessionid)){
localStorage.removeItem(item);
}
})
}
if(Object.is(this.navModel,"tab")){
this.navDataService.removeNavDataByTag(this.viewtag);
}
if (this.serviceStateEvent) {
this.serviceStateEvent.unsubscribe();
}
}
// 销毁计数器定时器
if(this.counterServiceArray && this.counterServiceArray.length >0){
this.counterServiceArray.forEach((item:any) =>{
if(item.destroyCounter && item.destroyCounter instanceof Function){
item.destroyCounter();
}
})
}
if(this.portletStateEvent){
this.portletStateEvent.unsubscribe();
}
}
/**
* 视图唯一标识
*
* @type {string}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public viewUID: string = 'sample-ibizbookhas-panel-kan-ban-view';
/**
* 搜索值
*
* @type {string}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public query: string = '';
/**
* 是否展开搜索表单
*
* @type {boolean}
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public isExpandSearchForm: boolean = false;
/**
* 快速搜索
*
* @param {*} $event
* @memberof IBIZBOOKHasPanelKanBanViewBase
*/
public onSearch($event: any): void {
const refs: any = this.$refs;
if (refs.dataview) {
refs.dataview.refresh({});
}
}
}
</script>
<style lang='less'>
@import './ibizbookhas-panel-kan-ban-view.less';
</style>
\ No newline at end of file
.ibizbookhas-panel-kan-ban-view{
position: relative;
}
.toolbar-container {
button {
margin: 6px 0px 4px 4px;
.caption {
margin-left: 4px;
}
}
.seperator {
color: #dcdee2;
margin: 0 0px 0 4px;
}
}
// this is less
.deepskyblueToolBar {color:white !important;background-color:#108cee !important;}
.ibizbookhas-panel-kan-ban-view{
display: block;
}
\ No newline at end of file
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import IBIZBOOKHasPanelKanBanViewBase from './ibizbookhas-panel-kan-ban-view-base.vue';
import view_kanban from '@widgets/ibizbook/has-panel-kan-ban-kanban/has-panel-kan-ban-kanban.vue';
import view_searchform from '@widgets/ibizbook/default-searchform/default-searchform.vue';
@Component({
components: {
view_kanban,
view_searchform,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
if(!Object.is(vm.navModel,"route")){
vm.initNavDataWithTab(vm.viewCacheData);
}
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
});
},
})
export default class IBIZBOOKHasPanelKanBanView extends IBIZBOOKHasPanelKanBanViewBase {
}
</script>
\ No newline at end of file
......@@ -127,6 +127,7 @@ export const PageComponents = {
Vue.component('ibizbookedit-view', () => import('@pages/sample/ibizbookedit-view/ibizbookedit-view.vue'));
Vue.component('ibizsample0001-sf5-edit-view', () => import('@pages/sample/ibizsample0001-sf5-edit-view/ibizsample0001-sf5-edit-view.vue'));
Vue.component('ibizbookgroup-by-codelist-list-view', () => import('@pages/sample/ibizbookgroup-by-codelist-list-view/ibizbookgroup-by-codelist-list-view.vue'));
Vue.component('ibizbookhas-panel-kan-ban-view', () => import('@pages/sample/ibizbookhas-panel-kan-ban-view/ibizbookhas-panel-kan-ban-view.vue'));
Vue.component('ibizorder-radar-chart-view', () => import('@pages/sample/ibizorder-radar-chart-view/ibizorder-radar-chart-view.vue'));
Vue.component('ibizbookupdate-default-grid-view', () => import('@pages/sample/ibizbookupdate-default-grid-view/ibizbookupdate-default-grid-view.vue'));
Vue.component('ibizsample0003-stab-exp-view', () => import('@pages/sample/ibizsample0003-stab-exp-view/ibizsample0003-stab-exp-view.vue'));
......
......@@ -1873,6 +1873,20 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizbookgroup-by-codelist-list-view/ibizbookgroup-by-codelist-list-view.vue'),
},
{
path: 'ibizbooks/:ibizbook?/haspanelkanbanview/:haspanelkanbanview?',
meta: {
caption: 'entities.ibizbook.views.haspanelkanbanview.caption',
info:'',
parameters: [
{ pathName: 'index', parameterName: 'index' },
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'haspanelkanbanview', parameterName: 'haspanelkanbanview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizbookhas-panel-kan-ban-view/ibizbookhas-panel-kan-ban-view.vue'),
},
{
path: 'ibizorders/:ibizorder?/radarchartview/:radarchartview?',
meta: {
......@@ -3017,6 +3031,19 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizsample0003-spickup-tree-view/ibizsample0003-spickup-tree-view.vue'),
},
{
path: '/ibizbooks/:ibizbook?/haspanelkanbanview/:haspanelkanbanview?',
meta: {
caption: 'entities.ibizbook.views.haspanelkanbanview.caption',
info:'',
parameters: [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'haspanelkanbanview', parameterName: 'haspanelkanbanview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizbookhas-panel-kan-ban-view/ibizbookhas-panel-kan-ban-view.vue'),
},
{
path: '/ibizsample0003s/:ibizsample0003?/editview/:editview?',
meta: {
......
......@@ -214,6 +214,7 @@ export const viewstate: any = {
'09663b7a4e3dce70524d1b64e02b5e2d',
'edca8ee67304eb78c02bbfb9e4cb11bb',
'e2a1c9cb077cd2c74f2f2b914fb1db84',
'a6cb9804bfd40d2542ae2c44e0cc3331',
'd3321077dfab8bc6b92c649e5b69daf3',
'491c2bc6eab0ad313d4b6f06f6a396f5',
'e53fed4d0b4dd614057f426b02115b41',
......@@ -855,6 +856,16 @@ export const viewstate: any = {
refviews: [
],
},
{
viewtag: 'a6cb9804bfd40d2542ae2c44e0cc3331',
viewmodule: 'Sample',
viewname: 'IBIZBOOKHasPanelKanBanView',
viewaction: '',
viewdatachange: false,
refviews: [
'b3429ecc4d89a02bc5f5279f1bd7f620',
],
},
{
viewtag: 'a7f212bb3011d82e8f7798905c97eb34',
viewmodule: 'Sample',
......
......@@ -578,6 +578,9 @@ export default class MainMenuBase extends Vue implements ControlInterface {
case 'Auto155':
this.clickAuto155(item);
return;
case 'AppFunc27':
this.clickAppFunc27(item);
return;
case 'Auto114':
this.clickAuto114(item);
return;
......@@ -1230,6 +1233,29 @@ export default class MainMenuBase extends Vue implements ControlInterface {
})
}
/**
* 图书看板视图(嵌入视图面板)
*
* @param {*} [item={}]
* @memberof MainMenu
*/
public clickAppFunc27(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'haspanelkanbanview', parameterName: 'haspanelkanbanview' },
];
const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
if(Object.is(this.$route.fullPath,path)){
return;
}
this.$nextTick(function(){
this.$router.push(path);
})
}
/**
* 表单项更新
*
......
......@@ -1320,7 +1320,7 @@ export default class MainMenuModel {
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
appfunctag: 'AppFunc27',
resourcetag: '',
authtag:'Web-MainMenu-menuitem105',
},
......
<template>
<div class="app-data-view-group">
<template v-if="items.length > 0">
<template v-for="(group, index) of groups">
<div :key="index" class="dataview-group-folading-kanban">
<div class="dataview-group-icon">
<Icon :type="group.folding ? 'md-arrow-dropright' : 'md-arrow-dropleft'" size="25" @click="onClick(group,index)"/>
</div>
<div class="dataview-group-folding">
<span>{{getGroupText(group.value)}}({{group.items.length}})</span>
</div>
</div>
<div :key="group + index" class="dataview-group-content dataview-group-kanban" style="flex-grow: 1;">
<div class="dataview-group-header">
{{ getGroupText(group.value) }}
</div>
<draggable :list="group.items" group="kanban" class="dataview-group-items" @change="onDragChange($event, group.value)">
<div v-for="(item, i) in group.items" :key="i" :class="{'dataview-group-item': true, 'is-select': item.isselected}" @click="handleClick(item)" @dblclick="handleDblClick(item)">
<layout_itemlayoutpanel name='itemlayoutpanel' :inputData="item" @panelDataChange="($event)=>{onPanelDataChange(item,$event)}"></layout_itemlayoutpanel>
</div>
</draggable>
</div>
</template>
</template>
<template v-else>
<span class="app-data-empty">{{ $t('entities.ibizbook.haspanelkanban_kanban.nodata') }}</span>
</template>
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util,ViewTool } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import AppCenterService from "@service/app/app-center-service";
import IBIZBOOKService from '@/service/ibizbook/ibizbook-service';
import HasPanelKanBanService from './has-panel-kan-ban-kanban-service';
import IBIZBOOKUIService from '@/uiservice/ibizbook/ibizbook-ui-service';
import draggable from "vuedraggable";
import CodeListService from '@codelist/codelist-service';
@Component({
components: {
draggable,
}
})
export default class HasPanelKanBanBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof HasPanelKanBanBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof HasPanelKanBanBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof HasPanelKanBanBase
*/
@Prop() public context: any;
/**
* 视图参数
*
* @type {*}
* @memberof HasPanelKanBanBase
*/
@Prop() public viewparams: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof HasPanelKanBanBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof HasPanelKanBanBase
*/
public getControlType(): string {
return 'KANBAN'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof HasPanelKanBanBase
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {HasPanelKanBanService}
* @memberof HasPanelKanBanBase
*/
public service: HasPanelKanBanService = new HasPanelKanBanService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZBOOKService}
* @memberof HasPanelKanBanBase
*/
public appEntityService: IBIZBOOKService = new IBIZBOOKService({ $store: this.$store });
/**
* 转化数据
*
* @param {any} args
* @memberof HasPanelKanBanBase
*/
public transformData(args: any) {
let _this: any = this;
if(_this.service && _this.service.handleRequestData instanceof Function && _this.service.handleRequestData('transform',_this.context,args)){
return _this.service.handleRequestData('transform',_this.context,args)['data'];
}
}
/**
* 关闭视图
*
* @param {any} args
* @memberof HasPanelKanBanBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof HasPanelKanBanBase
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof HasPanelKanBanBase
*/
public getDatas(): any[] {
return this.selections;
}
/**
* 获取单项树
*
* @returns {*}
* @memberof HasPanelKanBanBase
*/
public getData(): any {
return null;
}
/**
* 是否默认选中第一条数据
*
* @type {boolean}
* @memberof HasPanelKanBanBase
*/
@Prop({ default: false }) public isSelectFirstDefault!: boolean;
/**
* 显示处理提示
*
* @type {boolean}
* @memberof HasPanelKanBanBase
*/
@Prop({ default: true }) public showBusyIndicator?: boolean;
/**
* 部件行为--create
*
* @type {string}
* @memberof HasPanelKanBanBase
*/
@Prop() public createAction!: string;
/**
* 部件行为--remove
*
* @type {string}
* @memberof HasPanelKanBanBase
*/
@Prop() public removeAction!: string;
/**
* 部件行为--update
*
* @type {string}
* @memberof HasPanelKanBanBase
*/
@Prop() public updateAction!: string;
/**
* 部件行为--fetch
*
* @type {string}
* @memberof HasPanelKanBanBase
*/
@Prop() public fetchAction!: string;
/**
* 部件行为--updateGroup
*
* @type {string}
* @memberof HasPanelKanBanBase
*/
@Prop() public updateGroupAction!: string;
/**
* 是否单选
*
* @type {boolean}
* @memberof HasPanelKanBanBase
*/
@Prop() public isSingleSelect?: boolean;
/**
* 打开新建数据视图
*
* @type {any}
* @memberof HasPanelKanBanBase
*/
@Prop() public newdata: any;
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof HasPanelKanBanBase
*/
@Prop() public opendata: any;
/**
* 数据
*
* @type {any[]}
* @memberof HasPanelKanBanBase
*/
public items: any[] = [];
/**
* 是否支持分页
*
* @type {boolean}
* @memberof HasPanelKanBanBase
*/
public isEnablePagingBar: boolean = true;;
/**
* 总条数
*
* @type {number}
* @memberof HasPanelKanBanBase
*/
public totalRecord: number = 0;
/**
* 加载的数据是否附加在items之后
*
* @type {boolean}
* @memberof HasPanelKanBanBase
*/
public isAddBehind:boolean = false;
/**
* 选中数组
* @type {Array<any>}
* @memberof HasPanelKanBanBase
*/
public selections: Array<any> = [];
/**
* 代码表服务
*
* @type {CodeListService}
* @memberof HasPanelKanBanBase
*/
public codeListService:CodeListService = new CodeListService( {$store: this.$store});
/**
* 代码表数据
*
* @type {Array<any>}
* @memberof HasPanelKanBanBase
*/
public allCodeList:Array<any> = [];
/**
* 当前页
*
* @type {number}
* @memberof HasPanelKanBanBase
*/
public curPage: number = 1;
/**
* 分页条数
*
* @type {number}
* @memberof HasPanelKanBanBase
*/
public limit: number = 20;
/**
* 排序方向
*
* @type {string}
* @memberof HasPanelKanBanBase
*/
public sortDir:string = '';
/**
* 排序字段
*
* @type {string}
* @memberof HasPanelKanBanBase
*/
public sortField: string = '';
/**
* 是否分组
*
* @type {string}
* @memberof HasPanelKanBanBase
*/
public isGroup: boolean = true;
/**
* 分组集合
*
* @type {string}
* @memberof HasPanelKanBanBase
*/
public groups: any[] = [];
/**
* 分组属性名称
*
* @type {string}
* @memberof HasPanelKanBanBase
*/
public groupField: string = '';
/**
* 分组模式
*
* @type {string}
* @memberof HasPanelKanBanBase
*/
public groupMode: string = 'NONE'
/**
* 分组代码表
*
* @type {string}
* @memberof HasPanelKanBanBase
*/
public groupCodelist: any = {};
/**
* Vue声明周期,组件挂载完毕
*
* @memberof HasPanelKanBanBase
*/
public mounted () {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof HasPanelKanBanBase
*/
public afterMounted(){
}
/**
* Vue声明周期,组件创建完毕
*
* @memberof HasPanelKanBanBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof HasPanelKanBanBase
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(this.name, tag)) {
return;
}
if (Object.is(action,'load')) {
this.refresh(data)
}
if (Object.is(action,'filter')) {
this.refresh(data)
}
});
}
}
/**
* 加载更多
*
* @memberof HasPanelKanBanBase
*/
public loadMore(){
if(this.totalRecord>this.items.length)
{
this.curPage = ++this.curPage;
this.isAddBehind = true;
this.load({});
}
}
/**
* 刷新
*
* @param {*} [opt={}]
* @memberof HasPanelKanBanBase
*/
public refresh(args?: any) {
this.curPage = 1;
this.load(args, true);
}
/**
* vue 生命周期
*
* @memberof HasPanelKanBanBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof HasPanelKanBanBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 表格数据加载
*
* @public
* @param {*} [arg={}]
* @param {boolean} [isReset=false] 是否重置items
* @memberof HasPanelKanBanBase
*/
public async load(opt: any = {}, isReset: boolean = false) {
if(!this.fetchAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKHasPanelKanBanView' + (this.$t('app.kanban.notConfig.fetchAction') as string) });
return;
}
const arg: any = {...opt};
const page: any = {};
if (this.isEnablePagingBar) {
Object.assign(page, { page: this.curPage-1, size: this.limit });
}
// 设置排序
if (!Object.is(this.sortDir, '') && !Object.is(this.sortField, '')) {
const sort: string = this.sortField+","+this.sortDir;
Object.assign(page, { sort: sort });
}
Object.assign(arg, page);
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}
return;
}
const data: any = response.data;
if(!this.isAddBehind){
this.items = [];
}
if (Object.keys(data).length > 0) {
let datas = JSON.parse(JSON.stringify(data));
datas.map((item: any) => {
Object.assign(item, { isselected: false });
});
this.totalRecord = response.total;
if(isReset){
this.items = datas;
}else{
this.items.push(...datas);
}
}
this.isAddBehind = false;
this.setGroups();
this.$emit('load', this.items);
if(this.isSelectFirstDefault){
this.handleClick(this.items[0]);
}
}, (response: any) => {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
});
}
/**
* 删除
*
* @param {any[]} datas
* @returns {Promise<any>}
* @memberof HasPanelKanBanBase
*/
public async remove(datas: any[]): Promise<any> {
if(!this.removeAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKHasPanelKanBanView' + (this.$t('app.kanban.notConfig.removeAction') as string) });
return;
}
let _datas:any[] = [];
datas.forEach((record: any, index: number) => {
if (Object.is(record.srfuf, '0')) {
this.items.some((val: any, num: number) =>{
if(JSON.stringify(val) == JSON.stringify(record)){
this.items.splice(num,1);
return true;
}
});
}else{
_datas.push(datas[index]);
}
});
if (_datas.length === 0) {
return;
}
let dataInfo = '';
_datas.forEach((record: any, index: number) => {
let srfmajortext = record.srfmajortext;
if (index < 5) {
if (!Object.is(dataInfo, '')) {
dataInfo += '、';
}
dataInfo += srfmajortext;
} else {
return false;
}
});
if (_datas.length < 5) {
dataInfo = dataInfo + ' 共' + _datas.length + '条数据';
} else {
dataInfo = dataInfo + '...' + ' 共' + _datas.length + '条数据';
}
const removeData = () => {
let keys: any[] = [];
_datas.forEach((data: any) => {
keys.push(data.srfkey);
});
let _removeAction = keys.length > 1 ? 'removeBatch' : this.removeAction ;
const context:any = JSON.parse(JSON.stringify(this.context));
const post: Promise<any> = this.service.delete(_removeAction,Object.assign(context,{ ibizbook: keys.join(';') }),Object.assign({ ibizbook: keys.join(';') },{viewparams:this.viewparams}), this.showBusyIndicator);
return new Promise((resolve: any, reject: any) => {
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '', desc: (this.$t('app.commonWords.delDataFail') as string) + ',' + response.info });
return;
} else {
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.deleteSuccess') as string) });
}
//删除items中已删除的项
_datas.forEach((data: any) => {
this.items.some((item:any,index:number)=>{
if(Object.is(item.srfkey,data.srfkey)){
this.items.splice(index,1);
return true;
}
});
});
this.$emit('remove', null);
this.selections = [];
resolve(response);
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
reject(response);
return;
}
reject(response);
});
});
}
dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, '').replace(/[ ]/g, '');
this.$Modal.confirm({
title: (this.$t('app.commonWords.warning') as string),
content: (this.$t('app.kanban.delete1') as string) + dataInfo + ',' + (this.$t('app.kanban.delete2') as string),
onOk: () => {
removeData();
},
onCancel: () => { }
});
return removeData;
}
/**
* 设置分组集合
*
* @param {*}
* @memberof HasPanelKanBanBase
*/
public updateData(opt: any) {
const arg: any = { ...opt };
Object.assign(arg, { viewparams: this.viewparams });
let _context = JSON.parse(JSON.stringify(this.context));
Object.assign(_context, { ibizbook: opt.srfkey });
const post: Promise<any> = this.service.update(this.updateGroupAction, _context, arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
this.setGroups();
return;
}
let item = this.items.find((item: any) => Object.is(item.srfkey, response.data.srfkey));
Object.assign(item, response.data);
this.setGroups();
this.$emit('update', this.items);
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
return;
}
});
}
/**
* 设置分组集合
*
* @param {}
* @memberof HasPanelKanBanBase
*/
public async setGroups() {
if(!this.isGroup || !this.groupField || Object.is(this.groupMode, 'NONE')) {
return;
}
if(Object.is(this.groupMode, 'AUTO')) {
this.groups = [];
this.items.forEach(item => {
let group: any = this.groups.find((group: any) => Object.is(group.name, item[this.groupField]));
if(!group) {
this.groups.push({
name: item[this.groupField],
value: item[this.groupField],
items: this.getGroupItems(item[this.groupField])
})
}
});
}
if(Object.is(this.groupMode, 'CODELIST') && this.groupCodelist) {
this.groups = [];
let codelistItems: any = await this.codeListService.getDataItems(this.groupCodelist);
this.allCodeList = Util.deepCopy(codelistItems);
if(codelistItems && codelistItems.length >0) {
codelistItems.forEach((item: any) => {
this.groups.push({
name: item.value,
value: item.value,
items: this.getGroupItems(item.value)
})
})
}
}
}
/**
* 设置分组集合
*
* @param {string} name
* @memberof HasPanelKanBanBase
*/
public getGroupItems(name: string) {
let datas: any = [];
this.items.forEach(item => {
if(Object.is(item[this.groupField], name)) {
datas.push(item);
}
})
return datas;
}
/**
* 设置分组集合
*
* @param {string} name
* @memberof HasPanelKanBanBase
*/
public getGroupText(name: string) {
if(Object.is(this.groupMode, 'CODELIST') && this.groupCodelist) {
if(this.allCodeList && this.allCodeList.length >0) {
if(!name) {
return '未定义';
}
let item = this.allCodeList.find((item: any) => Object.is(item.value, name));
if(item) {
return item.text;
}
}
}else{
return name;
}
}
/**
* 选择数据
* @memberof HasPanelKanBanBase
*
*/
public handleClick(args: any) {
args.isselected = !args.isselected;
this.items.forEach((item:any) =>{
if(item.srfkey !== args.srfkey){
item.isselected =false;
}
})
this.selectchange();
}
/**
* 双击数据
* @memberof HasPanelKanBanBase
*
*/
public handleDblClick(args: any) {
args.isselected = true;
this.items.forEach((item:any) =>{
if(item.srfkey !== args.srfkey){
item.isselected =false;
}
})
this.$emit('rowdblclick', args);
}
/**
* 触发事件
* @memberof HasPanelKanBanBase
*
*/
public selectchange() {
this.selections = [];
this.items.map((item: any) => {
if (item.isselected) {
this.selections.push(item);
}
});
this.$emit('selectionchange', this.selections);
}
/**
* 点击时触发看板的展开和收起
*
* @param group 分组看板
* @param index 分组看板编号
* @memberof HasPanelKanBanBase
*/
public onClick(group: any,index: number){
group.folding = !group.folding;
let kanban: any = this.$el.getElementsByClassName('dataview-group-kanban')[index];
if(group.folding){
kanban.style.display="none";
}else{
kanban.style.display="block";
}
this.$forceUpdate();
}
/**
* 界面行为
*
* @param {*} tag
* @param {*} $event
* @memberof HasPanelKanBanBase
*/
public uiAction(tag: any, $event: any) {
let row = this.selections.length > 0 ? this.selections[0] : {};
}
/**
* 面板数据变化处理事件
* @param {any} item 当前列数据
* @param {any} $event 面板事件数据
*
* @memberof HasPanelKanBanBase
*/
public onPanelDataChange(item:any,$event:any) {
Object.assign(item, $event, {rowDataState:'update'});
}
/**
* 拖拽变化
*
* @param {*} evt
* @param {*} name
* @memberof HasPanelKanBanBase
*/
public onDragChange(evt: any, name: string) {
if(evt && evt.added && evt.added.element) {
let item: any = JSON.parse(JSON.stringify(evt.added.element))
item[this.groupField] = name;
this.updateData(item)
}
}
}
</script>
<style lang='less'>
@import './has-panel-kan-ban-kanban.less';
</style>
\ No newline at end of file
/**
* HasPanelKanBan 部件模型
*
* @export
* @class HasPanelKanBanModel
*/
export default class HasPanelKanBanModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof HasPanelKanBanKanbanMode
*/
public getDataItems(): any[] {
return [
{
name: 'subtext',
prop: 'subtext',
dataType: 'TEXT',
},
{
name: 'author',
prop: 'author',
dataType: 'TEXT',
},
{
name: 'price',
prop: 'price',
dataType: 'FLOAT',
},
{
name: 'booknumber',
prop: 'booknumber',
dataType: 'INT',
},
{
name: 'ibizbookid',
prop: 'ibizbookid',
dataType: 'GUID',
},
{
name: 'srfkey',
prop: 'ibizbookid',
dataType: 'GUID',
},
{
name: 'srfmajortext',
prop: 'ibizbookname',
dataType: 'TEXT',
},
{
name: 'ibizbook',
prop: 'ibizbookid',
dataType: 'FONTKEY',
},
{
name: 'n_ibizbookname_like',
prop: 'n_ibizbookname_like',
dataType: 'QUERYPARAM'
},
{
name: 'n_price_gtandeq',
prop: 'n_price_gtandeq',
dataType: 'QUERYPARAM'
},
{
name:'size',
prop:'size'
},
{
name:'query',
prop:'query'
},
{
name:'sort',
prop:'sort'
},
{
name:'page',
prop:'page'
},
{
name:'srfparentdata',
prop:'srfparentdata'
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import IBIZBOOKService from '@/service/ibizbook/ibizbook-service';
import HasPanelKanBanModel from './has-panel-kan-ban-kanban-model';
/**
* HasPanelKanBan 部件服务对象
*
* @export
* @class HasPanelKanBanService
*/
export default class HasPanelKanBanService extends ControlService {
/**
* 图书服务对象
*
* @type {IBIZBOOKService}
* @memberof HasPanelKanBanService
*/
public appEntityService: IBIZBOOKService = new IBIZBOOKService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof HasPanelKanBanService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of HasPanelKanBanService.
*
* @param {*} [opts={}]
* @memberof HasPanelKanBanService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new HasPanelKanBanModel();
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HasPanelKanBanService
*/
@Errorlog
public search(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.FetchDefault(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 删除数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HasPanelKanBanService
*/
@Errorlog
public delete(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.remove(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 更新数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof HasPanelKanBanService
*/
@Errorlog
public update(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.update(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
}
\ No newline at end of file
.app-data-view-group {
height: 100%;
display: flex;
overflow: auto;
.dataview-group-folading-kanban{
border: 1px solid #ddd;
text-align: center;
border-left: 0;
height: 100%;
width: 40px;
background-color: #d8d8d8;
color: #a5a5a5;
.dataview-group-icon{
padding: 6px 0;
}
.dataview-group-folding{
height: calc(100% - 39px);
writing-mode: tb;
width: 31px;
font-size: 17px;
}
}
.dataview-group-content {
border: 1px solid #ddd;
border-left: 0;
flex-shrink: 0;
height: 100%;
display: flex;
flex-direction: column;
.dataview-group-header {
height: 36px;
line-height: 36px;
border-bottom: 1px solid #ddd;
padding: 0 8px;
.group-action {
.group-action-item:nth-child(1) + .group-action-item {
margin-top: 5px;
}
}
}
.dataview-group-items {
flex-grow: 1;
overflow: auto;
.dataview-group-item {
margin: 8px 8px 0 8px;
border: 1px solid #ddd;
padding: 8px;
overflow: hidden;
}
.dataview-group-item.is-select {
border-color: #108cee;
}
}
}
.dataview-group-content:nth-child(1) {
border-left: 1px solid #ddd;
}
.quick-action {
flex-shrink: 0;
margin-left: 5px;
.quick-action-item {
width: 37px;
height: 37px;
text-align: center;
line-height: 37px;
border: 1px solid #ddd;
border-top-width: 0;
}
.quick-action-item:nth-child(1) {
border-top-width: 1px;
}
}
.app-data-empty{
margin: 0 auto;
display: flex;
align-items: center;
justify-content: center;
}
}
// this is less
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import HasPanelKanBanBase from './has-panel-kan-ban-kanban-base.vue';
import layout_itemlayoutpanel from '@widgets/ibizbook/has-panel-kan-ban-panel/has-panel-kan-ban-panel.vue';
@Component({
components: {
layout_itemlayoutpanel,
}
})
export default class HasPanelKanBan extends HasPanelKanBanBase {
}
</script>
\ No newline at end of file
<template>
<row class="app-layoutpanel " style="width:100%;height:100%;">
<i-col v-show="detailsModel.container1.visible" :md="{ span: 24, offset: 0 }" class="app-layoutpanel-container" style="width:;height:100%;">
<row style="height:100%;">
<i-col v-show="detailsModel.srfmajortext.visible" :md="{ span: 12, offset: 3 }" :lg="{ span: 12, offset: 3 }" style="" class="app-layoutpanel-field">
<div class="item-field">
<app-panel-field
name='srfmajortext'
labelPos='LEFT'
caption=""
:isEmptyCaption="false"
:error='detailsModel.srfmajortext.error'
:data='data'
:value='data.srfmajortext'
:itemRules="rules.srfmajortext">
<app-span :value="data.srfmajortext" name="srfmajortext" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""> </app-span>
</app-panel-field>
</div>
</i-col>
<i-col v-show="detailsModel.author.visible" :md="{ span: 9, offset: 0 }" :lg="{ span: 9, offset: 0 }" style="" class="app-layoutpanel-field">
<div class="item-field">
<app-panel-field
name='author'
labelPos='LEFT'
caption=""
:isEmptyCaption="false"
:error='detailsModel.author.error'
:data='data'
:value='data.author'
:itemRules="rules.author">
<app-span :value="data.author" name="author" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""> </app-span>
</app-panel-field>
</div>
</i-col>
<i-col v-show="detailsModel.srfsubtext.visible" :md="{ span: 24, offset: 0 }" style="" class="app-layoutpanel-field">
<div class="item-field">
<app-panel-field
name='srfsubtext'
labelPos='LEFT'
caption=""
:isEmptyCaption="false"
:error='detailsModel.srfsubtext.error'
:data='data'
:value='data.srfsubtext'
:itemRules="rules.srfsubtext">
<app-span :value="data.srfsubtext" name="srfsubtext" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""> </app-span>
</app-panel-field>
</div>
</i-col>
</row>
</i-col>
</row>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util,ViewTool } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import AppCenterService from "@service/app/app-center-service";
import IBIZBOOKService from '@/service/ibizbook/ibizbook-service';
import HasPanelKanBanService from './has-panel-kan-ban-panel-service';
import IBIZBOOKUIService from '@/uiservice/ibizbook/ibizbook-ui-service';
import { PanelDetailModel,PanelRawitemModel,PanelTabPanelModel,PanelTabPageModel,PanelFieldModel,PanelContainerModel,PanelControlModel,PanelUserControlModel,PanelButtonModel } from '@/model/panel-detail';
import HasPanelKanBanModel from './has-panel-kan-ban-panel-model';
import CodeListService from "@/codelist/codelist-service";
import UIService from '@/uiservice/ui-service';
@Component({
components: {
}
})
export default class HasPanelKanBanBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof HasPanelKanBanBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof HasPanelKanBanBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof HasPanelKanBanBase
*/
@Prop() public context: any;
/**
* 视图参数
*
* @type {*}
* @memberof HasPanelKanBanBase
*/
@Prop() public viewparams: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof HasPanelKanBanBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof HasPanelKanBanBase
*/
public getControlType(): string {
return 'PANEL'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof HasPanelKanBanBase
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {HasPanelKanBanService}
* @memberof HasPanelKanBanBase
*/
public service: HasPanelKanBanService = new HasPanelKanBanService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZBOOKService}
* @memberof HasPanelKanBanBase
*/
public appEntityService: IBIZBOOKService = new IBIZBOOKService({ $store: this.$store });
/**
* 转化数据
*
* @param {any} args
* @memberof HasPanelKanBanBase
*/
public transformData(args: any) {
let _this: any = this;
if(_this.service && _this.service.handleRequestData instanceof Function && _this.service.handleRequestData('transform',_this.context,args)){
return _this.service.handleRequestData('transform',_this.context,args)['data'];
}
}
/**
* 关闭视图
*
* @param {any} args
* @memberof HasPanelKanBanBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof HasPanelKanBanBase
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 接口实现
*
* @returns {any[]}
* @memberof HasPanelKanBanBase
*/
getDatas(): any[] {
if (!this.panelData) {
return [];
}
return [this.panelData];
}
/**
* 接口实现
*
* @returns {*}
* @memberof HasPanelKanBanBase
*/
getData() {
return this.panelData;
}
/**
* 父级部件引用
*
* @type {*}
* @memberof HasPanelKanBanBase
*/
@Prop() public parentRef?: any;
/**
* 面板数据对象
*
* @type {*}
* @memberof HasPanelKanBanBase
*/
@Prop() public inputData?: any;
/**
* UI数据对象
*
* @type {*}
* @memberof HasPanelKanBanBase
*/
public data:any = {};
/**
* 面板数据对象
*
* @type {*}
* @memberof HasPanelKanBanBase
*/
public panelData:any = null;
/**
* 数据模型对象
*
* @type {HasPanelKanBanModel}
* @memberof HasPanelKanBanBase
*/
public dataModel:HasPanelKanBanModel = new HasPanelKanBanModel();
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof HasPanelKanBanBase
*/
public codeListService:CodeListService = new CodeListService({ $store:this.$store });
/**
* 界面UI服务对象
*
* @type {IBIZBOOKUIService}
* @memberof HasPanelKanBanBase
*/
public appUIService:IBIZBOOKUIService = new IBIZBOOKUIService(this.$store);
/**
* 详情模型集合
*
* @type {*}
* @memberof HasPanelKanBanBase
*/
public detailsModel: any = {
srfmajortext: new PanelFieldModel({ caption: '', itemType: 'FIELD',visible: true, disabled: false, name: 'srfmajortext', panel: this })
,
author: new PanelFieldModel({ caption: '', itemType: 'FIELD',visible: true, disabled: false, name: 'author', panel: this })
,
srfsubtext: new PanelFieldModel({ caption: '', itemType: 'FIELD',visible: true, disabled: false, name: 'srfsubtext', panel: this })
,
container1: new PanelContainerModel({ caption: '', itemType: 'CONTAINER',visible: true, disabled: false, name: 'container1', panel: this })
,
};
/**
* 值规则对象
*
* @type {*}
* @memberof HasPanelKanBanBase
*/
public rules:any={
srfmajortext:[
{ required: false, type: 'string', message: ' 值不能为空'},
{ required: false, type: 'string', message: ' 值不能为空'}
],
author:[
{ required: false, type: 'string', message: ' 值不能为空'},
{ required: false, type: 'string', message: ' 值不能为空'}
],
srfsubtext:[
{ required: false, type: 'string', message: ' 值不能为空'},
{ required: false, type: 'string', message: ' 值不能为空'}
],
};
/**
* 监听数据对象
*
* @memberof HasPanelKanBanBase
*/
@Watch('inputData',{immediate:true,deep: true})
public onInputDataChange(newVal: any, oldVal: any){
if(newVal){
this.computedUIData(newVal);
this.panelData = Util.deepCopy(newVal);
this.computeButtonState(newVal);
this.panelLogic({ name: '', newVal: null, oldVal: null });
this.$forceUpdate();
}
}
/**
* 计算UI展示数据
*
* @param codelistArray 代码表模型数组
* @memberof HasPanelKanBanBase
*/
public computedUIData(newVal:any){
if((this.dataModel.getDataItems instanceof Function) && this.dataModel.getDataItems().length >0){
this.dataModel.getDataItems().forEach((item:any) =>{
this.data[item.name] = newVal[item.prop];
})
}
}
/**
* 计算面板按钮权限状态
*
* @param {*} [data] 传入数据
* @memberof HasPanelKanBanBase
*/
public computeButtonState(data:any){
// 若为项布局面板,存在parentRef
if(this.parentRef){
let targetData:any = this.parentRef.transformData(data);
if(this.detailsModel && Object.keys(this.detailsModel).length >0){
Object.keys(this.detailsModel).forEach((name:any) =>{
if(this.detailsModel[name] && this.detailsModel[name].uiaction && this.detailsModel[name].uiaction.dataaccaction && Object.is(this.detailsModel[name].itemType,"BUTTON")){
this.detailsModel[name].isPower = true;
let tempUIAction:any = JSON.parse(JSON.stringify(this.detailsModel[name].uiaction));
let result: any[] = ViewTool.calcActionItemAuthState(targetData,[tempUIAction],this.appUIService?this.appUIService:null);
this.detailsModel[name].visible = tempUIAction.visabled;
this.detailsModel[name].disabled = tempUIAction.disabled;
this.detailsModel[name].isPower = result[0] === 1 ? true : false;
}
})
}
}
}
/**
* 界面行为
*
* @param {*} row
* @param {*} tag
* @param {*} $event
* @memberof HasPanelKanBanBase
*/
public uiAction(row: any, tag: any, $event: any) {
}
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof HasPanelKanBanBase
*/
public opendata(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any){
if (this.parentRef.opendata && this.parentRef.opendata instanceof Function) {
this.parentRef.opendata(args,fullargs,params, $event, xData);
}
}
/**
* 打开新建数据视图
*
* @type {any}
* @memberof HasPanelKanBanBase
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
if (this.parentRef.newdata && this.parentRef.newdata instanceof Function) {
this.parentRef.newdata(args,fullargs,params, $event, xData);
}
}
/**
* 删除
*
* @param {any[]} datas
* @returns {Promise<any>}
* @memberof HasPanelKanBanBase
*/
public async remove(datas: any[]): Promise<any> {
if (this.parentRef.remove && this.parentRef.remove instanceof Function) {
return this.parentRef.remove(datas);
}
}
/**
* 刷新
*
* @param {*} [args={}]
* @memberof HasPanelKanBanBase
*/
public refresh(args: any = {}) {
if (this.parentRef.refresh && this.parentRef.refresh instanceof Function) {
this.parentRef.refresh(args);
}
}
/**
* 设置变更面板编辑项的值
*
* @param data 面板数据
* @param {{ name: string, value: any }} $event
* @returns {void}
* @memberof HasPanelKanBanBase
*/
public onPanelItemValueChange(data: any,$event: { name: string, value: any }): void {
if (!$event) {
return;
}
if (!$event.name || Object.is($event.name, '') || !data.hasOwnProperty($event.name)) {
return;
}
data[$event.name] = $event.value;
this.panelEditItemChange(data, $event.name, $event.value);
}
/**
* 面板编辑项值变化后续操作
*
* @public
* @param data 面板数据
* @param property 编辑项名
* @param value 编辑项值
* @returns {void}
* @memberof HasPanelKanBanBase
*/
public panelEditItemChange(data: any, property: string, value: any){
// 面板数据变化事件
if((this.dataModel.getDataItems instanceof Function) && this.dataModel.getDataItems().length >0){
let modelitem =this.dataModel.getDataItems().find((item:any) =>{
return item.name === property;
})
if(modelitem){
this.$emit('panelDataChange',{[modelitem.prop]: value});
}
}
}
/**
* 分页切换事件
*
* @memberof HasPanelKanBanBase
*/
public handleTabPanelClick(name:string,$event:any){
this.detailsModel[name].clickPage($event.name);
}
/**
* 面板逻辑
*
* @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof HasPanelKanBanBase
*/
public panelLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
}
}
</script>
<style lang='less'>
@import './has-panel-kan-ban-panel.less';
</style>
/**
* HasPanelKanBan 部件模型
*
* @export
* @class HasPanelKanBanModel
*/
export default class HasPanelKanBanModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof HasPanelKanBanModel
*/
public getDataItems(): any[] {
return [
{
name: 'srfmajortext',
prop: 'srfmajortext'
},
{
name: 'author',
prop: 'author'
},
{
name: 'srfsubtext',
prop: 'subtext'
}
]
}
}
\ No newline at end of file
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* HasPanelKanBan 部件服务对象
*
* @export
* @class HasPanelKanBanService
*/
export default class HasPanelKanBanService extends ControlService {
}
\ No newline at end of file
// this is less
.app-layoutpanel {
height: 100%;
.app-layoutpanel-container {
padding: 6px;
}
.app-layoutpanel-tabpanel{
>.el-tabs {
>.el-.el-tabs__header{
margin: 0 0 10px;
}
.app-layoutpanel-tabpage{
padding: 6px;
}
}
}
.app-layoutpanel-button,.app-layoutpanel-conctrl,.app-layoutpanel-ctrlpos,.app-layoutpanel-field,.app-layoutpanel-rowitem,.app-layoutpanel-usercontrol{
padding: 6px;
}
.item-field{
padding: 0 4px;
display: flex;
>.item-field-label{
padding: 0 8px;
}
}
}
\ No newline at end of file
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import HasPanelKanBanBase from './has-panel-kan-ban-panel-base.vue';
@Component({
components: {
}
})
export default class HasPanelKanBan extends HasPanelKanBanBase {
}
</script>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册