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

update:更新表格

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