提交 25fc6088 编写于 作者: sq3536's avatar sq3536

Merge remote-tracking branch 'origin/master'

......@@ -8,6 +8,14 @@
detailStyle: '{{formDetail.detailStyle}}',
resetItemName: '{{formDetail.resetItemName}}',
valueItemName: '{{formDetail.valueItemName}}',
{{#each formDetail.psDEFDGroupLogics as | groupLogic |}}
groupOP: {{groupLogic.groupOP}},
relatedDetailNames: {{groupLogic.relatedDetailNames}},
logicCat: {{groupLogic.logicCat}},
logicType: {{groupLogic.logicType}},
notMode: {{groupLogic.notMode}},
Logics: []
{{/each}}
{{/if}}
},
{{#if formDetail.psDEFormDetails}}
......
......@@ -17,7 +17,7 @@
</IbizFormGroup>
</div>
{{else}}
<a-col :span="24">
{{> @macro/front-end/view/common/layout.hbs item=item}}
<IbizFormGroup name="{{item.codeName}}" title="{{item.caption}}">
{{#eq item.psLayout.layout "FLEX"}}
<div class="app-form-layout-flex" style="{{#if item.psLayout.dir}}flex-direction: {{item.psLayout.dir}};{{/if}}{{#if item.psLayout.align}}justify-content: {{item.psLayout.align}};{{/if}}{{#if item.psLayout.vAlign}}align-items: {{item.psLayout.vAlign}};{{/if}}">
......
......@@ -8,7 +8,7 @@
</IbizFormItem>
</div>
{{else}}
<a-col :span="24">
{{> @macro/front-end/view/common/layout.hbs item=item.psLayoutPos}}
<IbizFormItem name="{{item.codeName}}" label="{{item.caption}}">
{{#if item.psEditor}}
{{>(lookup . 'item.psEditor.editorType') item=item ctrlType="form"}}
......
controlsAction:{
controlsAction:{
{{#page.ctrls as | ctrl |}}
{{#neq controlType "TOOLBAR"}}
{{codeName}}:{
loadAction: '{{ctrl.getPSControlAction.psAppDEMethod.codeName}}',
removeAction: '{{ctrl.removePSControlAction.psAppDEMethod.codeName}}',
updateAction: '{{ctrl.updatePSControlAction.psAppDEMethod.codeName}}',
loadDraftAction: '{{ctrl.getDraftPSControlAction.psAppDEMethod.codeName}}',
createAction: '{{ctrl.getDraftPSControlAction.psAppDEMethod.codeName}}',
}
\ No newline at end of file
},
{{/neq}}
{{/page.ctrls}}
}
\ No newline at end of file
<a-col
:span="{{#if item.colMD}}{{item.colMD}}{{else}}24{{/if}}"
{{!-- :offset="{{#if item.colMD}}{{item.colMD}}{{/if}}"
:lg="{{#if item.colLG}}{{item.colLG}}{{/if}}"
:md="{{#if item.colMD}}{{item.colMD}}{{/if}}"
:sm="{{#if item.colSM}}{{item.colSM}}{{/if}}"
:xs="{{#if item.xs}}{{item.xs}}{{/if}}" --}}
>
viewCodeName: '{{page.codeName}}',
viewName: '{{page.name}}',
viewCaption: '{{page.caption}}',
height: '{{page.height}}',
width: '{{page.width}}',
viewMsgGroup: '{{page.psAppViewMsgGroup}}',
viewUIActions: '{{page.psAppViewUIActions}}',
viewSysCss: '{{page.psSysCss}}',
viewSysImage: '{{page.psSysImage}}',
subCaption: '{{page.subCaption}}',
viewType: '{{page.viewType}}',
viewStyle: '{{page.viewStyle}}',
showCaptionBar: '{{page.viewStyle}}',
viewToolbarModel: [
{{#page.ctrls}}
{{#eq controlType "TOOLBAR"}}
{{#psDEToolbarItems}}
{ name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}' },
{{/psDEToolbarItems}}
{{/eq}}
{{/page.ctrls}}
],
\ No newline at end of file
viewCodeName: '{{page.codeName}}',
viewName: '{{page.name}}',
viewCaption: '{{page.caption}}',
height: '{{page.height}}',
width: '{{page.width}}',
viewMsgGroup: '{{page.psAppViewMsgGroup}}',
viewUIActions: '{{page.psAppViewUIActions}}',
viewSysCss: '{{page.psSysCss}}',
viewSysImage: '{{page.psSysImage}}',
subCaption: '{{page.subCaption}}',
viewType: '{{page.viewType}}',
viewStyle: '{{page.viewStyle}}',
showCaptionBar: '{{page.viewStyle}}',
viewToolbarModel: [
{{#page.ctrls}}
{{#eq controlType "TOOLBAR"}}
{{#psDEToolbarItems}}
{ name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true,{{#if psUIAction.psSysImage}}{{#if psUIAction.psSysImage.imagePath}} imgPath: "{{psUIAction.psSysImage.imagePath}}",{{/if}}{{#if psUIAction.psSysImage.cssClass}} iconClass: "{{psUIAction.psSysImage.cssClass}}",{{/if}}{{/if}} },
{{/psDEToolbarItems}}
{{/eq}}
{{/page.ctrls}}
],
{{> @macro/front-end/view/common/controlAction.hbs}}
\ No newline at end of file
......@@ -15,7 +15,7 @@
{{/if}}
{{#if item.psSysImage}}
{{#if item.psSysImage.cssClass}}
iconCls: "{{item.psSysImage.cssClass}}",
iconClass: "{{item.psSysImage.cssClass}}",
{{/if}}
{{#if item.psSysImage.imagePath}}
imgPath: "{{item.psSysImage.imagePath}}",
......
......@@ -23,6 +23,6 @@
{{/if}}
"viewType": "{{appView.viewType}}",
"fileDir": "@page/{{#if psAppDataEntity}}{{spinalCase psAppDataEntity.codeName}}{{else}}default{{/if}}/{{spinalCase appView.codeName}}"
}{{#unless (and @last ../@last)}},{{/unless}}
}{{#unless @last}},{{/unless}}
{{/each}}
}
......@@ -18,46 +18,50 @@ const showHeader = computed(()=> props.showHeader && (props.viewCaption || slot
<template>
<div class="ibiz-view-layout ibiz-view-layout--default">
<div v-if="showHeader" class="ibiz-view-layout__header">
<div class="ibiz-view-layout__header">
<slot name="header-top" />
<div class="ibiz-view-layout__header-content">
<slot name="header">
<div class="ibiz-view-layout__header-left">
<slot name="header-left"/>
</div>
<div class="ibiz-view-layout__header-right">
<slot name="header-right" />
</div>
</slot>
<slot name="header-left" />
<slot name="header-content" />
<slot name="header-right" />
</div>
<slot name="header-bottom" />
</div>
<div class="ibiz-view-layout__body">
<slot name="body-top" />
<slot />
<slot name="body-bottom" />
</div>
<div class="ibiz-view-footer">
<slot name="footer" />
<slot name="footer-left" />
<slot name="footer-content" />
<slot name="footer-right" />
</div>
</div>
</template>
<style lang="scss">
.ibiz-view-layout {
display: flex;
flex-direction: column;
padding: 0 24px 24px;
.ibiz-view-layout__header {
flex: none;
display: flex;
flex-direction: column;
padding: 16px 0;
.ibiz-view-layout__header-content {
display: flex;
justify-content: space-between;
padding: 16px 0;
}
}
.ibiz-view-layout__body {
flex: auto;
display: flex;
flex-direction: column;
}
.ibiz-view-layout__footer {
.ibiz-view-footer {
flex: none;
display: flex;
justify-content: space-between;
}
}
......
<script setup lang="ts">
interface Props {
viewCaption?: string
showHeader?: boolean
}
const props = withDefaults(defineProps<Props>(), {
// 设定默认值,可选属性可以在这初始化
showHeader: true,
})
</script>
<template>
<IbizDefaultViewLayout>
<template v-slot:header-left>
<slot name="caption" />
</template>
<template v-slot:header-right>
<slot name="toolbar" />
</template>
<template v-slot:header-bottom>
<slot name="topMessage" />
<slot name="searchForm" />
</template>
<template v-slot:body-top>
<slot name="bodyMessage" />
</template>
<slot />
<template v-slot:footer-content>
<slot name="bottomMessage" />
</template>
</IbizDefaultViewLayout>
</template>
<style lang="scss">
</style>
\ No newline at end of file
<script setup lang="ts">
// props声明和默认值处理
interface Props {
text?: string
iconClass?: string,
......@@ -15,7 +13,6 @@ const props = withDefaults(defineProps<Props>(), {
const hasIcon = computed(() => props.iconClass || props.imgPath)
const extraClass = {
"ibiz-icon-text--no-icon": !hasIcon.value,
[`ibiz-icon-text--${props.position}`]: hasIcon.value,
......
<script setup lang="ts">
import { IParam } from "@ibiz-core";
import {
UserOutlined,
} from '@ant-design/icons-vue';
interface Props{
items: IParam[];
items: IParam[],
collapsed: boolean,
}
const props = withDefaults(defineProps<Props>(), {});
const props = withDefaults(defineProps<Props>(), {
collapsed: false,
});
</script>
<template>
<template v-for="item in items" :key="item.name">
<template v-if="!item.items">
<a-menu-item v-if="!item.hidden" :key="item.name">
<a-menu-item v-if="!item.hidden" :key="item.name" class="ibiz-menu-item">
<template #icon>
<div class="menu-icon">
<UserOutlined />
</div>
<IbizIconText :iconClass="item.iconClass" :imgPath="item.imgPath" :text="collapsed && item.caption[0]"/>
</template>
\{{item.caption}}
</a-menu-item>
</template>
<template v-else>
<a-sub-menu v-if="!item.hidden" :key="item.name">
<a-sub-menu v-if="!item.hidden" :key="item.name" class="ibiz-menu-item">
<template #icon>
<div class="menu-icon">
<UserOutlined />
</div>
<IbizIconText :iconClass="item.iconClass" :imgPath="item.imgPath" :text="collapsed && item.caption[0]"/>
</template>
<template #title>\{{item.caption}}</template>
<IbizMenuItem :items="item.items" />
......@@ -36,5 +32,26 @@ const props = withDefaults(defineProps<Props>(), {});
</template>
<style lang="scss">
.ibiz-icon-text {
display: flex !important;
align-items: center;
}
.ant-menu-submenu-popup {
.ibiz-menu-item {
display: flex !important;
}
.ant-menu-submenu-title {
display: flex !important;
width: 100%;
}
}
.ant-menu-inline-collapsed {
.ibiz-menu-item {
position: relative;
.ibiz-icon-text {
position: absolute;
right: calc(50% - 8px);
}
}
}
</style>
\ No newline at end of file
......@@ -25,15 +25,6 @@ const props = withDefaults(defineProps<ToolbarProps>(), {
});
const emit = defineEmits<toolbarEmit>();
const items: Ref<IParam[]> = ref(props.actionModel || []);
console.log(items);
const getItemClass = (item: IParam) => {
return item?.class;
};
const getItemIcon = (item: IParam) => {
if (item.getPSSysImage) {
return item.getPSSysImage.cssClass;
}
};
const itemClick = (item: IParam) => {
emit("toolbarEvent", {
tag: props.name,
......@@ -52,17 +43,19 @@ const itemClick = (item: IParam) => {
>
<!-- todo 无权限显示模式 -->
<a-button
v-show="true"
:class="['toolbar-item', getItemClass(item)]"
v-show="item.visible"
:class="['toolbar-item', item.class]"
:disabled="item.disabled"
type="primary"
@click="itemClick(item)"
>
<!-- <a-icon v-show="item.showIcon" :type="getItemIcon(item)" /> -->
\{{ item.showCaption ? item.caption : "" }}
<IbizIconText
:text="item.showCaption && item.caption"
:iconClass="item.showIcon && item.iconClass"
:imgPath="item.showIcon && item.imgPath"/>
</a-button>
</a-tooltip>
<a-dropdown v-else-if="Object.is(item.itemType, 'items')">
<a-dropdown v-else-if="Object.is(item.itemType, 'ITEMS')">
<a-menu slot="overlay" @click="itemClick">
<a-tooltip
v-for="(childItem, index) in item"
......@@ -71,35 +64,39 @@ const itemClick = (item: IParam) => {
>
<a-menu-item
v-show="childItem.visible"
:class="['toolbar-item', getItemClass(childItem)]"
:class="['toolbar-item', item.class]"
:disabled="childItem.disabled"
type="primary"
@click="itemClick(childItem)"
>
<!-- <a-icon
v-show="childItem.showIcon"
:type="getItemIcon(childItem)"
/> -->
\{{ childItem.showCaption ? childItem.caption : "" }}
<IbizIconText
:text="item.showCaption && item.caption"
:iconClass="item.showIcon && item.iconClass"
:imgPath="item.showIcon && item.imgPath"/>
</a-menu-item>
</a-tooltip>
</a-menu>
</a-dropdown>
<template v-else-if="Object.is(item.itemType, 'SEPERATOR')">
<span class='separator'>|</span>
</template>
</template>
</a-space>
<a-space v-else class="toolbar-link">
<template v-for="(item, index) in items" :key="index">
<div v-if="item.separator" class="separator"></div>
<a-button
v-show="item.visabled"
:class="['toolbar-item', getItemClass(item)]"
v-show="item.visible"
:class="['toolbar-item', item.class]"
:disabled="item.disabled"
type="link"
@click="itemClick(item)"
>
<!-- <a-icon v-show="item.showIcon" :type="getItemIcon(item)" /> -->
\{{ item.showCaption ? item.caption : "" }}
<IbizIconText
:text="item.showCaption && item.caption"
:iconClass="item.showIcon && item.iconClass"
:imgPath="item.showIcon && item.imgPath"/>
</a-button>
<div v-if="item.separator" class="separator"></div>
</template>
</a-space>
</div>
......@@ -113,9 +110,12 @@ const itemClick = (item: IParam) => {
flex-wrap: wrap;
.ant-space-item {
position: relative;
.ant-btn-link {
padding: 4px 10px;
}
.separator {
position: absolute;
right: 0;
left: 0;
top: 15%;
height: 70%;
width: 1px;
......@@ -123,5 +123,10 @@ const itemClick = (item: IParam) => {
}
}
}
.toolbar-item {
.ibiz-icon-text__icon {
vertical-align: unset;
}
}
}
</style>
......@@ -74,6 +74,23 @@ export class ControlVOBase {
}
}
/**
* 克隆方法(创建一个新的ControlVO对象)
* 拥有ControlVO的功能,且与原对象的互不影响。
*
*/
public clone(){
}
/**
* 转换成普通js对象,拷贝所有的数据
*
*/
public toObject(){
return {};
}
/**
* 用后台数据重置数据对象
* @param data 后台数据
......
export class ControlServiceBase {
import { ControlVOBase, EntityService } from "@ibiz-core";
export class ControlServiceBase<T extends ControlVOBase> {
/**
* 构造函数
* @param controlVOType
*/
constructor(private controlVOType: new (data: any)=> T,public entityService: EntityService){}
/**
* 新建部件界面数据对象
* @param $DO 后台数据对象
* @return {*}
*/
public newControlVO($DO: any){
return new this.controlVOType($DO);
}
/**
* 请求前处理函数
*
......
import { ControlServiceBase, hasFunction } from '@ibiz-core';
import { createUUID } from 'qx-util';
import { {{pascalCase ctrl.psAppDataEntity.codeName}}Service } from '@service/entity/{{spinalCase ctrl.psAppDataEntity.codeName}}/{{spinalCase ctrl.psAppDataEntity.codeName}}-service';
import { ControlVO } from './{{spinalCase ctrl.codeName}}-form-config';
export class ControlService extends ControlServiceBase {
/**
* 实体服务对象
*/
public entityService: {{pascalCase ctrl.psAppDataEntity.codeName}}Service = new {{pascalCase ctrl.psAppDataEntity.codeName}}Service();
import { ControlServiceBase, ControlVOBase, hasFunction } from '@ibiz-core';
/**
* 表单部件服务
*
* @export
* @class EditFormService
* @template T 部件数据对象类型
*/
export class EditFormService<T extends ControlVOBase> extends ControlServiceBase<T> {
/**
* 加载草稿数据
*
......@@ -19,14 +17,15 @@ export class ControlService extends ControlServiceBase {
* @return {*}
*/
public async loadDraft(context: any, data: any, opts: { action: string; isLoading?: boolean }): Promise<any> {
const { context: Context, data: Data } = this.handleRequestData(context, data, opts);
// todo主键
const action = hasFunction(this.entityService, opts.action) ? opts.action : 'GetDraft';
const response = await this.entityService[action](Context, Data, opts.isLoading);
// this.setRemoteCopyData(response);
response.data = new ControlVO(response.data);
response.data.srfuf = "0";
return this.handleResponse(response, opts);
let _entityService: any = this.entityService;
const { context: Context, data: Data } = this.handleRequestData(context, data, opts);
// todo主键
const action = hasFunction(_entityService, opts.action) ? opts.action : 'GetDraft';
const response = await _entityService[action](Context, Data, opts.isLoading);
// this.setRemoteCopyData(response);
response.data = this.newControlVO(response.data);
response.data.srfuf = '0';
return this.handleResponse(response, opts);
}
/**
......@@ -38,12 +37,13 @@ export class ControlService extends ControlServiceBase {
* @return {*}
*/
public async get(context: any, data: any, opts: { action: string; isLoading?: boolean }): Promise<any> {
const { context: Context, data: Data } = this.handleRequestData(context, data, opts);
const action = hasFunction(this.entityService, opts.action) ? opts.action : 'GET';
const response = await this.entityService[action](Context, Data, opts.isLoading);
// this.setRemoteCopyData(response);
response.data = new ControlVO(response.data);
return this.handleResponse(response, opts);
let _entityService: any = this.entityService;
const { context: Context, data: Data } = this.handleRequestData(context, data, opts);
const action = hasFunction(_entityService, opts.action) ? opts.action : 'GET';
const response = await _entityService[action](Context, Data, opts.isLoading);
// this.setRemoteCopyData(response);
response.data = this.newControlVO(response.data);
return this.handleResponse(response, opts);
}
/**
......@@ -55,11 +55,12 @@ export class ControlService extends ControlServiceBase {
* @return {*}
*/
public async create(context: any, data: any, opts: { action: string; isLoading?: boolean }): Promise<any> {
const { context: Context, data: Data } = this.handleRequestData(context, data, opts);
const action = hasFunction(this.entityService, opts.action) ? opts.action : 'Create';
const response = await this.entityService[action](Context, Data, opts.isLoading);
response.data = new ControlVO(response.data);
return this.handleResponse(response, opts);
let _entityService: any = this.entityService;
const { context: Context, data: Data } = this.handleRequestData(context, data, opts);
const action = hasFunction(_entityService, opts.action) ? opts.action : 'Create';
const response = await _entityService[action](Context, Data, opts.isLoading);
response.data = this.newControlVO(response.data);
return this.handleResponse(response, opts);
}
/**
......@@ -71,11 +72,12 @@ export class ControlService extends ControlServiceBase {
* @return {*}
*/
public async remove(context: any, data: any, opts: { action: string; isLoading?: boolean }): Promise<any> {
const { context: Context, data: Data } = this.handleRequestData(context, data, opts);
const action = hasFunction(this.entityService, opts.action) ? opts.action : 'Remove';
const response = await this.entityService[action](Context, Data, opts.isLoading);
response.data = new ControlVO(response.data);
return this.handleResponse(response, opts);
let _entityService: any = this.entityService;
const { context: Context, data: Data } = this.handleRequestData(context, data, opts);
const action = hasFunction(_entityService, opts.action) ? opts.action : 'Remove';
const response = await _entityService[action](Context, Data, opts.isLoading);
response.data = this.newControlVO(response.data);
return this.handleResponse(response, opts);
}
/**
......@@ -87,11 +89,11 @@ export class ControlService extends ControlServiceBase {
* @return {*}
*/
public async update(context: any, data: any, opts: { action: string; isLoading?: boolean }): Promise<any> {
const { context: Context, data: Data } = this.handleRequestData(context, data, opts);
const action = hasFunction(this.entityService, opts.action) ? opts.action : 'Update';
const response = await this.entityService[action](Context, Data, opts.isLoading);
response.data = new ControlVO(response.data);
return this.handleResponse(response, opts);
}
let _entityService: any = this.entityService;
const { context: Context, data: Data } = this.handleRequestData(context, data, opts);
const action = hasFunction(_entityService, opts.action) ? opts.action : 'Update';
const response = await _entityService[action](Context, Data, opts.isLoading);
response.data = this.newControlVO(response.data);
return this.handleResponse(response, opts);
}
}
export * from './control-service-base'
\ No newline at end of file
export * from './control-service-base'
export * from './edit-form-service'
\ No newline at end of file
export const ViewConfig = {
viewCodeName: '{{page.codeName}}',
viewName: '{{page.name}}',
viewCaption: '{{page.caption}}',
{{> @macro/front-end/view/common/viewBaseConfig.hbs}}
};
\ No newline at end of file
......@@ -32,6 +32,9 @@ const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const { state } = new IndexView(ViewConfig).moduleInstall(props, emit);
const collapsed: Ref<boolean> = ref(false);
const collapsedChange = () => {
collapsed.value = !collapsed.value;
}
</script>
<template>
......@@ -42,9 +45,9 @@ const collapsed: Ref<boolean> = ref(false);
<MenuUnfoldOutlined
v-if="collapsed"
class="trigger"
@click="() => (collapsed = !collapsed)"
@click="collapsedChange"
/>
<MenuFoldOutlined v-else class="trigger" @click="() => (collapsed = !collapsed)" />
<MenuFoldOutlined v-else class="trigger" @click="collapsedChange" />
</div>
</template>
<template #user>
......
export const ViewConfig = {
{{> @macro/front-end/view/common/viewBaseConfig.hbs}}
{{#each page.ctrls as | ctrl |}}
{{#if (eq ctrl.controlType "FORM")}}
{{> @macro/front-end/view/common/controlAction.hbs ctrl=ctrl}}
{{/if}}
{{/each}}
};
\ No newline at end of file
......@@ -34,8 +34,8 @@ const { state, handleToolbarEvent } = new EditView(ViewConfig).moduleInstall(pro
</script>
<template>
<IbizDefaultViewLayout :class="['ibiz-edit-view', state.viewSysCss]">
<template v-slot:header-left>
<IbizEditViewLayout :class="['ibiz-edit-view', state.viewSysCss]">
<template v-slot:caption>
<IbizIconText
class="ibiz-view__caption"
size="large"
......@@ -46,7 +46,7 @@ const { state, handleToolbarEvent } = new EditView(ViewConfig).moduleInstall(pro
</template>
{{#page.ctrls}}
{{#eq controlType "TOOLBAR"}}
<template v-slot:header-right>
<template v-slot:toolbar>
<IbizToolbar
mode="button"
name="{{lowerCase codeName}}"
......@@ -64,7 +64,7 @@ const { state, handleToolbarEvent } = new EditView(ViewConfig).moduleInstall(pro
></{{codeName}}Form>
{{/eq}}
{{/page.ctrls}}
</IbizDefaultViewLayout>
</IbizEditViewLayout>
</template>
<style lang="scss">
......
......@@ -2,9 +2,4 @@ export const ViewConfig = {
gridRowActiveMode: {{page.gridRowActiveMode}},
rowEditState: {{#if page.enableRowEdit}}{{page.rowEditDefault}}{{else}}false{{/if}},
{{> @macro/front-end/view/common/viewBaseConfig.hbs}}
{{#each page.ctrls as | ctrl |}}
{{#if (eq ctrl.controlType "GRID")}}
{{> @macro/front-end/view/common/controlAction.hbs ctrl=ctrl}}
{{/if}}
{{/each}}
};
\ No newline at end of file
export const ViewConfig = {
viewCodeName: '{{page.codeName}}',
viewName: '{{page.name}}',
viewCaption: '{{page.caption}}',
{{#page.ctrls}}
{{#eq controlType "GRID"}}
{{lowerCase codeName}}:{
name:'{{name}}',
codeName:'{{codeName}}',
action:{
'createAction': 'Create'
}
},
{{/eq}}
{{/page.ctrls}}
{{> @macro/front-end/view/common/viewBaseConfig.hbs}}
};
\ No newline at end of file
export const ViewConfig = {
viewCodeName: '{{page.codeName}}',
viewName: '{{page.name}}',
viewCaption: '{{page.caption}}',
{{#page.ctrls}}
{{#eq controlType "PICKUPVIEWPANEL"}}
{{lowerCase codeName}}:{
name:'{{name}}',
codeName:'{{codeName}}',
action:{
'createAction': 'Create'
}
},
{{/eq}}
{{/page.ctrls}}
{{> @macro/front-end/view/common/viewBaseConfig.hbs}}
};
\ No newline at end of file
......@@ -32,7 +32,7 @@ const routes = [
viewType: "{{appView.viewType}}",
{{#if appView.psSysImage}}
imgPath: "{{appView.psSysImage.imagePath}}",
iconCls: "{{appView.psSysImage.cssClass}}",
iconClass: "{{appView.psSysImage.cssClass}}",
{{/if}}
parameters: [
{ pathName: "apps", parameterName: "app" },
......
......@@ -25,11 +25,12 @@ const { state, menuSelect } = new MenuControl(CtrlConfig).moduleInstall(props, e
<template>
<a-menu
class="ibiz-menu"
v-model:openKeys="state.defaultOpens"
v-model:selectedKeys="state.defaultSelect"
:mode="Object.is('LEFT', state.menuAlign) ? 'inline' : 'horizontal'"
@select="menuSelect">
<IbizMenuItem :items="state.menus" />
<IbizMenuItem :items="state.menus" :collapsed="collapsed"/>
</a-menu>
</template>
......
{{>@macro/form-detail/include-form.hbs}}
import { ControlVOBase, verifyRules } from '@ibiz-core';
import { ControlService } from './{{spinalCase ctrl.codeName}}-form-service';
import { ControlVOBase, verifyRules, EditFormService } from '@ibiz-core';
import { {{pascalCase ctrl.psAppDataEntity.codeName}}Service } from '@service/entity/{{spinalCase ctrl.psAppDataEntity.codeName}}/{{spinalCase ctrl.psAppDataEntity.codeName}}-service';
/**
* 部件展示数据对象
* @export
* @class ControlVO
*/
export class ControlVO extends ControlVOBase {
/**
* 用后台数据对象创建部件数据对象
* @param data 后台数据
*/
constructor(data: any){
super(data);
// 记录没有映射的属性
this.$ownKeys =
{{~#each ctrl.psDEFormItems as | formItem | ~}}
{{#if @first}}[{{/if~}}
'{{lowerCase formItem.id}}'{{#unless @last}},{{/unless}}
{{~#if @last}}];{{/if~}}
{{/each}}
}
// 表单里映射了属性的字段
{{#each ctrl.psDEFormItems as | formItem | }}
{{!-- TODO: 表单formItem的name拿不到 --}}
{{#neq formItem.psAppDEField null }}
get {{lowerCase formItem.id}}() {
return this.$DO.{{lowerCase formItem.psAppDEField.codeName}};
}
set {{lowerCase formItem.id}}(value: any) {
this.$DO.{{lowerCase formItem.psAppDEField.codeName}} = value;
}
{{/neq}}
{{/each}}
// 表单里没有映射实体属性的字段(srfuf除外)
{{#each ctrl.psDEFormItems as | formItem | }}
{{#if (and (eq formItem.psAppDEField null) (neq formItem.id "srfuf" )) }}
{{lowerCase formItem.id}}: any;
{{/if}}
{{/each}}
}
// 部件配置对象
export const CtrlConfig = {
controlCodeName: '{{ctrl.codeName}}',
controlName: '{{ctrl.name}}',
controlService: new ControlService(),
data: {},
controlService: new EditFormService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
data: new ControlVO({}),
itemsModel: [
{{#each ctrl.psDEFormPages as | FormPage | }}
{{>(lookup 'FORMDETAILSMODEL') items=FormPage.psDEFormDetails}}
......@@ -34,32 +79,4 @@ export const CtrlConfig = {
{{/neq}}
{{/each}}
},
};
/**
* 部件展示数据对象
* @export
* @class ControlVO
*/
export class ControlVO extends ControlVOBase {
// 表单里映射了属性的字段
{{#each ctrl.psDEFormItems as | formItem | }}
{{!-- TODO: 表单formItem的name拿不到 --}}
{{#neq formItem.psAppDEField null }}
get {{lowerCase formItem.id}}() {
return this.$DO.{{lowerCase formItem.psAppDEField.codeName}};
}
set {{lowerCase formItem.id}}(value: any) {
this.$DO.{{lowerCase formItem.psAppDEField.codeName}} = value;
}
{{/neq}}
{{/each}}
// 表单里没有映射实体属性的字段(srfuf除外)
{{#each ctrl.psDEFormItems as | formItem | }}
{{#if (and (eq formItem.psAppDEField null) (neq formItem.id "srfuf" )) }}
{{lowerCase formItem.id}}: any;
{{/if}}
{{/each}}
}
\ No newline at end of file
};
\ No newline at end of file
......@@ -48,7 +48,7 @@ export const CtrlConfig = {
{{#if (eq column.columnType 'UAGRIDCOLUMN')}}
{{#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}} },
{ 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, visible: true,{{#if psUIAction.psSysImage}}{{#if psUIAction.psSysImage.imagePath}} imgPath: "{{psUIAction.psSysImage.imagePath}}",{{/if}}{{#if psUIAction.psSysImage.cssClass}} iconClass: "{{psUIAction.psSysImage.cssClass}}",{{/if}}{{/if}} },
{{/action}}
{{/each}}
{{/if}}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册