提交 8be0ecd3 编写于 作者: RedPig97's avatar RedPig97

update: 选择视图更新

上级 894e2457
......@@ -2,3 +2,4 @@
{{#*inline "SEARCHFORM"}}{{>@macro/front-end/views/view-control/view-search-form/view-control-search-form.hbs}}{{/inline}}
{{#*inline "GRID"}}{{>@macro/front-end/views/view-control/view-grid/view-control-grid.hbs}}{{/inline}}
{{#*inline "APPMENU"}}{{>@macro/front-end/views/view-control/view-menu/view-control-menu.hbs}}{{/inline}}
{{#*inline "PICKUPVIEWPANEL"}}{{>@macro/front-end/views/view-control/view-pickup-panel/view-pickup-panel.hbs}}{{/inline}}
{{name}}:{
action:{
loadAction: '{{ctrl.getPSControlAction.psAppDEMethod.codeName}}',
removeAction: '{{ctrl.removePSControlAction.psAppDEMethod.codeName}}',
updateAction: '{{ctrl.updatePSControlAction.psAppDEMethod.codeName}}',
loadDraftAction: '{{ctrl.getDraftPSControlAction.psAppDEMethod.codeName}}',
createAction: '{{ctrl.createPSControlAction.psAppDEMethod.codeName}}',
fetchAction:'{{ctrl.fetchPSControlAction.psAppDEMethod.codeName}}'
}
}
\ No newline at end of file
......@@ -232,7 +232,11 @@ const openView = () => {
if (!view) {
return;
}
const subject = App.getOpenViewService().openView(view, {});
const params: IParam = {};
if (!Object.is(view.openMode,'POPOVER') && !Object.is(view.openMode,'POPOVER')) {
Object.assign(params,{openMode: 'POPUPMODAL'})
}
const subject = App.getOpenViewService().openView(view, params);
const subjectEvent = subject?.subscribe((data: any) => {
if (data?.ret == 'OK' && data.resultData) {
doEditorEmit(data.resultData);
......
......@@ -24,8 +24,3 @@
</template>
</AppViewBaseLayout>
</template>
\ No newline at end of file
<style lang="scss">
</style>
\ No newline at end of file
......@@ -22,8 +22,3 @@
</template>
</AppViewBaseLayout>
</template>
\ No newline at end of file
<style lang="scss">
</style>
\ No newline at end of file
......@@ -45,11 +45,11 @@ export class PickupViewPanelControl extends MainControl {
* @param {IActionParam} actionParam
* @memberof PickupViewPanelControl
*/
public handleViewEvent(actionParam: IActionParam) {
public onViewEvent(actionParam: IActionParam) {
const { tag, action, data } = actionParam;
const { controlName } = this.state;
if (Object.is("selectionChange", action)) {
this.emit("ctrlEvent", { tag: this.props.name, action: action, data: data });
this.emit("onCtrlEvent", { tag: this.props.name, action: action, data: data });
}
}
......@@ -62,7 +62,7 @@ export class PickupViewPanelControl extends MainControl {
const superParams = super.moduleInstall();
return {
...superParams,
handleViewEvent: this.handleViewEvent.bind(this)
onViewEvent: this.onViewEvent.bind(this)
};
}
}
\ No newline at end of file
.app-pickup-view {
padding: 0;
.app-pickup-grid-view {
padding: 0;
}
.app-view-layout__footer {
padding: 12px 0;
justify-content: flex-end;
}
}
\ No newline at end of file
@use './app-view-base-layout.scss';
@use './app-index-view-base-layout.scss';
@use './app-default-index-view-base-layout.scss';
@use './app-pick-up-view-layout.scss';
\ No newline at end of file
......@@ -65,10 +65,10 @@ export class AppModal {
let props = { view: view, context: params.context, viewParams: params.viewParams, isFullscreen: params.isFullscreen, subject: subject, options: options };
let dir = view.fileDir?.replace(/@views/, '');
//Vite 支持使用特殊的 import.meta.glob 函数从文件系统导入多个模块
const modules = import.meta.glob('../../page/*/*/index.ts');
const modules = import.meta.glob('../../views/*/*/index.ts');
const AsyncComp = defineAsyncComponent({
// 工厂函数
loader: modules['../../page' + dir + '/index.ts'],
loader: modules['../../views' + dir + '/index.ts'],
// 加载异步组件时要使用的组件
loadingComponent: AppLoading,
// 在显示 loadingComponent 之前的延迟 | 默认值:200(单位 ms)
......
......@@ -67,7 +67,7 @@ export class OpenViewService implements IOpenViewService {
* @param params 相关参数
*/
public openByOpenMode(view: ViewDetail, params: Params): Subject<any> | undefined {
const { openMode } = view;
const openMode = params.openMode || view.openMode;
const { viewParams, context } = params;
// 路由打开视图
if (openMode == 'INDEXVIEWTAB' || openMode == 'POPUPAPP') {
......
......@@ -36,7 +36,7 @@ const { state, confirm, onCtrlEvent } = new PickupGridView(viewState, props, emi
</script>
<template>
<AppPickerUpGridViewLayout :class="['app-pickup-grid-view', state.viewSysCss]">
<AppPickUpGridViewLayout :class="['app-pickup-grid-view', state.viewSysCss]">
<template v-slot:header-left>
<AppIconText class="app-view__caption" size="large" :text="state.viewCaption" />
</template>
......@@ -49,20 +49,10 @@ const { state, confirm, onCtrlEvent } = new PickupGridView(viewState, props, emi
:rowActiveMode="state.gridRowActiveMode"
:showBusyIndicator="true"
:viewParams="state.viewParams"
:controlAction="state.controlsAction.{{name}}"
:controlAction="state.{{name}}.action"
:viewSubject="state.viewSubject"
></{{codeName}}Grid>
{{/eq}}
{{/page.ctrls}}
<MainGrid
:context="state.context"
:rowEditState="state.rowEditState"
:rowActiveMode="state.gridRowActiveMode"
:showBusyIndicator="true"
:viewParams="state.viewParams"
:controlAction="state.controlsAction.grid"
:viewSubject="state.viewSubject"
@ctrlEvent="onCtrlEvent"
></MainGrid>
</AppPickerUpGridViewLayout>
</AppPickUpGridViewLayout>
</template>
......@@ -4,7 +4,7 @@ import { PickupView, IActionParam, IParam, IContext } from '@core';
import { viewState } from './{{spinalCase page.codeName}}-state';
{{#page.ctrls}}
{{#eq controlType "PICKUPVIEWPANEL"}}
import { {{codeName}}PickUpViewPanel } from '@widgets/{{spinalCase appEntity.codeName}}/{{spinalCase codeName}}-pickup-view-panel';
import { {{codeName}}PickupViewPanel } from '@widgets/{{spinalCase appEntity.codeName}}/{{spinalCase codeName}}-pickup-view-panel';
{{/eq}}
{{/page.ctrls}}
// props声明和默认值处理
......@@ -28,15 +28,14 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const { state, cancel, confirm,onCtrlEvent } = new PickupView(viewState, props, emit).moduleInstall();
const { state, cancel, confirm, onCtrlEvent } = new PickupView(viewState, props, emit).moduleInstall();
</script>
<template>
<AppPickerUpViewLayout :class="['app-pickup-view', state.viewSysCss]">
<template v-slot:header-left>
<AppPickUpViewLayout :class="['app-pickup-view', state.viewSysCss]">
<template #caption>
<AppIconText class="app-view__caption" size="large" :text="state.viewCaption" />
</template>
{{#page.ctrls}}
{{#eq controlType "TOOLBAR"}}
<template v-slot:toolbar>
......@@ -48,16 +47,16 @@ const { state, cancel, confirm,onCtrlEvent } = new PickupView(viewState, props,
</template>
{{/eq}}
{{#eq controlType "PICKUPVIEWPANEL"}}
<{{codeName}}PickUpViewPanel
<{{codeName}}PickupViewPanel
:context="state.context"
:rowEditState="state.rowEditState"
:rowActiveMode="state.gridRowActiveMode"
:showBusyIndicator="true"
:viewParams="state.viewParams"
:controlAction="state.controlsAction.{{name}}"
:controlAction="state.{{name}}.action"
:viewSubject="state.viewSubject"
@ctrlEvent="onCtrlEvent"
></{{codeName}}PickUpViewPanel>
@onCtrlEvent="onCtrlEvent"
></{{codeName}}PickupViewPanel>
{{/eq}}
{{/page.ctrls}}
<template v-slot:footer>
......@@ -66,15 +65,5 @@ const { state, cancel, confirm,onCtrlEvent } = new PickupView(viewState, props,
<a-button @click="confirm">确认</a-button>
</a-space>
</template>
</AppPickerUpViewLayout>
</AppPickUpViewLayout>
</template>
\ No newline at end of file
<style lang="scss">
.app-pickup-view {
position: relative;
.app-pickup-view--footer {
position: absolute;
bottom: 20px;
right: 35px;
}
}
</style>
\ No newline at end of file
import {{ctrl.codeName}}PickupViewPanel from "./{{ctrl.codeName.spinalCase}}-pickupviewpanel.vue";
import {{ctrl.codeName}}PickupViewPanel from "./{{spinalCase ctrl.codeName}}-pickup-view-panel.vue";
export { {{ctrl.codeName}}PickupViewPanel };
<script setup lang="ts">
import { Subject } from 'rxjs';
import { IActionParam, IParam, ControlAction, PickupViewPanelControl, IContext } from '@core';
import { ctrlState } from './{{ctrl.codeName.spinalCase}}-pickupviewpanelstate';
import { ctrlState } from './{{spinalCase ctrl.codeName}}-pickup-view-panel-state';
{{#if ctrl.embeddedPSAppDEView}}
import {{ctrl.embeddedPSAppDEView.codeName}} from '@views/{{spinalCase ctrl.embeddedPSAppDEView.psAppModule.codeName}}/{{spinalCase ctrl.embeddedPSAppDEView.codeName}}';
{{/if}}
interface Props {
context: IContext;
viewParams?: IParam;
......@@ -25,22 +27,28 @@ const props = withDefaults(defineProps < Props > (), {
// emit声明
interface CtrlEmit {
(name: "ctrlEvent", value: IActionParam): void;
(name: "onCtrlEvent", value: IActionParam): void;
}
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { state, inited, viewdata, viewparam } = new PickupViewPanelControl(ctrlState, props, emit).moduleInstall();
const { state } = new PickupViewPanelControl(ctrlState, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
</script>
<template>
<div class="app-pickupviewpanel{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}">
<component v-if="inited && state.embeddedView && state.embeddedView.viewName" :if="state.embeddedView.viewName"
:viewdata="viewdata" :viewparam="viewparam" :isSingleSelect="state.isSingleSelect"
:isShowButton="state.isShowButton" :selectedData="state.selectedData"></component>
<div class="app-pickup-view-panel{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}">
{{#if ctrl.embeddedPSAppDEView}}
<{{ctrl.embeddedPSAppDEView.codeName}}
:isShowButton="state.isShowButton"
:selectedData="state.selectedData"
/>
{{else}}
<div class="app-pickup-view-panel--empty">视图不存在,请配置选择视图</div>
{{/if}}
</div>
</template>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册