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

update:更新

上级 d09c3c44
{{#eq item.psLayoutPos 'FLEX'}}
<div style="flex-grow: {{#if item.psLayoutPos.grow}}{{item.psLayoutPos.grow}}{{else}}0{{/if}};">
<a-button
type="primary"
class="ibiz-form-button{{#if item.psSysCss}}{{item.psSysCss.cssName}}{{/if}}"
style="{{#if item.width}}width: {{item.width}}px;{{/if}}{{#if item.height}}height: {{item.height}}px;{{/if}}">
{{#if item.psSysImage}}
<template #icon>
<IbizIconText {{#if item.psSysImage.cssClass}}:iconClass="{{item.psSysImage.cssClass}}"{{/if}} {{#if item.psSysImage.imagePath}}:imgPath="{{item.psSysImage.imagePath}}"{{/if}}/>
</template>
{{/if}}
{{#if item.showCaption}}
{{item.caption}}
{{/if}}
</a-button>
</div>
{{else}}
<a-col
{{> @macro/front-end/ctrl/common/layoutPos.hbs item=item.psLayoutPos}} >
<a-button
type="primary"
class="ibiz-form-button{{#if item.psSysCss}}{{item.psSysCss.cssName}}{{/if}}"
style="{{#if item.width}}width: {{item.width}}px;{{/if}}{{#if item.height}}height: {{item.height}}px;{{/if}}">
{{#if item.psSysImage}}
<template #icon>
<IbizIconText {{#if item.psSysImage.cssClass}}:iconClass="{{item.psSysImage.cssClass}}"{{/if}} {{#if item.psSysImage.imagePath}}:imgPath="{{item.psSysImage.imagePath}}"{{/if}}/>
</template>
{{/if}}
{{#if item.showCaption}}
{{item.caption}}
{{/if}}
</a-button>
</a-col>
{{/eq}}
\ No newline at end of file
{{#eq item.psLayoutPos 'FLEX'}}
<div style="flex-grow: {{#if item.psLayoutPos.grow}}{{item.psLayoutPos.grow}}{{else}}0{{/if}};">
<a-tabs class="ibiz-form-page">
{{#each item.psDEFormPages as | formPage | }}
{{>(lookup . 'formPage.detailType') item=formPage }}
{{/each}}
</a-tabs>
</div>
{{else}}
<a-col
{{> @macro/front-end/ctrl/common/layoutPos.hbs item=item.psLayoutPos}} >
<a-tabs class="ibiz-form-page">
{{#each item.psDEFormPages as | formPage | }}
{{>(lookup . 'formPage.detailType') item=formPage }}
{{/each}}
</a-tabs>
</a-col>
{{/eq}}
\ No newline at end of file
{{#*inline "FORMPAGE"}}{{>@macro/form-detail/form-page.hbs}}{{/inline}}
{{#*inline "GROUPPANEL"}}{{>@macro/form-detail/form-group.hbs}}{{/inline}}
{{#*inline "FORMITEM"}}{{>@macro/form-detail/form-item.hbs}}{{/inline}}
{{#*inline "TABPANEL"}}{{>@macro/form-detail/form-tabpanel.hbs}}{{/inline}}
{{#*inline "BUTTON"}}{{>@macro/form-detail/form-button.hbs}}{{/inline}}
{{#*inline "FORMDETAILSMODEL"}}{{>@macro/form-detail/form-details-model.hbs}}{{/inline}}
\ No newline at end of file
......@@ -424,7 +424,7 @@ export class GridControl extends MainControl {
for (const item of items) {
const { updateAction, createAction } = controlAction;
const saveAction: any = item.rowDataState == "update" ? updateAction : item.rowDataState == "create" ? createAction : "create";
const saveAction: any = item.rowDataState == "update" ? updateAction : item.rowDataState == "create" ? createAction : "";
const saveFunName = item.rowDataState;
if (!saveAction || !saveFunName) {
return;
......@@ -474,24 +474,47 @@ export class GridControl extends MainControl {
*/
public useRemove(props: GridControlProps) {
const { viewSubject, controlName } = this.controlState;
const remove = async (opt: any = {}) => {
const remove = async (opt: IParam[] = []) => {
try {
const { controlService, context, viewParams, showBusyIndicator, controlAction } = this.controlState;
const { controlService, context, viewParams, showBusyIndicator, controlAction, appDeCodeName } = this.controlState;
if (!controlAction.removeAction) {
return;
}
let _context = deepCopy(context);
let _viewParams = deepCopy(viewParams);
const arg: any = opt[0];
Object.assign(arg, { viewParams: _viewParams });
const response = await controlService.remove(
_context,
arg,
{ action: controlAction.removeAction, isLoading: showBusyIndicator },
);
if (response.status || response.status == 200) {
const dataRef = toRef(this.controlState, "items");
const data: IParam[] = [];
opt.forEach((item: IParam, index: number) => {
if (Object.is(item.srfuf, "0")) {
dataRef.value.some((val: any, num: number) => {
if (JSON.stringify(val) == JSON.stringify(item)) {
dataRef.value.splice(num, 1);
return true;
}
});
} else {
data.push(opt[index]);
}
});
if (data.length > 0) {
const keys: string[] = [];
data.forEach((item: IParam) => {
keys.push(item.srfkey);
});
const _removeAction = keys.length > 1 ? "removeBatch" : controlAction.removeAction;
let _context = deepCopy(context);
Object.assign(_context, {[appDeCodeName]: keys});
let _viewParams = deepCopy(viewParams);
const arg: IParam = {
[appDeCodeName]: keys,
};
Object.assign(arg, { viewParams: _viewParams });
const response = await controlService.remove(
_context,
arg,
{ action: _removeAction, isLoading: showBusyIndicator },
);
if (response.status || response.status == 200) {
}
}
} catch (error) {
// TODO 错误异常处理
......@@ -585,7 +608,7 @@ export class GridControl extends MainControl {
}
/**
* @description 处理工具栏事件
* @description 处理表格操作列事件
* @param {IActionParam} actionParam 行为参数
* @param {IParam} [row] 表格行数据
* @memberof GridControl
......
......@@ -35,4 +35,11 @@ export interface MainControlState extends ControlStateBase {
* @memberof MainControlState
*/
UIService: IParam;
/**
* @description 应用实体codeName
* @type {string}
* @memberof MainControlState
*/
appDeCodeName: string;
}
\ No newline at end of file
......@@ -42,7 +42,7 @@ const { state, handleEditorEvent } = new FormControl(CtrlConfig).moduleInstall(p
{{/each }}
{{/each}}
{{else}}
<a-tabs class="app-form-page">
<a-tabs class="ibiz-form-page">
{{#each ctrl.psDEFormPages as | ctrlPage | }}
{{>(lookup . 'ctrlPage.detailType') item=ctrlPage }}
{{/each}}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册