提交 7ed48ea7 编写于 作者: Shine-zwj's avatar Shine-zwj

update:更新

上级 cc5faf56
......@@ -98,7 +98,6 @@ export class GridControl extends MainControl {
}
})
gridData.push({
groupRow: true,
srfkey: createUUID(),
[groupColumn.dataIndex]: group,
children: deepCopy(children),
......@@ -130,7 +129,6 @@ export class GridControl extends MainControl {
}
});
gridData.push({
groupRow: true,
srfkey: createUUID(),
[groupColumn.dataIndex]: group.text,
children: deepCopy(children),
......@@ -144,7 +142,6 @@ export class GridControl extends MainControl {
});
if (otherGroup.length > 0) {
gridData.push({
groupRow: true,
srfkey: createUUID(),
[groupColumn.dataIndex]: "其它",
children: deepCopy(otherGroup),
......@@ -176,7 +173,29 @@ export class GridControl extends MainControl {
* @memberof GridControl
*/
public setGridColSpan() {
const columnsModelRef = toRef(this.controlState, "columnsModel");
columnsModelRef.value.forEach((columnModel: IParam) => {
const customRender = ({text, record, index, column}: IParam) => {
const option = {
props: {} as IParam,
};
if (record.children) {
if (Object.is(column.columnType, "GROUP")) {
Object.assign(option.props,{
colSpan: columnsModelRef.value.length,
});
} else {
Object.assign(option.props,{
colSpan: 0
});
}
}
return option;
}
Object.assign(columnModel,{
customRender: customRender,
})
});
}
/**
......@@ -269,7 +288,7 @@ export class GridControl extends MainControl {
aggData = await this.remoteAgg();
}
const start: number = (currentRef.value - 1) * pageSizeRef.value > 0 ? (currentRef.value - 1) * pageSizeRef.value - 1 : 0;
const end: number = currentRef.value * pageSizeRef.value - 1;
const end: number = currentRef.value * pageSizeRef.value;
aggData = aggData.slice(start, end);
const columnsModelRef = toRef(this.controlState, "columnsModel");
const columnsModel: IParam[] = [];
......
......@@ -48,7 +48,7 @@ export const CtrlConfig = {
{{#if ctrl.groupPSAppDEField}}
{
title: "分组",
align: "center",
align: "left",
columnType: "GROUP",
width: 100,
resizable: true,
......
......@@ -54,7 +54,7 @@ const customRow = (record: IParam, index: number) => {
return {
onClick: () => {
state.selectedRowKeys = [record.srfkey];
if (!record.groupRow) {
if (!record.children) {
emit("ctrlEvent",{ tag: state.controlName, action: "selectionChange", data: [deepCopy(record)] })
if (Object.is(props.rowActiveMode, 1)) {
emit("ctrlEvent",{ tag: state.controlName, action: "rowClick", data: [deepCopy(record)] })
......@@ -62,7 +62,7 @@ const customRow = (record: IParam, index: number) => {
}
},
onDblclick: () => {
if (!record.groupRow && Object.is(props.rowActiveMode, 2)) {
if (!record.children && Object.is(props.rowActiveMode, 2)) {
emit("ctrlEvent",{ tag: state.controlName, action: "rowDbClick", data: [deepCopy(record)] })
}
}
......@@ -78,7 +78,7 @@ const rowSelectionOption = computed(() => {
state.selectedRowKeys = selectedRowKeys;
const selection: IParam[] = [];
selectedRows.forEach((select: IParam) => {
if (!select.groupRow) {
if (!select.children) {
selection.push(select);
}
})
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册