提交 9c2159fb 编写于 作者: tony001's avatar tony001

2020.4.30 模板初始化

上级 7419a602
# General
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
<#assign deuiaction=item.getPSUIAction()>
<#assign icon><#if item.getPSSysImage()??><#assign image = item.getPSSysImage()><#if image.getCssClass()??>, iconcls: '${image.getCssClass()}'</#if><#if image.getImagePath()??>, icon: '${image.getImagePath()}'</#if></#if></#assign>
<#if deuiaction.getUIActionTag() == 'ExportExcel'>
${item.getName()?lower_case}: { name: '${item.getName()?lower_case}', <#if item.isShowCaption()>caption: '${item.caption}',</#if> disabled: false, type: '${item.getItemType()}', visabled: true, dataaccaction: '<#if deuiaction.getDataAccessAction()??>${deuiaction.getDataAccessAction()}</#if>', uiaction: { tag: '${deuiaction.getUIActionTag()}', target: '${deuiaction.getActionTarget()}' }<#if view.hasPSControl("GRID")><#assign gridhandler = view.getPSControl("GRID").getPSAjaxControlHandler()>, MaxRowCount: <#if gridhandler?? && gridhandler.getPSDEDataExport()??>${gridhandler.getPSDEDataExport().getMaxRowCount()?c}<#elseif sys.getDEDataExportMaxRowCount() gt 0>${sys.getDEDataExportMaxRowCount()?c}<#else>10000</#if></#if> },
${item.getName()?lower_case}: { name: '${item.getName()?lower_case}', caption: '${item.caption}','isShowCaption':${item.isShowCaption()?c},'isShowIcon':${item.isShowIcon()?c}, tooltip: '${item.getTooltip()}'${icon}, disabled: false, type: '${item.getItemType()}', visabled: true, dataaccaction: '<#if deuiaction.getDataAccessAction()??>${deuiaction.getDataAccessAction()}</#if>', uiaction: { tag: '${deuiaction.getUIActionTag()}', target: '${deuiaction.getActionTarget()}' }<#if view.hasPSControl("GRID")><#assign gridhandler = view.getPSControl("GRID").getPSAjaxControlHandler()>, MaxRowCount: <#if gridhandler?? && gridhandler.getPSDEDataExport()??>${gridhandler.getPSDEDataExport().getMaxRowCount()?c}<#elseif sys.getDEDataExportMaxRowCount() gt 0>${sys.getDEDataExportMaxRowCount()?c}<#else>10000</#if></#if> },
<#elseif deuiaction.getUIActionTag() == 'ToggleRowEdit'>
${item.getName()?lower_case}: { name: '${item.getName()?lower_case}', <#if item.isShowCaption()>caption: '${item.caption}', </#if>disabled: false, type: '${item.getItemType()}', visabled: true, dataaccaction: '<#if deuiaction.getDataAccessAction()??>${deuiaction.getDataAccessAction()}</#if>', uiaction: { tag: '${deuiaction.getUIActionTag()}', target: '${deuiaction.getActionTarget()}' } },
${item.getName()?lower_case}: { name: '${item.getName()?lower_case}', caption: '${item.caption}','isShowCaption':${item.isShowCaption()?c},'isShowIcon':${item.isShowIcon()?c}, tooltip: '${item.getTooltip()}'${icon}, disabled: false, type: '${item.getItemType()}', visabled: true, dataaccaction: '<#if deuiaction.getDataAccessAction()??>${deuiaction.getDataAccessAction()}</#if>', uiaction: { tag: '${deuiaction.getUIActionTag()}', target: '${deuiaction.getActionTarget()}' } },
<#else>
${item.getName()?lower_case}: { name: '${item.getName()?lower_case}', <#if item.isShowCaption()>caption: '${item.caption}', </#if>disabled: false, type: '${item.getItemType()}', visabled: true, dataaccaction: '<#if deuiaction.getDataAccessAction()??>${deuiaction.getDataAccessAction()}</#if>', uiaction: { tag: '${deuiaction.getUIActionTag()}', target: '${deuiaction.getActionTarget()}' } },
${item.getName()?lower_case}: { name: '${item.getName()?lower_case}', caption: '${item.caption}','isShowCaption':${item.isShowCaption()?c},'isShowIcon':${item.isShowIcon()?c}, tooltip: '${item.getTooltip()}'${icon}, disabled: false, type: '${item.getItemType()}', visabled: true, dataaccaction: '<#if deuiaction.getDataAccessAction()??>${deuiaction.getDataAccessAction()}</#if>', uiaction: { tag: '${deuiaction.getUIActionTag()}', target: '${deuiaction.getActionTarget()}' } },
</#if>
\ No newline at end of file
<#macro badge item>
<#if item.getPSUIAction?? && item.getPSUIAction()?? && item.getPSUIAction().getPSAppCounter?? && item.getPSUIAction().getPSAppCounter()??>
<#assign uiaction = item.getPSUIAction() />
<#assign counter = uiaction.getPSAppCounter() />
<Badge type="primary" :count="${srfclassname('${counter.getCodeName()}')}counterservice.counterData.<#if uiaction.getCounterId()??>${uiaction.getCounterId()}</#if>">
<#nested>
</Badge>
<#else>
<#nested>
</#if>
</#macro>
\ No newline at end of file
<template>
<#if quick_menus??>
${quick_menus}
<#else>
<div class="app-app-menu">
<el-menu
class="app-menu"
:default-openeds="defaultOpeneds"
:mode="mode"
:menu-trigger="trigger"
:collapse="isCollapse"
@select="select"
:default-active="defaultActive">
<template v-for="item0 in menus">
<template v-if="item0.items && Array.isArray(item0.items) && item0.items.length > 0">
<el-submenu v-show="!item0.hidden" :index="item0.name" :popper-class="popperClass" :key="item0.id">
<template slot='title'>
<template v-if="item0.icon && item0.icon != ''">
<img :src="item0.icon" class='app-menu-icon' />
</template>
<template v-else-if="item0.iconcls && item0.iconcls != ''">
<i :class="[item0.iconcls, 'app-menu-icon']"></i>
</template>
<template v-else>
<i class='fa fa-cogs app-menu-icon'></i>
</template>
<span class='text' :title="$t('app.menus.${ctrl.codeName?lower_case}.' + item0.name)">{{$t('app.menus.${ctrl.codeName?lower_case}.' + item0.name)}}</span>
</template>
<template v-for="item1 in item0.items">
<template v-if="item1.items && Array.isArray(item1.items) && item1.items.length > 0">
<el-submenu v-show="!item1.hidden" :index="item1.name" :popper-class="popperClass" :key="item1.id">
<template slot='title'>
<template v-if="item1.icon && item1.icon != ''">
<img :src="item1.icon" class='app-menu-icon' />
</template>
<template v-else-if="item1.iconcls && item1.iconcls != ''">
<i :class="[item1.iconcls, 'app-menu-icon']"></i>
</template>
<span class='text' :title="$t('app.menus.${ctrl.codeName?lower_case}.' + item1.name)">{{$t('app.menus.${ctrl.codeName?lower_case}.' + item1.name)}}</span>
</template>
<template v-for="item2 in item1.items">
<template v-if="item2.type =='MENUITEM'">
<el-menu-item v-show="!item2.hidden" :index="item2.name" :key="item2.id">
<template v-if="item2.icon && item2.icon != ''">
<img :src="item2.icon" class='app-menu-icon' />
</template>
<template v-else-if="item2.iconcls && item2.iconcls != ''">
<i :class="[item2.iconcls, 'app-menu-icon']"></i>
</template>
<template slot="title">
<span class="text" :title="$t('app.menus.${ctrl.codeName?lower_case}.' + item2.name)">{{$t('app.menus.${ctrl.codeName?lower_case}.' + item2.name)}}</span>
<template v-if="counterdata && counterdata[item2.counterid] && counterdata[item2.counterid] > 0">
<span class="pull-right">
<badge :count="counterdata[item2.counterid]" :overflow-count="9999"></badge>
</span>
</template>
</template>
</el-menu-item>
</template>
<template v-if="item2.type =='SEPERATOR'">
<divider :key="item2.id" />
</template>
</template>
</el-submenu>
</template>
<template v-else>
<template v-if="item1.type =='MENUITEM'">
<el-menu-item v-show="!item1.hidden" :index="item1.name" :key="item1.id">
<template v-if="item1.icon && item1.icon != ''">
<img :src="item1.icon" class='app-menu-icon' />
</template>
<template v-else-if="item1.iconcls && item1.iconcls != ''">
<i :class="[item1.iconcls, 'app-menu-icon']"></i>
</template>
<template slot="title">
<span class="text" :title="$t('app.menus.${ctrl.codeName?lower_case}.' + item1.name)">{{$t('app.menus.${ctrl.codeName?lower_case}.' + item1.name)}} </span>
<template v-if="counterdata && counterdata[item1.counterid] && counterdata[item1.counterid] > 0">
<span class="pull-right">
<badge :count="counterdata[item1.counterid]" :overflow-count="9999"></badge>
</span>
</template>
</template>
</el-menu-item>
</template>
<template v-if="item1.type =='SEPERATOR'">
<divider :key="item1.id" />
</template>
</template>
</template>
</el-submenu>
</template>
<template v-else>
<template v-if="item0.type =='MENUITEM'">
<el-menu-item v-show="!item0.hidden" :index="item0.name" :key="item0.id">
<template v-if="item0.icon && item0.icon != ''">
<img :src="item0.icon" class='app-menu-icon' />
</template>
<template v-else-if="item0.iconcls && item0.iconcls != ''">
<i :class="[item0.iconcls, 'app-menu-icon']"></i>
</template>
<template v-else>
<i class='fa fa-cogs app-menu-icon'></i>
</template>
<template slot="title">
<span class="text" :title="$t('app.menus.${ctrl.codeName?lower_case}.' + item0.name)">{{$t('app.menus.${ctrl.codeName?lower_case}.' + item0.name)}}</span>
<template v-if="counterdata && counterdata[item0.counterid] && counterdata[item0.counterid] > 0">
<span class="pull-right">
<badge :count="counterdata[item0.counterid]" :overflow-count="9999"></badge>
</span>
</template>
</template>
</el-menu-item>
</template>
<template v-if="item0.type =='SEPERATOR'">
<divider :key="item0.id" />
</template>
</template>
</template>
</el-menu>
</div>
</#if>
</template>
<#assign import_block>
import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.codeName)}-${ctrl.getControlType()?lower_case}-model';
import ${srfclassname(ctrl.codeName)}Model from './${srffilepath2(ctrl.codeName)}-${ctrl.getControlType()?lower_case}-model';
</#assign>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public getData(): any {
return null;
}
/**
* 菜单模型
*
* @private
* @type {${srfclassname('${ctrl.codeName}')}Model}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
private menuMode: ${srfclassname('${ctrl.codeName}')}Model = new ${srfclassname('${ctrl.codeName}')}Model();
/**
* 显示处理提示
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop({ default: true }) protected showBusyIndicator?: boolean;
/**
* 菜单数据
*
* @private
* @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Provide()
private menus: any[] = [];
/**
* 菜单收缩改变
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Model() protected collapsechange?: boolean;
/**
* 监听菜单收缩
*
* @param {*} newVal
* @param {*} oldVal
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Watch('collapsechange')
onCollapsechangeChange(newVal: any, oldVal: any) {
if (newVal !== this.isCollapse) {
this.isCollapse = !this.isCollapse;
}
}
<script lang='tsx'>
import { Prop, Provide, Emit, Watch, Model } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { AppMenusCtrlBase } from '@/crm-core';
<#if appde??>
import ${srfclassname('${appde.getCodeName()}')}Service from '@/service/${srffilepath2(appde.getCodeName())}/${srffilepath2(appde.getCodeName())}-service';
</#if>
import ${srfclassname(ctrl.codeName)}Service from './${srffilepath2(ctrl.codeName)}-${ctrl.getControlType()?lower_case}-service';
<#if ctrl.getPSUIActions?? && ctrl.getPSUIActions()??>
<#list ctrl.getPSUIActions() as uiAction>
<#if uiAction.getPSAppDataEntity()??>
<#assign curAppEntity = uiAction.getPSAppDataEntity()/>
<#if !P.exists("importService", curAppEntity.getId(), "")>
import ${srfclassname('${curAppEntity.getCodeName()}')}UIService from '@/uiservice/${srffilepath2(curAppEntity.getCodeName())}/${srffilepath2(curAppEntity.getCodeName())}-ui-service';
</#if>
</#if>
</#list>
</#if>
<#if import_block??>${import_block}</#if>
/**
* 当前模式,菜单在顶部还是在底部
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() mode: any;
/**
* ${ctrl.getLogicName()}基类
*
* @export
* @class ${srfclassname(ctrl.codeName)}Base
* @extends {AppMenusCtrlBase}
*/
export default class ${srfclassname(ctrl.codeName)}Base extends AppMenusCtrlBase {
/**
* 当前菜单是否在默认视图上
* 建构部件服务对象
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @type {${srfclassname(ctrl.codeName)}Service}
* @memberof ${srfclassname(ctrl.codeName)}
*/
@Prop({ default: false }) isDefaultPage?: boolean;
public service: ${srfclassname(ctrl.codeName)}Service = new ${srfclassname(ctrl.codeName)}Service({ $store: this.$store });
/**
* 默认打开视图
* 菜单对齐方向
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @type {CrmIndexService}
* @memberof CrmIndex
*/
@Prop() defPSAppView: any;
protected menuAlign: string = '<#if view.getMainMenuAlign?? && view.getMainMenuAlign() ??>${view.getMainMenuAlign()}</#if>';
<#if appde??>
/**
* 默认激活的index
* 实体服务对象
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @type {${srfclassname('${appde.getCodeName()}')}Service}
* @memberof ${srfclassname(ctrl.codeName)}
*/
@Provide() defaultActive: any = null;
public appEntityService: ${srfclassname('${appde.getCodeName()}')}Service = new ${srfclassname('${appde.getCodeName()}')}Service({ $store: this.$store });
</#if>
<#if ctrl.getPSAppViewLogics?? && ctrl.getPSAppViewLogics()??>
<#list ctrl.getPSAppViewLogics() as logic>
<#if logic.getLogicTrigger() == "CUSTOM" || logic.getLogicTrigger() == "CTRLEVENT">
/**
* 当前选中主题
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() selectTheme: any;
${P.getLogicCode(logic, "LOGIC.vue").code}
</#if>
</#list>
</#if>
<#if ctrl.getPSUIActions?? && ctrl.getPSUIActions()??>
<#list ctrl.getPSUIActions() as uiAction>
<#if !uiAction.getPSAppDataEntity()??>
/**
* 默认打开的index数组
*
* @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Provide() protected defaultOpeneds: any[] = [];
${P.getLogicCode(uiAction, "LOGIC.vue").code}
</#if>
</#list>
</#if>
/**
* 是否展开
* 菜单模型
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @protected
* @type {${srfclassname(ctrl.codeName)}Model}
* @memberof ${srfclassname(ctrl.codeName)}
*/
@Provide() protected isCollapse: boolean = false;
protected menuModel: ${srfclassname(ctrl.codeName)}Model = new ${srfclassname(ctrl.codeName)}Model();
/**
* 触发方式,默认click
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Provide() trigger: string = 'click';
/**
* 计数器数据
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected counterdata: any = {};
/**
* vue 生命周期
*
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname(ctrl.codeName)}
*/
protected created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected afterCreated(){
if (Object.is(this.mode, 'horizontal')) {
this.trigger = 'hover';
}
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
this.load(data);
});
}
}
/**
* vue 生命周期
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
<#if destroyed_block??>
${destroyed_block}
</#if>
}
<#if view.isDefaultPage?? && view.isDefaultPage()>
@Provide()
public trigger: string = 'click';
<#if ctrl.getPSSysCounter?? && ctrl.getPSSysCounter()??>
<#assign sysCounter = ctrl.getPSSysCounter()/>
/**
* 处理菜单默认选中项
* 计数器对象
*
* @private
* @memberof ${srfclassname('${ctrl.codeName}')}
* @type {(UICounter | null)}
* @memberof ${srfclassname(ctrl.codeName)}
*/
private doMenuSelect(): void {
if (!this.isDefaultPage) {
return;
}
const appFuncs: any[] = this.menuMode.getAppFuncs();
if (this.$route && this.$route.matched && this.$route.matched.length == 2) { // 存在二级路由
const [{ }, matched] = this.$route.matched;
const appfunc: any = appFuncs.find((_appfunc: any) => Object.is(_appfunc.routepath, matched.path) && Object.is(_appfunc.appfuncyype, 'APPVIEW'));
if (appfunc) {
this.computeMenuSelect(this.menus, appfunc.appfunctag);
}
return;
} else if (this.defPSAppView && Object.keys(this.defPSAppView).length > 0) { // 存在默认视图
const appfunc: any = appFuncs.find((_appfunc: any) => Object.is(_appfunc.routepath, this.defPSAppView.routepath) && Object.is(_appfunc.appfuncyype, 'APPVIEW'));
if (appfunc) {
this.computeMenuSelect(this.menus, appfunc.appfunctag);
}
const viewparam: any = {};
const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, this.defPSAppView.deResParameters, this.defPSAppView.parameters, [], viewparam);
this.$router.push(path);
return;
}
this.computeMenuSelect(this.menus, '');
let item = this.compute(this.menus, this.defaultActive);
if (Object.keys(item).length === 0) {
return;
}
this.click(item);
}
public ${sysCounter.getCodeName()}: UICounter | null = null;
</#if>
<#if ctrl.getPSSysCounter?? && ctrl.getPSSysCounter()??>
/**
* 计算菜单选中项
* vue 生命周期
*
* @private
* @param {any[]} items
* @param {string} appfunctag
* @returns {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname(ctrl.codeName)}
*/
private computeMenuSelect(items: any[], appfunctag: string): boolean {
const appFuncs: any[] = this.menuMode.getAppFuncs();
return items.some((item: any) => {
if (Object.is(appfunctag, '') && !Object.is(item.appfunctag, '')) {
const appfunc = appFuncs.find((_appfunc: any) => Object.is(_appfunc.appfunctag, item.appfunctag));
if (appfunc.routepath) {
this.defaultActive = item.name;
this.setHideSideBar(item);
return true;
}
}
if (Object.is(item.appfunctag, appfunctag)) {
this.setHideSideBar(item);
this.defaultActive = item.name;
return true;
}
if (item.items && item.items.length > 0) {
const state = this.computeMenuSelect(item.items, appfunctag);
if (state) {
this.defaultOpeneds.push(item.name);
return true;
}
}
return false;
public created() {
<#assign sysCounter = ctrl.getPSSysCounter()/>
this.${sysCounter.getCodeName()} = new UICounter({
name: '${sysCounter.getCodeName()}',
counterId: '${sysCounter.id}',
timer: ${sysCounter.timer?c},
url: ``,
});
}
</#if>
/**
* 获取菜单项数据
*
* @private
* @param {any[]} items
* @param {string} name
* @returns
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
private compute(items: any[], name: string) {
const item: any = {};
items.some((_item: any) => {
if (name && Object.is(_item.name, name)) {
Object.assign(item, _item);
this.setHideSideBar(_item);
return true;
}
if (_item.items && Array.isArray(_item.items)) {
const subItem = this.compute(_item.items, name);
if (Object.keys(subItem).length > 0) {
Object.assign(item, subItem);
return true;
}
}
return false;
this.${sysCounter.getCodeName()}.uiCounterData.subscribe((data: any) => {
this.counterdata = {};
Object.assign(this.counterdata, data);
});
return item;
}
/**
* 设置是否隐藏菜单栏
*
* @private
* @param {*} item
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
private setHideSideBar(item: any): void {
<#if view.isDefaultPage?? && view.isDefaultPage()>
if (item.hidesidebar) {
this.$emit('collapsechange', true);
}
</#if>
super.created();
}
</#if>
<#if ctrl.getPSSysCounter?? && ctrl.getPSSysCounter()??>
/**
* 菜单项选中处理
* vue 生命周期
*
* @param {*} index
* @param {any[]} indexs
* @returns
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname(ctrl.codeName)}
*/
protected select(index: any, indexs: any[]) {
let item = this.compute(this.menus, index);
if (Object.keys(item).length === 0) {
return;
public destroyed() {
super.destroyed();
<#assign sysCounter = ctrl.getPSSysCounter()/>
if(this.${sysCounter.getCodeName()}) {
this.${sysCounter.getCodeName()}.uiCounterData.unsubscribe();
this.${sysCounter.getCodeName()}.close();
}
this.click(item);
}
</#if>
/**
* 菜单点击
*
* @private
* @protected
* @param {*} item 菜单数据
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname(ctrl.codeName)}
*/
private click(item: any) {
protected click(item: any) {
if (item) {
switch (item.appfunctag) {
<#if ctrl.getPSAppFuncs()??>
......@@ -478,7 +165,6 @@ import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.code
}
}
}
<#if ctrl.getPSAppFuncs()??>
<@ibizindent blank=4>
<#list ctrl.getPSAppFuncs() as singleFuncs>
......@@ -488,47 +174,12 @@ ${P.getLogicCode(singleFuncs,"LOGIC.vue").code}
</@ibizindent>
</#if>
/**
* 数据加载
*
* @param {*} data
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected load(data: any) {
this.dataProcess(this.menuMode.getAppMenuItems());
this.menus = this.menuMode.getAppMenuItems();
<#if view.isDefaultPage?? && view.isDefaultPage()>
this.doMenuSelect();
</#if>
}
/**
* 数据处理
*
* @private
* @param {any[]} items
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
private dataProcess(items: any[]): void {
items.forEach((_item: any) => {
if (_item.expanded) {
this.defaultOpeneds.push(_item.name);
}
if (_item.items && _item.items.length > 0) {
this.dataProcess(_item.items)
}
});
}
/**
* 提示框主题样式
*
* @readonly
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
get popperClass(): string {
return 'app-popper-menu ' + this.selectTheme;
public render(): any {
return (
<div class="app-app-menu">
<app-menus menuAlign={this.menuAlign} menus={this.menus} on-menu-click={(item: any) => this.click(item)}/>
</div>
);
}
<#ibizinclude>
......
<#-- content -->
<#assign content>
:showBusyIndicator="${ctrl.isShowBusyIndicator()?c}"
v-model="collapseChange"
:mode="mode"
:selectTheme="selectTheme"
:isDefaultPage="isDefaultPage"
:defPSAppView="defPSAppView"
</#assign>
<#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl
</#ibizinclude>
\ No newline at end of file
<view_${ctrl.getName()}
viewState={this.viewState}
viewparams={this.viewparams}
context={this.context}
showBusyIndicator={${ctrl.isShowBusyIndicator()?c}}
on-menus-change={(menus: any[]) => this.appMenusChange(menus)}
name="${ctrl.name}"
ref="${ctrl.name}"
/>
\ No newline at end of file
/*** BRGIN:菜单样式 ***/
.app-app-menu {
overflow-y: auto;
overflow-x: hidden;
height: calc(100% - 58px);
.ivu-divider{
background-color: #b3b3b3;
height: 2px;
}
> .el-menu {
border-right: 0;
.el-menu-item {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
.ivu-badge {
.ivu-badge-count {
box-shadow: 0 0 0 0px #fff;
}
}
}
.el-submenu__title i, .el-menu-item i {
font-size: 16px;
width: 16px;
}
.el-submenu__title .text {
font-size: 16px;
}
.el-menu-item, .el-submenu__title {
height: 36px;
font-size: 16px;
line-height: 32px;
}
.el-menu-item, .el-submenu, .el-menu {
border-top: 1px solid #fff;
}
> .el-menu-item, > .el-submenu > .el-submenu__title {
height: 40px;
line-height: 36px;
border-left: 4px solid transparent;
padding-left: 16px !important;
}
.app-menu-icon {
margin-right: 4px;
}
> .el-submenu {
> .el-menu {
> .el-menu-item, > .el-submenu > .el-submenu__title {
padding-left: 44px !important;
}
> .el-submenu {
> .el-menu {
> .el-menu-item, > .el-submenu > .el-submenu__title {
padding-left: 68px !important;
}
}
}
}
}
.active-icon {
font-size: 40px !important;
position: absolute;
right: 0;
line-height: 42px;
color: #fff !important;
display: none;
width: 24px !important;
overflow: hidden;
}
}
.ivu-divider-horizontal {
width: calc(100% - 32px);
min-width: calc(100% - 32px);
margin: 4px auto;
margin-bottom: 1px;
}
}
.app-popper-menu {
.el-menu-item, .el-submenu__title {
height: 36px;
font-size: 16px;
line-height: 36px;
}
> .el-menu-item, > .el-submenu > .el-submenu__title {
height: 40px;
line-height: 40px;
}
.el-menu-item {
.ivu-badge {
.ivu-badge-count {
box-shadow: 0 0 0 0px #fff;
}
}
> span{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.ivu-divider-horizontal {
width: calc(100% - 12px);
min-width: calc(100% - 12px);
margin: 4px auto;
margin-bottom: 1px;
}
}
<#ibizinclude>
../@MACRO/CSS/DEFAULT.less.ftl
</#ibizinclude>
\ No newline at end of file
height: 100%;
width: 100%;
}
\ No newline at end of file
<#ibizinclude>
../@MACRO/CONTROL/CONTROL.vue.ftl
</#ibizinclude>
\ No newline at end of file
<script lang='ts'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/crm-core';
import ${srfclassname(ctrl.codeName)}Base from './${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}-base.vue';
<#if ctrl.getPSControls?? && ctrl.getPSControls()??>
<#list ctrl.getPSControls() as subctrl>
<#if subctrl.getControlType() != 'TOOLBAR' && subctrl.getControlType() != 'CONTEXTMENU'>
<#if subctrl.getPSAppDataEntity?? && subctrl.getPSAppDataEntity()??>
import view_${subctrl.getName()} from '@widgets/${srffilepath2(subctrl.getPSAppDataEntity().getCodeName())}/${srffilepath2(subctrl.getCodeName())}-${subctrl.getControlType()?lower_case}/${srffilepath2(subctrl.getCodeName())}-${subctrl.getControlType()?lower_case}.vue';
<#else>
import view_${subctrl.getName()} from '@widgets/app/${srffilepath2(subctrl.getCodeName())}-${subctrl.getControlType()?lower_case}/${srffilepath2(subctrl.getCodeName())}-${subctrl.getControlType()?lower_case}.vue';
</#if>
</#if>
</#list>
</#if>
/**
* ${ctrl.getName()}基类
*
* @export
* @class ${srfclassname(ctrl.codeName)}
* @extends {${srfclassname(ctrl.codeName)}Base}
*/
@Component({
components: {
<#if ctrl.getPSControls?? && ctrl.getPSControls()??>
<#list ctrl.getPSControls() as subctrl>
<#if subctrl.getControlType() != 'TOOLBAR' && subctrl.getControlType() != 'CONTEXTMENU'>
view_${subctrl.getName()},
</#if>
</#list>
</#if>
<#if components??>${components}</#if>
}
})
@VueLifeCycleProcessing
export default class ${srfclassname(ctrl.codeName)} extends ${srfclassname(ctrl.codeName)}Base { }
</script>
\ No newline at end of file
<template>
<div class="app-data-chart <#if ctrl.getPSSysCss()??><#assign singleCss = ctrl.getPSSysCss()> ${singleCss.getCssName()}</#if>">
<#if ctrl.render??><#t>
${ctrl.render.code}
<#else><#t>
<div class="app-charts" :id="chartId" style="<#if ctrl.getWidth() gt 0>width: ${ctrl.getWidth()};</#if>height: <#if ctrl.getHeight() gt 0>${ctrl.getHeight()}px<#else>100%</#if>;padding: 6px 0;"></div>
</#if>
</div>
</template>
<#assign import_block>
import echarts from 'echarts';
</#assign>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public getData(): any {
return null;
}
/**
* 显示处理提示
*
* @type {boolean}
* @memberof MOBILEENTITY3Canlen
*/
@Prop({ default: true }) protected showBusyIndicator!: boolean;
/**
* 部件行为--fetch
*
* @type {string}
* @memberof Mob
*/
@Prop() protected fetchAction!: string;
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
if (Object.is('load', action)) {
this.load(data);
}
});
}
}
/**
* vue 生命周期
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
<#if destroyed_block??>
${destroyed_block}
</#if>
}
/**
* 图表div绑定的id
*
* @type {}
* @memberof ${srfclassname('${ctrl.name}')}
*/
public chartId:string = this.$util.createUUID();
/**
* echarts图表对象
*
* @type {}
* @memberof ${srfclassname('${ctrl.name}')}
*/
public myChart:any;
/**
* 初始化图表所需参数
*
* @type {}
* @memberof ${srfclassname('${ctrl.name}')}
*/
public chartOption:any = {};
/**
* 图表基础配置参数
*
* @returns {*}
* @memberof ${srfclassname('${ctrl.name}')}Service
*/
public defaultConfig: any = {
<#-- 获取模板对象:BEGIN -->
<#assign title=ctrl.getPSDEChartTitle()>
<#list ctrl.getPSDEChartSerieses() as series>
<#-- 暂只支持第一个序列 -->
<#if series_index == 0>
<#assign chartSeries = series/>
</#if>
</#list>
<#-- 获取模板对象:END -->
<#-- 公共配置:BEGIN -->
title: {
show: <#if title.isShowTitle()>true<#else>false</#if>,
<#if title.getTitle()??>
text: '${title.getTitle()}',
</#if>
<#if title.getSubTitle()??>
subtext: '${title.getSubTitle()}'
</#if>
},
legend: {top: 20},
// toolbox: {
// show: true,
// feature: {
// dataView: {
// show: true,
// readOnly: true,
// title: '数据视图'
// },
// saveAsImage: {
// show: true,
// title: '保存为图片'
// }
// }
// },
tooltip: {
trigger: 'item',
formatter: (params: any) => {
return `<#noparse>${params.seriesName}<br>${params.data.name}: ${params.data.sum}个</#noparse>`
}
},
color:['#37A2DA','#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C','#ff9f7f', '#fb7293', '#E062AE','#E690D1', '#e7bcf3', '#9d96f5']
}
/**
* 深度合并对象,把secondObj的内容合并给firstObj,返回合并后的firstObj
* @param {} firstObj 被合并对象
* @param {} secondObj 合并对象
* @memberof ${srfclassname('${ctrl.name}')}
*/
public deepObjectMerge(firstObj: any, secondObj: any) {
for (let key in secondObj) {
firstObj[key] =
firstObj[key] && firstObj[key].toString() === "[object Object]"
? this.deepObjectMerge(firstObj[key], secondObj[key])
: (firstObj[key] = secondObj[key]);
}
return firstObj;
}
/**
* 刷新
*
* @param {*} [opt={}]
* @memberof ${srfclassname('${ctrl.name}')}
*/
protected refresh(opt: any = {}) {
this.load(opt);
}
/**
* 获取图表数据
*
* @returns {*}
* @memberof ${srfclassname('${ctrl.name}')}
*/
public load(opt?:any) {
let _this = this;
const arg: any = { ...opt };
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
Object.assign(arg,{viewparams:this.viewparams});
this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)),arg,this.showBusyIndicator).then((res) => {
if (res) {
_this.chartOption = _this.deepObjectMerge(_this.defaultConfig, res.data);
_this.drawCharts();
}
}).catch((error) => {
console.error(error);
});
}
/**
* 绘制图表
*
* @returns {*}
* @memberof ${srfclassname('${ctrl.name}')}
*/
public drawCharts(){
if(!this.myChart){
let element:any = document.getElementById(this.chartId);
this.myChart = echarts.init(element);
}
this.myChart.setOption(this.chartOption);
this.myChart.resize();
}
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL-BASE.style.ftl
</#ibizinclude>
\ No newline at end of file
<#ibizinclude>
../@MACRO/SERVICE/SERVICE_HEADER.ts.ftl
</#ibizinclude>
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
@Errorlog
public search(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.FetchDefault(Context,Data, isloading);
}
result.then((response) => {
this.handleSeries(response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
<#-- 暂只支持第一个序列 -->
<#list ctrl.getPSDEChartSerieses() as series>
<#if series_index == 0>
<#assign chartSeries = series/>
</#if>
</#list>
/**
* 生成图表数据
*
* @param {*} response
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
public handleSeries(response: any) {
let chartOption:any = {};
<#-- 获取x轴的分类属性字段 -->
<#if chartSeries.getCatalogField?? && chartSeries.getCatalogField()??>
<#assign catalogField = chartSeries.getCatalogField()>
let catalogFields: any = [<#rt>
<#list catalogField?split(";") as field>
"${field?lower_case}",<#t>
</#list>
</#if>
];<#lt>
<#-- 获取y轴值属性字段和中文名称 -->
<#if chartSeries.getValueField?? && chartSeries.getValueField()??>
<#assign valueField = chartSeries.getValueField()>
let valueFields: any = [<#rt>
<#list valueField?split(";") as field>
[ "${field?lower_case}", "${de.getPSDEField(field).getLogicName()}" ],<#t>
</#list>
</#if>
];<#lt>
let otherFields: any = ['planned_revenue'];
// 数据按分类属性分组处理
let xFields:any = [];
let yFields:any = [];
let oFields: any = [];
valueFields.forEach((field: any,index: number) => {
yFields[index] = [];
});
response.data.forEach((item:any) => {
if(xFields.indexOf(item[catalogFields[0]]) > -1){
let num = xFields.indexOf(item[catalogFields[0]]);
valueFields.forEach((field: any,index: number) => {
yFields[index][num] += item[field[0]];
});
oFields[num] += item[otherFields[0]];
}else{
xFields.push(item[catalogFields[0]]);
oFields.push(item[otherFields[0]]);
valueFields.forEach((field: any,index: number) => {
yFields[index].push(item[field[0]]);
});
}
});
let series: any = [];
valueFields.forEach((field: any,index: number) => {
let yData: any = [];
xFields.forEach((item:any, num: number) => {
yData.push({value: (100 - (100 / xFields.length) * num), name: item, sum: yFields[index][num], total: oFields[num]});
});
yData.sort(function (a:any, b:any) { return a.value - b.value; });
series.push({
name:field[1],
type:"funnel",
data:yData,
minSize: '40%',
label: {
position: 'center',
formatter: (params: any) => {
return `<#noparse>${params.data.name}(${params.data.sum}个, 金额¥${params.data.total})</#noparse>`
}
},
});
});
chartOption.series = series;
response.data = chartOption;
}
<#ibizinclude>
../@MACRO/SERVICE/SERVICE_BOTTOM.ts.ftl
</#ibizinclude>
\ No newline at end of file
CTRLTYPE=CHART#FunnelChart
\ No newline at end of file
......@@ -53,7 +53,7 @@
}
}
.el-table__body-wrapper{
height: calc(100% - 43px) !important;
height: calc(100% - 60px) !important;
}
.el-table__empty-block{
height: auto !important;
......
<template>
<div class='grid' style="height:100%;">
<#if ctrl.render?? || ctrl.getRender()??>
${ctrl.render.code}
<#else>
<data-reveal-type :datas="JSON.stringify(items)" @click="rowDBLClick">
<el-table v-if="isDisplay === true"
<#-- BEGIN:是否支持排序 -->
<#if !ctrl.isNoSort()>
:default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"
@sort-change="onSortChange($event)"
</#if>
<#-- END:是否支持排序 -->
:border="isDragendCol"
<#-- 表格聚合start -->
<#if ctrl.getAggMode() != "NONE">
:show-summary="true && items.length > 0"
:summary-method="getSummaries"
</#if>
<#-- 表格聚合end -->
stripe :height="isEnablePagingBar && items.length > 0 ? 'calc(100% - 50px)' : '100%'"
@row-click="rowClick($event)"
@select-all="selectAll($event)"
@select="select($event)"
@row-class-name="onRowClassName($event)"
@row-dblclick="rowDBLClick($event)"
ref='multipleTable' :data="items" :show-header="!isHideHeader">
<template v-if="!isSingleSelect">
<el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
</template>
<#assign adaptationColu = true/>
<#list ctrl.getPSDEGridColumns() as column>
<@ibizindent blank=12>
${P.getPartCode(column,'COLUMN').code}<#t>
</@ibizindent>
</#list>
</el-table>
<#if ctrl.isEnablePagingBar()>
<row class='grid-pagination' v-show="items.length > 0">
<page class='pull-right' @on-change="pageOnChange($event)"
@on-page-size-change="onPageSizeChange($event)"
:transfer="true" :total="totalrow"
show-sizer :current="curPage" :page-size="limit"
:page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total>
<span>
<span class="page-column">
<poptip transfer placement="top-start">
<i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button>
<div slot="content">
<template v-for="col in allColumns">
<div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div>
</template>
</div>
</poptip>
</span>
<span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
<span>
{{$t('app.gridpage.show')}}&nbsp;
<span>
<template v-if="items.length === 1">
1
</template>
<template v-else>
<span>{{(curPage - 1) * limit + 1}}&nbsp;-&nbsp;{{totalrow > curPage * limit ? curPage * limit : totalrow}}</span>
</template>
</span>&nbsp;
{{$t('app.gridpage.records')}},{{$t('app.gridpage.totle')}}&nbsp;{{totalrow}}&nbsp;{{$t('app.gridpage.records')}}
</span>
</span>
</page>
</row>
</#if>
</#if>
</data-reveal-type>
</div>
</template>
<#assign import_block>
import CodeListService from "@service/app/codelist-service";
</#assign>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public getDatas(): any[] {
return this.selections;
}
/**
* 获取单项树
*
* @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public getData(): any {
return this.selections[0];
}
<#if view.getPSAppViewLogics?? && view.getPSAppViewLogics()??>
<#list view.getPSAppViewLogics() as logic>
<#if logic.getPFLogicCodeType() == 'APP_NEWDATA'>
/**
* 打开新建数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() protected newdata: any;
</#if>
<#if logic.getPFLogicCodeType() == 'APP_OPENDATA'>
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() protected opendata: any;
</#if>
</#list>
</#if>
/**
* 显示处理提示
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop({ default: true }) protected showBusyIndicator?: boolean;
/**
* 部件行为--update
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() protected updateAction!: string;
/**
* 部件行为--fetch
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() protected fetchAction!: string;
/**
* 部件行为--remove
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() protected removeAction!: string;
/**
* 部件行为--load
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() protected loadAction!: string;
/**
* 部件行为--loaddraft
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() protected loaddraftAction!: string;
/**
* 部件行为--create
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() protected createAction!: string;
/**
* 当前页
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected curPage: number = 1;
/**
* 数据
*
* @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected items: any[] = [];
/**
* 是否支持分页
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected isEnablePagingBar: boolean = ${ctrl.isEnablePagingBar()?c};
/**
* 是否禁用排序
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected isNoSort: boolean = ${ctrl.isNoSort()?c};
/**
* 排序方向
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected minorSortDir: string = '<#if ctrl.getMinorSortDir()??>${ctrl.getMinorSortDir()}</#if>';
/**
* 排序字段
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected minorSortPSDEF: string = '<#if ctrl.getMinorSortPSDEF()??>${ctrl.getMinorSortPSDEF().getCodeName()?lower_case}</#if>';
/**
* 分页条数
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected limit: number = ${ctrl.getPagingSize()?c};
/**
* 是否显示标题
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected isHideHeader: boolean = ${ctrl.isHideHeader()?c};
/**
* 是否默认选中第一条数据
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop({ default: false }) protected isSelectFirstDefault!: boolean;
/**
* 是否单选
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() protected isSingleSelect?: boolean;
/**
* 选中数据字符串
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() protected selectedData?: string;
/**
* 选中值变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof MainTree
*/
@Watch('selectedData')
public onValueChange(newVal: any, oldVal: any) {
this.selections = [];
if(this.selectedData){
const refs: any = this.$refs;
if (refs.multipleTable) {
refs.multipleTable.clearSelection();
JSON.parse(this.selectedData).forEach((selection:any)=>{
let selectedItem = this.items.find((item:any)=>{
return Object.is(item.srfkey, selection.srfkey);
});
if(selectedItem){
this.rowClick(selectedItem);
}
});
}
}
}
/**
* 表格行数据默认激活模式
* 0 不激活
* 1 单击激活
* 2 双击激活
*
* @type {(number | 0 | 1 | 2)}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop({default: 2}) protected gridRowActiveMode!: number;
/**
* 是否开启行编辑
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop({default: false}) protected isOpenEdit!: boolean;
/**
* 实际是否开启行编辑
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected actualIsOpenEdit: boolean = this.isOpenEdit;
/**
* 总条数
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected totalrow: number = 0;
/**
* 选中行数据
*
* @type {any[]}
* @memberof Main
*/
protected selections: any[] = [];
/**
* 拦截行选中
*
* @type {boolean}
* @memberof Main
*/
protected stopRowClick: boolean = false;
<#if ctrl.getAggMode() == "ALL">
/**
* 表格聚合行为
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected aggAction:string ='<#if ctrl.getAggPSDEAction()??>${ctrl.getAggPSDEAction().getCodeName()}</#if>';
/**
* 远程数据
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected remoteData:any = {};
</#if>
/**
* 表格是否显示
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected isDisplay:boolean = <#if ctrl.getAggMode() == "ALL">false<#else>true</#if>;
/**
* 部件刷新
*
* @param {any[]} args
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected refresh(args: any[]): void {
this.load();
}
/**
* 选项框列宽
*
* @type {number}
* @memberof AppIndex
*/
protected checkboxColWidth: number = <#if app.getPSApplicationUI()??>${app.getPSApplicationUI().getPFStyleParam('EL-TABLE.CHECKCOLWIDTH',80)}<#else>80</#if>;
/**
* 是否允许拖动列宽
*
* @type {boolean}
* @memberof AppEmbedPicker
*/
protected isDragendCol: boolean = <#if app.getPSApplicationUI()??>${app.getPSApplicationUI().getPFStyleParam('EL-TABLE.ISDRAGENDCOL',false)?c}<#else>false</#if>;
/**
* 所有列成员
*
* @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected allColumns: any[] = [
<#if ctrl.getAllPSDEGridColumns()??>
<#list ctrl.getAllPSDEGridColumns() as column>
{
name: '${column.getName()?lower_case}',
label: '${column.getCaption()}',
langtag: '<#if langbase??>${langbase}.columns.${column.getName()?lower_case}</#if>',
show: <#if column.isHideDefault()>false<#else>true</#if>,
util: '${column.getWidthUnit()}'
},
</#list>
</#if>
]
/**
* 属性值规则
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected rules: any = {
<#list ctrl.getPSDEGridEditItems() as edititem>
${edititem.getName()}: [
{ required: <#if edititem.isAllowEmpty()>false<#else>true</#if>, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: <#if edititem.getCaption?? && edititem.getCaption()??>'${edititem.getCaption()} 值不能为空'<#else>'值不能为空'</#if>, trigger: 'change' },
{ required: <#if edititem.isAllowEmpty()>false<#else>true</#if>, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: <#if edititem.getCaption?? && edititem.getCaption()??>'${edititem.getCaption()} 值不能为空'<#else>'值不能为空'</#if>, trigger: 'blur' },
<#if ctrl.getPSGEIDEFValueRules?? && ctrl.getPSGEIDEFValueRules()??>
<#list ctrl.getPSGEIDEFValueRules() as fideValueRule>
<#if fideValueRule.getPSSysValueRule()??>
<#assign valueRule = fideValueRule.getPSSysValueRule()/>
<#if valueRule.getRuleType?? && valueRule.getRuleType()??>
<#if valueRule.getRuleType() == "REG">
{ <#if valueRule.getRegExCode?? && valueRule.getRegExCode()??>pattern: /^${valueRule.getRegExCode()}$/</#if><#if valueRule.getRuleInfo?? && valueRule.getRuleInfo()??>, message: '${valueRule.getRuleInfo()}'</#if>, trigger: 'change' },
<#elseif valueRule.getRuleType() == "SCRIPT">
{ <#if valueRule.getScriptCode?? && valueRule.getScriptCode()??>validator: (rule:any, value:any, callback:any) => { ${valueRule.getScriptCode()} }</#if><#if valueRule.getRuleInfo?? && valueRule.getRuleInfo()??>, message: '${valueRule.getRuleInfo()}'</#if>, trigger: 'change' },
</#if>
</#if>
</#if>
</#list>
</#if>
],
</#list>
}
/**
* 表格数据加载
*
* @param {*} [arg={}]
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected load(opt: any = {}, pageReset: boolean = false): void {
if(!this.fetchAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格fetchAction参数未配置' });
return;
}
if(pageReset){
this.curPage = 1;
}
const arg: any = {...opt};
const page: any = {};
if (this.isEnablePagingBar) {
Object.assign(page, { page: this.curPage-1, size: this.limit });
}
// 设置排序
if (!this.isNoSort && !Object.is(this.minorSortDir, '') && !Object.is(this.minorSortPSDEF, '')) {
const sort: string = this.minorSortPSDEF+","+this.minorSortDir;
Object.assign(page, { sort: sort });
}
Object.assign(arg, page);
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
Object.assign(arg,{viewparams:this.viewparams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
}
return;
}
const data: any = response.data;
this.totalrow = response.total;
this.items = JSON.parse(JSON.stringify(data));
// 清空selections
this.selections = [];
this.$emit('load', this.items);
// 设置默认选中
let _this = this;
setTimeout(() => {
if(_this.isSelectFirstDefault){
_this.rowClick(_this.items[0]);
}
if(_this.selectedData){
const refs: any = _this.$refs;
if (refs.multipleTable) {
refs.multipleTable.clearSelection();
JSON.parse(_this.selectedData).forEach((selection:any)=>{
let selectedItem = _this.items.find((item:any)=>{
return Object.is(item.srfkey, selection.srfkey);
});
if(selectedItem){
_this.rowClick(selectedItem);
}
});
}
}
}, 300);
<#if ctrl.getAggMode() == "ALL">
this.getAggData();
</#if>
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.errorMessage });
});
}
/**
* 删除
*
* @param {any[]} datas
* @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected async remove(datas: any[]): Promise<any> {
if(!this.removeAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格removeAction参数未配置' });
return;
}
let _datas:any[] = [];
datas.forEach((record: any, index: number) => {
if (!record.srfkey) {
this.items.some((val: any, num: number) =>{
if(JSON.stringify(val) == JSON.stringify(record)){
this.items.splice(num,1);
return true;
}
});
}else{
_datas.push(datas[index]);
}
});
if (_datas.length === 0) {
return;
}
let dataInfo = '';
_datas.forEach((record: any, index: number) => {
let srfmajortext = record.${ctrl.getPSAppDataEntity().getMajorPSAppDEField().getCodeName()?lower_case};
if (index < 5) {
if (!Object.is(dataInfo, '')) {
dataInfo += '、';
}
dataInfo += srfmajortext;
} else {
return false;
}
});
if (_datas.length < 5) {
dataInfo = dataInfo + ' 共' + _datas.length + '条数据';
} else {
dataInfo = dataInfo + '...' + ' 共' + _datas.length + '条数据';
}
const removeData = () => {
let keys: any[] = [];
_datas.forEach((data: any) => {
keys.push(data.srfkey);
});
const context:any = JSON.parse(JSON.stringify(this.context));
const post: Promise<any> = this.service.delete(this.removeAction,Object.assign(context,{ ${ctrl.getPSAppDataEntity().codeName?lower_case}: keys.join(';') }),Object.assign({ ${ctrl.getPSAppDataEntity().getKeyPSAppDEField().codeName?lower_case}: keys.join(';') },{viewparams:this.viewparams}), this.showBusyIndicator);
return new Promise((resolve: any, reject: any) => {
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '', desc: '删除数据失败,' + response.info });
return;
} else {
this.$Notice.success({ title: '', desc: '删除成功!' });
}
//删除items中已删除的项
console.log(this.items);
_datas.forEach((data: any) => {
this.items.some((item:any,index:number)=>{
if(Object.is(item.srfkey,data.srfkey)){
this.items.splice(index,1);
return true;
}
});
});
this.totalrow -= _datas.length;
this.$emit('remove', null);
this.selections = [];
resolve(response);
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
reject(response);
return;
}
reject(response);
});
});
}
dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, '');
this.$Modal.confirm({
title: '警告',
content: '确认要删除 ' + dataInfo + ',删除操作将不可恢复?',
onOk: () => {
removeData();
},
onCancel: () => { }
});
return removeData;
}
/**
* 批量添加
*
* @param {*} [arg={}]
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected addBatch(arg: any = {}): void {
if(!this.fetchAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格fetchAction参数未配置' });
return;
}
if(!arg){
arg = {};
}
console.error("批量添加未实现");
<#-- const post: Promise<any> = this.$http.post(this.fetchAction, arg, this.showBusyIndicator);
post.then((response: any) => {
if (response.ret !== 200) {
this.$Notice.error({ title: '', desc: '批量添加失败,' + response.info });
return;
}
this.load({});
this.$emit('addbatch', null);
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '', desc: '批量添加失败' });
}); -->
}
/**
* 数据导入
*
* @param {*} data
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public importExcel(data:any ={}):void{
//导入excel
const importDataModel:any ={
<#if ctrl.getPSDEDataImport?? && ctrl.getPSDEDataImport()??>
<#assign dataImport = ctrl.getPSDEDataImport() />
importId:'${dataImport.getCodeName()}',
serviceName:'${dataImport.getPSAppDataEntity().getCodeName()?lower_case}',
appDeLogicName:'${dataImport.getPSAppDataEntity().getLogicName()}',
importData:{
<#if dataImport.getPSDEDataImportItems()??>
<#list dataImport.getPSDEDataImportItems() as dataImportItem>
"${dataImportItem.getName()}":{<#if dataImportItem.getPSCodeList()??><#assign codelist = dataImportItem.getPSCodeList()/>"codelist":{"type":"${codelist.getCodeListType()}","tag":"${codelist.getCodeName()}","isnumber":${codelist.isCodeItemValueNumber()?c}},</#if>"headername":"${dataImportItem.getCaption()}","isuniqueitem":${dataImportItem.isUniqueItem()?c},<#if dataImportItem.getPSAppDEField()??><#assign appDeField = dataImportItem.getPSDEField()/>"name":"${appDeField.getCodeName()?lower_case}","order":<#if appDeField.getImportOrder()??>${appDeField.getImportOrder()?c}</#if></#if>}<#if dataImportItem_has_next>,</#if>
</#list>
</#if>
}
</#if>
}
if(Object.keys(importDataModel).length == 0){
this.$Notice.warning({ title: '警告', desc: '请配置数据导入项' });
return;
}
const view:any ={
viewname: 'app-data-upload',
title: '导入数据',
width: 900,
height: 700
}
let container: Subject<any> = this.$appmodal.openModal(view, JSON.parse(JSON.stringify(this.context)), importDataModel);
container.subscribe((result: any) => {
if(Object.is(result.ret,'OK')){
this.refresh(result.datas);
}
});
}
<#assign hasDEExport = false />
<#if ctrl.getPSDEDataExport?? && ctrl.getPSDEDataExport()??>
<#assign hasDEExport = true />
/**
* 所有导出列成员
*
* @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected allExportColumns: any[] = [
<#if ctrl.getPSDEDataExport().getPSDEDataExportItems()??>
<#list ctrl.getPSDEDataExport().getPSDEDataExportItems() as column>
{
name: '${column.getName()?lower_case}',
label: '${column.getCaption()}',
langtag: '<#if langbase??>${langbase}.exportColumns.${column.getName()?lower_case}</#if>',
show: true,
},
</#list>
</#if>
]
</#if>
/**
* 数据导出
*
* @param {*} data
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected exportExcel(data: any = {}): void {
// 导出Excel
const doExport = async (_data:any) => {
const tHeader: Array<any> = [];
const filterVal: Array<any> = [];
<#if hasDEExport>
this.allExportColumns.forEach((item: any) => {
<#else>
this.allColumns.forEach((item: any) => {
</#if>
item.show && item.label ? tHeader.push(this.$t(item.langtag)) : "";
item.show && item.name ? filterVal.push(item.name) : "";
});
const data = await this.formatExcelData(filterVal, _data);
this.$export.exportExcel().then((excel:any)=>{
excel.export_json_to_excel({
header: tHeader, //表头 必填
data, //具体数据 必填
filename: "${ctrl.getPSAppDataEntity().getLogicName()}表", //非必填
autoWidth: true, //非必填
bookType: "xlsx" //非必填
});
});
};
const page: any = {};
// 设置page,size
if (Object.is(data.type, 'maxRowCount')) {
Object.assign(page, { page: 0, size: data.maxRowCount });
} else if (Object.is(data.type, 'activatedPage')) {
<#if hasDEExport>
Object.assign(page, { page: this.curPage-1, size: this.limit });
<#else>
try {
doExport(JSON.parse(JSON.stringify(this.items)));
} catch (error) {
console.error(error);
}
return;
</#if>
}
// 设置排序
if (!this.isNoSort && !Object.is(this.minorSortDir, '') && !Object.is(this.minorSortPSDEF, '')) {
const sort: string = this.minorSortPSDEF+","+this.minorSortDir;
Object.assign(page, { sort: sort });
}
const arg: any = {};
Object.assign(arg, page);
// 获取query,搜索表单,viewparams等父数据
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
<#if hasDEExport>
const post: Promise<any> = this.service.searchDEExportData(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
<#else>
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
</#if>
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '', desc: '数据导出失败,' + response.info });
return;
}
try {
doExport(JSON.parse(JSON.stringify(response.data)));
} catch (error) {
console.error(error);
}
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '', desc: '数据导出失败' });
});
}
/**
* 导出数据格式化
*
* @param {*} filterVal
* @param {*} jsonData
* @returns {[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public async formatExcelData(filterVal:any, jsonData:any) {
let codelistColumns:Array<any> = [
<#if hasDEExport>
<#assign exportItems = ctrl.getPSDEDataExport().getPSDEDataExportItems() />
<#else>
<#assign exportItems = ctrl.getAllPSDEGridColumns() />
</#if>
<#if exportItems??>
<#list exportItems as column>
<#if (hasDEExport || (!column.isHideDefault() && column.getName() != '')) && column.getCodeList?? && column.getCodeList()?? && column.getCLConvertMode() == 'FRONT'>
<#assign codelist = column.getPSCodeList()>
<#if codelist.getCodeListType() == 'STATIC' || codelist.getCodeListType() == 'DYNAMIC'>
{
name: '${column.getName()?lower_case}',
srfkey: '${codelist.codeName}',
codelistType : '${codelist.getCodeListType()}',
<#if codelist.getOrMode() == 'STR'>
textSeparator: '${codelist.textSeparator}',
renderMode: 'string',
valueSeparator: "${codelist.valueSeparator}",
<#elseif codelist.getOrMode() == 'NUM'>
renderMode: 'number',
textSeparator: '${codelist.textSeparator}',
valueSeparator: ';',
<#else>
renderMode: 'other',
textSeparator: '、',
valueSeparator: ';',
</#if>
},
</#if>
</#if>
</#list>
</#if>
];
let _this = this;
for (const codelist of codelistColumns) {
// 动态代码表处理
if (Object.is(codelist.codelistType, "DYNAMIC")) {
let items = await _this.codeListService.getItems(codelist.srfkey);
jsonData.forEach((row:any)=>{
row[codelist.name] = _this.getCodelistValue(items, row[codelist.name], codelist);
});
// 静态处理
} else if(Object.is(codelist.codelistType, "STATIC")){
let items = await _this.$store.getters.getCodeListItems(codelist.srfkey);
jsonData.forEach((row:any)=>{
row[codelist.name] = _this.getCodelistValue(items, row[codelist.name], codelist);
});
}
}
return jsonData.map((v:any) => filterVal.map((j:any) => v[j]))
}
/**
* 解析代码表和vlaue,设置items
*
* @private
* @param {any[]} items 代码表数据
* @param {*} value
* @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
private getCodelistValue(items: any[], value: any, codelist: any,){
if(!value){
return this.$t('codelist.'+codelist.srfkey+'.empty');
}
if (items) {
let result:any = [];
if(Object.is(codelist.renderMode,"number")){
items.map((_item: any, index: number)=>{
const nValue = parseInt((value as any), 10);
const codevalue = _item.value;
if((parseInt(codevalue, 10) & nValue) > 0){
result.push(_item);
}
});
} else if(Object.is(codelist.renderMode,"string")){
const arrayValue: Array<any> = (value as any).split(codelist.valueSeparator);
arrayValue.map((value: any, index: number) => {
result.push([]);
let values: any[] = Object.is(this.$util.typeOf(value), 'number') ? [value] : [...(value as any).split(codelist.valueSeparator)];
values.map((val:any ,num: number)=>{
const item = this.getItem(items, val, codelist);
if(item){
result[index].push(item);
}
});
});
} else {
let values: any[] = Object.is(this.$util.typeOf(value), 'number') ? [value] : [...(value as any).split(codelist.valueSeparator)];
values.map((value:any ,index: number)=>{
const item = this.getItem(items, value, codelist);
if(item){
result.push(item);
}
});
}
// 设置items
if(result.length != 0){
return result.join(codelist.valueSeparator);
}else{
return value;
}
}
}
/**
* 获取代码项
*
* @private
* @param {any[]} items
* @param {*} value
* @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
private getItem(items: any[], value: any, codelist: any): any {
const arr: Array<any> = items.filter(item => {return item.value == value});
if (arr.length !== 1) {
return undefined;
}
if(Object.is(codelist.codelistType,'STATIC')){
return this.$t('codelist.'+codelist.srfkey+'.'+arr[0].value);
}else{
return arr[0].text;
}
}
/**
* 生命周期
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected created(): void {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected afterCreated(){
this.setColState();
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
if (Object.is('load', action)) {
this.load(data);
}
if (Object.is('remove', action)) {
this.remove(data);
}
if (Object.is('save', action)) {
this.save(data);
}
});
}
}
/**
* vue 生命周期
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
<#if destroyed_block??>
${destroyed_block}
</#if>
}
/**
* 获取选中行胡数据
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected getSelection(): any[] {
return this.selections;
}
/**
* 行双击事件
*
* @param {*} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected rowDBLClick($event: any): void {
if (!$event || this.actualIsOpenEdit || Object.is(this.gridRowActiveMode,0)) {
return;
}
this.selections = [];
this.selections.push(JSON.parse(JSON.stringify($event)));
const refs: any = this.$refs;
if (refs.multipleTable) {
refs.multipleTable.clearSelection();
refs.multipleTable.toggleRowSelection($event);
}
this.$emit('rowdblclick', this.selections);
this.$emit('selectionchange', this.selections);
}
/**
* 复选框数据选中
*
* @param {*} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected select($event: any): void {
if (!$event) {
return;
}
this.selections = [];
this.selections = [...JSON.parse(JSON.stringify($event))];
this.$emit('selectionchange', this.selections);
}
/**
* 复选框数据全部选中
*
* @param {*} $event
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected selectAll($event: any): void {
if (!$event) {
return;
}
this.selections = [];
this.selections = [...JSON.parse(JSON.stringify($event))];
this.$emit('selectionchange', this.selections);
}
/**
* 行单击选中
*
* @param {*} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected rowClick($event: any, ifAlways: boolean = false): void {
if (!ifAlways && (!$event || this.actualIsOpenEdit)) {
return;
}
if(this.stopRowClick) {
this.stopRowClick = false;
return;
}
if(this.isSingleSelect){
this.selections = [];
}
// 已选中则删除,没选中则添加
let selectIndex = this.selections.findIndex((item:any)=>{
return Object.is(item.${ctrl.getPSDataEntity().getName()?lower_case},$event.${ctrl.getPSDataEntity().getName()?lower_case});
});
if (Object.is(selectIndex,-1)){
this.selections.push(JSON.parse(JSON.stringify($event)));
} else {
this.selections.splice(selectIndex,1);
}
const refs: any = this.$refs;
if (refs.multipleTable) {
if(this.isSingleSelect){
refs.multipleTable.clearSelection();
refs.multipleTable.setCurrentRow($event);
}else{
refs.multipleTable.toggleRowSelection($event);
}
}
this.$emit('selectionchange', this.selections);
}
/**
* 页面变化
*
* @param {*} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected pageOnChange($event: any): void {
if (!$event) {
return;
}
if ($event === this.curPage) {
return;
}
this.curPage = $event;
this.load({});
}
/**
* 分页条数变化
*
* @param {*} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected onPageSizeChange($event: any): void {
if (!$event) {
return;
}
if ($event === this.limit) {
return;
}
this.limit = $event;
if (this.curPage === 1) {
this.load({});
}
}
/**
* 分页刷新
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected pageRefresh(): void {
this.load({});
}
/**
* 排序变化
*
* @param {{ column: any, prop: any, order: any }} { column, prop, order }
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected onSortChange({ column, prop, order }: { column: any, prop: any, order: any }): void {
const dir = Object.is(order, 'ascending') ? 'asc' : Object.is(order, 'descending') ? 'desc' : '';
if (Object.is(dir, this.minorSortDir) && Object.is(this.minorSortPSDEF, prop)) {
return;
}
this.minorSortDir = dir;
this.minorSortPSDEF = prop ? prop : '';
this.load({});
}
/**
* 表格行选中样式
*
* @param {{ row: any, rowIndex: any }} { row, rowIndex }
* @returns {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected onRowClassName({ row, rowIndex }: { row: any, rowIndex: any }): string {
const index = this.selections.findIndex((select: any) => Object.is(select.srfkey, row.srfkey));
return index !== -1 ? 'grid-row-select' : '';
}
<#if ctrl.getAggMode() != "NONE">
/**
* 合计行绘制
*
* @param {any} param
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected getSummaries(param:any){
<#if ctrl.getAggMode() == "PAGE">
const { columns, data } = param;
const sums:Array<any> = [];
columns.forEach((column:any, index:number) => {
if (index === 0) {
sums[index] = '合计';
return;
}
if(index === (columns.length - 1)){
sums[index] = '';
return;
}
const values = data.map((item:any) => Number(item[column.property]));
if (!values.every((value:any) => isNaN(value))) {
<#if ctrl.getPSDEGridColumns()??>
<#list ctrl.getPSDEGridColumns() as singleColumn>
<#if singleColumn.getAggMode() == "SUM">
if(Object.is(column.property,'${singleColumn.getCodeName()?lower_case}')){
let tempData = values.reduce((prev:any, curr:any) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] = tempData;
}
<#elseif singleColumn.getAggMode() == "AVG">
if(Object.is(column.property,'${singleColumn.getCodeName()?lower_case}')){
let tempData = values.reduce((prev:any, curr:any) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] = tempData/data.length;
}
<#elseif singleColumn.getAggMode() == "MAX">
if(Object.is(column.property,'${singleColumn.getCodeName()?lower_case}')){
let tempData:any;
values.forEach((item:any) =>{
const value = Number(item);
if (!isNaN(value)) {
if(!tempData){
tempData = value;
}
if(value > tempData){
tempData = value;
}
}
});
sums[index] = tempData;
}
<#elseif singleColumn.getAggMode() == "MIN">
if(Object.is(column.property,'${singleColumn.getCodeName()?lower_case}')){
let tempData:any;
values.forEach((item:any) =>{
const value = Number(item);
if (!isNaN(value)) {
if(!tempData){
tempData = value;
}
if(value < tempData){
tempData = value;
}
}
});
sums[index] = tempData;
}
</#if>
</#list>
</#if>
} else {
sums[index] = 'N/A';
}
});
return sums;
<#elseif ctrl.getAggMode() == "ALL">
const { columns } = param;
const sums:Array<any> = [];
columns.forEach((column:any, index:number) => {
if (index === 0) {
sums[index] = '合计';
return;
}else if(index === (columns.length - 1)){
sums[index] = '';
return;
}else{
<#if ctrl.getPSDEGridColumns()??>
sums[index] = 'N/A';
<#list ctrl.getPSDEGridColumns() as singleColumn>
<#if singleColumn.getAggMode() != "NONE">
if(Object.is(column.property,'${singleColumn.getCodeName()?lower_case}')){
const value = Number(this.remoteData.${singleColumn.getCodeName()?lower_case});
if (!isNaN(value)) {
<#if singleColumn.getAggMode() == "SUM">
sums[index] = value;
<#elseif singleColumn.getAggMode() == "AVG">
sums[index] = value;
<#elseif singleColumn.getAggMode() == "MAX">
sums[index] = value;
<#elseif singleColumn.getAggMode() == "MIN">
sums[index] = value;
</#if>
}
}
</#if>
</#list>
</#if>
}
});
return sums;
</#if>
}
</#if>
<#if ctrl.getAggMode() == "ALL">
/**
* 远程获取合计行数据
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected getAggData(){
this.service.getAggData(this.aggAction,JSON.parse(JSON.stringify(this.context)),this.showBusyIndicator).then((response:any) =>{
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
}
return;
}
this.remoteData = response.data;
this.isDisplay = true;
}).catch((response:any) =>{
if (response && response.status === 401) {
return;
}
this.remoteData = {};
this.isDisplay = true;
this.$Notice.error({ title: '错误', desc: response.errorMessage });
})
}
</#if>
/**
* 界面行为
*
* @param {*} row
* @param {*} tag
* @param {*} $event
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected uiAction(row: any, tag: any, $event: any) {
this.rowClick(row, true);
<#if ctrl.getPSAppViewLogics()??>
<#list ctrl.getPSAppViewLogics() as logic>
<#if logic.getPSAppViewUIAction().getPSUIAction()??>
<#assign action = logic.getPSAppViewUIAction().getPSUIAction()>
if(Object.is('${action.getUIActionTag()}', tag)) {
this.${logic.getName()}(row, tag, $event);
}
</#if>
</#list>
</#if>
}
/**
* 设置列状态
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected setColState() {
const _data: any = localStorage.getItem('${ctrl.getPSDataEntity().getName()?lower_case}_${ctrl.getCodeName()?lower_case}_${ctrl.name}');
if (_data) {
let columns = JSON.parse(_data);
columns.forEach((col: any) => {
let column = this.allColumns.find((item) => Object.is(col.name, item.name));
if (column) {
Object.assign(column, col);
}
});
}
}
/**
* 列变化
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected onColChange() {
localStorage.setItem('${ctrl.getPSDataEntity().getName()?lower_case}_${ctrl.getCodeName()?lower_case}_${ctrl.name}', JSON.stringify(this.allColumns));
}
/**
* 获取列状态
*
* @param {string} name
* @returns {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected getColumnState(name: string): boolean {
let column = this.allColumns.find((col: any) =>
Object.is(name, col.name)
);
return column.show ? true : false;
}
/**
* 保存
*
* @param {*} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected save(args: any[], params?: any, $event?: any, xData?: any): void {
let _this = this;
let promises:any = [];
_this.items.forEach((item:any)=>{
if(!item.rowDataState){
return;
} else if(Object.is(item.rowDataState, 'create')){
if(!this.createAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格createAction参数未配置' });
return;
}
Object.assign(item,{viewparams:this.viewparams});
promises.push(this.service.add(this.createAction, JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator));
}else if(Object.is(item.rowDataState, 'update')){
if(!this.updateAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格updateAction参数未配置' });
return;
}
Object.assign(item,{viewparams:this.viewparams});
<#if de??>
if(item.${appde.getCodeName()?lower_case}){
Object.assign(this.context,{${appde.getCodeName()?lower_case}:item.${appde.getCodeName()?lower_case}})
}
</#if>
promises.push(this.service.add(this.updateAction,JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator));
}
});
Promise.all(promises).then((response: any) => {
this.$emit('save', response);
}).catch((response: any) => {
this.$Notice.error({ title: '错误', desc: '系统异常' });
});
}
<#if ctrl.isEnableRowEdit()>
/**
* 新建行
*
* @param {*} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected newRow(args: any[], params?: any, $event?: any, xData?: any): void {
if(!this.loaddraftAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格loaddraftAction参数未配置' });
return;
}
let _this = this;
Object.assign(args[0],{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction, JSON.parse(JSON.stringify(this.context)), args[0], this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
}
return;
}
const data = response.data;
data.rowDataState = "create";
_this.items.push(data);
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
return;
}
});
}
/**
* 表格编辑项值变更
*
* @param row 行数据
* @param {{ name: string, value: any }} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected onGridItemValueChange(row: any,$event: { name: string, value: any }): void {
if (!$event) {
return;
}
if (!$event.name || Object.is($event.name, '') || !row.hasOwnProperty($event.name)) {
return;
}
row[$event.name] = $event.value;
this.gridEditItemChange(row, $event.name, $event.value);
}
/**
* 表格编辑项值变化
*
* @private
* @param row 行数据
* @param property 列编辑项名
* @param row 列编辑项值
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected gridEditItemChange(row: any, property: string, value: any){
row.rowDataState = row.rowDataState ? row.rowDataState : "update" ;
<#if ctrl.getPSDEGridEditItems()??>
<#list ctrl.getPSDEGridEditItems() as editItem>
<#if editItem.getPSDEGridEditItemUpdate()??>
<#assign itemUpdate=editItem.getPSDEGridEditItemUpdate()/>
if(Object.is(property, '${editItem.name}')){
const details: string[] = [<#list itemUpdate.getPSDEGEIUpdateDetails() as detail><#if detail_index gt 0>, </#if>'${detail.getPSDEGridColumnName()?lower_case}'</#list>];
this.updateGridEditItem('${itemUpdate.codeName}', row, details, ${itemUpdate.isShowBusyIndicator()?c});
}
</#if>
</#list>
</#if>
}
/**
* 表格编辑项更新
*
* @param {string} mode 界面行为名称
* @param {*} [data={}] 请求数据
* @param {string[]} updateDetails 更新项
* @param {boolean} [showloading] 是否显示加载状态
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected updateGridEditItem(mode: string, data: any = {}, updateDetails: string[], showloading?: boolean): void {
if (!mode || (mode && Object.is(mode, ''))) {
return;
}
const arg: any = JSON.parse(JSON.stringify(data));
Object.assign(arg,{viewparams:this.viewparams});
const post: Promise<any> = this.service.frontLogic(mode,JSON.parse(JSON.stringify(this.context)),arg, showloading);
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '表单项更新失败' });
return;
}
const _data: any = response.data;
if(!_data){
return;
}
updateDetails.forEach((name: string) => {
if (!_data.hasOwnProperty(name)) {
return;
}
data[name] = _data[name];
});
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
return;
}
});
}
</#if>
/**
* 获取对应行class
*
* @param {*} $args row 行数据,rowIndex 行索引
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected getRowClassName(args:{row: any,rowIndex: number}){
let isSelected = this.selections.some((item:any)=>{
return Object.is(item.${appde.getCodeName()?lower_case},args.row.${appde.getCodeName()?lower_case});
});
return isSelected ? "grid-selected-row" : "";
}
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL-BASE.style.ftl
</#ibizinclude>
\ No newline at end of file
CTRLTYPE=GRID#GRIDEX
\ No newline at end of file
<div class="view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card<#if !view.isShowCaptionBar()> view-no-caption</#if>' :disHover="true" :padding="0" :bordered="false">
<#ibizinclude>
./VIEW_CAPTION.vue.ftl
</#ibizinclude>
<#if view.hasPSControl('toolbar')>
<#assign toolbarCtrl = view.getPSControl('toolbar')>
<@ibizindent blank=8>
${P.getCtrlCode(toolbarCtrl, 'CONTROL.html').code}
</@ibizindent>
</#if>
<div class="content-container">
<#assign view_content>
<#if view.getPSControls()??>
<#list view.getPSControls() as ctrl>
<#if ctrl.getControlType() != "TOOLBAR">
......@@ -24,6 +10,7 @@ ${P.getCtrlCode(ctrl, 'CONTROL.html').code}
</#if>
</#list>
</#if>
</div>
</card>
</div>
\ No newline at end of file
</#assign>
<#ibizinclude>
./VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class="view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card<#if !view.isShowCaptionBar()> view-no-caption</#if>' :disHover="true" :padding="0" :bordered="false">
<#ibizinclude>
./VIEW_CAPTION.vue.ftl
</#ibizinclude>
<#if view.hasPSControl('toolbar')>
<#assign toolbarCtrl = view.getPSControl('toolbar')>
<@ibizindent blank=8>
${P.getCtrlCode(toolbarCtrl, 'CONTROL.html').code}
</@ibizindent>
</#if>
<div class="content-container">
<#if view.getAllPSControls()??>
<#list view.getAllPSControls() as ctrl>
<#if ctrl.getControlType() != "TOOLBAR">
<#if P.getCtrlCode(ctrl, 'CONTROL.html')??>
<#assign view_content>
<#if view.getAllPSControls()??>
<#list view.getAllPSControls() as ctrl>
<#if ctrl.getControlType() != "TOOLBAR">
<#if P.getCtrlCode(ctrl, 'CONTROL.html')??>
<@ibizindent blank=12>
${P.getCtrlCode(ctrl, 'CONTROL.html').code}
</@ibizindent>
</#if>
</#if>
</#list>
</#if>
</div>
</card>
</div>
\ No newline at end of file
</#if>
</#if>
</#list>
</#if>
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class="view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card<#if !view.isShowCaptionBar()> view-no-caption</#if> <#if !view.hasPSControl('toolbar')> view-no-toolbar</#if>' :disHover="true" :bordered="false">
<#ibizinclude>
./VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
<#if view.hasPSControl('toolbar')>
<@ibizindent blank=8>
<div slot="extra">
${P.getCtrlCode('toolbar', 'CONTROL.html').code}
</div>
</@ibizindent>
</#if>
<div class="content-container">
<#-- BEGIN:视图顶部视图消息 -->
<@ibizindent blank=8>
<#ibizinclude>
./View_Pos_Top_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图顶部视图消息 -->
<#assign view_content>
<#if view.hasPSControl('form')>
<@ibizindent blank=8>
${P.getCtrlCode('form', 'CONTROL.html').code}
</@ibizindent>
</#if>
<#-- BEGIN:视图底部视图消息 -->
<@ibizindent blank=8>
</#assign>
<#ibizinclude>
./View_Pos_Bottom_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图底部视图消息 -->
</div>
</card>
</div>
\ No newline at end of file
./VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class="view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card' :dis-hover="true" :bordered="false">
<#ibizinclude>
./VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
<#if view.hasPSControl('toolbar')>
<@ibizindent blank=8>
<p slot="extra" v-show="Object.is(this.selection.id, 'form')">
<row style='margin-bottom: 6px;'>
<div class='pull-right'>
${P.getCtrlCode('toolbar', 'CONTROL.html').code}
</div>
</row>
</p>
</@ibizindent>
</#if>
<div class="content-container">
<#assign view_content>
<#if view.hasPSControl('drtab')>
<@ibizindent blank=8>
${P.getCtrlCode('drtab', 'CONTROL.html').code}
</@ibizindent>
</#if>
</div>
</card>
</div>
</#assign>
<#ibizinclude>
./VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<#assign MDContent><#t>
<#if view.getViewType() == "DEGRIDVIEW9">
<#assign view_content>
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'CONTROL.html').code}
</#if>
<#if view.hasPSControl('grid')>
${P.getCtrlCode('grid', 'CONTROL.html').code}
</#if>
</#if>
<#-- BEGIN:快速搜索或工具栏存在 -->
<#if (view.isEnableQuickSearch() || view.hasPSControl('toolbar'))>
<row style='margin-bottom: 6px;'>
<#if view.isEnableQuickSearch()>
<i-input<#if view.hasPSControl('searchform')><#if view.isExpandSearchForm??> v-show="!isExpandSearchForm"</#if></#if> v-model="query" search enter-button @on-search="onSearch($event)" class='pull-left' style='max-width: 400px;margin-top:6px;' />
</#if>
<div class='pull-right'>
<#if view.hasPSControl('toolbar')>
<@ibizindent blank=8>
${P.getCtrlCode('toolbar', 'CONTROL.html').code}<#t>
</@ibizindent>
</#if>
</div>
</row>
</#if>
<#-- END:快速搜索或工具栏存在 -->
<#if view.getViewType() != "DEGRIDVIEW9">
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'CONTROL.html').code}
</#if>
<#if view.hasPSControl('grid')>
${P.getCtrlCode('grid', 'CONTROL.html').code}
</#if>
</#if>
</#assign>
<div class='view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card<#if !view.isShowCaptionBar()> view-no-caption</#if>' :dis-hover="true" :bordered="false">
<@ibizindent blank=8>
<#ibizinclude>
./VIEW_CAPTION.vue.ftl
</#ibizinclude>
</@ibizindent>
<div class='content-container'>
<#-- BEGIN:视图顶部视图消息 -->
<@ibizindent blank=12>
<#ibizinclude>
./View_Pos_Top_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图顶部视图消息 -->
<#-- BEGIN:视图内容 -->
<@ibizindent blank=12>
<#ibizinclude>
./VIEW_MD_CONTENT.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图内容 -->
<#-- BEGIN:视图底部视图消息 -->
<@ibizindent blank=12>
<#ibizinclude>
./View_Pos_Bottom_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图底部视图消息 -->
</div>
</card>
</div>
\ No newline at end of file
<#ibizinclude>
./VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<#if view.getPSSysCss?? && view.getPSSysCss()??>
<#assign styleName = view.getPSSysCss().getCssName()/>
</#if>
<#if styleName?? && styleName == "TopFullScreen">
<#assign isStyleName = true/>
<#else>
<#assign isStyleName = false/>
</#if>
<app-layout viewName="${view.getCodeName()?lower_case}" viewTitle="${view.getTitle()}"<#if view.isShowCaptionBar?? && (view.isShowCaptionBar() == false)> :isShowCaptionBar="false"</#if><#if !view.hasPSControl('toolbar')> :isShowToolbar="false"</#if> :className="{ 'view-container': true<#if !isStyleName>, 'default-mode-view': true</#if>, '${view.getViewType()?lower_case}': true, '${srffilepath2(view.getCodeName())}': true<#if view.getPSSysCss?? && view.getPSSysCss()??>, '${view.getPSSysCss().getCssName()}': true</#if> }"<#if !isStyleName> layoutMode="VIEW"</#if> :isShowUserInfo="isDefaultView()" :openMode="openMode" @close-view="closeView($event)">
<template slot="headerLeft">
<div class="view-header-left">
<#if isStyleName> <go-back-button v-if="isDefaultView()"/></#if>
<div class="view-caption" v-if="isDefaultView()">{{$t(model.srfCaption)}}</div>
<modal-breadcrumb v-if="isModalView()"/>
</div>
</template>
<#if view.hasPSControl('toolbar')>
<template slot="headerRight">
<div class="view-header-right">
<app-header-menus :toolbarModel="toolBarModels" @menu-click="toolbar_click($event)" mode="<#if isStyleName>view2<#else><#if header_menu_mode??>${header_menu_mode}<#else>view</#if></#if>" :openMode="openMode"<#if view.isEnableQuickSearch?? && view.isEnableQuickSearch()> :isEnableQuickSearch="true" v-model="query" @search="onSearch($event)"</#if>/>
</div>
</template>
</#if>
<template slot="content">
<div class="view-content-wrapper">
<#if view_content??>${view_content}</#if><#-- 视图内容变量:view_content -->
</div>
</template>
</app-layout>
\ No newline at end of file
<div class="view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card<#if !view.isShowCaptionBar()> view-no-caption</#if>' :dis-hover='true' :padding='0' :bordered='false'>
<#ibizinclude>
./VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
<div class="content-container">
<#assign view_content>
<@ibizindent blank=12>
<#if view.hasPSControl('wizardpanel')>
${P.getCtrlCode('wizardpanel', 'CONTROL.html').code}
</#if>
</@ibizindent>
</div>
</card>
</div>
\ No newline at end of file
</#assign>
<#ibizinclude>
./VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class='view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card<#if !view.isShowCaptionBar()> view-no-caption</#if>' :dis-hover="true" :bordered="false">
<#ibizinclude>
../@MACRO/VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
<#if view.hasPSControl('toolbar')>
<@ibizindent blank=8>
<p slot="extra">
${P.getCtrlCode('toolbar', 'CONTROL.html').code}
</p>
</@ibizindent>
<#assign view_content>
<#if view.hasPSControl('tabexppanel')>
${P.getCtrlCode('tabexppanel', 'CONTROL.html').code}
</#if>
<div class='content-container'>
<#ibizinclude>
../@MACRO/View_Pos_Top_Msgs.vue.ftl
</#ibizinclude>
<#if view.hasPSControl('tabexppanel')>
${P.getCtrlCode('tabexppanel', 'CONTROL.html').code}
</#if>
<#ibizinclude>
../@MACRO/View_Pos_Bottom_Msgs.vue.ftl
</#ibizinclude>
</div>
</card>
</div>
\ No newline at end of file
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class="view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card' :dis-hover="true" :bordered="false">
<#ibizinclude>
../@MACRO/VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
<div class="content-container">
<#if view.hasPSControl('listexpbar')>
${P.getCtrlCode('listexpbar', 'CONTROL.html').code}
</#if>
</div>
</card>
</div>
\ No newline at end of file
<#assign view_content>
<#if view.hasPSControl('listexpbar')>
${P.getCtrlCode('listexpbar', 'CONTROL.html').code}
</#if>
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class='view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card<#if !view.isShowCaptionBar()> view-no-caption</#if>' :bordered="false" :dis-hover="true" >
<#ibizinclude>
../@MACRO/VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
<div class='content-container'>
<#assign view_content>
<#assign MDContent>
<#comment><!--开始:快速搜索或工具栏存在--></#comment>
<#if (view.isEnableQuickSearch() || view.hasPSControl('toolbar'))>
<row style="margin-bottom:6px;">
<#if view.isEnableQuickSearch()>
<i-input<#if view.hasPSControl('searchform')><#if view.isExpandSearchForm??> v-show="!isExpandSearchForm"</#if></#if> v-model="query" search enter-button @on-search="onSearch($event)" class='pull-left' style='max-width: 400px;margin-top:6px;' />
</#if>
<div class='pull-right'>
<@ibizindent blank=8>
<#if view.hasPSControl('toolbar')>
${P.getCtrlCode('toolbar', 'CONTROL.html').code}
</#if>
</@ibizindent>
</div>
</row>
</#if>
<#comment><!--结束:快速搜索或工具栏存在--></#comment>
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'CONTROL.html').code}
......@@ -35,6 +12,7 @@ ${P.getCtrlCode('list', 'CONTROL.html').code}
<#ibizinclude>
../@MACRO/VIEW_MD_CONTENT.vue.ftl
</#ibizinclude>
</div>
</card>
</div>
\ No newline at end of file
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class='view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card view-no-caption' :bordered="false" :dis-hover="true" >
<div class='content-container'>
<#assign view_content>
<#assign MDContent>
<#comment><!--开始:快速搜索或工具栏存在--></#comment>
<#if (view.isEnableQuickSearch() || view.hasPSControl('toolbar'))>
<row style='margin-bottom: 6px;'>
<#if view.isEnableQuickSearch()>
<i-input<#if view.hasPSControl('searchform')><#if view.isExpandSearchForm??> v-show="!isExpandSearchForm"</#if></#if> v-model="query" search enter-button @on-search="onSearch($event)" class='pull-left' style='max-width: 400px;margin-top:6px;' />
</#if>
<div class='pull-right'>
<@ibizindent blank=16>
<#if view.hasPSControl('toolbar')>
${P.getCtrlCode('toolbar', 'CONTROL.html').code}
</#if>
</@ibizindent>
</div>
</row>
</#if>
<#comment><!--结束:快速搜索或工具栏存在--></#comment>
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'CONTROL.html').code}
......@@ -30,6 +12,7 @@ ${P.getCtrlCode('list', 'CONTROL.html').code}
<#ibizinclude>
../@MACRO/VIEW_MD_CONTENT.vue.ftl
</#ibizinclude>
</div>
</card>
</div>
\ No newline at end of file
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class="view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card' :dis-hover="true" :bordered="false">
<#ibizinclude>
../@MACRO/VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
<div class="content-container">
<#if view.hasPSControl('dataviewexpbar')>
${P.getCtrlCode('dataviewexpbar', 'CONTROL.html').code}
</#if>
</div>
</card>
</div>
\ No newline at end of file
<#assign view_content>
<#if view.hasPSControl('dataviewexpbar')>
${P.getCtrlCode('dataviewexpbar', 'CONTROL.html').code}
</#if>
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class='view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card<#if !view.isShowCaptionBar()> view-no-caption</#if>' :bordered="false" :dis-hover="true" >
<#ibizinclude>
../@MACRO/VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
<div class='content-container'>
<#assign MDContent>
<#comment><!--开始:快速搜索或工具栏存在--></#comment>
<#if (view.isEnableQuickSearch() || view.hasPSControl('toolbar'))>
<row style="margin-bottom:6px;">
<#if view.isEnableQuickSearch()>
<i-input<#if view.hasPSControl('searchform')><#if view.isExpandSearchForm??> v-show="!isExpandSearchForm"</#if></#if> v-model="query" search enter-button @on-search="onSearch($event)" class='pull-left' style='max-width: 400px;margin-top:6px;' />
</#if>
<div class='pull-right'>
<@ibizindent blank=8>
<#if view.hasPSControl('toolbar')>
${P.getCtrlCode('toolbar', 'CONTROL.html').code}
</#if>
</@ibizindent>
</div>
</row>
</#if>
<#comment><!--结束:快速搜索或工具栏存在--></#comment>
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'CONTROL.html').code}
</#if>
<#if view.hasPSControl('chart')>
${P.getCtrlCode('chart', 'CONTROL.html').code}
</#if>
</#assign>
<#ibizinclude>
../@MACRO/VIEW_MD_CONTENT.vue.ftl
</#ibizinclude>
</div>
</card>
</div>
\ No newline at end of file
../实体图表视图/VIEW.vue.ftl
</#ibizinclude>
\ No newline at end of file
<div class='view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card<#if !view.isShowCaptionBar()> view-no-caption</#if>' :bordered="false" :dis-hover="true" >
<#ibizinclude>
../@MACRO/VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
<div class='content-container'>
<#assign view_content>
<#assign MDContent>
<#comment><!--开始:快速搜索或工具栏存在--></#comment>
<#if (view.isEnableQuickSearch() || view.hasPSControl('toolbar'))>
<row style="margin-bottom:6px;">
<#if view.isEnableQuickSearch()>
<i-input<#if view.hasPSControl('searchform')><#if view.isExpandSearchForm??> v-show="!isExpandSearchForm"</#if></#if> v-model="query" search enter-button @on-search="onSearch($event)" class='pull-left' style='max-width: 400px;margin-top:6px;' />
</#if>
<div class='pull-right'>
<@ibizindent blank=8>
<#if view.hasPSControl('toolbar')>
${P.getCtrlCode('toolbar', 'CONTROL.html').code}
</#if>
</@ibizindent>
</div>
</row>
</#if>
<#comment><!--结束:快速搜索或工具栏存在--></#comment>
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'CONTROL.html').code}
</#if>
......@@ -35,6 +11,7 @@ ${P.getCtrlCode('chart', 'CONTROL.html').code}
<#ibizinclude>
../@MACRO/VIEW_MD_CONTENT.vue.ftl
</#ibizinclude>
</div>
</card>
</div>
\ No newline at end of file
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class="view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card' :dis-hover="true" :padding="0" :bordered="false">
<#assign view_content>
<div class="content-container pickup-view">
<div class="translate-contant">
<div class="center" :style="{width : !isShowButton ? '100%' : ''}">
<div class="center">
<#if view.hasPSControl('pickupviewpanel')>
<@ibizindent blank=20>
${P.getCtrlCode('pickupviewpanel', 'CONTROL.html').code}<#t>
</@ibizindent>
</#if>
</div>
<div v-if="isShowButton" class="translate-buttons">
<div class="translate-buttons">
<div class="buttons">
<i-button type="primary" :title="this.containerModel.view_rightbtn.text"
:disabled="this.containerModel.view_rightbtn.disabled"
......@@ -32,7 +30,7 @@
</i-button>
</div>
</div>
<div v-if="isShowButton" class="right">
<div class="right">
<div class="mpicker-select">
<div v-for="(item, index) in viewSelections" :key="index" :class="item._select ? 'select' : ''" @click="selectionsClick(item)" @dblclick="selectionsDBLClick(item)">
<span>{{item.srfmajortext}}</span>
......@@ -40,7 +38,7 @@
</div>
</div>
</div>
<card v-if="isShowButton" :dis-hover="true" :bordered="false" class="footer">
<card :dis-hover="true" :bordered="false" class="footer">
<row :style="{ textAlign: 'right' }">
<i-button type="primary" :disabled="this.viewSelections.length > 0 ? false : true" @click="onClickOk">{{this.containerModel.view_okbtn.text}}</i-button>
&nbsp;&nbsp;
......@@ -48,5 +46,7 @@
</row>
</card>
</div>
</card>
</div>
\ No newline at end of file
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class='view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card<#if !view.isShowCaptionBar()> view-no-caption</#if>' :dis-hover="true" :bordered="false">
<@ibizindent blank=8>
<#assign view_content>
<#assign MDContent>
<#if view.hasPSControl('searchform')>
<@ibizindent blank=12>
${P.getCtrlCode('searchform', 'CONTROL.html').code}<#t>
</@ibizindent>
</#if>
<#if view.hasPSControl('dataview')>
<@ibizindent blank=12>
${P.getCtrlCode('dataview', 'CONTROL.html').code}<#t>
</@ibizindent>
</#if>
</#assign>
<#ibizinclude>
../@MACRO/VIEW_CAPTION.vue.ftl
../@MACRO/VIEW_MD_CONTENT.vue.ftl
</#ibizinclude>
</@ibizindent>
<div class='content-container'>
<#assign MDContent>
<#comment><!--开始:快速搜索或工具栏存在--></#comment>
<#if (view.isEnableQuickSearch() || view.hasPSControl('toolbar'))>
<row style='margin-bottom: 6px;'>
<#if view.isEnableQuickSearch()>
<i-input placeholder='快速搜索框'<#if view.hasPSControl('searchform')><#if view.isExpandSearchForm??> v-show='!this.isExpandSearchForm '</#if></#if> v-model='query' search @on-search='onSearch' class='pull-left' style='max-width: 400px;margin-top:6px;' />
</#if>
<div class='pull-right'>
<@ibizindent blank=20>
<#if view.hasPSControl('toolbar')>
${P.getCtrlCode('toolbar', 'CONTROL.html').code}<#t>
</#if>
</@ibizindent>
</div>
</row>
</#if>
<#comment><!--结束:快速搜索或工具栏存在--></#comment>
<#if view.hasPSControl('searchform')>
<@ibizindent blank=12>
${P.getCtrlCode('searchform', 'CONTROL.html').code}<#t>
</@ibizindent>
</#if>
<#if view.hasPSControl('dataview')>
<@ibizindent blank=12>
${P.getCtrlCode('dataview', 'CONTROL.html').code}<#t>
</@ibizindent>
</#if>
</#assign>
<#ibizinclude>
../@MACRO/VIEW_MD_CONTENT.vue.ftl
</#ibizinclude>
</div>
</card>
</div>
\ No newline at end of file
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class='view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card view-no-caption' :dis-hover="true" :bordered="false">
<div class='content-container'>
<#assign view_content>
<#assign MDContent>
<#comment><!--开始:快速搜索或工具栏存在--></#comment>
<#if (view.isEnableQuickSearch() || view.hasPSControl('toolbar'))>
<row style='margin-bottom: 6px;'>
<#if view.isEnableQuickSearch()>
<i-input placeholder='快速搜索框'<#if view.hasPSControl('searchform')><#if view.isExpandSearchForm??> v-show='!this.isExpandSearchForm'</#if></#if> v-model='query' search @on-search='onSearch' class='pull-left' style='max-width: 400px;margin-top:6px;' />
</#if>
<div class='pull-right'>
<@ibizindent blank=8>
<#if view.hasPSControl('toolbar')>
${P.getCtrlCode('toolbar', 'CONTROL.html').code}
</#if>
</@ibizindent>
</div>
</row>
</#if>
<#comment><!--结束:快速搜索或工具栏存在--></#comment>
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'CONTROL.html').code}
</#if>
......@@ -30,6 +11,7 @@ ${P.getCtrlCode('dataview', 'CONTROL.html').code}
<#ibizinclude>
../@MACRO/VIEW_MD_CONTENT.vue.ftl
</#ibizinclude>
</div>
</card>
</div>
\ No newline at end of file
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class="view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card<#if !view.isShowCaptionBar()> view-no-caption</#if>' :dis-hover="true" :padding="0" :bordered="false">
<div class="content-container pickup-view">
<#assign view_content>
<#if view.hasPSControl('pickupviewpanel')>
<@ibizindent blank=12>
${P.getCtrlCode('pickupviewpanel', 'CONTROL.html').code}<#t>
......@@ -14,6 +11,7 @@
<i-button @click="onClickCancel">{{this.containerModel.view_cancelbtn.text}}</i-button>
</row>
</card>
</div>
</card>
</div>
\ No newline at end of file
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class="view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card' :dis-hover="true" :bordered="false">
<#ibizinclude>
../@MACRO/VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
<div class="content-container">
<#if view.hasPSControl('calendarexpbar')>
${P.getCtrlCode('calendarexpbar', 'CONTROL.html').code}
</#if>
</div>
</card>
</div>
\ No newline at end of file
<#assign view_content>
<#if view.hasPSControl('calendarexpbar')>
${P.getCtrlCode('calendarexpbar', 'CONTROL.html').code}
</#if>
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class='view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card<#if !view.isShowCaptionBar()> view-no-caption</#if>' :dis-hover="true" :bordered="false">
<@ibizindent blank=8>
<#ibizinclude>
../@MACRO/VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
</@ibizindent>
<#if view.hasPSControl('toolbar')>
<@ibizindent blank=8>
<p slot="extra">
${P.getCtrlCode('toolbar', 'CONTROL.html').code}
</p>
</@ibizindent>
<#assign view_content>
<#if view.hasPSControl('treeexpbar')>
<@ibizindent blank=12>
${P.getCtrlCode('treeexpbar', 'CONTROL.html').code}<#t>
</@ibizindent>
</#if>
<div class='content-container'>
<#-- BEGIN:视图顶部视图消息 -->
<@ibizindent blank=12>
<#ibizinclude>
../@MACRO/View_Pos_Top_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图顶部视图消息 -->
<#if view.hasPSControl('treeexpbar')>
<@ibizindent blank=12>
${P.getCtrlCode('treeexpbar', 'CONTROL.html').code}<#t>
</@ibizindent>
</#if>
<#-- BEGIN:视图底部视图消息 -->
<@ibizindent blank=12>
<#ibizinclude>
../@MACRO/View_Pos_Bottom_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图底部视图消息 -->
</div>
</card>
</div>
\ No newline at end of file
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class='view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card<#if !view.isShowCaptionBar()> view-no-caption</#if>' :dis-hover="true" :bordered="false">
<#ibizinclude>
../@MACRO/VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
<#if view.hasPSControl('toolbar')>
<@ibizindent blank=8>
<p slot="extra">
${P.getCtrlCode('toolbar', 'CONTROL.html').code}
</p>
</@ibizindent>
</#if>
<#assign view_content>
<#assign MDContent>
<#-- 搜索框: BEGIN -->
<#if (view.isEnableQuickSearch())>
<div class="search-contant">
<i-input search @on-change="($event) => { this.srfnodefilter = $event.target.value; }" @on-search="onSearch" class='pull-left'/>
</div>
</#if>
<#-- 搜索框: END -->
<#if view.hasPSControl('tree')>
<div class="tree-contant">
${P.getCtrlCode('tree', 'CONTROL.html').code}
......@@ -31,5 +10,7 @@ ${P.getCtrlCode('toolbar', 'CONTROL.html').code}
<#ibizinclude>
../@MACRO/VIEW_MD_CONTENT.vue.ftl
</#ibizinclude>
</card>
</div>
\ No newline at end of file
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class='view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card<#if !view.isShowCaptionBar()> view-no-caption</#if>' :dis-hover="true" :bordered="false">
<div class='content-container'>
<#assign MDContent>
<#-- 搜索框: BEGIN -->
<#if (view.isEnableQuickSearch())>
<div class="search-contant">
<i-input search @on-change="($event) => { this.srfnodefilter = $event.target.value; }" @on-search="onSearch" class='pull-left'/>
</div>
</#if>
<#-- 搜索框: END -->
<#if view.hasPSControl('tree')>
<div class="tree-contant">
${P.getCtrlCode('tree', 'CONTROL.html').code}
</div>
</#if>
</#assign>
<#assign view_content>
<#assign MDContent>
<#if view.hasPSControl('tree')>
<div class="tree-contant">
${P.getCtrlCode('tree', 'CONTROL.html').code}
</div>
</#if>
</#assign>
<#ibizinclude>
../@MACRO/VIEW_MD_CONTENT.vue.ftl
</#ibizinclude>
</div>
</card>
</div>
\ No newline at end of file
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class="view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card<#if !view.isShowCaptionBar()> view-no-caption</#if>' :disHover="true" :padding="0" :bordered="false">
<#ibizinclude>
../@MACRO/VIEW_CAPTION.vue.ftl
</#ibizinclude>
<#if view.hasPSControl('toolbar')>
<#assign toolbarCtrl = view.getPSControl('toolbar')>
<@ibizindent blank=8>
${P.getCtrlCode(toolbarCtrl, 'CONTROL.html').code}
</@ibizindent>
</#if>
<div class="content-container">
<#assign view_content>
<#if view.hasPSControl('form')>
<@ibizindent blank=8>
${P.getCtrlCode('form', 'CONTROL.html').code}
......@@ -29,6 +15,7 @@ ${P.getCtrlCode(ctrl, 'CONTROL.html').code}
</#if>
</#list>
</#if>
</div>
</card>
</div>
\ No newline at end of file
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class="view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card' :dis-hover="true" :bordered="false">
<#ibizinclude>
../@MACRO/VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
<#if view.hasPSControl('toolbar')>
<@ibizindent blank=8>
<p slot="extra" v-show="Object.is(this.selection.id, 'form')">
${P.getCtrlCode('toolbar', 'CONTROL.html').code}
</p>
</@ibizindent>
</#if>
<div class="content-container edit-view2">
<#assign view_content>
<#if view.hasPSControl('drbar')>
<@ibizindent blank=8>
${P.getCtrlCode('drbar', 'CONTROL.html').code}
</@ibizindent>
</#if>
</div>
</card>
</div>
\ No newline at end of file
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class="view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card' :dis-hover="true" :bordered="false">
<#ibizinclude>
../@MACRO/VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
<div class="content-container">
<#if view.hasPSControl('gridexpbar')>
${P.getCtrlCode('gridexpbar', 'CONTROL.html').code}
</#if>
</div>
</card>
</div>
\ No newline at end of file
<#assign view_content>
<#if view.hasPSControl('gridexpbar')>
<@ibizindent blank=8>
${P.getCtrlCode('gridexpbar', 'CONTROL.html').code}
</@ibizindent>
</#if>
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<#ibizinclude>
../@MACRO/GRID.vue.ftl
</#ibizinclude>
\ No newline at end of file
<#ibizinclude>
../@MACRO/GRID.vue.ftl
</#ibizinclude>
\ No newline at end of file
<#ibizinclude>
../@MACRO/GRID.vue.ftl
</#ibizinclude>
\ No newline at end of file
<#ibizinclude>
../@MACRO/GRID.vue.ftl
</#ibizinclude>
\ No newline at end of file
<div class='view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card<#if !view.isShowCaptionBar()> view-no-caption</#if>' :dis-hover="true" :bordered="false">
<#-- 不带数据信息标题 -->
<#if view.isShowCaptionBar()>
<p v-if="isShowButton" slot='title'>
<#if view.getPSSysImage()??>
<#assign viewimg = view.getPSSysImage()/>
<#if viewimg.getImagePath() != "">
<span class='caption-image'><i class='${viewimg.getCssClass()}'></i></span>
<#else>
<span class='caption-image'><img src='${viewimg.getImagePath()}'/></span>
</#if>
</#if>
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
</p>
</#if>
<div class='content-container'>
<#-- 搜索框: BEGIN -->
<#if (view.isEnableQuickSearch())>
<div class="search-contant">
<i-input search @on-change="($event) => { this.srfnodefilter = $event.target.value; }" @on-search="onSearch" class='pull-left'/>
</div>
</#if>
<#-- 搜索框: END -->
<@ibizindent blank=16>
<#if view.hasPSControl('tree')>
<div class="tree-contant">
${P.getCtrlCode('tree', 'CONTROL.html').code}<#t>
</div>
</#if>
</@ibizindent>
</div>
</card>
</div>
\ No newline at end of file
<#assign view_content>
<@ibizindent blank=8>
<#if view.hasPSControl('tree')>
<div class="tree-contant">
${P.getCtrlCode('tree', 'CONTROL.html').code}<#t>
</div>
</#if>
</@ibizindent>
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class='view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card view-no-caption' :dis-hover="true" :bordered="false">
<div class='content-container pickup-grid-view'>
<#assign view_content>
<@ibizindent blank=12>
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'CONTROL.html').code}<#t>
......@@ -10,6 +7,7 @@
${P.getCtrlCode('grid', 'CONTROL.html').code}<#t>
</#if>
</@ibizindent>
</div>
</card>
</div>
\ No newline at end of file
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class="view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<#assign view_content>
<app-studioaction viewTitle="${view.getTitle()}" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card<#if !view.isShowCaptionBar()> view-no-caption</#if>' dis-hover :padding="0" :bordered="false">
<@ibizindent blank=8>
<#ibizinclude>
......@@ -21,4 +21,7 @@
</row>
</card>
</card>
</div>
\ No newline at end of file
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
<div class='view-container ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card' dis-hover :bordered="false">
<#ibizinclude>
../@MACRO/VIEW_CAPTION.vue.ftl
</#ibizinclude>
<div class='content-container'>
<div class='view-top-messages'>
</div>
<#assign view_content>
<@ibizindent blank=12>
<#if view.hasPSControl('dashboard')>
${P.getCtrlCode('dashboard', 'CONTROL.html').code}
</#if>
</@ibizindent>
<div class='view-bottom-messages'>
</div>
</div>
</card>
</div>
\ No newline at end of file
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
.app-container {
position: absolute;
width: 100vw;
height: 100vh;
top: 0;
left: 0;
right: 0;
bottom: 0;
.index_view.crm-app-layout {
.app-header-left {
height: 100%;
display: flex;
align-items: center;
>img {
margin: 0px 6px;
margin-top: 2px;
height: 32px;
}
>.app-name {
font-size: 18px;
font-weight: 900;
color: black;
height: 32px;
line-height: 32px;
white-space: nowrap;
font-family: AlibabaPuHuiTiB, "Alibaba PuHuiTi";
}
}
.app-header-right {
height: 100%;
}
.crm-app-content {
height: 100%;
width: 100%;
}
/*** BRGIN:滚动条样式 ***/
::-webkit-scrollbar {
background: transparent;
width: 4px;
height: 4px;
}
::-webkit-scrollbar-thumb {
border-radius: 0;
box-shadow: none;
border: 0;
background-color: #cecece;
}
::-webkit-scrollbar-track {
border-radius: 0;
box-shadow: none;
border: 0;
}
}
}
\ No newline at end of file
<app-layout className={{ index_view: true }} v-show={isIndexRoot}>
<template slot="headerLeft">
<div class="app-header-left">
<img class="logo" src="./assets/img/logo.png" />
<div class="app-name">{this.$t(this.model.srfCaption)}</div>
</div>
</template>
<template slot="headerRight">
<div class="app-header-right">
<app-header-menus />
</div>
</template>
<template slot="content">
<div class="crm-app-content">
<div class="inedx-app-menus">
${P.getCtrlCode('appmenu', 'CONTROL.html').code}
</div>
<div class="content">内容</div>
</div>
</template>
</app-layout>
\ No newline at end of file
CTRLTYPE=VIEWLAYOUTPANEL#INDEXTOPNAV
\ No newline at end of file
<#ibizinclude>
../@MACRO/DEFAULT.less.ftl
</#ibizinclude>
.app-container {
position: absolute;
width: 100vw;
height: 100vh;
top: 0;
left: 0;
right: 0;
bottom: 0;
.index_view{
width: 100%;
height: 100%;
padding: 0;
margin: 0;
.index_header{
height:50px;
padding:0 20px;
display: flex;
align-items: center;
justify-content: space-between;
.page-logo{
display: flex;
align-items: center;
}
.header-left{
.index_view.crm-app-layout {
.app-header-left {
height: 100%;
display: flex;
align-items: center;
justify-content: space-between;
.el-menu.el-menu--horizontal{
border-bottom: none;
.el-submenu{
border-top: none;
}
>img {
margin: 0px 6px;
margin-top: 2px;
height: 32px;
}
>.app-name {
font-size: 18px;
font-weight: 900;
color: black;
height: 32px;
line-height: 32px;
white-space: nowrap;
font-family: AlibabaPuHuiTiB, "Alibaba PuHuiTi";
}
}
> div {
line-height: 49px;
.app-header-right {
height: 100%;
}
}
.index_content{
background-color:#fff;
height:calc(100vh - 50px);
overflow-x: hidden;
overflow-y: hidden;
}
>.ivu-layout {
>.ivu-layout {
height: calc(100vh - 50px);
.crm-app-content {
height: 100%;
width: 100%;
display: flex;
>.inedx-app-menus {
width: 240px;
height: 100%;
background-color: white;
flex-shrink: 0;
overflow-y: auto;
}
>.content {
flex-grow: 1;
}
}
}
.ivu-layout .ivu-layout-sider .ivu-layout-sider-children .sider-top{
line-height: 58px;
text-align: right;
padding-right: 18px;
}
.ivu-layout .ivu-layout-sider .ivu-layout-sider-children .sider-top .ivu-icon{
font-size: 20px;
padding: 4px;
margin-top: -2px;
cursor: pointer;
}
}
/*** BRGIN:滚动条样式 ***/
::-webkit-scrollbar {
background: transparent;
width: 4px;
height: 4px;
}
::-webkit-scrollbar-thumb {
border-radius: 0;
box-shadow: none;
border: 0;
background-color: #cecece;
}
::-webkit-scrollbar-track {
border-radius: 0;
box-shadow: none;
border: 0;
/*** BRGIN:滚动条样式 ***/
::-webkit-scrollbar {
background: transparent;
width: 4px;
height: 4px;
}
::-webkit-scrollbar-thumb {
border-radius: 0;
box-shadow: none;
border: 0;
background-color: #cecece;
}
::-webkit-scrollbar-track {
border-radius: 0;
box-shadow: none;
border: 0;
}
}
}
\ No newline at end of file
<#if view.isBlankMode()>
<div class="index_view ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-keep-alive :routerList="getRouterList">
<router-view :key="getRouterViewKey"></router-view>
</app-keep-alive>
</div>
<#else>
<#if view.getMainMenuAlign()=="LEFT" || view.getMainMenuAlign()=="">
<div class="index_view ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<layout :class="themeClasses" :style="themeStyle">
<header class="index_header">
<div class="header-left" >
<div class="page-logo">
<#if view.getAppIconPath() != "">
<img src="${view.getAppIconPath()}" height="32">
<#else>
<img src="../../../assets/img/logo.png" height="32" />
</#if>
<span style="display: inline-block;margin-left: 10px;font-size: 22px;">{{$t(model.srfCaption)}}</span>
</div>
<app-layout viewName="${view.getCodeName()?lower_case}" viewTitle="${view.getTitle()}" className={{ index_view: true }}>
<template slot="headerLeft">
<div class="app-header-left">
<img class="logo" src="./assets/img/logo.png" />
<div class="app-name">{this.$t(this.model.srfCaption)}</div>
</div>
</template>
<template slot="headerRight">
<div class="app-header-right">
<app-header-menus menus={this.topMenus} on-menu-click={(e: any) => this.topMenuClick(e)}/>
</div>
</template>
<template slot="content">
<div class="crm-app-content">
<div class="inedx-app-menus">
${P.getCtrlCode('appmenu', 'CONTROL.html').code}
</div>
<div class="header-right" style="display: flex;align-items: center;justify-content: space-between;">
<app-header-menus />
<app-lang style='font-size: 15px;padding: 0 10px;'></app-lang>
<app-orgsector></app-orgsector>
<app-user></app-user>
<app-theme style="width:45px;display: flex;justify-content: center;"></app-theme>
<div class="content" style="width: calc(100% - 240px)">
<router-view></router-view>
</div>
</header>
<layout>
<#if view.hasPSControl('appmenu')>
<sider :width="collapseChange ? 64 : 200" hide-trigger v-model="collapseChange">
<div class="sider-top">
<i class="ivu-icon ivu-icon-md-menu" @click="handleClick"></i>
</div>
${P.getCtrlCode('appmenu', 'CONTROL.html').code}
</sider>
<content class="index_content" :style="{'width':this.collapseChange ? 'calc(100vw - 64px)' : 'calc(100vw - 200px)' }">
<tab-page-exp></tab-page-exp>
<app-keep-alive :routerList="getRouterList">
<router-view :key="getRouterViewKey"></router-view>
</app-keep-alive>
</content>
<#else>
<content style="width: 100vw;height: calc(100vh - 50px);">
<tab-page-exp></tab-page-exp>
<app-keep-alive :routerList="getRouterList">
<router-view :key="getRouterViewKey"></router-view>
</app-keep-alive>
</content>
</#if>
</layout>
</layout>
</div>
<#else>
<div class="index_view <#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<layout :class="themeClasses" :style="themeStyle">
<header class="index_header" >
<div class="header-left">
<div class="page-logo">
<img src="../../../assets/img/logo.png" height="32" />
<span style="display: inline-block;margin-left: 10px;font-size: 22px;">{{$t(model.srfCaption)}}</span>
</div>
<div style="margin-left: 50px;">
${P.getCtrlCode('appmenu', 'CONTROL.html').code}
</div>
</div>
<div class="header-right" style="display: flex;align-items: center;justify-content: space-between;">
<app-header-menus />
<app-lang style='font-size: 15px;padding: 0 10px;'></app-lang>
<app-orgsector></app-orgsector>
<app-user></app-user>
<app-theme style="width:45px;display: flex;justify-content: center;"></app-theme>
</div>
</header>
<content style="height:calc(100vh - 50px);">
<router-view></router-view>
</content>
</layout>
</div>
</#if>
</#if>
</div>
</template>
</app-layout>
\ No newline at end of file
......@@ -10,11 +10,9 @@
if(this.formDruipart){
this.formDruipart.subscribe((res:any) =>{
if(Object.is(res.action,'save')){
this.viewState.next({ tag:'grid', action: 'save', data: this.viewparams });
}
if(Object.is(res.action,'load')){
const _this: any = this;
_this.engine.load(res.data,true);
let opt ={data:res.data};
Object.assign(opt,this.context);
this.viewState.next({ tag:'grid', action: 'save', data: opt });
}
});
}
......@@ -28,6 +26,7 @@ if(this.formDruipart){
<#assign grid = view.getPSControl('grid')>
</#if>
<#if grid??>
/**
* 是否单选
*
......@@ -38,12 +37,24 @@ if(this.formDruipart){
</#if>
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}Base
*/
@Prop({default:false}) public isformDruipart?: boolean;
* Vue声明周期
*
* @memberof ViewBase
*/
public created() {
super.created();
if(this.formDruipart){
this.formDruipart.subscribe((res:any) =>{
if(Object.is(res.action,'save')){
this.viewState.next({ tag:'grid', action: 'save', data: this.viewparams });
}
if(Object.is(res.action,'load')){
const _this: any = this;
_this.engine.load(res.data,true);
}
});
}
}
/**
* 界面关系通讯对象
......@@ -90,7 +101,7 @@ if(this.formDruipart){
<#if grid??>
const grid: any = this.$refs.${grid.name};
if (grid) {
grid.load(this.context, true);
grid.load(this.context);
}
</#if>
}
......
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import ${srfclassname('${view.name}')}Base from './${srffilepath2(view.name)}-base.vue';
import ${srfclassname(view.name)}Base from './${srffilepath2(view.name)}-base.vue';
<#if view.getPSControls()??>
<#list view.getPSControls() as ctrl>
<#if ctrl.getControlType?? && ctrl.getControlType() != 'TOOLBAR' && ctrl.getControlType() != 'CONTEXTMENU'>
<#if ctrl.getControlType() != 'TOOLBAR' && ctrl.getControlType() != 'CONTEXTMENU'>
<#if ctrl.getPSAppDataEntity?? && ctrl.getPSAppDataEntity()??>
import view_${ctrl.getName()} from '@widgets/${srffilepath2(ctrl.getPSAppDataEntity().getCodeName())}/${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}/${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}.vue';
import view_${ctrl.getName()} from '@widgets/${srffilepath2(view.getPSAppDataEntity().getCodeName())}/${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}/${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}.vue';
<#else>
import view_${ctrl.getName()} from '@widgets/app/${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}/${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}.vue';
</#if>
</#if>
</#list>
</#if>
/**
* ${view.getTitle()}
*
* @export
* @class ${srfclassname(view.name)}
* @extends {${srfclassname(view.name)}Base}
*/
@Component({
components: {
<#if view.getPSControls?? && view.getPSControls()??>
<#if view.getPSControls()??>
<#list view.getPSControls() as ctrl>
<#if ctrl.getControlType() != "TOOLBAR">
view_${ctrl.getName()},
......@@ -29,7 +37,5 @@ import view_${ctrl.getName()} from '@widgets/app/${srffilepath2(ctrl.getCodeName
});
},
})
export default class ${srfclassname('${view.name}')} extends ${srfclassname('${view.name}')}Base {
}
export default class ${srfclassname(view.name)} extends ${srfclassname(view.name)}Base { }
</script>
\ No newline at end of file
......@@ -7,21 +7,38 @@
/**
* 视图引擎
*
* @private
* @protected
* @type {Engine}
* @memberof ${srfclassname('${view.name}')}Base
*/
private ${engine.getName()?lower_case}: ${engine.getEngineType()}Engine = new ${engine.getEngineType()}Engine();
protected ${engine.getName()?lower_case}: ${engine.getEngineType()}Engine = new ${engine.getEngineType()}Engine();
</#list>
</#if>
<#if view.getPSDER1N?? && view.getPSDER1N()??>
/**
* 处理指定视图控制关系将父键转为父实体上下文
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public handleviewRes(){
<#assign viewRes = view.getPSDER1N()/>
<#if viewRes.getMajorPSDataEntity()??>
<#assign majorAppDataEntity = viewRes.getMajorPSDataEntity() />
if(this.context.srfparentkey){
Object.assign(this.context,{'${majorAppDataEntity.getCodeName()?lower_case}':this.context.srfparentkey});
}
</#if>
}
</#if>
/**
* 引擎初始化
*
* @private
* @protected
* @memberof ${srfclassname('${view.name}')}Base
*/
private engineInit(): void {
protected engineInit(): void {
<#if view.getPSAppViewEngines()??>
<#list view.getPSAppViewEngines() as engine>
this.${engine.getName()?lower_case}.init({
......@@ -29,8 +46,8 @@
<#if engine.getPSAppViewEngineParams()??>
<#list engine.getPSAppViewEngineParams() as param>
<#if param.getParamType() == "LOGIC" && param.getPSAppViewLogic()??>
${param.getName()?lower_case}: (args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) => {
this.${param.getPSAppViewLogic().getName()}(args,fullargs, params, $event, xData);
${param.getName()?lower_case}: (args: any[], params?: any, $event?: any, xData?: any) => {
this.${param.getPSAppViewLogic().getName()}(args, params, $event, xData);
},
</#if>
<#if param.getParamType() == "CTRL" && param.getPSControl()??>
......@@ -41,7 +58,7 @@
</#if>
</#list>
</#if>
<#if de??>
<#if appde??>
keyPSDEField: '${appde.getCodeName()?lower_case}',
<#if appde.getMajorPSAppDEField()??>
majorPSDEField: '${appde.getMajorPSAppDEField().getCodeName()?lower_case}',
......@@ -53,220 +70,6 @@
</#if>
}
/**
* 应用上下文
*
* @type {*}
* @memberof ${srfclassname('${view.name}')}Base
*/
protected context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof ${srfclassname('${view.name}')}Base
*/
protected viewparams:any = {};
/**
* 解析视图参数
*
* @private
* @memberof ${srfclassname('${view.name}')}Base
*/
private parseViewParam(): void {
for(let key in this.context){
delete this.context[key];
}
if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
Object.assign(this.context, JSON.parse(this.viewdata));
if(this.context && this.context.srfparentdename){
Object.assign(this.viewparams,{srfparentdename:this.context.srfparentdename});
}
if(this.context && this.context.srfparentkey){
Object.assign(this.viewparams,{srfparentkey:this.context.srfparentkey});
}
this.handleCustomViewData();
<#if self_viewparam??>
${self_viewparam}
</#if>
return;
}
const path = (this.$route.matched[this.$route.matched.length - 1]).path;
const keys: Array<any> = [];
const curReg = this.$pathToRegExp.pathToRegexp(path, keys);
const matchArray = curReg.exec(this.$route.path);
let tempValue: Object = {};
keys.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item.name, {
enumerable: true,
value: matchArray[index + 1]
});
});
this.$viewTool.formatRouteParams(tempValue,this.$route,this.context,this.viewparams);
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
<#if view.isPSDEView()>
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
</#if>
this.handleCustomViewData();
}
/**
* 处理自定义视图数据
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public handleCustomViewData(){
<#if view.getPSDER1N?? && view.getPSDER1N()??>
this.handleviewRes();
</#if>
if(Object.keys(this.customViewNavContexts).length > 0){
Object.keys(this.customViewNavContexts).forEach((item:any) =>{
let tempContext:any = {};
let curNavContext:any = this.customViewNavContexts[item];
this.handleCustomDataLogic(curNavContext,tempContext,item);
Object.assign(this.context,tempContext);
})
}
if(Object.keys(this.customViewParams).length > 0){
Object.keys(this.customViewParams).forEach((item:any) =>{
let tempParam:any = {};
let curNavParam:any = this.customViewParams[item];
this.handleCustomDataLogic(curNavParam,tempParam,item);
Object.assign(this.viewparams,tempParam);
})
}
}
/**
* 处理自定义视图数据逻辑
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public handleCustomDataLogic(curNavData:any,tempData:any,item:string){
// 直接值直接赋值
if(curNavData.isRawValue){
if(Object.is(curNavData.value,"null") || Object.is(curNavData.value,"")){
Object.defineProperty(tempData, item, {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item, {
value: curNavData.value,
writable : true,
enumerable : true,
configurable : true
});
}
}else{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if(this.context[curNavData.value]){
Object.defineProperty(tempData, item, {
value: this.context[curNavData.value],
writable : true,
enumerable : true,
configurable : true
});
}else{
if(this.viewparams[curNavData.value]){
Object.defineProperty(tempData, item, {
value: this.viewparams[curNavData.value],
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item, {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}
}
}
}
<#if view.getPSDER1N?? && view.getPSDER1N()??>
/**
* 处理指定视图控制关系将父键转为父实体上下文
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public handleviewRes(){
<#assign viewRes = view.getPSDER1N()/>
<#if viewRes.getMajorPSDataEntity()??>
<#assign majorAppDataEntity = viewRes.getMajorPSDataEntity() />
if(this.context.srfparentkey){
Object.assign(this.context,{'${majorAppDataEntity.getCodeName()?lower_case}':this.context.srfparentkey});
}
</#if>
}
</#if>
/**
* Vue声明周期
*
* @memberof ${srfclassname('${view.name}')}Base
*/
protected created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof ${srfclassname('${view.name}')}Base
*/
protected afterCreated(){
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
<#if created_block??>${created_block}</#if>
}
/**
* 销毁之前
*
* @memberof ${srfclassname('${view.name}')}Base
*/
protected beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof ${srfclassname('${view.name}')}Base
*/
protected mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof ${srfclassname('${view.name}')}Base
*/
protected afterMounted(){
const _this: any = this;
<#if view.getPSAppViewEngines()??>
_this.engineInit();
</#if>
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
<#if mounted_block??>${mounted_block}</#if>
}
<#if view.getPSControls()??>
<#list view.getPSControls() as ctrl>
<#if ctrl.getControlType()??>
......@@ -280,7 +83,7 @@
* @param {*} $event
* @memberof ${srfclassname('${view.name}')}Base
*/
protected ${ctrl.name}_${eventName?lower_case}($event: any, $event2?: any) {
public ${ctrl.name}_${eventName?lower_case}($event: any, $event2?: any) {
<#if ctrl.getPSControlLogics(eventName)??>
<#list ctrl.getPSControlLogics(eventName) as ctrlLogic>
<#if ctrlLogic.getLogicType() == "APPVIEWENGINE" && ctrlLogic.getPSAppViewEngine()??>
......@@ -313,36 +116,16 @@ ${P.getLogicCode(logic, "LOGIC.vue").code}
</#list>
</#if>
<#if view.getPSAppViewUIActions()??>
<#list view.getPSAppViewUIActions() as viewUIAction>
<#if viewUIAction.getPSUIAction()?? >
<#assign uiAction = viewUIAction.getPSUIAction()/>
<#if !P.exists("importService", uiAction.getFullCodeName(), "")>
<#if view.getPSUIActions()??>
<#list view.getPSUIActions() as uiAction>
<#-- 系统预置界面行为输入start -->
<#if !(uiAction.getPSAppDataEntity?? && uiAction.getPSAppDataEntity()??)>
${P.getLogicCode(uiAction, "LOGIC.vue").code}
</#if>
<#-- 系统预置界面行为输入end -->
</#if>
</#if>
</#list>
</#if>
/**
* 关闭视图
*
* @param {any[]} args
* @memberof ${srfclassname('${view.name}')}Base
*/
protected closeView(args: any[]): void {
let _view: any = this;
if (_view.viewdata) {
_view.$emit('viewdataschange', [args]);
_view.$emit('close', [args]);
} else if (_view.$tabPageExp) {
_view.$tabPageExp.onClose(_view.$route.fullPath);
}
}
<#if view.isPSDEView()>
<#if view.getPSAppDataEntity()??>
<#assign appDataEntity = view.getPSAppDataEntity() />
......@@ -353,16 +136,8 @@ ${P.getLogicCode(uiAction, "LOGIC.vue").code}
*
* @memberof ${srfclassname('${view.name}')}Base
*/
protected destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof ${srfclassname('${view.name}')}Base
*/
protected afterDestroyed(){
public destroyed(){
<#if view_base_name??>
if(this.viewDefaultUsage){
let localStoreLength = Object.keys(localStorage);
if(localStoreLength.length > 0){
......@@ -373,6 +148,7 @@ ${P.getLogicCode(uiAction, "LOGIC.vue").code}
})
}
}
</#if>
}
</#if>
</#if>
......
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
<#if view.getPSAppCounterRefs()??>
<#list view.getPSAppCounterRefs() as singleCounterRef>
<#if singleCounterRef.getPSAppCounter()??>
<#assign appCounter = singleCounterRef.getPSAppCounter()/>
import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/counter/${srffilepath2(appCounter.getCodeName())}/${srffilepath2(appCounter.getCodeName())}-counter';
</#if>
</#list>
</#if>
import { Subject } from 'rxjs';
import { UIActionTool, Util } from '@/utils';
import { VueLifeCycleProcessing<#if view_base_name??>, ${view_base_name}</#if> } from '@/crm-core';
<#if view.getPSAppDataEntity?? && view.getPSAppDataEntity()??>
<#assign appde = view.getPSAppDataEntity()/>
import ${srfclassname('${appde.getCodeName()}')}Service from '@/service/${srffilepath2(appde.getCodeName())}/${srffilepath2(appde.getCodeName())}-service';
import ${srfclassname(appde.getCodeName())}Service from '@/service/${srffilepath2(appde.getCodeName())}/${srffilepath2(appde.getCodeName())}-service';
</#if>
<#if view.getPSAppViewEngines()??>
......@@ -21,115 +14,70 @@ import ${engine.getEngineType()}Engine from '@engine/${engine.getEngineCat()?low
</#list>
</#if>
<#if view.getPSUIActions()??>
<#list view.getPSUIActions() as uiAction>
<#if uiAction.getPSAppDataEntity?? && uiAction.getPSAppDataEntity()??>
<#if uiAction.getPFLogicCodeType() == "WFBACKEND">
<#if uiAction.getPSAppWFVer?? && uiAction.getPSAppWFVer()??>
<#if !P.exists("importService", uiAction.getPSAppWFVer().getCodeName(), "")>
import ${srfclassname('${uiAction.getPSAppWFVer().getCodeName()}')}WFUIService from '@/wfuiservice/${uiAction.getPSAppWF().getCodeName()?lower_case}/${uiAction.getPSAppWFVer().getCodeName()?lower_case}-ui-service';
</#if>
</#if>
<#else>
<#assign curAppEntity = uiAction.getPSAppDataEntity()/>
<#if !P.exists("importService1", curAppEntity.getId(), "")>
<#if !P.exists("importService", curAppEntity.getId(), "")>
import ${srfclassname('${curAppEntity.getCodeName()}')}UIService from '@/uiservice/${srffilepath2(curAppEntity.getCodeName())}/${srffilepath2(curAppEntity.getCodeName())}-ui-service';
</#if>
</#if>
</#if>
</#list>
</#if>
<#if import_block??>
${import_block}
</#if>
@Component({
components: {
},
})
export default class ${srfclassname('${view.name}')}Base extends Vue {
/**
* ${view.getTitle()}基类
*
* @export
* @class ${srfclassname(view.name)}Base
* @extends {<#if view_base_name??>${view_base_name}<#else>Vue</#if>}
*/
@Component({})
@VueLifeCycleProcessing
export default class ${srfclassname(view.name)}Base extends <#if view_base_name??>${view_base_name}<#else>Vue</#if> {
<#if view.getPSAppDataEntity?? && view.getPSAppDataEntity()??>
<#assign appde = view.getPSAppDataEntity()/>
/**
* 实体服务对象
*
* @type {${srfclassname('${appde.getCodeName()}')}Service}
* @memberof ${srfclassname('${view.name}')}Base
* @type {${srfclassname(appde.getCodeName())}Service}
* @memberof ${srfclassname(view.name)}Base
*/
protected appEntityService: ${srfclassname('${appde.getCodeName()}')}Service = new ${srfclassname('${appde.getCodeName()}')}Service;
public appEntityService: ${srfclassname(appde.getCodeName())}Service = new ${srfclassname(appde.getCodeName())}Service;
</#if>
<#if view.getPSAppCounterRefs()??>
<#assign counterRefs = ''/>
<#list view.getPSAppCounterRefs() as singleCounterRef>
<#if singleCounterRef.getPSAppCounter()??>
<#assign appCounter = singleCounterRef.getPSAppCounter()/>
<#assign counterRefs>${counterRefs}this.${srfclassname('${appCounter.getCodeName()}')}counterservice<#if singleCounterRef_has_next>,</#if></#assign>
/**
* ${srfclassname('${appCounter.getCodeName()}')}CounterService计数器服务对象
*
* @type {${srfclassname('${appCounter.getCodeName()}')}CounterService}
* @memberof ${srfclassname('${view.name}')}Base
*/
protected ${srfclassname('${appCounter.getCodeName()}')}counterservice: ${srfclassname('${appCounter.getCodeName()}')}CounterService = new ${srfclassname('${appCounter.getCodeName()}')}CounterService({ $store: this.$store });
</#if>
</#list>
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof ${srfclassname('${view.name}')}Base
*/
protected counterServiceArray:Array<any> = [${counterRefs}];
</#if>
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof ${srfclassname('${view.name}')}Base
* @memberof ${srfclassname(view.name)}Base
*/
@Emit()
protected viewDatasChange(val: any):any {
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof ${srfclassname('${view.name}')}Base
*/
@Prop() protected viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof ${srfclassname('${view.name}')}Base
*/
@Prop() protected viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}Base
*/
@Prop({ default: true }) protected viewDefaultUsage!: boolean;
/**
* 视图标识
*
* @type {string}
* @memberof ${srfclassname('${view.name}')}Base
* @memberof ${srfclassname(view.name)}Base
*/
protected viewtag: string = '${view.getId()}';
public viewtag: string = '${view.getId()}';
/**
* 父数据对象
*
* @protected
* @type {*}
* @memberof ${srfclassname(view.name)}Base
*/
protected srfparentdata: any = {};
/**
* 自定义视图导航上下文集合
......@@ -140,7 +88,7 @@ export default class ${srfclassname('${view.name}')}Base extends Vue {
protected customViewNavContexts:any ={
<#if view.getPSAppViewNavContexts()??>
<#list view.getPSAppViewNavContexts() as viewNavContext>
"${viewNavContext.getKey()?lower_case}":{"isRawValue":${viewNavContext.isRawValue()?c},"value":"${viewNavContext.getValue()?lower_case}"}<#if viewNavContext_has_next>,</#if>
"${viewNavContext.getKey()?lower_case}":{"isRawValue":${viewNavContext.isRawValue()?c},"value":"${viewNavContext.getValue()?lower_case}"}<#if viewNavContext_has_next>,</#if>
</#list>
</#if>
};
......@@ -154,7 +102,7 @@ export default class ${srfclassname('${view.name}')}Base extends Vue {
protected customViewParams:any ={
<#if view.getPSAppViewNavParams()??>
<#list view.getPSAppViewNavParams() as viewNavParam>
"${viewNavParam.getKey()?lower_case}":{"isRawValue":${viewNavParam.isRawValue()?c},"value":"${viewNavParam.getValue()?lower_case}"}<#if viewNavParam_has_next>,</#if>
"${viewNavParam.getKey()?lower_case}":{"isRawValue":${viewNavParam.isRawValue()?c},"value":"${viewNavParam.getValue()?lower_case}"}<#if viewNavParam_has_next>,</#if>
</#list>
</#if>
};
......@@ -163,57 +111,22 @@ export default class ${srfclassname('${view.name}')}Base extends Vue {
* 视图模型数据
*
* @type {*}
* @memberof ${srfclassname('${view.name}')}Base
* @memberof ${srfclassname(view.name)}Base
*/
protected model: any = {
public model: any = {
srfCaption: '<#if view.getPSAppDataEntity()??>entities.${view.getPSAppDataEntity().getCodeName()?lower_case}.views.${view.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${view.getCodeName()?lower_case}.caption</#if>',
srfTitle: '<#if view.getPSAppDataEntity()??>entities.${view.getPSAppDataEntity().getCodeName()?lower_case}.views.${view.getPSDEViewCodeName()?lower_case}.title<#else>app.views.${view.getCodeName()?lower_case}.title</#if>',
srfSubTitle: '<#if view.getPSAppDataEntity()??>entities.${view.getPSAppDataEntity().getCodeName()?lower_case}.views.${view.getPSDEViewCodeName()?lower_case}.subtitle<#else>app.views.${view.getCodeName()?lower_case}.subtitle</#if>',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof ${srfclassname('${view.name}')}Base
*/
@Watch('viewparam',{immediate: true, deep: true})
onParamData(newVal: any, oldVal: any) {
if(newVal){
for(let key in this.viewparams){
delete this.viewparams[key];
}
Object.assign(this.viewparams, JSON.parse(this.viewparam));
<#if watch_viewparam_block??>${watch_viewparam_block}</#if>
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof ${srfclassname('${view.name}')}Base
*/
@Watch('viewdata')
onViewData(newVal: any, oldVal: any) {
const _this: any = this;
if (!Object.is(newVal, oldVal) && _this.engine) {
_this.parseViewParam();
_this.engine.load();
}
<#if viewdata_block??>${viewdata_block}</#if>
}
/**
* 容器模型
*
* @type {*}
* @memberof ${srfclassname('${view.name}')}Base
* @memberof ${srfclassname(view.name)}Base
*/
protected containerModel: any = {
public containerModel: any = {
<#if view.getPSControls()??>
<#list view.getPSControls() as ctrl>
view_${ctrl.name}: { name: '${ctrl.name}', type: '${ctrl.getControlType()}' },
......@@ -232,30 +145,14 @@ export default class ${srfclassname('${view.name}')}Base extends Vue {
</#if>
};
/**
* 计数器刷新
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 视图状态订阅对象
*
* @private
* @type {Subject<{action: string, data: any}>}
* @memberof ${srfclassname('${view.name}')}Base
* @memberof ${srfclassname(view.name)}Base
*/
protected viewState: Subject<ViewState> = new Subject();
public viewState: Subject<ViewState> = new Subject();
<#if view.hasPSControl('toolbar')>
${P.getCtrlCode('toolbar', 'CONTROL.vue').code}
......
<#assign view_base_name>TabExpViewBase</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......
<#assign view_base_name>TabFormView9Base</#assign>
<#ibizinclude>
../@MACRO/VIEW-BASE.vue.ftl
</#ibizinclude>
</#ibizinclude>
\ No newline at end of file
<#assign view_base_name>ListExpViewBase</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......@@ -11,13 +12,6 @@
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
/**
* 视图唯一标识
*
* @type {string}
* @memberof ${srfclassname('${view.name}')}
*/
public viewUID: string = '${srffilepath2(view.getPSAppModule().getCodeName())}-${srffilepath2(view.getCodeName())}';
<#ibizinclude>
../@MACRO/VIEW_BOTTOM-BASE.vue.ftl
......
<#assign view_base_name>ListViewBase</#assign>
<#ibizinclude>
../@MACRO/LIST_VIEW.vue.ftl
</#ibizinclude>
\ No newline at end of file
<#assign created_block>
if(this.formDruipart){
this.formDruipart.subscribe((res:any) =>{
if(Object.is(res.action,'load')){
const _this: any = this;
_this.engine.load(res.data,true);
}
});
}
</#assign>
<#assign view_base_name>ListView9Base</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}Base
*/
@Prop({default:false}) public isformDruipart?: boolean;
/**
* 界面关系通讯对象
*
* @type {Subject<ViewState>}
* @memberof ${srfclassname('${view.name}')}Base
*/
@Prop() public formDruipart!: Subject<ViewState>;
/**
* 搜索值
*
* @type {string}
* @memberof ${srfclassname('${view.name}')}Base
*/
protected query: string = '';
/**
* 是否展开搜索表单
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}Base
*/
protected isExpandSearchForm: boolean = ${view.isExpandSearchForm()?c};
/**
* 快速搜索
*
* @param {*} $event
* @memberof ${srfclassname('${view.name}')}Base
*/
protected onSearch($event: any): void {
const refs: any = this.$refs;
if (refs.list) {
refs.list.load({});
}
}
<#ibizinclude>
../@MACRO/VIEW_BOTTOM-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW-BASE.style.ftl
../@MACRO/LIST_VIEW.vue.ftl
</#ibizinclude>
\ No newline at end of file
<#assign view_base_name>DataViewExpViewBase</#assign>
<#ibizinclude>
../@MACRO/DATAVIEW_VIEW.vue.ftl
</#ibizinclude>
\ No newline at end of file
<#assign view_base_name>WizardViewBase</#assign>
<#ibizinclude>
../@MACRO/VIEW-BASE.vue.ftl
</#ibizinclude>
\ No newline at end of file
<#assign created_block>
if(this.formDruipart){
this.formDruipart.subscribe((res:any) =>{
if(Object.is(res.action,'load')){
const _this: any = this;
_this.engine.load(res.data,true);
}
});
}
</#assign>
<#assign view_base_name>ChartView9Base</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......@@ -20,27 +11,11 @@
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}Base
*/
@Prop({default:false}) public isformDruipart?: boolean;
/**
* 界面关系通讯对象
*
* @type {Subject<ViewState>}
* @memberof ${srfclassname('${view.name}')}Base
*/
@Prop() public formDruipart?: Subject<ViewState>;
/**
* 搜索值
*
* @type {string}
* @memberof ${srfclassname('${view.name}')}Base
* @memberof ${srfclassname('${view.name}')}
*/
public query: string = '';
......@@ -48,7 +23,7 @@
* 是否展开搜索表单
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}Base
* @memberof ${srfclassname('${view.name}')}
*/
public isExpandSearchForm: boolean = ${view.isExpandSearchForm()?c};
......@@ -56,7 +31,7 @@
* 快速搜索
*
* @param {*} $event
* @memberof ${srfclassname('${view.name}')}Base
* @memberof ${srfclassname('${view.name}')}
*/
public onSearch($event: any): void {
const refs: any = this.$refs;
......
<#assign view_base_name>ChartViewBase</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......
<#assign view_base_name>EditView9Base</#assign>
<#assign self_content>
/**
* 界面关系通讯对象
*
* @type {Subject<ViewState>}
* @memberof IBZSAM02MobMEditView9
*/
@Prop() public formDruipart!: Subject<ViewState>;
<#if view.hasPSControl('lefttoolbar')>
<#assign lefttoolbar = view.getPSControl('lefttoolbar')>
<@ibizindent blank=8>
......@@ -14,26 +23,27 @@
</#if>
</#assign>
<#assign mounted_block>
if(this.formDruipart){
this.formDruipart.subscribe((res) =>{
if(Object.is(res.action,'save')){
this.viewState.next({ tag:'meditviewpanel', action: 'save', data: this.viewparams });
}
if(Object.is(res.action,'remove')){
this.viewState.next({ tag:'meditviewpanel', action: 'remove', data: this.viewparams });
}
if(Object.is(res.action,'load')){
this.viewState.next({ tag: 'meditviewpanel', action: 'load', data: this.viewparams });
}
});
}else{
this.viewState.next({ tag: 'meditviewpanel', action: 'load', data: this.viewparams });
}
if(this.formDruipart){
this.formDruipart.subscribe((res) =>{
if(Object.is(res.action,'save')){
let opt ={data:res.data};
Object.assign(opt,this.context);
this.viewState.next({ tag:'meditviewpanel', action: 'save', data: opt });
}
if(Object.is(res.action,'remove')){
let opt ={data:res.data};
Object.assign(opt,this.context);
this.viewState.next({ tag:'meditviewpanel', action: 'remove', data: opt });
}
});
}
this.viewState.next({ tag: 'meditviewpanel', action: 'load', data: this.context });
</#assign>
<#assign viewdata_block>
if(!Object.is(newVal, oldVal) ){
_this.parseViewParam();
}
if(!Object.is(newVal, oldVal) ){
_this.parseViewParam();
this.viewState.next({ tag: 'meditviewpanel', action: 'load', data: this.context });
}
</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
......@@ -48,14 +58,6 @@
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
/**
* 界面关系通讯对象
*
* @type {Subject<ViewState>}
* @memberof ${srfclassname('${view.name}')}
*/
@Prop() public formDruipart!: Subject<ViewState>;
/**
* 刷新数据参数
*
......
<#assign view_base_name>MPickupViewBase</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
<#assign watch_viewparam_block>
if(this.viewparams.selectedData){
this.selectedData = JSON.stringify(this.viewparams.selectedData);
}
</#assign>
<#ibizinclude>
../@MACRO/VIEW_HEADER-BASE.vue.ftl
</#ibizinclude>
<#assign mounted_block>
if(this.viewparams.selectedData){
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', this.viewparams.selectedData);
this.onCLickRight();
}
</#assign>
<#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
/**
* 视图选中数据
*
* @type {any[]}
* @memberof ${srfclassname('${view.name}')}
*/
public viewSelections:any[] = [];
/**
* 是否显示按钮
*
......@@ -44,23 +41,42 @@ if(this.viewparams.selectedData){
* @type {any[]}
* @memberof ${srfclassname('${view.name}')}
*/
isInitSelected:boolean = false;
public isInitSelected: boolean = false;
/**
* 视图选中数据
* 是否单选
*
* @type {any[]}
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}
*/
public viewSelections:any[] = [];
public isSingleSelect: boolean = false;
/**
* 是否单选
* 视图参数变更
*
* @type {boolean}
* @protected
* @param {*} newVal
* @param {*} oldVal
* @memberof ${srfclassname('${view.name}')}
*/
public isSingleSelect: boolean = false;
protected viewParamChange(newVal: any, oldVal: any): void {
if(this.viewparams.selectedData){
this.selectedData = JSON.stringify(this.viewparams.selectedData);
}
}
/**
* 视图组件挂载完毕
*
* @protected
* @memberof ${srfclassname('${view.name}')}
*/
protected viewMounted(): void {
if(this.viewparams.selectedData){
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', this.viewparams.selectedData);
this.onCLickRight();
}
}
/**
* 选中数据单击
......
<#assign self_viewparam>
this.$forceUpdate();
</#assign>
<#assign view_base_name>DashboardViewBase</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......
<#assign self_viewparam>
this.$forceUpdate();
</#assign>
<#assign created_block>
if(this.formDruipart){
this.formDruipart.subscribe((res:any) =>{
if(Object.is(res.action,'load')){
const _this: any = this;
_this.engine.load(res.data,true);
}
});
}
</#assign>
<#assign view_base_name>DashboardView9Base</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......@@ -23,24 +11,6 @@ this.$forceUpdate();
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}Base
*/
@Prop({default:false}) public isformDruipart?: boolean;
/**
* 界面关系通讯对象
*
* @type {Subject<ViewState>}
* @memberof ${srfclassname('${view.name}')}Base
*/
@Prop() public formDruipart!: Subject<ViewState>;
<#ibizinclude>
../@MACRO/VIEW_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
<#assign view_base_name>DataViewBase</#assign>
<#ibizinclude>
../@MACRO/DATAVIEW_VIEW.vue.ftl
</#ibizinclude>
\ No newline at end of file
<#assign created_block>
if(this.formDruipart){
this.formDruipart.subscribe((res:any) =>{
if(Object.is(res.action,'load')){
const _this: any = this;
_this.engine.load(res.data,true);
}
});
}
</#assign>
<#assign view_base_name>DataView9Base</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
<#if view.hasPSControl('dataview')>
<#assign dataview = view.getPSControl('dataview')>
/**
* 是否单选
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}
*/
public isSingleSelect: boolean = ${dataview.isSingleSelect()?c};
</#if>
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}Base
*/
@Prop({default:false}) public isformDruipart?: boolean;
/**
* 界面关系通讯对象
*
* @type {Subject<ViewState>}
* @memberof ${srfclassname('${view.name}')}Base
*/
@Prop() public formDruipart!: Subject<ViewState>;
/**
* 视图唯一标识
*
* @type {string}
* @memberof ${srfclassname('${view.name}')}Base
*/
public viewUID: string = '${srffilepath2(view.getPSAppModule().getCodeName())}-${srffilepath2(view.getCodeName())}';
/**
* 搜索值
*
* @type {string}
* @memberof ${srfclassname('${view.name}')}Base
*/
public query: string = '';
/**
* 是否展开搜索表单
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}Base
*/
public isExpandSearchForm: boolean = ${view.isExpandSearchForm()?c};
/**
* 快速搜索
*
* @param {*} $event
* @memberof ${srfclassname('${view.name}')}Base
*/
public onSearch($event: any): void {
const refs: any = this.$refs;
if (refs.dataview) {
refs.dataview.refresh({});
}
}
<#ibizinclude>
../@MACRO/VIEW_BOTTOM-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW-BASE.style.ftl
../@MACRO/DATAVIEW_VIEW.vue.ftl
</#ibizinclude>
\ No newline at end of file
<#assign view_base_name>PickupViewBase</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
<#assign watch_viewparam_block>
if(this.viewparams.selectedData){
this.selectedData = JSON.stringify(this.viewparams.selectedData);
}
</#assign>
<#ibizinclude>
../@MACRO/VIEW_HEADER-BASE.vue.ftl
</#ibizinclude>
<#assign mounted_block>
if(this.viewparams.selectedData){
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', this.viewparams.selectedData);
}
</#assign>
<#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
......@@ -33,7 +22,7 @@ if(this.viewparams.selectedData){
* 视图选中数据
*
* @type {any[]}
* @memberof ${srfclassname('${view.name}')}Base
* @memberof ${srfclassname('${view.name}')}
*/
public viewSelections:any[] = [];
......@@ -41,7 +30,7 @@ if(this.viewparams.selectedData){
* 是否显示按钮
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}Base
* @memberof ${srfclassname('${view.name}')}
*/
@Prop({default: true}) public isShowButton!: boolean;
......@@ -49,14 +38,40 @@ if(this.viewparams.selectedData){
* 是否单选
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}Base
* @memberof ${srfclassname('${view.name}')}
*/
public isSingleSelect: boolean = true;
/**
* 视图参数变更
*
* @protected
* @param {*} newVal
* @param {*} oldVal
* @memberof ${srfclassname('${view.name}')}
*/
protected viewParamChange(newVal: any, oldVal: any): void {
if(this.viewparams.selectedData){
this.selectedData = JSON.stringify(this.viewparams.selectedData);
}
}
/**
* 视图组件挂载完毕
*
* @protected
* @memberof ${srfclassname('${view.name}')}
*/
protected viewMounted(): void {
if(this.viewparams.selectedData){
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', this.viewparams.selectedData);
}
}
/**
* 确定
*
* @memberof ${srfclassname('${view.name}')}Base
* @memberof ${srfclassname('${view.name}')}
*/
public onClickOk(): void {
this.$emit('viewdataschange', this.viewSelections);
......@@ -66,7 +81,7 @@ if(this.viewparams.selectedData){
/**
* 取消
*
* @memberof ${srfclassname('${view.name}')}Base
* @memberof ${srfclassname('${view.name}')}
*/
public onClickCancel(): void {
this.$emit('close', null);
......
<#assign view_base_name>PickupView3Base</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......
<#assign view_base_name>WizardViewBase</#assign>
<#assign import_block>
import UIService from '@/uiservice/ui-service';
</#assign>
......
<#assign view_base_name>CalendarExpViewBase</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......@@ -6,7 +7,6 @@
../@MACRO/VIEW_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
......
<#assign view_base_name>ListView9Base</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......
<#assign view_base_name>ListView9Base</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......@@ -6,41 +7,10 @@
../@MACRO/VIEW_HEADER-BASE.vue.ftl
</#ibizinclude>
<#assign created_block>
if(this.formDruipart){
this.formDruipartEvent = this.formDruipart.subscribe((res:any) =>{
if(Object.is(res.action,'load')){
<#if view.getXDataPSControl?? && view.getXDataPSControl()??>
<#assign xDataControl = view.getXDataPSControl() />
(this.$refs.${xDataControl.getName()} as any).refresh();
</#if>
}
});
}
</#assign>
<#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
/**
* 界面关系通讯对象
*
* @type {Subject<ViewState>}
* @memberof ${srfclassname('${view.name}')}Base
*/
@Prop() public formDruipart?: Subject<ViewState>;
/**
* 视图状态事件
*
* @protected
* @type {(any | undefined)}
* @memberof ${srfclassname('${view.name}')}Base
*/
protected formDruipartEvent: any | undefined;
<#ibizinclude>
../@MACRO/VIEW_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
<#assign view_base_name>TreeExpViewBase</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......@@ -9,7 +10,7 @@
<#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
/**
* 视图唯一标识
*
......@@ -17,7 +18,7 @@
* @memberof ${srfclassname('${view.name}')}
*/
public viewUID: string = '${srffilepath2(view.getPSAppModule().getCodeName())}-${srffilepath2(view.getCodeName())}';
<#ibizinclude>
../@MACRO/VIEW_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
<#assign view_base_name>TreeViewBase</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......@@ -9,7 +10,8 @@
<#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
/**
* 节点过滤值
*
......
<#assign created_block>
if(this.formDruipart){
this.formDruipart.subscribe((res:any) =>{
if(Object.is(res.action,'load')){
const _this: any = this;
_this.engine.load(res.data,true);
}
});
}
</#assign>
<#assign view_base_name>TreeView9Base</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......@@ -21,27 +11,12 @@
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}Base
*/
@Prop({default:false}) public isformDruipart?: boolean;
/**
* 界面关系通讯对象
*
* @type {Subject<ViewState>}
* @memberof ${srfclassname('${view.name}')}Base
*/
@Prop() public formDruipart?: Subject<ViewState>;
/**
* 节点过滤值
*
* @type {string}
* @memberof ${srfclassname('${view.name}')}Base
* @memberof ${srfclassname('${view.name}')}
*/
public srfnodefilter: string = '';
......@@ -49,7 +24,7 @@
* 快速搜索
*
* @returns {void}
* @memberof ${srfclassname('${view.name}')}Base
* @memberof ${srfclassname('${view.name}')}
*/
public onSearch(): void {
if (!this.viewState) {
......
<#assign view_base_name>IndexPickupDataViewBase</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......
<#assign view_base_name>EditViewBase</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......
<#assign view_base_name>EditView4Base</#assign>
<#ibizinclude>
../@MACRO/VIEW-BASE.vue.ftl
</#ibizinclude>
\ No newline at end of file
<#assign view_base_name>EditView3Base</#assign>
<#ibizinclude>
../@MACRO/EDIT_VIEW3-BASE.vue.ftl
</#ibizinclude>
</#ibizinclude>
\ No newline at end of file
<#assign view_base_name>EditView2Base</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......
<#assign view_base_name>EditView9Base</#assign>
<#assign self_content>
/**
* meditview9状态下发变量
......@@ -20,20 +21,6 @@
</@ibizindent>
</#if>
</#assign>
<#assign mounted_block>
if(this.panelState){
this.panelState.subscribe((res:any) =>{
if(Object.is(res.tag,'meditviewpanel')){
if(Object.is(res.action,'save')){
this.viewState.next({ tag:'form', action: 'save', data:res.data});
}
if(Object.is(res.action,'remove')){
this.viewState.next({ tag:'form', action: 'remove', data:res.data});
}
}
});
}
</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......@@ -42,11 +29,30 @@ if(this.panelState){
../@MACRO/VIEW_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
/**
* 视图组件挂载完毕
*
* @protected
* @memberof ViewBase
*/
protected viewMounted(): void {
if(this.panelState){
this.panelState.subscribe((res:any) =>{
if(Object.is(res.tag,'meditviewpanel')){
if(Object.is(res.action,'save')){
this.viewState.next({ tag:'form', action: 'save', data:res.data});
}
if(Object.is(res.action,'remove')){
this.viewState.next({ tag:'form', action: 'remove', data:res.data});
}
}
});
}
}
<#ibizinclude>
../@MACRO/VIEW_BOTTOM-BASE.vue.ftl
......
<#assign view_base_name>FormPickupDataViewBase</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......
<#assign view_base_name>GridExpViewBase</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......@@ -6,6 +7,7 @@
../@MACRO/VIEW_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
......
<#assign view_base_name>GridViewBase</#assign>
<#ibizinclude>
../@MACRO/GRID_VIEW-BASE.vue.ftl
</#ibizinclude>
\ No newline at end of file
<#assign view_base_name>GridView9Base</#assign>
<#ibizinclude>
../@MACRO/GRID_VIEW-BASE.vue.ftl
</#ibizinclude>
\ No newline at end of file
<#assign view_base_name>PickupTreeViewBase</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......
<#assign view_base_name>PickupViewBase</#assign>
<#ibizinclude>
../@MACRO/PICKUPGRID_VIEW-BASE.vue.ftl
</#ibizinclude>
\ No newline at end of file
<#assign view_base_name>OptionViewBase</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......
<#assign view_base_name>WizardViewBase</#assign>
<#assign import_block>
import UIService from '@/uiservice/ui-service';
</#assign>
......@@ -24,7 +25,6 @@ import UIService from '@/uiservice/ui-service';
const targetService:any = await uiService.getService(srfappde.toLowerCase());
targetService.getRDAppView(srfkey,this.isEnableWorkflow).then((res:any) =>{
if(res && res.viewname && res.srfappde){
console.log('重定向之后的视图'+res.viewname);
const path:string =<#noparse>`/${res.srfappde}/${srfkey}/${res.viewname}`</#noparse>;
this.$router.push({path:path});
}else{
......
<#assign mounted_block>
this.viewState.next({ tag: 'dashboard', action: 'load', data: {} });
</#assign>
<#assign view_base_name>PortalViewBase</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......
<script lang='tsx'>
import { Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { Subject } from 'rxjs';
import { IndexViewBase } from '@/crm-core';
/**
* ${view.getTitle()}基类
*
* @export
* @class ${srfclassname(view.name)}Base
* @extends {IndexViewBase}
*/
export default class ${srfclassname('${view.name}')}Base extends IndexViewBase {
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof ${srfclassname('${view.name}')}Base
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 视图标识
*
* @type {string}
* @protected
* @memberof ${srfclassname('${view.name}')}Base
*/
protected viewtag: string = '${view.getId()}';
/**
* 父数据对象
*
* @protected
* @type {*}
* @memberof ${srfclassname('${view.name}')}Base
*/
protected srfparentdata: any = {};
/**
* 视图模型数据
*
* @type {*}
* @memberof ${srfclassname('${view.name}')}Base
*/
public model: any = {
srfTitle: '<#if view.getTitle()??>${view.getTitle()}</#if>',
srfCaption: '<#if view.isPSDEView()>${de.getCodeName()?lower_case}.views.${view.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${view.getCodeName()?lower_case}.caption</#if>',
srfSubCaption: '<#if view.getSubCaption()??>${view.getSubCaption()}</#if>',
dataInfo: ''
}
/**
* 容器模型
*
* @type {*}
* @memberof ${srfclassname('${view.name}')}Base
*/
public containerModel: any = {
<#if view.getPSControls()??>
<#list view.getPSControls() as ctrl>
view_${ctrl.name}: { name: '${ctrl.name}', type: '${ctrl.getControlType()}' },
</#list>
</#if>
<#if view.isPickupView() || (view.getViewType?? && (view.getViewType() == 'DEOPTVIEW' || view.getViewType() == 'DEWFSTARTVIEW' || view.getViewType() == 'DEWFACTIONVIEW'))>
view_okbtn: { name: 'okbtn', type: 'button', text: '确定', disabled: true },
view_cancelbtn: { name: 'cancelbtn', type: 'button', text: '取消', disabled: false },
view_leftbtn: { name: 'leftbtn', type: 'button', text: '左移', disabled: true },
view_rightbtn: { name: 'rightbtn', type: 'button', text: '右移', disabled: true },
view_allleftbtn: { name: 'allleftbtn', type: 'button', text: '全部左移', disabled: true },
view_allrightbtn: { name: 'allrightbtn', type: 'button', text: '全部右移', disabled: true },
</#if>
<#if view.getPSWorkflow?? && view.getPSWorkflow()??>
wflinks: [],
</#if>
};
<#if view.getPSControls()??>
<#list view.getPSControls() as ctrl>
<#if ctrl.getControlType()??>
<#if ctrl.getHookEventNames()??>
<#list ctrl.getHookEventNames() as eventName>
/**
* ${ctrl.name} 部件 ${eventName?lower_case} 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ${srfclassname('${view.name}')}Base
*/
public ${ctrl.name}_${eventName?lower_case}($event: any, $event2?: any) {
<#if ctrl.getPSControlLogics(eventName)??>
<#list ctrl.getPSControlLogics(eventName) as ctrlLogic>
<#if ctrlLogic.getLogicType() == "APPVIEWENGINE" && ctrlLogic.getPSAppViewEngine()??>
this.${ctrlLogic.getPSAppViewEngine().getName()}.onCtrlEvent('${ctrl.name}', '${eventName?lower_case}', $event);
<#else>
<#if ctrlLogic.getEventArg()?? && ctrlLogic.getEventArg()?length gt 0>
if (Object.is($event.tag, '${ctrlLogic.getEventArg()}')) {
this.${ctrlLogic.name}($event, '', $event2);
}
<#else>
this.${ctrlLogic.name}($event, '', $event2);
</#if>
</#if>
</#list>
</#if>
}
</#list>
</#if>
</#if>
</#list>
</#if>
public render(): any {
const isIndexRoot: boolean = Object.is(this.$route.meta.viewType, 'APPINDEX');
return (<div class="app-container">
${P.getLayoutCode('VIEW.vue').code}
<router-view v-show={!isIndexRoot}></router-view>
</div>);
}
}
</script>
<#ibizinclude>
../@MACRO/VIEW-BASE.style.ftl
</#ibizinclude>
\ No newline at end of file
<script lang='ts'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/crm-core';
import ${srfclassname(view.name)}Base from './${srffilepath2(view.name)}-base.vue';
<#if view.getPSControls()??>
<#list view.getPSControls() as ctrl>
<#if ctrl.getControlType() != 'TOOLBAR' && ctrl.getControlType() != 'CONTEXTMENU'>
<#if ctrl.getPSAppDataEntity?? && ctrl.getPSAppDataEntity()??>
import view_${ctrl.getName()} from '@widgets/${srffilepath2(view.getPSAppDataEntity().getCodeName())}/${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}/${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}.vue';
<#else>
import view_${ctrl.getName()} from '@widgets/app/${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}/${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}.vue';
</#if>
</#if>
</#list>
</#if>
/**
* ${view.getTitle()}
*
* @export
* @class ${srfclassname(view.name)}
* @extends {${srfclassname(view.name)}Base}
*/
@Component({
components: {
<#if view.getPSControls()??>
<#list view.getPSControls() as ctrl>
<#if ctrl.getControlType() != "TOOLBAR">
view_${ctrl.getName()},
</#if>
</#list>
</#if>
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
});
},
})
@VueLifeCycleProcessing
export default class ${srfclassname(view.name)} extends ${srfclassname(view.name)}Base { }
</script>
\ No newline at end of file
VIEWTYPE=APPINDEXVIEW#INDEXTOPNAV
\ No newline at end of file
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW_HEADER-BASE.vue.ftl
</#ibizinclude>
<#assign mounted_block>
this.viewState.next({ tag: 'appmenu', action: 'load', data: {} });
this.$viewTool.setIndexParameters([{ pathName: '${view.getCodeName()?lower_case}', parameterName: '${view.getCodeName()?lower_case}' }]);
this.$viewTool.setIndexViewParam(this.context);
<#-- let loader:any = document.getElementById('app-loader');
loader.parentNode.removeChild(loader); -->
</#assign>
<#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
<script lang='tsx'>
import { Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { Subject } from 'rxjs';
import { IndexViewBase } from '@/crm-core';
/**
* ${view.getTitle()}基类
*
* @export
* @class ${srfclassname(view.name)}Base
* @extends {IndexViewBase}
*/
export default class ${srfclassname('${view.name}')}Base extends IndexViewBase {
/**
* 视图标识
*
* @type {string}
* @protected
* @memberof ${srfclassname('${view.name}')}Base
*/
protected viewtag: string = '${view.getId()}';
/**
* 菜单位置
*
* @private
* @type {string}
* @memberof ${srfclassname('${view.name}')}Base
*/
private mode: string ='<#if view.getMainMenuAlign()=="TOP">horizontal</#if><#if view.getMainMenuAlign()=="LEFT" || view.getMainMenuAlign() =="">vertical</#if>';
/**
* 当前主题
*
* @readonly
* @memberof ${srfclassname('${view.name}')}Base
*/
get selectTheme() {
if (this.$router.app.$store.state.selectTheme) {
return this.$router.app.$store.state.selectTheme;
} else if (localStorage.getItem('theme-class')) {
return localStorage.getItem('theme-class');
} else {
return 'app-default-theme';
}
}
/**
* 当前字体
*
* @readonly
* @memberof ${srfclassname('${view.name}')}Base
*/
get selectFont() {
if (this.$router.app.$store.state.selectFont) {
return this.$router.app.$store.state.selectFont;
} else if (localStorage.getItem('font-family')) {
return localStorage.getItem('font-family');
} else {
return 'Microsoft YaHei';
}
}
/**
* 菜单收缩变化
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}Base
*/
public collapseChange: boolean = false;
/**
* 菜单收缩点击
* 视图模型数据
*
* @type {*}
* @memberof ${srfclassname('${view.name}')}Base
*/
public handleClick(): void {
this.collapseChange = !this.collapseChange;
public model: any = {
srfTitle: '<#if view.getTitle()??>${view.getTitle()}</#if>',
srfCaption: '<#if view.isPSDEView()>${de.getCodeName()?lower_case}.views.${view.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${view.getCodeName()?lower_case}.caption</#if>',
srfSubCaption: '<#if view.getSubCaption()??>${view.getSubCaption()}</#if>',
dataInfo: ''
}
/**
* 默认打开的视图
* 容器模型
*
* @type {*}
* @memberof ${srfclassname('${view.name}')}Base
*/
public defPSAppView: any = {
<#if view.getDefPSAppView()??>
<#assign dataview = view.getDefPSAppView()>
codename: '${dataview.getCodeName()?lower_case}',
viewtitle: '${dataview.getTitle()}',
openmode: '${dataview.getOpenMode()}',
width: ${dataview.getWidth()?c},
height: ${dataview.getHeight()?c},
deResParameters: [],
<#-- BEGIN:是否应用实体视图 -->
<#if dataview.isPSDEView()>
<#assign appDataEntity = dataview.getPSAppDataEntity()/>
routepath: '/${view.getCodeName()?lower_case}/:${view.getCodeName()?lower_case}?/${srfpluralize(appDataEntity.codeName)?lower_case}/:${appDataEntity.getCodeName()?lower_case}?/${dataview.getPSDEViewCodeName()?lower_case}/:${dataview.getPSDEViewCodeName()?lower_case}?',
parameters: [
{ pathName: '${srfpluralize(appDataEntity.codeName)?lower_case}', parameterName: '${appDataEntity.getCodeName()?lower_case}' },
{ pathName: '${dataview.getPSDEViewCodeName()?lower_case}', parameterName: '${dataview.getPSDEViewCodeName()?lower_case}' },
],
<#else>
routepath: '/${view.getCodeName()?lower_case}/:${view.getCodeName()?lower_case}?/${dataview.getCodeName()?lower_case}/:${dataview.getCodeName()?lower_case}?',
parameters: [
{ pathName: '${dataview.getCodeName()?lower_case}', parameterName: '${dataview.getCodeName()?lower_case}' },
],
public containerModel: any = {
<#if view.getPSControls()??>
<#list view.getPSControls() as ctrl>
view_${ctrl.name}: { name: '${ctrl.name}', type: '${ctrl.getControlType()}' },
</#list>
</#if>
<#if view.isPickupView() || (view.getViewType?? && (view.getViewType() == 'DEOPTVIEW' || view.getViewType() == 'DEWFSTARTVIEW' || view.getViewType() == 'DEWFACTIONVIEW'))>
view_okbtn: { name: 'okbtn', type: 'button', text: '确定', disabled: true },
view_cancelbtn: { name: 'cancelbtn', type: 'button', text: '取消', disabled: false },
view_leftbtn: { name: 'leftbtn', type: 'button', text: '左移', disabled: true },
view_rightbtn: { name: 'rightbtn', type: 'button', text: '右移', disabled: true },
view_allleftbtn: { name: 'allleftbtn', type: 'button', text: '全部左移', disabled: true },
view_allrightbtn: { name: 'allrightbtn', type: 'button', text: '全部右移', disabled: true },
</#if>
<#-- END:是否应用实体视图 -->
<#if view.getPSWorkflow?? && view.getPSWorkflow()??>
wflinks: [],
</#if>
};
/**
* 应用起始页面
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}Base
*/
public isDefaultPage: boolean = ${view.isDefaultPage()?c};
/**
* 获取样式
*
* @readonly
* @type {string[]}
* @memberof ${srfclassname('${view.name}')}Base
*/
get themeClasses(): string[] {
return [
Object.is(this.selectTheme, 'app_theme_blue') ? 'app_theme_blue' : '',
Object.is(this.selectTheme, 'app-default-theme') ? 'app-default-theme' : '',
Object.is(this.selectTheme, 'app_theme_darkblue') ? 'app_theme_darkblue' : '',
];
}
<#if view.getPSControls()??>
<#list view.getPSControls() as ctrl>
<#if ctrl.getControlType()??>
<#if ctrl.getHookEventNames()??>
<#list ctrl.getHookEventNames() as eventName>
/**
* 主题字体
* ${ctrl.name} 部件 ${eventName?lower_case} 事件
*
* @readonly
* @type {*}
* @param {*} [args={}]
* @param {*} $event
* @memberof ${srfclassname('${view.name}')}Base
*/
get themeStyle(): any {
return {
'height': '100vh',
'font-family': this.selectFont,
public ${ctrl.name}_${eventName?lower_case}($event: any, $event2?: any) {
<#if ctrl.getPSControlLogics(eventName)??>
<#list ctrl.getPSControlLogics(eventName) as ctrlLogic>
<#if ctrlLogic.getLogicType() == "APPVIEWENGINE" && ctrlLogic.getPSAppViewEngine()??>
this.${ctrlLogic.getPSAppViewEngine().getName()}.onCtrlEvent('${ctrl.name}', '${eventName?lower_case}', $event);
<#else>
<#if ctrlLogic.getEventArg()?? && ctrlLogic.getEventArg()?length gt 0>
if (Object.is($event.tag, '${ctrlLogic.getEventArg()}')) {
this.${ctrlLogic.name}($event, '', $event2);
}
<#else>
this.${ctrlLogic.name}($event, '', $event2);
</#if>
</#if>
</#list>
</#if>
}
/**
* 获取路由列表
*
* @readonly
* @type {any[]}
* @memberof ${srfclassname('${view.name}')}Base
*/
get getRouterList(): any[] {
return this.$store.state.historyPathList;
}
</#list>
</#if>
</#if>
</#list>
</#if>
/**
* 获取路由键值
*
* @readonly
* @type {string}
* @memberof ${srfclassname('${view.name}')}Base
*/
get getRouterViewKey(): string {
return this.$route.fullPath;
public render(): any {
return (<div class="app-container">
${P.getLayoutCode('VIEW.vue').code}
</div>);
}
<#ibizinclude>
../@MACRO/VIEW_BOTTOM-BASE.vue.ftl
</#ibizinclude>
}
</script>
<#ibizinclude>
../@MACRO/VIEW-BASE.style.ftl
......
<#ibizinclude>
../@MACRO/VIEW.vue.ftl
</#ibizinclude>
\ No newline at end of file
<script lang='ts'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/crm-core';
import ${srfclassname(view.name)}Base from './${srffilepath2(view.name)}-base.vue';
<#if view.getPSControls()??>
<#list view.getPSControls() as ctrl>
<#if ctrl.getControlType() != 'TOOLBAR' && ctrl.getControlType() != 'CONTEXTMENU'>
<#if ctrl.getPSAppDataEntity?? && ctrl.getPSAppDataEntity()??>
import view_${ctrl.getName()} from '@widgets/${srffilepath2(view.getPSAppDataEntity().getCodeName())}/${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}/${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}.vue';
<#else>
import view_${ctrl.getName()} from '@widgets/app/${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}/${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}.vue';
</#if>
</#if>
</#list>
</#if>
/**
* ${view.getTitle()}
*
* @export
* @class ${srfclassname(view.name)}
* @extends {${srfclassname(view.name)}Base}
*/
@Component({
components: {
<#if view.getPSControls()??>
<#list view.getPSControls() as ctrl>
<#if ctrl.getControlType() != "TOOLBAR">
view_${ctrl.getName()},
</#if>
</#list>
</#if>
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
});
},
})
@VueLifeCycleProcessing
export default class ${srfclassname(view.name)} extends ${srfclassname(view.name)}Base { }
</script>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
<#list app.getAllPSAppViews() as view>
<#assign num = view_index />
</#list>
{
<#list app.getAllPSAppViews() as view>
"${view.getCodeName()?lower_case}": {
"title": "${view.getTitle()}",
"caption": "${view.getCaption()}",
"viewtype": "${view.getViewType()}",
"viewmodule": "${view.getPSAppModule().getCodeName()}",
"viewname": "${view.getCodeName()}",
"viewtag": "${view.getId()}",
"memo": "${view.getMemo()}"
}<#if view_index != num>,</#if>
</#list>
}
\ No newline at end of file
......@@ -19,25 +19,29 @@ export const Environment = {
// 文件上传
UploadFile: 'ibizutil/upload',
// 是否为pc端应用
isAppMode:true,
isAppMode: true,
//统一地址
uniteAddress:"http://172.16.100.202:8114",
uniteAddress: "http://172.16.100.202:8114",
// 是否为开发模式
devMode: true,
// 项目模板地址
// 项目地址
ProjectUrl: "http://172.16.180.229/wangxiang1/VUE_R7_FTL",
// 配置平台地址
StudioUrl: "http://172.16.170.145/slnstudio/",
// 中心标识
SlnId: "B4BF5C84-D020-4D9A-A986-8FA4FD72816C",
StudioUrl: "http://neko.org.cn:3333/",
// 方案标识
SlnId: "AFFB70EF-A2CF-470A-B1AE-38156EAF4A50",
// 系统标识
SysId: "B428B5BE-EA90-4101-A493-BA7085D89F0A",
SysId: "8A26FD38-06D7-495C-88B1-77238F3AB96D",
// 前端应用标识
AppId: "6e0b7357169ef4eba84e1347ed94bd84",
AppId: "0df1f39e51db7152428a905a11c28a16",
// 项目发布文件地址
PublishProjectUrl: '${app.getPSSystem().getReadOnlyPSSVNInstRepo().getGitPath()}',
// ibiz开放平台地址
ibizlabtUrl: 'https://www.ibizlab.cn',
// ibiz论坛地址
ibizbbstUrl: 'https://bbs.ibizlab.cn',
};
\ No newline at end of file
};
// 挂载外部配置文件
if ((window as any).Environment) {
Object.assign(Environment, (window as any).Environment);
}
\ No newline at end of file
<#if obj.getCapPSLanguageRes()?? && obj.getCapPSLanguageRes().getContent(langrestype, false)?? && obj.getCapPSLanguageRes().getContent(langrestype, false) != ''>${obj.getCapPSLanguageRes().getContent(langrestype, false)}<#elseif obj.getCaption()??>${obj.getCaption()}</#if>
\ No newline at end of file
<#if obj.getTooltipPSLanguageRes()?? && obj.getTooltipPSLanguageRes().getContent(langrestype, false)?? && obj.getTooltipPSLanguageRes().getContent(langrestype, false) != ''>${obj.getCapPSLanguageRes().getContent(langrestype, false)}<#elseif obj.getTooltip()??>${obj.getTooltip()}</#if>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册