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

Merge branch 'dev'

上级 98d3c4a5
......@@ -3,7 +3,7 @@ import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-pr
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util } from '@/utils';
import { UIActionTool,Util,ViewTool } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import AppCenterService from "@service/app/app-center-service";
<#if ctrl.getPSAppCounterRefs?? && ctrl.getPSAppCounterRefs()??>
......@@ -18,17 +18,20 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
import ${srfclassname('${appde.getCodeName()}')}Service from '@/service/${srffilepath2(appde.getCodeName())}/${srffilepath2(appde.getCodeName())}-service';
</#if>
import ${srfclassname('${ctrl.codeName}')}Service from './${srffilepath2(ctrl.codeName)}-${ctrl.getControlType()?lower_case}-service';
<#if ctrl.getPSUIActions?? && ctrl.getPSUIActions()??>
<#list ctrl.getPSUIActions() as uiAction>
<#if uiAction.getPSAppDataEntity()??>
<#assign curAppEntity = uiAction.getPSAppDataEntity()/>
<#if !P.exists("importService", curAppEntity.getId(), "")>
<#if !P.exists("importService", curAppEntity.getId(), "") >
import ${srfclassname('${curAppEntity.getCodeName()}')}UIService from '@/uiservice/${srffilepath2(curAppEntity.getCodeName())}/${srffilepath2(curAppEntity.getCodeName())}-ui-service';
<#if appde?? && (curAppEntity.getId() == appde.getId())><#assign hasAppDE = true /></#if>
</#if>
</#if>
</#list>
</#if>
<#if appde?? && !hasAppDE??>
import ${srfclassname('${appde.getCodeName()}')}UIService from '@/uiservice/${srffilepath2(appde.getCodeName())}/${srffilepath2(appde.getCodeName())}-ui-service';
</#if>
<#-- 语言资源入口 -->
<#ibizinclude>
./LANGBASE.vue.ftl
......@@ -188,6 +191,21 @@ ${P.getLogicCode(logic, "LOGIC.vue").code}
${P.getLogicCode(uiAction, "LOGIC.vue").code}
</#if>
</#list>
</#if>
<#if appde??>
/**
* 转化数据
*
* @param {any} args
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public transformData(args: any) {
let _this: any = this;
if(_this.service && _this.service.handleRequestData instanceof Function && _this.service.handleRequestData('transform',_this.context,args)){
return _this.service.handleRequestData('transform',_this.context,args)['data'];
}
}
</#if>
/**
......
......@@ -22,12 +22,16 @@ import ${srfclassname('${ctrl.codeName}')}Service from './${srffilepath2(ctrl.co
<#list ctrl.getPSUIActions() as uiAction>
<#if uiAction.getPSAppDataEntity()??>
<#assign curAppEntity = uiAction.getPSAppDataEntity()/>
<#if !P.exists("importService", curAppEntity.getId(), "")>
<#if !P.exists("importService", curAppEntity.getId(), "") >
import ${srfclassname('${curAppEntity.getCodeName()}')}UIService from '@/uiservice/${srffilepath2(curAppEntity.getCodeName())}/${srffilepath2(curAppEntity.getCodeName())}-ui-service';
<#if appde?? && (curAppEntity.getId() == appde.getId())><#assign hasAppDE = true /></#if>
</#if>
</#if>
</#list>
</#if>
<#if appde?? && !hasAppDE??>
import ${srfclassname('${appde.getCodeName()}')}UIService from '@/uiservice/${srffilepath2(appde.getCodeName())}/${srffilepath2(appde.getCodeName())}-ui-service';
</#if>
<#-- 语言资源入口 -->
<#ibizinclude>
./LANGBASE.vue.ftl
......@@ -135,6 +139,14 @@ export default class <#if ctrl.getPSAppDataEntity()??>${srfclassname('${ctrl.get
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appEntityService: ${srfclassname('${appde.getCodeName()}')}Service = new ${srfclassname('${appde.getCodeName()}')}Service({ $store: this.$store });
/**
* 界面UI服务对象
*
* @type {${srfclassname('${appde.getCodeName()}')}UIService}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appUIService:${srfclassname('${appde.getCodeName()}')}UIService = new ${srfclassname('${appde.getCodeName()}')}UIService(this.$store);
</#if>
<#if ctrl.getPSControls?? && ctrl.getPSControls()??>
<#list ctrl.getPSControls() as childCtrl>
......
......@@ -156,15 +156,6 @@ import ${srfclassname('${_appde.getCodeName()}')}Service from '@/service/${srffi
});
});
}
<#assign has_keyfield = false />
<#list ctrl.getPSDEFormItems() as formitem>
<#if formitem.getPSAppDEField?? && formitem.getPSAppDEField()??>
<#if !formitem.isHidden() && formitem.getPSAppDEField().isKeyField()>
<#assign has_keyfield = true />
</#if>
</#if>
</#list>
/**
* 添加数据
......@@ -179,9 +170,15 @@ import ${srfclassname('${_appde.getCodeName()}')}Service from '@/service/${srffi
@Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
<#if has_keyfield>
Object.assign(Data,{${appde.getKeyPSAppDEField().getCodeName()?lower_case}: data.${appde.getKeyPSAppDEField().getCodeName()?lower_case}, srffrontuf: '1'});
</#if>
<#-- 手动修改数据主键的情况start -->
<#list ctrl.getPSDEFormItems() as formitem>
<#if formitem.getPSAppDEField?? && formitem.getPSAppDEField()??>
<#if !formitem.isHidden() && formitem.getPSAppDEField().isKeyField()>
Object.assign(Data,{${appde.getKeyPSAppDEField().getCodeName()?lower_case}: data.${formitem.getName()}, srffrontuf: '1'});
</#if>
</#if>
</#list>
<#-- 手动修改数据主键的情况end -->
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......
......@@ -19,7 +19,7 @@
</#if>
</div>
<div v-else>
暂无数据
{{ $t('app.commonWords.noData') }}
</div>
</div>
</template>
......@@ -327,7 +327,7 @@
*/
public load(opt: any = {}): void {
if(!this.fetchAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图列表fetchAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.list.notConfig.fetchAction') as string) });
return;
}
const arg: any = {...opt};
......@@ -353,7 +353,7 @@
post.then((response: any) => {
if (!response || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}
return;
}
......@@ -378,7 +378,7 @@
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
});
}
......@@ -391,7 +391,7 @@
*/
public async remove(datas: any[]): Promise<any> {
if(!this.removeAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格removeAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.list.notConfig.removeAction') as string) });
return;
}
if (datas.length === 0) {
......@@ -427,10 +427,10 @@
return new Promise((resolve: any, reject: any) => {
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '', desc: '删除数据失败,' + response.info });
this.$Notice.error({ title: '', desc: (this.$t('app.commonWords.delDataFail') as string) + ',' + response.info });
return;
} else {
this.$Notice.success({ title: '', desc: '删除成功!' });
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.deleteSuccess') as string) });
}
//删除items中已删除的项
datas.forEach((data: any) => {
......@@ -449,7 +449,7 @@
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
reject(response);
return;
}
......@@ -460,8 +460,8 @@
dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, '').replace(/[ ]/g, '');
this.$Modal.confirm({
title: '警告',
content: '确认要删除 ' + dataInfo + ',删除操作将不可恢复?',
title: (this.$t('app.commonWords.warning') as string),
content: (this.$t('app.list.confirmDel') as string) + ' ' + dataInfo + ',' + (this.$t('app.list.notRecoverable') as string) ,
onOk: () => {
removeData();
},
......@@ -486,7 +486,7 @@
try {
if(Object.is(item.rowDataState, 'create')){
if(!this.createAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图列表createAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.list.notConfig.createAction') as string) });
}else{
Object.assign(item,{viewparams:this.viewparams});
let response = await this.service.add(this.createAction, JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator);
......@@ -494,7 +494,7 @@
}
}else if(Object.is(item.rowDataState, 'update')){
if(!this.updateAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图列表updateAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.warning') as string), desc: '${view.getName()}' + (this.$t('app.list.notConfig.updateAction') as string) });
}else{
Object.assign(item,{viewparams:this.viewparams});
<#if de??>
......@@ -514,10 +514,10 @@
this.$emit('save', successItems);
this.refresh();
if(errorItems.length === 0){
this.$Notice.success({ title: '', desc: '保存成功!' });
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{
errorItems.forEach((item:any,index:number)=>{
this.$Notice.error({ title: '保存失败', desc: item.majorentityname+'保存失败!' });
this.$Notice.error({ title: (this.$t('app.commonWords.saveFailed') as string), desc: item.majorentityname+ (this.$t('app.commonWords.saveFailed') as string) + '!' });
console.error(errorMessage[index]);
});
}
......
......@@ -109,9 +109,9 @@
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Data,Context,isloading);
result = _appEntityService[action](Context,Data,isloading);
}else{
result =_appEntityService.Update(Data,Context,isloading);
result =_appEntityService.Update(Context,Data,isloading);
}
result.then((response) => {
this.handleResponse(action, response);
......
......@@ -6,7 +6,7 @@
<div slot='<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">left<#else>top</#if>'>
<#if ctrl.isShowTitleBar()>
<div class='list-exp-bar-header'>
<#if ctrl.getTitle() == ''>列表导航栏<#else>${ctrl.getTitle()}</#if>
<#if ctrl.getTitle() == ''>{{$t('app.listExpBar.title')}}<#else>${ctrl.getTitle()}</#if>
</div>
</#if>
<div class="container-header">
......
......@@ -6,7 +6,7 @@
<div slot='<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">left<#else>top</#if>'>
<#if ctrl.isShowTitleBar()>
<div class='dataview-exp-bar-header'>
<div><icon type='ios-home-outline'/><#if ctrl.getTitle() == ''>卡片视图导航栏<#else>${ctrl.getTitle()}</#if></div>
<div><icon type='ios-home-outline'/><#if ctrl.getTitle() == ''>{{ $t('app.dataViewExpBar.title') }}<#else>${ctrl.getTitle()}</#if></div>
</div>
</#if>
<div class="container-header">
......
......@@ -32,9 +32,9 @@
</#if>
</i-content>
<footer class="app-wizard-footer">
<i-button :disabled="isDisabled('PREV')" @click="onClickPrev()" type="primary">上一步</i-button>
<i-button :disabled="isDisabled('NEXT')" @click="onClickNext()" type="primary">下一步</i-button>
<i-button :disabled="isDisabled('FINISH')" @click="onClickFinish()" type="primary">完成</i-button>
<i-button :disabled="isDisabled('PREV')" @click="onClickPrev()" type="primary">{{$t('app.wizardPanel.back')}}</i-button>
<i-button :disabled="isDisabled('NEXT')" @click="onClickNext()" type="primary">{{$t('app.wizardPanel.next')}}</i-button>
<i-button :disabled="isDisabled('FINISH')" @click="onClickFinish()" type="primary">{{$t('app.wizardPanel.complete')}}</i-button>
</footer>
</layout>
</template>
......@@ -229,7 +229,7 @@
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.info });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.info });
});
</#if>
}
......@@ -266,7 +266,7 @@
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.info });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.info });
});
</#if>
}
......@@ -354,7 +354,7 @@
this.curState = 'NEXT';
this.wizardState.next({ tag: this.activeForm, action: 'save', data: this.formParam });
} else {
this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.rulesException') as string) });
}
}
}
......@@ -373,7 +373,7 @@
this.curState = 'FINISH';
this.wizardState.next({ tag: this.activeForm, action: 'save', data: this.formParam });
} else {
this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.rulesException') as string) });
}
}
}
......
......@@ -17,7 +17,7 @@
</div>
<div>
<i-button type="primary" @click="handleAdd" style="float: right;">
增加
{{ $t('app.local.add')}}
</i-button>
</div>
</div>
......@@ -170,7 +170,8 @@
public count: number = 0;
<#-- BEGIN:参数处理 -->
<#list ctrl.getAllRelatedPSAppViews() as dataview>
<#if ctrl.getEmbeddedPSAppView()??>
<#assign dataview = ctrl.getEmbeddedPSAppView() />
<#if !dataview.isPSDEView()>
/**
......@@ -223,7 +224,7 @@
{ pathName: '${srfpluralize(appDataEntity.codeName)?lower_case}', parameterName: '${appDataEntity.getCodeName()?lower_case}' },
];
</#if>
</#list>
</#if>
<#-- END:参数处理 -->
/**
......@@ -341,7 +342,7 @@
*/
public load(data: any): void {
if(!this.fetchAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图多编辑视图面板fetchAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.multiEditView.notConfig.fetchAction') as string) });
return;
}
let arg: any = {};
......@@ -351,7 +352,7 @@
promice.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}
return;
}
......@@ -365,7 +366,7 @@
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
});
}
......@@ -376,14 +377,14 @@
*/
public handleAdd(){
if(!this.loaddraftAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图多编辑视图面板loaddraftAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.multiEditView.notConfig.loaddraftAction') as string) });
return;
}
const promice: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)),{viewparams:this.viewparams}, this.showBusyIndicator);
promice.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}
return;
}
......@@ -393,7 +394,7 @@
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
});
}
......
......@@ -13,12 +13,18 @@
<#if deuiaction.getUIActionTag() == 'ExportExcel'>
<app-export-excel :item="${ModelsName}.${item.name}" :caption="$t('${langbase}.${item.name}.caption')" @exportexcel="${ctrl.name}_click({ tag: '${item.name}' }, $event)"></app-export-excel>
<#else>
<@badge item>
<#if item.getPSUIAction?? && item.getPSUIAction()?? && item.getPSUIAction().getPSAppCounter?? && item.getPSUIAction().getPSAppCounter()??>
<#assign uiaction = item.getPSUIAction() />
<#assign counter = uiaction.getPSAppCounter() />
<Badge type="primary" v-show="${ModelsName}.${item.name}.visabled" :count="${srfclassname('${counter.getCodeName()}')}counterservice.counterData.<#if uiaction.getCounterId()??>${uiaction.getCounterId()}</#if>">
</#if>
<i-button v-show="${ModelsName}.${item.name}.visabled" :disabled="${ModelsName}.${item.name}.disabled" class='<#if item.getPSSysCss()??> ${item.getPSSysCss().getCssName()}</#if>' @click="${ctrl.name}_click({ tag: '${item.name}' }, $event)">
<#if item.isShowIcon()><i class='<#if item.getPSSysImage()??><#assign img=item.getPSSysImage()><#if img.getCssClass()?? && (img.getCssClass()?length gt 0)>${img.getCssClass()}</#if></#if>'></i></#if>
<#if item.isShowCaption()><span class='caption'>{{<#if langbase??>$t('${langbase}.${item.name}.caption')<#else>'${item.getCaption()}'</#if>}}</span></#if>
</i-button>
</@badge>
<#if item.getPSUIAction?? && item.getPSUIAction()?? && item.getPSUIAction().getPSAppCounter?? && item.getPSUIAction().getPSAppCounter()??>
</Badge>
</#if>
</#if>
<div slot='content'>{{<#if langbase??>$t('${langbase}.${item.name}.tip')<#else>'${item.getTooltip()}'</#if>}}</div>
</tooltip>
......@@ -26,12 +32,18 @@
<#if deuiaction.getUIActionTag() == 'ExportExcel'>
<app-export-excel :item="${ModelsName}.${item.name}" :caption="$t('${langbase}.${item.name}.caption')" @exportexcel="${ctrl.name}_click({ tag: '${item.name}' }, $event)"></app-export-excel>
<#else>
<@badge item>
<#if item.getPSUIAction?? && item.getPSUIAction()?? && item.getPSUIAction().getPSAppCounter?? && item.getPSUIAction().getPSAppCounter()??>
<#assign uiaction = item.getPSUIAction() />
<#assign counter = uiaction.getPSAppCounter() />
<Badge type="primary" v-show="${ModelsName}.${item.name}.visabled" :count="${srfclassname('${counter.getCodeName()}')}counterservice.counterData.<#if uiaction.getCounterId()??>${uiaction.getCounterId()}</#if>">
</#if>
<i-button v-show="${ModelsName}.${item.name}.visabled" :disabled="${ModelsName}.${item.name}.disabled" class='<#if item.getPSSysCss()??> ${item.getPSSysCss().getCssName()}</#if>' @click="${ctrl.name}_click({ tag: '${item.name}' }, $event)">
<#if item.isShowIcon()><i class='<#if item.getPSSysImage()??><#assign img=item.getPSSysImage()><#if img.getCssClass()?? && (img.getCssClass()?length gt 0)>${img.getCssClass()}</#if></#if>'></i></#if>
<#if item.isShowCaption()><span class='caption'>{{<#if langbase??>$t('${langbase}.${item.name}.caption')<#else>'${item.getCaption()}'</#if>}}</span></#if>
</i-button>
</@badge>
<#if item.getPSUIAction?? && item.getPSUIAction()?? && item.getPSUIAction().getPSAppCounter?? && item.getPSUIAction().getPSAppCounter()??>
</Badge>
</#if>
</#if>
</#if>
<#assign deuiaction=item.getPSUIAction()>
<#assign icon><#if item.getPSSysImage()??><#assign image = item.getPSSysImage()><#if image.getCssClass()??>, iconcls: '${image.getCssClass()}'</#if><#if image.getImagePath()??>, icon: '${image.getImagePath()}'</#if></#if></#assign>
<#if deuiaction.getUIActionTag() == 'ExportExcel'>
${item.getName()?lower_case}: { name: '${item.getName()?lower_case}', caption: '${item.caption}','isShowCaption':${item.isShowCaption()?c},'isShowIcon':${item.isShowIcon()?c}, tooltip: '${item.getTooltip()}'${icon}, disabled: false, type: '${item.getItemType()}', visabled: true, dataaccaction: '<#if deuiaction.getDataAccessAction()??>${deuiaction.getDataAccessAction()}</#if>', uiaction: { tag: '${deuiaction.getUIActionTag()}', target: '${deuiaction.getActionTarget()}' }<#if view.hasPSControl("GRID")><#assign gridhandler = view.getPSControl("GRID").getPSAjaxControlHandler()>, MaxRowCount: <#if gridhandler?? && gridhandler.getPSDEDataExport()??>${gridhandler.getPSDEDataExport().getMaxRowCount()?c}<#elseif sys.getDEDataExportMaxRowCount() gt 0>${sys.getDEDataExportMaxRowCount()?c}<#else>10000</#if></#if>, class: '<#if item.getPSSysCss()??> ${item.getPSSysCss().getCssName()}</#if>' },
${item.getName()?lower_case}: { name: '${item.getName()?lower_case}', <#if item.isShowCaption()>caption: '${item.caption}',</#if> disabled: false, type: '${item.getItemType()}', visabled: true,noprivdisplaymode:<#if item.getNoPrivDisplayMode()??>${item.getNoPrivDisplayMode()}</#if>,dataaccaction: '<#if deuiaction.getDataAccessAction()??>${deuiaction.getDataAccessAction()}</#if>', uiaction: { tag: '${deuiaction.getUIActionTag()}', target: '${deuiaction.getActionTarget()}' }<#if view.hasPSControl("GRID")><#assign gridhandler = view.getPSControl("GRID").getPSAjaxControlHandler()>, MaxRowCount: <#if gridhandler?? && gridhandler.getPSDEDataExport()??>${gridhandler.getPSDEDataExport().getMaxRowCount()?c}<#elseif sys.getDEDataExportMaxRowCount() gt 0>${sys.getDEDataExportMaxRowCount()?c}<#else>10000</#if></#if> },
<#elseif deuiaction.getUIActionTag() == 'ToggleRowEdit'>
${item.getName()?lower_case}: { name: '${item.getName()?lower_case}', caption: '${item.caption}','isShowCaption':${item.isShowCaption()?c},'isShowIcon':${item.isShowIcon()?c}, tooltip: '${item.getTooltip()}'${icon}, disabled: false, type: '${item.getItemType()}', visabled: true, dataaccaction: '<#if deuiaction.getDataAccessAction()??>${deuiaction.getDataAccessAction()}</#if>', uiaction: { tag: '${deuiaction.getUIActionTag()}', target: '${deuiaction.getActionTarget()}' }, class: '<#if item.getPSSysCss()??> ${item.getPSSysCss().getCssName()}</#if>' },
${item.getName()?lower_case}: { name: '${item.getName()?lower_case}', <#if item.isShowCaption()>caption: '${item.caption}', </#if>disabled: false, type: '${item.getItemType()}', visabled: true,noprivdisplaymode:<#if item.getNoPrivDisplayMode()??>${item.getNoPrivDisplayMode()}</#if>,dataaccaction: '<#if deuiaction.getDataAccessAction()??>${deuiaction.getDataAccessAction()}</#if>', uiaction: { tag: '${deuiaction.getUIActionTag()}', target: '${deuiaction.getActionTarget()}' } },
<#else>
${item.getName()?lower_case}: { name: '${item.getName()?lower_case}', caption: '${item.caption}','isShowCaption':${item.isShowCaption()?c},'isShowIcon':${item.isShowIcon()?c}, tooltip: '${item.getTooltip()}'${icon}, disabled: false, type: '${item.getItemType()}', visabled: true, dataaccaction: '<#if deuiaction.getDataAccessAction()??>${deuiaction.getDataAccessAction()}</#if>', uiaction: { tag: '${deuiaction.getUIActionTag()}', target: '${deuiaction.getActionTarget()}' }, class: '<#if item.getPSSysCss()??> ${item.getPSSysCss().getCssName()}</#if>' },
${item.getName()?lower_case}: { name: '${item.getName()?lower_case}', <#if item.isShowCaption()>caption: '${item.caption}', </#if>disabled: false, type: '${item.getItemType()}', visabled: true,noprivdisplaymode:<#if item.getNoPrivDisplayMode()??>${item.getNoPrivDisplayMode()}</#if>,dataaccaction: '<#if deuiaction.getDataAccessAction()??>${deuiaction.getDataAccessAction()}</#if>', uiaction: { tag: '${deuiaction.getUIActionTag()}', target: '${deuiaction.getActionTarget()}' } },
</#if>
\ No newline at end of file
......@@ -5,7 +5,7 @@
<template slot-scope="{ data }">
<#if ctrl.getPSSearchBarFilters()??>
<#list ctrl.getPSSearchBarFilters() as filter>
<template v-if="Object.is(data.field, '${filter.getName()}')">
<template v-if="Object.is(data.editor, '${filter.getName()}')">
${P.getEditorCode(filter, "EDITOR.vue").code}
</template>
</#list>
......@@ -18,15 +18,30 @@
<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>
<el-select size="small" v-if="historyItems.length > 0" v-model="selectItem" @change="onFilterChange">
<el-option v-for="item in historyItems" :key="item.value" :label="item.name" :value="item.value"></el-option>
</el-select>
<i-button type="primary" @click="onSearch">{{ $t('app.searchButton.search') }}</i-button>
<i-button @click="onReset">{{ $t('app.searchButton.reset') }}</i-button>
<Poptip ref="propip" trigger="hover" placement="top-end" :title="$t('app.searchForm.custom')" :width="250" @on-popper-show="openPoper">
<i-button><i class="fa fa-floppy-o" aria-hidden="true"></i></i-button>
<template slot="content">
<div>
<i-input v-model="saveItemName" :placeholder="$t('app.searchForm.title')"></i-input>
<div class="save-action">
<i-button @click="onCancel">{{ $t('app.commonWords.cancel') }}</i-button>
<i-button type="primary" @click="onOk">{{ $t('app.commonWords.save') }}</i-button>
</div>
</div>
</template>
</Poptip>
</div>
</div>
</div>
</template>
<#assign import_block>
import FilterTree from '@components/filter-tree/filter-tree.vue';
import moment from 'moment';
</#assign>
<#assign component_block>
......@@ -68,6 +83,9 @@ FilterTree,
label: '<#if filter.getPSDEField()??>${filter.getPSDEField().getLogicName()}</#if>',
name: '${filter.getName()}',
prop: '<#if filter.getPSDEField()??>${filter.getPSDEField().getCodeName()?lower_case}<#else>${filter.getName()}</#if>',
<#if filter.getPSDEFSearchMode()??>
mode: '${filter.getPSDEFSearchMode().getValueOP()}',
</#if>
disabled: false
},
</#list>
......@@ -106,6 +124,30 @@ FilterTree,
*/
public utilServiceName: string = "<#if app.getPSAppFilterStorageUtil?? && app.getPSAppFilterStorageUtil()??>${app.getPSAppFilterStorageUtil().getCodeName()?lower_case}</#if>";
/**
* 历史记录
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected historyItems: any[] = [];
/**
* 选中记录
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected selectItem: any = null;
/**
* 存储项名称
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected saveItemName: string = '';
/**
* 获取多项数据
*
......@@ -128,7 +170,8 @@ FilterTree,
Object.assign(data, { query: this.query })
} -->
if(this.filterFields.length > 0) {
Object.assign(data, { filter: this.getFilter() })
let filter: any = this.getFilter();
Object.assign(data, { filter: filter ? JSON.stringify(filter) : null })
}
return data;
}
......@@ -145,6 +188,9 @@ FilterTree,
}
let ands: any[] = this.transformAnd(this.filterItems);
this.transformResult(ands, '$and');
if(ands.length === 0) {
return null;
}
return { '$and': ands };
}
......@@ -184,9 +230,9 @@ FilterTree,
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]);
item[data.field] = {};
let valField: string = data.editor ? data.editor : data.field;
item[data.field][data.mode] = (data[valField] == null ? '' : data[valField]);
result.push(item)
} else if(Object.is(data.label, '$and')) {
let items: any[] = this.transformAnd(data.children);
......@@ -210,9 +256,9 @@ FilterTree,
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]);
item[data.field] = {};
let valField: string = data.editor ? data.editor : data.field;
item[data.field][data.mode] = (data[valField] == null ? '' : data[valField]);
result.push(item);
} else if(Object.is(data.label, '$and')) {
item[data.label] = this.transformAnd(data.children);
......@@ -266,10 +312,18 @@ FilterTree,
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onSave() {
public onSave(name?: string) {
let time = moment();
this.historyItems.push({
name: (name ? name : time.format('YYYY-MM-DD HH:mm:ss')),
value: time.unix().toString(),
data: JSON.parse(JSON.stringify(this.filterItems))
})
this.selectItem = time.unix().toString();
let param: any = {};
Object.assign(param, {
model: this.filterItems,
model: JSON.parse(JSON.stringify(this.historyItems)),
appdeName: this.appdeName,
modelid: this.modelId,
utilServiceName: this.utilServiceName,
......@@ -311,15 +365,59 @@ FilterTree,
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();
})
this.historyItems = response.data;
}
}).catch((response: any) => {
console.log(response);
});
}
/**
* 改变过滤条件
*
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onFilterChange(evt: any) {
let item: any = this.historyItems.find((item: any) => Object.is(evt, item.value));
if(item) {
this.filterItems = JSON.parse(JSON.stringify(item.data));
}
}
/**
* 打开弹框
*
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public openPoper() {
this.saveItemName = '';
}
/**
* 确定
*
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onOk() {
let propip: any = this.$refs.propip;
propip.handleMouseleave();
this.onSave(this.saveItemName);
}
/**
* 取消设置
*
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onCancel() {
let propip: any = this.$refs.propip;
propip.handleMouseleave();
this.onSave();
}
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
......@@ -2,8 +2,17 @@
height: 32px;
.search-bar-action {
float: right;
> .ivu-btn {
display: flex;
align-items: center;
> * {
margin-left: 5px;
.save-action {
text-align: right;
margin-top: 10px;
> * {
margin-left: 5px;
}
}
}
}
}
......
......@@ -467,7 +467,7 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
if (value && value.startsWith('%') && value.endsWith('%')) {
const key: string = value.substring(1, value.length - 1);
if (!this.data.hasOwnProperty(key)) {
this.$Notice.error({ title: '错误', desc: `操作失败,未能找到当前表单项${r'${key}'},无法继续操作` });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: `<#noparse>${(this.$t('app.formpage.desc1') as string)}${r'${key}'},${(this.$t('app.formpage.desc2') as string)}</#noparse>` });
return false;
}
value = this.data[key];
......@@ -609,7 +609,7 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
*/
public load(opt: any = {}): void {
if(!this.loadAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图搜索表单loadAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.searchForm.notConfig.loadAction') as string) });
return;
}
const arg: any = { ...opt };
......@@ -629,7 +629,7 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
return;
}
......@@ -646,7 +646,7 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
*/
public loadDraft(opt: any = {},mode?:string): void {
if(!this.loaddraftAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图搜索表单loaddraftAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
......@@ -655,7 +655,7 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}
return;
}
......@@ -687,7 +687,7 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
return;
}
......
......@@ -3,7 +3,7 @@
<#if ctrl.render??><#t>
${ctrl.render.code}
<#else><#t>
<div v-if="isNoData" class="chart-no-data"><i class="el-icon-data-analysis"></i>暂无数据</div>
<div v-if="isNoData" class="chart-no-data"><i class="el-icon-data-analysis"></i>{{$t('app.commonWords.noData')}}</div>
<div v-else class="app-charts" :id="chartId" style="<#if ctrl.getWidth() gt 0>width: ${ctrl.getWidth()};</#if>height: <#if ctrl.getHeight() gt 0>${ctrl.getHeight()}px<#else>100%</#if>;padding: 6px 0;"></div>
</#if>
</div>
......@@ -635,7 +635,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
}
// 补全空白分类
if(returnArray.length >0){
let emptyText = (groupFieldModel[0] && groupFieldModel[0].codeList)?groupFieldModel[0].codeList.emptytext:"未定义";
let emptyText = (groupFieldModel[0] && groupFieldModel[0].codeList)?groupFieldModel[0].codeList.emptytext:(this.$t('app.chart.undefined') as string);
returnArray.forEach((item:any) =>{
if(!item[groupField[0]]){
item[groupField[0]] = emptyText;
......@@ -701,11 +701,11 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
return Number(a[groupField[0].name]) - Number(b[groupField[0].name]);
});
}else if(Object.is(groupField[0].groupMode,"QUARTER")){
returnArray = this.handleSortGroupData(arr,groupField,"季度");
returnArray = this.handleSortGroupData(arr,groupField,(this.$t('app.chart.quarter') as string));
}else if(Object.is(groupField[0].groupMode,"MONTH")){
returnArray = this.handleSortGroupData(arr,groupField,"月");
returnArray = this.handleSortGroupData(arr,groupField,(this.$t('app.calendar.month') as string));
}else if(Object.is(groupField[0].groupMode,"YEARWEEK")){
returnArray = this.handleSortGroupData(arr,groupField,"周");
returnArray = this.handleSortGroupData(arr,groupField,(this.$t('app.calendar.week') as string));
}else if(Object.is(groupField[0].groupMode,"DAY")){
returnArray = arr.sort((a:any, b:any) => {
return moment(a[groupField[0].name]).unix() - moment(b[groupField[0].name]).unix();
......@@ -743,7 +743,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
arr.forEach((item:any) =>{
let sortFieldValue:Array<any> = item[groupField[0].name].split("-");
Object.assign(item,{sortField:Number(sortFieldValue[0])*10000+Number(sortFieldValue[1])});
item[groupField[0].name] = sortFieldValue[0]+"年"+sortFieldValue[1]+label;
item[groupField[0].name] = sortFieldValue[0]+(this.$t('app.chart.year') as string)+sortFieldValue[1]+label;
})
arr.sort((a:any, b:any) => {
return Number(a.sortField) - Number(b.sortField);
......
......@@ -3,7 +3,7 @@
<#if ctrl.render??><#t>
${ctrl.render.code}
<#else><#t>
<div v-if="isNoData" class="chart-no-data"><i class="el-icon-data-analysis"></i>暂无数据</div>
<div v-if="isNoData" class="chart-no-data"><i class="el-icon-data-analysis"></i>{{$t('app.commonWords.noData')}}</div>
<div v-else class="app-charts" :id="chartId" style="<#if ctrl.getWidth() gt 0>width: ${ctrl.getWidth()};</#if>height: <#if ctrl.getHeight() gt 0>${ctrl.getHeight()}px<#else>100%</#if>;padding: 6px 0;"></div>
</#if>
</div>
......@@ -635,7 +635,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
}
// 补全空白分类
if(returnArray.length >0){
let emptyText = (groupFieldModel[0] && groupFieldModel[0].codeList)?groupFieldModel[0].codeList.emptytext:"未定义";
let emptyText = (groupFieldModel[0] && groupFieldModel[0].codeList)?groupFieldModel[0].codeList.emptytext:(this.$t('app.chart.undefined') as string);
returnArray.forEach((item:any) =>{
if(!item[groupField[0]]){
item[groupField[0]] = emptyText;
......@@ -701,11 +701,11 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
return Number(a[groupField[0].name]) - Number(b[groupField[0].name]);
});
}else if(Object.is(groupField[0].groupMode,"QUARTER")){
returnArray = this.handleSortGroupData(arr,groupField,"季度");
returnArray = this.handleSortGroupData(arr,groupField,(this.$t('app.chart.quarter') as string));
}else if(Object.is(groupField[0].groupMode,"MONTH")){
returnArray = this.handleSortGroupData(arr,groupField,"月");
returnArray = this.handleSortGroupData(arr,groupField,(this.$t('app.calendar.month') as string));
}else if(Object.is(groupField[0].groupMode,"YEARWEEK")){
returnArray = this.handleSortGroupData(arr,groupField,"周");
returnArray = this.handleSortGroupData(arr,groupField,(this.$t('app.calendar.week') as string));
}else if(Object.is(groupField[0].groupMode,"DAY")){
returnArray = arr.sort((a:any, b:any) => {
return moment(a[groupField[0].name]).unix() - moment(b[groupField[0].name]).unix();
......@@ -743,7 +743,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
arr.forEach((item:any) =>{
let sortFieldValue:Array<any> = item[groupField[0].name].split("-");
Object.assign(item,{sortField:Number(sortFieldValue[0])*10000+Number(sortFieldValue[1])});
item[groupField[0].name] = sortFieldValue[0]+"年"+sortFieldValue[1]+label;
item[groupField[0].name] = sortFieldValue[0]+(this.$t('app.chart.year') as string)+sortFieldValue[1]+label;
})
arr.sort((a:any, b:any) => {
return Number(a.sortField) - Number(b.sortField);
......
......@@ -278,7 +278,7 @@ import UtilService from '@/utilservice/util-service';
public handleClick(){
const view:any ={
viewname: 'app-portal-design',
title: '面板设计',
title: (this.$t('app.dashBoard.handleClick.title')),
width: 1600,
placement: 'DRAWER_RIGHT'
}
......
......@@ -54,7 +54,7 @@
</i-col>
</a>
</row>
<div v-else class="app-data-empty">暂无数据</div>
<div v-else class="app-data-empty">{{ $t('app.commonWords.noData') }}</div>
</#if>
</div>
</template>
......@@ -410,7 +410,7 @@
*/
public load(opt: any = {}, isReset: boolean = false): void {
if(!this.fetchAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图列表fetchAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.list.notConfig.fetchAction') as string) });
return;
}
const arg: any = {...opt};
......@@ -434,7 +434,7 @@
post.then((response: any) => {
if (!response || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}
return;
}
......@@ -463,7 +463,7 @@
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
});
}
......@@ -476,7 +476,7 @@
*/
public async remove(datas: any[]): Promise<any> {
if(!this.removeAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格removeAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.gridpage.notConfig.removeAction') as string) });
return;
}
let _datas:any[] = [];
......@@ -509,9 +509,9 @@
});
if (_datas.length < 5) {
dataInfo = dataInfo + ' 共' + _datas.length + '条数据';
dataInfo = dataInfo + ' ' + (this.$t('app.dataView.sum') as string) + _datas.length + (this.$t('app.dataView.data') as string);
} else {
dataInfo = dataInfo + '...' + ' 共' + _datas.length + '条数据';
dataInfo = dataInfo + '...' + ' ' + (this.$t('app.dataView.sum') as string) + _datas.length + (this.$t('app.dataView.data') as string);
}
const removeData = () => {
......@@ -525,10 +525,10 @@
return new Promise((resolve: any, reject: any) => {
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '', desc: '删除数据失败,' + response.info });
this.$Notice.error({ title: '', desc: (this.$t('app.commonWords.delDataFail') as string) + ',' + response.info });
return;
} else {
this.$Notice.success({ title: '', desc: '删除成功!' });
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.deleteSuccess') as string) });
}
//删除items中已删除的项
_datas.forEach((data: any) => {
......@@ -547,7 +547,7 @@
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
reject(response);
return;
}
......@@ -558,8 +558,8 @@
dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, '').replace(/[ ]/g, '');
this.$Modal.confirm({
title: '警告',
content: '确认要删除 ' + dataInfo + ',删除操作将不可恢复?',
title: (this.$t('app.commonWords.warning') as string),
content: (this.$t('app.gridpage.confirmDel') as string) + ' ' + dataInfo + ',' + (this.$t('app.gridpage.notRecoverable') as string),
onOk: () => {
removeData();
},
......@@ -585,7 +585,7 @@
try {
if(Object.is(item.rowDataState, 'create')){
if(!this.createAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图列表createAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.list.notConfig.createAction') as string) });
}else{
Object.assign(item,{viewparams:this.viewparams});
let response = await this.service.add(this.createAction, JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator);
......@@ -593,7 +593,7 @@
}
}else if(Object.is(item.rowDataState, 'update')){
if(!this.updateAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图列表updateAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.list.notConfig.updateAction') as string) });
}else{
Object.assign(item,{viewparams:this.viewparams});
<#if de??>
......@@ -613,10 +613,10 @@
this.$emit('save', successItems);
this.refresh();
if(errorItems.length === 0){
this.$Notice.success({ title: '', desc: '保存成功!' });
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{
errorItems.forEach((item:any,index:number)=>{
this.$Notice.error({ title: '保存失败', desc: item.majorentityname+'保存失败!' });
this.$Notice.error({ title: (this.$t('app.commonWords.saveFailed') as string), desc: item.majorentityname + (this.$t('app.commonWords.saveFailed') as string) + '!' });
console.error(errorMessage[index]);
});
}
......
......@@ -112,9 +112,9 @@
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Data,Context,isloading);
result = _appEntityService[action](Context,Data,isloading);
}else{
result =_appEntityService.Update(Data,Context,isloading);
result =_appEntityService.Update(Context,Data,isloading);
}
result.then((response) => {
this.handleResponse(action, response);
......
......@@ -6,7 +6,7 @@
<div slot='<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">left<#else>top</#if>'>
<#if ctrl.isShowTitleBar()>
<div class='calendar-exp-bar-header'>
<div><icon type='ios-home-outline'/><#if ctrl.getTitle() == ''>日历导航栏<#else>${ctrl.getTitle()}</#if></div>
<div><icon type='ios-home-outline'/><#if ctrl.getTitle() == ''>{{ $t('app.calendarExpBar.title') }}<#else>${ctrl.getTitle()}</#if></div>
</div>
</#if>
<div class="container-header">
......
......@@ -31,7 +31,7 @@
<context-menu :contextMenuStyle="{width: '100%'}" :data="item" :renderContent="renderContextMenu">
<el-card @click.native="onEventClick(item,true,$event)" :class="item.className">
<h4>{{item.title}}</h4>
<p>从 {{item.start}} 至 {{item.end}}</p>
<p>{{$t('app.calendar.from')}} {{item.start}} {{$t('app.calendar.to')}} {{item.end}}</p>
</el-card>
</context-menu>
</el-timeline-item>
......@@ -405,7 +405,7 @@ FullCalendar,
post.then((response: any) => {
if (!response || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}
return;
}
......@@ -416,7 +416,7 @@ FullCalendar,
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
});
}
......@@ -606,7 +606,7 @@ FullCalendar,
post.then((response: any) => {
if (!response || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}
return;
}
......@@ -614,7 +614,7 @@ FullCalendar,
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
});
}
......
......@@ -446,7 +446,7 @@
Object.assign(params,{viewparams:tempViewParams});
this.service.getNodes(tempContext,params).then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: "错误", desc: response.info });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.info });
resolve([]);
return;
}
......@@ -466,7 +466,7 @@
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: "错误", desc: response.info });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.info });
});
}
......@@ -530,7 +530,7 @@
const get: Promise<any> = this.service.getNodes(JSON.parse(JSON.stringify(this.context)),arg);
get.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: response.info });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.info });
return;
}
const _items = [...response.data];
......@@ -545,7 +545,7 @@
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.info });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.info });
});
}
......
......@@ -6,7 +6,7 @@
<div slot='left'>
<#if ctrl.isShowTitleBar()>
<div class='tree-exp-bar-header'>
<div class="tree-exp-bar-title"><#if ctrl.getTitle() == ''>树视图导航栏<#else>${ctrl.getTitle()}</#if></div>
<div class="tree-exp-bar-title"><#if ctrl.getTitle() == ''>{{ $t('app.treeExpBar.title') }}<#else>${ctrl.getTitle()}</#if></div>
<#if ctrl.getPSControls()??>
<#assign controls = ctrl.getPSControls()/>
<#list controls as singleControl>
......
......@@ -3,7 +3,7 @@
<div slot='left'>
<#if ctrl.isShowTitleBar()>
<div class='workflow-exp-bar-header'>
<div><icon type='ios-home-outline'/><#if ctrl.getTitle() == ''>流程导航栏<#else>${ctrl.getTitle()}</#if></div>
<div><icon type='ios-home-outline'/><#if ctrl.getTitle() == ''>{{$t('app.wfExpBar.title')}}<#else>${ctrl.getTitle()}</#if></div>
</div>
</#if>
<#if ctrl.isEnableSearch()>
......
......@@ -63,8 +63,8 @@
</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>
<i-button v-if="isVisiable('${form.name}','NEXT')" @click="onClickNext('${form.name}')" type="primary" long>{{$t('app.wizardPanel.next')}}</i-button>
<i-button v-if="isVisiable('${form.name}','FINISH')" @click="onClickFinish('${form.name}')" type="primary" long>{{$t('app.wizardPanel.complete')}}</i-button>
</div>
</div>
</el-popover>
......@@ -358,7 +358,7 @@
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.info });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.info });
});
</#if>
}
......@@ -395,7 +395,7 @@
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.info });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.info });
});
</#if>
}
......@@ -543,7 +543,7 @@
this.curState = 'NEXT';
this.wizardState.next({ tag: name, action: 'save', data: this.formParam });
} else {
this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.rulesException') as string) });
}
}
}
......@@ -562,7 +562,7 @@
this.curState = 'FINISH';
this.wizardState.next({ tag: name, action: 'save', data: this.formParam });
} else {
this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.rulesException') as string) });
}
}
}
......
......@@ -257,7 +257,7 @@ GanttElastic,
Object.assign(params,{viewparams:tempViewParams});
this.service.getNodes(tempContext,params).then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: "错误", desc: response.info });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.info });
return;
}
this.tasks = [...this.tasks, ...response.data];
......@@ -271,7 +271,7 @@ GanttElastic,
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: "错误", desc: response.info });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.info });
});
}
......
......@@ -384,7 +384,7 @@ draggable,
*/
public load(opt: any = {}, isReset: boolean = false): void {
if(!this.fetchAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图列表fetchAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.kanban.notConfig.fetchAction') as string) });
return;
}
const arg: any = {...opt};
......@@ -408,7 +408,7 @@ draggable,
post.then((response: any) => {
if (!response || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}
return;
}
......@@ -438,7 +438,7 @@ draggable,
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
});
}
......@@ -451,7 +451,7 @@ draggable,
*/
public async remove(datas: any[]): Promise<any> {
if(!this.removeAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格removeAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.kanban.notConfig.removeAction') as string) });
return;
}
let _datas:any[] = [];
......@@ -500,10 +500,10 @@ draggable,
return new Promise((resolve: any, reject: any) => {
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '', desc: '删除数据失败,' + response.info });
this.$Notice.error({ title: '', desc: (this.$t('app.commonWords.delDataFail') as string) + ',' + response.info });
return;
} else {
this.$Notice.success({ title: '', desc: '删除成功!' });
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.deleteSuccess') as string) });
}
//删除items中已删除的项
_datas.forEach((data: any) => {
......@@ -522,7 +522,7 @@ draggable,
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
reject(response);
return;
}
......@@ -533,8 +533,8 @@ draggable,
dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, '').replace(/[ ]/g, '');
this.$Modal.confirm({
title: '警告',
content: '确认要删除 ' + dataInfo + ',删除操作将不可恢复?',
title: (this.$t('app.commonWords.warning') as string),
content: (this.$t('app.kanban.delete1') as string) + dataInfo + ',' + (this.$t('app.kanban.delete2') as string),
onOk: () => {
removeData();
},
......@@ -560,7 +560,7 @@ draggable,
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
this.setGroups();
return;
......@@ -571,11 +571,11 @@ draggable,
this.$emit('update', this.items);
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
return;
}
});
......
......@@ -4,7 +4,7 @@
<#if item.render??>
${item.render.code}
<#else>
<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>>
<app-form-group :uiService="appUIService" :data="transformData(data)" :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())>
......
......@@ -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: '<#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?? && item.getShowMoreMode()?? && item.getShowMoreMode() == 2>true<#else>false</#if>, showMoreModeItems: [<#if item.getPSDEFormDetails()??><#list item.getPSDEFormDetails() as moreItem><#if moreItem.getShowMoreMode?? && moreItem.getShowMoreMode()?? && moreItem.getShowMoreMode() == 1>'${moreItem.getName()}',</#if></#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()}',disabled: false, visabled: true, noprivdisplaymode:<#if uadetails.getPSUIAction()?? && uadetails.getPSUIAction().getNoPrivDisplayMode(view)??>${uadetails.getPSUIAction().getNoPrivDisplayMode(view)}</#if>,dataaccaction: '<#if uadetails.getPSUIAction()?? && uadetails.getPSUIAction().getDataAccessAction()??>${uadetails.getPSUIAction().getDataAccessAction()}</#if>',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?? && item.getShowMoreMode()?? && item.getShowMoreMode() == 2>true<#else>false</#if>, showMoreModeItems: [<#if item.getPSDEFormDetails()??><#list item.getPSDEFormDetails() as moreItem><#if moreItem.getShowMoreMode?? && moreItem.getShowMoreMode()?? && moreItem.getShowMoreMode() == 1>'${moreItem.getName()}',</#if></#list></#if>] })
<#elseif item.getDetailType() == 'IFRAME'>
new FormIFrameModel({ ${detail} })
<#elseif item.getDetailType() == 'RAWITEM'>
......
......@@ -23,6 +23,14 @@ import schema from 'async-validator';
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 界面UI服务对象
*
* @type {${srfclassname('${appde.getCodeName()}')}UIService}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appUIService:${srfclassname('${appde.getCodeName()}')}UIService = new ${srfclassname('${appde.getCodeName()}')}UIService(this.$store);
/**
* 工作流审批意见控件绑定值
*
......@@ -254,6 +262,7 @@ import schema from 'async-validator';
<#if ctrl.getPSDEFormItemVRs()??>
<#list ctrl.getPSDEFormItemVRs() as fideValueRule>
<#if fideValueRule.getPSDEFormItemName() == formdetail.getName()>
<#-- 系统值规则 -->
<#if fideValueRule.getPSSysValueRule()??>
<#assign valueRule = fideValueRule.getPSSysValueRule()/>
<#if valueRule.getRuleType?? && valueRule.getRuleType()??>
......@@ -272,6 +281,7 @@ import schema from 'async-validator';
</#list>
}
/**
* 详情模型集合
*
......@@ -676,7 +686,7 @@ import schema from 'async-validator';
if (value && value.startsWith('%') && value.endsWith('%')) {
const key: string = value.substring(1, value.length - 1);
if (!this.data.hasOwnProperty(key)) {
this.$Notice.error({ title: '错误', desc: `操作失败,未能找到当前表单项${r'${key}'},无法继续操作` });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: `<#noparse>${(this.$t('app.formpage.desc1') as string)}${r'${key}'},${(this.$t('app.formpage.desc2') as string)}</#noparse>` });
return false;
}
value = this.data[key];
......@@ -906,7 +916,7 @@ import schema from 'async-validator';
*/
public load(opt: any = {}): void {
if(!this.loadAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表单loadAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.formpage.notconfig.loadaction') as string) });
return;
}
const arg: any = { ...opt };
......@@ -923,11 +933,11 @@ import schema from 'async-validator';
}
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
return;
}
});
......@@ -941,7 +951,7 @@ import schema from 'async-validator';
*/
public loadDraft(opt: any = {}): void {
if(!this.loaddraftAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表单loaddraftAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.formpage.notconfig.loaddraftaction') as string) });
return;
}
const arg: any = { ...opt } ;
......@@ -950,19 +960,21 @@ import schema from 'async-validator';
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
const data = response.data;
<#if de??>
if(data.${appde.getCodeName()?lower_case}){
Object.assign(this.context,{${appde.getCodeName()?lower_case}:data.${appde.getCodeName()?lower_case}})
}
</#if>
this.resetDraftFormStates();
this.onFormLoad(data,'loadDraft');
<#list ctrl.getPSDEFormItems() as formitem>
<#if formitem.getPSAppDEField?? && formitem.getPSAppDEField()??>
<#if !formitem.isHidden() && formitem.getPSAppDEField().isKeyField()>
this.data.${formitem.getName()} = null;
</#if>
</#if>
</#list>
this.$emit('load', data);
this.$nextTick(() => {
this.formState.next({ type: 'load', data: data });
......@@ -979,11 +991,11 @@ import schema from 'async-validator';
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
return;
}
});
......@@ -1005,7 +1017,7 @@ import schema from 'async-validator';
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if(!action){
let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表单'+actionName+'参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.formpage.notconfig.actionname') as string) });
return;
}
Object.assign(arg,{viewparams:this.viewparams});
......@@ -1013,7 +1025,7 @@ import schema from 'async-validator';
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......@@ -1031,20 +1043,20 @@ import schema from 'async-validator';
if (response && response.status && response.data) {
if(response.data.errorKey && Object.is(response.data.errorKey,"versionCheck")){
this.$Modal.confirm({
title: '保存数据发生错误',
content: '数据不一致,可能后台数据已经被修改,是否要重新加载数据?',
title: (this.$t('app.formpage.saveerror') as string),
content: (this.$t('app.formpage.savecontent') as string),
onOk: () => {
this.refresh([]);
},
onCancel: () => { }
});
}else{
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
return;
}
});
......@@ -1063,7 +1075,7 @@ import schema from 'async-validator';
return new Promise((resolve: any, reject: any) => {
showResultInfo = showResultInfo === undefined ? true : false;
if (!this.formValidateStatus()) {
this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.formpage.valuecheckex') as string) });
return;
}
const arg: any = { ...opt };
......@@ -1088,7 +1100,7 @@ import schema from 'async-validator';
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if(!action){
let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表单'+actionName+'参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.formpage.notconfig.actionname') as string) });
return;
}
Object.assign(arg,{viewparams:this.viewparams});
......@@ -1096,7 +1108,7 @@ import schema from 'async-validator';
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......@@ -1112,7 +1124,7 @@ import schema from 'async-validator';
});
<#if ctrl.getFormFuncMode()?lower_case != 'wizardform'>
if (showResultInfo) {
this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;保存成功!' });
this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;'+ (this.$t('app.formpage.savesuccess') as string) });
}
</#if>
resolve(response);
......@@ -1120,21 +1132,21 @@ import schema from 'async-validator';
if (response && response.status && response.data) {
if(response.data.errorKey && Object.is(response.data.errorKey,"versionCheck")){
this.$Modal.confirm({
title: '保存数据发生错误',
content: '数据不一致,可能后台数据已经被修改,是否要重新加载数据?',
title: (this.$t('app.formpage.saveerror') as string),
content: (this.$t('app.formpage.savecontent') as string),
onOk: () => {
this.refresh([]);
},
onCancel: () => { }
});
}else{
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
reject(response);
}
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
reject(response);
return;
}
......@@ -1153,7 +1165,7 @@ import schema from 'async-validator';
public remove(opt:Array<any> = [],showResultInfo?: boolean): Promise<any> {
return new Promise((resolve: any, reject: any) => {
if(!this.removeAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表单removeAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.formpage.notconfig.removeaction') as string) });
return;
}
const arg: any = opt[0];
......@@ -1165,7 +1177,7 @@ import schema from 'async-validator';
this.$emit('remove',data);
this.formState.next({ type: 'remove', data: data });
this.data.ismodify = false;
this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;删除成功!' });
this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;' + (this.$t('app.formpage.deletesuccess') as string) });
<#if ctrl.getControlType() == 'FORM'>
AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data});
</#if>
......@@ -1201,20 +1213,20 @@ import schema from 'async-validator';
result.then((response: any) => {
if (!response || response.status !== 200) {
if(response.data){
this.$Notice.error({ title: '', desc: '工作流启动失败, ' + response.data.message });
this.$Notice.error({ title: '', desc: (this.$t('app.formpage.workflow.starterror') as string) + ', ' + response.data.message });
}
return;
}
this.$Notice.info({ title: '', desc: '工作流启动成功' });
this.$Notice.info({ title: '', desc: (this.$t('app.formpage.workflow.startsuccess') as string) });
resolve(response);
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
reject(response);
return;
}
......@@ -1222,12 +1234,12 @@ import schema from 'async-validator';
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
reject(response);
return;
}
......@@ -1276,22 +1288,22 @@ import schema from 'async-validator';
result.then((response: any) => {
if (!response || response.status !== 200) {
if(response.data){
this.$Notice.error({ title: '', desc: '工作流提交失败, ' + response.data.message });
this.$Notice.error({ title: '', desc: (this.$t('app.formpage.workflow.submiterror') as string) + ', ' + response.data.message });
}
return;
}
this.onFormLoad(arg,'submit');
this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
this.$Notice.info({ title: '', desc: '工作流提交成功' });
this.$Notice.info({ title: '', desc: (this.$t('app.formpage.workflow.submitsuccess') as string) });
resolve(response);
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
reject(response);
return;
}
......@@ -1299,12 +1311,12 @@ import schema from 'async-validator';
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
reject(response);
return;
}
......@@ -1333,7 +1345,7 @@ import schema from 'async-validator';
const post: Promise<any> = this.service.frontLogic(mode,JSON.parse(JSON.stringify(this.context)),arg, showloading);
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '表单项更新失败' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.formpage.updateerror') as string) });
return;
}
const data = response.data;
......@@ -1356,11 +1368,11 @@ import schema from 'async-validator';
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
return;
}
});
......
......@@ -75,22 +75,23 @@
<div style="text-align: center;">
<#if item.getPSDEUIActionGroup().getPSDEUIActions()??>
<#list item.getPSDEUIActionGroup().getPSUIActionGroupDetails() as uiactionDetail>
<#if uiactionDetail_index gt 0>
<divider type='vertical'></divider>
</#if>
<#if uiactionDetail.getPSUIAction?? && uiactionDetail.getPSUIAction()??>
<#assign uiaction = uiactionDetail.getPSUIAction() />
<#if preUIAction??>
<divider type='vertical' v-show="scope.row.${preUIAction.getUIActionTag()}.visabled && scope.row.${uiaction.getUIActionTag()}.visabled" ></divider>
</#if>
<#if !uiactionDetail.isShowCaption()>
<tooltip :transfer="true" :max-width="600">
</#if>
<a @click="uiAction(scope.row, '${uiaction.getUIActionTag()}', $event)">
<a v-show="scope.row.${uiaction.getUIActionTag()}.visabled" :style="{'pointer-events':scope.row.${uiaction.getUIActionTag()}.disabled?'none':'auto'}" @click="uiAction(scope.row, '${uiaction.getUIActionTag()}', $event)">
<#if uiactionDetail.isShowIcon()><i class='<#if uiaction.getIconCls?? && uiaction.getIconCls()??>${uiaction.getIconCls()}</#if>'></i></#if>
<#if uiactionDetail.isShowCaption()>{{<#if langbase??>$t('${langbase}.uiactions.${uiaction.getUIActionTag()?lower_case}')<#else>'${uiaction.getCaption()}'</#if>}}</#if>
<#if uiactionDetail.isShowCaption()>{{<#if langbase??>$t('${langbase}.uiactions.${uiaction.getFullCodeName()?lower_case}')<#else>'${uiaction.getCaption()}'</#if>}}</#if>
</a>
<#if !uiactionDetail.isShowCaption()>
<div slot='content'>{{<#if langbase??>$t('${langbase}.uiactions.${uiaction.getUIActionTag()?lower_case}')<#else>'${uiaction.getCaption()}'</#if>}}</div>
<div slot='content'>{{<#if langbase??>$t('${langbase}.uiactions.<#if uiaction.getPSAppDataEntity?? && uiaction.getPSAppDataEntity()??>${uiaction.getPSAppDataEntity().getCodeName()?lower_case}_</#if>${uiaction.getUIActionTag()?lower_case}')<#else>'${uiaction.getCaption()}'</#if>}}</div>
</tooltip>
</#if>
<#assign preUIAction = uiaction />
</#if>
</#list>
</#if>
......@@ -168,7 +169,12 @@
</app-column-link>
<#else>
<#if item.getPSDEGridEditItem()?? && item.getPSDEGridEditItem().getPSEditorType?? && item.getPSDEGridEditItem().getPSEditorType()??>
<app-span name='${item.name}' editorType="${item.getPSDEGridEditItem().getPSEditorType().getStandardPSEditorType()}" :value="row.${item.getName()?lower_case}"></app-span>
<app-span name='${item.name}' editorType="${item.getPSDEGridEditItem().getPSEditorType().getStandardPSEditorType()}" :value="row.${item.getName()?lower_case}" <#t>
<#if item.getPSDEField().getDataType()!="">
dataType="${item.getPSDEField().getDataType()}" <#t>
</#if>
<#if item.getPSDEField().getPrecision()??>
precision="${item.getPSDEField().getPrecision()}" <#t></#if>></app-span>
<#else>
<#if item.getValueFormat()?? && item.getValueFormat() != "%1$s">
<app-format-data format="${item.getValueFormat()}" :data="row.${item.getName()?lower_case}"></app-format-data>
......
<template>
<div class='grid' style="height:100%;">
<#if ctrl.render?? || ctrl.getRender()??>
<#if ctrl.render??>
${ctrl.render.code}
<#else>
<i-form style="height:100%">
......@@ -29,7 +29,7 @@
@row-dblclick="rowDBLClick($event)"
ref='multipleTable' :data="items" :show-header="!isHideHeader">
<template slot="empty">
无数据
{{$t('app.gridpage.noData')}}
<#if ctrl.getQuickPSDEToolbar?? && ctrl.getQuickPSDEToolbar()??>
<span class="quick-toolbar">
<#assign quickToolbar = ctrl.getQuickPSDEToolbar()/>
......@@ -116,6 +116,28 @@ import { FormItemModel } from '@/model/form-detail';
*/
public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/**
* 界面UI服务对象
*
* @type {${srfclassname('${appde.getCodeName()}')}UIService}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appUIService:${srfclassname('${appde.getCodeName()}')}UIService = new ${srfclassname('${appde.getCodeName()}')}UIService(this.$store);
/**
* 界面行为模型
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ActionModel:any ={
<#if ctrl.getPSUIActions()??>
<#list ctrl.getPSUIActions() as item>
${item.getUIActionTag()}: { name: '${item.getUIActionTag()}',disabled: false, visabled: true,noprivdisplaymode:<#if item.getNoPrivDisplayMode(view)??>${item.getNoPrivDisplayMode(view)}</#if>,dataaccaction: '<#if item.getDataAccessAction()??>${item.getDataAccessAction()}</#if>', target: '${item.getActionTarget()}'}<#if item_has_next>,</#if>
</#list>
</#if>
};
/**
* 应用状态事件
*
......@@ -373,6 +395,13 @@ import { FormItemModel } from '@/model/form-detail';
*/
public totalrow: number = 0;
/**
* 表格更新默认值项
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public defaultUpdateItems:Array<any> =[<#list ctrl.getPSDEGridEditItems() as editItem><#if editItem.getUpdateDV?? && editItem.getUpdateDV()?? && !(editItem.getUpdateDV() == '')>'${editItem.getCodeName()?lower_case}'</#if><#if editItem_has_next>,</#if></#list>];
/**
* 选中行数据
*
......@@ -487,6 +516,18 @@ import { FormItemModel } from '@/model/form-detail';
*/
public gridItemsModel: any[] = [];
/**
* 获取界面行为权限状态
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getActionState(data:any){
let targetData:any = this.transformData(data);
let tempActionModel:any = JSON.parse(JSON.stringify(this.ActionModel));
ViewTool.calcActionItemAuthState(targetData,tempActionModel,this.appUIService);
return tempActionModel;
}
/**
* 获取表格行模型
*
......@@ -584,7 +625,7 @@ import { FormItemModel } from '@/model/form-detail';
*/
public load(opt: any = {}, pageReset: boolean = false): void {
if(!this.fetchAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格fetchAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}'+(this.$t('app.gridpage.notConfig.fetchAction') as string) });
return;
}
if(pageReset){
......@@ -611,7 +652,7 @@ import { FormItemModel } from '@/model/form-detail';
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}
return;
}
......@@ -622,6 +663,9 @@ import { FormItemModel } from '@/model/form-detail';
this.selections = [];
this.gridItemsModel = [];
this.items.forEach(()=>{this.gridItemsModel.push(this.getGridRowModel())});
this.items.forEach((item:any)=>{
Object.assign(item,this.getActionState(item));
});
this.$emit('load', this.items);
// 设置默认选中
let _this = this;
......@@ -651,7 +695,7 @@ import { FormItemModel } from '@/model/form-detail';
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
});
}
......@@ -664,7 +708,7 @@ import { FormItemModel } from '@/model/form-detail';
*/
public async remove(datas: any[]): Promise<any> {
if(!this.removeAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格removeAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}'+(this.$t('app.gridpage.notConfig.removeAction') as string) });
return;
}
let _datas:any[] = [];
......@@ -698,9 +742,9 @@ import { FormItemModel } from '@/model/form-detail';
});
if (_datas.length < 5) {
dataInfo = dataInfo + ' 共' + _datas.length + '条数据';
dataInfo = dataInfo + ' '+(this.$t('app.gridpage.totle') as string) + _datas.length + (this.$t('app.gridpage.records') as string)+(this.$t('app.gridpage.data') as string);
} else {
dataInfo = dataInfo + '...' + ' 共' + _datas.length + '条数据';
dataInfo = dataInfo + '...' + ' '+(this.$t('app.gridpage.totle') as string) + _datas.length + (this.$t('app.gridpage.desc2') as string);
}
const removeData = () => {
......@@ -715,10 +759,10 @@ import { FormItemModel } from '@/model/form-detail';
return new Promise((resolve: any, reject: any) => {
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '', desc: '删除数据失败,' + response.info });
this.$Notice.error({ title: '', desc: (this.$t('app.gridpage.delDataFail') as string)+',' + response.info });
return;
} else {
this.$Notice.success({ title: '', desc: '删除成功!' });
this.$Notice.success({ title: '', desc: (this.$t('app.gridpage.delSuccess') as string) });
}
//删除items中已删除的项
console.log(this.items);
......@@ -740,7 +784,7 @@ import { FormItemModel } from '@/model/form-detail';
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
reject(response);
return;
}
......@@ -751,8 +795,8 @@ import { FormItemModel } from '@/model/form-detail';
dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, '');
this.$Modal.confirm({
title: '警告',
content: '确认要删除 ' + dataInfo + ',删除操作将不可恢复?',
title: (this.$t('app.commonWords.warning') as string),
content: (this.$t('app.gridpage.confirmDel') as string)+' ' + dataInfo + ','+(this.$t('app.gridpage.notRecoverable') as string),
onOk: () => {
removeData();
},
......@@ -770,13 +814,13 @@ import { FormItemModel } from '@/model/form-detail';
*/
public addBatch(arg: any = {}): void {
if(!this.fetchAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格fetchAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}'+(this.$t('app.gridpage.notConfig.fetchAction') as string) });
return;
}
if(!arg){
arg = {};
}
console.error("批量添加未实现");
console.error((this.$t('app.gridpage.notBatch') as string));
<#-- const post: Promise<any> = this.$http.post(this.fetchAction, arg, this.showBusyIndicator);
post.then((response: any) => {
if (response.ret !== 200) {
......@@ -882,7 +926,7 @@ import { FormItemModel } from '@/model/form-detail';
excel.export_json_to_excel({
header: tHeader, //表头 必填
data, //具体数据 必填
filename: "${ctrl.getPSAppDataEntity().getLogicName()}表", //非必填
filename: "${ctrl.getPSAppDataEntity().getLogicName()}"+(this.$t('app.gridpage.grid') as string), //非必填
autoWidth: true, //非必填
bookType: "xlsx" //非必填
});
......@@ -922,7 +966,7 @@ import { FormItemModel } from '@/model/form-detail';
</#if>
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '', desc: '数据导出失败,' + response.info });
this.$Notice.error({ title: '', desc: (this.$t('app.gridpage.exportFail') as string)+',' + response.info });
return;
}
try {
......@@ -934,7 +978,7 @@ import { FormItemModel } from '@/model/form-detail';
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '', desc: '数据导出失败' });
this.$Notice.error({ title: '', desc: (this.$t('app.gridpage.exportFail') as string) });
});
}
......@@ -1342,7 +1386,7 @@ import { FormItemModel } from '@/model/form-detail';
const sums:Array<any> = [];
columns.forEach((column:any, index:number) => {
if (index === 0) {
sums[index] = '合计';
sums[index] = (this.$t('app.gridpage.sum') as string);
return;
}
if(index === (columns.length - 1)){
......@@ -1422,7 +1466,7 @@ import { FormItemModel } from '@/model/form-detail';
const sums:Array<any> = [];
columns.forEach((column:any, index:number) => {
if (index === 0) {
sums[index] = '合计';
sums[index] = (this.$t('app.gridpage.sum') as string);
return;
}else if(index === (columns.length - 1)){
sums[index] = '';
......@@ -1466,7 +1510,7 @@ import { FormItemModel } from '@/model/form-detail';
this.service.getAggData(this.aggAction,JSON.parse(JSON.stringify(this.context)),this.showBusyIndicator).then((response:any) =>{
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}
return;
}
......@@ -1478,7 +1522,7 @@ import { FormItemModel } from '@/model/form-detail';
}
this.remoteData = {};
this.isDisplay = true;
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
})
}
</#if>
......@@ -1567,8 +1611,15 @@ import { FormItemModel } from '@/model/form-detail';
*/
public async save(args: any[], params?: any, $event?: any, xData?: any){
let _this = this;
if(_this.items && _this.items.length >0){
for (const item of _this.items) {
if(Object.is(item.rowDataState, 'update')){
_this.updateDefault(item);
}
}
}
if(!await this.validateAll()){
this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.rulesException') as string) });
return [];
}
let successItems:any = [];
......@@ -1578,7 +1629,7 @@ import { FormItemModel } from '@/model/form-detail';
try {
if(Object.is(item.rowDataState, 'create')){
if(!this.createAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格createAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}'+(this.$t('app.gridpage.notConfig.createAction') as string) });
}else{
Object.assign(item,{viewparams:this.viewparams});
let response = await this.service.add(this.createAction, JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator);
......@@ -1586,7 +1637,7 @@ import { FormItemModel } from '@/model/form-detail';
}
}else if(Object.is(item.rowDataState, 'update')){
if(!this.updateAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格updateAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}'+(this.$t('app.gridpage.notConfig.updateAction') as string) });
}else{
Object.assign(item,{viewparams:this.viewparams});
<#if de??>
......@@ -1594,7 +1645,7 @@ import { FormItemModel } from '@/model/form-detail';
Object.assign(this.context,{${appde.getCodeName()?lower_case}:item.${appde.getCodeName()?lower_case}});
}
</#if>
let response = await this.service.add(this.updateAction,JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator);
let response = await this.service.update(this.updateAction,JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator);
successItems.push(JSON.parse(JSON.stringify(response.data)));
}
}
......@@ -1606,10 +1657,10 @@ import { FormItemModel } from '@/model/form-detail';
this.$emit('save', successItems);
this.refresh([]);
if(errorItems.length === 0){
this.$Notice.success({ title: '', desc: '保存成功!' });
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{
errorItems.forEach((item:any,index:number)=>{
this.$Notice.error({ title: '保存失败', desc: item.majorentityname+'保存失败!' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: errorMessage[index].data.message });
console.error(errorMessage[index]);
});
}
......@@ -1625,7 +1676,7 @@ import { FormItemModel } from '@/model/form-detail';
*/
public newRow(args: any[], params?: any, $event?: any, xData?: any): void {
if(!this.loaddraftAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格loaddraftAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}'+(this.$t('app.gridpage.notConfig.loaddraftAction') as string) });
return;
}
let _this = this;
......@@ -1634,7 +1685,7 @@ import { FormItemModel } from '@/model/form-detail';
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}
return;
}
......@@ -1648,7 +1699,7 @@ import { FormItemModel } from '@/model/form-detail';
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
return;
}
});
......@@ -1685,6 +1736,11 @@ import { FormItemModel } from '@/model/form-detail';
*/
public gridEditItemChange(row: any, property: string, value: any, rowIndex: number){
row.rowDataState = row.rowDataState ? row.rowDataState : "update" ;
if(Object.is(row.rowDataState,"update")){
if(!value && this.defaultUpdateItems.includes(property)){
row.hasUpdated = true;
}
}
this.validate(property,row,rowIndex);
<#if ctrl.getPSDEGridEditItems()??>
<#list ctrl.getPSDEGridEditItems() as editItem>
......@@ -1718,7 +1774,7 @@ import { FormItemModel } from '@/model/form-detail';
const post: Promise<any> = this.service.frontLogic(mode,JSON.parse(JSON.stringify(this.context)),arg, showloading);
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '表单项更新失败' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.gridpage.formitemFailed') as string) });
return;
}
const _data: any = response.data;
......@@ -1736,7 +1792,7 @@ import { FormItemModel } from '@/model/form-detail';
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
return;
}
});
......@@ -1813,6 +1869,45 @@ import { FormItemModel } from '@/model/form-detail';
}
</#if>
</#if>
</#list>
}
/**
* 更新默认值
* @param {*} row 行数据
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public updateDefault(row: any){
<#list ctrl.getPSDEGridEditItems() as editItem><#t>
<#if editItem.getUpdateDV?? && editItem.getUpdateDV()??><#t>
<#if !(editItem.getUpdateDV() == '') || editItem.getUpdateDVT() == 'CURTIME'><#t>
if (row.hasOwnProperty('${editItem.getCodeName()?lower_case}') && !row.${editItem.getCodeName()?lower_case} && !row.hasUpdated) {
<#-- 网页请求 -->
<#if editItem.getUpdateDVT() == 'CONTEXT'>
row['${editItem.getCodeName()?lower_case}'] = this.viewparams['${editItem.getUpdateDV()}'];
<#-- 用户全局对象 -->
<#elseif editItem.getUpdateDVT() == 'SESSION'>
row['${editItem.getCodeName()?lower_case}'] = this.context['${editItem.getUpdateDV()}'];
<#-- 当前应用数据 -->
<#elseif editItem.getUpdateDVT() == 'APPDATA'>
row['${editItem.getCodeName()?lower_case}'] = this.context['${editItem.getUpdateDV()}'];
<#-- 当前操作用户(名称) -->
<#elseif editItem.getUpdateDVT() == 'OPERATORNAME'>
row['${editItem.getCodeName()?lower_case}'] = this.context['srfusername'];
<#-- 当前操作用户(编号) -->
<#elseif editItem.getUpdateDVT() == 'OPERATOR'>
row['${editItem.getCodeName()?lower_case}'] = this.context['srfuserid'];
<#-- 当前时间 -->
<#elseif editItem.getUpdateDVT() == 'CURTIME'>
row['${editItem.getCodeName()?lower_case}'] = this.$util.dateFormat(new Date());
<#else>
<#-- 默认值 -->
<#assign datatype=srfjavatype(editItem.getPSAppDEField().getStdDataType())>
row['${editItem.getCodeName()?lower_case}'] = <#if datatype=='BigInteger' || datatype=='Integer' || datatype=='Double' || datatype=='Decimal' || datatype=='Float' || datatype=='BigDecimal'>${editItem.getUpdateDV()}<#else>'${editItem.getUpdateDV()}'</#if>;
</#if>
}
</#if>
</#if>
</#list>
}
<#ibizinclude>
......
......@@ -27,6 +27,15 @@
<#if dataitem.getPSDEField()??>
prop: '${dataitem.getPSDEField().getCodeName()?lower_case}',
dataType: '${dataitem.getPSDEField().getDataType()}',
</#if>
<#if ctrl.getPSDEGridEditItems()??>
<#list ctrl.getPSDEGridEditItems() as editItem>
<#if editItem.getName() == dataitem.getName()>
<#if editItem.isEditable()>
isEditable:${editItem.isEditable()?c}
</#if>
</#if>
</#list>
</#if>
},
</#list>
......@@ -42,6 +51,15 @@
<#if dataitem.getPSDEField()??>
prop: '${dataitem.getPSDEField().getCodeName()?lower_case}',
dataType: '${dataitem.getPSDEField().getDataType()}',
</#if>
<#if ctrl.getPSDEGridEditItems()??>
<#list ctrl.getPSDEGridEditItems() as editItem>
<#if editItem.getName() == dataitem.getName()>
<#if editItem.isEditable()>
isEditable:${editItem.isEditable()?c}
</#if>
</#if>
</#list>
</#if>
},
</#list>
......@@ -88,6 +106,10 @@ ${P.getCtrlCode('searchform', 'MODEL_CONTENT.ts').code}
name:'query',
prop:'query'
},
{
name:'filter',
prop:'filter'
},
{
name:'page',
prop:'page'
......
......@@ -110,7 +110,7 @@ import ${srfclassname('${aggAppDataEntity.getCodeName()}')}Service from '@/servi
*/
@Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
......@@ -169,14 +169,14 @@ import ${srfclassname('${aggAppDataEntity.getCodeName()}')}Service from '@/servi
*/
@Errorlog
public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Data,Context,isloading);
result = _appEntityService[action](Context,Data,isloading);
}else{
result =_appEntityService.Update(Data,Context,isloading);
result =_appEntityService.Update(Context,Data,isloading);
}
result.then((response) => {
this.handleResponse(action, response);
......@@ -361,7 +361,7 @@ import ${srfclassname('${aggAppDataEntity.getCodeName()}')}Service from '@/servi
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
@Errorlog
public frontLogic(action:string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
......@@ -383,6 +383,42 @@ import ${srfclassname('${aggAppDataEntity.getCodeName()}')}Service from '@/servi
})
}
/**
* 处理请求数据(修改或增加数据)
*
* @param action 行为
* @param data 数据
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
public handleRequestDataWithUpdate(action: string,context:any ={},data: any = {},isMerge:boolean = false){
let model: any = this.getMode();
if (!model && model.getDataItems instanceof Function) {
return data;
}
let dataItems: any[] = model.getDataItems();
let requestData:any = {};
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
dataItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop && item.name ){
requestData[item.prop] = context[item.name];
}
}else{
if(item && item.isEditable && item.prop && item.name && (data[item.name] || Object.is(data[item.name],0)) ){
requestData[item.prop] = data[item.name];
}
}
});
let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
return {context:tempContext,data:requestData};
}
<#ibizinclude>
../@MACRO/SERVICE/SERVICE_BOTTOM.ts.ftl
</#ibizinclude>
\ No newline at end of file
......@@ -6,7 +6,7 @@
<div slot='<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">left<#else>top</#if>'>
<#if ctrl.isShowTitleBar()>
<div class='grid-exp-bar-header'>
<div><icon type='ios-home-outline'/><#if ctrl.getTitle() == ''>表格导航栏<#else>${ctrl.getTitle()}</#if></div>
<div><icon type='ios-home-outline'/><#if ctrl.getTitle() == ''>{{ $t('app.gridBar.title') }}<#else>${ctrl.getTitle()}</#if></div>
</div>
</#if>
<div class="container-header">
......
......@@ -76,6 +76,7 @@
</template>
<#assign import_block>
import CodeListService from "@service/app/codelist-service";
import { FormItemModel } from '@/model/form-detail';
</#assign>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
......@@ -85,15 +86,46 @@ import CodeListService from "@service/app/codelist-service";
* 代码表服务对象
*
* @type {CodeListService}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/**
* 界面UI服务对象
*
* @type {${srfclassname('${appde.getCodeName()}')}UIService}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appUIService:${srfclassname('${appde.getCodeName()}')}UIService = new ${srfclassname('${appde.getCodeName()}')}UIService(this.$store);
/**
* 界面行为模型
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ActionModel:any ={
<#if ctrl.getPSUIActions()??>
<#list ctrl.getPSUIActions() as item>
${item.getUIActionTag()}: { name: '${item.getUIActionTag()}',disabled: false, visabled: true,noprivdisplaymode:<#if item.getNoPrivDisplayMode(view)??>${item.getNoPrivDisplayMode(view)}</#if>,dataaccaction: '<#if item.getDataAccessAction()??>${item.getDataAccessAction()}</#if>', target: '${item.getActionTarget()}'}<#if item_has_next>,</#if>
</#list>
</#if>
};
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appStateEvent: Subscription | undefined;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getDatas(): any[] {
return this.selections;
......@@ -103,7 +135,7 @@ import CodeListService from "@service/app/codelist-service";
* 获取单项树
*
* @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getData(): any {
return this.selections[0];
......@@ -116,19 +148,18 @@ import CodeListService from "@service/app/codelist-service";
* 打开新建数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() protected newdata: any;
@Prop() public newdata: any;
</#if>
<#if logic.getPFLogicCodeType() == 'APP_OPENDATA'>
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() protected opendata: any;
@Prop() public opendata: any;
</#if>
</#list>
</#if>
......@@ -137,152 +168,152 @@ import CodeListService from "@service/app/codelist-service";
* 显示处理提示
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop({ default: true }) protected showBusyIndicator?: boolean;
@Prop({ default: true }) public showBusyIndicator?: boolean;
/**
* 部件行为--update
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() protected updateAction!: string;
@Prop() public updateAction!: string;
/**
* 部件行为--fetch
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() protected fetchAction!: string;
@Prop() public fetchAction!: string;
/**
* 部件行为--remove
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() protected removeAction!: string;
@Prop() public removeAction!: string;
/**
* 部件行为--load
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() protected loadAction!: string;
@Prop() public loadAction!: string;
/**
* 部件行为--loaddraft
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() protected loaddraftAction!: string;
@Prop() public loaddraftAction!: string;
/**
* 部件行为--create
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() protected createAction!: string;
@Prop() public createAction!: string;
/**
* 当前页
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected curPage: number = 1;
public curPage: number = 1;
/**
* 数据
*
* @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected items: any[] = [];
public items: any[] = [];
/**
* 是否支持分页
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected isEnablePagingBar: boolean = ${ctrl.isEnablePagingBar()?c};
public isEnablePagingBar: boolean = ${ctrl.isEnablePagingBar()?c};
/**
* 是否禁用排序
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected isNoSort: boolean = ${ctrl.isNoSort()?c};
public isNoSort: boolean = ${ctrl.isNoSort()?c};
/**
* 排序方向
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected minorSortDir: string = '<#if ctrl.getMinorSortDir()??>${ctrl.getMinorSortDir()}</#if>';
public minorSortDir: string = '<#if ctrl.getMinorSortDir()??>${ctrl.getMinorSortDir()}</#if>';
/**
* 排序字段
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected minorSortPSDEF: string = '<#if ctrl.getMinorSortPSDEF()??>${ctrl.getMinorSortPSDEF().getCodeName()?lower_case}</#if>';
public minorSortPSDEF: string = '<#if ctrl.getMinorSortPSDEF()??>${ctrl.getMinorSortPSDEF().getCodeName()?lower_case}</#if>';
/**
* 分页条数
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected limit: number = ${ctrl.getPagingSize()?c};
public limit: number = ${ctrl.getPagingSize()?c};
/**
* 是否显示标题
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected isHideHeader: boolean = ${ctrl.isHideHeader()?c};
public isHideHeader: boolean = ${ctrl.isHideHeader()?c};
/**
* 是否默认选中第一条数据
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop({ default: false }) protected isSelectFirstDefault!: boolean;
@Prop({ default: false }) public isSelectFirstDefault!: boolean;
/**
* 是否单选
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() protected isSingleSelect?: boolean;
@Prop() public isSingleSelect?: boolean;
/**
* 选中数据字符串
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() protected selectedData?: string;
@Prop() public selectedData?: string;
/**
* 选中值变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof MainTree
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Watch('selectedData')
public onValueChange(newVal: any, oldVal: any) {
......@@ -310,33 +341,40 @@ import CodeListService from "@service/app/codelist-service";
* 2 双击激活
*
* @type {(number | 0 | 1 | 2)}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop({default: 2}) protected gridRowActiveMode!: number;
@Prop({default: 2}) public gridRowActiveMode!: number;
/**
* 是否开启行编辑
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop({default: false}) protected isOpenEdit!: boolean;
@Prop({default: false}) public isOpenEdit!: boolean;
/**
* 实际是否开启行编辑
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected actualIsOpenEdit: boolean = this.isOpenEdit;
public actualIsOpenEdit: boolean = this.isOpenEdit;
/**
* 总条数
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public totalrow: number = 0;
/**
* 表格更新默认值项
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected totalrow: number = 0;
public defaultUpdateItems:Array<any> =[<#list ctrl.getPSDEGridEditItems() as editItem><#if editItem.getUpdateDV?? && editItem.getUpdateDV()?? && !(editItem.getUpdateDV() == '')>'${editItem.getCodeName()?lower_case}'</#if><#if editItem_has_next>,</#if></#list>];
/**
* 选中行数据
......@@ -344,7 +382,7 @@ import CodeListService from "@service/app/codelist-service";
* @type {any[]}
* @memberof Main
*/
protected selections: any[] = [];
public selections: any[] = [];
/**
* 拦截行选中
......@@ -352,41 +390,51 @@ import CodeListService from "@service/app/codelist-service";
* @type {boolean}
* @memberof Main
*/
protected stopRowClick: boolean = false;
public stopRowClick: boolean = false;
<#if ctrl.getAggMode() == "ALL">
/**
* 表格聚合行为
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected aggAction:string ='<#if ctrl.getAggPSDEAction()??>${ctrl.getAggPSDEAction().getCodeName()}</#if>';
public aggAction:string ='<#if ctrl.getAggPSDEAction()??>${ctrl.getAggPSDEAction().getCodeName()}</#if>';
/**
* 远程数据
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected remoteData:any = {};
public remoteData:any = {};
</#if>
<#if ctrl.getQuickPSDEToolbar?? && ctrl.getQuickPSDEToolbar()??>
<#assign quickToolbar = ctrl.getQuickPSDEToolbar()/>
${P.getCtrlCode(quickToolbar, 'CONTROL.vue').code}
</#if>
<#if ctrl.getBatchPSDEToolbar?? && ctrl.getBatchPSDEToolbar()??>
<#assign batchToolbar = ctrl.getBatchPSDEToolbar()/>
${P.getCtrlCode(batchToolbar, 'CONTROL.vue').code}
</#if>
/**
* 表格是否显示
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected isDisplay:boolean = <#if ctrl.getAggMode() == "ALL">false<#else>true</#if>;
public isDisplay:boolean = <#if ctrl.getAggMode() == "ALL">false<#else>true</#if>;
/**
* 部件刷新
*
* @param {any[]} args
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected refresh(args: any[]): void {
public refresh(args: any[]): void {
this.load();
}
......@@ -404,41 +452,84 @@ import CodeListService from "@service/app/codelist-service";
* @type {boolean}
* @memberof AppEmbedPicker
*/
protected isDragendCol: boolean = <#if app.getPSApplicationUI()??>${app.getPSApplicationUI().getPFStyleParam('EL-TABLE.ISDRAGENDCOL',false)?c}<#else>false</#if>;
public isDragendCol: boolean = <#if app.getPSApplicationUI()??>${app.getPSApplicationUI().getPFStyleParam('EL-TABLE.ISDRAGENDCOL',false)?c}<#else>false</#if>;
<#-- public isDragendCol: boolean = true; -->
/**
* 所有列成员
*
* @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected allColumns: any[] = [
<#if ctrl.getAllPSDEGridColumns()??>
public allColumns: any[] = [
<#if ctrl.getAllPSDEGridColumns()??>
<#list ctrl.getAllPSDEGridColumns() as column>
{
name: '${column.getName()?lower_case}',
label: '${column.getCaption()}',
langtag: '<#if langbase??>${langbase}.columns.${column.getName()?lower_case}</#if>',
show: <#if column.isHideDefault()>false<#else>true</#if>,
util: '${column.getWidthUnit()}'
util: '${column.getWidthUnit()}',
<#-- BEGIN:是否支持行编辑 -->
<#if ctrl.isEnableRowEdit() && column.isEnableRowEdit()>
isEnableRowEdit: true,
<#else>
isEnableRowEdit: false,
</#if>
<#-- END:是否支持行编辑 -->
},
</#list>
</#if>
</#if>
]
/**
* 表格模型集合
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public gridItemsModel: any[] = [];
/**
* 获取界面行为权限状态
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getActionState(data:any){
let targetData:any = this.transformData(data);
let tempActionModel:any = JSON.parse(JSON.stringify(this.ActionModel));
ViewTool.calcActionItemAuthState(targetData,tempActionModel,this.appUIService);
return tempActionModel;
}
/**
* 获取表格行模型
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getGridRowModel(){
return {
<#list ctrl.getPSDEGridEditItems() as edititem>
${edititem.getName()}: new FormItemModel(),
</#list>
}
}
/**
* 属性值规则
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected rules: any = {
public rules: any = {
<#list ctrl.getPSDEGridEditItems() as edititem>
${edititem.getName()}: [
{ required: <#if edititem.isAllowEmpty()>false<#else>true</#if>, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: <#if edititem.getCaption?? && edititem.getCaption()??>'${edititem.getCaption()} 值不能为空'<#else>'值不能为空'</#if>, trigger: 'change' },
{ required: <#if edititem.isAllowEmpty()>false<#else>true</#if>, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: <#if edititem.getCaption?? && edititem.getCaption()??>'${edititem.getCaption()} 值不能为空'<#else>'值不能为空'</#if>, trigger: 'blur' },
<#if ctrl.getPSGEIDEFValueRules?? && ctrl.getPSGEIDEFValueRules()??>
<#list ctrl.getPSGEIDEFValueRules() as fideValueRule>
<#if ctrl.getPSDEGridEditItemVRs?? && ctrl.getPSDEGridEditItemVRs()??>
<#list ctrl.getPSDEGridEditItemVRs() as fideValueRule>
<#if fideValueRule.getPSDEGridEditItemName() == edititem.getName()>
<#if fideValueRule.getPSSysValueRule()??>
<#assign valueRule = fideValueRule.getPSSysValueRule()/>
<#if valueRule.getRuleType?? && valueRule.getRuleType()??>
......@@ -449,21 +540,66 @@ import CodeListService from "@service/app/codelist-service";
</#if>
</#if>
</#if>
</#if>
</#list>
</#if>
],
</#list>
}
/**
* 表格行编辑项校验
*
* @param {string} property 属性名
* @param {*} data 行数据
* @param {number} rowIndex 行索引
* @returns Promise<any>
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public validate(property:string, data:any, rowIndex:number):Promise<any>{
return new Promise((resolve, reject) => {
this.$util.validateItem(property,data,this.rules).then(()=>{
this.gridItemsModel[rowIndex][property].setError(null);
resolve(true);
}).catch(({ errors, fields }) => {
this.gridItemsModel[rowIndex][property].setError(errors[0].message);
resolve(false);
});
});
}
/**
* 校验所有修改过的编辑项
*
* @returns Promise<any>
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public async validateAll(){
let validateState = true;
let index = -1;
for(let item of this.items){
index++;
if(item.rowDataState === "create" || item.rowDataState === "update"){
for(let property of Object.keys(this.rules)){
if(!await this.validate(property,item,index)){
validateState = false;
}
}
}
}
return validateState;
}
/**
* 表格数据加载
*
* @param {*} [arg={}]
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected load(opt: any = {}, pageReset: boolean = false): void {
public load(opt: any = {}, pageReset: boolean = false): void {
if(!this.fetchAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格fetchAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}'+(this.$t('app.gridpage.notConfig.fetchAction') as string) });
return;
}
if(pageReset){
......@@ -483,20 +619,27 @@ import CodeListService from "@service/app/codelist-service";
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
Object.assign(arg,{viewparams:this.viewparams});
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}
return;
}
const data: any = response.data;
this.totalrow = response.total;
this.items = JSON.parse(JSON.stringify(data));
// 清空selections
// 清空selections,gridItemsModel
this.selections = [];
this.gridItemsModel = [];
this.items.forEach(()=>{this.gridItemsModel.push(this.getGridRowModel())});
this.items.forEach((item:any)=>{
Object.assign(item,this.getActionState(item));
});
this.$emit('load', this.items);
// 设置默认选中
let _this = this;
......@@ -526,7 +669,7 @@ import CodeListService from "@service/app/codelist-service";
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
});
}
......@@ -535,19 +678,20 @@ import CodeListService from "@service/app/codelist-service";
*
* @param {any[]} datas
* @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected async remove(datas: any[]): Promise<any> {
public async remove(datas: any[]): Promise<any> {
if(!this.removeAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格removeAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}'+(this.$t('app.gridpage.notConfig.removeAction') as string) });
return;
}
let _datas:any[] = [];
datas.forEach((record: any, index: number) => {
if (!record.srfkey) {
if (Object.is(record.srfuf,"0")) {
this.items.some((val: any, num: number) =>{
if(JSON.stringify(val) == JSON.stringify(record)){
this.items.splice(num,1);
this.gridItemsModel.splice(num,1);
return true;
}
});
......@@ -572,9 +716,9 @@ import CodeListService from "@service/app/codelist-service";
});
if (_datas.length < 5) {
dataInfo = dataInfo + ' 共' + _datas.length + '条数据';
dataInfo = dataInfo + ' '+(this.$t('app.gridpage.totle') as string) + _datas.length + (this.$t('app.gridpage.records') as string)+(this.$t('app.gridpage.data') as string);
} else {
dataInfo = dataInfo + '...' + ' 共' + _datas.length + '条数据';
dataInfo = dataInfo + '...' + ' '+(this.$t('app.gridpage.totle') as string) + _datas.length + (this.$t('app.gridpage.desc2') as string);
}
const removeData = () => {
......@@ -589,10 +733,10 @@ import CodeListService from "@service/app/codelist-service";
return new Promise((resolve: any, reject: any) => {
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '', desc: '删除数据失败,' + response.info });
this.$Notice.error({ title: '', desc: (this.$t('app.gridpage.delDataFail') as string)+',' + response.info });
return;
} else {
this.$Notice.success({ title: '', desc: '删除成功!' });
this.$Notice.success({ title: '', desc: (this.$t('app.gridpage.delSuccess') as string) });
}
//删除items中已删除的项
console.log(this.items);
......@@ -600,6 +744,7 @@ import CodeListService from "@service/app/codelist-service";
this.items.some((item:any,index:number)=>{
if(Object.is(item.srfkey,data.srfkey)){
this.items.splice(index,1);
this.gridItemsModel.splice(index,1);
return true;
}
});
......@@ -613,7 +758,7 @@ import CodeListService from "@service/app/codelist-service";
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
reject(response);
return;
}
......@@ -624,8 +769,8 @@ import CodeListService from "@service/app/codelist-service";
dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, '');
this.$Modal.confirm({
title: '警告',
content: '确认要删除 ' + dataInfo + ',删除操作将不可恢复?',
title: (this.$t('app.commonWords.warning') as string),
content: (this.$t('app.gridpage.confirmDel') as string)+' ' + dataInfo + ','+(this.$t('app.gridpage.notRecoverable') as string),
onOk: () => {
removeData();
},
......@@ -639,17 +784,17 @@ import CodeListService from "@service/app/codelist-service";
* 批量添加
*
* @param {*} [arg={}]
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected addBatch(arg: any = {}): void {
public addBatch(arg: any = {}): void {
if(!this.fetchAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格fetchAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}'+(this.$t('app.gridpage.notConfig.fetchAction') as string) });
return;
}
if(!arg){
arg = {};
}
console.error("批量添加未实现");
console.error((this.$t('app.gridpage.notBatch') as string));
<#-- const post: Promise<any> = this.$http.post(this.fetchAction, arg, this.showBusyIndicator);
post.then((response: any) => {
if (response.ret !== 200) {
......@@ -670,7 +815,7 @@ import CodeListService from "@service/app/codelist-service";
* 数据导入
*
* @param {*} data
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public importExcel(data:any ={}):void{
//导入excel
......@@ -690,12 +835,12 @@ import CodeListService from "@service/app/codelist-service";
</#if>
}
if(Object.keys(importDataModel).length == 0){
this.$Notice.warning({ title: '警告', desc: '请配置数据导入项' });
this.$Notice.warning({ 'title': (this.$t("app.utilview.warning") as string), 'desc': (this.$t("app.utilview.info") as string) });
return;
}
const view:any ={
viewname: 'app-data-upload',
title: '导入数据',
title: this.$t("app.utilview.importview"),
width: 900,
height: 700
}
......@@ -714,9 +859,9 @@ import CodeListService from "@service/app/codelist-service";
* 所有导出列成员
*
* @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected allExportColumns: any[] = [
public allExportColumns: any[] = [
<#if ctrl.getPSDEDataExport().getPSDEDataExportItems()??>
<#list ctrl.getPSDEDataExport().getPSDEDataExportItems() as column>
{
......@@ -735,9 +880,9 @@ import CodeListService from "@service/app/codelist-service";
* 数据导出
*
* @param {*} data
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected exportExcel(data: any = {}): void {
public exportExcel(data: any = {}): void {
// 导出Excel
const doExport = async (_data:any) => {
const tHeader: Array<any> = [];
......@@ -755,7 +900,7 @@ import CodeListService from "@service/app/codelist-service";
excel.export_json_to_excel({
header: tHeader, //表头 必填
data, //具体数据 必填
filename: "${ctrl.getPSAppDataEntity().getLogicName()}表", //非必填
filename: "${ctrl.getPSAppDataEntity().getLogicName()}"+(this.$t('app.gridpage.grid') as string), //非必填
autoWidth: true, //非必填
bookType: "xlsx" //非必填
});
......@@ -795,7 +940,7 @@ import CodeListService from "@service/app/codelist-service";
</#if>
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '', desc: '数据导出失败,' + response.info });
this.$Notice.error({ title: '', desc: (this.$t('app.gridpage.exportFail') as string)+',' + response.info });
return;
}
try {
......@@ -807,7 +952,7 @@ import CodeListService from "@service/app/codelist-service";
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '', desc: '数据导出失败' });
this.$Notice.error({ title: '', desc: (this.$t('app.gridpage.exportFail') as string) });
});
}
......@@ -818,7 +963,7 @@ import CodeListService from "@service/app/codelist-service";
* @param {*} filterVal
* @param {*} jsonData
* @returns {[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public async formatExcelData(filterVal:any, jsonData:any) {
let codelistColumns:Array<any> = [
......@@ -843,11 +988,11 @@ import CodeListService from "@service/app/codelist-service";
<#elseif codelist.getOrMode() == 'NUM'>
renderMode: 'number',
textSeparator: '${codelist.textSeparator}',
valueSeparator: ';',
valueSeparator: ',',
<#else>
renderMode: 'other',
textSeparator: '、',
valueSeparator: ';',
valueSeparator: ',',
</#if>
},
</#if>
......@@ -874,16 +1019,17 @@ import CodeListService from "@service/app/codelist-service";
return jsonData.map((v:any) => filterVal.map((j:any) => v[j]))
}
/**
* 解析代码表和vlaue,设置items
*
* @private
* @public
* @param {any[]} items 代码表数据
* @param {*} value
* @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
private getCodelistValue(items: any[], value: any, codelist: any,){
public getCodelistValue(items: any[], value: any, codelist: any,){
if(!value){
return this.$t('codelist.'+codelist.srfkey+'.empty');
}
......@@ -930,13 +1076,13 @@ import CodeListService from "@service/app/codelist-service";
/**
* 获取代码项
*
* @private
* @public
* @param {any[]} items
* @param {*} value
* @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
private getItem(items: any[], value: any, codelist: any): any {
public getItem(items: any[], value: any, codelist: any): any {
const arr: Array<any> = items.filter(item => {return item.value == value});
if (arr.length !== 1) {
return undefined;
......@@ -951,18 +1097,18 @@ import CodeListService from "@service/app/codelist-service";
/**
* 生命周期
*
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected created(): void {
public created(): void {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected afterCreated(){
public afterCreated(){
this.setColState();
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
......@@ -980,26 +1126,39 @@ import CodeListService from "@service/app/codelist-service";
}
});
}
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]);
}
})
}
}
/**
* vue 生命周期
*
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected destroyed() {
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected afterDestroy() {
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
if(this.appStateEvent){
this.appStateEvent.unsubscribe();
}
<#if destroyed_block??>
${destroyed_block}
</#if>
......@@ -1009,9 +1168,9 @@ import CodeListService from "@service/app/codelist-service";
* 获取选中行胡数据
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected getSelection(): any[] {
public getSelection(): any[] {
return this.selections;
}
......@@ -1020,9 +1179,9 @@ import CodeListService from "@service/app/codelist-service";
*
* @param {*} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected rowDBLClick($event: any): void {
public rowDBLClick($event: any): void {
if (!$event || this.actualIsOpenEdit || Object.is(this.gridRowActiveMode,0)) {
return;
}
......@@ -1044,9 +1203,9 @@ import CodeListService from "@service/app/codelist-service";
*
* @param {*} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected select($event: any): void {
public select($event: any): void {
if (!$event) {
return;
}
......@@ -1059,9 +1218,9 @@ import CodeListService from "@service/app/codelist-service";
* 复选框数据全部选中
*
* @param {*} $event
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected selectAll($event: any): void {
public selectAll($event: any): void {
if (!$event) {
return;
}
......@@ -1076,9 +1235,9 @@ import CodeListService from "@service/app/codelist-service";
*
* @param {*} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected rowClick($event: any, ifAlways: boolean = false): void {
public rowClick($event: any, ifAlways: boolean = false): void {
if (!ifAlways && (!$event || this.actualIsOpenEdit)) {
return;
}
......@@ -1091,7 +1250,7 @@ import CodeListService from "@service/app/codelist-service";
}
// 已选中则删除,没选中则添加
let selectIndex = this.selections.findIndex((item:any)=>{
return Object.is(item.${ctrl.getPSDataEntity().getName()?lower_case},$event.${ctrl.getPSDataEntity().getName()?lower_case});
return Object.is(item.${ctrl.getPSAppDataEntity().getName()?lower_case},$event.${ctrl.getPSAppDataEntity().getName()?lower_case});
});
if (Object.is(selectIndex,-1)){
this.selections.push(JSON.parse(JSON.stringify($event)));
......@@ -1118,9 +1277,9 @@ import CodeListService from "@service/app/codelist-service";
*
* @param {*} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected pageOnChange($event: any): void {
public pageOnChange($event: any): void {
if (!$event) {
return;
}
......@@ -1136,9 +1295,9 @@ import CodeListService from "@service/app/codelist-service";
*
* @param {*} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected onPageSizeChange($event: any): void {
public onPageSizeChange($event: any): void {
if (!$event) {
return;
}
......@@ -1154,9 +1313,9 @@ import CodeListService from "@service/app/codelist-service";
/**
* 分页刷新
*
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected pageRefresh(): void {
public pageRefresh(): void {
this.load({});
}
......@@ -1164,9 +1323,9 @@ import CodeListService from "@service/app/codelist-service";
* 排序变化
*
* @param {{ column: any, prop: any, order: any }} { column, prop, order }
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected onSortChange({ column, prop, order }: { column: any, prop: any, order: any }): void {
public onSortChange({ column, prop, order }: { column: any, prop: any, order: any }): void {
const dir = Object.is(order, 'ascending') ? 'asc' : Object.is(order, 'descending') ? 'desc' : '';
if (Object.is(dir, this.minorSortDir) && Object.is(this.minorSortPSDEF, prop)) {
return;
......@@ -1181,9 +1340,9 @@ import CodeListService from "@service/app/codelist-service";
*
* @param {{ row: any, rowIndex: any }} { row, rowIndex }
* @returns {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected onRowClassName({ row, rowIndex }: { row: any, rowIndex: any }): string {
public onRowClassName({ row, rowIndex }: { row: any, rowIndex: any }): string {
const index = this.selections.findIndex((select: any) => Object.is(select.srfkey, row.srfkey));
return index !== -1 ? 'grid-row-select' : '';
}
......@@ -1193,15 +1352,15 @@ import CodeListService from "@service/app/codelist-service";
* 合计行绘制
*
* @param {any} param
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected getSummaries(param:any){
public getSummaries(param:any){
<#if ctrl.getAggMode() == "PAGE">
const { columns, data } = param;
const sums:Array<any> = [];
columns.forEach((column:any, index:number) => {
if (index === 0) {
sums[index] = '合计';
sums[index] = (this.$t('app.gridpage.sum') as string);
return;
}
if(index === (columns.length - 1)){
......@@ -1281,7 +1440,7 @@ import CodeListService from "@service/app/codelist-service";
const sums:Array<any> = [];
columns.forEach((column:any, index:number) => {
if (index === 0) {
sums[index] = '合计';
sums[index] = (this.$t('app.gridpage.sum') as string);
return;
}else if(index === (columns.length - 1)){
sums[index] = '';
......@@ -1319,13 +1478,13 @@ import CodeListService from "@service/app/codelist-service";
/**
* 远程获取合计行数据
*
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected getAggData(){
public getAggData(){
this.service.getAggData(this.aggAction,JSON.parse(JSON.stringify(this.context)),this.showBusyIndicator).then((response:any) =>{
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}
return;
}
......@@ -1337,7 +1496,7 @@ import CodeListService from "@service/app/codelist-service";
}
this.remoteData = {};
this.isDisplay = true;
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
})
}
</#if>
......@@ -1348,10 +1507,11 @@ import CodeListService from "@service/app/codelist-service";
* @param {*} row
* @param {*} tag
* @param {*} $event
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public uiAction(row: any, tag: any, $event: any) {
// this.rowClick(row, true);
$event.stopPropagation();
<#if ctrl.getPSAppViewLogics()??>
<#list ctrl.getPSAppViewLogics() as logic>
<#if logic.getPSAppViewUIAction().getPSUIAction()??>
......@@ -1367,10 +1527,10 @@ import CodeListService from "@service/app/codelist-service";
/**
* 设置列状态
*
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected setColState() {
const _data: any = localStorage.getItem('${ctrl.getPSDataEntity().getName()?lower_case}_${ctrl.getCodeName()?lower_case}_${ctrl.name}');
public setColState() {
const _data: any = localStorage.getItem('${ctrl.getPSAppDataEntity().getName()?lower_case}_${ctrl.getCodeName()?lower_case}_${ctrl.name}');
if (_data) {
let columns = JSON.parse(_data);
columns.forEach((col: any) => {
......@@ -1385,10 +1545,10 @@ import CodeListService from "@service/app/codelist-service";
/**
* 列变化
*
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected onColChange() {
localStorage.setItem('${ctrl.getPSDataEntity().getName()?lower_case}_${ctrl.getCodeName()?lower_case}_${ctrl.name}', JSON.stringify(this.allColumns));
public onColChange() {
localStorage.setItem('${ctrl.getPSAppDataEntity().getName()?lower_case}_${ctrl.getCodeName()?lower_case}_${ctrl.name}', JSON.stringify(this.allColumns));
}
/**
......@@ -1396,67 +1556,101 @@ import CodeListService from "@service/app/codelist-service";
*
* @param {string} name
* @returns {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected getColumnState(name: string): boolean {
public getColumnState(name: string): boolean {
let column = this.allColumns.find((col: any) =>
Object.is(name, col.name)
);
return column.show ? true : false;
}
/**
* 表格列是否自适应布局
*
* @readonly
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
get adaptiveState(): boolean {
return !this.allColumns.find((column: any) => column.show && Object.is(column.util, 'STAR'));
}
/**
* 保存
*
* @param {*} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected async save(args: any[], params?: any, $event?: any, xData?: any) {
public async save(args: any[], params?: any, $event?: any, xData?: any){
let _this = this;
let promises:any = [];
_this.items.forEach((item:any)=>{
if(!item.rowDataState){
return;
} else if(Object.is(item.rowDataState, 'create')){
if(!this.createAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格createAction参数未配置' });
return;
if(_this.items && _this.items.length >0){
for (const item of _this.items) {
if(Object.is(item.rowDataState, 'update')){
_this.updateDefault(item);
}
}
}
if(!await this.validateAll()){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.rulesException') as string) });
return [];
}
let successItems:any = [];
let errorItems:any = [];
let errorMessage:any = [];
for (const item of _this.items) {
try {
if(Object.is(item.rowDataState, 'create')){
if(!this.createAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}'+(this.$t('app.gridpage.notConfig.createAction') as string) });
}else{
Object.assign(item,{viewparams:this.viewparams});
promises.push(this.service.add(this.createAction, JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator));
let response = await this.service.add(this.createAction, JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator);
successItems.push(JSON.parse(JSON.stringify(response.data)));
}
}else if(Object.is(item.rowDataState, 'update')){
if(!this.updateAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格updateAction参数未配置' });
return;
}
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}'+(this.$t('app.gridpage.notConfig.updateAction') as string) });
}else{
Object.assign(item,{viewparams:this.viewparams});
<#if de??>
if(item.${appde.getCodeName()?lower_case}){
Object.assign(this.context,{${appde.getCodeName()?lower_case}:item.${appde.getCodeName()?lower_case}})
Object.assign(this.context,{${appde.getCodeName()?lower_case}:item.${appde.getCodeName()?lower_case}});
}
</#if>
promises.push(this.service.add(this.updateAction,JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator));
let response = await this.service.update(this.updateAction,JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator);
successItems.push(JSON.parse(JSON.stringify(response.data)));
}
}
} catch (error) {
errorItems.push(JSON.parse(JSON.stringify(item)));
errorMessage.push(error);
}
}
this.$emit('save', successItems);
this.refresh([]);
if(errorItems.length === 0){
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{
errorItems.forEach((item:any,index:number)=>{
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: errorMessage[index].data.message });
console.error(errorMessage[index]);
});
Promise.all(promises).then((response: any) => {
this.$emit('save', response);
}).catch((response: any) => {
this.$Notice.error({ title: '错误', desc: '系统异常' });
});
}
return successItems;
}
<#if ctrl.isEnableRowEdit()>
/**
* 新建行
*
* @param {*} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected newRow(args: any[], params?: any, $event?: any, xData?: any): void {
public newRow(args: any[], params?: any, $event?: any, xData?: any): void {
if(!this.loaddraftAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格loaddraftAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}'+(this.$t('app.gridpage.notConfig.loaddraftAction') as string) });
return;
}
let _this = this;
......@@ -1465,19 +1659,21 @@ import CodeListService from "@service/app/codelist-service";
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}
return;
}
const data = response.data;
this.createDefault(data);
data.rowDataState = "create";
_this.items.push(data);
_this.gridItemsModel.push(_this.getGridRowModel());
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
return;
}
});
......@@ -1489,7 +1685,7 @@ import CodeListService from "@service/app/codelist-service";
* @param row 行数据
* @param {{ name: string, value: any }} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onGridItemValueChange(row: any,$event: { name: string, value: any },rowIndex: number): void {
if (!$event) {
......@@ -1505,15 +1701,21 @@ import CodeListService from "@service/app/codelist-service";
/**
* 表格编辑项值变化
*
* @private
* @public
* @param row 行数据
* @param property 列编辑项名
* @param row 列编辑项值
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public gridEditItemChange(row: any, property: string, value: any, rowIndex: number){
row.rowDataState = row.rowDataState ? row.rowDataState : "update" ;
if(Object.is(row.rowDataState,"update")){
if(!value && this.defaultUpdateItems.includes(property)){
row.hasUpdated = true;
}
}
this.validate(property,row,rowIndex);
<#if ctrl.getPSDEGridEditItems()??>
<#list ctrl.getPSDEGridEditItems() as editItem>
<#if editItem.getPSDEGridEditItemUpdate()??>
......@@ -1535,9 +1737,9 @@ import CodeListService from "@service/app/codelist-service";
* @param {string[]} updateDetails 更新项
* @param {boolean} [showloading] 是否显示加载状态
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected updateGridEditItem(mode: string, data: any = {}, updateDetails: string[], showloading?: boolean): void {
public updateGridEditItem(mode: string, data: any = {}, updateDetails: string[], showloading?: boolean): void {
if (!mode || (mode && Object.is(mode, ''))) {
return;
}
......@@ -1546,7 +1748,7 @@ import CodeListService from "@service/app/codelist-service";
const post: Promise<any> = this.service.frontLogic(mode,JSON.parse(JSON.stringify(this.context)),arg, showloading);
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '表单项更新失败' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.gridpage.formitemFailed') as string) });
return;
}
const _data: any = response.data;
......@@ -1564,26 +1766,124 @@ import CodeListService from "@service/app/codelist-service";
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
return;
}
});
}
</#if>
/**
* 获取对应行class
*
* @param {*} $args row 行数据,rowIndex 行索引
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected getRowClassName(args:{row: any,rowIndex: number}){
public getRowClassName(args:{row: any,rowIndex: number}){
let isSelected = this.selections.some((item:any)=>{
return Object.is(item.${appde.getCodeName()?lower_case},args.row.${appde.getCodeName()?lower_case});
});
return isSelected ? "grid-selected-row" : "";
}
/**
* 获取对应列class
*
* @param {*} $args row 行数据,column 列数据,rowIndex 行索引,列索引
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getCellClassName(args:{row: any, column: any, rowIndex: number, columnIndex:number}){
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 'info-cell';
}
/**
* 新建默认值
* @param {*} row 行数据
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public createDefault(row: any){
<#list ctrl.getPSDEGridEditItems() as editItem><#t>
<#if editItem.getCreateDV?? && editItem.getCreateDV()??><#t>
<#if !(editItem.getCreateDV() == '') || editItem.getCreateDVT() == 'CURTIME'><#t>
if (row.hasOwnProperty('${editItem.getCodeName()?lower_case}')) {
<#-- 网页请求 -->
<#if editItem.getCreateDVT() == 'CONTEXT'>
row['${editItem.getCodeName()?lower_case}'] = this.viewparams['${editItem.getCreateDV()}'];
<#-- 用户全局对象 -->
<#elseif editItem.getCreateDVT() == 'SESSION'>
row['${editItem.getCodeName()?lower_case}'] = this.context['${editItem.getCreateDV()}'];
<#-- 当前应用数据 -->
<#elseif editItem.getCreateDVT() == 'APPDATA'>
row['${editItem.getCodeName()?lower_case}'] = this.context['${editItem.getCreateDV()}'];
<#-- 当前操作用户(名称) -->
<#elseif editItem.getCreateDVT() == 'OPERATORNAME'>
row['${editItem.getCodeName()?lower_case}'] = this.context['srfusername'];
<#-- 当前操作用户(编号) -->
<#elseif editItem.getCreateDVT() == 'OPERATOR'>
row['${editItem.getCodeName()?lower_case}'] = this.context['srfuserid'];
<#-- 当前时间 -->
<#elseif editItem.getCreateDVT() == 'CURTIME'>
row['${editItem.getCodeName()?lower_case}'] = this.$util.dateFormat(new Date());
<#else>
<#-- 默认值 -->
<#assign datatype=srfjavatype(editItem.getPSAppDEField().getStdDataType())>
row['${editItem.getCodeName()?lower_case}'] = <#if datatype=='BigInteger' || datatype=='Integer' || datatype=='Double' || datatype=='Decimal' || datatype=='Float' || datatype=='BigDecimal'>${editItem.getCreateDV()}<#else>'${editItem.getCreateDV()}'</#if>;
</#if>
}
</#if>
</#if>
</#list>
}
/**
* 更新默认值
* @param {*} row 行数据
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public updateDefault(row: any){
<#list ctrl.getPSDEGridEditItems() as editItem><#t>
<#if editItem.getUpdateDV?? && editItem.getUpdateDV()??><#t>
<#if !(editItem.getUpdateDV() == '') || editItem.getUpdateDVT() == 'CURTIME'><#t>
if (row.hasOwnProperty('${editItem.getCodeName()?lower_case}') && !row.${editItem.getCodeName()?lower_case} && !row.hasUpdated) {
<#-- 网页请求 -->
<#if editItem.getUpdateDVT() == 'CONTEXT'>
row['${editItem.getCodeName()?lower_case}'] = this.viewparams['${editItem.getUpdateDV()}'];
<#-- 用户全局对象 -->
<#elseif editItem.getUpdateDVT() == 'SESSION'>
row['${editItem.getCodeName()?lower_case}'] = this.context['${editItem.getUpdateDV()}'];
<#-- 当前应用数据 -->
<#elseif editItem.getUpdateDVT() == 'APPDATA'>
row['${editItem.getCodeName()?lower_case}'] = this.context['${editItem.getUpdateDV()}'];
<#-- 当前操作用户(名称) -->
<#elseif editItem.getUpdateDVT() == 'OPERATORNAME'>
row['${editItem.getCodeName()?lower_case}'] = this.context['srfusername'];
<#-- 当前操作用户(编号) -->
<#elseif editItem.getUpdateDVT() == 'OPERATOR'>
row['${editItem.getCodeName()?lower_case}'] = this.context['srfuserid'];
<#-- 当前时间 -->
<#elseif editItem.getUpdateDVT() == 'CURTIME'>
row['${editItem.getCodeName()?lower_case}'] = this.$util.dateFormat(new Date());
<#else>
<#-- 默认值 -->
<#assign datatype=srfjavatype(editItem.getPSAppDEField().getStdDataType())>
row['${editItem.getCodeName()?lower_case}'] = <#if datatype=='BigInteger' || datatype=='Integer' || datatype=='Double' || datatype=='Decimal' || datatype=='Float' || datatype=='BigDecimal'>${editItem.getUpdateDV()}<#else>'${editItem.getUpdateDV()}'</#if>;
</#if>
}
</#if>
</#if>
</#list>
}
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
......@@ -2,6 +2,6 @@
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<img class="logout-bg" src="/assets/img/logout_bg.png"/>
<div class="logout-container">
尊敬的客户您好,您已成功退出系统,将在 <a>{{this.countdown}}</a> 秒后跳转至<a @click="gotoLoginView">登录页</a>!
{{ $t('app.viewLayoutPanel.appLogoutView.prompt1') }} <a>{{this.countdown}}</a> {{ $t('app.viewLayoutPanel.appLogoutView.prompt2') }} <a @click="gotoLoginView">{{ $t('app.viewLayoutPanel.appLogoutView.loginpage') }}</a>!
</div>
</div>
\ No newline at end of file
<div class="${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<div>应用流程处理记录视图</div>
<div>{{$t('app.viewLayoutPanel.appWfstepTraceView.title')}}</div>
</div>
\ No newline at end of file
......@@ -5,7 +5,7 @@
../@MACRO/VIEW_CAPTION.vue.ftl
</#ibizinclude>
<div class='content-container'>
应用流程跟踪视图
{{$t('app.viewLayoutPanel.appWfstepDataView.title')}}
</div>
</card>
</div>
\ No newline at end of file
......@@ -5,18 +5,18 @@
<div class="login-title">{{$t(model.srfTitle)}}</div>
<i-form class="login-form">
<form-item>
<i-input type="text" v-model="formData.loginname" placeholder="用户名" clearable>
<i-input type="text" v-model="formData.loginname" :placeholder="$t('app.viewLayoutPanel.appLoginView.username')" clearable>
<icon type="ios-person-outline" slot="prepend"></icon>
</i-input>
</form-item>
<form-item>
<i-input type="password" v-model="formData.password" placeholder="密码" clearable>
<i-input type="password" v-model="formData.password" :placeholder="$t('app.viewLayoutPanel.appLoginView.password')" clearable>
<icon type="ios-lock-outline" slot="prepend"></icon>
</i-input>
</form-item>
</i-form>
<div class="form-submit">
<i-button @click="handleSubmit" long type="primary">登录</i-button>
<i-button @click="handleSubmit" long type="primary">{{ $t('app.viewLayoutPanel.appLoginView.login') }}</i-button>
</div>
</div>
</div>
......@@ -93,7 +93,7 @@
<#if ctrl.render??>
${ctrl.render.code}
<#else>
<div>无扩展插件</div>
<div>{{$t('app.portlet.noExtensions')}}</div>
</#if>
</div>
<#-- 操作栏 -->
......@@ -110,7 +110,7 @@
<#if ctrl.render??>
${ctrl.render.code}
<#else>
<app-actionbar :items="actionBarModelData" @itemClick="handleItemClick"></app-actionbar>
<app-actionbar :viewState="viewState" :uiService="appUIService" :items="actionBarModelData" @itemClick="handleItemClick"></app-actionbar>
</#if>
</div>
<#-- HTML -->
......@@ -208,6 +208,9 @@ import { Environment } from '@/environments/environment';
<#assign counter = uiaction.getPSAppCounter() />
counterService:this.${srfclassname('${counter.getCodeName()}')}counterservice,
<#if uiaction.getCounterId()??>counterId:"${uiaction.getCounterId()}",</#if>
noprivdisplaymode:'<#if uiaction.getNoPrivDisplayMode(view)??>${uiaction.getNoPrivDisplayMode(view)}</#if>',
dataaccaction:'<#if uiaction.getDataAccessAction()??>${uiaction.getDataAccessAction()}</#if>',
visabled:true,disabled:false
</#if>
</#if>
</#if>
......
<#if item.render??>
${item.render.code}
<#else>
<input-box
:disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1"
v-model="row[column.property]"
......@@ -7,3 +10,4 @@
<#if item.getPlaceHolder()??>placeholder="${item.getPlaceHolder()}"</#if>
@change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}">
</input-box>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<input-box
<#if item.getEnableCond??>
:disabled="data.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1"
......@@ -9,3 +12,4 @@
<#if item.getPlaceHolder()??>placeholder="${item.getPlaceHolder()}"</#if>
@change="($event)=>{panelEditItemChange(data, ${editor.getName()?lower_case}, $event)}">
</input-box>
</#if>
<app-rich-text-editor :formState="formState" :value="data.${editor.name}" @change="(val) =>{this.data.${editor.name} =val}" :disabled="detailsModel.${editor.name}.disabled" name="${editor.name}"<#if editor.getEditorHeight() gt 0> height={${editor.getEditorHeight()?c}}</#if> style="${editor.getEditorCssStyle()}"></app-rich-text-editor>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<app-rich-text-editor :formState="formState" :value="data.${editor.name}" @change="(val) =>{this.data.${editor.name} =val}" :disabled="detailsModel.${editor.name}.disabled" :data="JSON.stringify(this.data)" name="${editor.name}" :uploadparams='<#if editor.getEditorParam('uploadparams','') != ''>${editor.getEditorParam('uploadparams','')}<#else>{}</#if>' :exportparams='<#if editor.getEditorParam('exportparams','') != ''>${editor.getEditorParam('exportparams','')}<#else>{}</#if>' <#if editor.getEditorHeight() gt 0> height={${editor.getEditorHeight()?c}}</#if> style="${editor.getEditorCssStyle()}"></app-rich-text-editor>
</#if>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<app-rich-text-editor :formState="formState" :value="data.${editor.name?lower_case}" @change="(val) =>{this.data.${editor.name?lower_case} =val}" <#if item.getEnableCond??>:disabled="data.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1"</#if> name="${editor.name?lower_case}"<#if editor.getEditorHeight() gt 0> height={${editor.getEditorHeight()?c}}</#if> style="${editor.getEditorCssStyle()}"></app-rich-text-editor>
</#if>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<dropdown-list
v-model="data.${editor.name}"
:data="data"
......@@ -14,3 +17,4 @@
</#if>
placeholder=<#if item.getPlaceHolder()??>'${item.getPlaceHolder()}'<#else>'请选择...'</#if> style="${editor.getEditorCssStyle()}">
</dropdown-list>
</#if>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<dropdown-list
v-model="row[column.property]"
:disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1"
......@@ -16,3 +19,4 @@
style="${item.getEditorCssStyle()}"
@change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}">
</dropdown-list>
</#if>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<dropdown-list
v-model="data.${editor.name?lower_case}"
<#if item.getEnableCond??>
......@@ -18,3 +21,4 @@
style="${item.getEditorCssStyle()}"
@change="($event)=>{panelEditItemChange(data, '${editor.name?lower_case}', $event)}">
</dropdown-list>
</#if>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<dropdown-list
v-model="data.${editor.name}"
:data="data"
......@@ -15,3 +18,4 @@
</#if>
placeholder=<#if item.getPlaceHolder()??>'${item.getPlaceHolder()}'<#else>'请选择...'</#if>>
</dropdown-list>
</#if>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<dropdown-list
v-model="row[column.property]"
:disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1"
......@@ -16,3 +19,4 @@
placeholder=<#if item.getPlaceHolder()??>'${item.getPlaceHolder()}'<#else>'请选择...'</#if>
@change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}">
</dropdown-list>
</#if>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<dropdown-list
v-model="data.${editor.name?lower_case}"
<#if item.getEnableCond??>
......@@ -18,3 +21,4 @@
style="${item.getEditorCssStyle()}width: 100px;"
@change="($event)=>{panelEditItemChange(data, '${editor.name?lower_case}', $event)}">
</dropdown-list>
</#if>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<dropdown-list-mpicker
v-model="data.${editor.name}"
:data="data"
......@@ -6,6 +9,7 @@
:viewparams="viewparams"
:localContext =<@getNavigateContext editor />
:localParam =<@getNavigateParams editor />
:disabled="detailsModel.${editor.name}.disabled"
<#if editor.getPSCodeList()??>
<#assign codelist=editor.getPSCodeList()>
tag='${codelist.codeName}'
......@@ -16,3 +20,4 @@
</#if>
placeholder=<#if item.getPlaceHolder()??>'${item.getPlaceHolder()}'<#else>'请选择...'</#if> style="${editor.getEditorCssStyle()}">
</dropdown-list-mpicker>
</#if>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<dropdown-list-mpicker
v-model="row[column.property]"
:data="row"
......@@ -17,3 +20,4 @@
@change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}"
style="${item.getEditorCssStyle()}">
</dropdown-list-mpicker>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<dropdown-list-mpicker
v-model="data.${editor.name?lower_case}"
:data="data"
......@@ -19,3 +22,4 @@
@change="($event)=>{panelEditItemChange(data, '${editor.name?lower_case}', $event)}"
style="${item.getEditorCssStyle()}">
</dropdown-list-mpicker>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<app-code-editor :code="data.${editor.name}" :disabled="detailsModel.${editor.name}.disabled" @change="(val) =>{this.data.${editor.name} =val}" codetype="javascript" ></app-code-editor>
</#if>
\ No newline at end of file
<app-org-select :data="data" :context="JSON.parse(JSON.stringify(context))" :fillMap="<#if item.getEditorParam('fillMap','') != ''>${item.getEditorParam('fillMap','')}<#else>{'id':'${editor.getValueItemName()}','label':'${editor.name}'}</#if>" url="<#if item.getEditorParam('url','') != ''>${item.getEditorParam('url','')}</#if>" filter="<#if item.getEditorParam('filter','') != ''>${item.getEditorParam('filter','')}<#else>srforgid</#if>" :multiple="<#if item.getEditorParam('multiple','') != ''>${item.getEditorParam('multiple','')}<#else>false</#if>" style="${editor.getEditorCssStyle()}" @select-change="onFormItemValueChange"></app-org-select>
\ No newline at end of file
<app-org-select :data="data" :disabled="detailsModel.${editor.name}.disabled" :context="JSON.parse(JSON.stringify(context))" :fillMap="<#if item.getEditorParam('fillMap','') != ''>${item.getEditorParam('fillMap','')}<#else>{'id':'${editor.getValueItemName()}','label':'${editor.name}'}</#if>" url="<#if item.getEditorParam('url','') != ''>${item.getEditorParam('url','')}</#if>" filter="<#if item.getEditorParam('filter','') != ''>${item.getEditorParam('filter','')}<#else>srforgid</#if>" :multiple="<#if item.getEditorParam('multiple','') != ''>${item.getEditorParam('multiple','')}<#else>false</#if>" style="${editor.getEditorCssStyle()}" @select-change="onFormItemValueChange"></app-org-select>
<app-org-select :data="data" :context="JSON.parse(JSON.stringify(context))" :fillMap="<#if item.getEditorParam('fillMap','') != ''>${item.getEditorParam('fillMap','')}<#else>{'id':'${editor.getValueItemName()}','label':'${editor.name}'}</#if>" url="<#if item.getEditorParam('url','') != ''>${item.getEditorParam('url','')}</#if>" filter="<#if item.getEditorParam('filter','') != ''>${item.getEditorParam('filter','')}<#else>srforgid</#if>" :multiple="<#if item.getEditorParam('multiple','') != ''>${item.getEditorParam('multiple','')}<#else>false</#if>" style="${editor.getEditorCssStyle()}" @select-change="onFormItemValueChange"></app-org-select>
\ No newline at end of file
<app-org-select :data="data" :disabled="detailsModel.${editor.name}.disabled" :context="JSON.parse(JSON.stringify(context))" :fillMap="<#if item.getEditorParam('fillMap','') != ''>${item.getEditorParam('fillMap','')}<#else>{'id':'${editor.getValueItemName()}','label':'${editor.name}'}</#if>" url="<#if item.getEditorParam('url','') != ''>${item.getEditorParam('url','')}</#if>" filter="<#if item.getEditorParam('filter','') != ''>${item.getEditorParam('filter','')}<#else>srforgid</#if>" :multiple="<#if item.getEditorParam('multiple','') != ''>${item.getEditorParam('multiple','')}<#else>false</#if>" style="${editor.getEditorCssStyle()}" @select-change="onFormItemValueChange"></app-org-select>
<app-org-select :data="data" :context="JSON.parse(JSON.stringify(context))" :fillMap="<#if item.getEditorParam('fillMap','') != ''>${item.getEditorParam('fillMap','')}<#else>{'id':'${editor.getValueItemName()}','label':'${editor.name}'}</#if>" url="<#if item.getEditorParam('url','') != ''>${item.getEditorParam('url','')}</#if>" filter="<#if item.getEditorParam('filter','') != ''>${item.getEditorParam('filter','')}<#else>srforgid</#if>" :multiple="<#if item.getEditorParam('multiple','') != ''>${item.getEditorParam('multiple','')}<#else>false</#if>" style="${editor.getEditorCssStyle()}" @select-change="onFormItemValueChange"></app-org-select>
\ No newline at end of file
<app-org-select :data="data" :disabled="detailsModel.${editor.name}.disabled" :context="JSON.parse(JSON.stringify(context))" :fillMap="<#if item.getEditorParam('fillMap','') != ''>${item.getEditorParam('fillMap','')}<#else>{'id':'${editor.getValueItemName()}','label':'${editor.name}'}</#if>" url="<#if item.getEditorParam('url','') != ''>${item.getEditorParam('url','')}</#if>" filter="<#if item.getEditorParam('filter','') != ''>${item.getEditorParam('filter','')}<#else>srforgid</#if>" :multiple="<#if item.getEditorParam('multiple','') != ''>${item.getEditorParam('multiple','')}<#else>false</#if>" style="${editor.getEditorCssStyle()}" @select-change="onFormItemValueChange"></app-org-select>
<app-org-select :data="data" :context="JSON.parse(JSON.stringify(context))" :fillMap="<#if item.getEditorParam('fillMap','') != ''>${item.getEditorParam('fillMap','')}<#else>{'id':'${editor.getValueItemName()}','label':'${editor.name}'}</#if>" url="<#if item.getEditorParam('url','') != ''>${item.getEditorParam('url','')}</#if>" filter="<#if item.getEditorParam('filter','') != ''>${item.getEditorParam('filter','')}<#else>srforgid</#if>" :multiple="<#if item.getEditorParam('multiple','') != ''>${item.getEditorParam('multiple','')}<#else>false</#if>" style="${editor.getEditorCssStyle()}" @select-change="onFormItemValueChange"></app-org-select>
\ No newline at end of file
<app-org-select :data="data" :disabled="detailsModel.${editor.name}.disabled" :context="JSON.parse(JSON.stringify(context))" :fillMap="<#if item.getEditorParam('fillMap','') != ''>${item.getEditorParam('fillMap','')}<#else>{'id':'${editor.getValueItemName()}','label':'${editor.name}'}</#if>" url="<#if item.getEditorParam('url','') != ''>${item.getEditorParam('url','')}</#if>" filter="<#if item.getEditorParam('filter','') != ''>${item.getEditorParam('filter','')}<#else>srforgid</#if>" :multiple="<#if item.getEditorParam('multiple','') != ''>${item.getEditorParam('multiple','')}<#else>false</#if>" style="${editor.getEditorCssStyle()}" @select-change="onFormItemValueChange"></app-org-select>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<app-radio-group
v-model="data.${editor.name}"
:data="data"
......@@ -15,3 +18,4 @@
</#if>
style="${editor.getEditorCssStyle()}">
</app-radio-group>
</#if>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<app-radio-group
v-model="row[column.property]"
:disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1"
......@@ -16,3 +19,4 @@
</#if>
style="${item.getEditorCssStyle()}">
</app-radio-group>
</#if>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<app-radio-group
v-model="data.${editor.name?lower_case}"
<#if item.getEnableCond??>
......@@ -18,3 +21,4 @@
</#if>
style="${item.getEditorCssStyle()}">
</app-radio-group>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<app-image-upload :multiple="true" :formState="formState" :ignorefieldvaluechange="ignorefieldvaluechange" @formitemvaluechange="onFormItemValueChange" :data="JSON.stringify(this.data)" name='${editor.name}' :value="data.${editor.name}" :disabled="detailsModel.${editor.name}.disabled" :uploadparams='<#if editor.getEditorParam('uploadparams','') != ''>${editor.getEditorParam('uploadparams','')}<#else>{}</#if>' :exportparams='<#if editor.getEditorParam('exportparams','') != ''>${editor.getEditorParam('exportparams','')}<#else>{}</#if>' style="${editor.getEditorCssStyle()}overflow: auto;"></app-image-upload>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<app-file-upload
:formState="viewState"
:ignorefieldvaluechange="false"
......@@ -11,3 +14,4 @@
:uploadparams='<#if editor.getEditorParam('uploadparams','') != ''>${editor.getEditorParam('uploadparams','')}<#else>{}</#if>' :exportparams='<#if editor.getEditorParam('exportparams','') != ''>${editor.getEditorParam('exportparams','')}<#else>{}</#if>'
style="${editor.getEditorCssStyle()}overflow: auto;">
</app-file-upload>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<app-file-upload
:formState="viewState"
:ignorefieldvaluechange="false"
......@@ -14,3 +17,4 @@
:exportparams='<#if editor.getEditorParam('exportparams','') != ''>${editor.getEditorParam('exportparams','')}<#else>{}</#if>'
style="${editor.getEditorCssStyle()}overflow: auto;">
</app-file-upload>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<app-image-upload :multiple="false" :formState="formState" :ignorefieldvaluechange="ignorefieldvaluechange" @formitemvaluechange="onFormItemValueChange" :data="JSON.stringify(this.data)" name='${editor.name}' :value="data.${editor.name}" :disabled="detailsModel.${editor.name}.disabled" :uploadparams='<#if editor.getEditorParam('uploadparams','') != ''>${editor.getEditorParam('uploadparams','')}<#else>{}</#if>' :exportparams='<#if editor.getEditorParam('exportparams','') != ''>${editor.getEditorParam('exportparams','')}<#else>{}</#if>' ></app-image-upload>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<app-file-upload
:formState="viewState"
:ignorefieldvaluechange="false"
......@@ -11,3 +14,4 @@
:uploadparams='<#if editor.getEditorParam('uploadparams','') != ''>${editor.getEditorParam('uploadparams','')}<#else>{}</#if>' :exportparams='<#if editor.getEditorParam('exportparams','') != ''>${editor.getEditorParam('exportparams','')}<#else>{}</#if>'
style="${editor.getEditorCssStyle()}overflow: auto;">
</app-file-upload>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<app-file-upload
:formState="viewState"
:ignorefieldvaluechange="false"
......@@ -13,3 +16,4 @@
:uploadparams='<#if editor.getEditorParam('uploadparams','') != ''>${editor.getEditorParam('uploadparams','')}<#else>{}</#if>' :exportparams='<#if editor.getEditorParam('exportparams','') != ''>${editor.getEditorParam('exportparams','')}<#else>{}</#if>'
style="${editor.getEditorCssStyle()}overflow: auto;">
</app-file-upload>
</#if>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if editor.getPickupPSAppView()??>
<app-mpicker
:activeData="data"
......@@ -21,3 +24,4 @@
style="${editor.getEditorCssStyle()}">
</app-mpicker>
</#if>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if editor.getPickupPSAppView()??>
<app-mpicker
:activeData="row"
......@@ -21,3 +24,4 @@
style="${editor.getEditorCssStyle()}">
</app-mpicker>
</#if>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if editor.getPickupPSAppView()??>
<app-mpicker
:activeData="data"
......@@ -21,3 +24,4 @@
style="${editor.getEditorCssStyle()}">
</app-mpicker>
</#if>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if editor.getPickupPSAppView()??>
<app-mpicker
:activeData="row"
......@@ -21,3 +24,4 @@
style="${editor.getEditorCssStyle()}">
</app-mpicker>
</#if>
</#if>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<input-box v-model="data.${editor.name}" :disabled="detailsModel.${editor.name}.disabled" type='textarea' style="${editor.getEditorCssStyle()}" <#if item.getPlaceHolder()??> placeholder="${item.getPlaceHolder()}"</#if>></input-box>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<div class="ivu-input-wrapper ivu-input-wrapper-default ivu-input-type">
<textarea class="ivu-input" :disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1" v-model="row[column.property]" style="${item.getEditorCssStyle()}" <#if item.getPlaceHolder()??> placeholder="${item.getPlaceHolder()}"</#if> @change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}"></textarea>
</div>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<div class="ivu-input-wrapper ivu-input-wrapper-default ivu-input-type">
<textarea
class="ivu-input"
......@@ -12,3 +15,4 @@
@change="($event)=>{panelEditItemChange(data, '${editor.name?lower_case}', $event)}">
</textarea>
</div>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<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>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<div class="ivu-input-wrapper ivu-input-wrapper-default ivu-input-type">
<textarea class="ivu-input" rows="10" :disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1" v-model="row[column.property]" style="${item.getEditorCssStyle()}" <#if item.getPlaceHolder()??> placeholder="${item.getPlaceHolder()}"</#if> @change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}"></textarea>
</div>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<div class="ivu-input-wrapper ivu-input-wrapper-default ivu-input-type">
<textarea
class="ivu-input"
......@@ -13,3 +16,4 @@
@change="($event)=>{panelEditItemChange(data, '${editor.name?lower_case}', $event)}">
</textarea>
</div>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<i-input type="password" v-model="data.${editor.name}" :disabled="detailsModel.${editor.name}.disabled" style="${editor.getEditorCssStyle()}"></i-input>
</#if>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<input-box type="password" :disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1" v-model="row[column.property]" style="${item.getEditorCssStyle()}" @change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}"></input-box>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<input-box
type="password"
<#if item.getEnableCond??>
......@@ -7,3 +10,4 @@
style="${item.getEditorCssStyle()}"
@change="($event)=>{panelEditItemChange(data, '${editor.name?lower_case}', $event)}">
</input-box>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<app-switch 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>
</#if>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<app-switch name='${editor.name}' :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>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<app-switch
name='${editor.name?lower_case}'
:value="data.${editor.name?lower_case}"
......@@ -7,3 +10,4 @@
</#if>
style="${item.getEditorCssStyle()}">
</app-switch>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<input-box
v-model="data.${editor.name}"
@enter="onEnter($event)"
<#if editor.getUnitName?? && editor.getUnitName()??>unit="${editor.getUnitName()}"</#if>
:disabled="detailsModel.${editor.name}.disabled"
type='number'
<#if item.getPSAppDEField().getPSDEField().getPrecision??>
<#if item.getPSAppDEField()?? && item.getPSAppDEField().getPSDEField()?? && item.getPSAppDEField().getPSDEField().getPrecision??>
<#if item.getPSAppDEField().getPSDEField().getDataType() == 'FLOAT' && item.getPSAppDEField().getPSDEField().getPrecision() == 0>
:precision="2"
<#else>
......@@ -14,3 +17,4 @@
<#if editor.getPlaceHolder()??>placeholder="${editor.getPlaceHolder()}"</#if>
style="${editor.getEditorCssStyle()}">
</input-box>
</#if>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<input-box
:disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1"
v-model="row[column.property]"
......@@ -5,7 +8,7 @@
unit="${item.getUnitName()}"
</#if>
type="number"
<#if item.getPSAppDEField().getPSDEField().getPrecision??>
<#if item.getPSAppDEField()?? && item.getPSAppDEField().getPSDEField()?? && item.getPSAppDEField().getPSDEField().getPrecision??>
<#if item.getPSAppDEField().getPSDEField().getDataType() == 'FLOAT' && item.getPSAppDEField().getPSDEField().getPrecision() == 0>
:precision="2"
<#else>
......@@ -18,3 +21,4 @@
</#if>
@change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}">
</input-box>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<input-box
type="number"
<#if item.getEnableCond??>
:disabled="data.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1"
</#if>
<#if item.getUnitName()??>unit="${item.getUnitName()}"</#if>
<#if item.getUnitName?? && item.getUnitName()??>unit="${item.getUnitName()}"</#if>
:precision="2"
v-model="data.${editor.name?lower_case}"
style="${item.getEditorCssStyle()}"
<#if item.getPlaceHolder()??>placeholder="${item.getPlaceHolder()}"</#if>
@change="($event)=>{panelEditItemChange(data, '${editor.name?lower_case}', $event)}">
</input-box>
</#if>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if editor.getEditorParam("PICKUPVIEW",true)??>
<#if editor.getPickupPSAppView()??>
<app-picker
......@@ -26,3 +29,4 @@
</app-picker>
</#if>
</#if>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if editor.getEditorParam("PICKUPVIEW",true)??>
<#if editor.getPickupPSAppView()??>
<app-picker
......@@ -26,3 +29,4 @@
</app-picker>
</#if>
</#if>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if editor.getEditorParam("PICKUPVIEW",true)??>
<#if editor.getPickupPSAppView()??>
<app-picker
......@@ -26,3 +29,4 @@
</app-picker>
</#if>
</#if>
</#if>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if editor.getEditorParam("PICKUPVIEW",true)??>
<#if editor.getPickupPSAppView()??>
<app-picker-select-view
......@@ -24,3 +27,4 @@
</app-picker-select-view>
</#if>
</#if>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if editor.getEditorParam("PICKUPVIEW",true)??>
<#if editor.getPickupPSAppView()??>
<app-picker-select-view
......@@ -24,3 +27,4 @@
</app-picker-select-view>
</#if>
</#if>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if editor.getEditorParam("PICKUPVIEW",true)??>
<#if editor.getPickupPSAppView()??>
<app-picker-select-view
......@@ -26,3 +29,4 @@
</app-picker-select-view>
</#if>
</#if>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if editor.getEditorParam("PICKUPVIEW",true)??>
<#if editor.getPickupPSAppView()??>
<app-picker-select-view
......@@ -26,3 +29,4 @@
</app-picker-select-view>
</#if>
</#if>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<app-picker
:formState="formState"
:data="data"
......@@ -21,3 +24,4 @@
@formitemvaluechange="onFormItemValueChange">
<@getItemRender editor />
</app-picker>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<app-picker
:formState="viewState"
:data="row"
......@@ -21,3 +24,4 @@
@formitemvaluechange="($event)=>{onGridItemValueChange(row,$event,$index)}">
<@getItemRender editor />
</app-picker>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if item.getRefPickupPSAppView()??>
<#assign pickupview = item.getRefPickupPSAppView()>
<app-embed-picker
......@@ -26,3 +29,4 @@
style="${editor.getEditorCssStyle()}">
</app-embed-picker>
</#if>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if item.getRefPickupPSAppView()??>
<#assign pickupview = item.getRefPickupPSAppView()>
<app-embed-picker
......@@ -26,3 +29,4 @@
style="${editor.getEditorCssStyle()}">
</app-embed-picker>
</#if>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if editor.getEditorParam("PICKUPVIEW",true)??>
<#if editor.getPickupPSAppView()??>
<app-picker
......@@ -27,3 +30,4 @@
</app-picker>
</#if>
</#if>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if editor.getEditorParam("PICKUPVIEW",true)??>
<#if editor.getPickupPSAppView()??>
<app-picker
......@@ -27,3 +30,4 @@
</app-picker>
</#if>
</#if>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if editor.getEditorParam("PICKUPVIEW",true)??>
<#if editor.getPickupPSAppView()??>
<app-picker
......@@ -24,3 +27,4 @@
</app-picker>
</#if>
</#if>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if editor.getEditorParam("PICKUPVIEW",true)??>
<#if editor.getPickupPSAppView()??>
<app-picker
......@@ -24,3 +27,4 @@
</app-picker>
</#if>
</#if>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if editor.getEditorParam("PICKUPVIEW",true)??>
<#if editor.getPickupPSAppView()??>
<app-picker
......@@ -23,3 +26,4 @@
</app-picker>
</#if>
</#if>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<#if editor.getEditorParam("PICKUPVIEW",true)??>
<#if editor.getPickupPSAppView()??>
<app-picker
......@@ -23,3 +26,4 @@
</app-picker>
</#if>
</#if>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<app-picker
:formState="formState"
:data="data"
......@@ -19,3 +22,4 @@
style="${editor.getEditorCssStyle()}"
@formitemvaluechange="onFormItemValueChange">
</app-picker>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<app-picker
:formState="viewState"
:data="row"
......@@ -19,3 +22,4 @@
style="${editor.getEditorCssStyle()}"
@formitemvaluechange="($event)=>{onGridItemValueChange(row,$event,$index)}">
</app-picker>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<app-file-upload :formState="formState" :ignorefieldvaluechange="ignorefieldvaluechange" @formitemvaluechange="onFormItemValueChange" :data="JSON.stringify(this.data)" name='${editor.name}' :value="data.${editor.name}" :disabled="detailsModel.${editor.name}.disabled" :uploadparams='<#if editor.getEditorParam('uploadparams','') != ''>${editor.getEditorParam('uploadparams','')}<#else>{}</#if>' :exportparams='<#if editor.getEditorParam('exportparams','') != ''>${editor.getEditorParam('exportparams','')}<#else>{}</#if>' style="${editor.getEditorCssStyle()}overflow: auto;"></app-file-upload>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<app-file-upload
:formState="viewState"
:ignorefieldvaluechange="false"
......@@ -11,3 +14,4 @@
:exportparams='<#if editor.getEditorParam('exportparams','') != ''>${editor.getEditorParam('exportparams','')}<#else>{}</#if>'
style="${editor.getEditorCssStyle()}overflow: auto;">
</app-file-upload>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<app-file-upload
:formState="viewState"
:ignorefieldvaluechange="false"
......@@ -13,3 +16,4 @@
:exportparams='<#if editor.getEditorParam('exportparams','') != ''>${editor.getEditorParam('exportparams','')}<#else>{}</#if>'
style="${editor.getEditorCssStyle()}overflow: auto;">
</app-file-upload>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<input-box v-model="data.${editor.name}" @enter="onEnter($event)" <#if item.getUnitName()??> unit="${item.getUnitName()}"</#if> :disabled="detailsModel.${editor.name}.disabled" type='<#if item.getPSDEField()??><#assign datatype=srfjavatype(item.getPSDEField().getStdDataType())><#if datatype=='BigInteger' || datatype=='Integer' || datatype=='Double' || datatype=='Decimal' || datatype=='Float' || datatype=='BigDecimal'>number<#else>text</#if><#else>text</#if>' <#if item.getPlaceHolder()??> placeholder="${item.getPlaceHolder()}"</#if> style="${editor.getEditorCssStyle()}"></input-box>
</#if>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<date-picker type="datetime" :transfer="true" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择时间..." :value="data.${editor.name}" :disabled="detailsModel.${editor.name}.disabled" style="min-width: 150px; ${editor.getEditorCssStyle()}<#if editor.getEditorParam('width','') == 'auto'>width:100%;</#if>" @on-change="(val1, val2) => { this.data.${editor.name} = val1 }"></date-picker>
</#if>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<date-picker type="datetime" :transfer="true" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择时间..." :disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1" :value="row[column.property]" style="${item.getEditorCssStyle()}<#if item.getEditorParam('width','') == 'auto'>width:100%;</#if>" @on-change="(val1, val2) => { row[column.property] = val1; gridEditItemChange(row, column.property, val1, $index)}"></date-picker>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<date-picker
type="datetime"
:transfer="true"
......@@ -10,3 +13,4 @@
style="${item.getEditorCssStyle()}<#if item.getEditorParam('width','') == 'auto'>width:100%;</#if>"
@on-change="(val1, val2) => { data.${editor.name?lower_case} = val1; gridEditItemChange(data, '${editor.name?lower_case}', val1)}">
</date-picker>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<date-picker type="date" :transfer="true" format="yyyy-MM-dd" placeholder="请选择时间..." :value="data.${editor.name}" :disabled="detailsModel.${editor.name}.disabled" style="min-width: 150px;${editor.getEditorCssStyle()} <#if editor.getEditorParam('width','') == 'auto'>width:100%;</#if>" @on-change="(val1, val2) => { this.data.${editor.name} = val1 }"></date-picker>
</#if>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<date-picker type="date" :transfer="true" format="yyyy-MM-dd" placeholder="请选择时间..." :disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1" :value="row[column.property]" style="${item.getEditorCssStyle()}<#if item.getEditorParam('width','') == 'auto'>width:100%;</#if>" @on-change="(val1, val2) => { row[column.property] = val1; gridEditItemChange(row, column.property, val1, $index)}"></date-picker>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<date-picker
type="date"
:transfer="true"
......@@ -10,3 +13,4 @@
style="${item.getEditorCssStyle()}<#if item.getEditorParam('width','') == 'auto'>width:100%;</#if>"
@on-change="(val1, val2) => { data.${editor.name?lower_case} = val1; gridEditItemChange(data, '${editor.name?lower_case}', val1)}">
</date-picker>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<time-picker :value="data.${editor.name}" :transfer="true" :disabled="detailsModel.${editor.name}.disabled" format="mm" placeholder="请选择时间..." style="min-width: 150px; ${editor.getEditorCssStyle()}<#if editor.getEditorParam('width','') == 'auto'>width:100%;</#if>" @on-change="(val) => {this.data.${editor.name} = val}"></time-picker>
</#if>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<time-picker :value="row[column.property]" :transfer="true" format="mm" placeholder="请选择时间..." :disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1" style="${item.getEditorCssStyle()}<#if item.getEditorParam('width','') == 'auto'>width:100%;</#if>" @on-change="(val) => { row[column.property] = val; gridEditItemChange(row, column.property, val, $index)}"></time-picker>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<time-picker
:transfer="true"
format="mm"
......@@ -9,3 +12,4 @@
style="${item.getEditorCssStyle()}<#if item.getEditorParam('width','') == 'auto'>width:100%;</#if>"
@on-change="(val) => { data.${editor.name?lower_case} = val; gridEditItemChange(data, '${editor.name?lower_case}', val)}">
</time-picker>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<time-picker :value="data.${editor.name}" :transfer="true" :disabled="detailsModel.${editor.name}.disabled" format="HH" placeholder="请选择时间..." style="min-width: 150px; ${editor.getEditorCssStyle()}<#if editor.getEditorParam('width','') == 'auto'>width:100%;</#if>" @on-change="(val) => {this.data.${editor.name} = val}"></time-picker>
</#if>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<time-picker :value="row[column.property]" :transfer="true" format="HH" placeholder="请选择时间..." :disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1" style="${item.getEditorCssStyle()}<#if item.getEditorParam('width','') == 'auto'>width:100%;</#if>" @on-change="(val) => { row[column.property] = val; gridEditItemChange(row, column.property, val, $index)}"></time-picker>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<time-picker
:transfer="true"
format="HH"
......@@ -9,3 +12,4 @@
style="${item.getEditorCssStyle()}<#if item.getEditorParam('width','') == 'auto'>width:100%;</#if>"
@on-change="(val) => { data.${editor.name?lower_case} = val; gridEditItemChange(data, '${editor.name?lower_case}', val)}">
</time-picker>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<date-picker type="date" :transfer="true" format="yyyy-MM-dd" placeholder="请选择时间..." :value="data.${editor.name}" :disabled="detailsModel.${editor.name}.disabled" style="min-width: 150px; ${editor.getEditorCssStyle()}<#if editor.getEditorParam('width','') == 'auto'>width:100%;</#if>" @on-change="(val1, val2) => { this.data.${editor.name} = val1 }"></date-picker>
</#if>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<date-picker type="date" :transfer="true" format="yyyy-MM-dd" placeholder="请选择时间..." :disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1" :value="row[column.property]" style="${item.getEditorCssStyle()}<#if item.getEditorParam('width','') == 'auto'>width:100%;</#if>" @on-change="(val1, val2) => { row[column.property] = val1; gridEditItemChange(row, column.property, val1, $index)}"></date-picker>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<date-picker
type="date"
:transfer="true"
......@@ -10,3 +13,4 @@
style="${item.getEditorCssStyle()}<#if item.getEditorParam('width','') == 'auto'>width:100%;</#if>"
@on-change="(val1, val2) => { data.${editor.name?lower_case} = val1; gridEditItemChange(data, '${editor.name?lower_case}', val1)}">
</date-picker>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<time-picker :value="data.${editor.name}" :transfer="true" :disabled="detailsModel.${editor.name}.disabled" format="HH:mm:ss" placeholder="请选择时间..." style="min-width: 150px; ${editor.getEditorCssStyle()}<#if editor.getEditorParam('width','') == 'auto'>width:100%;</#if>" @on-change="(val) => {this.data.${editor.name} = val}"></time-picker>
</#if>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<time-picker :value="row[column.property]" :transfer="true" format="HH:mm:ss" placeholder="请选择时间..." :disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1" style="${item.getEditorCssStyle()}<#if item.getEditorParam('width','') == 'auto'>width:100%;</#if>" @on-change="(val) => { row[column.property] = val; gridEditItemChange(row, column.property, val, $index)}"></time-picker>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<time-picker
:transfer="true"
format="HH:mm:ss"
......@@ -9,3 +12,4 @@
style="${item.getEditorCssStyle()}<#if item.getEditorParam('width','') == 'auto'>width:100%;</#if>"
@on-change="(val) => { data.${editor.name?lower_case} = val; gridEditItemChange(data, '${editor.name?lower_case}', val)}">
</time-picker>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<time-picker :value="data.${editor.name}" :transfer="true" :disabled="detailsModel.${editor.name}.disabled" format="HH:mm" placeholder="请选择时间..." style="min-width: 150px; ${editor.getEditorCssStyle()}<#if editor.getEditorParam('width','') == 'auto'>width:100%;</#if>" @on-change="(val) => {this.data.${editor.name} = val}"></time-picker>
</#if>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<time-picker :value="row[column.property]" :transfer="true" format="HH:mm" placeholder="请选择时间..." :disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1" style="${item.getEditorCssStyle()}<#if item.getEditorParam('width','') == 'auto'>width:100%;</#if>" @on-change="(val) => { row[column.property] = val; gridEditItemChange(row, column.property, val, $index)}"></time-picker>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<time-picker
:transfer="true"
format="HH:mm"
......@@ -9,3 +12,4 @@
style="${item.getEditorCssStyle()}<#if item.getEditorParam('width','') == 'auto'>width:100%;</#if>"
@on-change="(val) => { data.${editor.name?lower_case} = val; gridEditItemChange(data, '${editor.name?lower_case}', val)}">
</time-picker>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<time-picker :value="data.${editor.name}" :transfer="true" :disabled="detailsModel.${editor.name}.disabled" format="ss" placeholder="请选择时间..." style="min-width: 150px; ${editor.getEditorCssStyle()}<#if editor.getEditorParam('width','') == 'auto'>width:100%;</#if>" @on-change="(val) => {this.data.${editor.name} = val}"></time-picker>
</#if>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<time-picker :value="row[column.property]" :transfer="true" format="ss" placeholder="请选择时间..." :disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1" style="${item.getEditorCssStyle()}<#if item.getEditorParam('width','') == 'auto'>width:100%;</#if>" @on-change="(val) => { row[column.property] = val; gridEditItemChange(row, column.property, val, $index)}"></time-picker>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<time-picker
:transfer="true"
format="ss"
......@@ -9,3 +12,4 @@
style="${item.getEditorCssStyle()}<#if item.getEditorParam('width','') == 'auto'>width:100%;</#if>"
@on-change="(val) => { data.${editor.name?lower_case} = val; gridEditItemChange(data, '${editor.name?lower_case}', val)}">
</time-picker>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<i-input v-model="data.${editor.name}" readonly disabled style="${editor.getEditorCssStyle()}"></i-input>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<app-span <#t>
name='${editor.name}' <#t>
:value="data.${editor.name}" <#t>
<#-- 值格式化 start -->
<#-- @author ljy -->
<#-- @update 2020.7.13 18:08 -->
<#if item.getPSEditor().getPSEditorContainer().getPSAppDEField().getPSDEField().getDataType()??>
dataType="${item.getPSEditor().getPSEditorContainer().getPSAppDEField().getPSDEField().getDataType()}" <#t>
<#if item.getUnitName()!="">
unitName="${item.getUnitName()}" <#t>
</#if>
</#if>
<#if item.getPSEditor().getPSEditorContainer().getPSDEFUIMode().getPSDEFFormItem().getValueFormat()?? && item.getPSEditor().getPSEditorContainer().getPSDEFUIMode().getPSDEFFormItem().getValueFormat()!= "%1$s">
valueFormat="${item.getPSEditor().getPSEditorContainer().getPSDEFUIMode().getPSDEFFormItem().getValueFormat()}" <#t>
</#if>
<#-- 值格式化 end -->
<#-- 数值精度 start -->
<#-- @author mos -->
<#-- @update 2020.7.16 -->
<#if item.getPSEditor().getPSEditorContainer().getPSAppDEField().getPSDEField().getPrecision??>
<#if item.getPSEditor().getPSEditorContainer().getPSAppDEField().getPSDEField().getDataType() == 'FLOAT' && item.getPSEditor().getPSEditorContainer().getPSAppDEField().getPSDEField().getPrecision() == 0>
:precision="2"
<#else>
:precision="${item.getPSEditor().getPSEditorContainer().getPSAppDEField().getPSDEField().getPrecision()?c}"
</#if>
</#if>
<#-- 数值精度 end -->
<#if item.getPSCodeList?? && item.getPSCodeList()??>
<#assign codelist=item.getPSCodeList() />
tag='${codelist.codeName}' <#t>
......@@ -22,4 +49,6 @@
:localContext =<@getNavigateContext editor /> <#t>
:localParam =<@getNavigateParams editor /> <#t>
style="${editor.getEditorCssStyle()}"><#t>
</app-span><#lt>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<app-span <#t>
name='${editor.name}' <#t>
:value="row[column.property]" <#t>
......@@ -23,3 +26,4 @@
:localParam =<@getNavigateParams editor /> <#t>
style="${editor.getEditorCssStyle()}"><#t>
</app-span><#lt>
</#if>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<app-span <#t>
:value="data.${editor.name?lower_case}" <#t>
name="${editor.name?lower_case}" <#t>
......@@ -14,3 +17,4 @@
</#if>
style="${item.getEditorCssStyle()}"> <#t>
</app-span> <#lt>
</#if>
<span v-html="data.${editor.name}"></span>
\ No newline at end of file
<span v-html="data.${item.getName()?lower_case}"></span>
<#if item.render??>
${item.render.code}
<#else>
<app-stepper name='${editor.name}' :value="this.data.${editor.name}" @change="onFormItemValueChange" :disabled="detailsModel.${editor.name}.disabled" style="${editor.getEditorCssStyle()}"></app-stepper>
</#if>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<app-stepper name='${editor.name}' :value="row[column.property]" @change="($event)=>{onGridItemValueChange(row,$event,$index)} " :disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1" style="${item.getEditorCssStyle()}"></app-stepper>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<app-stepper
name='${editor.name}'
:value="data.${editor.name?lower_case}"
......@@ -7,3 +10,4 @@
</#if>
style="${item.getEditorCssStyle()}">
</app-stepper>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<app-slider name='${editor.name}' :value="this.data.${editor.name}" @change="onFormItemValueChange" :disabled="detailsModel.${editor.name}.disabled" style="${editor.getEditorCssStyle()}"></app-slider>
</#if>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<app-slider name='${editor.name}' :value="row[column.property]" @change="($event)=>{onGridItemValueChange(row,$event,$index)} " :disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1" style="${item.getEditorCssStyle()}"></app-slider>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<app-slider
name='${editor.name?lower_case}'
:value="data.${editor.name?lower_case}"
......@@ -7,3 +10,4 @@
</#if>
style="${item.getEditorCssStyle()}">
</app-slider>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<div style="${editor.getEditorCssStyle()}">{{data.${editor.name}}}</div>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<app-autocomplete
:data="data"
:disabled="detailsModel.${editor.name}.disabled"
......@@ -18,3 +21,4 @@
@formitemvaluechange="onFormItemValueChange"
style="${editor.getEditorCssStyle()}">
</app-autocomplete>
</#if>
\ No newline at end of file
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<app-autocomplete
:data="row"
:disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1"
......@@ -18,3 +21,4 @@
@formitemvaluechange="($event)=>{onGridItemValueChange(row,$event,$index)}"
style="${editor.getEditorCssStyle()}">
</app-autocomplete>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<app-rate name='${editor.name}' :value="this.data.${editor.name}" @change="($event)=>{this.data.${editor.name} = $event} " :disabled="detailsModel.${editor.name}.disabled" style="${editor.getEditorCssStyle()}"></app-rate>
</#if>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<app-rate name='${item.name}' :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-rate>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<app-rate
name='${editor.name?lower_case}'
:value="data.${editor.name?lower_case}"
......@@ -7,3 +10,4 @@
</#if>
style="${item.getEditorCssStyle()}">
</app-rate>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<div style="${editor.getEditorCssStyle()}">
<app-checkbox :value="this.data.${editor.name}" @change="($event)=>{this.data.${editor.name} = $event} " :disabled="detailsModel.${editor.name}.disabled"></app-checkbox>
</div>
</#if>
\ No newline at end of file
<#if item.render??>
${item.render.code}
<#else>
<div style="${item.getEditorCssStyle()}">
<app-checkbox :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"></app-checkbox>
</div>
</#if>
<#if item.render??>
${item.render.code}
<#else>
<div style="${item.getEditorCssStyle()}">
<app-checkbox :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="data.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1"</#if>></app-checkbox>
</div>
</#if>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<app-checkbox-list
v-model="data.${editor.name}"
:data="data"
......@@ -19,3 +22,4 @@
name="${editor.name}"
style="${editor.getEditorCssStyle()}">
</app-checkbox-list>
</#if>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<app-checkbox-list
v-model="row[column.property]"
:disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1"
......@@ -19,3 +22,4 @@
name="${item.name}"
@change="($event)=>{gridEditItemChange(row, column.property, $event, $index)}">
</app-checkbox-list>
</#if>
<#ibizinclude>../@MACRO/FUNC/PUBLIC.vue.ftl</#ibizinclude>
<#if item.render??>
${item.render.code}
<#else>
<app-checkbox-list
v-model="data.${editor.name?lower_case}"
<#if item.getEnableCond??>
......@@ -21,3 +24,4 @@
name="${editor.name?lower_case}"
@change="($event)=>{panelEditItemChange(data, '${editor.name?lower_case}', $event)}">
</app-checkbox-list>
</#if>
<app-department-select :data="data" :context="JSON.parse(JSON.stringify(context))" url="<#if item.getEditorParam('url','') != ''>${item.getEditorParam('url','')}<#else>/ibzorganizations/${orgid}/ibzdepartments/picker</#if>" filter="<#if item.getEditorParam('filter','') != ''>${item.getEditorParam('filter','')}<#else>srforgid</#if>" :fillMap="<#if item.getEditorParam('fillMap','') != ''>${item.getEditorParam('fillMap','')}<#else>{'id':'${editor.getValueItemName()}','label':'${editor.name}'}</#if>" :multiple=<#if item.getEditorParam('multiple','') != ''>"${item.getEditorParam('multiple','')}"<#else>"false"</#if> style="${editor.getEditorCssStyle()}" @select-change="onFormItemValueChange"></app-department-select>
\ No newline at end of file
<app-department-select :data="data" :disabled="detailsModel.${editor.name}.disabled" :context="JSON.parse(JSON.stringify(context))" url="<#if item.getEditorParam('url','') != ''>${item.getEditorParam('url','')}<#else>/ibzorganizations/${orgid}/ibzdepartments/picker</#if>" filter="<#if item.getEditorParam('filter','') != ''>${item.getEditorParam('filter','')}<#else>srforgid</#if>" :fillMap="<#if item.getEditorParam('fillMap','') != ''>${item.getEditorParam('fillMap','')}<#else>{'id':'${editor.getValueItemName()}','label':'${editor.name}'}</#if>" :multiple=<#if item.getEditorParam('multiple','') != ''>"${item.getEditorParam('multiple','')}"<#else>"false"</#if> style="${editor.getEditorCssStyle()}" @select-change="onFormItemValueChange"></app-department-select>
<app-department-select :data="data" :context="JSON.parse(JSON.stringify(context))" url="<#if item.getEditorParam('url','') != ''>${item.getEditorParam('url','')}<#else>/ibzorganizations/${orgid}/ibzdepartments/picker</#if>" filter="<#if item.getEditorParam('filter','') != ''>${item.getEditorParam('filter','')}<#else>srforgid</#if>" :fillMap="<#if item.getEditorParam('fillMap','') != ''>${item.getEditorParam('fillMap','')}<#else>{'id':'${editor.getValueItemName()}','label':'${editor.name}'}</#if>" :multiple=<#if item.getEditorParam('multiple','') != ''>"${item.getEditorParam('multiple','')}"<#else>"false"</#if> style="${editor.getEditorCssStyle()}" @select-change="onFormItemValueChange"></app-department-select>
\ No newline at end of file
<app-department-select :data="data" :disabled="detailsModel.${editor.name}.disabled" :context="JSON.parse(JSON.stringify(context))" url="<#if item.getEditorParam('url','') != ''>${item.getEditorParam('url','')}<#else>/ibzorganizations/${orgid}/ibzdepartments/picker</#if>" filter="<#if item.getEditorParam('filter','') != ''>${item.getEditorParam('filter','')}<#else>srforgid</#if>" :fillMap="<#if item.getEditorParam('fillMap','') != ''>${item.getEditorParam('fillMap','')}<#else>{'id':'${editor.getValueItemName()}','label':'${editor.name}'}</#if>" :multiple=<#if item.getEditorParam('multiple','') != ''>"${item.getEditorParam('multiple','')}"<#else>"false"</#if> style="${editor.getEditorCssStyle()}" @select-change="onFormItemValueChange"></app-department-select>
<app-department-select :data="data" :context="JSON.parse(JSON.stringify(context))" url="<#if item.getEditorParam('url','') != ''>${item.getEditorParam('url','')}<#else>/ibzorganizations/${orgid}/ibzdepartments/picker</#if>" filter="<#if item.getEditorParam('filter','') != ''>${item.getEditorParam('filter','')}<#else>srforgid</#if>" :fillMap="<#if item.getEditorParam('fillMap','') != ''>${item.getEditorParam('fillMap','')}<#else>{'id':'${editor.getValueItemName()}','label':'${editor.name}'}</#if>" :multiple=<#if item.getEditorParam('multiple','') != ''>"${item.getEditorParam('multiple','')}"<#else>"false"</#if> style="${editor.getEditorCssStyle()}" @select-change="onFormItemValueChange"></app-department-select>
\ No newline at end of file
<app-department-select :data="data" :disabled="detailsModel.${editor.name}.disabled" :context="JSON.parse(JSON.stringify(context))" url="<#if item.getEditorParam('url','') != ''>${item.getEditorParam('url','')}<#else>/ibzorganizations/${orgid}/ibzdepartments/picker</#if>" filter="<#if item.getEditorParam('filter','') != ''>${item.getEditorParam('filter','')}<#else>srforgid</#if>" :fillMap="<#if item.getEditorParam('fillMap','') != ''>${item.getEditorParam('fillMap','')}<#else>{'id':'${editor.getValueItemName()}','label':'${editor.name}'}</#if>" :multiple=<#if item.getEditorParam('multiple','') != ''>"${item.getEditorParam('multiple','')}"<#else>"false"</#if> style="${editor.getEditorCssStyle()}" @select-change="onFormItemValueChange"></app-department-select>
<app-department-select :data="data" :context="JSON.parse(JSON.stringify(context))" url="<#if item.getEditorParam('url','') != ''>${item.getEditorParam('url','')}<#else>/ibzorganizations/${orgid}/ibzdepartments/picker</#if>" filter="<#if item.getEditorParam('filter','') != ''>${item.getEditorParam('filter','')}<#else>srforgid</#if>" :fillMap="<#if item.getEditorParam('fillMap','') != ''>${item.getEditorParam('fillMap','')}<#else>{'id':'${editor.getValueItemName()}','label':'${editor.name}'}</#if>" :multiple=<#if item.getEditorParam('multiple','') != ''>"${item.getEditorParam('multiple','')}"<#else>"false"</#if> style="${editor.getEditorCssStyle()}" @select-change="onFormItemValueChange"></app-department-select>
\ No newline at end of file
<app-department-select :data="data" :disabled="detailsModel.${editor.name}.disabled" :context="JSON.parse(JSON.stringify(context))" url="<#if item.getEditorParam('url','') != ''>${item.getEditorParam('url','')}<#else>/ibzorganizations/${orgid}/ibzdepartments/picker</#if>" filter="<#if item.getEditorParam('filter','') != ''>${item.getEditorParam('filter','')}<#else>srforgid</#if>" :fillMap="<#if item.getEditorParam('fillMap','') != ''>${item.getEditorParam('fillMap','')}<#else>{'id':'${editor.getValueItemName()}','label':'${editor.name}'}</#if>" :multiple=<#if item.getEditorParam('multiple','') != ''>"${item.getEditorParam('multiple','')}"<#else>"false"</#if> style="${editor.getEditorCssStyle()}" @select-change="onFormItemValueChange"></app-department-select>
......@@ -12,7 +12,7 @@
public ${item.getFullCodeName()}(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
const data: any = {};
if (_this.newRow && _this.newRow instanceof Function) {
if (_this.hasOwnProperty('newRow') && _this.newRow instanceof Function) {
_this.newRow([{ ...data }], params, $event, xData);
} else if(xData.newRow && xData.newRow instanceof Function) {
xData.newRow([{ ...data }], params, $event, xData);
......
......@@ -24,6 +24,9 @@ import ${srfclassname('${curAppEntity.getCodeName()}')}UIService from '@/uiservi
</#if>
</#list>
</#if>
<#if appde??>
import ${srfclassname('${appde.getCodeName()}')}UIService from '@/uiservice/${srffilepath2(appde.getCodeName())}/${srffilepath2(appde.getCodeName())}-ui-service';
</#if>
<#if import_block??>
${import_block}
</#if>
......@@ -48,6 +51,14 @@ export default class ${srfclassname(view.name)}Base extends <#if view_base_name?
* @memberof ${srfclassname(view.name)}Base
*/
public appEntityService: ${srfclassname('${appde.getCodeName()}')}Service = new ${srfclassname('${appde.getCodeName()}')}Service;
/**
* 实体UI服务对象
*
* @type ${srfclassname('${appde.getCodeName()}')}UIService
* @memberof ${srfclassname('${view.name}')}Base
*/
public appUIService: ${srfclassname('${appde.getCodeName()}')}UIService = new ${srfclassname('${appde.getCodeName()}')}UIService(this.$store);
</#if>
<#if view.getPSAppCounterRefs()??>
......
......@@ -216,6 +216,7 @@
* @memberof ${srfclassname('${view.name}')}Base
*/
public onClickCancel(): void {
this.$emit('viewdataschange', null);
this.$emit('close', null);
}
......
......@@ -84,6 +84,7 @@
* @memberof ${srfclassname('${view.name}')}
*/
public onClickCancel(): void {
this.$emit('viewdataschange', null);
this.$emit('close', null);
}
......
<#assign view_base_name>ViewBase</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......
<#ibiztemplate>
TARGET=PSAPPDATAENTITY
</#ibiztemplate>
import AuthService from '../auth-service';
/**
* ${de.getLogicName()}权限服务对象基类
*
* @export
* @class ${srfclassname('${item.getCodeName()}')}AuthServiceBase
* @extends {AuthService}
*/
export default class ${srfclassname('${item.getCodeName()}')}AuthServiceBase extends AuthService {
/**
* Creates an instance of ${srfclassname('${item.getCodeName()}')}AuthServiceBase.
*
* @param {*} [opts={}]
* @memberof ${srfclassname('${item.getCodeName()}')}AuthServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 根据当前数据获取实体操作标识
*
* @param {*} mainSateOPPrivs 传入数据操作标识
* @returns {any}
* @memberof ${srfclassname('${item.getCodeName()}')}AuthServiceBase
*/
public getOPPrivs(mainSateOPPrivs:any):any{
let curDefaultOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs));
if(mainSateOPPrivs){
Object.assign(curDefaultOPPrivs,mainSateOPPrivs);
}
return curDefaultOPPrivs;
}
}
\ No newline at end of file
<#ibiztemplate>
TARGET=PSAPPDATAENTITY
</#ibiztemplate>
import ${srfclassname('${item.getCodeName()}')}AuthServiceBase from './${srffilepath2(item.getCodeName())}-auth-service-base';
/**
* ${de.getLogicName()}权限服务对象
*
* @export
* @class ${srfclassname('${item.getCodeName()}')}AuthService
* @extends {${srfclassname('${item.getCodeName()}')}AuthServiceBase}
*/
export default class ${srfclassname('${item.getCodeName()}')}AuthService extends ${srfclassname('${item.getCodeName()}')}AuthServiceBase {
/**
* Creates an instance of ${srfclassname('${item.getCodeName()}')}AuthService.
*
* @param {*} [opts={}]
* @memberof ${srfclassname('${item.getCodeName()}')}AuthService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
/**
* 实体权限服务注册中心
*
* @export
* @class AuthServiceRegister
*/
export class AuthServiceRegister {
/**
* 所有实体权限服务Map
*
* @protected
* @type {*}
* @memberof AuthServiceRegister
*/
protected allAuthService: Map<string, () => Promise<any>> = new Map();
/**
* 已加载实体权限服务Map缓存
*
* @protected
* @type {Map<string, any>}
* @memberof AuthServiceRegister
*/
protected serviceCache: Map<string, any> = new Map();
/**
* Creates an instance of AuthServiceRegister.
* @memberof AuthServiceRegister
*/
constructor() {
this.init();
}
/**
* 初始化
*
* @protected
* @memberof AuthServiceRegister
*/
protected init(): void {
<#if app.getAllPSAppDataEntities()??>
<#list app.getAllPSAppDataEntities() as curAppEntity>
this.allAuthService.set('${curAppEntity.getCodeName()?lower_case}', () => import('@/authservice/${srffilepath2(curAppEntity.getCodeName())}/${srffilepath2(curAppEntity.getCodeName())}-auth-service'));
</#list>
</#if>
}
/**
* 加载实体权限服务
*
* @protected
* @param {string} serviceName
* @returns {Promise<any>}
* @memberof AuthServiceRegister
*/
protected async loadService(serviceName: string): Promise<any> {
const service = this.allAuthService.get(serviceName);
if (service) {
return service();
}
}
/**
* 获取应用实体权限服务
*
* @param {string} name
* @returns {Promise<any>}
* @memberof AuthServiceRegister
*/
public async getService(name: string): Promise<any> {
if (this.serviceCache.has(name)) {
return this.serviceCache.get(name);
}
const authService: any = await this.loadService(name);
if (authService && authService.default) {
const instance: any = new authService.default();
this.serviceCache.set(name, instance);
return instance;
}
}
}
export const authServiceRegister: AuthServiceRegister = new AuthServiceRegister();
\ No newline at end of file
......@@ -18,9 +18,23 @@ export default {
success: "Success",
ok: "OK",
cancel: "Cancel",
save: "Save",
codeNotExist: 'Code list does not exist',
reqException: "Request exception",
sysException: "System abnormality",
warning: "Warning",
wrong: "Error",
rulesException: "Abnormal value check rule",
saveSuccess: "Saved successfully",
saveFailed: "Save failed",
deleteSuccess: "Successfully deleted!",
deleteError: "Failed to delete",
delDataFail: "Failed to delete data",
noData: "No data",
},
local:{
new: "New"
new: "New",
add: "Add",
},
gridpage: {
choicecolumns: "Choice columns",
......@@ -28,6 +42,50 @@ export default {
show: "Show",
records: "records",
totle: "totle",
noData: "No data",
valueVail: "Value cannot be empty",
notConfig: {
fetchAction: "The view table fetchaction parameter is not configured",
removeAction: "The view table removeaction parameter is not configured",
createAction: "The view table createaction parameter is not configured",
updateAction: "The view table updateaction parameter is not configured",
loaddraftAction: "The view table loadtrafaction parameter is not configured",
},
data: "Data",
delDataFail: "Failed to delete data",
delSuccess: "Delete successfully!",
confirmDel: "Are you sure you want to delete",
notRecoverable: "delete will not be recoverable?",
notBatch: "Batch addition not implemented",
grid: "Grid",
exportFail: "Data export failed",
sum: "Total",
formitemFailed: "Form item update failed",
},
list: {
notConfig: {
fetchAction: "View list fetchAction parameter is not configured",
removeAction: "View table removeAction parameter is not configured",
createAction: "View list createAction parameter is not configured",
updateAction: "View list updateAction parameter is not configured",
},
confirmDel: "Are you sure you want to delete",
notRecoverable: "delete will not be recoverable?",
},
listExpBar: {
title: "List navigation bar",
},
wfExpBar: {
title: "Process navigation bar",
},
calendarExpBar:{
title: "Calendar navigation bar",
},
treeExpBar: {
title: "Tree view navigation bar",
},
portlet: {
noExtensions: "No extensions",
},
tabpage: {
sureclosetip: {
......@@ -52,6 +110,8 @@ export default {
list: "list",
dateSelectModalTitle: "select the time you wanted",
gotoDate: "goto",
from: "From",
to: "To",
},
// 非实体视图
views: {
......@@ -81,6 +141,94 @@ export default {
},
</#list>
},
formpage:{
error: "Error",
desc1: "Operation failed, failed to find current form item",
desc2: "Can't continue",
notconfig: {
loadaction: "View form loadAction parameter is not configured",
loaddraftaction: "View form loaddraftAction parameter is not configured",
actionname: "View form actionName parameter is not configured",
removeaction: "View form removeAction parameter is not configured",
},
saveerror: "Error saving data",
savecontent: "The data is inconsistent. The background data may have been modified. Do you want to reload the data?",
valuecheckex: "Value rule check exception",
savesuccess: "Saved successfully!",
deletesuccess: "Successfully deleted!",
workflow: {
starterror: "Workflow started successfully",
startsuccess: "Workflow failed to start",
submiterror: "Workflow submission failed",
submitsuccess: "Workflow submitted successfully",
},
updateerror: "Form item update failed",
},
gridBar: {
title: "Table navigation bar",
},
multiEditView: {
notConfig: {
fetchAction: "View multi-edit view panel fetchAction parameter is not configured",
loaddraftAction: "View multi-edit view panel loaddraftAction parameter is not configured",
},
},
dataViewExpBar: {
title: "Card view navigation bar",
},
kanban: {
notConfig: {
fetchAction: "View list fetchAction parameter is not configured",
removeAction: "View table removeAction parameter is not configured",
},
delete1: "Confirm to delete ",
delete2: "the delete operation will be unrecoverable!",
},
dashBoard: {
handleClick: {
title: "Panel design",
},
},
dataView: {
sum: "total",
data: "data",
},
chart: {
undefined: "Undefined",
quarter: "Quarter",
year: "Year",
},
searchForm: {
notConfig: {
loadAction: "View search form loadAction parameter is not configured",
loaddraftAction: "View search form loaddraftAction parameter is not configured",
},
custom: "Store custom queries",
title: "Name",
},
wizardPanel: {
back: "Back",
next: "Next",
complete: "Complete",
},
viewLayoutPanel: {
appLogoutView: {
prompt1: "Dear customer, you have successfully exited the system, after",
prompt2: "seconds, we will jump to the",
logingPage: "login page",
},
appWfstepTraceView: {
title: "Application process processing record view",
},
appWfstepDataView: {
title: "Application process tracking view",
},
appLoginView: {
username: "Username",
password: "Password",
login: "Login",
},
},
},
entities: {
<#list app.getAllPSAppDataEntities() as dataEntitey>
......
......@@ -18,9 +18,23 @@ export default {
success: "成功",
ok: "确认",
cancel: "取消",
save: "保存",
codeNotExist: "代码表不存在",
reqException: "请求异常",
sysException: "系统异常",
warning: "警告",
wrong: "错误",
rulesException: "值规则校验异常",
saveSuccess: "保存成功",
saveFailed: "保存失败",
deleteSuccess: "删除成功!",
deleteError: "删除失败!",
delDataFail: "删除数据失败",
noData: "暂无数据",
},
local:{
new: "新建"
new: "新建",
add: "增加",
},
gridpage: {
choicecolumns: "选择列",
......@@ -28,6 +42,50 @@ export default {
show: "显示",
records: "条",
totle: "共",
noData: "无数据",
valueVail: "值不能为空",
notConfig: {
fetchAction: "视图表格fetchAction参数未配置",
removeAction: "视图表格removeAction参数未配置",
createAction: "视图表格createAction参数未配置",
updateAction: "视图表格updateAction参数未配置",
loaddraftAction: "视图表格loaddraftAction参数未配置",
},
data: "数据",
delDataFail: "删除数据失败",
delSuccess: "删除成功!",
confirmDel: "确认要删除",
notRecoverable: "删除操作将不可恢复?",
notBatch: "批量添加未实现",
grid: "表",
exportFail: "数据导出失败",
sum: "合计",
formitemFailed: "表单项更新失败",
},
list: {
notConfig: {
fetchAction: "视图列表fetchAction参数未配置",
removeAction: "视图表格removeAction参数未配置",
createAction: "视图列表createAction参数未配置",
updateAction: "视图列表updateAction参数未配置",
},
confirmDel: "确认要删除",
notRecoverable: "删除操作将不可恢复?",
},
listExpBar: {
title: "列表导航栏",
},
wfExpBar: {
title: "流程导航栏",
},
calendarExpBar:{
title: "日历导航栏",
},
treeExpBar: {
title: "树视图导航栏",
},
portlet: {
noExtensions: "无扩展插件",
},
tabpage: {
sureclosetip: {
......@@ -52,6 +110,8 @@ export default {
list: "列",
dateSelectModalTitle: "选择要跳转的时间",
gotoDate: "跳转",
from: "从",
to: "至",
},
// 非实体视图
views: {
......@@ -81,6 +141,93 @@ export default {
},
</#list>
},
formpage:{
desc1: "操作失败,未能找到当前表单项",
desc2: "无法继续操作",
notconfig: {
loadaction: "视图表单loadAction参数未配置",
loaddraftaction: "视图表单loaddraftAction参数未配置",
actionname: "视图表单'+actionName+'参数未配置",
removeaction: "视图表单removeAction参数未配置",
},
saveerror: "保存数据发生错误",
savecontent: "数据不一致,可能后台数据已经被修改,是否要重新加载数据?",
valuecheckex: "值规则校验异常",
savesuccess: "保存成功!",
deletesuccess: "删除成功!",
workflow: {
starterror: "工作流启动失败",
startsuccess: "工作流启动成功",
submiterror: "工作流提交失败",
submitsuccess: "工作流提交成功",
},
updateerror: "表单项更新失败",
},
gridBar: {
title: "表格导航栏",
},
multiEditView: {
notConfig: {
fetchAction: "视图多编辑视图面板fetchAction参数未配置",
loaddraftAction: "视图多编辑视图面板loaddraftAction参数未配置",
},
},
dataViewExpBar: {
title: "卡片视图导航栏",
},
kanban: {
notConfig: {
fetchAction: "视图列表fetchAction参数未配置",
removeAction: "视图表格removeAction参数未配置",
},
delete1: "确认要删除 ",
delete2: "删除操作将不可恢复?",
},
dashBoard: {
handleClick: {
title: "面板设计",
},
},
dataView: {
sum: "共",
data: "条数据",
},
chart: {
undefined: "未定义",
quarter: "季度",
year: "年",
},
searchForm: {
notConfig: {
loadAction: "视图搜索表单loadAction参数未配置",
loaddraftAction: "视图搜索表单loaddraftAction参数未配置",
},
custom: "存储自定义查询",
title: "名称",
},
wizardPanel: {
back: "上一步",
next: "下一步",
complete: "完成",
},
viewLayoutPanel: {
appLogoutView: {
prompt1: "尊敬的客户您好,您已成功退出系统,将在",
prompt2: "秒后跳转至",
logingPage: "登录页",
},
appWfstepTraceView: {
title: "应用流程处理记录视图",
},
appWfstepDataView: {
title: "应用流程跟踪视图",
},
appLoginView: {
username: "用户名",
password: "密码",
login: "登录",
},
},
},
entities: {
<#list app.getAllPSAppDataEntities() as dataEntitey>
......
......@@ -23,11 +23,23 @@ import { Verify } from '@/utils/verify/verify';
<#-- 源参数 -->
<#if logicparam.getSrcPSDELogicParam()??><#assign srcParam = logicparam.getSrcPSDELogicParam() /></#if>
<#-- 源参数属性名称 -->
<#if logicparam.getSrcFieldName()??><#assign srcFieldParam = logicparam.getSrcFieldName()?lower_case /></#if>
<#if logicparam.getSrcFieldName()??>
<#assign srcFieldParamName = logicparam.getSrcFieldName() />
<#if srcParam?? && srcParam.getParamPSAppDataEntity?? && srcParam.getParamPSAppDataEntity()?? && srcParam.getParamPSAppDataEntity().getPSAppDEField(srcFieldParamName,true)??>
<#assign srcFieldParam=srfcaseformat(srcParam.getParamPSAppDataEntity().getPSAppDEField(srcFieldParamName,true).getCodeName()?lower_case,'l_u2lC') />
<#else>
<#assign srcFieldParam= logicparam.getSrcFieldName()?lower_case />
</#if>
</#if>
<#-- 目标参数 -->
<#assign dstParam = logicparam.getDstPSDELogicParam() />
<#-- 目标参数属性名称 -->
<#assign dstFieldParam = logicparam.getDstFieldName()?lower_case />
<#assign dstFieldParamName = logicparam.getDstFieldName() />
<#if dstParam?? && dstParam.getParamPSAppDataEntity?? && dstParam.getParamPSAppDataEntity()?? && dstParam.getParamPSAppDataEntity().getPSAppDEField(dstFieldParamName,true)??>
<#assign dstFieldParam=srfcaseformat(dstParam.getParamPSAppDataEntity().getPSAppDEField(dstFieldParamName,true).getCodeName()?lower_case,'l_u2lC') />
<#else>
<#assign dstFieldParam= logicparam.getDstFieldName()?lower_case />
</#if>
<#-- 源逻辑参数 -->
let tempDstParam${logicparam_index}Context:any = this.paramsMap.get('${dstParam.getCodeName()}').context?this.paramsMap.get('${dstParam.getCodeName()}').context:{};
let tempDstParam${logicparam_index}Data:any = this.paramsMap.get('${dstParam.getCodeName()}').data?this.paramsMap.get('${dstParam.getCodeName()}').data:{};
......
......@@ -21,7 +21,13 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#assign majorPSAppDataEntity = deReRs.getMajorPSAppDataEntity() />
<#-- 从实体 -->
<#assign minorPSAppDataEntity = deReRs.getMinorPSAppDataEntity() />
this.tempStorage.setItem(context.srfsessionkey+'_${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}',JSON.stringify(res.data.${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}));
<#-- 从实体支持临时数据模式为true,才设置本地缓存 start -->
<#-- @author zpc -->
<#-- @update 2020.7.13 15:00 -->
<#if minorPSAppDataEntity.isEnableTempData()>
this.tempStorage.setItem(context.srfsessionkey+'_${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}',JSON.stringify(res.data.${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}?res.data.${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}:[]));
</#if>
<#-- 从实体支持临时数据模式为true,才设置本地缓存 end -->
</#list>
</#if>
</#macro>
......@@ -34,6 +40,10 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#assign majorPSAppDataEntity = deReRs.getMajorPSAppDataEntity() />
<#-- 从实体 -->
<#assign minorPSAppDataEntity = deReRs.getMinorPSAppDataEntity() />
<#-- 从实体支持临时数据模式为true,才从前端缓存拿取数据,组装数据给后台 start -->
<#-- @author zpc -->
<#-- @update 2020.7.13 15:00 -->
<#if minorPSAppDataEntity.isEnableTempData()>
let ${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}Data:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}'),'undefined')){
${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}Data = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}') as any);
......@@ -49,12 +59,25 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
}
}
masterData.${srfpluralize(minorPSAppDataEntity.codeName)?lower_case} = ${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}Data;
</#if>
<#-- 从实体支持临时数据模式为true,才从前端缓存拿取数据,组装数据给后台 end -->
</#list>
</#if>
</#macro>
<#-- 检查行为是否可以执行 start -->
<#-- @author zpc -->
<#-- @update 2020.7.13 18:00 -->
<#-- 获取测试行为的修饰符和名称 start -->
<#macro getTestActionModifier appdeAction>
<#compress>
<#if appdeAction.getTestActionMode() == 1>private</#if><#if appdeAction.getTestActionMode() == 3>public</#if>
</#compress>
</#macro>
<#-- 获取测试行为的修饰符和名称 end -->
<#-- 定义service_block start -->
<#macro service_block item singleAppMethod>
<#macro service_block item singleAppMethod afterActionStr = "">
<#if item.getPSAppDERSPathCount() gt 0 && singleServiceApi??>
<#list 1..item.getPSAppDERSPathCount() as count>
<#assign path = ''/>
......@@ -70,21 +93,24 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#if singleAppMethod.getMethodType() == "SELECT">
if(${condition}context.${item.getCodeName()?lower_case}){
<#if singleServiceApi.getRequestMethod() == 'PUT' || 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);
let res:any = 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>
let res:any = 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><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
}
<#-- 方法类型为FETCH -->
<#elseif singleAppMethod.getMethodType() == "FETCH">
if(${condition}true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,tempData,isloading);
let res:any = Http.getInstance().get(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,tempData,isloading);<#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
}
<#-- 方法类型为FETCHTEMP -->
<#elseif singleAppMethod.getMethodType() == "FETCHTEMP">
if(${condition}true){
return Http.getInstance().get(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
let res:any = Http.getInstance().get(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);<#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
}
<#else>
<#-- 方法类型为DEACTION start -->
......@@ -93,7 +119,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
if(${condition}true){
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 />
<@setStore appEntity=item /><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
}
<#-- 无参数情况end -->
......@@ -104,12 +130,16 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#-- 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 />
<@setStore appEntity=item /><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
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);
let res:any = 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);<#if afterActionStr?? && afterActionStr !="" >
${afterActionStr}</#if>
return res;
<#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);
let res:any = 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 afterActionStr?? && afterActionStr !="" >
${afterActionStr}</#if>
return res;
</#if>
<#-- 指定属性情况end -->
}
......@@ -135,9 +165,9 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#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}));
this.tempStorage.setItem(tempContext.srfsessionkey+'_${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}',JSON.stringify(res.data.${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}?res.data.${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}:[]));
</#list>
</#if>
</#if><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
}
<#else>
......@@ -146,7 +176,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<@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 />
<@setStore appEntity=item /><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
}
</#if>
......@@ -165,25 +195,30 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#if singleAppMethod.getMethodType() == "SELECT">
<#-- if(context.${item.getCodeName()?lower_case}){ -->
<#if singleServiceApi.getRequestMethod() == 'PUT' || singleServiceApi.getRequestMethod() == 'POST'>
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);
let res:any = 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);
<#else>
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>
let res:any = 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 afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
<#-- } -->
<#-- 方法类型为FETCH -->
<#elseif singleAppMethod.getMethodType() == "FETCH">
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,tempData,isloading);
let res:any = Http.getInstance().get(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,tempData,isloading);<#if afterActionStr?? && afterActionStr !="" >
${afterActionStr}</#if>
return res;
<#-- 方法类型为FETCHTEMP -->
<#elseif singleAppMethod.getMethodType() == "FETCHTEMP">
return Http.getInstance().get(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
let res:any = Http.getInstance().get(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);<#if afterActionStr?? && afterActionStr !="" >
${afterActionStr}</#if>
return res;
<#else>
<#-- 方法类型为DEACTION start -->
<#if singleServiceApi.getRequestParamType() == "NONE">
<#-- 无参数情况start -->
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${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 />
<@setStore appEntity=item /><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
<#-- 无参数情况end -->
<#elseif singleServiceApi.getRequestParamType() == "FIELD">
......@@ -192,17 +227,21 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#if singleServiceApi.getRequestMethod() == "GET">
<#-- if(context.${item.getCodeName()?lower_case}){ -->
let res:any = await 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);
<@setStore appEntity=item />
<@setStore appEntity=item /><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
<#-- } -->
<#elseif singleServiceApi.getRequestMethod() == "POST">
<#-- REMOVE -->
<#-- if(context.${item.getCodeName()?lower_case}){ -->
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);
let res:any = 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 afterActionStr?? && afterActionStr !="" >
${afterActionStr}</#if>
return res;
<#-- } -->
<#else>
<#-- if(context.${item.getCodeName()?lower_case}){ -->
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);
let res:any = 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 afterActionStr?? && afterActionStr !="" >
${afterActionStr}</#if>
return res;
<#-- } -->
</#if>
<#-- 指定属性情况end -->
......@@ -214,7 +253,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
Object.assign(data,masterData);
<#-- if(context.${item.getCodeName()?lower_case}){ -->
let res:any = await 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);
<@setStore appEntity=item />
<@setStore appEntity=item /><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
<#-- } -->
<#elseif singleAppMethod.getCodeName() == 'Save'>
......@@ -223,7 +262,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
Object.assign(data,masterData);
<#-- if(context.${item.getCodeName()?lower_case}){ -->
let res:any = await 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);
<@setStore appEntity=item />
<@setStore appEntity=item /><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
<#-- } -->
<#elseif singleAppMethod.getCodeName() == 'Create'>
......@@ -244,13 +283,14 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#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}));
this.tempStorage.setItem(tempContext.srfsessionkey+'_${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}',JSON.stringify(res.data.${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}?res.data.${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}:[]));
</#list>
</#if>
</#if><#if afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
<#else>
<#-- if(context.${item.getCodeName()?lower_case}){ -->
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);
let res:any = 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 afterActionStr?? && afterActionStr !="" >${afterActionStr}</#if>
return res;
<#-- } -->
</#if>
<#-- 提交对象数据情况end -->
......@@ -440,6 +480,38 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
</#macro>
<#-- 定义service_block end -->
<#-- 行为执行之前 start -->
<#-- @author zpc -->
<#-- @update 2020.7.14 11:00 -->
<#macro excuteBeforeAction appdeAction>
<#if appdeAction.getBeforePSDEActionLogics?? && appdeAction.getBeforePSDEActionLogics()??>
<#list appdeAction.getBeforePSDEActionLogics() as beforelogic>
<#if beforelogic.getPSDELogic()??>
<#assign singleLogic = beforelogic.getPSDELogic() />
let ${singleLogic.getCodeName()?lower_case}:${srfclassname('${singleLogic.getCodeName()}')}Logic = new ${srfclassname('${singleLogic.getCodeName()}')}Logic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(data))});
data = await ${singleLogic.getCodeName()?lower_case}.onExecute(context,data,isloading?true:false);
</#if>
</#list>
</#if>
</#macro>
<#-- 行为执行之前 end -->
<#-- 行为执行之后 start -->
<#-- @author zpc -->
<#-- @update 2020.7.14 14:00 -->
<#macro excuteAfterAction appdeAction>
<#if appdeAction.getAfterPSDEActionLogics?? && appdeAction.getAfterPSDEActionLogics()??>
<#list appdeAction.getAfterPSDEActionLogics() as afterlogic>
<#if afterlogic.getPSDELogic()??>
<#assign singleLogic = afterlogic.getPSDELogic() />
<@compress single_line=true>let ${singleLogic.getCodeName()?lower_case}:${srfclassname('${singleLogic.getCodeName()}')}Logic = new ${srfclassname('${singleLogic.getCodeName()}')}Logic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(res))});</@compress>
<@compress single_line=true>res = await ${singleLogic.getCodeName()?lower_case}.onExecute(context,res,isloading?true:false);</@compress>
</#if>
</#list>
</#if>
</#macro>
<#-- 行为执行之后 end -->
/**
* ${de.getLogicName()}服务对象基类
......@@ -479,7 +551,7 @@ export default class ${srfclassname('${item.getCodeName()}')}ServiceBase extends
<#if item.getAllPSAppDEMethods?? && item.getAllPSAppDEMethods()??>
<#list item.getAllPSAppDEMethods() as singleAppMethod>
<#if singleAppMethod.getPSDEServiceAPIMethod?? && singleAppMethod.getPSDEServiceAPIMethod()??>
<#assign singleServiceApi = singleAppMethod.getPSDEServiceAPIMethod()/>
<#assign singleServiceApi = singleAppMethod.getPSDEServiceAPIMethod()/>
</#if>
<#if singleAppMethod.render??>
${singleAppMethod.render.code}
......@@ -496,22 +568,133 @@ export default class ${srfclassname('${item.getCodeName()}')}ServiceBase extends
* @memberof ${srfclassname('${item.getCodeName()}')}ServiceBase
*/
public async ${singleAppMethod.getCodeName()}(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
<#--是否存在前端处理逻辑start -->
<#if singleAppMethod.getPSDEAction()??>
<#assign appdeAction = singleAppMethod.getPSDEAction() />
<#-- 检查行为是否可以执行 start -->
<#-- @author zpc -->
<#-- @update 2020.7.13 16:00 -->
<#if appdeAction.getTestActionMode?? && appdeAction.getTestActionMode()?? && (appdeAction.getTestActionMode() == 1 || appdeAction.getTestActionMode() == 3)>
let result:any = await this.test${srfclassname('${singleAppMethod.getCodeName()}')}(context,data);
if(!result) return;
</#if>
<#-- 检查行为是否可以执行 end -->
<#-- 行为执行之前 start -->
<#-- @author zpc -->
<#-- @update 2020.7.14 11:00 -->
<@excuteBeforeAction appdeAction = appdeAction />
<#-- 行为执行之前 end -->
<#--是否存在前端处理逻辑start -->
<#if appdeAction.getPSDELogic?? && appdeAction.getPSDELogic()?? && (appdeAction.getActionHolder() == 2 || appdeAction.getActionHolder() == 3) >
<#assign appdelogic = appdeAction.getPSDELogic() />
let appLogic:${srfclassname('${appdelogic.getCodeName()}')}Logic = new ${srfclassname('${appdelogic.getCodeName()}')}Logic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(data))});
const result = await appLogic.onExecute(context,data,isloading?true:false);
return {status:200,data:result};
const res = await appLogic.onExecute(context,data,isloading?true:false);
<@excuteAfterAction appdeAction = appdeAction />
return {status:200,data:res};
<#else>
<@service_block item=item singleAppMethod=singleAppMethod/>
<#-- 行为执行之后 start -->
<#-- @author zpc -->
<#-- @update 2020.7.14 14:00 -->
<#assign afterActionStr><@excuteAfterAction appdeAction = appdeAction /></#assign>
<@service_block item=item singleAppMethod=singleAppMethod afterActionStr = afterActionStr/>
<#-- 行为执行之后 end -->
</#if>
<#--是否存在前端处理逻辑end -->
<#else>
<@service_block item=item singleAppMethod=singleAppMethod/>
<#-- 行为执行之后 start -->
<#-- @author zpc -->
<#-- @update 2020.7.14 14:00 -->
<@service_block item=item singleAppMethod=singleAppMethod />
<#-- 行为执行之后 end -->
</#if>
}
<#-- 查询数据集(post方式)start -->
<#-- @author zpc -->
<#-- @update 2020.7.13 15:00 -->
<#-- <#if singleAppMethod.getMethodType?? && singleAppMethod.getMethodType()?? && singleAppMethod.getMethodType() == "FETCH">
<#assign dataSet = singleAppMethod.getPSDEDataSet() /> -->
<#-- /**
* search${dataSet.getCodeName()}接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ${srfclassname('${item.getCodeName()}')}ServiceBase
*/
public async search${dataSet.getCodeName()}(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { -->
<#-- 检查行为是否可以执行 start -->
<#-- @author zpc -->
<#-- @update 2020.7.13 16:00 -->
<#-- <#if singleAppMethod.getPSDEAction()??>
<#assign appdeAction = singleAppMethod.getPSDEAction() />
<#if appdeAction.getTestActionMode?? && appdeAction.getTestActionMode()?? && (appdeAction.getTestActionMode() == 1 || appdeAction.getTestActionMode() == 3)>
let result:any = await this.test${srfclassname('search${dataSet.getCodeName()}')}(context,data);
if(!result) return;
</#if>
</#if> -->
<#-- 检查行为是否可以执行 end -->
<#-- <#if item.getPSAppDERSPathCount() gt 0 && singleServiceApi??>
<#list 1..item.getPSAppDERSPathCount() as count>
<#assign path = ''/>
<#assign condition = ''/>
<#list item.getPSAppDERSPath(count_index) as deRSPath>
<#if deRSPath.getMajorPSAppDataEntity?? && deRSPath.getMajorPSAppDataEntity()??>
<#assign _dataEntity = deRSPath.getMajorPSAppDataEntity()/>
<#assign condition>${condition}context.${_dataEntity.getCodeName()?lower_case} && </#assign>
<#assign path>${path}${srfpluralize(_dataEntity.codeName)?lower_case}/<#noparse>$</#noparse>{context.${_dataEntity.getCodeName()?lower_case}}/</#assign>
</#if>
</#list>
if(${condition}true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().post(`/${path}${srfpluralize(item.codeName)?lower_case}/search${dataSet.getCodeName()?lower_case}`,tempData,isloading);
}
</#list>
</#if>
<#if item.isMajor()>
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().post(`/${srfpluralize(item.codeName)?lower_case}/search${dataSet.getCodeName()?lower_case}`,tempData,isloading);
</#if>
}
</#if> -->
<#-- 查询数据集(post方式)end -->
<#-- 检查行为是否可以执行 start -->
<#-- @author zpc -->
<#-- @update 2020.7.13 17:00 -->
<#if singleAppMethod.getPSDEAction()??>
<#assign appdeAction = singleAppMethod.getPSDEAction() />
<#if appdeAction.getTestActionMode?? && appdeAction.getTestActionMode()?? && (appdeAction.getTestActionMode() == 1 || appdeAction.getTestActionMode() == 3)>
/**
* test${srfclassname('${singleAppMethod.getCodeName()}')}方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @returns {Promise<any>}
* @memberof ${srfclassname('${item.getCodeName()}')}ServiceBase
*/
<@getTestActionModifier appdeAction=appdeAction/> async test${srfclassname('${singleAppMethod.getCodeName()}')}(context: any = {},data: any = {}): Promise<any> {
return true;
}
<#if singleAppMethod.getMethodType?? && singleAppMethod.getMethodType()?? && singleAppMethod.getMethodType() == "FETCH">
<#assign dataSet = singleAppMethod.getPSDEDataSet() />
/**
* test${srfclassname('search${dataSet.getCodeName()}')}方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @returns {Promise<any>}
* @memberof ${srfclassname('${item.getCodeName()}')}ServiceBase
*/
<@getTestActionModifier appdeAction=appdeAction/> async test${srfclassname('search${dataSet.getCodeName()}')}(context: any = {},data: any = {}): Promise<any> {
return true;
}
</#if>
</#if>
</#if>
<#-- 检查行为是否可以执行 end -->
</#if>
</#if>
</#list>
......
<#ibiztemplate>
TARGET=PSAPPDATAENTITY
</#ibiztemplate>
<#macro getMainStateOPPrivs mainState>
<#compress>
<#if mainState.getPSDEMainStateOPPrivs?? && mainState.getPSDEMainStateOPPrivs()??>
{<#list mainState.getPSDEMainStateOPPrivs() as mainStateOPPriv>'${mainStateOPPriv.getName()}':<#if mainState.isOPPrivAllowMode()>1<#else>0</#if><#if mainStateOPPriv_has_next>,</#if></#list>}
<#else>
{}
</#if>
</#compress>
</#macro>
import { Environment } from '@/environments/environment';
import { UIActionTool,Util } from '@/utils';
import UIService from '../ui-service';
import { Subject } from 'rxjs';
import ${srfclassname('${item.getCodeName()}')}Service from '@/service/${srffilepath2(item.getCodeName())}/${srffilepath2(item.getCodeName())}-service';
import ${srfclassname('${item.getCodeName()}')}AuthService from '@/authservice/${srffilepath2(item.getCodeName())}/${srffilepath2(item.getCodeName())}-auth-service';
<#if item.getAllPSAppDEUIActions()??>
<#list item.getAllPSAppDEUIActions() as appdeUIAction>
<#if appdeUIAction.getPSAppDataEntity()??>
......@@ -85,6 +95,13 @@ export default class ${srfclassname('${item.getCodeName()}')}UIServiceBase exten
*/
public allDeMainStateMap:Map<string,string> = new Map();
/**
* 主状态操作标识Map
*
* @memberof ${srfclassname('${item.getCodeName()}')}UIServiceBase
*/
public allDeMainStateOPPrivsMap:Map<string,any> = new Map();
/**
* Creates an instance of ${srfclassname('${item.getCodeName()}')}UIServiceBase.
*
......@@ -93,8 +110,10 @@ export default class ${srfclassname('${item.getCodeName()}')}UIServiceBase exten
*/
constructor(opts: any = {}) {
super(opts);
this.authService = new ${srfclassname('${item.getCodeName()}')}AuthService(opts);
this.initViewMap();
this.initDeMainStateMap();
this.initDeMainStateOPPrivsMap();
}
/**
......@@ -121,9 +140,21 @@ export default class ${srfclassname('${item.getCodeName()}')}UIServiceBase exten
<#if demState.getMSTag()??>
this.allDeMainStateMap.set('${demState.getMSTag()}','${demState.getMSTag()}');
</#if>
<#-- <#if demState.getId()?? && demState.getMSTag()??>
this.allDeMainStateMap.set('${demState.getId()}','${demState.getMSTag()}');
</#if> -->
</#list>
</#if>
}
/**
* 初始化主状态操作标识
*
* @memberof ${srfclassname('${item.getCodeName()}')}UIServiceBase
*/
public initDeMainStateOPPrivsMap(){
<#if item.getPSDataEntity?? && item.getPSDataEntity()?? && item.getPSDataEntity().getAllPSDEMainStates()??>
<#list item.getPSDataEntity().getAllPSDEMainStates() as demState>
<#if demState.getMSTag()??>
this.allDeMainStateOPPrivsMap.set('${demState.getMSTag()}',<@getMainStateOPPrivs mainState=demState />);
</#if>
</#list>
</#if>
}
......@@ -218,12 +249,12 @@ ${P.getLogicCode(appdeUIAction, "LOGIC.vue").code}
}
if(!Environment.isAppMode){
if(this.getDEMainStateTag(curData)){
<#noparse>return `MOBEDITVIEW:MSTAG:${ await this.getDEMainStateTag(curData)}`;</#noparse>
<#noparse>return `MOBEDITVIEW:MSTAG:${ this.getDEMainStateTag(curData)}`;</#noparse>
}
return 'MOBEDITVIEW:';
}
if(this.getDEMainStateTag(curData)){
<#noparse>return `EDITVIEW:MSTAG:${ await this.getDEMainStateTag(curData)}`;</#noparse>
<#noparse>return `EDITVIEW:MSTAG:${ this.getDEMainStateTag(curData)}`;</#noparse>
}
return 'EDITVIEW:';
}
......@@ -302,16 +333,14 @@ ${P.getLogicCode(appdeUIAction, "LOGIC.vue").code}
* @param curData 当前数据
* @memberof ${srfclassname('${item.getCodeName()}')}UIServiceBase
*/
public async getDEMainStateTag(curData:any){
public getDEMainStateTag(curData:any){
if(this.mainStateFields.length === 0) return null;
this.mainStateFields.forEach((singleMainField:any) =>{
if(!(singleMainField in curData)){
console.error(`当前数据对象不包含属性singleMainField,可能会发生错误`);
<#noparse>console.warn(`当前数据对象不包含属性${singleMainField},可能会发生错误`);</#noparse>
}
})
let strTag:String = "";
for (let i = 0; i <= 1; i++) {
let strTag:string = (curData[this.mainStateFields[0]])?(i == 0) ? curData[this.mainStateFields[0]] : "":"";
if (this.mainStateFields.length >= 2) {
......@@ -334,4 +363,28 @@ ${P.getLogicCode(appdeUIAction, "LOGIC.vue").code}
return null;
}
/**
* 获取数据对象当前操作标识
*
* @param data 当前数据
* @memberof ${srfclassname('${item.getCodeName()}')}UIServiceBase
*/
public getDEMainStateOPPrivs(data:any){
if(this.getDEMainStateTag(data)){
return this.allDeMainStateOPPrivsMap.get((this.getDEMainStateTag(data) as string));
}else{
return null;
}
}
/**
* 获取数据对象所有的操作标识
*
* @param data 当前数据
* @memberof ${srfclassname('${item.getCodeName()}')}UIServiceBase
*/
public getAllOPPrivs(data:any){
return this.authService.getOPPrivs(this.getDEMainStateOPPrivs(data));
}
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册