提交 86877ff0 编写于 作者: RedPig97's avatar RedPig97

update:表格链接视图参数优化

上级 00d71b95
<script setup lang="ts"> <script setup lang="ts">
import { IActionParam, IContext, IParam } from '@core'; import { deepCopy, EditorBase, IActionParam, IContext, IParam } from '@core';
interface ColumnLinkProps { interface ColumnLinkProps {
/** /**
...@@ -45,19 +45,26 @@ interface ColumnLinkProps { ...@@ -45,19 +45,26 @@ interface ColumnLinkProps {
} }
const props = withDefaults(defineProps<ColumnLinkProps>(), {}); const props = withDefaults(defineProps<ColumnLinkProps>(), {});
const { handleEditorNavParams } = new EditorBase();
const { navContext, navViewParam } = handleEditorNavParams(props);
interface EditorEmit { interface EditorEmit {
(name: 'editorEvent', value: IActionParam): void; (name: 'editorEvent', value: IActionParam): void;
} }
const openLinkView = ($event: any) => { const openLinkView = ($event: any) => {
if (!props.linkView) { $event.stopPropagation();
if (!props.linkView && !props.data || !props.valueItem || !props.data[props.valueItem]) {
return; return;
} }
const view = App.getViewInfo(props.linkView); const view: any = App.getViewInfo(props.linkView);
if (!view) { if (!view) {
return; return;
} }
const params: IParam = {}; const appEntity = App.getEntityInfo(view?.appEntityCodeName);
const subject = App.getOpenViewService().openView(view, params); const keyField: string = appEntity.keyField || 'keyField';
let _navContext = deepCopy(navContext);
let _navViewParam = deepCopy(navViewParam);
Object.assign(_navContext,{keyField: props.data[props.valueItem]});
const subject = App.getOpenViewService().openView(view, {_navContext, _navViewParam});
const subjectEvent = subject?.subscribe((data: any) => { const subjectEvent = subject?.subscribe((data: any) => {
if (data?.ret == 'OK' && data.resultData) { if (data?.ret == 'OK' && data.resultData) {
openViewClose(data.resultData); openViewClose(data.resultData);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册