提交 8320da65 编写于 作者: RedPig97's avatar RedPig97

update:表格链接视图适配

上级 408ba038
......@@ -11,6 +11,10 @@
minWidth: {{item.width}},
{{/if}}
resizable: true,
{{#if (and item.enableLinkView item.linkPSAppView)}}
linkView: "{{item.linkPSAppView.codeName}}",
linkValueItem: "{{item.linkValueItem}}",
{{/if}}
{{#eq item.columnType 'GROUPGRIDCOLUMN'}}
children: [
{{#each item.psDEGridColumns as | column |}}
......
......@@ -9,7 +9,14 @@
></AppCodelist>
{{else if (and item.enableLinkView item.linkPSAppView)}}
{{!-- 链接视图暂未支持 --}}
<span class="text">\{{text}}</span>
<app-column-link
:context="state.context"
:viewParams="state.viewParams"
:linkView="column.linkView"
:valueItem="column.linkValueItem"
:data="record" >
<span>\{{text}}</span>
</app-column-link>
{{else}}
{{#if item.valueFormat}}
<AppSpan
......
<script setup lang="ts">
import { IActionParam, IContext, IParam } from '@core';
interface ColumnLinkProps {
/**
* 表格行数据
*
* @type {IParam}
* @memberof ColumnLinkProps
*/
data: IParam;
/**
* 视图上下文
*
* @type {IContext}
* @memberof ColumnLinkProps
*/
context: IContext;
/**
* 视图参数
*
* @type {IParam}
* @memberof ColumnLinkProps
*/
viewParams: IParam;
/**
* 链接视图
*
* @type {string}
* @memberof ColumnLinkProps
*/
linkView: string;
/**
* 值项
*
* @type {string}
* @memberof ColumnLinkProps
*/
valueItem: string;
}
const props = withDefaults(defineProps<ColumnLinkProps>(), {});
interface EditorEmit {
(name: 'editorEvent', value: IActionParam): void;
}
const openLinkView = ($event: any) => {
if (!props.linkView) {
return;
}
const view = App.getViewInfo(props.linkView);
if (!view) {
return;
}
const params: IParam = {};
const subject = App.getOpenViewService().openView(view, params);
const subjectEvent = subject?.subscribe((data: any) => {
if (data?.ret == 'OK' && data.resultData) {
openViewClose(data.resultData);
}
subjectEvent?.unsubscribe();
});
}
const openViewClose = (result: any) => {
if (Array.isArray(result) && result.length > 0) {
// 视图关闭回调
}
}
</script>
<template>
<a class="app-column-link" @click="openLinkView">
<slot />
</a>
</template>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册