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

update:更新表格

上级 8d935f84
...@@ -22,11 +22,12 @@ ...@@ -22,11 +22,12 @@
{{/if}} {{/if}}
{{/if}} {{/if}}
{{#if (eq item.columnType 'UAGRIDCOLUMN')}} {{#if (eq item.columnType 'UAGRIDCOLUMN')}}
{{!-- <ibizToolbar <ibizToolbar
mode="uiAction"
:toolbarModel="record.{{lowerCase item.codeName}}" :toolbarModel="record.{{lowerCase item.codeName}}"
:context="state.context" :context="state.context"
:viewParams="state.viewParams" :viewParams="state.viewParams"
@toolbarEvent="($event: ) => handleToolbarEvent()"/> --}} @toolbarEvent="($event) => handleToolbarEvent(record, $event)"/>
{{/if}} {{/if}}
</div> </div>
{{/if}} {{/if}}
...@@ -23,11 +23,11 @@ export interface GridControlState extends MainControlState { ...@@ -23,11 +23,11 @@ export interface GridControlState extends MainControlState {
columnsModel: IParam[]; columnsModel: IParam[];
/** /**
* @description 表格界面行为模型 * @description 表格操作列行为模型
* @type {IParam} * @type {IParam}
* @memberof GridControlState * @memberof GridControlState
*/ */
actionModel: IParam; UAColumnModel: IParam;
/** /**
* @description 值规则 * @description 值规则
......
...@@ -53,10 +53,10 @@ export class GridControl extends MainControl { ...@@ -53,10 +53,10 @@ export class GridControl extends MainControl {
* @memberof GridControl * @memberof GridControl
*/ */
public getActionAuthState(rowData: IParam) { public getActionAuthState(rowData: IParam) {
const { UIService, actionModel } = this.controlState; const { UIService, UAColumnModel } = this.controlState;
let tempActionModel: any = deepCopy(actionModel); let tempUAColumn: any = deepCopy(UAColumnModel);
calcActionItemAuthState(rowData, tempActionModel, UIService); calcActionItemAuthState(rowData, tempUAColumn.items, UIService);
return tempActionModel; return tempUAColumn;
} }
/** /**
...@@ -435,6 +435,17 @@ export class GridControl extends MainControl { ...@@ -435,6 +435,17 @@ export class GridControl extends MainControl {
} }
} }
/**
* @description 处理工具栏事件
* @param {IActionParam} actionParam 行为参数
* @param {IParam} [row] 表格行数据
* @memberof GridControl
*/
public handleToolbarEvent(actionParam: IActionParam, row?: IParam) {
const { tag, action, data } = actionParam;
console.log('触发界面行为', actionParam, row);
}
/** /**
* @description 安装部件所有功能模块的方法 * @description 安装部件所有功能模块的方法
* @param {GridControlProps} props 传入的Props * @param {GridControlProps} props 传入的Props
...@@ -451,6 +462,7 @@ export class GridControl extends MainControl { ...@@ -451,6 +462,7 @@ export class GridControl extends MainControl {
state: this.controlState, state: this.controlState,
load, load,
handleEditorEvent: this.handleEditorEvent.bind(this), handleEditorEvent: this.handleEditorEvent.bind(this),
handleToolbarEvent: this.handleToolbarEvent.bind(this),
}; };
} }
} }
export * from './util'; export * from './util';
export * from './view-util'; export * from './view-util';
export * from './view-tool';
export { Http } from './net/http'; export { Http } from './net/http';
\ No newline at end of file
...@@ -43,6 +43,20 @@ export const CtrlConfig = { ...@@ -43,6 +43,20 @@ export const CtrlConfig = {
enablePagingBar: false, enablePagingBar: false,
pagination: false, pagination: false,
{{/if}} {{/if}}
UAColumnModel:{
{{#each ctrl.psDEGridColumns as | column |}}
{{#if (eq column.columnType 'UAGRIDCOLUMN')}}
name: "{{lowerCase column.codeName}}",
items: [
{{#each column.psDEUIActionGroup.psUIActionGroupDetails as | action |}}
{{#action}}
{ name: "{{name}}", caption: "{{psUIAction.caption}}", showIcon: {{showIcon}}, showCaption: {{showCaption}}, separator: {{addSeparator}}, uIActionTag: "{{psUIAction.uIActionTag}}", noPrivDisplayMode: {{#if psUIAction.noPrivDisplayMode}}{{psUIAction.noPrivDisplayMode}}{{else}}6{{/if}}, disabled: false, visabled: true,{{#if psUIAction.psSysImage}}{{#if psUIAction.psSysImage.imagePath}} imgPath: "{{psUIAction.psSysImage.imagePath}}",{{/if}}{{#if psUIAction.psSysImage.cssClass}} iconCls: "{{psUIAction.psSysImage.cssClass}}",{{/if}}{{/if}} },
{{/action}}
{{/each}}
],
{{/if}}
{{/each}}
},
columnsModel: [ columnsModel: [
{{#if ctrl.enableGroup}} {{#if ctrl.enableGroup}}
{{#if ctrl.groupPSAppDEField}} {{#if ctrl.groupPSAppDEField}}
...@@ -58,11 +72,7 @@ export const CtrlConfig = { ...@@ -58,11 +72,7 @@ export const CtrlConfig = {
{{/if}} {{/if}}
{{/if}} {{/if}}
{{#each ctrl.psDEGridColumns as | column |}} {{#each ctrl.psDEGridColumns as | column |}}
{{#if @last}} {{>(lookup 'COLUMNMODEL') item=column}}
{{>(lookup 'COLUMNMODEL') item=column lastColumn=true}}
{{else}}
{{>(lookup 'COLUMNMODEL') item=column lastColumn=false}}
{{/if}}
{{/each}} {{/each}}
] ],
}; };
\ No newline at end of file
...@@ -32,7 +32,7 @@ interface CtrlEmit { ...@@ -32,7 +32,7 @@ interface CtrlEmit {
} }
const emit = defineEmits<CtrlEmit>(); const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力方法 // 安装功能模块,提供状态和能力方法
const { state, load, handleEditorEvent } = new GridControl(CtrlConfig).moduleInstall(props); const { state, load, handleEditorEvent, handleToolbarEvent } = new GridControl(CtrlConfig).moduleInstall(props);
// 表格滚动条配置 // 表格滚动条配置
const gridScrollOption = computed(() => { const gridScrollOption = computed(() => {
return { return {
...@@ -72,7 +72,7 @@ const customRow = (record: IParam, index: number) => { ...@@ -72,7 +72,7 @@ const customRow = (record: IParam, index: number) => {
} }
// 表格选择功能配置 // 表格选择功能配置
const rowSelectionOption = computed(() => { const rowSelectionOption = computed(() => {
if (props.rowEditState || props.selectFirstDefault) { if (props.selectFirstDefault) {
return false; return false;
} }
return { return {
...@@ -139,12 +139,14 @@ const handleChange = (pagination: IParam, filters: IParam, sorter: IParam, data: ...@@ -139,12 +139,14 @@ const handleChange = (pagination: IParam, filters: IParam, sorter: IParam, data:
</template> </template>
{{#neq ctrl.aggMode 'NONE'}} {{#neq ctrl.aggMode 'NONE'}}
<template #summary> <template #summary>
<a-table-summary-row> <a-table-summary>
<a-table-summary-cell>数据聚合</a-table-summary-cell> <a-table-summary-row>
<a-table-summary-cell v-for="(item, index) in state.dataAgg" :key="index"> <a-table-summary-cell align="center">数据聚合</a-table-summary-cell>
<span>\{{item}}</span> <a-table-summary-cell v-for="(item, index) in state.dataAgg" :key="index">
</a-table-summary-cell> <span>\{{item}}</span>
</a-table-summary-row> </a-table-summary-cell>
</a-table-summary-row>
</a-table-summary>
</template> </template>
{{/neq}} {{/neq}}
</a-table> </a-table>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册