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

Merge branch 'dev'

上级 929d6bc0
...@@ -21,3 +21,25 @@ ...@@ -21,3 +21,25 @@
</#list> </#list>
</#if> </#if>
</#macro> </#macro>
<#-- 获取导航上下文 -->
<#macro getNavigateContext currentItem>
{<#t>
<#if currentItem.getPSNavigateContexts?? && currentItem.getPSNavigateContexts()??>
<#list currentItem.getPSNavigateContexts() as navContext>
${navContext.getKey()}:<#if navContext.isRawValue()?? && navContext.isRawValue() == true>"${navContext.getValue()}"<#else>"%${navContext.getValue()}%"</#if><#if navContext_has_next>,</#if><#t>
</#list>
</#if>
}<#t>
</#macro>
<#-- 获取导航参数 -->
<#macro getNavigateParams currentItem>
{<#t>
<#if currentItem.getPSNavigateParams?? && currentItem.getPSNavigateParams()??>
<#list currentItem.getPSNavigateParams() as navParam >
${navParam.getKey()}:<#if navParam.isRawValue()?? && navParam.isRawValue() == true>"${navParam.getValue()}"<#else>"%${navParam.getValue()}%"</#if><#if navParam_has_next>,</#if><#t>
</#list>
</#if>
}<#t>
</#macro>
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
ref='${ctrl.name}' ref='${ctrl.name}'
:viewparams="viewparams" :viewparams="viewparams"
:context="context" :context="context"
:formData="formData"
<#if ctrl.getPSAppDataEntity()??>parentName = "${ctrl.getPSAppDataEntity().getCodeName()}"</#if> <#if ctrl.getPSAppDataEntity()??>parentName = "${ctrl.getPSAppDataEntity().getCodeName()}"</#if>
<#if view.getViewType() == 'DEEDITVIEW4'> <#if view.getViewType() == 'DEEDITVIEW4'>
:isShowSlot="false" :isShowSlot="false"
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<#if ctrl.getEmbeddedPSAppDEView()??><#assign embedddevedview = ctrl.getEmbeddedPSAppDEView()> <#if ctrl.getEmbeddedPSAppDEView()??><#assign embedddevedview = ctrl.getEmbeddedPSAppDEView()>
<${srffilepath2(embedddevedview.getCodeName())} <${srffilepath2(embedddevedview.getCodeName())}
class='viewcontainer2' class='viewcontainer2'
:viewdata="JSON.stringify(context)" :viewdata="viewdata"
:viewparam="JSON.stringify(getNavViewParams())" :viewparam="viewparam"
@viewload="viewDatasChange($event)" @viewload="viewDatasChange($event)"
:viewDefaultUsage="false" > :viewDefaultUsage="false" >
</${srffilepath2(embedddevedview.getCodeName())}></#if> </${srffilepath2(embedddevedview.getCodeName())}></#if>
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
</template> </template>
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/FUNC/MACRO.ftl
</#ibizinclude> </#ibizinclude>
/** /**
...@@ -42,6 +46,38 @@ ...@@ -42,6 +46,38 @@
*/ */
public isActivied: boolean = true; public isActivied: boolean = true;
/**
* 局部上下文
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public localContext: any = <#if ctrl.getPSNavigateContexts?? && ctrl.getPSNavigateContexts()??><@getNavigateContext ctrl /><#else>null</#if>;
/**
* 局部视图参数
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public localViewParam: any = <#if ctrl.getPSNavigateParams?? && ctrl.getPSNavigateParams()??><@getNavigateParams ctrl /><#else>null</#if>;
/**
* 传入上下文
*
* @type {string}
* @memberof TabExpViewtabviewpanel
*/
public viewdata: string = JSON.stringify(this.context);
/**
* 传入视图参数
*
* @type {string}
* @memberof PickupViewpickupviewpanel
*/
public viewparam: string = JSON.stringify(this.viewparams);
/** /**
* 视图面板过滤项 * 视图面板过滤项
* *
...@@ -66,6 +102,7 @@ ...@@ -66,6 +102,7 @@
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public afterCreated(){ public afterCreated(){
this.initNavParam();
if (this.viewState) { if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => { this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) { if (!Object.is(tag, this.name)) {
...@@ -85,18 +122,24 @@ ...@@ -85,18 +122,24 @@
} }
/** /**
* 传入导航视图参数 * 初始化导航参数
* *
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public getNavViewParams(){ public initNavParam(){
if(Object.is(this.navfilter,"")){ if(!Object.is(this.navfilter,"")){
return this.viewparams; Object.assign(this.viewparams,{[this.navfilter]:this.context['majorentity']})
}else{ }
let tempViewParams:any = JSON.parse(JSON.stringify(this.viewparams)); if(this.localContext && Object.keys(this.localContext).length >0){
Object.assign(tempViewParams,{[this.navfilter]:this.context['${ctrl.getPSAppDataEntity().getCodeName()?lower_case}']}); let _context:any = this.$util.computedNavData({},this.context,this.viewparams,this.localContext);
return tempViewParams; Object.assign(this.context,_context);
}
if(this.localViewParam && Object.keys(this.localViewParam).length >0){
let _param:any = this.$util.computedNavData({},this.context,this.viewparams,this.localViewParam);
Object.assign(this.viewparams,_param);
} }
this.viewdata =JSON.stringify(this.context);
this.viewparam = JSON.stringify(this.viewparams);
} }
/** /**
......
<#assign content> <view_${ctrl.getName()}
v-if="isInit.${ctrl.name}" :viewState="viewState"
@viewpanelDatasChange = "tabViewPanelDatasChange" :viewparams="JSON.parse(JSON.stringify(viewparams))"
</#assign> :context="JSON.parse(JSON.stringify(context))"
<#ibizinclude> v-if="isInit.${ctrl.name}"
../@MACRO/HTML/DEFAULT.html.ftl name="${ctrl.name}"
</#ibizinclude> ref='${ctrl.name}'
\ No newline at end of file @viewpanelDatasChange = "tabViewPanelDatasChange"
<#if ctrl.getHookEventNames()??>
<#list ctrl.getHookEventNames() as eventName>
@${eventName?lower_case}="${ctrl.name}_${eventName?lower_case}($event)"
</#list>
</#if>
@closeview="closeView($event)">
</view_${ctrl.getName()}>
\ No newline at end of file
...@@ -44,7 +44,8 @@ ...@@ -44,7 +44,8 @@
:is="selection.view.viewname" :is="selection.view.viewname"
class="viewcontainer2" class="viewcontainer2"
:viewDefaultUsage="false" :viewDefaultUsage="false"
:viewdata="JSON.stringify(selection.data)"> :viewdata="JSON.stringify(selection.context)"
:viewparam="JSON.stringify(selection.viewparam)">
</component> </component>
</div> </div>
</split> </split>
...@@ -56,6 +57,33 @@ ...@@ -56,6 +57,33 @@
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
<#ibizinclude>
../@MACRO/FUNC/MACRO.ftl
</#ibizinclude>
<#if view.getPSAppViewLogics?? && view.getPSAppViewLogics()??>
<#list view.getPSAppViewLogics() as logic>
<#if logic.getPFLogicCodeType() == 'APP_NEWDATA'>
/**
* 打开新建数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public newdata: any;
</#if>
<#if logic.getPFLogicCodeType() == 'APP_OPENDATA'>
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public opendata: any;
</#if>
</#list>
</#if>
/** /**
* 视图唯一标识 * 视图唯一标识
* *
...@@ -141,6 +169,30 @@ ...@@ -141,6 +169,30 @@
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public navFilter: string = "<#if xDataControl.getNavFilter()??>${xDataControl.getNavFilter()}</#if>"; public navFilter: string = "<#if xDataControl.getNavFilter()??>${xDataControl.getNavFilter()}</#if>";
/**
* 导航关系
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navPSDer: string = "<#if xDataControl.getNavPSDER()??>n_${xDataControl.getNavPSDER().getPSPickupDEField().getCodeName()?lower_case}_eq</#if>";
/**
* 导航上下文参数
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navigateContext:any = <#if xDataControl.getPSNavigateContexts?? && xDataControl.getPSNavigateContexts()??><@getNavigateContext xDataControl /><#else>null</#if>;
/**
* 导航视图参数
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navigateParams:any = <#if xDataControl.getPSNavigateParams?? && xDataControl.getPSNavigateParams()??><@getNavigateParams xDataControl /><#else>null</#if>;
</#if> </#if>
/** /**
...@@ -290,24 +342,39 @@ ...@@ -290,24 +342,39 @@
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public ${ctrl.name}_selectionchange(args: any [], tag?: string, $event2?: any): void { public ${ctrl.name}_selectionchange(args: any [], tag?: string, $event2?: any): void {
let data:any = {}; let tempContext:any = {};
let tempViewParam:any = {};
if (args.length === 0) { if (args.length === 0) {
return ; return ;
} }
const arg:any = args[0]; const arg:any = args[0];
if(this.context){ if(this.context){
Object.assign(data,JSON.parse(JSON.stringify(this.context))); Object.assign(tempContext,JSON.parse(JSON.stringify(this.context)));
} }
<#if ctrl.getXDataPSControl()??> <#if ctrl.getXDataPSControl()??>
<#assign xDataControl = ctrl.getXDataPSControl()/> <#assign xDataControl = ctrl.getXDataPSControl()/>
<#if xDataControl.getPSAppDataEntity()??> <#if xDataControl.getPSAppDataEntity()??>
<#assign curDataEntity = xDataControl.getPSAppDataEntity()/> <#assign curDataEntity = xDataControl.getPSAppDataEntity()/>
Object.assign(data,{'${curDataEntity.getCodeName()?lower_case}':arg['${curDataEntity.getCodeName()?lower_case}']}); Object.assign(tempContext,{'${curDataEntity.getCodeName()?lower_case}':arg['${curDataEntity.getCodeName()?lower_case}']});
Object.assign(data,{srfparentdename:'${curDataEntity.getCodeName()}',srfparentkey:arg['${curDataEntity.getCodeName()?lower_case}']}); Object.assign(tempContext,{srfparentdename:'${curDataEntity.getCodeName()}',srfparentkey:arg['${curDataEntity.getCodeName()?lower_case}']});
if(this.navFilter && !Object.is(this.navFilter,"")){
Object.assign(tempViewParam,{[this.navFilter]:arg['${curDataEntity.getCodeName()?lower_case}']});
}
if(this.navPSDer && !Object.is(this.navPSDer,"")){
Object.assign(tempViewParam,{[this.navPSDer]:arg['${curDataEntity.getCodeName()?lower_case}']});
}
</#if> </#if>
</#if> </#if>
if(this.navigateContext && Object.keys(this.navigateContext).length >0){
let _context:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navigateContext);
Object.assign(tempContext,_context);
}
if(this.navigateParams && Object.keys(this.navigateParams).length >0){
let _params:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navigateParams);
Object.assign(tempViewParam,_params);
}
this.selection = {}; this.selection = {};
Object.assign(this.selection, { view: { viewname: this.navViewName }, data:data }); Object.assign(this.selection, { view: { viewname: this.navViewName },context:tempContext,viewparam:tempViewParam});
this.$emit('selectionchange',args); this.$emit('selectionchange',args);
this.$forceUpdate(); this.$forceUpdate();
} }
......
...@@ -3,6 +3,16 @@ ...@@ -3,6 +3,16 @@
<#if view.getViewType() == 'DELISTEXPVIEW'> <#if view.getViewType() == 'DELISTEXPVIEW'>
:viewUID="viewUID" :viewUID="viewUID"
</#if> </#if>
<#if view.getPSAppViewLogics?? && view.getPSAppViewLogics()??>
<#list view.getPSAppViewLogics() as logic>
<#if logic.getPFLogicCodeType() == 'APP_NEWDATA'>
:newdata="newdata"
</#if>
<#if logic.getPFLogicCodeType() == 'APP_OPENDATA'>
:opendata="opendata"
</#if>
</#list>
</#if>
</#assign> </#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl ../@MACRO/HTML/DEFAULT.html.ftl
......
...@@ -44,7 +44,8 @@ ...@@ -44,7 +44,8 @@
:is="selection.view.viewname" :is="selection.view.viewname"
class="viewcontainer2" class="viewcontainer2"
:viewDefaultUsage="false" :viewDefaultUsage="false"
:viewdata="JSON.stringify(selection.data)"> :viewdata="JSON.stringify(selection.context)"
:viewparam="JSON.stringify(selection.viewparam)">
</component> </component>
</div> </div>
</split> </split>
...@@ -54,6 +55,10 @@ ...@@ -54,6 +55,10 @@
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/FUNC/MACRO.ftl
</#ibizinclude> </#ibizinclude>
/** /**
...@@ -141,6 +146,30 @@ ...@@ -141,6 +146,30 @@
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public navFilter: string = "<#if xDataControl.getNavFilter()??>${xDataControl.getNavFilter()}</#if>"; public navFilter: string = "<#if xDataControl.getNavFilter()??>${xDataControl.getNavFilter()}</#if>";
/**
* 导航关系
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navPSDer: string = "<#if xDataControl.getNavPSDER()??>n_${xDataControl.getNavPSDER().getPSPickupDEField().getCodeName()?lower_case}_eq</#if>";
/**
* 导航上下文参数
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navigateContext:any = <#if xDataControl.getPSNavigateContexts?? && xDataControl.getPSNavigateContexts()??><@getNavigateContext xDataControl /><#else>null</#if>;
/**
* 导航视图参数
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navigateParams:any = <#if xDataControl.getPSNavigateParams?? && xDataControl.getPSNavigateParams()??><@getNavigateParams xDataControl /><#else>null</#if>;
</#if> </#if>
/** /**
...@@ -294,24 +323,39 @@ ...@@ -294,24 +323,39 @@
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public ${ctrl.name}_selectionchange(args: any [], tag?: string, $event2?: any): void { public ${ctrl.name}_selectionchange(args: any [], tag?: string, $event2?: any): void {
let data:any = {}; let tempContext:any = {};
let tempViewParam:any = {};
if (args.length === 0) { if (args.length === 0) {
return ; return ;
} }
const arg:any = args[0]; const arg:any = args[0];
if(this.context){
Object.assign(tempContext,JSON.parse(JSON.stringify(this.context)));
}
<#if ctrl.getXDataPSControl()??> <#if ctrl.getXDataPSControl()??>
<#assign xDataControl = ctrl.getXDataPSControl()/> <#assign xDataControl = ctrl.getXDataPSControl()/>
<#if xDataControl.getPSAppDataEntity()??> <#if xDataControl.getPSAppDataEntity()??>
<#assign curDataEntity = xDataControl.getPSAppDataEntity()/> <#assign curDataEntity = xDataControl.getPSAppDataEntity()/>
Object.assign(data,{'${curDataEntity.getCodeName()?lower_case}':arg['${curDataEntity.getCodeName()?lower_case}']}); Object.assign(tempContext,{'${curDataEntity.getCodeName()?lower_case}':arg['${curDataEntity.getCodeName()?lower_case}']});
Object.assign(data,{srfparentdename:'${curDataEntity.getCodeName()}',srfparentkey:arg['${curDataEntity.getCodeName()?lower_case}']}); Object.assign(tempContext,{srfparentdename:'${curDataEntity.getCodeName()}',srfparentkey:arg['${curDataEntity.getCodeName()?lower_case}']});
if(this.navFilter && !Object.is(this.navFilter,"")){
Object.assign(tempViewParam,{[this.navFilter]:arg['${curDataEntity.getCodeName()?lower_case}']});
}
if(this.navPSDer && !Object.is(this.navPSDer,"")){
Object.assign(tempViewParam,{[this.navPSDer]:arg['${curDataEntity.getCodeName()?lower_case}']});
}
</#if> </#if>
</#if> </#if>
if(this.context){ if(this.navigateContext && Object.keys(this.navigateContext).length >0){
Object.assign(data,JSON.parse(JSON.stringify(this.context))); let _context:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navigateContext);
Object.assign(tempContext,_context);
}
if(this.navigateParams && Object.keys(this.navigateParams).length >0){
let _params:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navigateParams);
Object.assign(tempViewParam,_params);
} }
this.selection = {}; this.selection = {};
Object.assign(this.selection, { view: { viewname: this.navViewName }, data:data }); Object.assign(this.selection, { view: { viewname: this.navViewName },context:tempContext,viewparam:tempViewParam});
this.$emit('selectionchange',args); this.$emit('selectionchange',args);
this.$forceUpdate(); this.$forceUpdate();
} }
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
/** /**
* 部件行为--init * 部件行为--init
* *
......
<#-- content --> <#-- content -->
<#assign content> <#assign content>
:showBusyIndicator="${ctrl.isShowBusyIndicator()?c}" :showBusyIndicator="${ctrl.isShowBusyIndicator()?c}"
<#if view.getViewType() == 'APPINDEXVIEW'>
v-model="collapseChange" v-model="collapseChange"
:mode="mode" :mode="mode"
:selectTheme="selectTheme" :selectTheme="selectTheme"
:isDefaultPage="isDefaultPage" :isDefaultPage="isDefaultPage"
:defPSAppView="defPSAppView" :defPSAppView="defPSAppView"
</#if>
</#assign> </#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl ../@MACRO/HTML/DEFAULT.html.ftl
......
...@@ -23,11 +23,16 @@ ...@@ -23,11 +23,16 @@
</#list> </#list>
</tabs> </tabs>
</div> </div>
</template> </template>
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
<#ibizinclude>
../@MACRO/FUNC/MACRO.ftl
</#ibizinclude>
/** /**
* 是否显示插槽 * 是否显示插槽
* *
...@@ -44,6 +49,14 @@ ...@@ -44,6 +49,14 @@
*/ */
@Prop() public parentName!: string; @Prop() public parentName!: string;
/**
* 表单数据
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop({default:{}}) public formData?:any;
/** /**
* 获取多项数据 * 获取多项数据
* *
...@@ -99,6 +112,24 @@ ...@@ -99,6 +112,24 @@
</#list> </#list>
]; ];
/**
* 关系栏数据项导航参数集合
*
* @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navParamsArray:Array<any> = [
<#if ctrl.getPSDEDRCtrlItems?? && ctrl.getPSDEDRCtrlItems()??>
<#list ctrl.getPSDEDRCtrlItems() as appdeDrCtrlItem>
{
id:'${appdeDrCtrlItem.getName()?lower_case}',
localContext:<#if appdeDrCtrlItem.getPSNavigateContexts?? && appdeDrCtrlItem.getPSNavigateContexts()??><@getNavigateContext appdeDrCtrlItem /><#else>null</#if>,
localViewParam:<#if appdeDrCtrlItem.getPSNavigateParams?? && appdeDrCtrlItem.getPSNavigateParams()??><@getNavigateParams appdeDrCtrlItem /><#else>null</#if>
}<#if appdeDrCtrlItem_has_next>,</#if>
</#list>
</#if>
];
/** /**
* 生命周期 * 生命周期
* *
...@@ -212,6 +243,36 @@ ...@@ -212,6 +243,36 @@
return null; return null;
} }
/**
* 初始化导航参数
*
* @param {*} drItem
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public initNavParam(drItem:any){
let returnNavParam:any = {};
if(drItem && drItem.id){
let curDRItem:any = this.navParamsArray.find((item:any) =>{
return Object.is(item.id,drItem.id);
})
if(curDRItem){
let localContext:any = curDRItem.localContext;
let localViewParam:any = curDRItem.localViewParam;
if(localContext && Object.keys(localContext).length >0){
let _context:any = this.$util.computedNavData(this.formData,this.context,this.viewparams,localContext);
returnNavParam.localContext = _context;
}
if(localViewParam && Object.keys(localViewParam).length >0){
let _params:any = this.$util.computedNavData(this.formData,this.context,this.viewparams,localViewParam);
returnNavParam.localViewParam = _params;
}
return returnNavParam;
}else{
return null;
}
}
}
/** /**
* 选中节点 * 选中节点
* *
...@@ -224,12 +285,18 @@ ...@@ -224,12 +285,18 @@
return; return;
} }
this.$emit('selectionchange', [item]); this.$emit('selectionchange', [item]);
let localNavParam:any = this.initNavParam(item);
const refview = this.getDRTabItem({ nodetype: item.id }); const refview = this.getDRTabItem({ nodetype: item.id });
this.selection = {}; this.selection = {};
const _context: any = { ...JSON.parse(JSON.stringify(this.context)) }; const _context: any = { ...JSON.parse(JSON.stringify(this.context)) };
if(localNavParam && localNavParam.localContext){
Object.assign(_context,localNavParam.localContext);
}
Object.assign(_context,{srfparentdename:this.parentName,srfparentkey:_context[this.parentName.toLowerCase()]}); Object.assign(_context,{srfparentdename:this.parentName,srfparentkey:_context[this.parentName.toLowerCase()]});
const _params: any = { ...JSON.parse(JSON.stringify(this.viewparams)) }; const _params: any = {};
if(localNavParam && localNavParam.localViewParam){
Object.assign(_params,localNavParam.localViewParam);
}
if (refview && refview.parentdatajo) { if (refview && refview.parentdatajo) {
Object.assign(_context, refview.parentdatajo); Object.assign(_context, refview.parentdatajo);
Object.assign(this.selection, { view: { viewname: refview.viewname }, data: _context, param: _params }); Object.assign(this.selection, { view: { viewname: refview.viewname }, data: _context, param: _params });
......
...@@ -28,6 +28,10 @@ ...@@ -28,6 +28,10 @@
</template> </template>
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/FUNC/MACRO.ftl
</#ibizinclude> </#ibizinclude>
/** /**
...@@ -58,6 +62,14 @@ ...@@ -58,6 +62,14 @@
*/ */
@Prop() public loadAction?: string; @Prop() public loadAction?: string;
/**
* 表单数据
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop({default:{}}) public formData?:any;
/** /**
* 数据选中项 * 数据选中项
* *
...@@ -93,6 +105,24 @@ ...@@ -93,6 +105,24 @@
</#list> </#list>
]; ];
/**
* 关系栏数据项导航参数集合
*
* @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navParamsArray:Array<any> = [
<#if ctrl.getPSDEDRCtrlItems?? && ctrl.getPSDEDRCtrlItems()??>
<#list ctrl.getPSDEDRCtrlItems() as appdeDrCtrlItem>
{
id:'${appdeDrCtrlItem.getName()?lower_case}',
localContext:<#if appdeDrCtrlItem.getPSNavigateContexts?? && appdeDrCtrlItem.getPSNavigateContexts()??><@getNavigateContext appdeDrCtrlItem /><#else>null</#if>,
localViewParam:<#if appdeDrCtrlItem.getPSNavigateParams?? && appdeDrCtrlItem.getPSNavigateParams()??><@getNavigateParams appdeDrCtrlItem /><#else>null</#if>
}<#if appdeDrCtrlItem_has_next>,</#if>
</#list>
</#if>
];
/** /**
* 默认打开项 * 默认打开项
* *
...@@ -229,6 +259,36 @@ ...@@ -229,6 +259,36 @@
return item; return item;
} }
/**
* 初始化导航参数
*
* @param {*} drItem
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public initNavParam(drItem:any){
let returnNavParam:any = {};
if(drItem && drItem.id){
let curDRItem:any = this.navParamsArray.find((item:any) =>{
return Object.is(item.id,drItem.id);
})
if(curDRItem){
let localContext:any = curDRItem.localContext;
let localViewParam:any = curDRItem.localViewParam;
if(localContext && Object.keys(localContext).length >0){
let _context:any = this.$util.computedNavData(this.formData,this.context,this.viewparams,localContext);
returnNavParam.localContext = _context;
}
if(localViewParam && Object.keys(localViewParam).length >0){
let _params:any = this.$util.computedNavData(this.formData,this.context,this.viewparams,localViewParam);
returnNavParam.localViewParam = _params;
}
return returnNavParam;
}else{
return null;
}
}
}
/** /**
* 节点选中 * 节点选中
* *
...@@ -240,13 +300,18 @@ ...@@ -240,13 +300,18 @@
if (Object.is(item.id, this.selection.id)) { if (Object.is(item.id, this.selection.id)) {
return; return;
} }
this.$emit('selectionchange', [item]); this.$emit('selectionchange', [item]);
let localNavParam:any = this.initNavParam(item);
const refview = this.getDRBarItem({ nodetype: item.id }); const refview = this.getDRBarItem({ nodetype: item.id });
this.selection = {}; this.selection = {};
const _context: any = { ...JSON.parse(JSON.stringify(this.context)) }; const _context: any = { ...JSON.parse(JSON.stringify(this.context)) };
const _params: any = { ...JSON.parse(JSON.stringify(this.viewparams)) }; if(localNavParam && localNavParam.localContext){
Object.assign(_context,localNavParam.localContext);
}
const _params: any = {};
if(localNavParam && localNavParam.localViewParam){
Object.assign(_params,localNavParam.localViewParam);
}
if (refview && refview.parentdatajo) { if (refview && refview.parentdatajo) {
Object.assign(_context, refview.parentdatajo); Object.assign(_context, refview.parentdatajo);
Object.assign(this.selection, { view: { viewname: refview.viewname }, data: _context, param: _params }); Object.assign(this.selection, { view: { viewname: refview.viewname }, data: _context, param: _params });
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
ref='${ctrl.name}' ref='${ctrl.name}'
:viewparams="viewparams" :viewparams="viewparams"
:context="context" :context="context"
:formData="formData"
<#if ctrl.getHookEventNames()??> <#if ctrl.getHookEventNames()??>
<#list ctrl.getHookEventNames() as eventName> <#list ctrl.getHookEventNames() as eventName>
@${eventName?lower_case}="${ctrl.name}_${eventName?lower_case}($event)" @${eventName?lower_case}="${ctrl.name}_${eventName?lower_case}($event)"
......
...@@ -7,17 +7,17 @@ ${item.render.code} ...@@ -7,17 +7,17 @@ ${item.render.code}
name:'<#if item.getCaption()??>${item.getCaption()}</#if>', name:'<#if item.getCaption()??>${item.getCaption()}</#if>',
type:'funnel', type:'funnel',
datasetIndex:${item.getIndex()}, datasetIndex:${item.getIndex()},
<#compress><#if item.getLeft()?? && item.getLeft() != "">left:"${item.getLeft()}",</#if> <#compress><#if item.getLeft()??>left:"${item.getLeft()}",</#if>
<#if item.getTop()?? && item.getTop() != 0>top:"${item.getTop()}",</#if> <#if item.getTop()??>top:"${item.getTop()}",</#if>
<#if item.getBottom()?? && item.getBottom() != 0>bottom:"${item.getBottom()}",</#if> <#if item.getBottom()??>bottom:"${item.getBottom()}",</#if>
<#if item.getRight()?? && item.getRight() != "">right:"${item.getRight()}",</#if> <#if item.getRight()??>right:"${item.getRight()}",</#if>
<#if item.getWidth()?? && item.getWidth() != "">width:"${item.getWidth()}",</#if> <#if item.getWidth()??>width:"${item.getWidth()}",</#if>
<#if item.getHeight()?? && item.getHeight() != "">height:"${item.getHeight()}",</#if> <#if item.getHeight()??>height:"${item.getHeight()}",</#if>
<#if item.getMinValue()?? && item.getMinValue() != 0 >min:"${item.getMinValue()}",</#if> <#if item.getMinValue()??>min:"${item.getMinValue()}",</#if>
<#if item.getMaxValue()?? && item.getMaxValue() != 0 >max:"${item.getMaxSize()}",</#if> <#if item.getMaxValue()??>max:"${item.getMaxSize()}",</#if>
<#if item.getMinSize()?? && item.getMinSize() != "">minSize:"${item.getMinSize()}",</#if> <#if item.getMinSize()??>minSize:"${item.getMinSize()}",</#if>
<#if item.getMaxSize()?? && item.getMaxSize() != "">maxSize: "${item.getMaxSize()}",</#if> <#if item.getMaxSize()??>maxSize: "${item.getMaxSize()}",</#if>
<#if item.getFunnelAlign()?? && item.getFunnelAlign() != "">funnelAlign:"${item.getFunnelAlign()}",</#if></#compress> <#if item.getFunnelAlign()??>funnelAlign:"${item.getFunnelAlign()}",</#if></#compress>
seriesLayoutBy:"${item.getSeriesLayoutBy()}", seriesLayoutBy:"${item.getSeriesLayoutBy()}",
encode:{ encode:{
<#if item.getPSChartSeriesEncode()??><#assign chartSeriesEncode = item.getPSChartSeriesEncode() /></#if> <#if item.getPSChartSeriesEncode()??><#assign chartSeriesEncode = item.getPSChartSeriesEncode() /></#if>
......
...@@ -8,11 +8,11 @@ ${item.render.code} ...@@ -8,11 +8,11 @@ ${item.render.code}
type:'pie', type:'pie',
datasetIndex:${item.getIndex()}, datasetIndex:${item.getIndex()},
<#compress><#if item.getLeft()?? && item.getLeft() != "">left:"${item.getLeft()}",</#if> <#compress><#if item.getLeft()?? && item.getLeft() != "">left:"${item.getLeft()}",</#if>
<#if item.getTop()?? && item.getTop() != 0>top:"${item.getTop()}",</#if> <#if item.getTop()??>top:"${item.getTop()}",</#if>
<#if item.getBottom()?? && item.getBottom() != 0>bottom:"${item.getBottom()}",</#if> <#if item.getBottom()??>bottom:"${item.getBottom()}",</#if>
<#if item.getRight()?? && item.getRight() != "">right:"${item.getRight()}",</#if> <#if item.getRight()??>right:"${item.getRight()}",</#if>
<#if item.getWidth()?? && item.getWidth() != "">width:"${item.getWidth()}",</#if> <#if item.getWidth()??>width:"${item.getWidth()}",</#if>
<#if item.getHeight()?? && item.getHeight() != "">height:"${item.getHeight()}",</#if></#compress> <#if item.getHeight()??>height:"${item.getHeight()}",</#if></#compress>
seriesLayoutBy:"${item.getSeriesLayoutBy()}", seriesLayoutBy:"${item.getSeriesLayoutBy()}",
encode:{ encode:{
<#if item.getPSChartSeriesEncode()??><#assign chartSeriesEncode = item.getPSChartSeriesEncode() /></#if> <#if item.getPSChartSeriesEncode()??><#assign chartSeriesEncode = item.getPSChartSeriesEncode() /></#if>
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
<#if ctrl.render??><#t> <#if ctrl.render??><#t>
${ctrl.render.code} ${ctrl.render.code}
<#else><#t> <#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> <div v-if="isNoData" class="chart-no-data"><i class="el-icon-data-analysis"></i>暂无数据</div>
<div v-else 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> </#if>
</div> </div>
</template> </template>
...@@ -105,6 +106,15 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -105,6 +106,15 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
</#if> </#if>
} }
/**
* 是否无数据
*
* @public
* @type {boolean}
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public isNoData: boolean = false;
/** /**
* 图表div绑定的id * 图表div绑定的id
* *
...@@ -307,9 +317,9 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -307,9 +317,9 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
let element:any = document.getElementById(this.chartId); let element:any = document.getElementById(this.chartId);
this.myChart = echarts.init(element); this.myChart = echarts.init(element);
} }
this.handleChartOPtion(codelist); let _chartOption = this.handleChartOPtion(codelist);
console.log(this.chartOption); console.log(_chartOption);
this.myChart.setOption(this.chartOption); this.myChart.setOption(_chartOption);
this.myChart.resize(); this.myChart.resize();
} }
...@@ -319,6 +329,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -319,6 +329,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
* @memberof ${srfclassname('${ctrl.name}')}Base * @memberof ${srfclassname('${ctrl.name}')}Base
*/ */
public handleChartOPtion(allcodelist:any){ public handleChartOPtion(allcodelist:any){
let _chartOption:any = JSON.parse(JSON.stringify(this.chartOption));
if(Object.keys(this.seriesModel).length > 0){ if(Object.keys(this.seriesModel).length > 0){
let tempDataSourceMap:Map<string,any> = new Map(); let tempDataSourceMap:Map<string,any> = new Map();
for(let i=0;i<Object.keys(this.seriesModel).length;i++){ for(let i=0;i<Object.keys(this.seriesModel).length;i++){
...@@ -330,12 +341,12 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -330,12 +341,12 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
} }
if(tempDataSourceMap.size > 0){ if(tempDataSourceMap.size > 0){
tempDataSourceMap.forEach((item:any) =>{ tempDataSourceMap.forEach((item:any) =>{
this.chartOption.dataset.push({'source':item}); _chartOption.dataset.push({'source':item});
}) })
} }
Object.keys(this.seriesModel).forEach((seriesName:string) =>{ Object.keys(this.seriesModel).forEach((seriesName:string) =>{
if(this.chartOption && this.chartOption.series.length > 0){ if(_chartOption && _chartOption.series.length > 0){
this.chartOption.series.forEach((item:any) =>{ _chartOption.series.forEach((item:any) =>{
if(this.seriesModel[seriesName].ecxObject){ if(this.seriesModel[seriesName].ecxObject){
item = Util.deepObjectMerge(item,this.seriesModel[seriesName].ecxObject); item = Util.deepObjectMerge(item,this.seriesModel[seriesName].ecxObject);
} }
...@@ -351,25 +362,26 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -351,25 +362,26 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
let tempSeries:any = this.seriesModel[seriesName]; let tempSeries:any = this.seriesModel[seriesName];
// 非雷达图 // 非雷达图
if(tempSeries && tempSeries.seriesIdField && tempSeries.seriesValues.length > 0 && !Object.is(tempSeries.type,'radar')){ if(tempSeries && tempSeries.seriesIdField && tempSeries.seriesValues.length > 0 && !Object.is(tempSeries.type,'radar')){
const returnIndex:number = this.chartOption.series.findIndex((item:any) =>{ const returnIndex:number = _chartOption.series.findIndex((item:any) =>{
return Object.is(item.id,seriesName); return Object.is(item.id,seriesName);
}) })
this.chartOption.series.splice(returnIndex,1); _chartOption.series.splice(returnIndex,1);
let tempSeriesArray:Array<any> = []; let tempSeriesArray:Array<any> = [];
tempSeries.seriesValues.forEach((seriesvalueItem:any) =>{ tempSeries.seriesValues.forEach((seriesvalueItem:any) =>{
let tempSeriesTemp:any = JSON.parse(JSON.stringify(tempSeries.seriesTemp)); let tempSeriesTemp:any = JSON.parse(JSON.stringify(tempSeries.seriesTemp));
<#noparse>Object.assign(tempSeriesTemp,{name:tempSeries.seriesMap[seriesvalueItem],datasetIndex:tempSeries.seriesIndex,encode:{x:tempSeries.categorField,y:`${seriesvalueItem}`}});</#noparse> <#noparse>Object.assign(tempSeriesTemp,{name:tempSeries.seriesMap[seriesvalueItem],datasetIndex:tempSeries.seriesIndex,encode:{x:tempSeries.categorField,y:`${seriesvalueItem}`}});</#noparse>
this.chartOption.series.push(tempSeriesTemp); _chartOption.series.push(tempSeriesTemp);
}) })
} }
}) })
} }
if(Object.keys(this.chartBaseOPtion).length > 0){ if(Object.keys(this.chartBaseOPtion).length > 0){
Object.assign(this.chartOption,this.chartBaseOPtion); Object.assign(_chartOption,this.chartBaseOPtion);
} }
if(Object.keys(this.chartUserParams).length >0){ if(Object.keys(this.chartUserParams).length >0){
Object.assign(this.chartOption,this.chartUserParams); Object.assign(_chartOption,this.chartUserParams);
} }
return _chartOption;
} }
/** /**
...@@ -387,8 +399,10 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -387,8 +399,10 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
*/ */
public async transformToBasicChartSetData(data:any,callback:Function){ public async transformToBasicChartSetData(data:any,callback:Function){
if(!data || !Array.isArray(data) || data.length === 0){ if(!data || !Array.isArray(data) || data.length === 0){
this.isNoData = true;
return; return;
} }
this.isNoData = false;
//获取代码表值 //获取代码表值
let allCodeList:any = await this.getChartAllCodeList(); let allCodeList:any = await this.getChartAllCodeList();
if(Object.values(this.seriesModel).length > 0){ if(Object.values(this.seriesModel).length > 0){
...@@ -635,10 +649,11 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -635,10 +649,11 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
let seriesValues:Array<any> = item.seriesValues; let seriesValues:Array<any> = item.seriesValues;
if(seriesValues && seriesValues.length >0){ if(seriesValues && seriesValues.length >0){
seriesValues.forEach((singleSeriesName:any) =>{ seriesValues.forEach((singleSeriesName:any) =>{
let singleSeriesObj:any = {type:singleSeriesName}; let singleSeriesObj:any = {};
returnArray.forEach((item:any) =>{ returnArray.forEach((item:any) =>{
Object.assign(singleSeriesObj,{[item[groupField[0]]]:item[singleSeriesName]}); Object.assign(singleSeriesObj,{[item[groupField[0]]]:item[singleSeriesName]});
}) })
Object.assign(singleSeriesObj,{type:singleSeriesName});
tempReturnArray.push(singleSeriesObj); tempReturnArray.push(singleSeriesObj);
}) })
} }
......
...@@ -4,4 +4,14 @@ ...@@ -4,4 +4,14 @@
.app-data-chart { .app-data-chart {
width: 100%; width: 100%;
height: 100%; height: 100%;
.chart-no-data{
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
i{
margin-right: 5px;
}
}
} }
\ No newline at end of file
...@@ -7,17 +7,17 @@ ${item.render.code} ...@@ -7,17 +7,17 @@ ${item.render.code}
name:'<#if item.getCaption()??>${item.getCaption()}</#if>', name:'<#if item.getCaption()??>${item.getCaption()}</#if>',
type:'funnel', type:'funnel',
datasetIndex:${item.getIndex()}, datasetIndex:${item.getIndex()},
<#compress><#if item.getLeft()?? && item.getLeft() != "">left:"${item.getLeft()}",</#if> <#compress><#if item.getLeft()??>left:"${item.getLeft()}",</#if>
<#if item.getTop()?? && item.getTop() != 0>top:"${item.getTop()}",</#if> <#if item.getTop()??>top:"${item.getTop()}",</#if>
<#if item.getBottom()?? && item.getBottom() != 0>bottom:"${item.getBottom()}",</#if> <#if item.getBottom()??>bottom:"${item.getBottom()}",</#if>
<#if item.getRight()?? && item.getRight() != "">right:"${item.getRight()}",</#if> <#if item.getRight()??>right:"${item.getRight()}",</#if>
<#if item.getWidth()?? && item.getWidth() != "">width:"${item.getWidth()}",</#if> <#if item.getWidth()??>width:"${item.getWidth()}",</#if>
<#if item.getHeight()?? && item.getHeight() != "">height:"${item.getHeight()}",</#if> <#if item.getHeight()??>height:"${item.getHeight()}",</#if>
<#if item.getMinValue()?? && item.getMinValue() != 0 >min:"${item.getMinValue()}",</#if> <#if item.getMinValue()??>min:"${item.getMinValue()}",</#if>
<#if item.getMaxValue()?? && item.getMaxValue() != 0 >max:"${item.getMaxSize()}",</#if> <#if item.getMaxValue()??>max:"${item.getMaxSize()}",</#if>
<#if item.getMinSize()?? && item.getMinSize() != "">minSize:"${item.getMinSize()}",</#if> <#if item.getMinSize()??>minSize:"${item.getMinSize()}",</#if>
<#if item.getMaxSize()?? && item.getMaxSize() != "">maxSize: "${item.getMaxSize()}",</#if> <#if item.getMaxSize()??>maxSize: "${item.getMaxSize()}",</#if>
<#if item.getFunnelAlign()?? && item.getFunnelAlign() != "">funnelAlign:"${item.getFunnelAlign()}",</#if></#compress> <#if item.getFunnelAlign()??>funnelAlign:"${item.getFunnelAlign()}",</#if></#compress>
seriesLayoutBy:"${item.getSeriesLayoutBy()}", seriesLayoutBy:"${item.getSeriesLayoutBy()}",
encode:{ encode:{
<#if item.getPSChartSeriesEncode()??><#assign chartSeriesEncode = item.getPSChartSeriesEncode() /></#if> <#if item.getPSChartSeriesEncode()??><#assign chartSeriesEncode = item.getPSChartSeriesEncode() /></#if>
......
...@@ -7,12 +7,12 @@ ${item.render.code} ...@@ -7,12 +7,12 @@ ${item.render.code}
name:'<#if item.getCaption()??>${item.getCaption()}</#if>', name:'<#if item.getCaption()??>${item.getCaption()}</#if>',
type:'pie', type:'pie',
datasetIndex:${item.getIndex()}, datasetIndex:${item.getIndex()},
<#compress><#if item.getLeft()?? && item.getLeft() != "">left:"${item.getLeft()}",</#if> <#compress><#if item.getLeft()??>left:"${item.getLeft()}",</#if>
<#if item.getTop()?? && item.getTop() != 0>top:"${item.getTop()}",</#if> <#if item.getTop()??>top:"${item.getTop()}",</#if>
<#if item.getBottom()?? && item.getBottom() != 0>bottom:"${item.getBottom()}",</#if> <#if item.getBottom()??>bottom:"${item.getBottom()}",</#if>
<#if item.getRight()?? && item.getRight() != "">right:"${item.getRight()}",</#if> <#if item.getRight()??>right:"${item.getRight()}",</#if>
<#if item.getWidth()?? && item.getWidth() != "">width:"${item.getWidth()}",</#if> <#if item.getWidth()??>width:"${item.getWidth()}",</#if>
<#if item.getHeight()?? && item.getHeight() != "">height:"${item.getHeight()}",</#if></#compress> <#if item.getHeight()??>height:"${item.getHeight()}",</#if></#compress>
seriesLayoutBy:"${item.getSeriesLayoutBy()}", seriesLayoutBy:"${item.getSeriesLayoutBy()}",
encode:{ encode:{
<#if item.getPSChartSeriesEncode()??><#assign chartSeriesEncode = item.getPSChartSeriesEncode() /></#if> <#if item.getPSChartSeriesEncode()??><#assign chartSeriesEncode = item.getPSChartSeriesEncode() /></#if>
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
<#if ctrl.render??><#t> <#if ctrl.render??><#t>
${ctrl.render.code} ${ctrl.render.code}
<#else><#t> <#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> <div v-if="isNoData" class="chart-no-data"><i class="el-icon-data-analysis"></i>暂无数据</div>
<div v-else 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> </#if>
</div> </div>
</template> </template>
...@@ -105,6 +106,15 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -105,6 +106,15 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
</#if> </#if>
} }
/**
* 是否无数据
*
* @public
* @type {boolean}
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public isNoData: boolean = false;
/** /**
* 图表div绑定的id * 图表div绑定的id
* *
...@@ -307,9 +317,9 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -307,9 +317,9 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
let element:any = document.getElementById(this.chartId); let element:any = document.getElementById(this.chartId);
this.myChart = echarts.init(element); this.myChart = echarts.init(element);
} }
this.handleChartOPtion(codelist); let _chartOption = this.handleChartOPtion(codelist);
console.log(this.chartOption); console.log(_chartOption);
this.myChart.setOption(this.chartOption); this.myChart.setOption(_chartOption);
this.myChart.resize(); this.myChart.resize();
} }
...@@ -319,6 +329,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -319,6 +329,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
* @memberof ${srfclassname('${ctrl.name}')}Base * @memberof ${srfclassname('${ctrl.name}')}Base
*/ */
public handleChartOPtion(allcodelist:any){ public handleChartOPtion(allcodelist:any){
let _chartOption:any = JSON.parse(JSON.stringify(this.chartOption));
if(Object.keys(this.seriesModel).length > 0){ if(Object.keys(this.seriesModel).length > 0){
let tempDataSourceMap:Map<string,any> = new Map(); let tempDataSourceMap:Map<string,any> = new Map();
for(let i=0;i<Object.keys(this.seriesModel).length;i++){ for(let i=0;i<Object.keys(this.seriesModel).length;i++){
...@@ -330,12 +341,12 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -330,12 +341,12 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
} }
if(tempDataSourceMap.size > 0){ if(tempDataSourceMap.size > 0){
tempDataSourceMap.forEach((item:any) =>{ tempDataSourceMap.forEach((item:any) =>{
this.chartOption.dataset.push({'source':item}); _chartOption.dataset.push({'source':item});
}) })
} }
Object.keys(this.seriesModel).forEach((seriesName:string) =>{ Object.keys(this.seriesModel).forEach((seriesName:string) =>{
if(this.chartOption && this.chartOption.series.length > 0){ if(_chartOption && _chartOption.series.length > 0){
this.chartOption.series.forEach((item:any) =>{ _chartOption.series.forEach((item:any) =>{
if(this.seriesModel[seriesName].ecxObject){ if(this.seriesModel[seriesName].ecxObject){
item = Util.deepObjectMerge(item,this.seriesModel[seriesName].ecxObject); item = Util.deepObjectMerge(item,this.seriesModel[seriesName].ecxObject);
} }
...@@ -351,25 +362,26 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -351,25 +362,26 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
let tempSeries:any = this.seriesModel[seriesName]; let tempSeries:any = this.seriesModel[seriesName];
// 非雷达图 // 非雷达图
if(tempSeries && tempSeries.seriesIdField && tempSeries.seriesValues.length > 0 && !Object.is(tempSeries.type,'radar')){ if(tempSeries && tempSeries.seriesIdField && tempSeries.seriesValues.length > 0 && !Object.is(tempSeries.type,'radar')){
const returnIndex:number = this.chartOption.series.findIndex((item:any) =>{ const returnIndex:number = _chartOption.series.findIndex((item:any) =>{
return Object.is(item.id,seriesName); return Object.is(item.id,seriesName);
}) })
this.chartOption.series.splice(returnIndex,1); _chartOption.series.splice(returnIndex,1);
let tempSeriesArray:Array<any> = []; let tempSeriesArray:Array<any> = [];
tempSeries.seriesValues.forEach((seriesvalueItem:any) =>{ tempSeries.seriesValues.forEach((seriesvalueItem:any) =>{
let tempSeriesTemp:any = JSON.parse(JSON.stringify(tempSeries.seriesTemp)); let tempSeriesTemp:any = JSON.parse(JSON.stringify(tempSeries.seriesTemp));
<#noparse>Object.assign(tempSeriesTemp,{name:tempSeries.seriesMap[seriesvalueItem],datasetIndex:tempSeries.seriesIndex,encode:{x:tempSeries.categorField,y:`${seriesvalueItem}`}});</#noparse> <#noparse>Object.assign(tempSeriesTemp,{name:tempSeries.seriesMap[seriesvalueItem],datasetIndex:tempSeries.seriesIndex,encode:{x:tempSeries.categorField,y:`${seriesvalueItem}`}});</#noparse>
this.chartOption.series.push(tempSeriesTemp); _chartOption.series.push(tempSeriesTemp);
}) })
} }
}) })
} }
if(Object.keys(this.chartBaseOPtion).length > 0){ if(Object.keys(this.chartBaseOPtion).length > 0){
Object.assign(this.chartOption,this.chartBaseOPtion); Object.assign(_chartOption,this.chartBaseOPtion);
} }
if(Object.keys(this.chartUserParams).length >0){ if(Object.keys(this.chartUserParams).length >0){
Object.assign(this.chartOption,this.chartUserParams); Object.assign(_chartOption,this.chartUserParams);
} }
return _chartOption;
} }
/** /**
...@@ -387,8 +399,10 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -387,8 +399,10 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
*/ */
public async transformToBasicChartSetData(data:any,callback:Function){ public async transformToBasicChartSetData(data:any,callback:Function){
if(!data || !Array.isArray(data) || data.length === 0){ if(!data || !Array.isArray(data) || data.length === 0){
this.isNoData = true;
return; return;
} }
this.isNoData = false;
//获取代码表值 //获取代码表值
let allCodeList:any = await this.getChartAllCodeList(); let allCodeList:any = await this.getChartAllCodeList();
if(Object.values(this.seriesModel).length > 0){ if(Object.values(this.seriesModel).length > 0){
...@@ -635,10 +649,11 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -635,10 +649,11 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
let seriesValues:Array<any> = item.seriesValues; let seriesValues:Array<any> = item.seriesValues;
if(seriesValues && seriesValues.length >0){ if(seriesValues && seriesValues.length >0){
seriesValues.forEach((singleSeriesName:any) =>{ seriesValues.forEach((singleSeriesName:any) =>{
let singleSeriesObj:any = {type:singleSeriesName}; let singleSeriesObj:any = {};
returnArray.forEach((item:any) =>{ returnArray.forEach((item:any) =>{
Object.assign(singleSeriesObj,{[item[groupField[0]]]:item[singleSeriesName]}); Object.assign(singleSeriesObj,{[item[groupField[0]]]:item[singleSeriesName]});
}) })
Object.assign(singleSeriesObj,{type:singleSeriesName});
tempReturnArray.push(singleSeriesObj); tempReturnArray.push(singleSeriesObj);
}) })
} }
......
...@@ -4,4 +4,14 @@ ...@@ -4,4 +4,14 @@
.app-data-chart { .app-data-chart {
width: 100%; width: 100%;
height: 100%; height: 100%;
.chart-no-data{
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
i{
margin-right: 5px;
}
}
} }
\ No newline at end of file
...@@ -4,32 +4,36 @@ ...@@ -4,32 +4,36 @@
<app-build @handleClick="handleClick"></app-build> <app-build @handleClick="handleClick"></app-build>
</row> </row>
<row v-if="!isHasCustomized"> <row v-if="!isHasCustomized">
<#-- BEGIN:看板Flex布局-前 -->
<#if ctrl.getLayoutMode?? && ctrl.getLayoutMode() == 'FLEX'>
<div style = 'display : flex; <#if ctrl.getFlexAlign()??> justify-content :${ctrl.getFlexAlign()};</#if> <#if ctrl.getFlexDir()??> flex-direction:${ctrl.getFlexDir()};</#if> <#if ctrl.getFlexVAlign()??>align-items:${ctrl.getFlexVAlign()};</#if> '>
</#if>
<#-- END:看板Flex布局-前 -->
<#list ctrl.getPSPortlets() as portlet><#t> <#list ctrl.getPSPortlets() as portlet><#t>
<#if portlet.getPortletType?? && portlet.getPortletType()??><#t> <#if portlet.getPortletType?? && portlet.getPortletType()??><#t>
<#-- BEGIN:处理参数layout,LayoutPos --> <#-- BEGIN:获取父的layout,自己的LayoutPos -->
<#assign layout='TABLE_24COL'> <#assign layout=ctrl.getLayoutMode()>
<#if portlet.getPSLayoutPos()??> <#assign LayoutPos = portlet.getPSLayoutPos()>
<#if portlet.getPSLayoutPos().getParentPSLayout()??> <#-- END:获取父的layout,自己的LayoutPos -->
<#assign layout='${portlet.getPSLayoutPos().getParentPSLayout().getLayout()}'> <#-- BEGIN:门户部件绘制,栅格布局 -->
</#if> <#if layout == 'TABLE_12COL'>
</#if> <#assign multiple = 2/>
<#assign LayoutPos = portlet.getPSLayoutPos()><#t> <#else>
<#-- END:处理参数layout,LayoutPos --> <#assign multiple = 1/>
<#-- BEGIN:第一个门户部件前 -->
<#if portlet_index == 0 >
<#list ctrl.getPSPortlets() as container><#t>
<#if container.getPortletType() == 'CONTAINER' && layout == 'FLEX'>
<#assign flexLayout = container.getPSLayout()><#t>
</#if> </#if>
</#list> <#macro format_numer num>
<div style = '<#if layout == 'FLEX' > display : flex; justify-content : ${flexLayout.getAlign()}; flex-direction:${flexLayout.getDir()} ;align-items:${flexLayout.getVAlign()};flex-wrap: wrap;</#if>'> <#if num lt 0 >
0<#t>
<#elseif num gt 24>
24<#t>
<#else>
${num}<#t>
</#if> </#if>
<#-- END:第一个门户部件前 --> </#macro>
<#-- BEGIN:门户部件绘制,栅格布局 --> <#if (layout == 'TABLE_24COL' || layout == 'TABLE_12COL') && LayoutPos??><#t>
<#if layout == 'TABLE_24COL' && LayoutPos??><#t> <i-col<#if LayoutPos.getColXS() != -1> :xs="{ span: <@format_numer LayoutPos.getColXS()*multiple/>, offset: <#if LayoutPos.getColXSOffset() != -1><@format_numer LayoutPos.getColXSOffset()*multiple /><#else>0</#if> }"</#if><#if LayoutPos.getColSM() != -1> :sm="{ span: <@format_numer LayoutPos.getColSM()*multiple />, offset: <#if LayoutPos.getColSMOffset() != -1><@format_numer LayoutPos.getColSMOffset()*multiple /><#else>0</#if> }"</#if><#if LayoutPos.getColMD() != -1> :md="{ span: <@format_numer LayoutPos.getColMD()*multiple />, offset: <#if LayoutPos.getColMDOffset() != -1><@format_numer LayoutPos.getColMDOffset()*multiple /><#else>0</#if> }"</#if><#if LayoutPos.getColLG() != -1> :lg="{ span: <@format_numer LayoutPos.getColLG()*multiple />, offset: <#if LayoutPos.getColLGOffset() != -1><@format_numer LayoutPos.getColLGOffset()*multiple /><#else>0</#if> }"</#if>>
<i-col<#if LayoutPos.getColXS() != -1> :xs="{ span: ${LayoutPos.getColXS()}, offset: <#if LayoutPos.getColXSOffset() != -1>${LayoutPos.getColXSOffset()}<#else>0</#if>}"</#if><#if LayoutPos.getColSM() != -1> :sm="{ span: ${LayoutPos.getColSM()}, offset: <#if LayoutPos.getColSMOffset() != -1>${LayoutPos.getColSMOffset()}<#else>0</#if>}"</#if><#if LayoutPos.getColMD() != -1> :md="{ span: ${LayoutPos.getColMD()}, offset: <#if LayoutPos.getColMDOffset() != -1>${LayoutPos.getColMDOffset()}<#else>0</#if> }"</#if><#if LayoutPos.getColLG() != -1> :lg="{ span: ${LayoutPos.getColLG()}, offset: <#if LayoutPos.getColLGOffset() != -1>${LayoutPos.getColLGOffset()}<#else>0</#if> }"</#if>>
<card class="portlet-card" :bordered="false" dis-hover :padding="0"> <card class="portlet-card" :bordered="false" dis-hover :padding="0">
<#if portlet.isShowTitleBar() && portlet.getTitle()?has_content> <#if portlet.getPortletType() == 'CONTAINER' && portlet.isShowTitleBar() && portlet.getTitle()?has_content>
<p slot='title'> <p slot='title'>
${portlet.getTitle()} ${portlet.getTitle()}
<span class="line"></span> <span class="line"></span>
...@@ -43,12 +47,13 @@ ...@@ -43,12 +47,13 @@
</span> </span>
</card> </card>
</i-col> </i-col>
<#-- ELSE:门户部件布局,Flex --> <#-- ELSE:门户部件绘制,Flex -->
<#else> <#else>
<card class="portlet-card" :bordered="false" dis-hover :padding="0"> <card class="portlet-card" :bordered="false" dis-hover :padding="0">
<#if portlet.isShowTitleBar() && portlet.getTitle()?has_content><#t> <#if portlet.getPortletType() == 'CONTAINER' && portlet.isShowTitleBar() && portlet.getTitle()?has_content>
<p slot='title'> <p slot='title'>
${portlet.getTitle()} ${portlet.getTitle()}
<span class="line"></span>
</p> </p>
<a slot='extra'></a> <a slot='extra'></a>
</#if> </#if>
...@@ -59,14 +64,14 @@ ...@@ -59,14 +64,14 @@
</span> </span>
</card> </card>
</#if> </#if>
<#-- END:门户部件布局 --> <#-- END:门户部件绘制 -->
<#-- BEGIN:最后一个门户部件后 -->
<#if !portlet_has_next>
</div>
</#if>
<#-- END:最后一个门户部件后 -->
</#if> </#if>
</#list> </#list>
<#-- BEGIN:看板Flex布局-后 -->
<#if ctrl.getLayoutMode?? && ctrl.getLayoutMode() == 'FLEX'>
</div>
</#if>
<#-- END:看板Flex布局-后 -->
</row> </row>
<row v-if="isHasCustomized" style="width: 100%;min-height: calc(100% - 40px);"> <row v-if="isHasCustomized" style="width: 100%;min-height: calc(100% - 40px);">
<div class="portlet-container" style="position: relative;width:100%;"> <div class="portlet-container" style="position: relative;width:100%;">
...@@ -253,7 +258,12 @@ import UtilService from '@/utilservice/util-service'; ...@@ -253,7 +258,12 @@ import UtilService from '@/utilservice/util-service';
this.isHasCustomized = false; this.isHasCustomized = false;
this.notifyState(); this.notifyState();
} }
}) }).catch((error:any)=>{
console.error("加载面板模型异常");
console.error(error);
this.isHasCustomized = false;
this.notifyState();
});
}) })
}else{ }else{
this.notifyState(); this.notifyState();
......
<#ibizinclude> <script lang='tsx'>
../@MACRO/CONTROL/CONTROL.vue.ftl import { Component } from 'vue-property-decorator';
</#ibizinclude> import ${srfclassname('${ctrl.codeName}')}Base from './${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}-base.vue';
\ No newline at end of file <#if ctrl.getPSControls?? && ctrl.getPSControls()??>
<#list ctrl.getPSControls() as subctrl>
<#if subctrl.getControlType() != 'TOOLBAR' && subctrl.getControlType() != 'CONTEXTMENU' && (subctrl.getControlType() != 'PORTLET' || subctrl.getPortletType() != 'CONTAINER') >
<#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>
<#if ctrl.getPSLayoutPanels?? && ctrl.getPSLayoutPanels()??>
<#list ctrl.getPSLayoutPanels() as panel>
import layout_${panel.getName()} from '@widgets/${srffilepath2(panel.getPSAppDataEntity().getCodeName())}/${srffilepath2(panel.getCodeName())}-${panel.getControlType()?lower_case}/${srffilepath2(panel.getCodeName())}-${panel.getControlType()?lower_case}.vue';
</#list>
</#if>
<#if import_block??>${import_block}</#if>
@Component({
components: {
<#if ctrl.getPSControls?? && ctrl.getPSControls()??>
<#list ctrl.getPSControls() as subctrl>
<#if subctrl.getControlType() != 'TOOLBAR' && subctrl.getControlType() != 'CONTEXTMENU' && (subctrl.getControlType() != 'PORTLET' || subctrl.getPortletType() != 'CONTAINER') >
view_${subctrl.getName()},
</#if>
</#list>
</#if>
<#if ctrl.getPSLayoutPanels?? && ctrl.getPSLayoutPanels()??>
<#list ctrl.getPSLayoutPanels() as panel>
layout_${panel.getName()},
</#list>
</#if>
<#if components??>${components}</#if>
}
})
export default class ${srfclassname('${ctrl.codeName}')} extends ${srfclassname('${ctrl.codeName}')}Base {
}
</script>
\ No newline at end of file
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<el-card shadow="always" :class="[ item.isselected === true ? 'isselected' : false, 'single-card-data' ]" @click.native="handleClick(item)" @dblclick.native="handleDblClick(item)"> <el-card shadow="always" :class="[ item.isselected === true ? 'isselected' : false, 'single-card-data' ]" @click.native="handleClick(item)" @dblclick.native="handleDblClick(item)">
<#if ctrl.getItemPSLayoutPanel()??> <#if ctrl.getItemPSLayoutPanel()??>
<#assign panel = ctrl.getItemPSLayoutPanel()> <#assign panel = ctrl.getItemPSLayoutPanel()>
<layout_${panel.getName()} name='${panel.name}' :data="item"></layout_${panel.getName()}> <layout_${panel.getName()} name='${panel.name}' :inputData="item"></layout_${panel.getName()}>
<#elseif ctrl.itemRender??> <#elseif ctrl.itemRender??>
${ctrl.itemRender.code} ${ctrl.itemRender.code}
<#else> <#else>
......
...@@ -44,7 +44,8 @@ ...@@ -44,7 +44,8 @@
:is="selection.view.viewname" :is="selection.view.viewname"
class="viewcontainer2" class="viewcontainer2"
:viewDefaultUsage="false" :viewDefaultUsage="false"
:viewdata="JSON.stringify(selection.data)"> :viewdata="JSON.stringify(selection.context)"
:viewparam="JSON.stringify(selection.viewparam)">
</component> </component>
</div> </div>
</split> </split>
...@@ -54,6 +55,10 @@ ...@@ -54,6 +55,10 @@
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/FUNC/MACRO.ftl
</#ibizinclude> </#ibizinclude>
/** /**
...@@ -64,6 +69,29 @@ ...@@ -64,6 +69,29 @@
*/ */
@Prop() public viewUID!:string; @Prop() public viewUID!:string;
<#if view.getPSAppViewLogics?? && view.getPSAppViewLogics()??>
<#list view.getPSAppViewLogics() as logic>
<#if logic.getPFLogicCodeType() == 'APP_NEWDATA'>
/**
* 打开新建数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() public newdata: any;
</#if>
<#if logic.getPFLogicCodeType() == 'APP_OPENDATA'>
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() public opendata: any;
</#if>
</#list>
</#if>
/** /**
* 是否单选 * 是否单选
* *
...@@ -127,21 +155,24 @@ ...@@ -127,21 +155,24 @@
public navViewName: any = { public navViewName: any = {
<#if xDataControl.getPSSysCalendarItems()??> <#if xDataControl.getPSSysCalendarItems()??>
<#list xDataControl.getPSSysCalendarItems() as calendarItem> <#list xDataControl.getPSSysCalendarItems() as calendarItem>
${calendarItem.getItemType()}: "<#if calendarItem.getNavPSAppView?? && calendarItem.getNavPSAppView()??><#assign navPSAppView = calendarItem.getNavPSAppView() />${srffilepath2(navPSAppView.getCodeName())}</#if>", ${calendarItem.getItemType()}: "<#if calendarItem.getNavPSAppView?? && calendarItem.getNavPSAppView()??><#assign navPSAppView = calendarItem.getNavPSAppView() />${srffilepath2(navPSAppView.getCodeName())}</#if>"<#if calendarItem_has_next>,</#if>
</#list> </#list>
</#if> </#if>
}; };
/** /**
* 导航视图参数 * 导航参数
* *
* @type {string} * @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public navViewParam: any = { public navParam: any = {
<#if xDataControl.getPSSysCalendarItems()??> <#if xDataControl.getPSSysCalendarItems()??>
<#list xDataControl.getPSSysCalendarItems() as calendarItem> <#list xDataControl.getPSSysCalendarItems() as calendarItem>
${calendarItem.getItemType()}: '<#if calendarItem.getNavViewParamJO?? && calendarItem.getNavViewParamJO()??>${calendarItem.getNavViewParamJO()}</#if>', ${calendarItem.getItemType()}: {
navigateContext:<#if calendarItem.getPSNavigateContexts?? && calendarItem.getPSNavigateContexts()??><@getNavigateContext calendarItem /><#else>null</#if>,
navigateParams:<#if calendarItem.getPSNavigateParams?? && calendarItem.getPSNavigateParams()??><@getNavigateParams calendarItem /><#else>null</#if>
}<#if calendarItem_has_next>,</#if>
</#list> </#list>
</#if> </#if>
}; };
...@@ -149,18 +180,32 @@ ...@@ -149,18 +180,32 @@
/** /**
* 导航过滤项 * 导航过滤项
* *
* @type {string} * @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
</#if>
public navFilter: any = { public navFilter: any = {
<#if xDataControl.getPSSysCalendarItems()??> <#if xDataControl.getPSSysCalendarItems()??>
<#list xDataControl.getPSSysCalendarItems() as calendarItem> <#list xDataControl.getPSSysCalendarItems() as calendarItem>
${calendarItem.getItemType()}: "<#if calendarItem.getNavFilter?? && calendarItem.getNavFilter()??>${calendarItem.getNavFilter()}</#if>", ${calendarItem.getItemType()}: "<#if calendarItem.getNavFilter?? && calendarItem.getNavFilter()??>${calendarItem.getNavFilter()}</#if>"<#if calendarItem_has_next>,</#if>
</#list> </#list>
</#if> </#if>
}; };
/**
* 导航关系
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navPSDer: any = {
<#if xDataControl.getPSSysCalendarItems()??>
<#list xDataControl.getPSSysCalendarItems() as calendarItem>
${calendarItem.getItemType()}: "<#if calendarItem.getNavPSDER?? && calendarItem.getNavPSDER()??>n_${calendarItem.getNavPSDER().getPSPickupDEField().getCodeName()?lower_case}_eq</#if>"<#if calendarItem_has_next>,</#if>
</#list>
</#if>
};
</#if>
/** /**
* 显示处理提示 * 显示处理提示
* *
...@@ -319,13 +364,14 @@ ...@@ -319,13 +364,14 @@
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public ${ctrl.name}_selectionchange(args: any [], tag?: string, $event2?: any): void { public ${ctrl.name}_selectionchange(args: any [], tag?: string, $event2?: any): void {
let data:any = {}; let tempContext:any = {};
let tempViewParam:any = {};
if (args.length === 0) { if (args.length === 0) {
return ; return ;
} }
const arg:any = args[0]; const arg:any = args[0];
if(this.context){ if(this.context){
Object.assign(data,JSON.parse(JSON.stringify(this.context))); Object.assign(tempContext,JSON.parse(JSON.stringify(this.context)));
} }
switch(arg.itemType) { switch(arg.itemType) {
<#if xDataControl?? && xDataControl.getPSSysCalendarItems()??> <#if xDataControl?? && xDataControl.getPSSysCalendarItems()??>
...@@ -333,15 +379,29 @@ ...@@ -333,15 +379,29 @@
<#if calendarItem.getPSAppDataEntity()??> <#if calendarItem.getPSAppDataEntity()??>
<#assign _appde = calendarItem.getPSAppDataEntity() /> <#assign _appde = calendarItem.getPSAppDataEntity() />
case "${calendarItem.getItemType()}": case "${calendarItem.getItemType()}":
Object.assign(data,{ ${_appde.getCodeName()?lower_case} : arg.${_appde.getCodeName()?lower_case}}); Object.assign(tempContext,{ ${_appde.getCodeName()?lower_case} : arg.${_appde.getCodeName()?lower_case}});
Object.assign(data,{srfparentdename:'${_appde.getCodeName()}',srfparentkey:arg['${_appde.getCodeName()?lower_case}']}); Object.assign(tempContext,{srfparentdename:'${_appde.getCodeName()}',srfparentkey:arg['${_appde.getCodeName()?lower_case}']});
if(this.navFilter && this.navFilter['${calendarItem.getItemType()}'] && !Object.is(this.navFilter['${calendarItem.getItemType()}'],"")){
Object.assign(tempViewParam,{[this.navFilter['${calendarItem.getItemType()}']]:arg['${_appde.getCodeName()?lower_case}']});
}
if(this.navPSDer && this.navFilter['${calendarItem.getItemType()}'] && !Object.is(this.navPSDer['${calendarItem.getItemType()}'],"")){
Object.assign(tempViewParam,{[this.navPSDer['${calendarItem.getItemType()}']]:arg['${_appde.getCodeName()?lower_case}']});
}
if(this.navParam && this.navParam['${calendarItem.getItemType()}'] && this.navParam['${calendarItem.getItemType()}'].navigateContext && Object.keys(this.navParam['${calendarItem.getItemType()}'].navigateContext).length >0){
let _context:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navParam['${calendarItem.getItemType()}'].navigateContext);
Object.assign(tempContext,_context);
}
if(this.navParam && this.navParam['${calendarItem.getItemType()}'] && this.navParam['${calendarItem.getItemType()}'].navigateParams && Object.keys(this.navParam['${calendarItem.getItemType()}'].navigateParams).length >0){
let _params:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navParam['${calendarItem.getItemType()}'].navigateParams);
Object.assign(tempViewParam,_params);
}
break; break;
</#if> </#if>
</#list> </#list>
</#if> </#if>
} }
this.selection = {}; this.selection = {};
Object.assign(this.selection, { view: { viewname: this.navViewName[arg.itemType] }, data:data }); Object.assign(this.selection, { view: { viewname: this.navViewName[arg.itemType] }, context:tempContext,viewparam:tempViewParam });
this.$emit('selectionchange',args); this.$emit('selectionchange',args);
this.$forceUpdate(); this.$forceUpdate();
} }
......
...@@ -3,6 +3,16 @@ ...@@ -3,6 +3,16 @@
<#if view.getViewType() == 'DECALENDAREXPVIEW'> <#if view.getViewType() == 'DECALENDAREXPVIEW'>
:viewUID="viewUID" :viewUID="viewUID"
</#if> </#if>
<#if view.getPSAppViewLogics?? && view.getPSAppViewLogics()??>
<#list view.getPSAppViewLogics() as logic>
<#if logic.getPFLogicCodeType() == 'APP_NEWDATA'>
:newdata="newdata"
</#if>
<#if logic.getPFLogicCodeType() == 'APP_OPENDATA'>
:opendata="opendata"
</#if>
</#list>
</#if>
</#assign> </#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl ../@MACRO/HTML/DEFAULT.html.ftl
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
</@ibizindent> </@ibizindent>
</span> </span>
</#if> </#if>
<context-menu-container>
<#if ctrl.getCalendarStyle?? && ctrl.getCalendarStyle() == 'TIMELINE'> <#if ctrl.getCalendarStyle?? && ctrl.getCalendarStyle() == 'TIMELINE'>
<el-timeline> <el-timeline>
<el-timeline-item <el-timeline-item
...@@ -27,10 +28,12 @@ ...@@ -27,10 +28,12 @@
:color="item.color" :color="item.color"
:timestamp="item.start" :timestamp="item.start"
placement="top"> placement="top">
<context-menu :contextMenuStyle="{width: '100%'}" :data="item" :renderContent="renderContextMenu">
<el-card @click.native="onEventClick(item,true,$event)" :class="item.className"> <el-card @click.native="onEventClick(item,true,$event)" :class="item.className">
<h4>{{item.title}}</h4> <h4>{{item.title}}</h4>
<p>从 {{item.start}} 至 {{item.end}}</p> <p>从 {{item.start}} 至 {{item.end}}</p>
</el-card> </el-card>
</context-menu>
</el-timeline-item> </el-timeline-item>
</el-timeline> </el-timeline>
<#else> <#else>
...@@ -58,6 +61,7 @@ ...@@ -58,6 +61,7 @@
:customButtons="customButtons" :customButtons="customButtons"
:validRange="validRange" :validRange="validRange"
:defaultDate="defaultDate" :defaultDate="defaultDate"
:eventRender="eventRender"
@dateClick="onDateClick" @dateClick="onDateClick"
@eventClick="onEventClick" @eventClick="onEventClick"
@eventDrop="onEventDrop" @eventDrop="onEventDrop"
...@@ -66,6 +70,7 @@ ...@@ -66,6 +70,7 @@
<el-date-picker style="width: 200px;" v-model="selectedGotoDate" type="date"></el-date-picker> <el-date-picker style="width: 200px;" v-model="selectedGotoDate" type="date"></el-date-picker>
</modal> </modal>
</#if> </#if>
</context-menu-container>
</div> </div>
</template> </template>
<#assign import_block> <#assign import_block>
...@@ -74,6 +79,7 @@ import dayGridPlugin from '@fullcalendar/daygrid' ...@@ -74,6 +79,7 @@ import dayGridPlugin from '@fullcalendar/daygrid'
import timeGridPlugin from '@fullcalendar/timegrid'; import timeGridPlugin from '@fullcalendar/timegrid';
import listPlugin from '@fullcalendar/list'; import listPlugin from '@fullcalendar/list';
import interactionPlugin from '@fullcalendar/interaction' import interactionPlugin from '@fullcalendar/interaction'
import ContextMenu from '@components/context-menu/context-menu'
</#assign> </#assign>
<#assign component_block> <#assign component_block>
...@@ -108,6 +114,29 @@ FullCalendar, ...@@ -108,6 +114,29 @@ FullCalendar,
*/ */
@Prop() public loadAction!: string; @Prop() public loadAction!: string;
<#if view.getPSAppViewLogics?? && view.getPSAppViewLogics()??>
<#list view.getPSAppViewLogics() as logic>
<#if logic.getPFLogicCodeType() == 'APP_NEWDATA'>
/**
* 打开新建数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() public newdata: any;
</#if>
<#if logic.getPFLogicCodeType() == 'APP_OPENDATA'>
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() public opendata: any;
</#if>
</#list>
</#if>
/** /**
* 日历部件样式名 * 日历部件样式名
* *
...@@ -484,8 +513,7 @@ FullCalendar, ...@@ -484,8 +513,7 @@ FullCalendar,
let _this = this; let _this = this;
let view: any = {}; let view: any = {};
let _context: any = Object.assign({},this.context); let _context: any = Object.assign({},this.context);
let itemType = event.itemType; switch(event.itemType) {
switch(itemType) {
<#if ctrl.getPSSysCalendarItems()??> <#if ctrl.getPSSysCalendarItems()??>
<#list ctrl.getPSSysCalendarItems() as calendarItem> <#list ctrl.getPSSysCalendarItems() as calendarItem>
<#if calendarItem.getPSAppDataEntity()??> <#if calendarItem.getPSAppDataEntity()??>
...@@ -498,11 +526,10 @@ FullCalendar, ...@@ -498,11 +526,10 @@ FullCalendar,
</#list> </#list>
</#if> </#if>
} }
_context.itemType = itemType; this.selections = [event];
this.selections = [_context];
// 导航栏中不需要打开视图,只要抛出选中数据 // 导航栏中不需要打开视图,只要抛出选中数据
if(this.isSelectFirstDefault){ if(this.isSelectFirstDefault){
this.$emit("selectionchange",[_context]); this.$emit("selectionchange",this.selections);
return; return;
} }
// 根据打开模式打开视图 // 根据打开模式打开视图
...@@ -608,7 +635,7 @@ FullCalendar, ...@@ -608,7 +635,7 @@ FullCalendar,
} }
/** /**
* 获取单项 * 获取单项数据
* *
* @returns {*} * @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
...@@ -680,6 +707,76 @@ FullCalendar, ...@@ -680,6 +707,76 @@ FullCalendar,
${P.getCtrlCode(batchToolbar, 'CONTROL.vue').code} ${P.getCtrlCode(batchToolbar, 'CONTROL.vue').code}
</#if> </#if>
/**
* 事件绘制回调
*
* @param {*} info 信息
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public eventRender(info?:any,) {
let data = Object.assign({title: info.event.title, start: info.event.start, end: info.event.end}, info.event.extendedProps);
info.el.addEventListener('contextmenu', (event: MouseEvent) => {
event.preventDefault();
let props = { data: data, renderContent: this.renderContextMenu };
let component = ContextMenu;
const vm:any = new Vue({
render(h) {
return h(component, { props });
}
}).$mount();
document.body.appendChild(vm.$el);
const comp: any = vm.$children[0];
comp.showContextMenu(event.clientX, event.clientY);
});
}
/**
* 绘制右键菜单
*
* @param {*} event
* @returns
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public renderContextMenu(event: any) {
let content;
if (event && event.itemType) {
const data: any = JSON.parse(JSON.stringify(event));
this.selections = [event];
switch(event.itemType){
<#if ctrl.getPSControls()??>
<#list ctrl.getPSControls() as childCtrl>
<#if childCtrl.getControlType() == "CONTEXTMENU">
case "${childCtrl.getOwner().getItemType()}":
content = this.renderContextMenu${srfclassname(childCtrl.getOwner().getItemType()?lower_case)}();
break;
</#if>
</#list>
</#if>
}
}
return content;
}
<#if ctrl.getPSControls()??>
<#list ctrl.getPSControls() as childCtrl>
<#if childCtrl.getControlType() == "CONTEXTMENU">
/**
* 绘制${childCtrl.getOwner().getItemType()}类型右键菜单
*
* @returns
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public renderContextMenu${srfclassname(childCtrl.getOwner().getItemType()?lower_case)}() {
return (
<@ibizindent blank=12>
${P.getCtrlCode(childCtrl, 'CONTROL.html').code}
</@ibizindent>
);
}
</#if>
</#list>
</#if>
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
...@@ -6,6 +6,16 @@ ...@@ -6,6 +6,16 @@
<#if view.getViewType() == 'DECALENDARVIEW' || view.getViewType() == 'DECALENDARVIEW9'> <#if view.getViewType() == 'DECALENDARVIEW' || view.getViewType() == 'DECALENDARVIEW9'>
@beforeload="onBeforeLoad($event)" @beforeload="onBeforeLoad($event)"
</#if> </#if>
<#if view.getPSAppViewLogics?? && view.getPSAppViewLogics()??>
<#list view.getPSAppViewLogics() as logic>
<#if logic.getPFLogicCodeType() == 'APP_NEWDATA'>
:newdata="newdata"
</#if>
<#if logic.getPFLogicCodeType() == 'APP_OPENDATA'>
:opendata="opendata"
</#if>
</#list>
</#if>
</#assign> </#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl ../@MACRO/HTML/DEFAULT.html.ftl
......
<#ibizinclude>
../@MACRO/CONTROL/LANGBASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../../@MACRO/LANG_FUN.ftl
</#ibizinclude>
<template>
<el-table ref="${ctrl.name}"
:data="items"
row-key="id"
border
lazy
height="100%"
:row-class-name="setRowClass"
:load="loadTreeNode"
:tree-props="{ children: 'children', hasChildren: 'leaf' }"
:select-on-indeterminate="isSingleSelect"
@current-change="select"
>
<#if ctrl.getPSDETreeColumns()??>
<#list ctrl.getPSDETreeColumns() as column>
<el-table-column show-overflow-tooltip prop="${column.getName()?lower_case}" label="${column.getCaption()}"<#if column.getWidthUnit()!='STAR'> :width="${column.getWidth()?c}" <#else> :min-width="${column.getWidth()?c}" </#if> :align="'${column.getAlign()?lower_case}'">
<template v-slot="{ row }">
<#if column.render??>
${column.render.code}
<#else>
<span>{{ getColumnValue(row, '${column.getName()?lower_case}') }}</span>
</#if>
</template>
</el-table-column>
</#list>
</#if>
</el-table>
</template>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
/**
* 显示处理提示
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop({ default: true }) public showBusyIndicator?: boolean;
/**
* 部件行为--load
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() public loadAction!: string;
/**
* 是否单选
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop({ default: true }) public isSingleSelect!: boolean;
/**
* 部件样式名
*
* @public
* @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public controlClass: string = "${ctrl.name}";
/**
* 数据集合
*
* @public
* @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public items: any[] = [];
/**
* 默认展开节点集合
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public defExpands: any = [];
/**
* 行节点下标
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public itemNum: any = {};
/**
* 计数下标
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public num: number = 0;
/**
* 获取列属性值
*
* @public
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public getColumnValue(task: any, field: string) {
<#if ctrl.getPSDETreeNodes()??>
<#list ctrl.getPSDETreeNodes() as node>
if(Object.is(task.id.split(';')[0], '${srfjavastring(node.getNodeType())}')) {
<#if node.getPSDETreeNodeDataItems()??>
<#list node.getPSDETreeNodeDataItems() as dataItem>
<#if dataItem.getFrontPSCodeList()??>
<#assign codelist = dataItem.getFrontPSCodeList()/>
if (Object.is(field, '${dataItem.name}')) {
let codelist: any[] = this.$store.getters.getCodeList('${codelist.getCodeName()}');
if(codelist) {
return this.getCodeListItem(codelist, task[field]);
}
}
</#if>
</#list>
</#if>
return task[field];
}
</#list>
</#if>
}
/**
* 获取代码项
*
* @public
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public getCodeListItem(codelist: any, val: any) {
for(let i = 0; i < codelist.items.length; i++) {
if(Object.is(codelist.items[i].value, val)) {
return codelist.items[i].text;
}
}
return codelist.emptytext;
}
/**
* 搜索获取日程事件
*
* @param {*} $event 日期信息
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public load(task: any = {}, resolve?: any) {
const params: any = {
srfnodeid: task && task.id ? task.id : "#",
srfnodefilter: ''
};
let tempViewParams:any = JSON.parse(JSON.stringify(this.viewparams));
let curNode:any = {};
Util.deepObjectMerge(curNode, task);
let tempContext:any = this.computecurNodeContext(curNode);
if(curNode && curNode.srfparentdename) {
Object.assign(tempContext,{ srfparentdename: curNode.srfparentdename });
Object.assign(tempViewParams,{ srfparentdename: curNode.srfparentdename });
}
if(curNode && curNode.srfparentkey) {
Object.assign(tempContext,{ srfparentkey: curNode.srfparentkey });
Object.assign(tempViewParams,{ srfparentkey: curNode.srfparentkey });
}
Object.assign(params,{viewparams:tempViewParams});
this.service.getNodes(tempContext,params).then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: "错误", desc: response.info });
return;
}
response.data.forEach((item: any) => {
this.itemNum[item.id] = this.num++;
if(!item.collapsed) {
this.defExpands.push(item);
}
})
if(resolve && resolve instanceof Function) {
resolve(response.data);
} else {
this.items = [...response.data];
}
this.$nextTick(() => {
this.expandDefNode();
})
this.$emit("load", this.items);
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: "错误", desc: response.info });
});
}
/**
* 加载节点
*
* @memberof TreeTable
*/
public loadTreeNode(tree: any, treeNode: any, resolve: any) {
this.load(tree, resolve);
}
/**
* 计算当前节点的上下文
*
* @param {*} curNode 当前节点
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public computecurNodeContext(curNode:any){
let tempContext:any = {};
if(curNode && curNode.data && curNode.data.srfappctx){
tempContext = JSON.parse(JSON.stringify(curNode.data.srfappctx));
}else{
tempContext = JSON.parse(JSON.stringify(this.context));
}
return tempContext;
}
/**
* 节点展开
*
* @param {*} item 当前节点
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public itemExpand(item: any) {
}
/**
* 刷新
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public refresh() {
this.load();
}
/**
* 选中的数据
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public selections: any[] = [];
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public getDatas(): any[] {
return this.selections;
}
/**
* 获取单项树
*
* @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public getData(): any {
return null;
}
/**
* vue 生命周期
*
* @returns
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public created() {
this.load();
}
/**
* 设置行Class
*
* @returns
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public setRowClass({row, rowIndex}: {row: any, rowIndex: number}) {
return 'treegrid' + this.itemNum[row.id];
}
/**
* 展开默认节点
*
* @returns
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public expandDefNode() {
if(this.defExpands.length > 0) {
let item: any = this.defExpands[0];
this.defExpands.splice(0, 1);
let trs: any = this.$el.getElementsByClassName('treegrid' + this.itemNum[item.id]);
if(trs) {
let icons: any = trs[0].getElementsByClassName('el-table__expand-icon');
icons[0].click();
}
}
}
/**
* 选中变化
*
* @returns
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public select($event: any) {
if (!$event) {
return;
}
this.selections = [JSON.parse(JSON.stringify($event))];
this.$emit('selectionchange', this.selections);
}
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL-BASE.style.ftl
</#ibizinclude>
\ No newline at end of file
<#assign content>
:showBusyIndicator="${ctrl.isShowBusyIndicator()?c}"
</#assign>
<#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl
</#ibizinclude>
\ No newline at end of file
.gantt {
height: 100%;
.gantt-elastic__main-view-container {
flex-grow: 1;
}
}
<#ibizinclude>
../@MACRO/CSS/DEFAULT.less.ftl
</#ibizinclude>
\ No newline at end of file
<#ibizinclude>
../@MACRO/CONTROL/CONTROL.vue.ftl
</#ibizinclude>
\ No newline at end of file
<#ibizinclude>
../@MACRO/MODEL/MODEL_HEADER.ts.ftl
</#ibizinclude>
/**
* 日历项类型
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.getCodeName()}')}${srfclassname('${ctrl.name}')}Mode
*/
public itemType: string = "";
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.getCodeName()}')}${srfclassname('${ctrl.name}')}Mode
*/
public getDataItems(): any[] {
let dataItems: any = [
<#-- 关联主实体的主键 -->
<#if ctrl.getPSAppDataEntity()??>
<#assign appDataEntity = ctrl.getPSAppDataEntity() />
<#if appDataEntity.isMajor() == false && appDataEntity.getMinorPSAppDERSs()??>
<#list appDataEntity.getMinorPSAppDERSs() as minorAppDERSs>
<#if minorAppDERSs.getMajorPSAppDataEntity()??>
<#assign majorAppDataEntity = minorAppDERSs.getMajorPSAppDataEntity() />
{
name: '${majorAppDataEntity.getCodeName()?lower_case}',
prop: '${majorAppDataEntity.getKeyPSAppDEField().getCodeName()?lower_case}'
},
</#if>
</#list>
</#if>
</#if>
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
{
name: 'style',
},
{
name: 'textColor',
},
{
name: 'itemType',
},
{
name: 'parentId'
},
{
name: 'query',
prop: 'query',
},
];
switch(this.itemType){
<#-- 甘特项实体映射 -->
<#if ctrl.getPSDETreeNodes()??>
<#list ctrl.getPSDETreeNodes() as ganttItem>
<#if ganttItem.getTreeNodeType() == "DE">
case "${ganttItem.getNodeType()}":
dataItems = [...dataItems,
<#if ganttItem.getIdPSAppDEField()??>
{
name: 'id',
prop: '${ganttItem.getIdPSAppDEField().getCodeName()?lower_case}'
},
</#if>
<#if ganttItem.getPSDETreeNodeDataItems()??>
<#list ganttItem.getPSDETreeNodeDataItems() as dataItem>
{
name: '<#if dataItem.getName() == 'begin'>start<#else>${dataItem.getName()?lower_case}</#if>',
prop: '<#if dataItem.getPSDEField()??>${dataItem.getPSDEField().getCodeName()?lower_case}</#if>'
},
</#list>
</#if>
];
break;
</#if>
</#list>
</#if>
}
return dataItems;
}
<#ibizinclude>
../@MACRO/MODEL/MODEL_BOTTOM.ts.ftl
</#ibizinclude>
\ No newline at end of file
此差异已折叠。
CTRLTYPE=TREEGRIDEX
\ No newline at end of file
...@@ -471,7 +471,8 @@ ...@@ -471,7 +471,8 @@
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public refresh(args: any[]): void { public refresh(args: any[]): void {
if (Object.keys(this.currentselectedNode).length === 0) { this.refresh_all();
<#-- if (Object.keys(this.currentselectedNode).length === 0) {
return; return;
} }
const id: string = this.currentselectedNode.id; const id: string = this.currentselectedNode.id;
...@@ -483,13 +484,13 @@ ...@@ -483,13 +484,13 @@
} }
let curNode:any = {}; let curNode:any = {};
curNode = Util.deepObjectMerge(curNode,node); curNode = Util.deepObjectMerge(curNode,node);
let tempContext:any; let tempContext:any = {};
if(curNode.data && curNode.data.srfappctx){ if(curNode.data && curNode.data.srfappctx){
Object.assign(tempContext,curNode.data.srfappctx); Object.assign(tempContext,curNode.data.srfappctx);
}else{ }else{
Object.assign(tempContext,this.context); Object.assign(tempContext,this.context);
} }
this.refresh_node(tempContext,param, false); this.refresh_node(tempContext,param, false); -->
} }
/** /**
......
...@@ -17,6 +17,10 @@ import ${srfclassname('${node.getPSAppDataEntity().codeName}')}Service from '@se ...@@ -17,6 +17,10 @@ import ${srfclassname('${node.getPSAppDataEntity().codeName}')}Service from '@se
../@MACRO/SERVICE/SERVICE_HEADER.ts.ftl ../@MACRO/SERVICE/SERVICE_HEADER.ts.ftl
</#ibizinclude> </#ibizinclude>
<#ibizinclude>
../@MACRO/FUNC/MACRO.ftl
</#ibizinclude>
<#-- 获取树节点关系导航上下文 --> <#-- 获取树节点关系导航上下文 -->
<#macro getNavContext nodeRs> <#macro getNavContext nodeRs>
<#compress> <#compress>
...@@ -280,8 +284,11 @@ import ${srfclassname('${node.getPSAppDataEntity().codeName}')}Service from '@se ...@@ -280,8 +284,11 @@ import ${srfclassname('${node.getPSAppDataEntity().codeName}')}Service from '@se
<#if node.getNavFilter()??> <#if node.getNavFilter()??>
Object.assign(treeNode, { navfilter: "${node.getNavFilter()}" }); Object.assign(treeNode, { navfilter: "${node.getNavFilter()}" });
</#if> </#if>
<#if node.getNavViewParam()?? && node.getNavViewParam() != ""> <#if node.getPSNavigateContexts?? && node.getPSNavigateContexts()??>
Object.assign(treeNode, { navparams: '${node.getNavViewParam()}' }); Object.assign(treeNode, {navigateContext: <@getNavigateContext node /> });
</#if>
<#if node.getPSNavigateParams?? && node.getPSNavigateParams()??>
Object.assign(treeNode, {navigateParams: <@getNavigateParams node /> });
</#if> </#if>
<#-- 补充nodeid和nodeid2 --> <#-- 补充nodeid和nodeid2 -->
Object.assign(treeNode, { nodeid: treeNode.srfkey }); Object.assign(treeNode, { nodeid: treeNode.srfkey });
...@@ -346,8 +353,11 @@ import ${srfclassname('${node.getPSAppDataEntity().codeName}')}Service from '@se ...@@ -346,8 +353,11 @@ import ${srfclassname('${node.getPSAppDataEntity().codeName}')}Service from '@se
<#if node.getNavFilter()??> <#if node.getNavFilter()??>
Object.assign(item, { navfilter: "${node.getNavFilter()}" }); Object.assign(item, { navfilter: "${node.getNavFilter()}" });
</#if> </#if>
<#if node.getNavViewParam()?? && node.getNavViewParam() !=""> <#if node.getPSNavigateContexts?? && node.getPSNavigateContexts()??>
Object.assign(item, { navparams: '${node.getNavViewParam()}' }); Object.assign(item, {navigateContext: <@getNavigateContext node /> });
</#if>
<#if node.getPSNavigateParams?? && node.getPSNavigateParams()??>
Object.assign(item, {navigateParams: <@getNavigateParams node /> });
</#if> </#if>
<#-- 补充nodeid和nodeid2 --> <#-- 补充nodeid和nodeid2 -->
Object.assign(item, { nodeid: item.srfkey }); Object.assign(item, { nodeid: item.srfkey });
...@@ -412,8 +422,11 @@ import ${srfclassname('${node.getPSAppDataEntity().codeName}')}Service from '@se ...@@ -412,8 +422,11 @@ import ${srfclassname('${node.getPSAppDataEntity().codeName}')}Service from '@se
<#if node.getNavFilter()??> <#if node.getNavFilter()??>
Object.assign(treeNode, { navfilter: "${node.getNavFilter()}" }); Object.assign(treeNode, { navfilter: "${node.getNavFilter()}" });
</#if> </#if>
<#if node.getNavViewParam()?? && node.getNavViewParam() !=""> <#if node.getPSNavigateContexts?? && node.getPSNavigateContexts()??>
Object.assign(treeNode, { navparams: '${node.getNavViewParam()}' }); Object.assign(treeNode, {navigateContext: <@getNavigateContext node /> });
</#if>
<#if node.getPSNavigateParams?? && node.getPSNavigateParams()??>
Object.assign(treeNode, {navigateParams: <@getNavigateParams node /> });
</#if> </#if>
if(item.children && item.children.length >0){ if(item.children && item.children.length >0){
Object.assign(treeNode, { children: item.children }); Object.assign(treeNode, { children: item.children });
...@@ -540,8 +553,12 @@ import ${srfclassname('${node.getPSAppDataEntity().codeName}')}Service from '@se ...@@ -540,8 +553,12 @@ import ${srfclassname('${node.getPSAppDataEntity().codeName}')}Service from '@se
<#if node.getNavFilter()??> <#if node.getNavFilter()??>
Object.assign(treeNode, { navfilter: "${node.getNavFilter()}" }); Object.assign(treeNode, { navfilter: "${node.getNavFilter()}" });
</#if> </#if>
<#if node.getNavViewParam()?? && node.getNavViewParam() != ""> Object.assign(treeNode, { curData: entity });
Object.assign(treeNode, { navparams: '${node.getNavViewParam()}' }); <#if node.getPSNavigateContexts?? && node.getPSNavigateContexts()??>
Object.assign(treeNode, {navigateContext: <@getNavigateContext node /> });
</#if>
<#if node.getPSNavigateParams?? && node.getPSNavigateParams()??>
Object.assign(treeNode, {navigateParams: <@getNavigateParams node /> });
</#if> </#if>
<#-- 补充nodeid和nodeid2 --> <#-- 补充nodeid和nodeid2 -->
Object.assign(treeNode, { nodeid: treeNode.srfkey }); Object.assign(treeNode, { nodeid: treeNode.srfkey });
......
...@@ -198,38 +198,32 @@ ...@@ -198,38 +198,32 @@
}) })
Object.assign(tempContext,{srfcounter:this.counter}); Object.assign(tempContext,{srfcounter:this.counter});
} }
if(arg && arg.navparams){
let curNavParams:any = JSON.parse(arg.navparams);
if(Object.keys(curNavParams).length >0){
Object.keys(curNavParams).forEach((name:any) =>{
if (!name) {
return;
}
let value: string | null = curNavParams[name];
if (value && value.startsWith('%') && value.endsWith('%')) {
const key = value.substring(1, value.length - 1);
if (arg && arg.hasOwnProperty(key)) {
value = (arg[key] !== null && arg[key] !== undefined) ? arg[key] : null;
} else {
value = null;
}
}
Object.assign(tempViewparam, { [name]: value });
})
this.counter += 1;
Object.assign(tempContext,{srfcounter:this.counter});
}
}
Object.assign(tempContext,JSON.parse(JSON.stringify(this.context))); Object.assign(tempContext,JSON.parse(JSON.stringify(this.context)));
if(arg.srfappctx){ if(arg.srfappctx){
Object.assign(tempContext,JSON.parse(JSON.stringify(arg.srfappctx))); Object.assign(tempContext,JSON.parse(JSON.stringify(arg.srfappctx)));
} }
// 计算导航上下文
if(arg && arg.navigateContext && Object.keys(arg.navigateContext).length >0){
let tempData:any = arg.curData?JSON.parse(JSON.stringify(arg.curData)):{};
Object.assign(tempData,arg);
let _context = this.$util.computedNavData(tempData,tempContext,tempViewparam,arg.navigateContext);
Object.assign(tempContext,_context);
}
if(arg.srfparentdename){ if(arg.srfparentdename){
Object.assign(tempContext,{srfparentdename:arg.srfparentdename}); Object.assign(tempContext,{srfparentdename:arg.srfparentdename});
} }
if(arg.srfparentkey){ if(arg.srfparentkey){
Object.assign(tempContext,{srfparentkey:arg.srfparentkey}); Object.assign(tempContext,{srfparentkey:arg.srfparentkey});
} }
// 计算导航参数
if(arg && arg.navigateParams && Object.keys(arg.navigateParams).length >0){
let tempData:any = arg.curData?JSON.parse(JSON.stringify(arg.curData)):{};
Object.assign(tempData,arg);
let _params = this.$util.computedNavData(tempData,tempContext,tempViewparam,arg.navigateParams);
Object.assign(tempViewparam,_params);
this.counter += 1;
Object.assign(tempContext,{srfcounter:this.counter});
}
this.selection = {}; this.selection = {};
Object.assign(this.selection, { view: { viewname: refview.viewname } }); Object.assign(this.selection, { view: { viewname: refview.viewname } });
Object.assign(this.selection,{'viewparam':tempViewparam,'context':tempContext}); Object.assign(this.selection,{'viewparam':tempViewparam,'context':tempContext});
......
...@@ -108,7 +108,8 @@ GanttElastic, ...@@ -108,7 +108,8 @@ GanttElastic,
<#list ctrl.getPSDETreeColumns() as column> <#list ctrl.getPSDETreeColumns() as column>
{ {
label: '${column.getCaption()}', label: '${column.getCaption()}',
value: (task: any) => { value: '<#if column.getName() == "begin">start<#else>${column.getName()}</#if>',
render: (task: any) => {
<#if column.render??> <#if column.render??>
${column.render.code} ${column.render.code}
<#else> <#else>
......
此差异已折叠。
<#-- content -->
<#assign content>
createAction="<#if ctrl.getCreatePSControlAction()?? && ctrl.getCreatePSControlAction().getPSAppDEMethod()??>${ctrl.getCreatePSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
removeAction="<#if ctrl.getRemovePSControlAction()?? && ctrl.getRemovePSControlAction().getPSAppDEMethod()??>${ctrl.getRemovePSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
updateAction="<#if ctrl.getUpdatePSControlAction()?? && ctrl.getUpdatePSControlAction().getPSAppDEMethod()??>${ctrl.getUpdatePSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
fetchAction="<#if ctrl.getFetchPSControlAction()?? && ctrl.getFetchPSControlAction().getPSAppDEMethod()??>${ctrl.getFetchPSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
updateGroupAction="<#if ctrl.getUpdateGroupPSControlAction()?? && ctrl.getUpdateGroupPSControlAction().getPSAppDEMethod()??>${ctrl.getUpdateGroupPSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
:showBusyIndicator="${ctrl.isShowBusyIndicator()?c}"
<#if view.getViewType() == 'DEDATAVIEWEXPVIEW'>
:isSelectFirstDefault="true"
</#if>
</#assign>
<#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl
</#ibizinclude>
\ No newline at end of file
.app-data-view-group {
height: 100%;
display: flex;
overflow: auto;
.dataview-group-content {
border: 1px solid #ddd;
border-left: 0;
flex-shrink: 0;
height: 100%;
display: flex;
flex-direction: column;
.dataview-group-header {
height: 36px;
line-height: 36px;
border-bottom: 1px solid #ddd;
padding: 0 8px;
.group-action {
.group-action-item:nth-child(1) + .group-action-item {
margin-top: 5px;
}
}
}
.dataview-group-items {
flex-grow: 1;
overflow: auto;
.dataview-group-item {
margin: 8px 8px 0 8px;
border: 1px solid #ddd;
padding: 8px;
overflow: hidden;
}
.dataview-group-item.is-select {
border-color: #108cee;
}
}
}
.dataview-group-content:nth-child(1) {
border-left: 1px solid #ddd;
}
}
<#ibizinclude>
../@MACRO/CSS/DEFAULT.less.ftl
</#ibizinclude>
\ No newline at end of file
<#ibizinclude>
../@MACRO/CONTROL/CONTROL.vue.ftl
</#ibizinclude>
\ No newline at end of file
<#ibizinclude>
../@MACRO/MODEL/MODEL_HEADER.ts.ftl
</#ibizinclude>
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.getCodeName()}')}${srfclassname('${ctrl.name}')}Mode
*/
public getDataItems(): any[] {
return [
<#-- 数据视图数据项 -->
<#if ctrl.getPSDEDataViewDataItems()??>
<#list ctrl.getPSDEDataViewDataItems() as dataitem>
{
name: '${dataitem.getName()}',
<#if dataitem.getPSDEField()??>
prop: '${dataitem.getPSDEField().getCodeName()?lower_case}',
dataType: '${dataitem.getPSDEField().getDataType()}',
</#if>
},
</#list>
</#if>
<#-- 关联主实体的主键 -->
<#if ctrl.getPSAppDataEntity()??>
<#assign appDataEntity = ctrl.getPSAppDataEntity() />
<#if appDataEntity.isMajor() == false && appDataEntity.getMinorPSAppDERSs()??>
<#list appDataEntity.getMinorPSAppDERSs() as minorAppDERSs>
<#if minorAppDERSs.getMajorPSAppDataEntity()??>
<#assign majorAppDataEntity = minorAppDERSs.getMajorPSAppDataEntity() />
{
name: '${majorAppDataEntity.getCodeName()?lower_case}',
prop: '${majorAppDataEntity.getKeyPSAppDEField().getCodeName()?lower_case}'
},
</#if>
</#list>
</#if>
</#if>
<#if ctrl.getPSDEDataViewDataItems()??>
<#list ctrl.getPSDEDataViewDataItems() as dataitem>
<#-- 界面主键标识 -->
<#if dataitem.getPSDEField?? && dataitem.getPSDEField()?? && dataitem.getPSDEField().isKeyDEField() == true>
<#if !P.exists("importService", dataitem.getPSDEField().getId(), "")>
{
name: '${ctrl.getPSAppDataEntity().getCodeName()?lower_case}',
prop: '${dataitem.getPSDEField().getCodeName()?lower_case}',
dataType: 'FONTKEY',
},
</#if>
</#if>
</#list>
</#if>
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'MODEL_CONTENT.ts').code}
</#if>
{
name:'size',
prop:'size'
},
{
name:'query',
prop:'query'
},
{
name:'sort',
prop:'sort'
},
{
name:'page',
prop:'page'
},
{
name:'srfparentdata',
prop:'srfparentdata'
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
]
}
<#ibizinclude>
../@MACRO/MODEL/MODEL_BOTTOM.ts.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.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 删除数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
@Errorlog
public delete(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.remove(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 更新数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
@Errorlog
public update(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.update(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
<#ibizinclude>
../@MACRO/SERVICE/SERVICE_BOTTOM.ts.ftl
</#ibizinclude>
\ No newline at end of file
CTRLTYPE=KANBAN
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/MACRO.ftl</#ibizinclude>
<#if item.render??> <#if item.render??>
${item.render.code} ${item.render.code}
<#else> <#else>
...@@ -20,6 +21,8 @@ ${item.render.code} ...@@ -20,6 +21,8 @@ ${item.render.code}
]" ]"
:context="context" :context="context"
:viewparams="viewparams" :viewparams="viewparams"
:localContext ='<@getNavigateContext item />'
:localParam ='<@getNavigateParams item />'
parameterName='${appde.getCodeName()?lower_case}' parameterName='${appde.getCodeName()?lower_case}'
parentName="${appde.getCodeName()}" parentName="${appde.getCodeName()}"
refviewtype='<#if refView.getPSViewType()??>${refView.getPSViewType().getId()}</#if>' refviewtype='<#if refView.getPSViewType()??>${refView.getPSViewType().getId()}</#if>'
......
...@@ -59,16 +59,16 @@ ...@@ -59,16 +59,16 @@
</#ibizinclude> </#ibizinclude>
<template v-if="getColumnState('${item.getName()?lower_case}')"> <template v-if="getColumnState('${item.getName()?lower_case}')">
<#if item.getColumnType() == 'GROUPGRIDCOLUMN' && item.getPSDEGridColumns()??> <#if item.getColumnType() == 'GROUPGRIDCOLUMN' && item.getPSDEGridColumns()??>
<#-- BEGIN:分组列 --> <#-- [1]BEGIN:分组列 -->
<el-table-column show-overflow-tooltip :align="'${item.getAlign()?lower_case}'" :label="<#if langbase??>$t('${langbase}.columns.${item.getName()?lower_case}')<#else>'${item.getCaption()}'</#if>"> <el-table-column show-overflow-tooltip :align="'${item.getAlign()?lower_case}'" :label="<#if langbase??>$t('${langbase}.columns.${item.getName()?lower_case}')<#else>'${item.getCaption()}'</#if>">
<@getColumnHeader item 4 /> <@getColumnHeader item 4 />
<#list item.getPSDEGridColumns() as column> <#list item.getPSDEGridColumns() as column>
${P.getPartCode(column,'COLUMN').code} ${P.getPartCode(column,'COLUMN').code}
</#list> </#list>
</el-table-column> </el-table-column>
<#-- END:分组列 --> <#-- [1]END:分组列 -->
<#elseif item.getColumnType() == 'UAGRIDCOLUMN'> <#elseif item.getColumnType() == 'UAGRIDCOLUMN'>
<#-- BEGIN:操作列 --> <#-- [2]BEGIN:操作列 -->
<el-table-column :column-key="'${item.getName()?lower_case}'" :label="<#if langbase??>$t('${langbase}.columns.${item.getName()?lower_case}')<#else>'${item.getCaption()}'</#if>"<#if item.getWidthUnit()!='STAR'> :width="${item.width?c}" <#else> :min-width="${item.width?c}" </#if> :align="'${item.getAlign()?lower_case}'"> <el-table-column :column-key="'${item.getName()?lower_case}'" :label="<#if langbase??>$t('${langbase}.columns.${item.getName()?lower_case}')<#else>'${item.getCaption()}'</#if>"<#if item.getWidthUnit()!='STAR'> :width="${item.width?c}" <#else> :min-width="${item.width?c}" </#if> :align="'${item.getAlign()?lower_case}'">
<@getColumnHeader item 8 /> <@getColumnHeader item 8 />
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -85,9 +85,9 @@ ...@@ -85,9 +85,9 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<#-- END:操作列 --> <#-- [2]END:操作列 -->
<#elseif item.getColumnType() == 'DEFGRIDCOLUMN'> <#elseif item.getColumnType() == 'DEFGRIDCOLUMN'>
<#-- BEGIN:数据列 --> <#-- [3]BEGIN:数据列 -->
<el-table-column show-overflow-tooltip :prop="'${item.getName()?lower_case}'" :label="<#if langbase??>$t('${langbase}.columns.${item.getName()?lower_case}')<#else>'${item.getCaption()}'</#if>"<#if item.getWidthUnit()!='STAR'> :width="${item.width?c}" <#else> :min-width="${item.width?c}" </#if> :align="'${item.getAlign()?lower_case}'"<#if (!ctrl.isNoSort()) && item.isEnableSort()> :sortable="'custom'"</#if>> <el-table-column show-overflow-tooltip :prop="'${item.getName()?lower_case}'" :label="<#if langbase??>$t('${langbase}.columns.${item.getName()?lower_case}')<#else>'${item.getCaption()}'</#if>"<#if item.getWidthUnit()!='STAR'> :width="${item.width?c}" <#else> :min-width="${item.width?c}" </#if> :align="'${item.getAlign()?lower_case}'"<#if (!ctrl.isNoSort()) && item.isEnableSort()> :sortable="'custom'"</#if>>
<@getColumnHeader item 8 /> <@getColumnHeader item 8 />
<template v-slot="{row,column,$index}"> <template v-slot="{row,column,$index}">
...@@ -109,6 +109,9 @@ ...@@ -109,6 +109,9 @@
<#-- END:行编辑 --> <#-- END:行编辑 -->
</#if> </#if>
<template <#if (ctrl.isEnableRowEdit() && item.isEnableRowEdit())>v-if="!actualIsOpenEdit"</#if>> <template <#if (ctrl.isEnableRowEdit() && item.isEnableRowEdit())>v-if="!actualIsOpenEdit"</#if>>
<#if item.getPSDEUIAction?? && item.getPSDEUIAction()??>
<a @click="uiAction(row, '${item.getPSDEUIAction().getUIActionTag()}', $event)">
</#if>
<#if (item.render??)> <#if (item.render??)>
<#-- BEGIN:列绘制 --> <#-- BEGIN:列绘制 -->
<span>${item.render.code}</span> <span>${item.render.code}</span>
...@@ -166,6 +169,9 @@ ...@@ -166,6 +169,9 @@
</#if> </#if>
<#-- END:常规显示 --> <#-- END:常规显示 -->
</#if> </#if>
<#if item.getPSDEUIAction?? && item.getPSDEUIAction()??>
</a>
</#if>
</template> </template>
<#-- END:列绘制、前端绘制代码表、行编辑 --> <#-- END:列绘制、前端绘制代码表、行编辑 -->
<#else> <#else>
...@@ -181,6 +187,9 @@ ...@@ -181,6 +187,9 @@
<span>{{row.${item.getName()?lower_case}}}</span> <span>{{row.${item.getName()?lower_case}}}</span>
</app-column-link > </app-column-link >
<#else> <#else>
<#if item.getPSDEUIAction?? && item.getPSDEUIAction()??>
<a @click="uiAction(row, '${item.getPSDEUIAction().getUIActionTag()}', $event)">
</#if>
<#if item.getValueFormat()?? && item.getValueFormat() != "%1$s"> <#if item.getValueFormat()?? && item.getValueFormat() != "%1$s">
<app-format-data format="${item.getValueFormat()}" :data="row.${item.getName()?lower_case}"></app-format-data> <app-format-data format="${item.getValueFormat()}" :data="row.${item.getName()?lower_case}"></app-format-data>
<#elseif item.getPSDEField?? && item.getPSDEField()?? && (item.getPSDEField().getDataType() == "DECIMAL" || item.getPSDEField().getDataType() == "FLOAT" || item.getPSDEField().getDataType() == "CURRENCY")> <#elseif item.getPSDEField?? && item.getPSDEField()?? && (item.getPSDEField().getDataType() == "DECIMAL" || item.getPSDEField().getDataType() == "FLOAT" || item.getPSDEField().getDataType() == "CURRENCY")>
...@@ -188,11 +197,14 @@ ...@@ -188,11 +197,14 @@
<#else> <#else>
<span>{{row.${item.getName()?lower_case}}}</span> <span>{{row.${item.getName()?lower_case}}}</span>
</#if> </#if>
<#if item.getPSDEUIAction?? && item.getPSDEUIAction()??>
</a>
</#if>
</#if> </#if>
</#if> </#if>
</template> </template>
</el-table-column> </el-table-column>
<#-- END:数据列 --> <#-- [3]END:数据列 -->
</#if> </#if>
</template> </template>
...@@ -1463,6 +1463,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1463,6 +1463,7 @@ import { FormItemModel } from '@/model/form-detail';
*/ */
public uiAction(row: any, tag: any, $event: any) { public uiAction(row: any, tag: any, $event: any) {
// this.rowClick(row, true); // this.rowClick(row, true);
$event.stopPropagation();
<#if ctrl.getPSAppViewLogics()??> <#if ctrl.getPSAppViewLogics()??>
<#list ctrl.getPSAppViewLogics() as logic> <#list ctrl.getPSAppViewLogics() as logic>
<#if logic.getPSAppViewUIAction().getPSUIAction()??> <#if logic.getPSAppViewUIAction().getPSUIAction()??>
...@@ -1609,6 +1610,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1609,6 +1610,7 @@ import { FormItemModel } from '@/model/form-detail';
return; return;
} }
const data = response.data; const data = response.data;
this.createDefault(data);
data.rowDataState = "create"; data.rowDataState = "create";
_this.items.push(data); _this.items.push(data);
_this.gridItemsModel.push(_this.getGridRowModel()); _this.gridItemsModel.push(_this.getGridRowModel());
...@@ -1725,6 +1727,42 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1725,6 +1727,42 @@ import { FormItemModel } from '@/model/form-detail';
}); });
return isSelected ? "grid-selected-row" : ""; return isSelected ? "grid-selected-row" : "";
} }
/**
* 新建默认值
* @param {*} row 行数据
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public createDefault(row: any){
<#list ctrl.getPSDEGridEditItems() as editItem><#t>
<#if editItem.getCreateDV?? && editItem.getCreateDV()??><#t>
<#if !(editItem.getCreateDV() == '')><#t>
if (row.hasOwnProperty('${editItem.getCodeName()?lower_case}')) {
<#-- 网页请求 -->
<#if editItem.getCreateDVT() == 'CONTEXT'>
row['${editItem.getCodeName()?lower_case}'] = this.viewparams['${editItem.getCreateDV()}'];
<#-- 用户全局对象 -->
<#elseif editItem.getCreateDVT() == 'SESSION'>
row['${editItem.getCodeName()?lower_case}'] = this.context['${editItem.getCreateDV()}'];
<#-- 当前应用数据 -->
<#elseif editItem.getCreateDVT() == 'APPDATA'>
row['${editItem.getCodeName()?lower_case}'] = this.context['${editItem.getCreateDV()}'];
<#-- 当前操作用户(名称) -->
<#elseif editItem.getCreateDVT() == 'OPERATORNAME'>
row['${editItem.getCodeName()?lower_case}'] = this.context['srfusername'];
<#-- 当前操作用户(编号) -->
<#elseif editItem.getCreateDVT() == 'OPERATOR'>
row['${editItem.getCodeName()?lower_case}'] = this.context['srfuserid'];
<#else>
<#-- 默认值 -->
<#assign datatype=srfjavatype(editItem.getPSAppDEField().getStdDataType())>
row['${editItem.getCodeName()?lower_case}'] = <#if datatype=='BigInteger' || datatype=='Integer' || datatype=='Double' || datatype=='Decimal' || datatype=='Float' || datatype=='BigDecimal'>${editItem.getCreateDV()}<#else>'${editItem.getCreateDV()}'</#if>;
</#if>
}
</#if>
</#if>
</#list>
}
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
...@@ -44,7 +44,8 @@ ...@@ -44,7 +44,8 @@
:is="selection.view.viewname" :is="selection.view.viewname"
class="viewcontainer2" class="viewcontainer2"
:viewDefaultUsage="false" :viewDefaultUsage="false"
:viewdata="JSON.stringify(selection.data)"> :viewdata="JSON.stringify(selection.context)"
:viewparam="JSON.stringify(selection.viewparam)">
</component> </component>
</div> </div>
</split> </split>
...@@ -56,6 +57,10 @@ ...@@ -56,6 +57,10 @@
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
<#ibizinclude>
../@MACRO/FUNC/MACRO.ftl
</#ibizinclude>
<#if view.getPSAppViewLogics?? && view.getPSAppViewLogics()??> <#if view.getPSAppViewLogics?? && view.getPSAppViewLogics()??>
<#list view.getPSAppViewLogics() as logic> <#list view.getPSAppViewLogics() as logic>
<#if logic.getPFLogicCodeType() == 'APP_NEWDATA'> <#if logic.getPFLogicCodeType() == 'APP_NEWDATA'>
...@@ -145,6 +150,7 @@ ...@@ -145,6 +150,7 @@
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public split: number = 0.5; public split: number = 0.5;
<#if ctrl.getXDataPSControl()??> <#if ctrl.getXDataPSControl()??>
<#assign xDataControl = ctrl.getXDataPSControl() /> <#assign xDataControl = ctrl.getXDataPSControl() />
...@@ -157,20 +163,36 @@ ...@@ -157,20 +163,36 @@
public navViewName: string = "<#if xDataControl.getNavPSAppView()??><#assign navPSAppView = xDataControl.getNavPSAppView() />${srffilepath2(navPSAppView.getCodeName())}</#if>"; public navViewName: string = "<#if xDataControl.getNavPSAppView()??><#assign navPSAppView = xDataControl.getNavPSAppView() />${srffilepath2(navPSAppView.getCodeName())}</#if>";
/** /**
* 导航视图参数 * 导航过滤项
* *
* @type {string} * @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public navViewParam: string = '<#if xDataControl.getNavViewParamJO()??>${xDataControl.getNavViewParamJO()}</#if>'; public navFilter: string = "<#if xDataControl.getNavFilter()??>${xDataControl.getNavFilter()}</#if>";
/** /**
* 导航过滤项 * 导航关系
* *
* @type {string} * @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public navFilter: string = "<#if xDataControl.getNavFilter()??>${xDataControl.getNavFilter()}</#if>"; public navPSDer: string = "<#if xDataControl.getNavPSDER()??>n_${xDataControl.getNavPSDER().getPSPickupDEField().getCodeName()?lower_case}_eq</#if>";
/**
* 导航上下文参数
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navigateContext:any =<#if xDataControl.getPSNavigateContexts?? && xDataControl.getPSNavigateContexts()??><@getNavigateContext xDataControl /><#else>null</#if>;
/**
* 导航视图参数
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navigateParams:any = <#if xDataControl.getPSNavigateParams?? && xDataControl.getPSNavigateParams()??><@getNavigateParams xDataControl /><#else>null</#if>;
</#if> </#if>
/** /**
...@@ -326,24 +348,39 @@ ...@@ -326,24 +348,39 @@
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public ${ctrl.name}_selectionchange(args: any [], tag?: string, $event2?: any): void { public ${ctrl.name}_selectionchange(args: any [], tag?: string, $event2?: any): void {
let data:any = {}; let tempContext:any = {};
let tempViewParam:any = {};
if (args.length === 0) { if (args.length === 0) {
return ; return ;
} }
const arg:any = args[0]; const arg:any = args[0];
if(this.context){ if(this.context){
Object.assign(data,JSON.parse(JSON.stringify(this.context))); Object.assign(tempContext,JSON.parse(JSON.stringify(this.context)));
} }
<#if ctrl.getXDataPSControl()??> <#if ctrl.getXDataPSControl()??>
<#assign xDataControl = ctrl.getXDataPSControl()/> <#assign xDataControl = ctrl.getXDataPSControl()/>
<#if xDataControl.getPSAppDataEntity()??> <#if xDataControl.getPSAppDataEntity()??>
<#assign curDataEntity = xDataControl.getPSAppDataEntity()/> <#assign curDataEntity = xDataControl.getPSAppDataEntity()/>
Object.assign(data,{'${curDataEntity.getCodeName()?lower_case}':arg['${curDataEntity.getCodeName()?lower_case}']}); Object.assign(tempContext,{'${curDataEntity.getCodeName()?lower_case}':arg['${curDataEntity.getCodeName()?lower_case}']});
Object.assign(data,{srfparentdename:'${curDataEntity.getCodeName()}',srfparentkey:arg['${curDataEntity.getCodeName()?lower_case}']}); Object.assign(tempContext,{srfparentdename:'${curDataEntity.getCodeName()}',srfparentkey:arg['${curDataEntity.getCodeName()?lower_case}']});
if(this.navFilter && !Object.is(this.navFilter,"")){
Object.assign(tempViewParam,{[this.navFilter]:arg['${curDataEntity.getCodeName()?lower_case}']});
}
if(this.navPSDer && !Object.is(this.navPSDer,"")){
Object.assign(tempViewParam,{[this.navPSDer]:arg['${curDataEntity.getCodeName()?lower_case}']});
}
</#if> </#if>
</#if> </#if>
if(this.navigateContext && Object.keys(this.navigateContext).length >0){
let _context:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navigateContext);
Object.assign(tempContext,_context);
}
if(this.navigateParams && Object.keys(this.navigateParams).length >0){
let _params:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navigateParams);
Object.assign(tempViewParam,_params);
}
this.selection = {}; this.selection = {};
Object.assign(this.selection, { view: { viewname: this.navViewName }, data:data }); Object.assign(this.selection, { view: { viewname: this.navViewName }, context:tempContext,viewparam:tempViewParam });
this.$emit('selectionchange',args); this.$emit('selectionchange',args);
this.$forceUpdate(); this.$forceUpdate();
} }
......
<#ibizinclude>
../@MACRO/DEFAULT.less.ftl
</#ibizinclude>
\ No newline at end of file
<#ibizinclude>../../@MACRO/FUNC/MACRO.ftl</#ibizinclude>
<#assign MDContent><#t>
<#if view.getPSSysCounterRef?? && view.getPSSysCounterRef()?? && view.getPSSysCounterRef().getPSAppCounter()??>
<#assign appCounter = view.getPSSysCounterRef().getPSAppCounter() />
</#if>
<#-- BEGIN:快速搜索框或工具栏或支持快速分组搜索或快速搜索表单部件存在 -->
<#if (view.isEnableQuickSearch() || view.hasPSControl('toolbar'))>
<div 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='quick-search-input' style='max-width: 400px;' placeholder="<@getQuickSearchPlaceholder view />" />
</#if>
<div class='pull-right'>
<#if view.hasPSControl('toolbar')>
<@ibizindent blank=8>
${P.getCtrlCode('toolbar', 'CONTROL.html').code}<#t>
</@ibizindent>
</#if>
</div>
</div>
</#if>
<#-- END:快速搜索或工具栏存在 -->
<#if view.hasPSControl('treegridex')>
${P.getCtrlCode('treegridex', 'CONTROL.html').code}
</#if>
</#assign>
<div class='view-container ${view.getViewType()?lower_case} ${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.vue.ftl
</#ibizinclude>
</@ibizindent>
<div class='content-container'>
<#-- BEGIN:视图顶部视图消息 -->
<@ibizindent blank=12>
<#ibizinclude>
../@MACRO/View_Pos_Top_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图顶部视图消息 -->
<#-- BEGIN:视图内容 -->
<@ibizindent blank=12>
<#ibizinclude>
../@MACRO/VIEW_MD_CONTENT.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图内容 -->
<#-- BEGIN:视图底部视图消息 -->
<@ibizindent blank=12>
<#ibizinclude>
../@MACRO/View_Pos_Bottom_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图底部视图消息 -->
</div>
</card>
</div>
\ No newline at end of file
CTRLTYPE=VIEWLAYOUTPANEL#APPDETREEGRIDEXVIEW
\ No newline at end of file
<#ibizinclude>
../@MACRO/DEFAULT.less.ftl
</#ibizinclude>
.${srffilepath2(view.getCodeName())}{
display: block;
}
\ No newline at end of file
<#ibizinclude>../../@MACRO/FUNC/MACRO.ftl</#ibizinclude>
<div class='view-container ${view.getViewType()?lower_case} ${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>' :dis-hover="true" :bordered="false">
<@ibizindent blank=8>
<#ibizinclude>
../@MACRO/VIEW_CAPTION.vue.ftl
</#ibizinclude>
</@ibizindent>
<div class='content-container'>
<#assign MDContent>
<#-- BEGIN:快速搜索框或工具栏或支持快速分组搜索或快速搜索表单部件存在 -->
<#if (view.isEnableQuickSearch() || view.hasPSControl('toolbar') || view.isEnableQuickGroup() || view.getQuickPSDESearchForm()??)>
<div style="margin-bottom:6px;">
<#if view.isEnableQuickGroup()>
<div class="quick-group-container">
<app-quick-group :items="quickGroupModel" <#if appCounter??>:counterService="${srfclassname('${appCounter.getCodeName()}')}counterservice"</#if> @valuechange="qucikGroupValueChange"></app-quick-group>
</div>
</#if>
<#if view.getQuickPSDESearchForm()??>
<div class="quick-search-container">
<#assign quickSearchForm = view.getQuickPSDESearchForm() />
${P.getCtrlCode(quickSearchForm, 'CONTROL.html').code}
</div>
</#if>
<#if view.isEnableQuickSearch()>
<i-input <#if view.hasPSControl('searchform')><#if view.isExpandSearchForm??> v-show='!this.isExpandSearchForm '</#if></#if> v-model='query' search @on-search='onSearch' placeholder="<@getQuickSearchPlaceholder view />" class='pull-left' style='max-width: 400px;margin-top:6px;' />
</#if>
<div class='pull-right'>
<#if view.hasPSControl('toolbar')>
<@ibizindent blank=20>
${P.getCtrlCode('toolbar', 'CONTROL.html').code}<#t>
</@ibizindent>
</#if>
</div>
</div>
</#if>
<#-- END:快速搜索框或工具栏或支持快速分组搜索或快速搜索表单部件存在 -->
<#if view.hasPSControl('searchform')>
<@ibizindent blank=12>
${P.getCtrlCode('searchform', 'CONTROL.html').code}<#t>
</@ibizindent>
</#if>
<#if view.hasPSControl('kanban')>
<@ibizindent blank=12>
${P.getCtrlCode('kanban', 'CONTROL.html').code}<#t>
</@ibizindent>
</#if>
</#assign>
<#ibizinclude>
../@MACRO/VIEW_MD_CONTENT.vue.ftl
</#ibizinclude>
</div>
</card>
</div>
\ No newline at end of file
CTRLTYPE=VIEWLAYOUTPANEL#APPDEKANBANVIEW
\ No newline at end of file
...@@ -23,6 +23,11 @@ import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.code ...@@ -23,6 +23,11 @@ import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.code
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
<#ibizinclude>
../@MACRO/FUNC/MACRO.ftl
</#ibizinclude>
/** /**
* 选中数据字符串 * 选中数据字符串
* *
...@@ -62,6 +67,22 @@ import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.code ...@@ -62,6 +67,22 @@ import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.code
data: {}, data: {},
} }
/**
* 局部上下文
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public localContext: any = <#if ctrl.getPSNavigateContexts?? && ctrl.getPSNavigateContexts()??><@getNavigateContext ctrl /><#else>null</#if>;
/**
* 局部视图参数
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public localViewParam: any = <#if ctrl.getPSNavigateParams?? && ctrl.getPSNavigateParams()??><@getNavigateParams ctrl /><#else>null</#if>;
/** /**
* 视图数据 * 视图数据
* *
...@@ -155,6 +176,7 @@ import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.code ...@@ -155,6 +176,7 @@ import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.code
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public afterCreated(){ public afterCreated(){
this.initNavParam();
if (this.viewState) { if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => { this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) { if (!Object.is(tag, this.name)) {
...@@ -169,6 +191,25 @@ import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.code ...@@ -169,6 +191,25 @@ import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.code
} }
} }
/**
* 初始化导航参数
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public initNavParam(){
if(this.localContext && Object.keys(this.localContext).length >0){
let _context:any = this.$util.computedNavData({},this.context,this.viewparams,this.localContext);
Object.assign(this.context,_context);
}
if(this.localViewParam && Object.keys(this.localViewParam).length >0){
let _param:any = this.$util.computedNavData({},this.context,this.viewparams,this.localViewParam);
Object.assign(this.viewparams,_param);
}
this.viewdata = JSON.stringify(this.context);
this.viewparam = JSON.stringify(this.viewparams);
}
/** /**
* vue 生命周期 * vue 生命周期
* *
......
<#-- content --> <view_${ctrl.getName()}
<#assign content> :viewState="viewState"
:viewparams="JSON.parse(JSON.stringify(viewparams))"
:context="JSON.parse(JSON.stringify(context))"
:isSingleSelect="isSingleSelect" :isSingleSelect="isSingleSelect"
:selectedData="selectedData" :selectedData="selectedData"
:isShowButton="isShowButton" :isShowButton="isShowButton"
</#assign> name="${ctrl.name}"
<#ibizinclude> ref='${ctrl.name}'
../@MACRO/HTML/DEFAULT.html.ftl <#if ctrl.getHookEventNames()??>
</#ibizinclude> <#list ctrl.getHookEventNames() as eventName>
\ No newline at end of file @${eventName?lower_case}="${ctrl.name}_${eventName?lower_case}($event)"
</#list>
</#if>
@closeview="closeView($event)">
</view_${ctrl.getName()}>
\ No newline at end of file
<#-- -->
<#if ctrl.getPortletType() != 'CONTAINER'>
<#assign content>
<#if (ctrl.getHeight?? && ctrl.getHeight() gt 0)>
:height="${ctrl.getHeight()?c}"
</#if>
<#if (ctrl.getWidth?? && ctrl.getWidth() gt 0)>
:width="${ctrl.getWidth()?c}"
</#if>
</#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl ../@MACRO/HTML/DEFAULT.html.ftl
</#ibizinclude> </#ibizinclude>
<#else>
<div class='portlet-container ${srffilepath2(ctrl.getCodeName())} <#if ctrl.getPSSysCss()??> ${ctrl.getPSSysCss().getCssName()}</#if>' :style="{<#if (ctrl.getHeight?? && ctrl.getHeight() gt 0)>'height': '${ctrl.getHeight()?c}px',</#if><#if (ctrl.getWidth?? && ctrl.getWidth() gt 0)>'width': '${ctrl.getWidth()?c}px '</#if>}">
<#-- BEGIN:容器Flex布局-前 -->
<#if ctrl.getLayoutMode?? && ctrl.getLayoutMode() == 'FLEX'>
<div style = 'display : flex; <#if ctrl.getFlexAlign()??> justify-content :${ctrl.getFlexAlign()};</#if> <#if ctrl.getFlexDir()??> flex-direction:${ctrl.getFlexDir()};</#if> <#if ctrl.getFlexVAlign()??>align-items:${ctrl.getFlexVAlign()};</#if>'>
<#else>
<row>
</#if>
<#-- END:容器Flex布局-前 -->
<#list ctrl.getPSPortlets() as portlet><#t>
<#if portlet.getPortletType?? && portlet.getPortletType()??><#t>
<#-- BEGIN:获取父的layout,自己的LayoutPos -->
<#assign layout=ctrl.getLayoutMode()>
<#assign LayoutPos = portlet.getPSLayoutPos()>
<#-- END:获取父的layout,自己的LayoutPos -->
<#-- BEGIN:子门户部件绘制,栅格绘制 -->
<#if layout == 'TABLE_12COL'>
<#assign multiple = 2/>
<#else>
<#assign multiple = 1/>
</#if>
<#macro format_numer num>
<#if num lt 0 >
0<#t>
<#elseif num gt 24>
24<#t>
<#else>
${num}<#t>
</#if>
</#macro>
<#if (layout == 'TABLE_24COL' || layout == 'TABLE_12COL') && LayoutPos??><#t>
<i-col<#if LayoutPos.getColXS() != -1> :xs="{ span: <@format_numer LayoutPos.getColXS()*multiple/>, offset: <#if LayoutPos.getColXSOffset() != -1><@format_numer LayoutPos.getColXSOffset()*multiple /><#else>0</#if> }"</#if><#if LayoutPos.getColSM() != -1> :sm="{ span: <@format_numer LayoutPos.getColSM()*multiple />, offset: <#if LayoutPos.getColSMOffset() != -1><@format_numer LayoutPos.getColSMOffset()*multiple /><#else>0</#if> }"</#if><#if LayoutPos.getColMD() != -1> :md="{ span: <@format_numer LayoutPos.getColMD()*multiple />, offset: <#if LayoutPos.getColMDOffset() != -1><@format_numer LayoutPos.getColMDOffset()*multiple /><#else>0</#if> }"</#if><#if LayoutPos.getColLG() != -1> :lg="{ span: <@format_numer LayoutPos.getColLG()*multiple />, offset: <#if LayoutPos.getColLGOffset() != -1><@format_numer LayoutPos.getColLGOffset()*multiple /><#else>0</#if> }"</#if>>
<div class="portlet-without-title">
<card class="portlet-card" :bordered="false" dis-hover :padding="0">
<#if portlet.getPortletType() == 'CONTAINER' && portlet.isShowTitleBar() && portlet.getTitle()?has_content>
<p slot='title'>
${portlet.getTitle()}
<span class="line"></span>
</p>
<a slot='extra'></a>
</#if>
<span>
<@ibizindent blank=14><#t>
${P.getCtrlCode(portlet, 'CONTROL.html').code}
</@ibizindent>
</span>
</card>
</div>
</i-col>
<#-- BEGIN:子门户部件绘制,Flex -->
<#else>
<div class="portlet-without-title">
<card class="portlet-card" :bordered="false" dis-hover :padding="0">
<#if portlet.getPortletType() == 'CONTAINER' && portlet.isShowTitleBar() && portlet.getTitle()?has_content>
<p slot='title'>
${portlet.getTitle()}
<span class="line"></span>
</p>
<a slot='extra'></a>
</#if>
<span>
<@ibizindent blank=14><#t>
${P.getCtrlCode(portlet, 'CONTROL.html').code}
</@ibizindent>
</span>
</card>
</div>
</#if>
<#-- END:子门户部件绘制 -->
</#if>
</#list>
<#-- BEGIN:容器Flex布局-后 -->
<#if ctrl.getLayoutMode?? && ctrl.getLayoutMode() == 'FLEX'>
</div>
<#else>
</row>
</#if>
<#-- END:容器Flex布局-后 -->
</div>
</#if>
\ No newline at end of file
<#if ctrl.getPortletType() != 'CONTAINER'>
<#ibizinclude> <#ibizinclude>
../@MACRO/CSS/DEFAULT.less.ftl ../@MACRO/CSS/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
...@@ -13,6 +14,7 @@ ...@@ -13,6 +14,7 @@
-webkit-box-align: center; -webkit-box-align: center;
-ms-flex-align: center; -ms-flex-align: center;
align-items: center; align-items: center;
justify-content: space-between;
width:100%; width:100%;
line-height: 22px; line-height: 22px;
font-size: 16px; font-size: 16px;
...@@ -25,6 +27,13 @@ ...@@ -25,6 +27,13 @@
i{ i{
margin-right: 5px; margin-right: 5px;
} }
>.portlet-action{
margin-left: 12px;
font-size: 14px;
>a{
padding: 6px;
}
}
} }
> .portlet-with-title{ > .portlet-with-title{
width:100%; width:100%;
...@@ -52,3 +61,4 @@ ...@@ -52,3 +61,4 @@
} }
} }
} }
</#if>
<#if ctrl.getPortletType() != 'CONTAINER'>
<#assign import_block> <#assign import_block>
<#if ctrl.getPSPortlets?? && ctrl.getPSPortlets()??> <#if ctrl.getPSPortlets?? && ctrl.getPSPortlets()??>
<#list ctrl.getPSPortlets() as subctrl> <#list ctrl.getPSPortlets() as subctrl>
...@@ -63,3 +64,4 @@ export default class <#if ctrl.getPSAppDataEntity()??>${srfclassname('${ctrl.get ...@@ -63,3 +64,4 @@ export default class <#if ctrl.getPSAppDataEntity()??>${srfclassname('${ctrl.get
} }
</script> </script>
</#if>
\ No newline at end of file
<#if ctrl.getPortletType() != 'CONTAINER'>
<#ibizinclude> <#ibizinclude>
../@MACRO/MODEL/DEFAULT.ts.ftl ../@MACRO/MODEL/DEFAULT.ts.ftl
</#ibizinclude> </#ibizinclude>
</#if>
\ No newline at end of file
<#if ctrl.getPortletType() != 'CONTAINER'>
<#ibizinclude> <#ibizinclude>
../@MACRO/SERVICE/DEFAULT.ts.ftl ../@MACRO/SERVICE/DEFAULT.ts.ftl
</#ibizinclude> </#ibizinclude>
</#if>
\ No newline at end of file
<div class='panel-container'> <#if ctrl.getLayoutMode()=='FLEX'>
<row class="app-layoutpanel"> <div class='panel-container' style="<#if ctrl.getWidth() gt 0>width: ${ctrl.getWidth()?c}px;</#if><#if ctrl.getHeight() gt 0>height: ${ctrl.getHeight()?c}px;</#if>">
<div class="app-layoutpanel" style="height:100%;display: flex;">
<@ibizindent blank=8>
<#if ctrl.getRootPSPanelItems()??>
<#list ctrl.getRootPSPanelItems() as item>
${P.getPartCode(item).code}
</#list>
</#if>
</@ibizindent>
</div>
<#else>
<row class="app-layoutpanel" style="height:100%;">
<@ibizindent blank=8> <@ibizindent blank=8>
<#if ctrl.getRootPSPanelItems()??> <#if ctrl.getRootPSPanelItems()??>
<#list ctrl.getRootPSPanelItems() as item> <#list ctrl.getRootPSPanelItems() as item>
...@@ -8,4 +19,5 @@ ${P.getPartCode(item).code} ...@@ -8,4 +19,5 @@ ${P.getPartCode(item).code}
</#if> </#if>
</@ibizindent> </@ibizindent>
</row> </row>
</#if>
</div> </div>
\ No newline at end of file
...@@ -45,6 +45,28 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -45,6 +45,28 @@ import CodeListService from "@service/app/codelist-service";
* 面板数据对象 * 面板数据对象
* *
* @type {*} * @type {*}
* @memberof Mob
*/
public panelData:any = null;
/**
* 监听数据对象
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Watch('inputData',{immediate:true})
async onInputDataChange(newVal: any, oldVal: any){
if(newVal){
await this.computedUIData(newVal);
this.panelLogic({ name: '', newVal: null, oldVal: null });
this.$forceUpdate();
}
}
/**
* 计算UI展示数据
*
* @param codelistArray 代码表模型数组
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
@Prop() public inputData?: any; @Prop() public inputData?: any;
...@@ -170,14 +192,14 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -170,14 +192,14 @@ import CodeListService from "@service/app/codelist-service";
let res:any = await this.getAllCodeList(codelistArray,true); let res:any = await this.getAllCodeList(codelistArray,true);
this.dataModel.getDataItems().forEach((item:any) =>{ this.dataModel.getDataItems().forEach((item:any) =>{
if(item.codelist){ if(item.codelist){
panelData[item.prop] = res.get(item.codelist.tag).get(this.data[item.name]); panelData[item.prop] = res.get(item.codelist.tag).get(this.inputData[item.name]);
}else{ }else{
panelData[item.prop] = this.data[item.name]; panelData[item.prop] = this.inputData[item.name];
} }
}) })
}else{ }else{
this.dataModel.getDataItems().forEach((item:any) =>{ this.dataModel.getDataItems().forEach((item:any) =>{
panelData[item.prop] = this.data[item.name]; panelData[item.prop] = this.inputData[item.name];
}) })
} }
} }
...@@ -318,27 +340,6 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -318,27 +340,6 @@ import CodeListService from "@service/app/codelist-service";
} }
} }
/**
* 界面行为
*
* @param {*} row
* @param {*} tag
* @param {*} $event
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public uiAction(row: any, tag: any, $event: any) {
<#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>
}
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
...@@ -126,3 +126,27 @@ ...@@ -126,3 +126,27 @@
}' <#t> }' <#t>
</#macro> </#macro>
<#-- END:获取AC参数 --> <#-- END:获取AC参数 -->
<#-- BEGIN:获取导航上下文 -->
<#macro getNavigateContext currentItem>
'{ <#t>
<#if currentItem.getPSNavigateContexts?? && currentItem.getPSNavigateContexts()??>
<#list currentItem.getPSNavigateContexts() as navContext>
${navContext.getKey()}:<#if navContext.isRawValue()?? && navContext.isRawValue() == true>"${navContext.getValue()}"<#else>"%${navContext.getValue()}%"</#if><#if navContext_has_next>,</#if> <#t>
</#list>
</#if>
}' <#t>
</#macro>
<#-- END:获取导航上下文 -->
<#-- BEGIN:获取导航参数 -->
<#macro getNavigateParams currentItem>
'{ <#t>
<#if currentItem.getPSNavigateParams?? && currentItem.getPSNavigateParams()??>
<#list currentItem.getPSNavigateParams() as navParam >
${navParam.getKey()}:<#if navParam.isRawValue()?? && navParam.isRawValue() == true>"${navParam.getValue()}"<#else>"%${navParam.getValue()}%"</#if><#if navParam_has_next>,</#if> <#t>
</#list>
</#if>
}' <#t>
</#macro>
<#-- END:获取导航参数 -->
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<dropdown-list-dynamic <dropdown-list-dynamic
v-model="data.${editor.name}" v-model="data.${editor.name}"
:data="data" :data="data"
:context="context" :context="context"
:viewparams="viewparams" :viewparams="viewparams"
:itemParam="<#if item.getEditorParam('ITEMPARAM','') != ''>${item.getEditorParam('ITEMPARAM','')}<#else>{}</#if>" :localContext =<@getNavigateContext editor />
:localParam =<@getNavigateParams editor />
:disabled="detailsModel.${editor.name}.disabled" :disabled="detailsModel.${editor.name}.disabled"
<#if editor.getPSCodeList()??> <#if editor.getPSCodeList()??>
<#assign codelist=editor.getPSCodeList()> <#assign codelist=editor.getPSCodeList()>
......
<dropdown-list v-model="row[column.property]" :disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1" <#if item.getPSCodeList()??><#assign codelist=item.getPSCodeList()>tag='${codelist.codeName}' codelistType='${codelist.getCodeListType()}'</#if> placeholder=<#if item.getPlaceHolder()??>'${item.getPlaceHolder()}'<#else>'请选择...'</#if> style="${item.getEditorCssStyle()}" @change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}"></dropdown-list> <#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
\ No newline at end of file <dropdown-list
v-model="row[column.property]"
:disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1"
:data="row"
:context="context"
:viewparams="viewparams"
:localContext =<@getNavigateContext editor />
:localParam =<@getNavigateParams editor />
<#if item.getPSCodeList()??>
<#assign codelist=item.getPSCodeList()>
tag='${codelist.codeName}'
codelistType='${codelist.getCodeListType()}'
</#if>
placeholder=<#if item.getPlaceHolder()??>'${item.getPlaceHolder()}'<#else>'请选择...'</#if>
style="${item.getEditorCssStyle()}"
@change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}">
</dropdown-list>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<dropdown-list <dropdown-list
v-model="data.${editor.name}" v-model="data.${editor.name}"
:data="data" :data="data"
:context="context" :context="context"
:viewparams="viewparams" :viewparams="viewparams"
:itemParam="<#if item.getEditorParam('ITEMPARAM','') != ''>${item.getEditorParam('ITEMPARAM','')}<#else>{}</#if>" :localContext =<@getNavigateContext editor />
:localParam =<@getNavigateParams editor />
:disabled="detailsModel.${editor.name}.disabled" :disabled="detailsModel.${editor.name}.disabled"
<#if editor.getPSCodeList()??> <#if editor.getPSCodeList()??>
<#assign codelist=editor.getPSCodeList()> <#assign codelist=editor.getPSCodeList()>
......
<dropdown-list v-model="row[column.property]" :disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1" <#if item.getPSCodeList()??><#assign codelist=item.getPSCodeList()>tag='${codelist.codeName}' codelistType='${codelist.getCodeListType()}'</#if> placeholder=<#if item.getPlaceHolder()??>'${item.getPlaceHolder()}'<#else>'请选择...'</#if> style="${item.getEditorCssStyle()}" @change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}"></dropdown-list> <#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
\ No newline at end of file <dropdown-list
v-model="row[column.property]"
:disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1"
:data="row"
:context="context"
:viewparams="viewparams"
:localContext =<@getNavigateContext editor />
:localParam =<@getNavigateParams editor />
<#if item.getPSCodeList()??>
<#assign codelist=item.getPSCodeList()>
tag='${codelist.codeName}'
codelistType='${codelist.getCodeListType()}'
</#if>
placeholder=<#if item.getPlaceHolder()??>'${item.getPlaceHolder()}'<#else>'请选择...'</#if>
style="${item.getEditorCssStyle()}"
@change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}">
</dropdown-list>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<dropdown-list <dropdown-list
v-model="data.${editor.name}" v-model="data.${editor.name}"
:data="data" :data="data"
:context="context" :context="context"
:viewparams="viewparams" :viewparams="viewparams"
:itemParam="<#if item.getEditorParam('ITEMPARAM','') != ''>${item.getEditorParam('ITEMPARAM','')}<#else>{}</#if>" :localContext =<@getNavigateContext editor />
:localParam =<@getNavigateParams editor />
:disabled="detailsModel.${editor.name}.disabled" :disabled="detailsModel.${editor.name}.disabled"
style="${editor.getEditorCssStyle()}width: 100px;" style="${editor.getEditorCssStyle()}width: 100px;"
<#if editor.getPSCodeList()??> <#if editor.getPSCodeList()??>
......
<#ibizinclude>../@MACRO/PANEL/DEFAULT.vue.ftl</#ibizinclude>
\ No newline at end of file
EDITORTYPE=MDROPDOWNLIST#TRANSFER
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册