提交 edb19996 编写于 作者: zcdtk's avatar zcdtk

修复常规报错异常

上级 990f5271
......@@ -9,58 +9,54 @@
}
</#assign>
<#assign self_content>
/**
* 工具栏模型数据
*
*
* @type {Array<any>}
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public linkModel:Array<any> = [];
public linkModel: Array<any> = [];
/**
* 获取工具栏按钮
*
*
* @returns {Promise<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(response.message);
return;
}
if (!response || !response.status || !response.data) {
this.$notice.error('系统异常');
return;
}
});
});
public async getWFLinkModel(): Promise<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 });
}
const response: any = await this.appEntityService.GetWFLink({ ...this.context }, datas);
if (response && response.status === 200) {
this.linkModel = response.data;
} else {
const { data: _data } = response;
this.$notice.error(_data.message);
}
return response;
}
/**
* 动态工具栏点击
*
*
* @param {*} linkItem
* @param {*} $event
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public dynamic_toolbar_click(linkItem:any, $event:any){
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) => {
xData.wfsubmit(datas, linkItem).then((response: any) => {
if (!response || response.status !== 200) {
return;
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册