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

update:更新

上级 6591a538
{ {
title: "{{item.caption}}", title: "{{item.caption}}",
columnType: "{{item.columnType}}",
{{#neq lastColumn true}} {{#neq lastColumn true}}
{{#if item.widthUnit 'PX'}} {{#if item.widthUnit 'PX'}}
width: {{item.width}}, width: {{item.width}},
......
...@@ -13,14 +13,14 @@ export interface GridControlState extends MainControlState { ...@@ -13,14 +13,14 @@ export interface GridControlState extends MainControlState {
* @type {IParam[]} * @type {IParam[]}
* @memberof GridControlState * @memberof GridControlState
*/ */
Items: IParam[]; items: IParam[];
/** /**
* @description 表格列模型 * @description 表格列模型
* @type {IParam} * @type {IParam}
* @memberof GridControlState * @memberof GridControlState
*/ */
columnsModel: IParam; columnsModel: IParam[];
/** /**
* @description 表格界面行为模型 * @description 表格界面行为模型
...@@ -72,11 +72,11 @@ export interface GridControlState extends MainControlState { ...@@ -72,11 +72,11 @@ export interface GridControlState extends MainControlState {
selectFirstDefault: boolean; selectFirstDefault: boolean;
/** /**
* @description 数据总条数 * @description 分页大小
* @type {number} * @type {number}
* @memberof GridControlState * @memberof GridControlState
*/ */
total: number; pageSize: number;
/** /**
* @description 是否启用分页 * @description 是否启用分页
......
import { deepCopy, GridControlProps, GridControlState, IActionParam, MainControl } from '@ibiz-core'; import { calcActionItemAuthState, deepCopy, GridControlProps, GridControlState, IActionParam, IParam, MainControl } from '@ibiz-core';
/** /**
* @description 表格部件 * @description 表格部件
...@@ -40,6 +40,61 @@ export class GridControl extends MainControl { ...@@ -40,6 +40,61 @@ export class GridControl extends MainControl {
this.controlState.items[rowIndex][name] = value; this.controlState.items[rowIndex][name] = value;
} }
/**
* @description 获取界面行为权限状态
* @param {IParam} rowData 行数据
* @return {*}
* @memberof GridControl
*/
public getActionAuthState(rowData: IParam) {
const { UIService, actionModel } = this.controlState;
let tempActionModel: any = deepCopy(actionModel);
calcActionItemAuthState(rowData, tempActionModel, UIService);
return tempActionModel;
}
/**
* @description 获取操作列标识
* @param {IParam} column 表格列集合
* @memberof GridControl
*/
public getUAGridColumn(columns: IParam[]): any {
columns.forEach((column: IParam) => {
if (Object.is(column.columnType, "UAGRIDCOLUMN")) {
return column.dataIndex;
}
if (column.children?.length > 0) {
return this.getUAGridColumn(column.children);
}
})
}
/**
* @description 计算表格行为权限
* @memberof GridControl
*/
public calcGridAuthState() {
const dataRef = toRef(this.controlState, 'items');
const columnsModelRef = toRef(this.controlState, 'columnsModel');
let uaColumnKey = this.getUAGridColumn(columnsModelRef.value);
if (uaColumnKey) {
dataRef.value.forEach((item: IParam) => {
Object.assign(item, {
[uaColumnKey]: this.getActionAuthState(item),
})
})
}
}
/**
* @description 处理表格分组
* @memberof GridControl
*/
public handleGridGroup() {
const { groupMode, groupField, groupCodeList } = this.controlState;
}
/** /**
* @description 使用加载功能模块 * @description 使用加载功能模块
* @param {GridControlProps} props 传入的props * @param {GridControlProps} props 传入的props
...@@ -51,24 +106,40 @@ export class GridControl extends MainControl { ...@@ -51,24 +106,40 @@ export class GridControl extends MainControl {
const load = async (opt: any = {})=>{ const load = async (opt: any = {})=>{
try { try {
const loadAction = this.controlState.controlAction.loadAction; const loadAction = this.controlState.controlAction.loadAction;
const { controlService, context, viewParams, showBusyIndicator } = this.controlState; const {
controlService, context, viewParams, showBusyIndicator, noSort, minorSortDir, minorSortPSDEF,
enablePagingBar, pageSize
} = this.controlState;
const dataRef = toRef(this.controlState, 'items'); const dataRef = toRef(this.controlState, 'items');
const paginationRef = toRef(this.controlState, 'pagination');
if(!loadAction){ if(!loadAction){
return; return;
} }
let _context = deepCopy(context); let _context = deepCopy(context);
let _viewParams = deepCopy(viewParams); let _viewParams = deepCopy(viewParams);
if (noSort && minorSortDir && minorSortPSDEF) {
Object.assign(_viewParams, { sort: `${minorSortPSDEF},${minorSortDir}`});
}
if (enablePagingBar) {
if (opt.current && opt.pageSize) {
Object.assign(_viewParams, { page: opt.current - 1, size: opt.pageSize});
} else {
Object.assign(_viewParams, { page: 0, size: pageSize});
}
}
const response = await controlService.get(loadAction, _context, {viewParams: _viewParams}, showBusyIndicator ); const response = await controlService.get(loadAction, _context, {viewParams: _viewParams}, showBusyIndicator );
if (!response.status || response.status !== 200) { if (!response.status || response.status !== 200) {
return return
} }
dataRef.value = response.data; dataRef.value = response.data;
if (enablePagingBar) {
paginationRef.value['total'] = response.total;
}
this.calcGridAuthState();
this.handleGridGroup();
} catch (error) { } catch (error) {
// todo 错误异常处理 // todo 错误异常处理
} }
} }
// 订阅viewSubject,监听load行为 // 订阅viewSubject,监听load行为
...@@ -114,7 +185,7 @@ export class GridControl extends MainControl { ...@@ -114,7 +185,7 @@ export class GridControl extends MainControl {
*/ */
public moduleInstall(props: GridControlProps, emit?: Function) { public moduleInstall(props: GridControlProps, emit?: Function) {
const superParams = super.moduleInstall(props, emit); const superParams = super.moduleInstall(props, emit);
const { load } = this.useLoad(props) const { load } = this.useLoad(props);
const handleEditorEvent = this.handleEditorEvent.bind(this); const handleEditorEvent = this.handleEditorEvent.bind(this);
this.handleEditorEvent = (rowIndex: number,actionParam: IActionParam) => { this.handleEditorEvent = (rowIndex: number,actionParam: IActionParam) => {
......
...@@ -7,9 +7,9 @@ export const ViewConfig = { ...@@ -7,9 +7,9 @@ export const ViewConfig = {
{{lowerCase codeName}}:{ {{lowerCase codeName}}:{
name:'{{name}}', name:'{{name}}',
items:[ items:[
{{#pSDEToolbarItems}} {{#psDEToolbarItems}}
{ name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}' }, { name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}' },
{{/pSDEToolbarItems}} {{/psDEToolbarItems}}
] ]
}, },
{{/eq}} {{/eq}}
......
...@@ -11,67 +11,67 @@ const routes = [ ...@@ -11,67 +11,67 @@ const routes = [
caption: "{{app.defaultPSAppIndexView.caption}}", caption: "{{app.defaultPSAppIndexView.caption}}",
viewType: "{{app.defaultPSAppIndexView.viewType}}", viewType: "{{app.defaultPSAppIndexView.viewType}}",
dynaModelFilePath: "{{app.defaultPSAppIndexView.dynaModelFilePath}}", dynaModelFilePath: "{{app.defaultPSAppIndexView.dynaModelFilePath}}",
{{#if app.defaultPSAppIndexView.pSSysImage}} {{#if app.defaultPSAppIndexView.psSysImage}}
imgPath: "{{app.defaultPSAppIndexView.pSSysImage.ImagePath}}", imgPath: "{{app.defaultPSAppIndexView.psSysImage.imagePath}}",
iconCls: "{{app.defaultPSAppIndexView.pSSysImage.cssClass}}", iconCls: "{{app.defaultPSAppIndexView.psSysImage.cssClass}}",
{{/if}} {{/if}}
parameters: [ parameters: [
{ pathName: "views", parameterName: "{{lowerCase app.defaultPSAppIndexView.codeName}}" }, { pathName: "views", parameterName: "{{lowerCase app.defaultPSAppIndexView.codeName}}" },
], ],
requireAuth: {{#eq app.defaultPSAppIndexView.accUserMode 0}}false{{else}}{{#eq app.defaultPSAppIndexView.accUserMode 3}}false{{else}}true{{/eq}}{{/eq}}, requireAuth: {{#eq app.defaultPSAppIndexView.accUserMode 0}}false{{else}}{{#eq app.defaultPSAppIndexView.accUserMode 3}}false{{else}}true{{/eq}}{{/eq}},
}, },
component: () => import("@page/{{#if app.defaultPSAppIndexView.pSAppDataEntity}}{{spinalCase app.defaultPSAppIndexView.pSAppDataEntity.codeName}}{{else}}default{{/if}}/{{spinalCase app.defaultPSAppIndexView.codeName}}/{{spinalCase app.defaultPSAppIndexView.codeName}}.vue"), component: () => import("@page/{{#if app.defaultPSAppIndexView.psAppDataEntity}}{{spinalCase app.defaultPSAppIndexView.psAppDataEntity.codeName}}{{else}}default{{/if}}/{{spinalCase app.defaultPSAppIndexView.codeName}}/{{spinalCase app.defaultPSAppIndexView.codeName}}.vue"),
children: [ children: [
{{#each app.allPSAppViews as | appView |}} {{#each app.allPSAppViews as | appView |}}
{{!-- 实体视图 --}} {{!-- 实体视图 --}}
{{#if appView.pSAppDataEntity}} {{#if appView.psAppDataEntity}}
{{!-- 多重路径 --}} {{!-- 多重路径 --}}
{{#if appView.pSAppDataEntity.pSAppDERSPathCount}} {{#if appView.psAppDataEntity.psAppDERSPathCount}}
{{#if (or (eq appView.viewType 'DEEDITVIEW') (eq appView.viewType 'DEGRIDVIEW'))}} {{#if (or (eq appView.viewType 'DEEDITVIEW') (eq appView.viewType 'DEGRIDVIEW'))}}
{ {
path: "{{lowerCase (pluralize appView.pSAppDataEntity.codeName)}}/:{{lowerCase codeName}}?/views/:view?", path: "{{lowerCase (pluralize appView.psAppDataEntity.codeName)}}/:{{lowerCase codeName}}?/views/:view?",
meta: { meta: {
captionTag: "{{#if appView.capPSLanguageRes}}{{appView.capPSLanguageRes.lanResTag}}{{/if}}", captionTag: "{{#if appView.capPSLanguageRes}}{{appView.capPSLanguageRes.lanResTag}}{{/if}}",
caption: "{{appView.caption}}", caption: "{{appView.caption}}",
viewType: "{{appView.viewType}}", viewType: "{{appView.viewType}}",
info:'', info:'',
{{#if appView.pSSysImage}} {{#if appView.psSysImage}}
imgPath: "{{appView.pSSysImage.ImagePath}}", imgPath: "{{appView.psSysImage.imagePath}}",
iconCls: "{{appView.pSSysImage.cssClass}}", iconCls: "{{appView.psSysImage.cssClass}}",
{{/if}} {{/if}}
parameters: [ parameters: [
{ pathName: "{{lowerCase app.defaultPSAppIndexView.codeName}}", parameterName: "{{lowerCase app.defaultPSAppIndexView.codeName}}" }, { pathName: "{{lowerCase app.defaultPSAppIndexView.codeName}}", parameterName: "{{lowerCase app.defaultPSAppIndexView.codeName}}" },
{ pathName: "{{lowerCase (pluralize appView.pSAppDataEntity.codeName)}}", parameterName: "{{lowerCase codeName}}" }, { pathName: "{{lowerCase (pluralize appView.psAppDataEntity.codeName)}}", parameterName: "{{lowerCase codeName}}" },
{ pathName: 'views', parameterName: 'view' }, { pathName: 'views', parameterName: 'view' },
], ],
resource: "{{entity.codeName.lowerCase}}", resource: "{{entity.codeName.lowerCase}}",
requireAuth: false, requireAuth: false,
}, },
component: () => import("@page/{{#if appView.pSAppDataEntity}}{{spinalCase appView.pSAppDataEntity.codeName}}{{else}}default{{/if}}/{{spinalCase appView.codeName}}/{{spinalCase appView.codeName}}.vue"), component: () => import("@page/{{#if appView.psAppDataEntity}}{{spinalCase appView.psAppDataEntity.codeName}}{{else}}default{{/if}}/{{spinalCase appView.codeName}}/{{spinalCase appView.codeName}}.vue"),
}, },
{{/if}} {{/if}}
{{else}} {{else}}
{{#if (or (eq appView.viewType 'DEEDITVIEW') (eq appView.viewType 'DEGRIDVIEW'))}} {{#if (or (eq appView.viewType 'DEEDITVIEW') (eq appView.viewType 'DEGRIDVIEW'))}}
{ {
path: "{{lowerCase (pluralize appView.pSAppDataEntity.codeName)}}/:{{lowerCase codeName}}?/views/:view?", path: "{{lowerCase (pluralize appView.psAppDataEntity.codeName)}}/:{{lowerCase codeName}}?/views/:view?",
meta: { meta: {
captionTag: "{{#if appView.capPSLanguageRes}}{{appView.capPSLanguageRes.lanResTag}}{{/if}}", captionTag: "{{#if appView.capPSLanguageRes}}{{appView.capPSLanguageRes.lanResTag}}{{/if}}",
caption: "{{appView.caption}}", caption: "{{appView.caption}}",
viewType: "{{appView.viewType}}", viewType: "{{appView.viewType}}",
info:'', info:'',
{{#if appView.pSSysImage}} {{#if appView.psSysImage}}
imgPath: "{{appView.pSSysImage.ImagePath}}", imgPath: "{{appView.psSysImage.imagePath}}",
iconCls: "{{appView.pSSysImage.cssClass}}", iconCls: "{{appView.psSysImage.cssClass}}",
{{/if}} {{/if}}
parameters: [ parameters: [
{ pathName: "{{lowerCase app.defaultPSAppIndexView.codeName}}", parameterName: "{{lowerCase app.defaultPSAppIndexView.codeName}}" }, { pathName: "{{lowerCase app.defaultPSAppIndexView.codeName}}", parameterName: "{{lowerCase app.defaultPSAppIndexView.codeName}}" },
{ pathName: "{{lowerCase (pluralize appView.pSAppDataEntity.codeName)}}", parameterName: "{{lowerCase appView.pSAppDataEntity.codeName}}" }, { pathName: "{{lowerCase (pluralize appView.psAppDataEntity.codeName)}}", parameterName: "{{lowerCase appView.psAppDataEntity.codeName}}" },
{ pathName: 'views', parameterName: 'view' }, { pathName: 'views', parameterName: 'view' },
], ],
resource: "{{entity.codeName.lowerCase}}", resource: "{{entity.codeName.lowerCase}}",
requireAuth: false, requireAuth: false,
}, },
component: () => import("@page/{{#if appView.pSAppDataEntity}}{{spinalCase appView.pSAppDataEntity.codeName}}{{else}}default{{/if}}/{{spinalCase appView.codeName}}/{{spinalCase appView.codeName}}.vue"), component: () => import("@page/{{#if appView.psAppDataEntity}}{{spinalCase appView.psAppDataEntity.codeName}}{{else}}default{{/if}}/{{spinalCase appView.codeName}}/{{spinalCase appView.codeName}}.vue"),
}, },
{{/if}} {{/if}}
{{/if}} {{/if}}
...@@ -84,9 +84,9 @@ const routes = [ ...@@ -84,9 +84,9 @@ const routes = [
caption: "{{appView.caption}}", caption: "{{appView.caption}}",
viewType: "{{appView.viewType}}", viewType: "{{appView.viewType}}",
info:'', info:'',
{{#if appView.pSSysImage}} {{#if appView.psSysImage}}
imgPath: "{{appView.pSSysImage.ImagePath}}", imgPath: "{{appView.psSysImage.imagePath}}",
iconCls: "{{appView.pSSysImage.cssClass}}", iconCls: "{{appView.psSysImage.cssClass}}",
{{/if}} {{/if}}
parameters: [ parameters: [
{ pathName: "{{lowerCase app.defaultPSAppIndexView.codeName}}", parameterName: "{{lowerCase app.defaultPSAppIndexView.codeName}}" }, { pathName: "{{lowerCase app.defaultPSAppIndexView.codeName}}", parameterName: "{{lowerCase app.defaultPSAppIndexView.codeName}}" },
...@@ -94,7 +94,7 @@ const routes = [ ...@@ -94,7 +94,7 @@ const routes = [
], ],
requireAuth: false, requireAuth: false,
}, },
component: () => import("@page/{{#if appView.pSAppDataEntity}}{{spinalCase appView.pSAppDataEntity.codeName}}{{else}}default{{/if}}/{{spinalCase appView.codeName}}/{{spinalCase appView.codeName}}.vue"), component: () => import("@page/{{#if appView.psAppDataEntity}}{{spinalCase appView.psAppDataEntity.codeName}}{{else}}default{{/if}}/{{spinalCase appView.codeName}}/{{spinalCase appView.codeName}}.vue"),
}, },
{{/neq}} {{/neq}}
{{/if}} {{/if}}
......
...@@ -31,8 +31,8 @@ export class {{appEntity.codeName.pascalCase}}ServiceBase extends EntityService ...@@ -31,8 +31,8 @@ export class {{appEntity.codeName.pascalCase}}ServiceBase extends EntityService
*/ */
async {{singleAppMethod.codeName}}(_context: any = {}, _data: any = {}): Promise<any> { async {{singleAppMethod.codeName}}(_context: any = {}, _data: any = {}): Promise<any> {
//{{singleAppMethod}} //{{singleAppMethod}}
//{{singleAppMethod.pSDEServiceAPIMethod}} //{{singleAppMethod.psDEServiceAPIMethod}}
//{{singleAppMethod.pSDEServiceAPIMethod.requestMethod}} //{{singleAppMethod.psDEServiceAPIMethod.requestMethod}}
{{#eq singleAppMethod.methodType "SELECT" }} {{#eq singleAppMethod.methodType "SELECT" }}
const res = await this.http.post(`/{{appEntity.codeName.pluralize}}/${encodeURIComponent(_context.{{appEntity.codeName.lowerCase}})}{{singleAppMethod.requestPath}}`, _data); const res = await this.http.post(`/{{appEntity.codeName.pluralize}}/${encodeURIComponent(_context.{{appEntity.codeName.lowerCase}})}{{singleAppMethod.requestPath}}`, _data);
return res; return res;
......
...@@ -5,7 +5,7 @@ export const CtrlConfig = { ...@@ -5,7 +5,7 @@ export const CtrlConfig = {
defaultOpens: [], defaultOpens: [],
defaultSelect: [], defaultSelect: [],
menus: [ menus: [
{{#each ctrl.pSAppMenuItems as | item |}} {{#each ctrl.psAppMenuItems as | item |}}
{{>(lookup 'MENUITEM') item=item}} {{>(lookup 'MENUITEM') item=item}}
{{/each}} {{/each}}
], ],
......
...@@ -15,24 +15,24 @@ export const CtrlConfig = { ...@@ -15,24 +15,24 @@ export const CtrlConfig = {
*/ */
export class ControlVO extends ControlVOBase { export class ControlVO extends ControlVOBase {
// 表单里映射了属性的字段 // 表单里映射了属性的字段
{{#each ctrl.pSDEFormItems as | formItem | }} {{#each ctrl.psDEFormItems as | formItem | }}
{{!-- // 表单formItem {{!-- // 表单formItem
{{formItem.name}} {{formItem.name}}
{{formItem.id}} --}} {{formItem.id}} --}}
{{#neq formItem.pSAppDEField null }} {{#neq formItem.psAppDEField null }}
get {{lowerCase formItem.id}}() { get {{lowerCase formItem.id}}() {
return this.$DO.{{lowerCase formItem.pSAppDEField.codeName}}; return this.$DO.{{lowerCase formItem.psAppDEField.codeName}};
} }
set {{lowerCase formItem.id}}(value: any) { set {{lowerCase formItem.id}}(value: any) {
this.$DO.{{lowerCase formItem.pSAppDEField.codeName}} = value; this.$DO.{{lowerCase formItem.psAppDEField.codeName}} = value;
} }
{{/neq}} {{/neq}}
{{/each}} {{/each}}
// 表单里没有映射实体属性的字段 // 表单里没有映射实体属性的字段
{{#each ctrl.pSDEFormItems as | formItem | }} {{#each ctrl.psDEFormItems as | formItem | }}
{{#eq formItem.pSAppDEField null }} {{#eq formItem.psAppDEField null }}
{{lowerCase formItem.id}}: any; {{lowerCase formItem.id}}: any;
{{/eq}} {{/eq}}
{{/each}} {{/each}}
......
import { ControlServiceBase } from '@ibiz-core'; import { ControlServiceBase } from '@ibiz-core';
import { {{pascalCase ctrl.pSAppDataEntity.codeName}}Service } from '@service/{{spinalCase ctrl.pSAppDataEntity.codeName}}/{{spinalCase ctrl.pSAppDataEntity.codeName}}-service'; import { {{pascalCase ctrl.psAppDataEntity.codeName}}Service } from '@service/{{spinalCase ctrl.psAppDataEntity.codeName}}/{{spinalCase ctrl.psAppDataEntity.codeName}}-service';
import { ControlVO } from './{{ctrl.codeName.lowerCase}}-form-config'; import { ControlVO } from './{{ctrl.codeName.lowerCase}}-form-config';
export class ControlService extends ControlServiceBase { export class ControlService extends ControlServiceBase {
...@@ -7,7 +7,7 @@ export class ControlService extends ControlServiceBase { ...@@ -7,7 +7,7 @@ export class ControlService extends ControlServiceBase {
/** /**
* 实体服务对象 * 实体服务对象
*/ */
public entityService: {{pascalCase ctrl.pSAppDataEntity.codeName}}Service = new {{pascalCase ctrl.pSAppDataEntity.codeName}}Service(); public entityService: {{pascalCase ctrl.psAppDataEntity.codeName}}Service = new {{pascalCase ctrl.psAppDataEntity.codeName}}Service();
/** /**
* 加载数据 * 加载数据
......
...@@ -31,13 +31,13 @@ const { state, handleEditorEvent } = new FormControl(CtrlConfig).moduleInstall(p ...@@ -31,13 +31,13 @@ const { state, handleEditorEvent } = new FormControl(CtrlConfig).moduleInstall(p
<template> <template>
<a-form <a-form
name="{{ctrl.codeName}}" name="{{ctrl.codeName}}"
class="ibiz-form{{#if ctrl.pSSysCss}} {{ctrl.pSSysCss.cssName}}{{/if}}{{#if ctrl.infoFormMode}} ibiz-info-form{{/if}}" class="ibiz-form{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}{{#if ctrl.infoFormMode}} ibiz-info-form{{/if}}"
style="{{#if ctrl.formWidth}}width: {{ctrl.formWidth}}px;{{/if}}" style="{{#if ctrl.formWidth}}width: {{ctrl.formWidth}}px;{{/if}}"
:model="state.data" :model="state.data"
:rules="state.rules"> :rules="state.rules">
{{#if ctrl.noTabHeader}} {{#if ctrl.noTabHeader}}
{{#each ctrl.psDEFormPages as | ctrlPage | }} {{#each ctrl.psDEFormPages as | ctrlPage | }}
{{#each ctrlPage.pSDEFormDetails as | formDetail | }} {{#each ctrlPage.psDEFormDetails as | formDetail | }}
{{>(lookup . 'formDetail.detailType') item=formDetail}} {{>(lookup . 'formDetail.detailType') item=formDetail}}
{{/each }} {{/each }}
{{/each}} {{/each}}
......
...@@ -4,8 +4,8 @@ export const CtrlConfig = { ...@@ -4,8 +4,8 @@ export const CtrlConfig = {
controlCodeName: "{{ctrl.codeName}}", controlCodeName: "{{ctrl.codeName}}",
controlName: "{{ctrl.name}}", controlName: "{{ctrl.name}}",
items: [], items: [],
total: 0,
aggMode: "{{ctrl.aggMode}}", aggMode: "{{ctrl.aggMode}}",
{{#if ctrl.enableGroup}}
groupMode: "{{ctrl.groupMode}}", groupMode: "{{ctrl.groupMode}}",
groupField: "{{ctrl.groupPSAppDEField.codeName}}", groupField: "{{ctrl.groupPSAppDEField.codeName}}",
{{#if ctrl.groupPSCodeList}} {{#if ctrl.groupPSCodeList}}
...@@ -14,18 +14,20 @@ export const CtrlConfig = { ...@@ -14,18 +14,20 @@ export const CtrlConfig = {
codeListType: "{{ctrl.groupPSCodeList.codeListType}}", codeListType: "{{ctrl.groupPSCodeList.codeListType}}",
}, },
{{/if}} {{/if}}
{{/if}}
{{#if ctrl.noSort}} {{#if ctrl.noSort}}
noSort: true, noSort: true,
{{else}} {{else}}
noSort: false, noSort: false,
minorSortDir: "{{#if ctrl.minorSortDir}}{{ctrl.minorSortDir}}{{else}}ASC{{/if}}", minorSortDir: "{{#if ctrl.minorSortDir}}{{ctrl.minorSortDir}}{{/if}}",
minorSortPSDEF: "{{ctrl.minorSortPSAppDEField.codeName}}", minorSortPSDEF: "{{ctrl.minorSortPSAppDEField.codeName}}",
{{/if}} {{/if}}
{{#if ctrl.enablePagingBar}} {{#if ctrl.enablePagingBar}}
enablePagingBar: true, enablePagingBar: true,
pageSize: {{#if ctrl.pagingSize}}{{ctrl.pagingSize}}{{else}}20{{/if}},
pagination: { pagination: {
position: ['bottomRight'], position: ['bottomRight'],
defaultPageSize: {{ctrl.pagingSize}}, defaultPageSize: {{#if ctrl.pagingSize}}{{ctrl.pagingSize}}{{else}}20{{/if}},
showQuickJumper: true, showQuickJumper: true,
showTotal: (total: number, range: IParam[]) => `${range[0]}-${range[1]} of ${total} items`, showTotal: (total: number, range: IParam[]) => `${range[0]}-${range[1]} of ${total} items`,
pageSizeOptions: ['10','20','50','100'], pageSizeOptions: ['10','20','50','100'],
...@@ -35,7 +37,7 @@ export const CtrlConfig = { ...@@ -35,7 +37,7 @@ export const CtrlConfig = {
pagination: false, pagination: false,
{{/if}} {{/if}}
columnsModel: [ columnsModel: [
{{#each ctrl.pSDEGridColumns as | column |}} {{#each ctrl.psDEGridColumns as | column |}}
{{#if @last}} {{#if @last}}
{{>(lookup 'COLUMNMODEL') item=column lastColumn=true}} {{>(lookup 'COLUMNMODEL') item=column lastColumn=true}}
{{else}} {{else}}
......
...@@ -30,12 +30,9 @@ const props = withDefaults(defineProps<Props>(), { ...@@ -30,12 +30,9 @@ const props = withDefaults(defineProps<Props>(), {
interface CtrlEmit { interface CtrlEmit {
(name: "ctrlEvent", value: IActionParam): void; (name: "ctrlEvent", value: IActionParam): void;
} }
const emit = defineEmits<CtrlEmit>(); const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力方法 // 安装功能模块,提供状态和能力方法
const { state, handleEditorEvent } = new GridControl(CtrlConfig).moduleInstall(props); const { state, handleEditorEvent } = new GridControl(CtrlConfig).moduleInstall(props);
// 表格滚动条配置 // 表格滚动条配置
const gridScrollOption = computed(() => { const gridScrollOption = computed(() => {
return { return {
...@@ -57,12 +54,10 @@ const rowSelectionOption = computed(() => { ...@@ -57,12 +54,10 @@ const rowSelectionOption = computed(() => {
}, },
}; };
}); });
// 处理拖动列 // 处理拖动列
const handleResizeColumn = (width: number, column: IParam) => { const handleResizeColumn = (width: number, column: IParam) => {
column.width = width; column.width = width;
} }
// 处理表格变化(分页,过滤,排序) // 处理表格变化(分页,过滤,排序)
const handleChange = (pagination: IParam, filters: IParam, sorter: IParam, data: IParam) => { const handleChange = (pagination: IParam, filters: IParam, sorter: IParam, data: IParam) => {
const { current, pageSize } = pagination; const { current, pageSize } = pagination;
...@@ -106,7 +101,7 @@ for (let i = 0; i < 100; i++) { ...@@ -106,7 +101,7 @@ for (let i = 0; i < 100; i++) {
</div> </div>
</template> </template>
<template #bodyCell="{ column, text, record }"> <template #bodyCell="{ column, text, record }">
{{#each ctrl.pSDEGridColumns as | column |}} {{#each ctrl.psDEGridColumns as | column |}}
{{>(lookup 'COLUMN') item=column ctrl=ctrl}} {{>(lookup 'COLUMN') item=column ctrl=ctrl}}
{{/each}} {{/each}}
</template> </template>
...@@ -114,7 +109,7 @@ for (let i = 0; i < 100; i++) { ...@@ -114,7 +109,7 @@ for (let i = 0; i < 100; i++) {
<template #summary> <template #summary>
<a-table-summary-row> <a-table-summary-row>
<a-table-summary-cell>数据聚合</a-table-summary-cell> <a-table-summary-cell>数据聚合</a-table-summary-cell>
{{#each ctrl.pSDEGridColumns as | column |}} {{#each ctrl.psDEGridColumns as | column |}}
{{>(lookup 'SUMMARYCOLUMN') item=column ctrl=ctrl}} {{>(lookup 'SUMMARYCOLUMN') item=column ctrl=ctrl}}
{{/each}} {{/each}}
</a-table-summary-row> </a-table-summary-row>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册