提交 38864e07 编写于 作者: jlj05024111@163.com's avatar jlj05024111@163.com

feat: 表格更新支持通过控件参数决定表格是否允许换行

上级 c684e46b
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable no-param-reassign */
import { GridController } from '@ibiz-template/controller';
import {
......@@ -127,9 +128,15 @@ export function useITableColumns(c: GridController) {
} else if (frozenLastColumn && index >= allNum - frozenLastColumn) {
column.fixed = 'right';
}
if (ibiz.env.enableGridRowBreak) {
if (
(ibiz.env.enableGridRowBreak as any) === 'TRUE' ||
ibiz.env.enableGridRowBreak === true
) {
column.ellipsis = false;
}
if (c.controlParams.ENABLEGRIDROWBREAK) {
column.ellipsis = c.controlParams.ENABLEGRIDROWBREAK !== 'TRUE';
}
});
return copy;
});
......
/* eslint-disable @typescript-eslint/no-explicit-any */
import {
GridFieldColumnController,
GridRowController,
......@@ -21,6 +22,8 @@ export const GridFieldColumn = defineComponent({
setup(props) {
const ns = useNamespace('grid-field-column');
const c = props.controller;
const codeList = props.controller.model.source.getPSAppCodeList();
/**
......@@ -41,6 +44,15 @@ export const GridFieldColumn = defineComponent({
props.controller.triggerAction(props.row, event);
}
};
const enableGridRowBreak = computed(() => {
if (c?.grid?.controlParams?.ENABLEGRIDROWBREAK) {
return c.grid.controlParams.ENABLEGRIDROWBREAK === 'TRUE';
}
return (
(ibiz.env.enableGridRowBreak as any) === 'TRUE' ||
ibiz.env.enableGridRowBreak === true
);
});
const alignStyle = computed(() => {
let justContent = '';
......@@ -58,7 +70,7 @@ export const GridFieldColumn = defineComponent({
return ns.cssVarBlock({ 'justify-content': justContent });
});
return { ns, alignStyle, codeList, onCellClick };
return { ns, alignStyle, codeList, onCellClick, enableGridRowBreak };
},
render() {
const c = this.controller;
......@@ -73,7 +85,7 @@ export const GridFieldColumn = defineComponent({
<code-list
class={[
this.ns.e('text'),
this.ns.is('enablebreak', ibiz.env.enableGridRowBreak),
this.ns.is('enablebreak', this.enableGridRowBreak),
]}
codeListItems={c.codeListItems}
codeList={this.codeList}
......@@ -84,7 +96,7 @@ export const GridFieldColumn = defineComponent({
<span
class={[
this.ns.e('text'),
this.ns.is('enablebreak', ibiz.env.enableGridRowBreak),
this.ns.is('enablebreak', this.enableGridRowBreak),
]}
>
{fieldValue}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册