提交 adc3ef6a 编写于 作者: MosYCo's avatar MosYCo

update:调整视图事件抛出标识

上级 938ecd72
......@@ -164,7 +164,7 @@ const refreshDRUIPart = (data?: any) => {
});
};
const viewEvent = (action:any) => {
const onViewEvent = (action:any) => {
};
</script>
......@@ -178,7 +178,7 @@ const viewEvent = (action:any) => {
<AppIconText :text="title" />
</p>
</template>
<slot :context="druipartContext" :viewParams="druipartViewParams" :viewEvent="viewEvent" ></slot>
<slot :context="druipartContext" :viewParams="druipartViewParams" :viewEvent="onViewEvent" ></slot>
</a-card>
</template>
</AppCol>
......
......@@ -105,7 +105,7 @@ export class EditView extends MainView {
*/
public onFormLoad(data: IParam[]): void {
// 抛出数据
this.emit("onViewEvent", { tag: this.state.viewName, action: 'viewLoad', data: data });
this.emit("viewEvent", { tag: this.state.viewName, action: 'viewLoad', data: data });
// 设置工具栏状态
const state: boolean = !Object.is(data[0].srfuf, '1');
this.setToolbarItemState(state, data[0]);
......
......@@ -195,7 +195,7 @@ export class MainView extends ViewBase {
const { tag, action, data } = actionParam;
if (tag === this.state.xDataControlName) {
if (action === 'save') {
this.emit('onViewEvent', { tag: this.state.viewName, action: 'viewsave', data: data });
this.emit('viewEvent', { tag: this.state.viewName, action: 'viewsave', data: data });
}
}
}
......
......@@ -240,7 +240,7 @@ export class MDView extends MainView {
*/
public MDCtrlLoaded(data: IParam[]) {
// 抛出数据
this.emit("onViewEvent", { tag: this.state.viewName, action: 'viewLoad', data: data });
this.emit("viewEvent", { tag: this.state.viewName, action: 'viewLoad', data: data });
// 设置工具栏状态
this.setToolbarItemState(true);
}
......@@ -253,7 +253,7 @@ export class MDView extends MainView {
*/
public selectionChange(data: IParam[]) {
// 抛出数据
this.emit("onViewEvent", { tag: this.state.viewName, action: 'viewDataChange', data: data });
this.emit("viewEvent", { tag: this.state.viewName, action: 'viewDataChange', data: data });
// 设置工具栏状态
const state: boolean = !Object.is(data[0]?.srfuf, '1');
this.setToolbarItemState(state, data[0]?.$DO);
......
......@@ -93,7 +93,7 @@ export class ViewBase {
window.history.back();
} else {
// 非路由模式继续向外抛关闭视图事件
this.emit('onViewEvent', { tag: this.state.viewName, action: 'closeView', data: this.xDataControl?.getData() });
this.emit('viewEvent', { tag: this.state.viewName, action: 'closeView', data: this.xDataControl?.getData() });
}
}
......
......@@ -266,6 +266,7 @@ export class GridControl extends MDControl {
}
resolve(false);
} else {
gridEditState.value[name][rowIndex] = null;
resolve(true);
}
})
......
......@@ -147,7 +147,7 @@ export class MDControl extends MainControl {
item.rowDataState == 'update' ? updateAction : item.rowDataState == 'create' ? createAction : '';
const saveFunName = item.rowDataState == 'update' ? 'update' : 'create';
if (!saveAction) {
return;
continue;
}
const arg: any = { ...opt };
let _context = deepCopy(context);
......@@ -158,7 +158,7 @@ export class MDControl extends MainControl {
action: saveAction,
isLoading: showBusyIndicator,
});
if (response.status || response.status == 200) {
if (response.status && response.status == 200) {
}
}
} catch (error) {
......
......@@ -23,7 +23,7 @@ const props = withDefaults(defineProps<Props>(), {
// emit声明
interface ViewEmit {
(name: "onViewEvent", value: IActionParam): void;
(name: "viewEvent", value: IActionParam): void;
}
const emit = defineEmits<ViewEmit>();
......
......@@ -23,7 +23,7 @@ const props = withDefaults(defineProps<Props>(), {
// emit声明
interface ViewEmit {
(name: "onViewEvent", value: IActionParam): void;
(name: "viewEvent", value: IActionParam): void;
}
const emit = defineEmits<ViewEmit>();
......
......@@ -33,7 +33,7 @@ const props = withDefaults(defineProps<Props>(), {
// emit声明
interface ViewEmit {
(name: "onViewEvent", value: IActionParam): void;
(name: "viewEvent", value: IActionParam): void;
}
const emit = defineEmits<ViewEmit>();
......
......@@ -32,7 +32,7 @@ const props = withDefaults(defineProps<Props>(), {
// emit声明
interface ViewEmit {
(name: "onViewEvent", value: IActionParam): void;
(name: "viewEvent", value: IActionParam): void;
}
const emit = defineEmits<ViewEmit>();
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册