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

update:更新表格

上级 c8e48f99
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
title: "{{item.caption}}", title: "{{item.caption}}",
columnType: "{{item.columnType}}", columnType: "{{item.columnType}}",
{{#if item.align}} {{#if item.align}}
align: "{{item.align}}", align: "{{lowerCase item.align}}",
{{/if}} {{/if}}
{{#neq lastColumn true}} {{#neq lastColumn true}}
{{#if item.widthUnit 'PX'}} {{#if item.widthUnit 'PX'}}
...@@ -19,7 +19,10 @@ ...@@ -19,7 +19,10 @@
{{/each}} {{/each}}
], ],
{{else}} {{else}}
dataIndex: "{{lowerCase item.codeName}}", {{#eq item.columnType 'UAGRIDCOLUMN'}}
fixed: "right",
{{/eq}}
dataIndex: "{{#if item.dataItemName}}{{lowerCase item.dataItemName}}{{else}}{{lowerCase item.codeName}}{{/if}}",
ellipsis: true, ellipsis: true,
enableSort: {{item.enableSort}}, enableSort: {{item.enableSort}},
{{#if item.aggMode}} {{#if item.aggMode}}
......
{{#neq item.columnType 'GROUPGRIDCOLUMN'}} {{#if (neq item.columnType 'GROUPGRIDCOLUMN')}}
<div v-if="column.dataIndex === '{{item.codeName}}'" class="table-cell"> <div v-if="Object.is(column.dataIndex, '{{item.codeName}}')" class="table-cell">
{{#eq item.columnType 'DEFGRIDCOLUMN'}} {{#if (eq item.columnType 'DEFGRIDCOLUMN')}}
{{#if item.enableRowEdit}} {{#if item.enableRowEdit}}
<div v-if="state.rowEditState" class="editor-cell"> <div v-if="state.rowEditState" class="editor-cell">
{{#each ctrl.psDEGridEditItems as | editColumn | }} {{#each ctrl.psDEGridEditItems as | editColumn | }}
{{#eq editColumn.codeName (item.codeName)}} {{#eq editColumn.codeName (item.codeName)}}
...@@ -20,13 +20,13 @@ ...@@ -20,13 +20,13 @@
<span class="text">\{{text}}</span> <span class="text">\{{text}}</span>
</div> </div>
{{/if}} {{/if}}
{{/eq}} {{/if}}
{{#eq item.columnType 'UAGRIDCOLUMN'}} {{#if (eq item.columnType 'UAGRIDCOLUMN')}}
{{!-- <ibizToolbar {{!-- <ibizToolbar
:toolbarModel="state.actionModel" :toolbarModel="state.actionModel"
@toolbarEvent="handleToolbarEvent" @toolbarEvent="handleToolbarEvent"
:context="state.context" :context="state.context"
:viewParams="state.viewParams"/> --}} :viewParams="state.viewParams"/> --}}
{{/eq}} {{/if}}
</div> </div>
{{/neq}} {{/if}}
...@@ -46,6 +46,7 @@ export const CtrlConfig = { ...@@ -46,6 +46,7 @@ export const CtrlConfig = {
{{#if ctrl.groupPSAppDEField}} {{#if ctrl.groupPSAppDEField}}
{ {
title: "分组", title: "分组",
align: "center",
columnType: "GROUP", columnType: "GROUP",
width: 100, width: 100,
resizable: true, resizable: true,
......
...@@ -37,18 +37,24 @@ const { state, handleEditorEvent } = new GridControl(CtrlConfig).moduleInstall(p ...@@ -37,18 +37,24 @@ const { state, handleEditorEvent } = new GridControl(CtrlConfig).moduleInstall(p
const gridScrollOption = computed(() => { const gridScrollOption = computed(() => {
return { return {
scrollToFirstRowOnChange: true, scrollToFirstRowOnChange: true,
x: '100%', x: '110%',
y: '690px', y: '690px',
} }
}); });
// 表格行key
const rowKey = (record: IParam) => {
return record.srfkey;
}
// 表格行样式(斑马纹) // 表格行样式(斑马纹)
const rowClassName = (record: IParam, index: number) => { const rowClassName = (record: IParam, index: number) => {
return index % 2 === 1 ? 'table-striped' : null; return index % 2 === 1 ? "table-striped" : null;
} }
// 表格选择功能配置 // 表格选择功能配置
const rowSelectionOption = computed(() => { const rowSelectionOption = computed(() => {
return { return {
fixed: true,
columnWidth: {{#neq ctrl.aggMode 'NONE'}}90{{else}}50{{/neq}}, columnWidth: {{#neq ctrl.aggMode 'NONE'}}90{{else}}50{{/neq}},
checkStrictly: props.multiple ? false : true,
onChange: (selectedRowKeys: string[], selectedRows: IParam[]) => { onChange: (selectedRowKeys: string[], selectedRows: IParam[]) => {
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows); console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
}, },
...@@ -68,7 +74,9 @@ const handleChange = (pagination: IParam, filters: IParam, sorter: IParam, data: ...@@ -68,7 +74,9 @@ const handleChange = (pagination: IParam, filters: IParam, sorter: IParam, data:
<template> <template>
<a-table <a-table
bordered bordered
sticky
class="ibiz-grid" class="ibiz-grid"
:rowKey="rowKey"
:showHeader="{{#if ctrl.hideHeader}}false{{else}}true{{/if}}" :showHeader="{{#if ctrl.hideHeader}}false{{else}}true{{/if}}"
:scroll="gridScrollOption" :scroll="gridScrollOption"
:sortDirections="['ascend', 'descend']" :sortDirections="['ascend', 'descend']"
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册