提交 8bea9781 编写于 作者: KK's avatar KK

功能修复--关系界面加载异常

上级 6ed2cf1c
......@@ -24,6 +24,7 @@
<div v-show="!blockUI">
<component
class="viewcontainer2"
ref="appFormDruipart"
:is="viewname"
:viewDefaultUsage="false"
:formDruipart="formDruipart"
......@@ -95,7 +96,7 @@ export default class AppFormDRUIPart extends Vue {
* @type {string}
* @memberof AppFormDRUIPart
*/
@Prop({default:"0"}) public tempMode?:string;
@Prop({ default: "0" }) public tempMode?: string;
/**
* 父数据
......@@ -301,14 +302,14 @@ export default class AppFormDRUIPart extends Vue {
//设置顶层视图唯一标识
Object.assign(_context, this.context);
// 导航参数处理
const {context, param}= this.$viewTool.formatNavigateParam(this.navigateContext, this.navigateParam, _context, this.viewparams, JSON.parse(this.data));
const { context, param } = this.$viewTool.formatNavigateParam(this.navigateContext, this.navigateParam, _context, this.viewparams, JSON.parse(this.data));
Object.assign(this.tempContext, context);
Object.assign(this.tempViewParams, param);
if (this.isRelationalData) {
if(this.tempMode && Object.is(this.tempMode,"2")){
if (this.tempMode && Object.is(this.tempMode, "2")) {
this.blockUIStop();
}else{
} else {
if (!_paramitem || _paramitem == null || Object.is(_paramitem, '')) {
this.blockUIStart();
return;
......@@ -317,7 +318,7 @@ export default class AppFormDRUIPart extends Vue {
}
}
}
setTimeout(()=>{this.formDruipart.next({ action: "load", data: {}})},500)
this.partViewEvent("load", {} );
}
/**
......@@ -372,7 +373,6 @@ export default class AppFormDRUIPart extends Vue {
}
}
});
this.refreshDRUIPart();
}
/**
......@@ -456,6 +456,46 @@ export default class AppFormDRUIPart extends Vue {
public viewload() {
console.log("视图加载完成");
}
/**
* 定时器实例
*
* @type {[any]}
* @memberof AppFormDRUIPart
*/
protected timer?: any;
/**
* 向关系视图发送事件,采用轮询模式。避免异步视图出现加载慢情况
*
* @param {*} action 触发行为
* @param {*} data 数据
* @param {*} count 轮询计数
* @memberof AppFormDRUIPart
*/
protected partViewEvent(action: string, data: any, count: number = 0): void {
if (count > 100) {
return;
}
const clearResource: Function = () => {
if (this.timer !== undefined) {
clearTimeout(this.timer);
this.timer = undefined;
}
}
if (count === 0) {
clearResource();
}
if (this.$refs.appFormDruipart) {
this.formDruipart.next({ action: action, data });
clearResource();
return;
}
this.timer = setTimeout(() => {
count++;
this.partViewEvent(action, data, count);
}, 30);
}
}
</script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册