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

Merge remote-tracking branch 'local/master' into dev

上级 22450933
...@@ -5,6 +5,7 @@ import { Subject, Subscription } from 'rxjs'; ...@@ -5,6 +5,7 @@ import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control'; import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util } from '@/utils'; import { UIActionTool,Util } from '@/utils';
import NavDataService from '@/service/app/navdata-service'; import NavDataService from '@/service/app/navdata-service';
import AppCenterService from "@service/app/app-center-service";
<#if ctrl.getPSAppCounterRefs?? && ctrl.getPSAppCounterRefs()??> <#if ctrl.getPSAppCounterRefs?? && ctrl.getPSAppCounterRefs()??>
<#list ctrl.getPSAppCounterRefs() as singleCounterRef> <#list ctrl.getPSAppCounterRefs() as singleCounterRef>
<#if singleCounterRef.getPSAppCounter()??> <#if singleCounterRef.getPSAppCounter()??>
......
...@@ -70,6 +70,8 @@ import ${srfclassname('${_appde.getCodeName()}')}Service from '@/service/${srffi ...@@ -70,6 +70,8 @@ import ${srfclassname('${_appde.getCodeName()}')}Service from '@/service/${srffi
*/ */
@Errorlog @Errorlog
public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> { public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> {
data.page = data.page ? data.page : 0;
data.size = data.size ? data.size : 1000;
<#list ctrl.getPSDEFormItems() as deItem> <#list ctrl.getPSDEFormItems() as deItem>
<#if deItem.getPSEditor()?? && deItem.getPSEditor().getPSAppDataEntity?? && deItem.getPSEditor().getPSAppDataEntity()?? && deItem.getPSEditor().getPSAppDEDataSet?? && deItem.getPSEditor().getPSAppDEDataSet()??> <#if deItem.getPSEditor()?? && deItem.getPSEditor().getPSAppDataEntity?? && deItem.getPSEditor().getPSAppDataEntity()?? && deItem.getPSEditor().getPSAppDEDataSet?? && deItem.getPSEditor().getPSAppDEDataSet()??>
<#assign _appde = deItem.getPSEditor().getPSAppDataEntity()/> <#assign _appde = deItem.getPSEditor().getPSAppDataEntity()/>
......
...@@ -197,6 +197,15 @@ ...@@ -197,6 +197,15 @@
*/ */
public selections: Array<any> = []; public selections: Array<any> = [];
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appStateEvent: Subscription | undefined;
/** /**
* Vue声明周期,组件挂载完毕 * Vue声明周期,组件挂载完毕
* *
...@@ -245,6 +254,16 @@ ...@@ -245,6 +254,16 @@
} }
}); });
} }
if(AppCenterService && AppCenterService.getMessageCenter()){
this.appStateEvent = AppCenterService.getMessageCenter().subscribe(({ name, action, data }) =>{
if(!Object.is(name,"${ctrl.getPSAppDataEntity().getCodeName()}")){
return;
}
if(Object.is(action,'appRefresh')){
this.refresh([data]);
}
})
}
} }
/** /**
...@@ -265,6 +284,9 @@ ...@@ -265,6 +284,9 @@
if (this.viewStateEvent) { if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe(); this.viewStateEvent.unsubscribe();
} }
if(this.appStateEvent){
this.appStateEvent.unsubscribe();
}
<#if destroyed_block??> <#if destroyed_block??>
${destroyed_block} ${destroyed_block}
</#if> </#if>
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
} }
.toolbar-container{ .toolbar-container{
padding: 4px; padding: 4px;
display: flex;
flex-wrap: wrap;
align-items: center;
} }
} }
.list-exp-bar-content { .list-exp-bar-content {
......
...@@ -61,6 +61,29 @@ ...@@ -61,6 +61,29 @@
../@MACRO/FUNC/MACRO.ftl ../@MACRO/FUNC/MACRO.ftl
</#ibizinclude> </#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>
/** /**
* 视图唯一标识 * 视图唯一标识
* *
......
...@@ -3,6 +3,16 @@ ...@@ -3,6 +3,16 @@
<#if view.getViewType() == 'DEDATAVIEWEXPVIEW'> <#if view.getViewType() == 'DEDATAVIEWEXPVIEW'>
: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
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
} }
.toolbar-container{ .toolbar-container{
padding: 4px; padding: 4px;
display: flex;
flex-wrap: wrap;
align-items: center;
} }
} }
.dataview-exp-bar-content { .dataview-exp-bar-content {
......
...@@ -151,6 +151,10 @@ ${P.getLogicCode(uiAction, "LOGIC.vue").code} ...@@ -151,6 +151,10 @@ ${P.getLogicCode(uiAction, "LOGIC.vue").code}
*/ */
protected click(item: any) { protected click(item: any) {
if (item) { if (item) {
let navDataService = NavDataService.getInstance(this.$store);
if(Object.is(this.navModel,"route")){
navDataService.removeNavData(this.viewtag);
}
switch (item.appfunctag) { switch (item.appfunctag) {
<#if ctrl.getPSAppFuncs()??> <#if ctrl.getPSAppFuncs()??>
<#assign appFuncs = ctrl.getPSAppFuncs()> <#assign appFuncs = ctrl.getPSAppFuncs()>
......
<template> <template>
<div>
<div v-if="filterFields.length > 0" class="filter-group">
<filter-tree :datas="filterItems" :fields="filterFields">
<template slot-scope="{ data }">
<#if ctrl.getPSSearchBarFilters()??>
<#list ctrl.getPSSearchBarFilters() as filter>
<template v-if="Object.is(data.field, '${filter.getName()}')">
${P.getEditorCode(filter, "EDITOR.vue").code}
</template>
</#list>
</#if>
</template>
</filter-tree>
</div>
<div class="search-bar-footer">
<#-- <#if !view.isEnableQuickSearch() && ctrl.getQuickSearchMode() gt 0>
<i-input v-model="query" placeholder="<#if ctrl.getPSSearchBarQuickSearchs()??><#list ctrl.getPSSearchBarQuickSearchs() as search><#if search_index gt 0>,</#if><#if search.getPSDEField()??>${search.getPSDEField().getLogicName()}</#if></#list></#if>" style="<#if ctrl.getQuickSearchWidth() gt 0>width: ${ctrl.getQuickSearchWidth()?c}px;</#if>"></i-input>
</#if> -->
<div class="search-bar-action">
<i-button type="primary" @click="onSearch">搜索</i-button>
<i-button @click="onReset">重置</i-button>
<i-button @click="onSave"><i class="fa fa-floppy-o" aria-hidden="true"></i></i-button>
</div>
</div>
</div>
</template> </template>
<#assign import_block>
import FilterTree from '@components/filter-tree/filter-tree.vue';
</#assign>
<#assign component_block>
FilterTree,
</#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
<#-- /**
* 快速搜索值
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public query: string = ''; -->
/**
* 过滤属性集合
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
get filterFields() {
return Object.values(this.detailsModel);
}
/**
* 过滤属性模型集合
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public detailsModel: any = {
<#if ctrl.getPSSearchBarFilters()??>
<#list ctrl.getPSSearchBarFilters() as filter>
'${filter.getName()}': {
label: '<#if filter.getPSDEField()??>${filter.getPSDEField().getLogicName()}</#if>',
name: '${filter.getName()}',
prop: '<#if filter.getPSDEField()??>${filter.getPSDEField().getCodeName()?lower_case}<#else>${filter.getName()}</#if>',
disabled: false
},
</#list>
</#if>
};
/**
* 过滤项集合
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public filterItems: any[] = [];
/**
* 应用实体名称
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appdeName: string = '<#if ctrl.getPSDataEntity()??>${ctrl.getPSDataEntity().getCodeName()}</#if>';
/**
* modleId
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public modelId: string = "searchbar_<#if ctrl.getPSAppDataEntity()??>${ctrl.getPSAppDataEntity().getCodeName()?lower_case}<#else>app</#if>_${ctrl.getCodeName()?lower_case}";
/**
* 功能服务名称
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public utilServiceName: string = "<#if app.getPSAppFilterStorageUtil?? && app.getPSAppFilterStorageUtil()??>${app.getPSAppFilterStorageUtil().getCodeName()?lower_case}</#if>";
/** /**
* 获取多项数据 * 获取多项数据
* *
...@@ -22,9 +123,203 @@ ...@@ -22,9 +123,203 @@
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public getData(): any { public getData(): any {
let data: any = {};
<#-- if(!Object.is(this.query, '')) {
Object.assign(data, { query: this.query })
} -->
if(this.filterFields.length > 0) {
Object.assign(data, { filter: this.getFilter() })
}
return data;
}
/**
* 获取filter
*
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getFilter(): any {
if(this.filterItems.length === 0) {
return null; return null;
} }
let ands: any[] = this.transformAnd(this.filterItems);
this.transformResult(ands, '$and');
return { '$and': ands };
}
/**
* 处理结果集
*
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public transformResult(datas: any[], pName: string) {
let items: any[] = [];
for(let i = datas.length - 1; i >= 0; i--) {
let data: any = datas[i];
let field: string = Object.is(pName, '$and') ? '$or' : '$and';
if(data.hasOwnProperty(field)) {
items.push(data);
datas.splice(i, 1);
this.transformResult(data[field], field);
}
}
if(items.length > 0) {
let item: any = {};
item[pName] = items;
datas.push(item);
}
}
/**
* 处理并且逻辑
*
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public transformAnd(datas: any[]): any {
let result: any[] = [];
datas.forEach((data: any) => {
let item: any = {};
if(data.field && data.mode) {
let field: any = this.detailsModel[data.field];
item[field.prop] = {};
item[field.prop][data.mode] = (data[data.field] == null ? '' : data[data.field]);
result.push(item)
} else if(Object.is(data.label, '$and')) {
let items: any[] = this.transformAnd(data.children);
result = [...result, ...items];
} else if(Object.is(data.label, '$or')) {
item[data.label] = this.transformOr(data.children);
result.push(item)
}
})
return result;
}
/**
* 处理或逻辑
*
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public transformOr(datas: any[]) {
let result: any[] = [];
datas.forEach((data: any) => {
let item: any = {};
if(data.field && data.mode) {
let field: any = this.detailsModel[data.field];
item[field.prop] = {};
item[field.prop][data.mode] = (data[data.field] == null ? '' : data[data.field]);
result.push(item);
} else if(Object.is(data.label, '$and')) {
item[data.label] = this.transformAnd(data.children);
result.push(item)
} else if(Object.is(data.label, '$or')) {
item[data.label] = this.transformOr(data.children);
result.push(item);
}
})
return result;
}
/**
* Vue声明周期(处理组件的输入属性)
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public created(): void {
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (Object.is('load', action)) {
this.load(data);
}
});
}
}
/**
* 删除过滤项
*
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onRemove(index: number) {
this.filterItems.splice(index, 1);
}
/**
* 搜索
*
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onSearch() {
this.$emit('search', this.getData());
}
/**
* 保存
*
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onSave() {
let param: any = {};
Object.assign(param, {
model: this.filterItems,
appdeName: this.appdeName,
modelid: this.modelId,
utilServiceName: this.utilServiceName,
...this.viewparams
});
let post = this.service.saveModel(this.utilServiceName, this.context, param);
post.then((response: any) => {
this.$emit("save", response.data);
}).catch((response: any) => {
console.log(response);
});
}
/**
* 重置
*
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onReset() {
<#-- this.query = ''; -->
this.filterItems = [];
}
/**
* 加载
*
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public load(data: any) {
let param: any = {};
Object.assign(param, {
appdeName: this.appdeName,
modelid: this.modelId,
utilServiceName: this.utilServiceName,
...this.viewparams
});
let post = this.service.loadModel(this.utilServiceName, this.context, param);
post.then((response: any) => {
if(response.status == 200) {
this.filterItems = response.data;
this.$nextTick(() => {
this.onSearch();
})
}
}).catch((response: any) => {
console.log(response);
});
}
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
<#-- content --> <#-- content -->
<#assign content> <#assign content>
v-show="isExpandSearchForm"
@search="onSearch($event)"
</#assign> </#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl ../@MACRO/HTML/DEFAULT.html.ftl
......
.search-bar-footer {
height: 32px;
.search-bar-action {
float: right;
> .ivu-btn {
margin-left: 5px;
}
}
}
<#ibizinclude> <#ibizinclude>
../@MACRO/CSS/DEFAULT.less.ftl ../@MACRO/CSS/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
<#assign import_block>
import UtilService from '@/utilservice/util-service';
</#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/SERVICE/SERVICE_HEADER.ts.ftl ../@MACRO/SERVICE/SERVICE_HEADER.ts.ftl
</#ibizinclude> </#ibizinclude>
/**
* 工具服务对象
*
* @protected
* @type {UtilService}
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
protected utilService: UtilService = new UtilService();
/**
* 加载数据模型
*
* @param {string} serviceName
* @param {*} context
* @param {*} viewparams
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
public loadModel(serviceName: string, context: any, viewparams: any) {
return new Promise((resolve: any, reject: any) => {
this.utilService.getService(serviceName).then((service: any) => {
service.loadModelData(JSON.stringify(context), viewparams).then((response: any) => {
resolve(response);
}).catch((response: any) => {
reject(response);
});
}).catch((response: any) => {
reject(response);
});
});
}
/**
* 保存模型
*
* @param {string} serviceName
* @param {*} context
* @param {*} viewparams
* @returns
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
public saveModel(serviceName: string, context: any, viewparams: any) {
return new Promise((resolve: any, reject: any) => {
this.utilService.getService(serviceName).then((service: any) => {
service.saveModelData(JSON.stringify(context), '', viewparams).then((response: any) => {
resolve(response);
}).catch((response: any) => {
reject(response);
});
}).catch((response: any) => {
reject(response);
});
});
}
<#ibizinclude> <#ibizinclude>
../@MACRO/SERVICE/SERVICE_BOTTOM.ts.ftl ../@MACRO/SERVICE/SERVICE_BOTTOM.ts.ftl
</#ibizinclude> </#ibizinclude>
\ No newline at end of file
...@@ -139,6 +139,17 @@ ...@@ -139,6 +139,17 @@
this.afterCreated(); this.afterCreated();
} }
/**
* 生命周期
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public mounted(){
if(this.items.length>0){
this.isShowSlot?this.tabPanelClick(this.items[0].name):this.items.length>1?this.tabPanelClick(this.items[1].name):()=>{};
}
}
/** /**
* 执行created后的逻辑 * 执行created后的逻辑
* *
......
.drtab{ .drtab{
height:100%; height:100%;
overflow: auto;
.app-dr-tab { .app-dr-tab {
height: 100%; height: 100%;
>.ivu-tabs-bar { >.ivu-tabs-bar {
......
...@@ -5,7 +5,7 @@ ${item.render.code} ...@@ -5,7 +5,7 @@ ${item.render.code}
{ {
<#if item.getIndex()??>gridIndex:${item.getIndex()},</#if> <#if item.getIndex()??>gridIndex:${item.getIndex()},</#if>
position:<#if item.getPosition()?? && item.getPosition() =='bottom'>"bottom"<#else>"top"</#if>, position:<#if item.getPosition()?? && item.getPosition() =='bottom'>"bottom"<#else>"top"</#if>,
type:<#if item.getType()??>'${item.getType()}'<#else>'category'</#if>, type:<#if item.getEChartsType()??>'${item.getEChartsType()}'<#else>'category'</#if>,
name:<#if item.getCaption()??>'${item.getCaption()}'</#if>, name:<#if item.getCaption()??>'${item.getCaption()}'</#if>,
<#if item.getMinValue()??>min:${item.getMinValue()},</#if> <#if item.getMinValue()??>min:${item.getMinValue()},</#if>
<#if item.getMaxValue()??>max:${item.getMaxValue()},</#if> <#if item.getMaxValue()??>max:${item.getMaxValue()},</#if>
......
...@@ -5,7 +5,7 @@ ${item.render.code} ...@@ -5,7 +5,7 @@ ${item.render.code}
{ {
<#if item.getIndex()??>gridIndex:${item.getIndex()},</#if> <#if item.getIndex()??>gridIndex:${item.getIndex()},</#if>
position:<#if item.getPosition()?? && item.getPosition() =='bottom'>"bottom"<#else>"top"</#if>, position:<#if item.getPosition()?? && item.getPosition() =='bottom'>"bottom"<#else>"top"</#if>,
type:<#if item.getType()?? && item.getType() == 'numeric'>'value'<#else>'${item.getType()}'</#if>, type:<#if item.getEChartsType()??>'${item.getEChartsType()}'<#else>'value'</#if>,
name:<#if item.getCaption()??>'${item.getCaption()}'</#if>, name:<#if item.getCaption()??>'${item.getCaption()}'</#if>,
<#if item.getMinValue()??>min:${item.getMinValue()},</#if> <#if item.getMinValue()??>min:${item.getMinValue()},</#if>
<#if item.getMaxValue()??>max:${item.getMaxValue()},</#if> <#if item.getMaxValue()??>max:${item.getMaxValue()},</#if>
......
...@@ -5,7 +5,7 @@ ${item.render.code} ...@@ -5,7 +5,7 @@ ${item.render.code}
{ {
<#if item.getIndex()??>gridIndex:${item.getIndex()},</#if> <#if item.getIndex()??>gridIndex:${item.getIndex()},</#if>
position:<#if item.getPosition()?? && item.getPosition() =='bottom'>"bottom"<#else>"top"</#if>, position:<#if item.getPosition()?? && item.getPosition() =='bottom'>"bottom"<#else>"top"</#if>,
type:<#if item.getType()??>'${item.getType()}'<#else>'category'</#if>, type:<#if item.getEChartsType()??>'${item.getEChartsType()}'<#else>'category'</#if>,
name:<#if item.getCaption()??>'${item.getCaption()}'</#if>, name:<#if item.getCaption()??>'${item.getCaption()}'</#if>,
<#if item.getMinValue()??>min:${item.getMinValue()},</#if> <#if item.getMinValue()??>min:${item.getMinValue()},</#if>
<#if item.getMaxValue()??>max:${item.getMaxValue()},</#if> <#if item.getMaxValue()??>max:${item.getMaxValue()},</#if>
......
...@@ -5,7 +5,7 @@ ${item.render.code} ...@@ -5,7 +5,7 @@ ${item.render.code}
{ {
<#if item.getIndex()??>gridIndex:${item.getIndex()},</#if> <#if item.getIndex()??>gridIndex:${item.getIndex()},</#if>
position:<#if item.getPosition()?? && item.getPosition() =='bottom'>"bottom"<#else>"top"</#if>, position:<#if item.getPosition()?? && item.getPosition() =='bottom'>"bottom"<#else>"top"</#if>,
type:<#if item.getType()?? && item.getType() == 'numeric'>'value'<#else>'${item.getType()}'</#if>, type:<#if item.getEChartsType()??>'${item.getEChartsType()}'<#else>'value'</#if>,
name:<#if item.getCaption()??>'${item.getCaption()}'</#if>, name:<#if item.getCaption()??>'${item.getCaption()}'</#if>,
<#if item.getMinValue()??>min:${item.getMinValue()},</#if> <#if item.getMinValue()??>min:${item.getMinValue()},</#if>
<#if item.getMaxValue()??>max:${item.getMaxValue()},</#if> <#if item.getMaxValue()??>max:${item.getMaxValue()},</#if>
......
...@@ -240,6 +240,15 @@ ...@@ -240,6 +240,15 @@
*/ */
public sortField: string = '<#if ctrl.getMinorSortPSDEF()??>${ctrl.getMinorSortPSDEF().getCodeName()?lower_case}</#if>'; public sortField: string = '<#if ctrl.getMinorSortPSDEF()??>${ctrl.getMinorSortPSDEF().getCodeName()?lower_case}</#if>';
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appStateEvent: Subscription | undefined;
/** /**
* 排序点击事件 * 排序点击事件
* @param {string} field 属性名 * @param {string} field 属性名
...@@ -328,6 +337,16 @@ ...@@ -328,6 +337,16 @@
} }
}); });
} }
if(AppCenterService && AppCenterService.getMessageCenter()){
this.appStateEvent = AppCenterService.getMessageCenter().subscribe(({ name, action, data }) =>{
if(!Object.is(name,"${ctrl.getPSAppDataEntity().getCodeName()}")){
return;
}
if(Object.is(action,'appRefresh')){
this.refresh([data]);
}
})
}
} }
/** /**
...@@ -373,6 +392,9 @@ ...@@ -373,6 +392,9 @@
if (this.viewStateEvent) { if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe(); this.viewStateEvent.unsubscribe();
} }
if(this.appStateEvent){
this.appStateEvent.unsubscribe();
}
<#if destroyed_block??> <#if destroyed_block??>
${destroyed_block} ${destroyed_block}
</#if> </#if>
......
...@@ -31,12 +31,15 @@ ...@@ -31,12 +31,15 @@
.search-container { .search-container {
width: 30%; width: 30%;
height: 48px; height: 48px;
padding: 10px 10px 10px 0; padding: 10px;
min-width: 200px; min-width: 200px;
max-width: 400px; max-width: 400px;
} }
.toolbar-container{ .toolbar-container{
padding: 4px; padding: 4px;
display: flex;
flex-wrap: wrap;
align-items: center;
} }
} }
.calendar-exp-bar-content { .calendar-exp-bar-content {
......
...@@ -374,9 +374,11 @@ FullCalendar, ...@@ -374,9 +374,11 @@ FullCalendar,
let handleEvents = ()=>{ let handleEvents = ()=>{
if(_this.isSelectFirstDefault){ if(_this.isSelectFirstDefault){
// 模拟$event数据 // 模拟$event数据
let tempEvent = JSON.parse(JSON.stringify(_this.events[0])); let tempEvent = JSON.parse(JSON.stringify(_this.events.length > 0?_this.events[0]:{}));
_this.onEventClick(tempEvent,true); _this.onEventClick(tempEvent,true);
if(_this.events.length > 0){
_this.events[0].className = "select-first-event"; _this.events[0].className = "select-first-event";
}
_this.calendarClass = "calendar select-first-calendar"; _this.calendarClass = "calendar select-first-calendar";
} }
let filterEvents = this.events.filter((event:any)=>{ let filterEvents = this.events.filter((event:any)=>{
...@@ -624,6 +626,15 @@ FullCalendar, ...@@ -624,6 +626,15 @@ FullCalendar,
*/ */
public selections: any[] = []; public selections: any[] = [];
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appStateEvent: Subscription | undefined;
/** /**
* 获取多项数据 * 获取多项数据
* *
...@@ -672,6 +683,39 @@ FullCalendar, ...@@ -672,6 +683,39 @@ FullCalendar,
} }
}); });
} }
if(AppCenterService && AppCenterService.getMessageCenter()){
this.appStateEvent = AppCenterService.getMessageCenter().subscribe(({ name, action, data }) =>{
if(!Object.is(name,"${ctrl.getPSAppDataEntity().getCodeName()}")){
return;
}
if(Object.is(action,'appRefresh')){
this.refresh();
}
})
}
}
/**
* vue 生命周期
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public mounted(){
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public afterMounted(){
let appCalendar: any = this.$refs.calendar;
if(appCalendar){
let api = appCalendar.getApi();
api.updateSize()
}
} }
...@@ -715,6 +759,9 @@ FullCalendar, ...@@ -715,6 +759,9 @@ FullCalendar,
if (this.viewStateEvent) { if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe(); this.viewStateEvent.unsubscribe();
} }
if(this.appStateEvent){
this.appStateEvent.unsubscribe();
}
<#if destroyed_block??> <#if destroyed_block??>
${destroyed_block} ${destroyed_block}
</#if> </#if>
......
...@@ -240,6 +240,15 @@ ...@@ -240,6 +240,15 @@
@Provide() @Provide()
public expandedKeys: string[] = []; public expandedKeys: string[] = [];
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appStateEvent: Subscription | undefined;
/** /**
* 选中数据变更事件 * 选中数据变更事件
* *
...@@ -319,6 +328,16 @@ ...@@ -319,6 +328,16 @@
} }
}); });
} }
if(AppCenterService && AppCenterService.getMessageCenter()){
this.appStateEvent = AppCenterService.getMessageCenter().subscribe(({ name, action, data }) =>{
if(!Object.is(name,"${ctrl.getPSAppDataEntity().getCodeName()}")){
return;
}
if(Object.is(action,'appRefresh')){
this.refresh([data]);
}
})
}
} }
/** /**
...@@ -349,6 +368,9 @@ ...@@ -349,6 +368,9 @@
if (this.viewStateEvent) { if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe(); this.viewStateEvent.unsubscribe();
} }
if(this.appStateEvent){
this.appStateEvent.unsubscribe();
}
<#if destroyed_block??> <#if destroyed_block??>
${destroyed_block} ${destroyed_block}
</#if> </#if>
......
...@@ -6,7 +6,15 @@ ...@@ -6,7 +6,15 @@
<div slot='left'> <div slot='left'>
<#if ctrl.isShowTitleBar()> <#if ctrl.isShowTitleBar()>
<div class='tree-exp-bar-header'> <div class='tree-exp-bar-header'>
<div><#if ctrl.getTitle() == ''>树视图导航栏<#else>${ctrl.getTitle()}</#if></div> <div class="tree-exp-bar-title"><#if ctrl.getTitle() == ''>树视图导航栏<#else>${ctrl.getTitle()}</#if></div>
<#if ctrl.getPSControls()??>
<#assign controls = ctrl.getPSControls()/>
<#list controls as singleControl>
<#if singleControl.getControlType() == "TOOLBAR">
${P.getCtrlCode(singleControl, 'CONTROL.html').code}
</#if>
</#list>
</#if>
</div> </div>
</#if> </#if>
<#if ctrl.isEnableSearch()> <#if ctrl.isEnableSearch()>
...@@ -46,6 +54,29 @@ ...@@ -46,6 +54,29 @@
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude> </#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>
/** /**
* 视图唯一标识 * 视图唯一标识
* *
...@@ -369,6 +400,15 @@ ...@@ -369,6 +400,15 @@
this.$emit('load', $event); this.$emit('load', $event);
} }
<#if ctrl.getPSControls()??>
<#assign controls = ctrl.getPSControls()/>
<#list controls as singleControl>
<#if singleControl.getControlType() == "TOOLBAR">
${P.getCtrlCode(singleControl, 'CONTROL.vue').code}
</#if>
</#list>
</#if>
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
...@@ -2,6 +2,16 @@ ...@@ -2,6 +2,16 @@
<#if view.getViewType() == 'DETREEEXPVIEW'> <#if view.getViewType() == 'DETREEEXPVIEW'>
: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
......
...@@ -22,11 +22,22 @@ ...@@ -22,11 +22,22 @@
font-weight: 600; font-weight: 600;
color: black; color: black;
padding-left: 8px; padding-left: 8px;
flex-shrink: 0;
i { i {
font-size: 20px; font-size: 20px;
margin-top: -2px; margin-top: -2px;
} }
} }
.toolbar-container{
margin-left: auto;
margin-right: 10px;
display: flex;
flex-wrap: wrap;
align-items: center;
.ivu-badge-count{
top: 2px;
}
}
} }
.search-content { .search-content {
width: 100%; width: 100%;
......
此差异已折叠。
<#assign content>
:showBusyIndicator="${ctrl.isShowBusyIndicator()?c}"
<#if ctrl.getPSControlActions()??>
<#list ctrl.getPSControlActions() as action>
<#if action.getPSAppDEMethod?? && action.getPSAppDEMethod()??>
${action.name?lower_case}Action='${action.getPSAppDEMethod().getCodeName()}'
</#if>
</#list>
</#if>
</#assign>
<#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl
</#ibizinclude>
\ No newline at end of file
.app-wizard {
background: #fff;
height: 100%;
.view-steps{
display: flex;
padding: 0 20px;
position: relative;
.steps_icon{
width: 30px;
text-align: center;
font-size: 20px;
background: #409eff;
color: #fff;
line-height: 50px;
height: 50px;
margin-top: 21px;
z-index: 1;
}
.steps_icon:hover{
cursor: pointer;
}
}
.wizard-steps{
padding: 10px 20px 10px 70px;
margin-bottom: 10px;
width: 100%;
.steps-item-span{
padding: 7px 20px;
position: relative;
right: 20px;
}
.drawer-box-shadow{
box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
}
.el-step__head.is-process{
border-color: #7e8187;
color: #7e8187;
}
.el-step__title.is-process{
color: #7e8187;
}
.el-step__head.is-success{
border-color: #1890ff;
color: #1890ff;
}
.el-step__title.is-success{
color: #1890ff;
}
.el-step__title:hover{
cursor: pointer;
}
.app-active-step{
.el-icon-check:before {
content: "";
width: 12px;
height: 12px;
border-radius: 8px;
background-color: #1890ff;
display: block;
}
}
}
.el-step__main{
background-color: rgb(239, 239, 239);
}
.background-box {
height: 50px;
width: calc(100% - 40px);
position: absolute;
background: #efefef;
top: 21px;
border-top: 2px solid rgb(225, 225, 225);
}
}
.app-wizard-popover-container{
.app-wizard-container{
width: 100%;
.popover-title{
position: absolute;
top: 14px;
left: 13px;
}
.app-wizard-header{
width: 100%;
height: 30px;
line-height: 22px;
padding: 2px;
border-bottom: 1px solid #ccc;
margin-bottom: 10px;
.app-wizard-header-extra{
float: right;
}
}
.app-wizard-content{
width: 100%;
padding: 4px 0px;
}
.app-wizard-footer{
display: flex;
}
}
}
.el-popper[x-placement^=bottom] {
margin-top: 0px;
}
.app-wizard-drawer{
.app-form {
height: calc(100% - 51px);
}
.drawer-button{
display: flex;
justify-content: flex-end;
}
}
<#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.codeName}')}Model
*/
public getDataItems(): any[] {
return [
<#-- 主实体所有属性 -->
<#if ctrl.getPSAppDataEntity()??>
<#assign appDataEntity = ctrl.getPSAppDataEntity() />
<#if appDataEntity.getAllPSAppDEFields?? && appDataEntity.getAllPSAppDEFields()??>
<#list appDataEntity.getAllPSAppDEFields() as defield>
{
<#if defield.isKeyField()>
name: '${appDataEntity.getCodeName()?lower_case}',
prop: '${defield.getCodeName()?lower_case}',
<#else>
name: '${defield.getCodeName()?lower_case}',
prop: '${defield.getCodeName()?lower_case}',
</#if>
},
</#list>
</#if>
</#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}',
dataType: 'FONTKEY',
},
</#if>
</#list>
</#if>
</#if>
]
}
<#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 init(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Create(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 finish(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.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=STATEWIZARDPANEL
\ No newline at end of file
...@@ -154,6 +154,15 @@ GanttElastic, ...@@ -154,6 +154,15 @@ GanttElastic,
*/ */
public tasks: any[] = []; public tasks: any[] = [];
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appStateEvent: Subscription | undefined;
/** /**
* 监听语言变化 * 监听语言变化
* *
...@@ -345,6 +354,16 @@ GanttElastic, ...@@ -345,6 +354,16 @@ GanttElastic,
public created() { public created() {
this.locale = this.$i18n.locale; this.locale = this.$i18n.locale;
this.load(); this.load();
if(AppCenterService && AppCenterService.getMessageCenter()){
this.appStateEvent = AppCenterService.getMessageCenter().subscribe(({ name, action, data }) =>{
if(!Object.is(name,"${ctrl.getPSAppDataEntity().getCodeName()}")){
return;
}
if(Object.is(action,'appRefresh')){
this.refresh();
}
})
}
} }
/** /**
...@@ -361,6 +380,29 @@ GanttElastic, ...@@ -361,6 +380,29 @@ GanttElastic,
} }
} }
/**
* vue 生命周期
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public afterDestroy() {
if(this.appStateEvent){
this.appStateEvent.unsubscribe();
}
<#if destroyed_block??>
${destroyed_block}
</#if>
}
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<#if item.render??> <#if item.render??>
${item.render.code} ${item.render.code}
<#else> <#else>
<app-form-group layoutType="<#if item.getPSLayout()??>${item.getPSLayout().getLayout()}</#if>" titleStyle="<#if item.getLabelPSSysCss?? && item.getLabelPSSysCss()??>${item.getLabelPSSysCss().getCssName()}</#if>" class='<#if item.getPSSysCss?? && item.getPSSysCss()??> ${item.getPSSysCss().getCssName()}</#if>' :uiActionGroup="detailsModel.${item.name}.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="<#if langbase??>$t('${langbase}.details.${item.name}')<#else>'${item.getCaption()}'</#if>" :isShowCaption="${item.isShowCaption()?c}" uiStyle="${item.getDetailStyle()}" :titleBarCloseMode="${item.getTitleBarCloseMode()}" :isInfoGroupMode="${item.isInfoGroupMode()?c}" <#if item.getPSSysImage()??>:iconInfo="{<#assign img=item.getPSSysImage()><#if img.getImagePath() == "">'iconclass':'${img.getCssClass()}'<#else>'iconpath':'${img.getImagePath()}'</#if>}"</#if>> <app-form-group :manageContainerStatus="detailsModel.${item.name}.manageContainerStatus" :isManageContainer="detailsModel.${item.name}.isManageContainer" @managecontainerclick="manageContainerClick('${item.name}')" layoutType="<#if item.getPSLayout()??>${item.getPSLayout().getLayout()}</#if>" titleStyle="<#if item.getLabelPSSysCss?? && item.getLabelPSSysCss()??>${item.getLabelPSSysCss().getCssName()}</#if>" class='<#if item.getPSSysCss?? && item.getPSSysCss()??> ${item.getPSSysCss().getCssName()}</#if>' :uiActionGroup="detailsModel.${item.name}.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="<#if langbase??>$t('${langbase}.details.${item.name}')<#else>'${item.getCaption()}'</#if>" :isShowCaption="${item.isShowCaption()?c}" uiStyle="${item.getDetailStyle()}" :titleBarCloseMode="${item.getTitleBarCloseMode()}" :isInfoGroupMode="${item.isInfoGroupMode()?c}" <#if item.getPSSysImage()??>:iconInfo="{<#assign img=item.getPSSysImage()><#if img.getImagePath() == "">'iconclass':'${img.getCssClass()}'<#else>'iconpath':'${img.getImagePath()}'</#if>}"</#if>>
<#assign content> <#assign content>
<#list item.getPSDEFormDetails() as formmenber> <#list item.getPSDEFormDetails() as formmenber>
<#if !(formmenber.isHidden?? && formmenber.isHidden())> <#if !(formmenber.isHidden?? && formmenber.isHidden())>
......
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/LANGBASE.vue.ftl ../@MACRO/CONTROL/LANGBASE.vue.ftl
</#ibizinclude> </#ibizinclude>
<#assign detail>caption: '${item.getCaption()}', detailType: '${item.getDetailType()}', name: '${item.getName()}', visible: <#if item.getPSDEFDGroupLogic('PANELVISIBLE')??>false<#else>true</#if>, isShowCaption: ${item.isShowCaption()?c}, form: this</#assign> <#assign detail>caption: '${item.getCaption()}', detailType: '${item.getDetailType()}', name: '${item.getName()}', visible: <#if item.getPSDEFDGroupLogic('PANELVISIBLE')??>false<#else>true</#if>, isShowCaption: ${item.isShowCaption()?c}, form: this, isControlledContent: <#if item.getShowMoreMode() == 1>true<#else>false</#if> </#assign>
<#if item.getDetailType() == 'BUTTON'> <#if item.getDetailType() == 'BUTTON'>
new FormButtonModel({ ${detail}<#if item.getPSUIAction()??><#assign uiaction=item.getPSUIAction()>, uiaction: { type: '${uiaction.getUIActionType()}', new FormButtonModel({ ${detail}<#if item.getPSUIAction()??><#assign uiaction=item.getPSUIAction()>, uiaction: { type: '${uiaction.getUIActionType()}',
tag: '${uiaction.getUIActionTag()}'<#if (uiaction.getActionTarget()!="")>, actiontarget: '${uiaction.getActionTarget()}'</#if> }</#if> }) tag: '${uiaction.getUIActionTag()}'<#if (uiaction.getActionTarget()!="")>, actiontarget: '${uiaction.getActionTarget()}'</#if> }</#if> })
...@@ -14,7 +14,7 @@ new FormPageModel({ ${detail} }) ...@@ -14,7 +14,7 @@ new FormPageModel({ ${detail} })
<#elseif item.getDetailType() == 'FORMPART'> <#elseif item.getDetailType() == 'FORMPART'>
new FormPartModel({ ${detail} }) new FormPartModel({ ${detail} })
<#elseif item.getDetailType() == 'GROUPPANEL'> <#elseif item.getDetailType() == 'GROUPPANEL'>
new FormGroupPanelModel({ ${detail}, uiActionGroup: { caption: '<#if item.getPSUIActionGroup()??>${item.getPSUIActionGroup().getName()}</#if>', langbase: '<#if langbase??>${langbase}</#if>', extractMode: '<#if item.getActionGroupExtractMode?? && item.getActionGroupExtractMode()??>${item.getActionGroupExtractMode()}<#else>ITEM</#if>', details: [<#if item.getPSUIActionGroup()??><#list item.getPSUIActionGroup().getPSUIActionGroupDetails() as uadetails><#if uadetails_index gt 0>, </#if>{ name: '${item.getName()}_${uadetails.getName()}', caption: '${uadetails.getPSUIAction().getCaption()}', uiactiontag: '${uadetails.getPSUIAction().getUIActionTag()?lower_case}'<#if uadetails.getPSUIAction().getPSSysImage()??>, <#assign viewimg=uadetails.getPSUIAction().getPSSysImage()/><#if viewimg.getCssClass() != ''>icon: '${viewimg.getCssClass()}'<#else>img: '${viewimg.getImagePath()}'</#if></#if>,isShowCaption:${uadetails.isShowCaption()?c},isShowIcon:${uadetails.isShowIcon()?c} }</#list></#if>] } }) new FormGroupPanelModel({ ${detail}, uiActionGroup: { caption: '<#if item.getPSUIActionGroup()??>${item.getPSUIActionGroup().getName()}</#if>', langbase: '<#if langbase??>${langbase}</#if>', extractMode: '<#if item.getActionGroupExtractMode?? && item.getActionGroupExtractMode()??>${item.getActionGroupExtractMode()}<#else>ITEM</#if>', details: [<#if item.getPSUIActionGroup()??><#list item.getPSUIActionGroup().getPSUIActionGroupDetails() as uadetails><#if uadetails_index gt 0>, </#if>{ name: '${item.getName()}_${uadetails.getName()}', caption: '${uadetails.getPSUIAction().getCaption()}', uiactiontag: '<#if uadetails.getPSUIAction().getPSAppDataEntity?? && uadetails.getPSUIAction().getPSAppDataEntity()??>${uadetails.getPSUIAction().getPSAppDataEntity().getCodeName()?lower_case}_</#if>${uadetails.getPSUIAction().getUIActionTag()?lower_case}'<#if uadetails.getPSUIAction().getPSSysImage()??>, <#assign viewimg=uadetails.getPSUIAction().getPSSysImage()/><#if viewimg.getCssClass() != ''>icon: '${viewimg.getCssClass()}'<#else>img: '${viewimg.getImagePath()}'</#if></#if>,isShowCaption:${uadetails.isShowCaption()?c},isShowIcon:${uadetails.isShowIcon()?c} }</#list></#if>] }, isManageContainer: <#if item.getShowMoreMode() == 2>true<#else>false</#if>, showMoreModeItems: [<#if item.getPSDEFormDetails()??><#list item.getPSDEFormDetails() as moreItem><#if moreItem.getShowMoreMode() == 1>'${moreItem.getName()}',</#if></#list></#if>] })
<#elseif item.getDetailType() == 'IFRAME'> <#elseif item.getDetailType() == 'IFRAME'>
new FormIFrameModel({ ${detail} }) new FormIFrameModel({ ${detail} })
<#elseif item.getDetailType() == 'RAWITEM'> <#elseif item.getDetailType() == 'RAWITEM'>
......
...@@ -13,6 +13,15 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -13,6 +13,15 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
/**
* 视图默认使用
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/** /**
* 工作流审批意见控件绑定值 * 工作流审批意见控件绑定值
* *
...@@ -301,6 +310,24 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -301,6 +310,24 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
</#list> </#list>
/**
* 显示更多模式切换操作
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public manageContainerClick(name: string){
let model = this.detailsModel[name];
if(model.isManageContainer){
model.setManageContainerStatus(!model.manageContainerStatus);
model.showMoreModeItems.forEach((item:any) => {
if(this.detailsModel[item].isControlledContent){
this.detailsModel[item].setVisible(model.manageContainerStatus? this.detailsModel[item].oldVisible : false);
}
});
}
}
/** /**
* 重置表单项值 * 重置表单项值
* *
...@@ -973,14 +1000,25 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -973,14 +1000,25 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
this.onFormLoad(data,'autoSave'); this.onFormLoad(data,'autoSave');
this.$emit('save', data); this.$emit('save', data);
<#if ctrl.getControlType() == 'FORM'> <#if ctrl.getControlType() == 'FORM'>
this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag }); AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data});
</#if> </#if>
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'save', data: data }); this.formState.next({ type: 'save', data: data });
}); });
}).catch((response: any) => { }).catch((response: any) => {
if (response && response.status && response.data) { if (response && response.status && response.data) {
if(response.data.errorKey && Object.is(response.data.errorKey,"versionCheck")){
this.$Modal.confirm({
title: '保存数据发生错误',
content: '数据不一致,可能后台数据已经被修改,是否要重新加载数据?',
onOk: () => {
this.refresh([]);
},
onCancel: () => { }
});
}else{
this.$Notice.error({ title: '错误', desc: response.data.message }); this.$Notice.error({ title: '错误', desc: response.data.message });
}
return; return;
} }
if (!response || !response.status || !response.data) { if (!response || !response.status || !response.data) {
...@@ -1045,7 +1083,7 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -1045,7 +1083,7 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
this.onFormLoad(data,'save'); this.onFormLoad(data,'save');
this.$emit('save', data); this.$emit('save', data);
<#if ctrl.getControlType() == 'FORM'> <#if ctrl.getControlType() == 'FORM'>
this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag }); AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data});
</#if> </#if>
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'save', data: data }); this.formState.next({ type: 'save', data: data });
...@@ -1058,8 +1096,19 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -1058,8 +1096,19 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
resolve(response); resolve(response);
}).catch((response: any) => { }).catch((response: any) => {
if (response && response.status && response.data) { if (response && response.status && response.data) {
if(response.data.errorKey && Object.is(response.data.errorKey,"versionCheck")){
this.$Modal.confirm({
title: '保存数据发生错误',
content: '数据不一致,可能后台数据已经被修改,是否要重新加载数据?',
onOk: () => {
this.refresh([]);
},
onCancel: () => { }
});
}else{
this.$Notice.error({ title: '错误', desc: response.data.message }); this.$Notice.error({ title: '错误', desc: response.data.message });
reject(response); reject(response);
}
return; return;
} }
if (!response || !response.status || !response.data) { if (!response || !response.status || !response.data) {
...@@ -1095,6 +1144,9 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -1095,6 +1144,9 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
this.formState.next({ type: 'remove', data: data }); this.formState.next({ type: 'remove', data: data });
this.data.ismodify = false; this.data.ismodify = false;
this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;删除成功!' }); this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;删除成功!' });
<#if ctrl.getControlType() == 'FORM'>
AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data});
</#if>
resolve(response); resolve(response);
} }
}).catch((error: any) => { }).catch((error: any) => {
...@@ -1116,10 +1168,6 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -1116,10 +1168,6 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
*/ */
public async wfstart(data: any,localdata?:any): Promise<any> { public async wfstart(data: any,localdata?:any): Promise<any> {
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
<#-- if(!this.WFStartAction){
this.$Notice.error({ title: '错误', desc: 'WFCIDEditView视图表单WFStartAction参数未配置' });
return;
} -->
const _this: any = this; const _this: any = this;
const post: Promise<any> = _this.save({},false); const post: Promise<any> = _this.save({},false);
post.then((response:any) =>{ post.then((response:any) =>{
...@@ -1176,10 +1224,6 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -1176,10 +1224,6 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
*/ */
public async wfsubmit(data: any,localdata?:any): Promise<any> { public async wfsubmit(data: any,localdata?:any): Promise<any> {
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
<#-- if(!this.WFSubmitAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表单WFSubmitAction参数未配置' });
return;
} -->
const _this: any = this; const _this: any = this;
const arg: any = data[0]; const arg: any = data[0];
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
...@@ -1192,6 +1236,9 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -1192,6 +1236,9 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
// 保存完成UI处理 // 保存完成UI处理
this.onFormLoad(arg,'save'); this.onFormLoad(arg,'save');
this.$emit('save', arg); this.$emit('save', arg);
<#if ctrl.getControlType() == 'FORM'>
AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data});
</#if>
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'save', data: arg }); this.formState.next({ type: 'save', data: arg });
}); });
...@@ -1279,6 +1326,9 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -1279,6 +1326,9 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
this.fillForm(_data,'updateFormItem'); this.fillForm(_data,'updateFormItem');
this.formLogic({ name: '', newVal: null, oldVal: null }); this.formLogic({ name: '', newVal: null, oldVal: null });
this.dataChang.next(JSON.stringify(this.data)); this.dataChang.next(JSON.stringify(this.data));
<#if ctrl.getControlType() == 'FORM'>
AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data});
</#if>
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'updateformitem', ufimode: arg.srfufimode, data: _data }); this.formState.next({ type: 'updateformitem', ufimode: arg.srfufimode, data: _data });
}); });
......
...@@ -116,6 +116,15 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -116,6 +116,15 @@ import { FormItemModel } from '@/model/form-detail';
*/ */
public codeListService:CodeListService = new CodeListService({ $store: this.$store }); public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appStateEvent: Subscription | undefined;
/** /**
* 获取多项数据 * 获取多项数据
* *
...@@ -450,17 +459,24 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -450,17 +459,24 @@ import { FormItemModel } from '@/model/form-detail';
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public allColumns: any[] = [ public allColumns: any[] = [
<#if ctrl.getAllPSDEGridColumns()??> <#if ctrl.getAllPSDEGridColumns()??>
<#list ctrl.getAllPSDEGridColumns() as column> <#list ctrl.getAllPSDEGridColumns() as column>
{ {
name: '${column.getName()?lower_case}', name: '${column.getName()?lower_case}',
label: '${column.getCaption()}', label: '${column.getCaption()}',
langtag: '<#if langbase??>${langbase}.columns.${column.getName()?lower_case}</#if>', langtag: '<#if langbase??>${langbase}.columns.${column.getName()?lower_case}</#if>',
show: <#if column.isHideDefault()>false<#else>true</#if>, show: <#if column.isHideDefault()>false<#else>true</#if>,
util: '${column.getWidthUnit()}' util: '${column.getWidthUnit()}',
<#-- BEGIN:是否支持行编辑 -->
<#if ctrl.isEnableRowEdit() && column.isEnableRowEdit()>
isEnableRowEdit: true,
<#else>
isEnableRowEdit: false,
</#if>
<#-- END:是否支持行编辑 -->
}, },
</#list> </#list>
</#if> </#if>
] ]
/** /**
...@@ -1092,6 +1108,16 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1092,6 +1108,16 @@ import { FormItemModel } from '@/model/form-detail';
} }
}); });
} }
if(AppCenterService && AppCenterService.getMessageCenter()){
this.appStateEvent = AppCenterService.getMessageCenter().subscribe(({ name, action, data }) =>{
if(!Object.is(name,"${ctrl.getPSAppDataEntity().getCodeName()}")){
return;
}
if(Object.is(action,'appRefresh')){
this.refresh([data]);
}
})
}
} }
/** /**
...@@ -1112,6 +1138,9 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1112,6 +1138,9 @@ import { FormItemModel } from '@/model/form-detail';
if (this.viewStateEvent) { if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe(); this.viewStateEvent.unsubscribe();
} }
if(this.appStateEvent){
this.appStateEvent.unsubscribe();
}
<#if destroyed_block??> <#if destroyed_block??>
${destroyed_block} ${destroyed_block}
</#if> </#if>
...@@ -1735,16 +1764,17 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1735,16 +1764,17 @@ import { FormItemModel } from '@/model/form-detail';
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public getCellClassName(args:{row: any, column: any, rowIndex: number, columnIndex:number}){ public getCellClassName(args:{row: any, column: any, rowIndex: number, columnIndex:number}){
let hasRowEdit:any = { if(args.column.property){
<#list ctrl.getPSDEGridColumns() as column> let col = this.allColumns.find((item:any)=>{
<#if ctrl.isEnableRowEdit() && column.isEnableRowEdit()> return Object.is(args.column.property,item.name);
'${column.getName()?lower_case}':true, })
<#else> if(col !== undefined){
'${column.getName()?lower_case}':false, if(col.isEnableRowEdit && this.actualIsOpenEdit ){
</#if> return 'edit-cell';
</#list> }
}
} }
return ( hasRowEdit[args.column.property] && this.actualIsOpenEdit ) ? "edit-cell" : "info-cell"; return 'info-cell';
} }
/** /**
......
...@@ -75,6 +75,8 @@ import ${srfclassname('${aggAppDataEntity.getCodeName()}')}Service from '@/servi ...@@ -75,6 +75,8 @@ import ${srfclassname('${aggAppDataEntity.getCodeName()}')}Service from '@/servi
*/ */
@Errorlog @Errorlog
public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> { public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> {
data.page = data.page ? data.page : 0;
data.size = data.size ? data.size : 1000;
<#list ctrl.getPSDEGridEditItems() as deItem> <#list ctrl.getPSDEGridEditItems() as deItem>
<#if deItem.getPSEditor()?? && deItem.getPSEditor().getPSAppDataEntity?? && deItem.getPSEditor().getPSAppDataEntity()?? && deItem.getPSEditor().getPSAppDEDataSet?? && deItem.getPSEditor().getPSAppDEDataSet()??> <#if deItem.getPSEditor()?? && deItem.getPSEditor().getPSAppDataEntity?? && deItem.getPSEditor().getPSAppDataEntity()?? && deItem.getPSEditor().getPSAppDEDataSet?? && deItem.getPSEditor().getPSAppDEDataSet()??>
<#assign _appde = deItem.getPSEditor().getPSAppDataEntity()/> <#assign _appde = deItem.getPSEditor().getPSAppDataEntity()/>
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
} }
.toolbar-container{ .toolbar-container{
padding: 4px; padding: 4px;
display: flex;
flex-wrap: wrap;
align-items: center;
} }
} }
.grid-exp-bar-content { .grid-exp-bar-content {
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
<#if view.hasPSControl('wizardpanel')> <#if view.hasPSControl('wizardpanel')>
${P.getCtrlCode('wizardpanel', 'CONTROL.html').code} ${P.getCtrlCode('wizardpanel', 'CONTROL.html').code}
</#if> </#if>
<#if view.hasPSControl('statewizardpanel')>
${P.getCtrlCode('statewizardpanel', 'CONTROL.html').code}
</#if>
</@ibizindent> </@ibizindent>
</#assign> </#assign>
<#ibizinclude> <#ibizinclude>
......
...@@ -29,16 +29,6 @@ import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.code ...@@ -29,16 +29,6 @@ import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.code
../@MACRO/FUNC/MACRO.ftl ../@MACRO/FUNC/MACRO.ftl
</#ibizinclude> </#ibizinclude>
/**
* 视图打开模式
*
* @protected
* @type {('DEFAULT' | 'MODAL')}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop({ default: 'DEFAULT' })
protected openMode!: 'DEFAULT' | 'MODAL';
/** /**
* 选中数据字符串 * 选中数据字符串
* *
......
...@@ -178,6 +178,15 @@ import { Environment } from '@/environments/environment'; ...@@ -178,6 +178,15 @@ import { Environment } from '@/environments/environment';
*/ */
@Prop() public width?: number; @Prop() public width?: number;
/**
* 视图默认使用
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
<#if ctrl.getPortletType() == 'ACTIONBAR'> <#if ctrl.getPortletType() == 'ACTIONBAR'>
/** /**
* 操作栏模型数据 * 操作栏模型数据
...@@ -194,6 +203,7 @@ import { Environment } from '@/environments/environment'; ...@@ -194,6 +203,7 @@ import { Environment } from '@/environments/environment';
<#if viewUIAction.getPSUIAction?? && viewUIAction.getPSUIAction()??> <#if viewUIAction.getPSUIAction?? && viewUIAction.getPSUIAction()??>
<#assign uiaction = viewUIAction.getPSUIAction() /> <#assign uiaction = viewUIAction.getPSUIAction() />
actionName:"${uiaction.getCaption()}", actionName:"${uiaction.getCaption()}",
icon:"<#if uiaction.getIconCls?? && uiaction.getIconCls()??>${uiaction.getIconCls()}</#if>",
<#if uiaction.getPSAppCounter?? && uiaction.getPSAppCounter()??> <#if uiaction.getPSAppCounter?? && uiaction.getPSAppCounter()??>
<#assign counter = uiaction.getPSAppCounter() /> <#assign counter = uiaction.getPSAppCounter() />
counterService:this.${srfclassname('${counter.getCodeName()}')}counterservice, counterService:this.${srfclassname('${counter.getCodeName()}')}counterservice,
......
<#assign selfContent>
<#if !item.isHidden()> <#if !item.isHidden()>
<#assign selfContent>
<div class="item-field"> <div class="item-field">
<#if item.isShowCaption()><span class="item-field-label <#if item.getLabelPSSysCss()??> ${item.getLabelPSSysCss().getCssName()}</#if>"<#if item.getLabelPSSysCss()??> style="${item.getLabelPSSysCss().getRawCssStyle()}"</#if>>${item.getCaption()}</span></#if> <#if item.isShowCaption()><span class="item-field-label <#if item.getLabelPSSysCss()??> ${item.getLabelPSSysCss().getCssName()}</#if>"<#if item.getLabelPSSysCss()??> style="${item.getLabelPSSysCss().getRawCssStyle()}"</#if>>${item.getCaption()}</span></#if>
<div class="item-field-content"> <div class="item-field-content">
${P.getEditorCode(item, "PANELEDITOR.vue").code} ${P.getEditorCode(item, "PANELEDITOR.vue").code}
</div> </div>
</div> </div>
</#if> </#assign>
</#assign>
<#ibizinclude> <#ibizinclude>
./@MACRO/PLAYOUT.vue.ftl ./@MACRO/PLAYOUT.vue.ftl
</#ibizinclude> </#ibizinclude>
<#if item.getParentLayoutMode()=='FLEX'> <#if item.getParentLayoutMode()=='FLEX'>
<div v-show="detailsModel.${item.name}.visible" style="${flexAttr}<#if item.getWidth() gt 0>width: ${item.getWidth()?c}px;</#if><#if item.getHeight() gt 0>height: ${item.getHeight()?c}px;</#if><#if item.getPSSysCss()??>${item.getPSSysCss().getRawCssStyle()}</#if>" class="app-layoutpanel-field <#if item.getPSSysCss?? && item.getPSSysCss()??> ${item.getPSSysCss().getCssName()}</#if>"> <div v-show="detailsModel.${item.name}.visible" style="${flexAttr}<#if item.getWidth() gt 0>width: ${item.getWidth()?c}px;</#if><#if item.getHeight() gt 0>height: ${item.getHeight()?c}px;</#if><#if item.getPSSysCss()??>${item.getPSSysCss().getRawCssStyle()}</#if>" class="app-layoutpanel-field <#if item.getPSSysCss?? && item.getPSSysCss()??> ${item.getPSSysCss().getCssName()}</#if>">
${content} ${content}
</div> </div>
<#else> <#else>
<i-col v-show="detailsModel.${item.name}.visible" ${tableAttr} style="${flexAttr}<#if item.getWidth() gt 0>width: ${item.getWidth()?c}px;</#if><#if item.getHeight() gt 0>height: ${item.getHeight()?c}px;</#if><#if item.getPSSysCss()??>${item.getPSSysCss().getRawCssStyle()}</#if>" class="app-layoutpanel-field<#if item.getPSSysCss()??> ${item.getPSSysCss().getCssName()}</#if>"> <i-col v-show="detailsModel.${item.name}.visible" ${tableAttr} style="${flexAttr}<#if item.getWidth() gt 0>width: ${item.getWidth()?c}px;</#if><#if item.getHeight() gt 0>height: ${item.getHeight()?c}px;</#if><#if item.getPSSysCss()??>${item.getPSSysCss().getRawCssStyle()}</#if>" class="app-layoutpanel-field<#if item.getPSSysCss()??> ${item.getPSSysCss().getCssName()}</#if>">
${content} ${content}
</i-col> </i-col>
</#if>
</#if> </#if>
\ No newline at end of file
...@@ -221,6 +221,185 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -221,6 +221,185 @@ import CodeListService from "@service/app/codelist-service";
} }
/**
* 设置变更面板编辑项的值
*
* @param data 面板数据
* @param {{ name: string, value: any }} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onPanelItemValueChange(data: any,$event: { name: string, value: any }): void {
if (!$event) {
return;
}
if (!$event.name || Object.is($event.name, '') || !data.hasOwnProperty($event.name)) {
return;
}
data[$event.name] = $event.value;
this.panelEditItemChange(data, $event.name, $event.value);
}
/**
* 面板编辑项值变化后续操作
*
* @public
* @param data 面板数据
* @param property 编辑项名
* @param value 编辑项值
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public panelEditItemChange(data: any, property: string, value: any){
// 面板数据变化事件
if((this.dataModel.getDataItems instanceof Function) && this.dataModel.getDataItems().length >0){
let modelitem =this.dataModel.getDataItems().find((item:any) =>{
return item.name === property;
})
if(modelitem){
this.$emit('panelDataChange',{[modelitem.prop]: value});
}
}
/**
* 数据模型对象
*
* @type {${srfclassname('${ctrl.codeName}')}Model}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public dataModel:${srfclassname('${ctrl.codeName}')}Model = new ${srfclassname('${ctrl.codeName}')}Model();
/**
* UI数据对象
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public data:any = {};
/**
* 面板数据对象
*
* @type {*}
* @memberof Mob
*/
public panelData:any = null;
/**
* 监听数据对象
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Watch('inputData',{immediate:true,deep: true})
public onInputDataChange(newVal: any, oldVal: any){
if(newVal){
this.computedUIData(newVal);
this.panelLogic({ name: '', newVal: null, oldVal: null });
this.$forceUpdate();
}
}
/**
* 计算UI展示数据
*
* @param codelistArray 代码表模型数组
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public computedUIData(newVal:any){
if((this.dataModel.getDataItems instanceof Function) && this.dataModel.getDataItems().length >0){
this.dataModel.getDataItems().forEach((item:any) =>{
this.data[item.name] = newVal[item.prop];
})
}
}
/**
* 计算面板数据
*
* @memberof Mob
*/
public computeOutputData(){
let panelData:any = {};
if((this.dataModel.getDataItems instanceof Function) && this.dataModel.getDataItems().length >0){
this.dataModel.getDataItems().forEach((item:any) =>{
panelData[item.prop] = this.data[item.name];
})
}
this.panelData = Object.assign(JSON.parse(JSON.stringify(this.inputData)),panelData);
}
/**
* 界面行为
*
* @param {*} row
* @param {*} tag
* @param {*} $event
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public async uiAction(row: any, tag: any, $event: any) {
await this.computeOutputData();
<#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>
}
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public opendata(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any){
if (this.parentRef.opendata && this.parentRef.opendata instanceof Function) {
this.parentRef.opendata(args,fullargs,params, $event, xData);
}
}
/**
* 打开新建数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
if (this.parentRef.newdata && this.parentRef.newdata instanceof Function) {
this.parentRef.newdata(args,fullargs,params, $event, xData);
}
}
/**
* 删除
*
* @param {any[]} datas
* @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public async remove(datas: any[]): Promise<any> {
if (this.parentRef.remove && this.parentRef.remove instanceof Function) {
return this.parentRef.remove(datas);
}
}
/**
* 刷新
*
* @param {*} [opt={}]
* @memberof Main
*/
public refresh(opt: any = {}) {
if (this.parentRef.refresh && this.parentRef.refresh instanceof Function) {
this.parentRef.refresh(opt);
}
}
/** /**
* 设置变更面板编辑项的值 * 设置变更面板编辑项的值
* *
......
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude> <#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<ibiz-group-select <app-group-select
name="${editor.name}" name="${editor.name}"
:value='data.${editor.name}' :value='data.${editor.name}'
valueitem="${editor.getValueItemName()}" valueitem="${editor.getValueItemName()}"
...@@ -12,4 +12,4 @@ ...@@ -12,4 +12,4 @@
:data="data" :data="data"
:context="context" :context="context"
@formitemvaluechange="onFormItemValueChange"> @formitemvaluechange="onFormItemValueChange">
</ibiz-group-select> </app-group-select>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude> <#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<ibiz-group-select <app-group-select
name="${editor.name}" name="${editor.name}"
:value='data.${editor.name}' :value='data.${editor.name}'
valueitem="${editor.getValueItemName()}" valueitem="${editor.getValueItemName()}"
...@@ -12,4 +12,4 @@ ...@@ -12,4 +12,4 @@
:data="data" :data="data"
:context="context" :context="context"
@formitemvaluechange="onFormItemValueChange"> @formitemvaluechange="onFormItemValueChange">
</ibiz-group-select> </app-group-select>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude> <#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<ibiz-group-select <app-group-select
name="${editor.name}" name="${editor.name}"
:value='data.${editor.name}' :value='data.${editor.name}'
valueitem="${editor.getValueItemName()}" valueitem="${editor.getValueItemName()}"
...@@ -12,4 +12,4 @@ ...@@ -12,4 +12,4 @@
:data="data" :data="data"
:context="context" :context="context"
@formitemvaluechange="onFormItemValueChange"> @formitemvaluechange="onFormItemValueChange">
</ibiz-group-select> </app-group-select>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude> <#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<ibiz-group-select <app-group-select
name="${editor.name}" name="${editor.name}"
:value='data.${editor.name}' :value='data.${editor.name}'
valueitem="${editor.getValueItemName()}" valueitem="${editor.getValueItemName()}"
...@@ -12,4 +12,4 @@ ...@@ -12,4 +12,4 @@
:data="data" :data="data"
:context="context" :context="context"
@formitemvaluechange="onFormItemValueChange"> @formitemvaluechange="onFormItemValueChange">
</ibiz-group-select> </app-group-select>
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
:localContext =<@getNavigateContext editor /> :localContext =<@getNavigateContext editor />
:localParam =<@getNavigateParams editor /> :localParam =<@getNavigateParams editor />
:service="service" :service="service"
valueitem='${editor.getValueItemName()}'
<#if editor.getPSAppDataEntity?? && editor.getPSAppDataEntity()??> <#if editor.getPSAppDataEntity?? && editor.getPSAppDataEntity()??>
deMajorField='${editor.getPSAppDataEntity().getMajorPSAppDEField().getCodeName()?lower_case}' deMajorField='${editor.getPSAppDataEntity().getMajorPSAppDEField().getCodeName()?lower_case}'
deKeyField='${editor.getPSAppDataEntity().getCodeName()?lower_case}' deKeyField='${editor.getPSAppDataEntity().getCodeName()?lower_case}'
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
:localContext =<@getNavigateContext editor /> :localContext =<@getNavigateContext editor />
:localParam =<@getNavigateParams editor /> :localParam =<@getNavigateParams editor />
:service="service" :service="service"
valueitem='${editor.getValueItemName()}'
<#if editor.getPSAppDataEntity?? && editor.getPSAppDataEntity()??> <#if editor.getPSAppDataEntity?? && editor.getPSAppDataEntity()??>
deMajorField='${editor.getPSAppDataEntity().getMajorPSAppDEField().getCodeName()?lower_case}' deMajorField='${editor.getPSAppDataEntity().getMajorPSAppDEField().getCodeName()?lower_case}'
deKeyField='${editor.getPSAppDataEntity().getCodeName()?lower_case}' deKeyField='${editor.getPSAppDataEntity().getCodeName()?lower_case}'
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
:localContext =<@getNavigateContext editor /> :localContext =<@getNavigateContext editor />
:localParam =<@getNavigateParams editor /> :localParam =<@getNavigateParams editor />
:service="service" :service="service"
valueitem='${editor.getValueItemName()}'
<#if editor.getPSAppDataEntity?? && editor.getPSAppDataEntity()??> <#if editor.getPSAppDataEntity?? && editor.getPSAppDataEntity()??>
deMajorField='${editor.getPSAppDataEntity().getMajorPSAppDEField().getCodeName()?lower_case}' deMajorField='${editor.getPSAppDataEntity().getMajorPSAppDEField().getCodeName()?lower_case}'
deKeyField='${editor.getPSAppDataEntity().getCodeName()?lower_case}' deKeyField='${editor.getPSAppDataEntity().getCodeName()?lower_case}'
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
:localContext =<@getNavigateContext editor /> :localContext =<@getNavigateContext editor />
:localParam =<@getNavigateParams editor /> :localParam =<@getNavigateParams editor />
:service="service" :service="service"
valueitem='${editor.getValueItemName()}'
<#if editor.getPSAppDataEntity?? && editor.getPSAppDataEntity()??> <#if editor.getPSAppDataEntity?? && editor.getPSAppDataEntity()??>
deMajorField='${editor.getPSAppDataEntity().getMajorPSAppDEField().getCodeName()?lower_case}' deMajorField='${editor.getPSAppDataEntity().getMajorPSAppDEField().getCodeName()?lower_case}'
deKeyField='${editor.getPSAppDataEntity().getCodeName()?lower_case}' deKeyField='${editor.getPSAppDataEntity().getCodeName()?lower_case}'
......
<input-box v-model="data.${editor.name}" :autoSize="{minRows: 10}" :disabled="detailsModel.${editor.name}.disabled" type='textarea' style="${editor.getEditorCssStyle()}" <#if item.getPlaceHolder()??> placeholder="${item.getPlaceHolder()}"</#if>></input-box> <input-box v-model="data.${editor.name}" :textareaId="this.$util.createUUID()" :disabled="detailsModel.${editor.name}.disabled" type='textarea' textareaStyle="${editor.getEditorCssStyle()}" <#if item.getPlaceHolder()??> placeholder="${item.getPlaceHolder()}"</#if>></input-box>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude> <#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<ibiz-group-select <app-group-select
name="${editor.name}" name="${editor.name}"
:value='data.${editor.name}' :value='data.${editor.name}'
valueitem="${editor.getValueItemName()}" valueitem="${editor.getValueItemName()}"
...@@ -10,4 +10,4 @@ ...@@ -10,4 +10,4 @@
:data="data" :data="data"
:context="context" :context="context"
@formitemvaluechange="onFormItemValueChange"> @formitemvaluechange="onFormItemValueChange">
</ibiz-group-select> </app-group-select>
<span>{{data.${item.getName()?lower_case}}}</span> <#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
\ No newline at end of file <app-span <#t>
:value="data.${editor.name?lower_case}" <#t>
name="${editor.name?lower_case}" <#t>
:data="data" <#t>
:context="context" <#t>
:viewparams="viewparams" <#t>
:localContext =<@getNavigateContext editor /> <#t>
:localParam =<@getNavigateParams editor /> <#t>
<#if item.getPSCodeList?? && item.getPSCodeList()??>
<#assign codelist=item.getPSCodeList()>
tag='${codelist.codeName}' <#t>
codelistType='${codelist.getCodeListType()}' <#t>
</#if>
style="${item.getEditorCssStyle()}"> <#t>
</app-span> <#lt>
<app-span <#t> <span v-html="data.${editor.name}"></span>
name='${editor.name}' <#t> \ No newline at end of file
:value="data.${editor.name}" <#t>
<#if item.getPSCodeList?? && item.getPSCodeList()??>
<#assign codelist=item.getPSCodeList() />
tag='${codelist.codeName}' <#t>
codelistType='${codelist.getCodeListType()}' <#t>
<#if codelist.getOrMode?? && codelist.getOrMode()?has_content>
renderMode="${codelist.getOrMode()}" <#t>
</#if>
<#if codelist.valueSeparator?has_content>
valueSeparator="${codelist.valueSeparator}" <#t>
</#if>
<#if codelist.textSeparator?has_content>
textSeparator="${codelist.textSeparator}" <#t>
</#if>
</#if>
:data="data" <#t>
:context="context" <#t>
:viewparams="viewparams" <#t>
:localContext =<@getNavigateContext editor /> <#t>
:localParam =<@getNavigateParams editor /> <#t>
style="${editor.getEditorCssStyle()}"><#t>
</app-span><#lt>
\ No newline at end of file
<span v-html="row[column.property]"></span>
\ No newline at end of file
...@@ -14,6 +14,15 @@ ...@@ -14,6 +14,15 @@
* @memberof ${srfclassname('${view.name}')} * @memberof ${srfclassname('${view.name}')}
*/ */
public ${item.name}(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) { public ${item.name}(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) {
<#if item.getPSControlContainer().getViewType??>
if(!this.viewDefaultUsage){
if(Object.is(this.navModel,"route")){
this.initNavDataWithRoute(this.viewCacheData, false, true);
}else{
this.initNavDataWithTab(this.viewCacheData, false, true);
}
}
</#if>
<#if viewlogic.getPSAppUILogicRefViews?? && viewlogic.getPSAppUILogicRefViews()??> <#if viewlogic.getPSAppUILogicRefViews?? && viewlogic.getPSAppUILogicRefViews()??>
<#list viewlogic.getPSAppUILogicRefViews() as appUILogicRefView> <#list viewlogic.getPSAppUILogicRefViews() as appUILogicRefView>
<#if appUILogicRefView_index == 0><#assign curOPenLogicRefView = appUILogicRefView /></#if> <#if appUILogicRefView_index == 0><#assign curOPenLogicRefView = appUILogicRefView /></#if>
......
...@@ -33,6 +33,9 @@ import view_${ctrl.getName()} from '@widgets/app/${srffilepath2(ctrl.getCodeName ...@@ -33,6 +33,9 @@ import view_${ctrl.getName()} from '@widgets/app/${srffilepath2(ctrl.getCodeName
}, },
beforeRouteEnter: (to: any, from: any, next: any) => { beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => { next((vm: any) => {
if(!Object.is(vm.navModel,"route")){
vm.initNavDataWithTab(vm.viewCacheData);
}
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag }); vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
}); });
}, },
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
</#if> </#if>
} }
<#if view.getPSControls()??> <#if view.getPSControls()??>
<#list view.getPSControls() as ctrl> <#list view.getPSControls() as ctrl>
<#if ctrl.getControlType()??> <#if ctrl.getControlType()??>
...@@ -147,6 +148,12 @@ ${P.getLogicCode(uiAction, "LOGIC.vue").code} ...@@ -147,6 +148,12 @@ ${P.getLogicCode(uiAction, "LOGIC.vue").code}
} }
}) })
} }
if(Object.is(this.navModel,"tab")){
this.navDataService.removeNavDataByTag(this.viewtag);
}
if (this.serviceStateEvent) {
this.serviceStateEvent.unsubscribe();
}
} }
</#if> </#if>
} }
......
...@@ -146,11 +146,21 @@ ...@@ -146,11 +146,21 @@
newSelections.push(this.viewSelections[index]); newSelections.push(this.viewSelections[index]);
} }
}); });
this.viewSelections = newSelections; this.viewSelections = this.removeDuplicates([...newSelections,...this.viewSelections]);
}); });
this.selectedData = JSON.stringify(this.viewSelections); this.selectedData = JSON.stringify(this.viewSelections);
} }
/**
* 去重
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public removeDuplicates(data:any):Array<any> {
const uniqueSet = new Set(data);
return [...uniqueSet];
}
/** /**
* 选中数据全部删除 * 选中数据全部删除
* *
......
...@@ -12,7 +12,6 @@ import i18n from '@/locale' ...@@ -12,7 +12,6 @@ import i18n from '@/locale'
import 'element-ui/lib/theme-chalk/index.css'; import 'element-ui/lib/theme-chalk/index.css';
import 'view-design/dist/styles/iview.css'; import 'view-design/dist/styles/iview.css';
import 'ibiz-vue-lib/lib/ibiz-vue-lib.css'; import 'ibiz-vue-lib/lib/ibiz-vue-lib.css';
import '@/styles/default.less'; import '@/styles/default.less';
// 模拟数据 // 模拟数据
......
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
<#if ctrl.getPSUIActions?? && ctrl.getPSUIActions()??> <#if ctrl.getPSUIActions?? && ctrl.getPSUIActions()??>
uiactions: { uiactions: {
<#list ctrl.getPSUIActions() as obj> <#list ctrl.getPSUIActions() as obj>
${obj.getUIActionTag()?lower_case}: "<#ibizinclude>../../../@MACRO/CAPTIONLANG.ts</#ibizinclude>", <#if obj.getPSAppDataEntity?? && obj.getPSAppDataEntity()??>${obj.getPSAppDataEntity().getCodeName()?lower_case}_</#if>${obj.getUIActionTag()?lower_case}: "<#ibizinclude>../../../@MACRO/CAPTIONLANG.ts</#ibizinclude>",
</#list> </#list>
}, },
</#if> </#if>
......
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
<#if ctrl.getPSUIActions?? && ctrl.getPSUIActions()??> <#if ctrl.getPSUIActions?? && ctrl.getPSUIActions()??>
uiactions: { uiactions: {
<#list ctrl.getPSUIActions() as obj> <#list ctrl.getPSUIActions() as obj>
${obj.getUIActionTag()?lower_case}: "<#ibizinclude>../../../@MACRO/CAPTIONLANG.ts</#ibizinclude>", <#if obj.getPSAppDataEntity?? && obj.getPSAppDataEntity()??>${obj.getPSAppDataEntity().getCodeName()?lower_case}_</#if>${obj.getUIActionTag()?lower_case}: "<#ibizinclude>../../../@MACRO/CAPTIONLANG.ts</#ibizinclude>",
</#list> </#list>
}, },
</#if> </#if>
......
...@@ -91,33 +91,66 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr ...@@ -91,33 +91,66 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#if singleServiceApi.getRequestParamType() == "NONE"> <#if singleServiceApi.getRequestParamType() == "NONE">
<#-- 无参数情况start --> <#-- 无参数情况start -->
if(${condition}true){ if(${condition}true){
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading); let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
res.data.${item.getCodeName()?lower_case} = data.${item.getCodeName()?lower_case};
<@setStore appEntity=item />
return res;
} }
<#-- 无参数情况end --> <#-- 无参数情况end -->
<#elseif singleServiceApi.getRequestParamType() == "FIELD"> <#elseif singleServiceApi.getRequestParamType() == "FIELD">
<#-- 指定属性情况start --> <#-- 指定属性情况start -->
if(${condition}context.${item.getCodeName()?lower_case}){ if(${condition}context.${item.getCodeName()?lower_case}){
<#-- 指定属性情况start -->
<#-- GET -->
<#if singleServiceApi.getRequestMethod() == "GET">
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
<@setStore appEntity=item />
return res;
<#elseif singleServiceApi.getRequestMethod() == "POST">
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<#else>
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading); return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
</#if>
<#-- 指定属性情况end -->
} }
<#-- 指定属性情况start --> <#-- 指定属性情况start -->
<#elseif singleServiceApi.getRequestParamType() == "ENTITY"> <#elseif singleServiceApi.getRequestParamType() == "ENTITY">
<#-- 提交对象数据情况start --> <#-- 提交对象数据情况start -->
<#if singleAppMethod.getCodeName() == 'Create'> <#if singleAppMethod.getCodeName() == 'Create'>
if(${condition}true){ if(${condition}true){
let masterData:any = {};
<@getStore appEntity=item />
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null; data[this.APPDEKEY] = null;
} }
if(data.srffrontuf){ if(data.srffrontuf){
delete data.srffrontuf; delete data.srffrontuf;
} }
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}`,data,isloading); let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}`,data,isloading);
<#if item.getMajorPSAppDERSs()??>
<#list item.getMajorPSAppDERSs() as deReRs>
<#-- 主实体 -->
<#assign majorPSAppDataEntity = deReRs.getMajorPSAppDataEntity() />
<#-- 从实体 -->
<#assign minorPSAppDataEntity = deReRs.getMinorPSAppDataEntity() />
this.tempStorage.setItem(tempContext.srfsessionkey+'_${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}',JSON.stringify(res.data.${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}));
</#list>
</#if>
return res;
} }
<#else> <#else>
if(${condition}context.${item.getCodeName()?lower_case}){ if(${condition}context.${item.getCodeName()?lower_case}){
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading); let masterData:any = {};
<@getStore appEntity=item />
Object.assign(data,masterData);
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<@setStore appEntity=item />
return res;
} }
</#if> </#if>
<#-- 提交对象数据情况start --> <#-- 提交对象数据情况end -->
<#else> <#else>
<#-- URI参数传递情况start --> <#-- URI参数传递情况start -->
// URI参数传递情况未实现 // URI参数传递情况未实现
...@@ -172,8 +205,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr ...@@ -172,8 +205,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading); return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
<#-- } --> <#-- } -->
</#if> </#if>
<#-- 指定属性情况end -->
<#-- 指定属性情况start -->
<#elseif singleServiceApi.getRequestParamType() == "ENTITY"> <#elseif singleServiceApi.getRequestParamType() == "ENTITY">
<#-- 提交对象数据情况start --> <#-- 提交对象数据情况start -->
<#if singleAppMethod.getCodeName() == 'Update'> <#if singleAppMethod.getCodeName() == 'Update'>
...@@ -221,7 +253,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr ...@@ -221,7 +253,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading); return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<#-- } --> <#-- } -->
</#if> </#if>
<#-- 提交对象数据情况start --> <#-- 提交对象数据情况end -->
<#else> <#else>
<#-- URI参数传递情况start --> <#-- URI参数传递情况start -->
// URI参数传递情况未实现 // URI参数传递情况未实现
......
...@@ -70,9 +70,9 @@ export default class ${srfclassname('${item.getCodeName()}')}UtilServiceBase ext ...@@ -70,9 +70,9 @@ export default class ${srfclassname('${item.getCodeName()}')}UtilServiceBase ext
*/ */
public initBasicParam(){ public initBasicParam(){
<#if item.getModelIdPSAppDEField()??>this.modelIdField = "${item.getModelIdPSAppDEField().getCodeName()?lower_case}";</#if> <#if item.getModelIdPSAppDEField()??>this.modelIdField = "${item.getModelIdPSAppDEField().getCodeName()?lower_case}";</#if>
<#if item.getModelIdPSAppDEField()??>this.modelField = "${item.getModelPSAppDEField().getCodeName()?lower_case}";</#if> <#if item.getModelPSAppDEField()??>this.modelField = "${item.getModelPSAppDEField().getCodeName()?lower_case}";</#if>
<#if item.getModelIdPSAppDEField()??>this.appIdField = "${item.getAppIdPSAppDEField().getCodeName()?lower_case}";</#if> <#if item.getAppIdPSAppDEField()??>this.appIdField = "${item.getAppIdPSAppDEField().getCodeName()?lower_case}";</#if>
<#if item.getModelIdPSAppDEField()??>this.userIdField = "${item.getUserIdPSAppDEField().getCodeName()?lower_case}";</#if> <#if item.getUserIdPSAppDEField()??>this.userIdField = "${item.getUserIdPSAppDEField().getCodeName()?lower_case}";</#if>
<#if item.getStoagePSAppDataEntity()??> <#if item.getStoagePSAppDataEntity()??>
<#assign stoageDataEntity = item.getStoagePSAppDataEntity() /> <#assign stoageDataEntity = item.getStoagePSAppDataEntity() />
this.stoageEntityName ="${stoageDataEntity.getCodeName()?lower_case}"; this.stoageEntityName ="${stoageDataEntity.getCodeName()?lower_case}";
......
<#ibiztemplate>
TARGET=PSAPPVIEWCTRL_STATEWIZARDPANEL
</#ibiztemplate>
${P.getCtrlCode('CONTROL-BASE.vue').code}
\ No newline at end of file
<#ibiztemplate>
TARGET=PSAPPVIEWCTRL_STATEWIZARDPANEL
</#ibiztemplate>
${P.getCtrlCode('MODEL.ts').code}
\ No newline at end of file
<#ibiztemplate>
TARGET=PSAPPVIEWCTRL_STATEWIZARDPANEL
</#ibiztemplate>
${P.getCtrlCode('SERVICE.ts').code}
\ No newline at end of file
<#ibiztemplate>
TARGET=PSAPPVIEWCTRL_STATEWIZARDPANEL
</#ibiztemplate>
${P.getCtrlCode('CONTROL.less').code}
\ No newline at end of file
<#ibiztemplate>
TARGET=PSAPPVIEWCTRL_STATEWIZARDPANEL
</#ibiztemplate>
${P.getCtrlCode('CONTROL.vue').code}
\ No newline at end of file
...@@ -3,7 +3,7 @@ TARGET=PSSYSAPP ...@@ -3,7 +3,7 @@ TARGET=PSSYSAPP
</#ibiztemplate> </#ibiztemplate>
const path = require('path'); const path = require('path');
const os = require('os'); const os = require('os');
<#-- const CompressionPlugin = require("compression-webpack-plugin"); -->
function resolve(dir) { function resolve(dir) {
return path.join(__dirname, dir) return path.join(__dirname, dir)
} }
...@@ -138,5 +138,16 @@ module.exports = { ...@@ -138,5 +138,16 @@ module.exports = {
// 单个进程最大使用内存 // 单个进程最大使用内存
ForkTsCheckerPlugin.memoryLimit = 4096; ForkTsCheckerPlugin.memoryLimit = 4096;
} }
<#-- if(Object.is(config.mode, 'production')){
return{
plugins: [
new CompressionPlugin({
test:/\.js$|\.html$|.\css/, //匹配文件名
threshold: 10240,//对超过10k的数据压缩
deleteOriginalAssets: false //不删除源文件
})
]
}
} -->
}, },
} }
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册