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

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

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