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

update:更新

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