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

update: 选择视图更新

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