提交 6cfa37f3 编写于 作者: KK's avatar KK

工作流动态编辑/导航多数据/编辑(分页)

上级 87a07fba
CTRLTYPE=VIEWLAYOUTPANEL#APPDEWFDYNAEDITVIEW
\ No newline at end of file
<div class="view-container ${view.getViewType()?lower_case} ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card <#if !view.isShowCaptionBar()> view-no-caption</#if> <#if !view.hasPSControl('toolbar')> view-no-toolbar</#if>' :disHover="true" :padding="0" :bordered="false">
<#ibizinclude>
../@MACRO/VIEW_CAPTION.vue.ftl
</#ibizinclude>
<split id="${view.getCodeName()?lower_case}" v-model="split" mode="horizontal">
<div slot='left'>
<el-tree ref="tree" :data="wfStepModel" node-key="userTaskId" :highlight-current="true" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
</div>
<div slot="right">
<div class="content-container">
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'CONTROL.html').code}
</#if>
<#if view.hasPSControl('mdctrl')>
${P.getCtrlCode('mdctrl', 'CONTROL.html').code}
</#if>
</div>
</div>
</split>
</card>
</div>
\ No newline at end of file
<#ibizinclude>
../@MACRO/DEFAULT.less.ftl
</#ibizinclude>
\ No newline at end of file
<#ibizinclude>
../@MACRO/DEFAULT.less.ftl
</#ibizinclude>
\ No newline at end of file
<div class="view-container ${view.getViewType()?lower_case} ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card <#if !view.isShowCaptionBar()> view-no-caption</#if> <#if !view.hasPSControl('toolbar')> view-no-toolbar</#if>' :disHover="true" :padding="0" :bordered="false">
<div slot="extra">
<div class='toolbar-container'>
<tooltip :transfer="true" :max-width="600" v-for="(linkItem, index) in linkModel" :key="index">
<i-button @click="dynamic_toolbar_click(linkItem, $event)">
<span class='caption'>{{linkItem.sequenceFlowName}}</span>
</i-button>
<div slot='content'>{{linkItem.sequenceFlowName}}</div>
</tooltip>
</div>
</div>
<div class="content-container">
<#if view.hasPSControl('form')>
<@ibizindent blank=8>
${P.getCtrlCode('form', 'CONTROL.html').code}
</@ibizindent>
</#if>
</div>
</card>
</div>
\ No newline at end of file
VIEWTYPE=APPDEWFDYNAEDITVIEW
\ No newline at end of file
<#assign self_content>
/**
* 分割宽度
*
* @type {number}
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public split: number = 0.2;
/**
* 树导航栏数据
*
* @type {any}
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public wfStepModel: Array<any> = [];
/**
* 是否展开搜索表单
*
* @type {any}
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public isExpandSearchForm:boolean = true;
/**
* 是否单选
*
* @type {any}
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public isSingleSelect:boolean = true;
/**
* 左侧树的默认配置
*
* @type {any}
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public defaultProps:any ={
children: 'children',
label: 'userTaskName'
};
/**
* 左侧树当前选中节点
*
* @type {any}
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public curSelectedNode:any;
/**
* 获取树导航栏数据
*
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public getWFStepModel():Promise<any>{
return new Promise((resolve:any, reject:any) =>{
this.appEntityService.WFGetWFStep().then((response:any) =>{
if (response && response.status === 200) {
this.wfStepModel = response.data;
if(this.wfStepModel && this.wfStepModel.length > 0){
this.curSelectedNode = this.wfStepModel[0];
}
Object.assign(this.viewparams,{'userTaskId':this.curSelectedNode['userTaskId'],'processDefinitionKey':this.curSelectedNode['processDefinitionKey']});
this.setTreeNodeHighLight(this.curSelectedNode);
resolve(response.data);
}
}).catch((response: any) => {
if (response && response.status) {
this.$Notice.error({ title: '错误', desc: response.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
return;
}
});
})
}
/**
* 左侧树选中节点
*
* @type {any}
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public handleNodeClick(data:any) {
this.curSelectedNode = data;
this.setTreeNodeHighLight(this.curSelectedNode);
Object.assign(this.viewparams,{'userTaskId':data['userTaskId'],'processDefinitionKey':data['processDefinitionKey']});
(this.$refs.searchform as any).onSearch();
}
/**
* 设置选中高亮
*
* @param {*} data
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public setTreeNodeHighLight(data: any): void {
this.$nextTick(() =>{
const tree: any = this.$refs.tree;
tree.setCurrentKey(data.userTaskId);
})
}
<#if view.hasPSControl('mdctrl')>
<#assign mdctrl = view.getPSControl('mdctrl')>
/**
* 刷新数据
*
* @readonly
* @type {(number | null)}
* @memberof ${srfclassname('${view.name}')}Base
*/
get refreshdata(): number | null {
return this.$store.getters['viewaction/getRefreshData'](this.viewtag);
}
/**
* 监控数据变化
*
* @param {*} newVal
* @param {*} oldVal
* @returns
* @memberof ${srfclassname('${view.name}')}Base
*/
@Watch('refreshdata')
onRefreshData(newVal: any, oldVal: any) {
if (newVal === null || newVal === undefined) {
return;
}
if (newVal === 0) {
return;
}
const mdctrl: any = this.$refs.${mdctrl.name};
if (mdctrl) {
mdctrl.load({});
}
}
</#if>
</#assign>
<#ibizinclude>
../@MACRO/VIEW-BASE.vue.ftl
</#ibizinclude>
\ No newline at end of file
VIEWTYPE=DEMOBWFDYNAEXPMDVIEW
\ No newline at end of file
${P.getLayoutCode().code}
\ No newline at end of file
<#ibizinclude>
../@MACRO/VIEW.vue.ftl
</#ibizinclude>
\ No newline at end of file
VIEWTYPE=DEMOBWFDYNAEDITVIEW
\ No newline at end of file
<#assign self_content>
/**
* 工具栏模型数据
*
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public linkModel:Array<any> = [];
/**
* 获取工具栏按钮
*
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public getWFLinkModel():Promise<any>{
return new Promise((resolve:any, reject:any) =>{
let datas: any[] = [];
let xData: any = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(Object.keys(this.viewparams).length > 0){
Object.assign(datas,{'taskDefinitionKey':this.viewparams.userTaskId});
}
this.appEntityService.GetWFLink(JSON.parse(JSON.stringify(this.context)),datas,true).then((response:any) =>{
if (response && response.status === 200) {
this.linkModel = response.data;
resolve(response.data);
}
}).catch((response: any) => {
if (response && response.status) {
this.$Notice.error({ title: '错误', desc: response.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
return;
}
});
});
}
/**
* 动态工具栏点击
*
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public dynamic_toolbar_click(linkItem:any, $event:any){
let datas: any[] = [];
let xData: any = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
xData.wfsubmit(datas,linkItem).then((response: any) => {
if (!response || response.status !== 200) {
return;
}
const { data: _data } = response;
if (this.viewdata) {
this.$emit('viewdataschange', [{ ..._data }]);
this.$emit('close');
} else if (this.$tabPageExp) {
this.$tabPageExp.onClose(this.$route.fullPath);
}
});
}
</#assign>
<#ibizinclude>
../@MACRO/VIEW-BASE.vue.ftl
</#ibizinclude>
\ No newline at end of file
<#ibizinclude>
../@MACRO/VIEW.vue.ftl
</#ibizinclude>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册