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

修复常规报错异常

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