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

Merge branch 'dev'

上级 629eb122
......@@ -5,6 +5,7 @@ import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import AppCenterService from "@service/app/app-center-service";
<#if ctrl.getPSAppCounterRefs?? && ctrl.getPSAppCounterRefs()??>
<#list ctrl.getPSAppCounterRefs() as singleCounterRef>
<#if singleCounterRef.getPSAppCounter()??>
......
......@@ -70,6 +70,8 @@ import ${srfclassname('${_appde.getCodeName()}')}Service from '@/service/${srffi
*/
@Errorlog
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>
<#if deItem.getPSEditor()?? && deItem.getPSEditor().getPSAppDataEntity?? && deItem.getPSEditor().getPSAppDataEntity()?? && deItem.getPSEditor().getPSAppDEDataSet?? && deItem.getPSEditor().getPSAppDEDataSet()??>
<#assign _appde = deItem.getPSEditor().getPSAppDataEntity()/>
......
......@@ -197,6 +197,15 @@
*/
public selections: Array<any> = [];
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appStateEvent: Subscription | undefined;
/**
* Vue声明周期,组件挂载完毕
*
......@@ -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 @@
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
if(this.appStateEvent){
this.appStateEvent.unsubscribe();
}
<#if destroyed_block??>
${destroyed_block}
</#if>
......
......@@ -37,6 +37,9 @@
}
.toolbar-container{
padding: 4px;
display: flex;
flex-wrap: wrap;
align-items: center;
}
}
.list-exp-bar-content {
......
......@@ -61,6 +61,29 @@
../@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>
/**
* 视图唯一标识
*
......
......@@ -3,6 +3,16 @@
<#if view.getViewType() == 'DEDATAVIEWEXPVIEW'>
:viewUID="viewUID"
</#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>
<#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl
......
......@@ -37,6 +37,9 @@
}
.toolbar-container{
padding: 4px;
display: flex;
flex-wrap: wrap;
align-items: center;
}
}
.dataview-exp-bar-content {
......
.app-app-menu {
height: 100%;
width: 100%;
}
\ No newline at end of file
}
<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>
<#assign import_block>
import FilterTree from '@components/filter-tree/filter-tree.vue';
</#assign>
<#assign component_block>
FilterTree,
</#assign>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#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 @@
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getData(): any {
return null;
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;
}
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>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
<#-- content -->
<#assign content>
v-show="isExpandSearchForm"
@search="onSearch($event)"
</#assign>
<#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl
......
.search-bar-footer {
height: 32px;
.search-bar-action {
float: right;
> .ivu-btn {
margin-left: 5px;
}
}
}
<#ibizinclude>
../@MACRO/CSS/DEFAULT.less.ftl
</#ibizinclude>
\ No newline at end of file
</#ibizinclude>
<#assign import_block>
import UtilService from '@/utilservice/util-service';
</#assign>
<#ibizinclude>
../@MACRO/SERVICE/SERVICE_HEADER.ts.ftl
</#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>
../@MACRO/SERVICE/SERVICE_BOTTOM.ts.ftl
</#ibizinclude>
\ No newline at end of file
......@@ -139,6 +139,17 @@
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后的逻辑
*
......
.drtab{
height:100%;
overflow: auto;
.app-dr-tab {
height: 100%;
>.ivu-tabs-bar {
......
......@@ -5,7 +5,7 @@ ${item.render.code}
{
<#if item.getIndex()??>gridIndex:${item.getIndex()},</#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>,
<#if item.getMinValue()??>min:${item.getMinValue()},</#if>
<#if item.getMaxValue()??>max:${item.getMaxValue()},</#if>
......
......@@ -5,7 +5,7 @@ ${item.render.code}
{
<#if item.getIndex()??>gridIndex:${item.getIndex()},</#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>,
<#if item.getMinValue()??>min:${item.getMinValue()},</#if>
<#if item.getMaxValue()??>max:${item.getMaxValue()},</#if>
......
......@@ -5,7 +5,7 @@ ${item.render.code}
{
<#if item.getIndex()??>gridIndex:${item.getIndex()},</#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>,
<#if item.getMinValue()??>min:${item.getMinValue()},</#if>
<#if item.getMaxValue()??>max:${item.getMaxValue()},</#if>
......
......@@ -5,7 +5,7 @@ ${item.render.code}
{
<#if item.getIndex()??>gridIndex:${item.getIndex()},</#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>,
<#if item.getMinValue()??>min:${item.getMinValue()},</#if>
<#if item.getMaxValue()??>max:${item.getMaxValue()},</#if>
......
......@@ -240,6 +240,15 @@
*/
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 属性名
......@@ -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 @@
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
if(this.appStateEvent){
this.appStateEvent.unsubscribe();
}
<#if destroyed_block??>
${destroyed_block}
</#if>
......
......@@ -31,12 +31,15 @@
.search-container {
width: 30%;
height: 48px;
padding: 10px 10px 10px 0;
padding: 10px;
min-width: 200px;
max-width: 400px;
}
.toolbar-container{
padding: 4px;
display: flex;
flex-wrap: wrap;
align-items: center;
}
}
.calendar-exp-bar-content {
......
......@@ -374,9 +374,11 @@ FullCalendar,
let handleEvents = ()=>{
if(_this.isSelectFirstDefault){
// 模拟$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.events[0].className = "select-first-event";
if(_this.events.length > 0){
_this.events[0].className = "select-first-event";
}
_this.calendarClass = "calendar select-first-calendar";
}
let filterEvents = this.events.filter((event:any)=>{
......@@ -624,6 +626,15 @@ FullCalendar,
*/
public selections: any[] = [];
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appStateEvent: Subscription | undefined;
/**
* 获取多项数据
*
......@@ -672,6 +683,16 @@ 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();
}
})
}
}
......@@ -715,6 +736,9 @@ FullCalendar,
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
if(this.appStateEvent){
this.appStateEvent.unsubscribe();
}
<#if destroyed_block??>
${destroyed_block}
</#if>
......
......@@ -240,6 +240,15 @@
@Provide()
public expandedKeys: string[] = [];
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appStateEvent: Subscription | undefined;
/**
* 选中数据变更事件
*
......@@ -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 @@
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
if(this.appStateEvent){
this.appStateEvent.unsubscribe();
}
<#if destroyed_block??>
${destroyed_block}
</#if>
......
......@@ -6,7 +6,15 @@
<div slot='left'>
<#if ctrl.isShowTitleBar()>
<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>
</#if>
<#if ctrl.isEnableSearch()>
......@@ -46,6 +54,29 @@
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.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>
/**
* 视图唯一标识
*
......@@ -369,6 +400,15 @@
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>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
......@@ -2,6 +2,16 @@
<#if view.getViewType() == 'DETREEEXPVIEW'>
:viewUID="viewUID"
</#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>
<#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl
......
......@@ -22,11 +22,22 @@
font-weight: 600;
color: black;
padding-left: 8px;
flex-shrink: 0;
i {
font-size: 20px;
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 {
width: 100%;
......
<#-- 获取该步骤的表单 -->
<#macro getStepForm ctrlmodel step>
<#compress>
<#if ctrlmodel.getPSDEEditForms()??>
<#list ctrlmodel.getPSDEEditForms() as form>
<#if form.getPSDEWizardForm()??><#assign wizardForm = form.getPSDEWizardForm() />
<#if wizardForm.getPSDEWizardStep()??><#assign wizardStep = wizardForm.getPSDEWizardStep() />
<#if wizardStep.getId() == step.getId()>${form.getName()}</#if>
</#if>
</#if>
</#list>
</#if>
</#compress>
</#macro>
<template>
<layout class="app-wizard">
<#if ctrl.getPSDEWizard?? && ctrl.getPSDEWizard()?? && ctrl.getPSDEWizard().getPSDEWizardSteps?? && ctrl.getPSDEWizard().getPSDEWizardSteps()??>
<div class="view-steps">
<div class="background-box"></div>
<div class="steps_icon" @click="handleClick('PRE')"><i class="el-icon-arrow-left"></i></div>
<el-steps class="wizard-steps" :active="(wizardForms.indexOf(activeForm) + 1)" finish-status="success">
<#list ctrl.getPSDEWizard().getPSDEWizardSteps() as step>
<el-step :class="{'app-active-step':activeForm==='<@getStepForm ctrlmodel=ctrl step=step />'?true:false}">
<template v-slot:title>
<div v-popover:<@getStepForm ctrlmodel=ctrl step=step />_popover @click="hanleClick('<@getStepForm ctrlmodel=ctrl step=step />')">
<span><i v-if="activeForm != '<@getStepForm ctrlmodel=ctrl step=step />' && !historyForms.includes('<@getStepForm ctrlmodel=ctrl step=step />')" class="el-icon-lock"></i>${step.getTitle()}</span>
</div>
</template>
</el-step>
</#list>
</el-steps>
<div class="steps_icon" @click="handleClick('NEXT')"><i class="el-icon-arrow-right"></i></div>
</div>
<#if ctrl.getPSDEEditForms()??>
<#list ctrl.getPSDEEditForms() as form>
<#assign handler = form.getPSAjaxControlHandler() />
<el-popover v-model="stepVisiable['${form.getName()}']" ref="${form.getName()}_popover" popper-class="app-wizard-popover-container" placement="bottom-<#if form_has_next>start<#else>end</#if>" trigger="click">
<div class="app-wizard-container">
<div class="app-wizard-header">
<div class="app-wizard-header-extra">
<Icon type="md-open" size="18" @click="handleOPen('${form.getName()}')"/>
<Icon type="md-close" size="18" @click="handleClose('${form.getName()}')"/>
</div>
</div>
<div class="popover-title">${form.getLogicName()}</div>
<div class="app-wizard-content">
<view_${form.getName()}
:key="'${form.name}'"
:viewState='wizardState'
:context="context"
:viewparams="viewparams"
updateAction="<#if form.getUpdatePSControlAction()?? && form.getUpdatePSControlAction().getPSAppDEMethod()??>${form.getUpdatePSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
removeAction="<#if form.getRemovePSControlAction()?? && form.getRemovePSControlAction().getPSAppDEMethod()??>${form.getRemovePSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
loadAction="<#if form.getGetPSControlAction()?? && form.getGetPSControlAction().getPSAppDEMethod()??>${form.getGetPSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
<#if form.getHookEventNames()??>
<#list form.getHookEventNames() as eventName>
@${eventName?lower_case}="${form.name}_${eventName?lower_case}"
</#list>
</#if>
name='${form.name}'
ref='${form.name}'>
</view_${form.getName()}>
</div>
<div class="app-wizard-footer">
<i-button v-if="isVisiable('${form.name}','PREV')" @click="onClickPrev('${form.name}')" ><Icon type="ios-arrow-back"></Icon></i-button>
<i-button v-if="isVisiable('${form.name}','NEXT')" @click="onClickNext('${form.name}')" type="primary" long>下一步</i-button>
<i-button v-if="isVisiable('${form.name}','FINISH')" @click="onClickFinish('${form.name}')" type="primary" long>完成</i-button>
</div>
</div>
</el-popover>
<drawer class="app-wizard-drawer" :closable="false" :value="drawerOpenStatus.isOpen && drawerOpenStatus.formName == '${form.name}'"
:width="600" title="${form.getLogicName()}" @on-visible-change="onVisibleChange($event)">
<view_${form.getName()}
:key="'${form.name}'"
:viewState='wizardState'
:context="context"
:viewparams="viewparams"
updateAction="<#if form.getUpdatePSControlAction()?? && form.getUpdatePSControlAction().getPSAppDEMethod()??>${form.getUpdatePSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
removeAction="<#if form.getRemovePSControlAction()?? && form.getRemovePSControlAction().getPSAppDEMethod()??>${form.getRemovePSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
loadAction="<#if form.getGetPSControlAction()?? && form.getGetPSControlAction().getPSAppDEMethod()??>${form.getGetPSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
<#if form.getHookEventNames()??>
<#list form.getHookEventNames() as eventName>
@${eventName?lower_case}="${form.name}_${eventName?lower_case}"
</#list>
</#if>
name='${form.name}'
ref='${form.name}'>
</view_${form.getName()}>
</drawer>
</#list>
</#if>
</#if>
</layout>
</template>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
/**
* 部件行为--init
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public initAction!: string;
/**
* 部件行为--finish
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public finishAction!: string;
/**
* 显示处理提示
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop({ default: true }) public showBusyIndicator?: boolean;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getDatas(): any[] {
return [this.formParam];
}
/**
* 获取单项数据
*
* @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getData(): any {
return this.formParam;
}
/**
* 视图状态订阅对象
*
* @public
* @type {Subject<{action: string, data: any}>}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public wizardState: Subject<ViewState> = new Subject();
/**
* 当前激活表单
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public activeForm: string = '';
/**
* 第一个向导表单
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public firstForm: string = '<#if ctrl.getPSDEWizard()?? && ctrl.getPSDEWizard().getFirstPSDEWizardForm()??><#assign firstForm = ctrl.getPSDEWizard().getFirstPSDEWizardForm()>${ctrl.name}_form_${firstForm.getFormTag()}</#if>';
/**
* 状态属性
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public stateField: string = '${ctrl.getStatePSAppDEField().getCodeName()?lower_case}';
/**
* 当前显示表单
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public curShow:string ="";
/**
* 向导表单参数
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public formParam: any = {};
/**
* 执行过的表单
*
* @public
* @type {Array<string>}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public historyForms: Array<string> = [];
/**
* 步骤行为集合
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public stepActions: any = {};
/**
* 步骤标识集合
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public stepTags: any = {};
/**
* 步骤是否显示集合
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public stepVisiable:any = {};
/**
* 向导表单集合
*
* @type {Array<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public wizardForms: Array<any> = [];
/**
* 当前状态
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public curState = '';
/**
* 抽屉状态
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public drawerOpenStatus:any = {
isOpen:false,
formName:""
}
/**
* Vue声明周期(处理组件的输入属性)
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public created(): void {
this.regFormActions();
this.doInit();
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (Object.is(tag, this.name)) {
if (Object.is('load', action)) {
this.doInit(data);
}
}
});
}
}
/**
* vue 生命周期
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public destroyed() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
<#if destroyed_block??>
${destroyed_block}
</#if>
}
/**
* 注册表单步骤行为
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public regFormActions() {
<#if ctrl.getPSDEWizard()?? && ctrl.getPSDEWizard().getPSDEWizardForms()??>
<#list ctrl.getPSDEWizard().getPSDEWizardForms() as form>
this.regFormAction('${ctrl.name}_form_${form.getFormTag()}', [<#if form.getStepActions()??><#list form.getStepActions() as action><#if action_index gt 0>,</#if>'${action}'</#list></#if>],<#if form.getPSDEWizardStep()?? && form.getPSDEWizardStep().getStepTag()??>'${form.getPSDEWizardStep().getStepTag()}'<#else>null</#if>);
</#list>
</#if>
}
/**
* 注册表单步骤行为
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public regFormAction(name: string, actions: Array<string>,stepTag:any) {
this.stepActions[name] = actions;
this.stepTags[name] = stepTag;
this.stepVisiable[name] = false;
this.wizardForms.push(name);
}
/**
* 计算激活表单
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public computedActiveForm(data:any){
if(data[this.stateField]){
if(Object.keys(this.stepTags).length >0){
Object.keys(this.stepTags).forEach((name:string) =>{
if(this.stepTags[name] === data[this.stateField]){
this.activeForm = name;
}
})
}
if(!this.activeForm){
this.activeForm = this.firstForm;
}
}else{
this.activeForm = this.firstForm;
}
if(this.activeForm) {
let index = this.wizardForms.indexOf(this.activeForm);
this.wizardForms.forEach((item:any,inx:number) =>{
if(inx <= index){
this.historyForms.push(item);
}
})
}
}
/**
* 初始化行为
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public doInit(opt: any = {}) {
<#if ctrl.getPSDEWizard()?? && ctrl.getPSDEWizard().getInitPSDEAction()??>
<#assign action = ctrl.getPSDEWizard().getInitPSDEAction()>
const arg: any = { ...opt };
Object.assign(arg,{viewparams:this.viewparams});
const post: Promise<any> = this.service.init(this.initAction, JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (response && response.status === 200) {
this.formParam = response.data;
if(response.data.${ctrl.getPSAppDataEntity().getCodeName()?lower_case}){
Object.assign(this.context,{${ctrl.getPSAppDataEntity().getCodeName()?lower_case}:response.data.${ctrl.getPSAppDataEntity().getCodeName()?lower_case}})
}
this.computedActiveForm(response.data);
}
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.info });
});
</#if>
}
/**
* 表单加载
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public formLoad(name:string) {
if(name) {
this.wizardState.next({ tag: name, action: 'load', data: this.formParam });
}
}
/**
* 完成行为
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public doFinish() {
<#if ctrl.getPSDEWizard()?? && ctrl.getPSDEWizard().getFinishPSDEAction()??>
<#assign action = ctrl.getPSDEWizard().getFinishPSDEAction()>
let arg: any = {};
Object.assign(arg, this.formParam);
Object.assign(arg,{viewparams:this.viewparams});
const post: Promise<any> = this.service.finish(this.finishAction, JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
this.$emit("finish", data);
}
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.info });
});
</#if>
}
/**
* 向导表单加载完成
*
* @param {*} args
* @param {string} name
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ${ctrl.name}_formload(args: any, name: string, $event2?: any) {
if(args) {
Object.assign(this.formParam, args);
}
}
/**
* 向导表单保存完成
*
* @param {*} args
* @param {string} name
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ${ctrl.name}_formsave(args: any, name: string, $event2?: any) {
Object.assign(this.formParam, args);
if(Object.is(this.curState, 'NEXT')) {
if(this.historyForms.indexOf(name) === -1){
this.historyForms.push(name);
}
this.setPopVisiable(name,false);
if (this.getNextForm(name)) {
this.activeForm = this.getNextForm(name);
this.setPopVisiable(this.activeForm,true);
setTimeout(() => {
this.formLoad(this.activeForm);
}, 1);
} else {
this.doFinish();
}
}else if(Object.is(this.curState, 'FINISH')) {
this.doFinish();
}
}
/**
* 打开链接
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public handleOPen(name:string){
this.handleClose(name);
this.drawerOpenStatus.isOpen = true;
this.drawerOpenStatus.formName = name;
}
/**
* 关闭
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public handleClose(name:string){
this.setPopVisiable(name,false);
}
/**
* 设置popover是否显示
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public setPopVisiable(name:string,isVisiable:boolean){
this.stepVisiable[name] = isVisiable;
(this.$refs[name+'_popover'] as any).showPopper = isVisiable;
this.curShow = isVisiable?name:"";
}
/**
* 导航条点击事件
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public hanleClick(name:string){
let activeIndex:number = this.wizardForms.indexOf(this.activeForm);
let curIndex:number = this.wizardForms.indexOf(name);
if(curIndex > activeIndex){
setTimeout(() =>{
(this.$refs[name+'_popover'] as any).showPopper = false;
this.curShow = "";
},0)
return;
}
this.stepVisiable[name] = !this.stepVisiable[name];
if(this.stepVisiable[name]){
this.curShow = name;
this.formLoad(name);
}else{
this.curShow = "";
}
}
/**
* 获取下一步向导表单
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getNextForm(name:string) {
let index = this.wizardForms.indexOf(name);
if(index >= 0) {
if(this.wizardForms[index + 1]) {
return this.wizardForms[index + 1];
}
}
return undefined;
}
/**
* 上一步
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onClickPrev(name:string) {
const length = this.historyForms.length;
if(length > 1) {
this.curState = 'PREV';
let curIndex:number = this.wizardForms.indexOf(name);
this.setPopVisiable(name,false);
setTimeout(() => {
this.setPopVisiable(this.historyForms[curIndex - 1],true);
this.formLoad(this.historyForms[curIndex - 1]);
}, 1);
}
}
/**
* 下一步
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onClickNext(name:string) {
if(name) {
if(this.$refs && this.$refs[name]){
let form: any = this.$refs[name];
if(form.formValidateStatus()) {
this.curState = 'NEXT';
this.wizardState.next({ tag: name, action: 'save', data: this.formParam });
} else {
this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
}
}
}
}
/**
* 完成
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onClickFinish(name:string) {
if(name) {
if(this.$refs && this.$refs[name]){
let form: any = this.$refs[name];
if(form.formValidateStatus()) {
this.curState = 'FINISH';
this.wizardState.next({ tag: name, action: 'save', data: this.formParam });
} else {
this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
}
}
}
}
/**
* 左右两侧点击事件
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public handleClick(mode:string){
if(Object.is(this.curShow,"")){
return;
}
let curIndex:number = this.wizardForms.indexOf(this.curShow);
if(Object.is(mode,"PRE") && (curIndex !== 0)){
this.setPopVisiable(this.wizardForms[curIndex],false);
setTimeout(() => {
this.setPopVisiable(this.wizardForms[curIndex-1],true);
this.formLoad(this.wizardForms[curIndex-1]);
}, 0);
}
if(Object.is(mode,"NEXT") && (curIndex < (this.wizardForms.length - 1) && this.historyForms.includes(this.wizardForms[curIndex+1]))){
this.setPopVisiable(this.wizardForms[curIndex],false);
setTimeout(() => {
this.setPopVisiable(this.wizardForms[curIndex+1],true);
this.formLoad(this.wizardForms[curIndex+1]);
}, 0);
}
}
/**
* 是否显示
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public isVisiable(name:string,type: string) {
const actions: Array<string> = this.stepActions[name];
if(actions && actions.indexOf(type) !== -1 && Object.is(name,this.activeForm)) {
return true;
}else{
return false;
}
}
/**
* 抽屉状态改变
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onVisibleChange(value:any){
if(!value){
this.drawerOpenStatus.isOpen = false;
}
}
<#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}"
<#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,
*/
public tasks: any[] = [];
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appStateEvent: Subscription | undefined;
/**
* 监听语言变化
*
......@@ -345,6 +354,16 @@ GanttElastic,
public created() {
this.locale = this.$i18n.locale;
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,
}
}
/**
* 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>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
......@@ -4,7 +4,7 @@
<#if item.render??>
${item.render.code}
<#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>
<#list item.getPSDEFormDetails() as formmenber>
<#if !(formmenber.isHidden?? && formmenber.isHidden())>
......
<#ibizinclude>
../@MACRO/CONTROL/LANGBASE.vue.ftl
</#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'>
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> })
......@@ -14,7 +14,7 @@ new FormPageModel({ ${detail} })
<#elseif item.getDetailType() == 'FORMPART'>
new FormPartModel({ ${detail} })
<#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'>
new FormIFrameModel({ ${detail} })
<#elseif item.getDetailType() == 'RAWITEM'>
......
......@@ -13,6 +13,15 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#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';
</#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';
this.onFormLoad(data,'autoSave');
this.$emit('save', data);
<#if ctrl.getControlType() == 'FORM'>
this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data});
</#if>
this.$nextTick(() => {
this.formState.next({ type: 'save', data: data });
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
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 });
}
return;
}
if (!response || !response.status || !response.data) {
......@@ -1045,7 +1083,7 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
this.onFormLoad(data,'save');
this.$emit('save', data);
<#if ctrl.getControlType() == 'FORM'>
this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data});
</#if>
this.$nextTick(() => {
this.formState.next({ type: 'save', data: data });
......@@ -1058,8 +1096,19 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
resolve(response);
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
reject(response);
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 });
reject(response);
}
return;
}
if (!response || !response.status || !response.data) {
......@@ -1095,6 +1144,9 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
this.formState.next({ type: 'remove', data: data });
this.data.ismodify = false;
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);
}
}).catch((error: any) => {
......@@ -1116,10 +1168,6 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
*/
public async wfstart(data: any,localdata?:any): Promise<any> {
return new Promise((resolve: any, reject: any) => {
<#-- if(!this.WFStartAction){
this.$Notice.error({ title: '错误', desc: 'WFCIDEditView视图表单WFStartAction参数未配置' });
return;
} -->
const _this: any = this;
const post: Promise<any> = _this.save({},false);
post.then((response:any) =>{
......@@ -1176,10 +1224,6 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
*/
public async wfsubmit(data: any,localdata?:any): Promise<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 arg: any = data[0];
Object.assign(arg,{viewparams:this.viewparams});
......@@ -1192,6 +1236,9 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
// 保存完成UI处理
this.onFormLoad(arg,'save');
this.$emit('save', arg);
<#if ctrl.getControlType() == 'FORM'>
AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data});
</#if>
this.$nextTick(() => {
this.formState.next({ type: 'save', data: arg });
});
......@@ -1279,6 +1326,9 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
this.fillForm(_data,'updateFormItem');
this.formLogic({ name: '', newVal: null, oldVal: null });
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.formState.next({ type: 'updateformitem', ufimode: arg.srfufimode, data: _data });
});
......
......@@ -116,6 +116,15 @@ import { FormItemModel } from '@/model/form-detail';
*/
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';
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public allColumns: any[] = [
<#if ctrl.getAllPSDEGridColumns()??>
<#list ctrl.getAllPSDEGridColumns() as column>
<#if ctrl.getAllPSDEGridColumns()??>
<#list ctrl.getAllPSDEGridColumns() as column>
{
name: '${column.getName()?lower_case}',
label: '${column.getCaption()}',
langtag: '<#if langbase??>${langbase}.columns.${column.getName()?lower_case}</#if>',
show: <#if column.isHideDefault()>false<#else>true</#if>,
util: '${column.getWidthUnit()}'
util: '${column.getWidthUnit()}',
<#-- BEGIN:是否支持行编辑 -->
<#if ctrl.isEnableRowEdit() && column.isEnableRowEdit()>
isEnableRowEdit: true,
<#else>
isEnableRowEdit: false,
</#if>
<#-- END:是否支持行编辑 -->
},
</#list>
</#if>
</#list>
</#if>
]
/**
......@@ -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';
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
if(this.appStateEvent){
this.appStateEvent.unsubscribe();
}
<#if destroyed_block??>
${destroyed_block}
</#if>
......@@ -1735,16 +1764,17 @@ import { FormItemModel } from '@/model/form-detail';
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getCellClassName(args:{row: any, column: any, rowIndex: number, columnIndex:number}){
let hasRowEdit:any = {
<#list ctrl.getPSDEGridColumns() as column>
<#if ctrl.isEnableRowEdit() && column.isEnableRowEdit()>
'${column.getName()?lower_case}':true,
<#else>
'${column.getName()?lower_case}':false,
</#if>
</#list>
if(args.column.property){
let col = this.allColumns.find((item:any)=>{
return Object.is(args.column.property,item.name);
})
if(col !== undefined){
if(col.isEnableRowEdit && this.actualIsOpenEdit ){
return 'edit-cell';
}
}
}
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
*/
@Errorlog
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>
<#if deItem.getPSEditor()?? && deItem.getPSEditor().getPSAppDataEntity?? && deItem.getPSEditor().getPSAppDataEntity()?? && deItem.getPSEditor().getPSAppDEDataSet?? && deItem.getPSEditor().getPSAppDEDataSet()??>
<#assign _appde = deItem.getPSEditor().getPSAppDataEntity()/>
......
......@@ -37,6 +37,9 @@
}
.toolbar-container{
padding: 4px;
display: flex;
flex-wrap: wrap;
align-items: center;
}
}
.grid-exp-bar-content {
......
......@@ -3,6 +3,9 @@
<#if view.hasPSControl('wizardpanel')>
${P.getCtrlCode('wizardpanel', 'CONTROL.html').code}
</#if>
<#if view.hasPSControl('statewizardpanel')>
${P.getCtrlCode('statewizardpanel', 'CONTROL.html').code}
</#if>
</@ibizindent>
</#assign>
<#ibizinclude>
......
<app-layout viewName="${view.getCodeName()?lower_case}" viewTitle="${view.getTitle()}" className={{ index_view: true }}>
<template slot="headerLeft">
<div class="app-header-left">
<span class="ibiz-menu-icon" onClick={()=>{this.contextMenuDragVisiable=!this.contextMenuDragVisiable}}><i class="ivu-icon ivu-icon-md-menu"></i></span>
{this.isEnableAppSwitch?<span class="ibiz-menu-icon" onClick={()=>{this.contextMenuDragVisiable=!this.contextMenuDragVisiable}}><i class="ivu-icon ivu-icon-md-menu"></i></span>:<span></span>}
<img class="logo" src="./assets/img/logo.png" />
<div class="app-name">{this.$t(this.model.srfCaption)}</div>
</div>
......@@ -15,7 +15,7 @@
<div class="crm-app-content">
<div class="inedx-app-menus">
${P.getCtrlCode('appmenu', 'CONTROL.html').code}
<context-menu-drag contextMenuDragVisiable={this.contextMenuDragVisiable}></context-menu-drag>
{this.isEnableAppSwitch?<context-menu-drag contextMenuDragVisiable={this.contextMenuDragVisiable}></context-menu-drag>:<div></div>}
</div>
<div class="content" style="width: calc(100% - 240px)" on-click={() =>{this.contextMenuDragVisiable=false}}>
<router-view></router-view>
......
......@@ -29,16 +29,6 @@ import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.code
../@MACRO/FUNC/MACRO.ftl
</#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';
*/
@Prop() public width?: number;
/**
* 视图默认使用
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
<#if ctrl.getPortletType() == 'ACTIONBAR'>
/**
* 操作栏模型数据
......@@ -194,6 +203,7 @@ import { Environment } from '@/environments/environment';
<#if viewUIAction.getPSUIAction?? && viewUIAction.getPSUIAction()??>
<#assign uiaction = viewUIAction.getPSUIAction() />
actionName:"${uiaction.getCaption()}",
icon:"<#if uiaction.getIconCls?? && uiaction.getIconCls()??>${uiaction.getIconCls()}</#if>",
<#if uiaction.getPSAppCounter?? && uiaction.getPSAppCounter()??>
<#assign counter = uiaction.getPSAppCounter() />
counterService:this.${srfclassname('${counter.getCodeName()}')}counterservice,
......
<#assign selfContent>
<#if !item.isHidden()>
<#if !item.isHidden()>
<#assign selfContent>
<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>
<div class="item-field-content">
${P.getEditorCode(item, "PANELEDITOR.vue").code}
</div>
</div>
</#if>
</#assign>
</#assign>
<#ibizinclude>
./@MACRO/PLAYOUT.vue.ftl
</#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>">
${content}
</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>">
${content}
</i-col>
</#if>
</#if>
\ No newline at end of file
......@@ -260,6 +260,7 @@ import CodeListService from "@service/app/codelist-service";
this.$emit('panelDataChange',{[modelitem.prop]: value});
}
}
}
<#ibizinclude>
......
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<ibiz-group-select
<app-group-select
name="${editor.name}"
:value='data.${editor.name}'
valueitem="${editor.getValueItemName()}"
......@@ -12,4 +12,4 @@
:data="data"
:context="context"
@formitemvaluechange="onFormItemValueChange">
</ibiz-group-select>
</app-group-select>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<ibiz-group-select
<app-group-select
name="${editor.name}"
:value='data.${editor.name}'
valueitem="${editor.getValueItemName()}"
......@@ -12,4 +12,4 @@
:data="data"
:context="context"
@formitemvaluechange="onFormItemValueChange">
</ibiz-group-select>
</app-group-select>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<ibiz-group-select
<app-group-select
name="${editor.name}"
:value='data.${editor.name}'
valueitem="${editor.getValueItemName()}"
......@@ -12,4 +12,4 @@
:data="data"
:context="context"
@formitemvaluechange="onFormItemValueChange">
</ibiz-group-select>
</app-group-select>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<ibiz-group-select
<app-group-select
name="${editor.name}"
:value='data.${editor.name}'
valueitem="${editor.getValueItemName()}"
......@@ -12,4 +12,4 @@
:data="data"
:context="context"
@formitemvaluechange="onFormItemValueChange">
</ibiz-group-select>
</app-group-select>
......@@ -10,6 +10,7 @@
:localContext =<@getNavigateContext editor />
:localParam =<@getNavigateParams editor />
:service="service"
valueitem='${editor.getValueItemName()}'
<#if editor.getPSAppDataEntity?? && editor.getPSAppDataEntity()??>
deMajorField='${editor.getPSAppDataEntity().getMajorPSAppDEField().getCodeName()?lower_case}'
deKeyField='${editor.getPSAppDataEntity().getCodeName()?lower_case}'
......
......@@ -10,6 +10,7 @@
:localContext =<@getNavigateContext editor />
:localParam =<@getNavigateParams editor />
:service="service"
valueitem='${editor.getValueItemName()}'
<#if editor.getPSAppDataEntity?? && editor.getPSAppDataEntity()??>
deMajorField='${editor.getPSAppDataEntity().getMajorPSAppDEField().getCodeName()?lower_case}'
deKeyField='${editor.getPSAppDataEntity().getCodeName()?lower_case}'
......
......@@ -10,6 +10,7 @@
:localContext =<@getNavigateContext editor />
:localParam =<@getNavigateParams editor />
:service="service"
valueitem='${editor.getValueItemName()}'
<#if editor.getPSAppDataEntity?? && editor.getPSAppDataEntity()??>
deMajorField='${editor.getPSAppDataEntity().getMajorPSAppDEField().getCodeName()?lower_case}'
deKeyField='${editor.getPSAppDataEntity().getCodeName()?lower_case}'
......
......@@ -10,6 +10,7 @@
:localContext =<@getNavigateContext editor />
:localParam =<@getNavigateParams editor />
:service="service"
valueitem='${editor.getValueItemName()}'
<#if editor.getPSAppDataEntity?? && editor.getPSAppDataEntity()??>
deMajorField='${editor.getPSAppDataEntity().getMajorPSAppDEField().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>
<app-switch :isShowText="true" name='${editor.name}' :value="this.data.${editor.name}" @change="($event)=>{this.data.${editor.name} = $event} " :disabled="detailsModel.${editor.name}.disabled" style="${editor.getEditorCssStyle()}"></app-switch>
\ No newline at end of file
<app-switch name='${editor.name}' :isShowText="true" :value="row[column.property]" @change="($event)=>{row[column.property] = $event;gridEditItemChange(row, column.property, $event, $index)} " :disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1" style="${item.getEditorCssStyle()}"></app-switch>
\ No newline at end of file
<app-switch
name='${editor.name?lower_case}'
:value="data.${editor.name?lower_case}"
@change="($event)=>{data.${editor.name?lower_case} = $event;panelEditItemChange(data, '${editor.name?lower_case}', $event)} "
<#if item.getEnableCond??>
:disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1"
</#if>
:isShowText="true"
style="${item.getEditorCssStyle()}">
</app-switch>
EDITORTYPE=SWITCH#CONTENT
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<ibiz-group-select
<app-group-select
name="${editor.name}"
:value='data.${editor.name}'
valueitem="${editor.getValueItemName()}"
......@@ -10,4 +10,4 @@
:data="data"
:context="context"
@formitemvaluechange="onFormItemValueChange">
</ibiz-group-select>
</app-group-select>
<span>{{data.${item.getName()?lower_case}}}</span>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<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>
name='${editor.name}' <#t>
: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="data.${editor.name}"></span>
\ No newline at end of file
<span v-html="row[column.property]"></span>
\ No newline at end of file
......@@ -33,6 +33,9 @@ import view_${ctrl.getName()} from '@widgets/app/${srffilepath2(ctrl.getCodeName
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
if(!Object.is(vm.navModel,"route")){
vm.initNavDataWithTab(vm.viewCacheData);
}
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
});
},
......
......@@ -70,6 +70,7 @@
</#if>
}
<#if view.getPSControls()??>
<#list view.getPSControls() as ctrl>
<#if ctrl.getControlType()??>
......@@ -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>
}
......
......@@ -146,11 +146,21 @@
newSelections.push(this.viewSelections[index]);
}
});
this.viewSelections = newSelections;
this.viewSelections = this.removeDuplicates([...newSelections,...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'
import 'element-ui/lib/theme-chalk/index.css';
import 'view-design/dist/styles/iview.css';
import 'ibiz-vue-lib/lib/ibiz-vue-lib.css';
import '@/styles/default.less';
// 模拟数据
......
......@@ -42,6 +42,14 @@ export default class ${srfclassname('${view.name}')}Base extends IndexViewBase {
*/
public contextMenuDragVisiable: boolean = false;
/**
* 是否支持应用切换
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}Base
*/
public isEnableAppSwitch: boolean = <#if view.isEnableAppSwitch?? && view.isEnableAppSwitch()??>${view.isEnableAppSwitch()?c}<#else>false</#if>;
/**
* 容器模型
*
......
......@@ -82,7 +82,7 @@ export default {
<#if ctrl.getPSUIActions?? && ctrl.getPSUIActions()??>
uiactions: {
<#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>
},
</#if>
......
......@@ -81,7 +81,7 @@ export default {
<#if ctrl.getPSUIActions?? && ctrl.getPSUIActions()??>
uiactions: {
<#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>
},
</#if>
......
......@@ -91,33 +91,66 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#if singleServiceApi.getRequestParamType() == "NONE">
<#-- 无参数情况start -->
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 -->
<#elseif singleServiceApi.getRequestParamType() == "FIELD">
<#-- 指定属性情况start -->
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);
</#if>
<#-- 指定属性情况end -->
}
<#-- 指定属性情况start -->
<#elseif singleServiceApi.getRequestParamType() == "ENTITY">
<#-- 提交对象数据情况start -->
<#if singleAppMethod.getCodeName() == 'Create'>
if(${condition}true){
let masterData:any = {};
<@getStore appEntity=item />
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(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>
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>
<#-- 提交对象数据情况start -->
<#-- 提交对象数据情况end -->
<#else>
<#-- URI参数传递情况start -->
// URI参数传递情况未实现
......@@ -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);
<#-- } -->
</#if>
<#-- 指定属性情况start -->
<#-- 指定属性情况end -->
<#elseif singleServiceApi.getRequestParamType() == "ENTITY">
<#-- 提交对象数据情况start -->
<#if singleAppMethod.getCodeName() == 'Update'>
......@@ -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);
<#-- } -->
</#if>
<#-- 提交对象数据情况start -->
<#-- 提交对象数据情况end -->
<#else>
<#-- URI参数传递情况start -->
// URI参数传递情况未实现
......
......@@ -70,9 +70,9 @@ export default class ${srfclassname('${item.getCodeName()}')}UtilServiceBase ext
*/
public initBasicParam(){
<#if item.getModelIdPSAppDEField()??>this.modelIdField = "${item.getModelIdPSAppDEField().getCodeName()?lower_case}";</#if>
<#if item.getModelIdPSAppDEField()??>this.modelField = "${item.getModelPSAppDEField().getCodeName()?lower_case}";</#if>
<#if item.getModelIdPSAppDEField()??>this.appIdField = "${item.getAppIdPSAppDEField().getCodeName()?lower_case}";</#if>
<#if item.getModelIdPSAppDEField()??>this.userIdField = "${item.getUserIdPSAppDEField().getCodeName()?lower_case}";</#if>
<#if item.getModelPSAppDEField()??>this.modelField = "${item.getModelPSAppDEField().getCodeName()?lower_case}";</#if>
<#if item.getAppIdPSAppDEField()??>this.appIdField = "${item.getAppIdPSAppDEField().getCodeName()?lower_case}";</#if>
<#if item.getUserIdPSAppDEField()??>this.userIdField = "${item.getUserIdPSAppDEField().getCodeName()?lower_case}";</#if>
<#if item.getStoagePSAppDataEntity()??>
<#assign stoageDataEntity = item.getStoagePSAppDataEntity() />
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
</#ibiztemplate>
const path = require('path');
const os = require('os');
<#-- const CompressionPlugin = require("compression-webpack-plugin"); -->
function resolve(dir) {
return path.join(__dirname, dir)
}
......@@ -138,5 +138,16 @@ module.exports = {
// 单个进程最大使用内存
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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册