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

Merge branch 'dev'

上级 9231f8f8
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<#if view.getViewType() == "DEGRIDVIEW" || view.getViewType() == "DEGRIDVIEW9"> <#if view.getViewType() == "DEGRIDVIEW" || view.getViewType() == "DEGRIDVIEW9">
:isOpenEdit="${view.isRowEditDefault()?c}" :isOpenEdit="${view.isRowEditDefault()?c}"
:gridRowActiveMode="gridRowActiveMode" :gridRowActiveMode="gridRowActiveMode"
:isformDruipart="isformDruipart"
@save="onSave" @save="onSave"
</#if> </#if>
updateAction="<#if ctrl.getUpdatePSControlAction()?? && ctrl.getUpdatePSControlAction().getPSAppDEMethod()??>${ctrl.getUpdatePSControlAction().getPSAppDEMethod().getCodeName()}</#if>" updateAction="<#if ctrl.getUpdatePSControlAction()?? && ctrl.getUpdatePSControlAction().getPSAppDEMethod()??>${ctrl.getUpdatePSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div class='tabviewpanel<#if ctrl.getPSSysCss()??><#assign singleCss = ctrl.getPSSysCss()> ${singleCss.getCssName()}</#if>' style="height:100%;"> <div class='tabviewpanel<#if ctrl.getPSSysCss()??><#assign singleCss = ctrl.getPSSysCss()> ${singleCss.getCssName()}</#if>' style="height:100%;">
<tabs :value="tabValue" :animated="false" class='tabexppanel' name='${ctrl.getCodeName()?lower_case}' @on-click="tabPanelClick"> <tabs :value="tabValue" :animated="false" class='tabexppanel' name='${ctrl.getCodeName()?lower_case}' @on-click="tabPanelClick">
<#list ctrl.getPSControls() as tabviewpanel> <#list ctrl.getPSControls() as tabviewpanel>
<tab-pane :index="${tabviewpanel_index}" name='${tabviewpanel.name}' tab='${ctrl.getCodeName()?lower_case}' class='<#if tabviewpanel.getPSSysCss?? && tabviewpanel.getPSSysCss()??>${tabviewpanel.getPSSysCss().getCssName()}</#if>' <tab-pane :index="${tabviewpanel_index}" name='${tabviewpanel.name}' tab='${ctrl.getCodeName()?lower_case}' class='<#if tabviewpanel.getPSSysCss?? && tabviewpanel.getPSSysCss()??>${tabviewpanel.getPSSysCss().getCssName()}</#if>' v-if="computedAuthorizedPanel('${tabviewpanel.name}')"
:label="(h) =>{ :label="(h) =>{
return h('div', [ return h('div', [
<#if tabviewpanel.getPSSysImage()??> <#if tabviewpanel.getPSSysImage()??>
...@@ -43,9 +43,21 @@ ...@@ -43,9 +43,21 @@
</div> </div>
</#if> </#if>
</template> </template>
<#assign import_block>
import ${srfclassname('${appde.getCodeName()}')}AuthService from '@/authservice/${srffilepath2(appde.getCodeName())}/${srffilepath2(appde.getCodeName())}-auth-service';
import { Environment } from '@/environments/environment';
</#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
/**
* 实体权限服务对象
*
* @type {${appde.getCodeName()}AuthService}
* @memberof TabExpViewtabexppanelBase
*/
public appAuthService: ${appde.getCodeName()}AuthService = new ${appde.getCodeName()}AuthService();
/** /**
* 是否初始化 * 是否初始化
* *
...@@ -107,6 +119,15 @@ ...@@ -107,6 +119,15 @@
*/ */
public action:any = ''; public action:any = '';
/**
* 分页面板统一资源存储对象
*
* @public
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public authResourceObject:any = {<#list ctrl.getPSControls() as tabviewpanel>'${tabviewpanel.name}':<#if tabviewpanel.getEmbeddedPSAppDEView()?? && tabviewpanel.getEmbeddedPSAppDEView().getAccessKey()??>'${tabviewpanel.getEmbeddedPSAppDEView().getAccessKey()}'<#else>null</#if><#if tabviewpanel_has_next>,</#if></#list>};
/** /**
* 被激活的分页面板 * 被激活的分页面板
* *
...@@ -115,6 +136,42 @@ ...@@ -115,6 +136,42 @@
*/ */
public activiedTabViewPanel: string = '<#list ctrl.getPSControls() as tabviewpanel><#if tabviewpanel_index==0>${tabviewpanel.name}</#if></#list>'; public activiedTabViewPanel: string = '<#list ctrl.getPSControls() as tabviewpanel><#if tabviewpanel_index==0>${tabviewpanel.name}</#if></#list>';
/**
* 计算激活分页面板
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public computedActiviedPanel(){
if(Environment.enablePermissionValid){
if(Object.keys(this.authResourceObject).length >0){
let targetResult:Array<any> = [];
Object.keys(this.authResourceObject).forEach((item:any) =>{
if(this.computedAuthorizedPanel(item))
targetResult.push(item);
})
if(targetResult.length >0){
this.activiedTabViewPanel = targetResult[0];
this.tabPanelClick(targetResult[0]);
}
}
}
}
/**
* 计算分页面板是否显示
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public computedAuthorizedPanel(name:string){
if(!Environment.enablePermissionValid)
return true;
if(!this.authResourceObject[name])
return true;
return this.appAuthService.getResourcePermission(this.authResourceObject[name]);
}
/** /**
* 分页视图面板数据变更 * 分页视图面板数据变更
* *
...@@ -147,6 +204,7 @@ ...@@ -147,6 +204,7 @@
Object.assign(this.context,{srfparentdename:'${appDataEntity.getCodeName()}',srfparentkey:this.context.${appDataEntity.getCodeName()?lower_case}}) Object.assign(this.context,{srfparentdename:'${appDataEntity.getCodeName()}',srfparentkey:this.context.${appDataEntity.getCodeName()?lower_case}})
} }
</#if> </#if>
this.computedActiviedPanel();
if (this.viewState) { if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => { this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) { if (!Object.is(tag, this.name)) {
......
...@@ -15,7 +15,7 @@ ${ctrl.render.code} ...@@ -15,7 +15,7 @@ ${ctrl.render.code}
<#list ctrl.getPSDEEditForms() as form> <#list ctrl.getPSDEEditForms() as form>
<#assign handler = form.getPSAjaxControlHandler() /> <#assign handler = form.getPSAjaxControlHandler() />
<view_${form.getName()} <view_${form.getName()}
v-if="activeForm == '${form.getName()}'" v-show="activeForm == '${form.getName()}'"
:key="'${form.name}'" :key="'${form.name}'"
:viewState='wizardState' :viewState='wizardState'
:context="context" :context="context"
...@@ -70,6 +70,22 @@ ${ctrl.render.code} ...@@ -70,6 +70,22 @@ ${ctrl.render.code}
*/ */
@Prop({ default: true }) public showBusyIndicator?: boolean; @Prop({ default: true }) public showBusyIndicator?: boolean;
/**
* 状态属性
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public stateField: string = '<#if ctrl.getStatePSAppDEField?? && ctrl.getStatePSAppDEField()??>${ctrl.getStatePSAppDEField().getCodeName()?lower_case}</#if>';
/**
* 步骤标识集合
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public stepTags: any = {};
/** /**
* 获取多项数据 * 获取多项数据
* *
...@@ -159,7 +175,7 @@ ${ctrl.render.code} ...@@ -159,7 +175,7 @@ ${ctrl.render.code}
*/ */
public created(): void { public created(): void {
this.regFormActions(); this.regFormActions();
if(this.activeForm) { if(this.activeForm && !this.stateField) {
this.historyForms.push(this.activeForm); this.historyForms.push(this.activeForm);
} }
if (this.viewState) { if (this.viewState) {
...@@ -195,7 +211,7 @@ ${ctrl.render.code} ...@@ -195,7 +211,7 @@ ${ctrl.render.code}
public regFormActions() { public regFormActions() {
<#if ctrl.getPSDEWizard()?? && ctrl.getPSDEWizard().getPSDEWizardForms()??> <#if ctrl.getPSDEWizard()?? && ctrl.getPSDEWizard().getPSDEWizardForms()??>
<#list ctrl.getPSDEWizard().getPSDEWizardForms() as form> <#list ctrl.getPSDEWizard().getPSDEWizardForms() as form>
this.regFormAction('${ctrl.name}_form_${form.getFormTag()}', [<#if form.getStepActions()??><#list form.getStepActions() as action><#if action_index gt 0>,</#if>'${action}'</#list></#if>]); this.regFormAction('${ctrl.name}_form_${form.getFormTag()}',{<#if form.getLoadPSDEAction?? && form.getLoadPSDEAction()??>loadAction:"${form.getLoadPSDEAction().getCodeName()}",</#if><#if form.getGoBackPSDEAction?? && form.getGoBackPSDEAction()??>preAction:'${form.getGoBackPSDEAction().getCodeName()}',</#if><#if form.getSavePSDEAction?? && form.getSavePSDEAction()??>saveAction:'${form.getSavePSDEAction().getCodeName()}',</#if><#if form.getStepActions()??>actions:[<#list form.getStepActions() as action><#if action_index gt 0>,</#if>'${action}'</#list>]</#if>},<#if form.getPSDEWizardStep()?? && form.getPSDEWizardStep().getStepTag()??>'${form.getPSDEWizardStep().getStepTag()}'<#else>null</#if>);
</#list> </#list>
</#if> </#if>
} }
...@@ -205,8 +221,9 @@ ${ctrl.render.code} ...@@ -205,8 +221,9 @@ ${ctrl.render.code}
* *
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public regFormAction(name: string, actions: Array<string>) { public regFormAction(name: string, actionParams: any,stepTag:any) {
this.stepActions[name] = actions; this.stepActions[name] = actionParams;
this.stepTags[name] = stepTag;
this.wizardForms.push(name); this.wizardForms.push(name);
} }
...@@ -227,7 +244,7 @@ ${ctrl.render.code} ...@@ -227,7 +244,7 @@ ${ctrl.render.code}
if(response.data.${ctrl.getPSAppDataEntity().getCodeName()?lower_case}){ if(response.data.${ctrl.getPSAppDataEntity().getCodeName()?lower_case}){
Object.assign(this.context,{${ctrl.getPSAppDataEntity().getCodeName()?lower_case}:response.data.${ctrl.getPSAppDataEntity().getCodeName()?lower_case}}) Object.assign(this.context,{${ctrl.getPSAppDataEntity().getCodeName()?lower_case}:response.data.${ctrl.getPSAppDataEntity().getCodeName()?lower_case}})
} }
this.formLoad(); this.formLoad(this.formParam);
} }
}).catch((response: any) => { }).catch((response: any) => {
if (response && response.status === 401) { if (response && response.status === 401) {
...@@ -243,9 +260,28 @@ ${ctrl.render.code} ...@@ -243,9 +260,28 @@ ${ctrl.render.code}
* *
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public formLoad() { public formLoad(data:any) {
if(this.stateField) this.computedActiveForm(data);
if(this.activeForm) { if(this.activeForm) {
this.wizardState.next({ tag: this.activeForm, action: 'load', data: this.formParam }); this.wizardState.next({ tag: this.activeForm, action:'panelaction',data: {action:this.stepActions[this.activeForm].loadAction,emitAction:'load',data:this.formParam} });
}
}
/**
* 根据状态获取当前激活表单
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public computedActiveForm(data:any){
if(data && data[this.stateField]){
if(Object.keys(this.stepTags).length >0){
Object.keys(this.stepTags).forEach((name:string) =>{
if(this.stepTags[name] === data[this.stateField]){
this.activeForm = name;
return;
}
})
}
} }
} }
...@@ -300,13 +336,25 @@ ${ctrl.render.code} ...@@ -300,13 +336,25 @@ ${ctrl.render.code}
Object.assign(this.formParam, args); Object.assign(this.formParam, args);
if(Object.is(this.curState, 'NEXT')) { if(Object.is(this.curState, 'NEXT')) {
this.historyForms.push(name); this.historyForms.push(name);
if (this.getNextForm()) { if(!this.stateField){
this.activeForm = this.getNextForm(); if (this.getNextForm()) {
this.activeForm = this.getNextForm();
setTimeout(() => {
this.formLoad(this.formParam);
}, 1);
} else {
this.doFinish();
}
}else{
setTimeout(() => {
this.formLoad(this.formParam);
}, 1);
}
}else if(Object.is(this.curState, 'PREV')) {
if(this.stateField){
setTimeout(() => { setTimeout(() => {
this.formLoad(); this.formLoad(this.formParam);
}, 1); }, 1);
} else {
this.doFinish();
} }
}else if(Object.is(this.curState, 'FINISH')) { }else if(Object.is(this.curState, 'FINISH')) {
this.doFinish(); this.doFinish();
...@@ -335,14 +383,32 @@ ${ctrl.render.code} ...@@ -335,14 +383,32 @@ ${ctrl.render.code}
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public onClickPrev() { public onClickPrev() {
const length = this.historyForms.length; if(!this.stateField){
if(length > 1) { const length = this.historyForms.length;
this.curState = 'PREV'; if(length > 1) {
this.activeForm = this.historyForms[length - 1]; this.curState = 'PREV';
setTimeout(() => { this.activeForm = this.historyForms[length - 1];
this.formLoad(); setTimeout(() => {
}, 1); this.formLoad(this.formParam);
this.historyForms.splice(length - 1, 1); }, 1);
this.historyForms.splice(length - 1, 1);
}
}else{
if(this.activeForm) {
if(this.$refs && this.$refs[this.activeForm]){
let form: any = this.$refs[this.activeForm];
if(form.formValidateStatus()) {
this.curState = 'PREV';
if(!this.stepActions[this.activeForm].preAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc:this.$t('app.wizardPanel.preactionmessage') as string });
return;
}
this.wizardState.next({ tag: this.activeForm, action:'panelaction',data: {action:this.stepActions[this.activeForm].preAction,emitAction:'save',data:this.formParam} });
} else {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.rulesException') as string) });
}
}
}
} }
} }
...@@ -357,7 +423,7 @@ ${ctrl.render.code} ...@@ -357,7 +423,7 @@ ${ctrl.render.code}
let form: any = this.$refs[this.activeForm]; let form: any = this.$refs[this.activeForm];
if(form.formValidateStatus()) { if(form.formValidateStatus()) {
this.curState = 'NEXT'; this.curState = 'NEXT';
this.wizardState.next({ tag: this.activeForm, action: 'save', data: this.formParam }); this.wizardState.next({ tag: this.activeForm, action:'panelaction',data: {action:this.stepActions[this.activeForm].saveAction,emitAction:'save',data:this.formParam} });
} else { } else {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.rulesException') as string) }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.rulesException') as string) });
} }
...@@ -376,7 +442,7 @@ ${ctrl.render.code} ...@@ -376,7 +442,7 @@ ${ctrl.render.code}
let form: any = this.$refs[this.activeForm]; let form: any = this.$refs[this.activeForm];
if(form.formValidateStatus()) { if(form.formValidateStatus()) {
this.curState = 'FINISH'; this.curState = 'FINISH';
this.wizardState.next({ tag: this.activeForm, action: 'save', data: this.formParam }); this.wizardState.next({ tag: this.activeForm, action:'panelaction',data: {action:this.stepActions[this.activeForm].saveAction,emitAction:'save',data:this.formParam} });
} else { } else {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.rulesException') as string) }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.rulesException') as string) });
} }
...@@ -391,7 +457,7 @@ ${ctrl.render.code} ...@@ -391,7 +457,7 @@ ${ctrl.render.code}
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public isDisabled(type: string) { public isDisabled(type: string) {
const actions: Array<string> = this.stepActions[this.activeForm] const actions: Array<string> = this.stepActions[this.activeForm].actions;
if(actions && actions.indexOf(type) < 0) { if(actions && actions.indexOf(type) < 0) {
return true; return true;
} }
......
...@@ -239,11 +239,12 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -239,11 +239,12 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
* *
* @public * @public
* @param {*} [data={}] * @param {*} [data={}]
* @param {string} [action]
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public onFormLoad(data: any = {}): void { public onFormLoad(data: any = {},action:string): void {
this.setFormEnableCond(data); this.setFormEnableCond(data);
this.fillForm(data); this.fillForm(data,action);
<#if ctrl.getControlType() == 'FORM'> <#if ctrl.getControlType() == 'FORM'>
this.oldData = {}; this.oldData = {};
Object.assign(this.oldData, JSON.parse(JSON.stringify(this.data))); Object.assign(this.oldData, JSON.parse(JSON.stringify(this.data)));
...@@ -256,15 +257,19 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -256,15 +257,19 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
* 值填充 * 值填充
* *
* @param {*} [_datas={}] * @param {*} [_datas={}]
* @param {string} [action]
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public fillForm(_datas: any = {}): void { public fillForm(_datas: any = {},action:string): void {
this.ignorefieldvaluechange = true; this.ignorefieldvaluechange = true;
Object.keys(_datas).forEach((name: string) => { Object.keys(_datas).forEach((name: string) => {
if (this.data.hasOwnProperty(name)) { if (this.data.hasOwnProperty(name)) {
this.data[name] = _datas[name]; this.data[name] = _datas[name];
} }
}); });
if(Object.is(action,'loadDraft')){
this.createDefault();
}
this.$nextTick(function () { this.$nextTick(function () {
this.ignorefieldvaluechange = false; this.ignorefieldvaluechange = false;
}) })
...@@ -287,6 +292,44 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -287,6 +292,44 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
}); });
} }
/**
* 新建默认值
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public createDefault(){
<#list ctrl.getAllPSDEFormDetails() as formdetail><#t>
<#if formdetail.getCreateDV?? && formdetail.getCreateDV()??><#t>
<#if !(formdetail.getCreateDV() == '') || formdetail.getCreateDVT() == 'CURTIME'><#t>
if (this.data.hasOwnProperty('${formdetail.getCodeName()?lower_case}')) {
<#-- 网页请求 -->
<#if formdetail.getCreateDVT() == 'CONTEXT'>
this.data['${formdetail.getCodeName()?lower_case}'] = this.viewparams['${formdetail.getCreateDV()}'];
<#-- 用户全局对象 -->
<#elseif formdetail.getCreateDVT() == 'SESSION'>
this.data['${formdetail.getCodeName()?lower_case}'] = this.context['${formdetail.getCreateDV()}'];
<#-- 当前应用数据 -->
<#elseif formdetail.getCreateDVT() == 'APPDATA'>
this.data['${formdetail.getCodeName()?lower_case}'] = this.context['${formdetail.getCreateDV()}'];
<#-- 当前操作用户(名称) -->
<#elseif formdetail.getCreateDVT() == 'OPERATORNAME'>
this.data['${formdetail.getCodeName()?lower_case}'] = this.context['srfusername'];
<#-- 当前操作用户(编号) -->
<#elseif formdetail.getCreateDVT() == 'OPERATOR'>
this.data['${formdetail.getCodeName()?lower_case}'] = this.context['srfuserid'];
<#-- 当前时间 -->
<#elseif formdetail.getCreateDVT() == 'CURTIME'>
this.data['${formdetail.getCodeName()?lower_case}'] = this.$util.dateFormat(new Date());
<#else>
<#-- 默认值 -->
<#assign datatype=srfjavatype(formdetail.getStdDataType())>
this.data['${formdetail.getCodeName()?lower_case}'] = <#if datatype=='BigInteger' || datatype=='Integer' || datatype=='Double' || datatype=='Decimal' || datatype=='Float' || datatype=='BigDecimal'>${formdetail.getCreateDV()}<#else>'${formdetail.getCreateDV()}'</#if>;
</#if>
}
</#if>
</#if>
</#list>
}
/** /**
* 重置草稿表单状态 * 重置草稿表单状态
* *
...@@ -618,7 +661,6 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -618,7 +661,6 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
get.then((response: any) => { get.then((response: any) => {
if (response && response.status === 200) { if (response && response.status === 200) {
const data = response.data; const data = response.data;
this.onFormLoad(data);
this.$emit('load', data); this.$emit('load', data);
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'load', data: data }); this.formState.next({ type: 'load', data: data });
...@@ -662,7 +704,7 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -662,7 +704,7 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
const data = response.data; const data = response.data;
this.resetDraftFormStates(); this.resetDraftFormStates();
this.onFormLoad(data); this.onFormLoad(data,'loadDraft');
setTimeout(() => { setTimeout(() => {
const form: any = this.$refs.form; const form: any = this.$refs.form;
if (form) { if (form) {
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
:load="loadTreeNode" :load="loadTreeNode"
:tree-props="{ children: 'children', hasChildren: 'leaf' }" :tree-props="{ children: 'children', hasChildren: 'leaf' }"
:select-on-indeterminate="isSingleSelect" :select-on-indeterminate="isSingleSelect"
:highlight-current-row="isSingleSelect"
@current-change="select" @current-change="select"
> >
<#if ctrl.getPSDETreeColumns()??> <#if ctrl.getPSDETreeColumns()??>
...@@ -271,7 +272,7 @@ ...@@ -271,7 +272,7 @@
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public getData(): any { public getData(): any {
return null; return this.selections.length > 0 ? this.selections[0] : null;
} }
/** /**
...@@ -326,6 +327,31 @@ ...@@ -326,6 +327,31 @@
this.$emit('selectionchange', this.selections); this.$emit('selectionchange', this.selections);
} }
/**
* 打开编辑数据
*
* @returns
* @memberof TreeTableBase
*/
public opendata(args: any) {
if(this.selections.length === 0) {
return;
}
<#if ctrl.getPSDETreeNodes()??>
<#list ctrl.getPSDETreeNodes() as node>
if(Object.is(this.selections[0].id.split(';')[0], '${srfjavastring(node.getNodeType())}')) {
<#if node.getPSAppViewRefs()??>
<#list node.getPSAppViewRefs() as viewRefs>
<#if viewRefs.name == "EDITDATA">
this.${srfjavastring(node.getNodeType())}_opendata(args);
</#if>
</#list>
</#if>
}
</#list>
</#if>
}
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
${item.render.code} ${item.render.code}
<#else> <#else>
<@badge item> <@badge item>
<i-button type="primary" @click="${item.getName()}_click($event)"<#if item.getPSSysCss?? && item.getPSSysCss()??> class="${item.getPSSysCss().getCssName()}"</#if> <i-button type="primary" :disabled="detailsModel.${item.getName()}.disabled" @click="${item.getName()}_click($event)"<#if item.getPSSysCss?? && item.getPSSysCss()??> class="${item.getPSSysCss().getCssName()}"</#if>
style="<#if item.getHeight() gt 0>height: ${item.getHeight()?c}px;</#if><#if item.getWidth() gt 0>width: ${item.getWidth()?c}px;</#if>"> style="<#if item.getHeight() gt 0>height: ${item.getHeight()?c}px;</#if><#if item.getWidth() gt 0>width: ${item.getWidth()?c}px;</#if>">
<#if item.getPSSysImage()??><#assign img=item.getPSSysImage()><#if img.getCssClass()?? && (img.getCssClass()?length gt 0)><i class="${img.getCssClass()}" style="margin-right: 2px;"></i></#if></#if> <#if item.getPSSysImage()??><#assign img=item.getPSSysImage()><#if img.getCssClass()?? && (img.getCssClass()?length gt 0)><i class="${img.getCssClass()}" style="margin-right: 2px;"></i></#if></#if>
<#if item.isShowCaption()><span ><#if item.getCaptionItemName()?? && item.getCaptionItemName()?length gt 0>{{data.${item.getCaptionItemName()}}}<#else><#if langbase??>{{$t('${langbase}.details.${item.name}')}}<#else>${item.getCaption()}</#if></#if></span></#if> <#if item.isShowCaption()><span ><#if item.getCaptionItemName()?? && item.getCaptionItemName()?length gt 0>{{data.${item.getCaptionItemName()}}}<#else><#if langbase??>{{$t('${langbase}.details.${item.name}')}}<#else>${item.getCaption()}</#if></#if></span></#if>
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
</#ibizinclude> </#ibizinclude>
<#assign detail>caption: '${item.getCaption()}', detailType: '${item.getDetailType()}', name: '${item.getName()}', visible: <#if item.getPSDEFDGroupLogic('PANELVISIBLE')??>false<#else>true</#if>, isShowCaption: ${item.isShowCaption()?c}, form: this, isControlledContent: <#if item.getShowMoreMode?? && item.getShowMoreMode()?? && item.getShowMoreMode() == 1>true<#else>false</#if> </#assign> <#assign detail>caption: '${item.getCaption()}', detailType: '${item.getDetailType()}', name: '${item.getName()}', visible: <#if item.getPSDEFDGroupLogic('PANELVISIBLE')??>false<#else>true</#if>, isShowCaption: ${item.isShowCaption()?c}, form: this, isControlledContent: <#if item.getShowMoreMode?? && item.getShowMoreMode()?? && item.getShowMoreMode() == 1>true<#else>false</#if> </#assign>
<#if item.getDetailType() == 'BUTTON'> <#if item.getDetailType() == 'BUTTON'>
new FormButtonModel({ ${detail}<#if item.getPSUIAction()??><#assign uiaction=item.getPSUIAction()>, uiaction: { type: '${uiaction.getUIActionType()}', new FormButtonModel({ ${detail},disabled: false<#if item.getPSUIAction()??><#assign uiaction=item.getPSUIAction()>, uiaction: { type: '${uiaction.getUIActionType()}',
tag: '${uiaction.getUIActionTag()}'<#if (uiaction.getActionTarget()!="")>, actiontarget: '${uiaction.getActionTarget()}'</#if> }</#if> }) tag: '${uiaction.getUIActionTag()}'<#if (uiaction.getActionTarget()!="")>,actiontarget: '${uiaction.getActionTarget()}'</#if><#if uiaction.getNoPrivDisplayMode(view)??>,noprivdisplaymode:${uiaction.getNoPrivDisplayMode(view)}</#if><#if uiaction.getDataAccessAction()??>,dataaccaction:'${uiaction.getDataAccessAction()}'</#if>,visabled: true,disabled: false}</#if> })
<#elseif item.getDetailType() == 'DRUIPART'> <#elseif item.getDetailType() == 'DRUIPART'>
new FormDRUIPartModel({ ${detail} }) new FormDRUIPartModel({ ${detail} })
<#elseif item.getDetailType() == 'FORMITEM'> <#elseif item.getDetailType() == 'FORMITEM'>
......
...@@ -383,6 +383,9 @@ import schema from 'async-validator'; ...@@ -383,6 +383,9 @@ import schema from 'async-validator';
if(!falg.hasOwnProperty("isPast")){ if(!falg.hasOwnProperty("isPast")){
falg.isPast = true; falg.isPast = true;
} }
if(!this.data[name]){
falg.isPast = true;
}
return falg; return falg;
} }
...@@ -727,6 +730,26 @@ import schema from 'async-validator'; ...@@ -727,6 +730,26 @@ import schema from 'async-validator';
this.data[name] = value; this.data[name] = value;
} }
/**
* 计算表单按钮权限状态
*
* @param {*} [data] 传入数据
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public computeButtonState(data:any){
let targetData:any = this.transformData(data);
if(this.detailsModel && Object.keys(this.detailsModel).length >0){
Object.keys(this.detailsModel).forEach((name:any) =>{
if(this.detailsModel[name] && this.detailsModel[name].uiaction && this.detailsModel[name].uiaction.dataaccaction && Object.is(this.detailsModel[name].detailType,"BUTTON")){
let tempUIAction:any = JSON.parse(JSON.stringify(this.detailsModel[name].uiaction));
ViewTool.calcActionItemAuthState(targetData,[tempUIAction],this.appUIService);
this.detailsModel[name].visible = tempUIAction.visabled;
this.detailsModel[name].disabled = tempUIAction.disabled;
}
})
}
}
<#list ctrl.getAllPSDEFormDetails() as formdetail> <#list ctrl.getAllPSDEFormDetails() as formdetail>
<#if formdetail.getDetailType?? && formdetail.getDetailType() == 'BUTTON'> <#if formdetail.getDetailType?? && formdetail.getDetailType() == 'BUTTON'>
<#if formdetail.getActionType?? && formdetail.getActionType()??> <#if formdetail.getActionType?? && formdetail.getActionType()??>
...@@ -901,6 +924,9 @@ import schema from 'async-validator'; ...@@ -901,6 +924,9 @@ import schema from 'async-validator';
if (Object.is('refresh', action)) { if (Object.is('refresh', action)) {
this.refresh(data); this.refresh(data);
} }
if (Object.is('panelaction', action)) {
this.panelAction(data.action,data.emitAction,data);
}
}); });
} }
this.dataChang this.dataChang
...@@ -1018,6 +1044,7 @@ import schema from 'async-validator'; ...@@ -1018,6 +1044,7 @@ import schema from 'async-validator';
const data = response.data; const data = response.data;
this.onFormLoad(data,'load'); this.onFormLoad(data,'load');
this.$emit('load', data); this.$emit('load', data);
this.computeButtonState(data);
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'load', data: data }); this.formState.next({ type: 'load', data: data });
}); });
...@@ -1068,6 +1095,7 @@ import schema from 'async-validator'; ...@@ -1068,6 +1095,7 @@ import schema from 'async-validator';
</#list> </#list>
data.${appde.getCodeName()?lower_case} = null; data.${appde.getCodeName()?lower_case} = null;
this.$emit('load', data); this.$emit('load', data);
this.computeButtonState(data);
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'load', data: data }); this.formState.next({ type: 'load', data: data });
}); });
...@@ -1125,6 +1153,7 @@ import schema from 'async-validator'; ...@@ -1125,6 +1153,7 @@ import schema from 'async-validator';
const data = response.data; const data = response.data;
this.onFormLoad(data,'autoSave'); this.onFormLoad(data,'autoSave');
this.$emit('save', data); this.$emit('save', data);
this.computeButtonState(data);
<#if ctrl.getControlType() == 'FORM'> <#if ctrl.getControlType() == 'FORM'>
AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data}); AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data});
</#if> </#if>
...@@ -1211,6 +1240,7 @@ import schema from 'async-validator'; ...@@ -1211,6 +1240,7 @@ import schema from 'async-validator';
const data = response.data; const data = response.data;
this.onFormLoad(data,'save'); this.onFormLoad(data,'save');
this.$emit('save', data); this.$emit('save', data);
this.computeButtonState(data);
<#if ctrl.getControlType() == 'FORM'> <#if ctrl.getControlType() == 'FORM'>
AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data}); AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data});
</#if> </#if>
...@@ -1425,6 +1455,50 @@ import schema from 'async-validator'; ...@@ -1425,6 +1455,50 @@ import schema from 'async-validator';
} }
</#if> </#if>
/**
* 面板行为
*
* @param {string} [action] 调用的实体行为
* @param {string} [emitAction] 抛出行为
* @param {*} [data={}] 传入数据
* @param {boolean} [showloading] 是否显示加载状态
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public panelAction(action:string,emitAction:string,data:any ={},showloading?:boolean):void{
if (!action || (action && Object.is(action, ''))) {
return;
}
const arg: any = { ...data };
const formdata = this.getValues();
Object.assign(arg, formdata);
Object.assign(arg,this.viewparams);
const post: Promise<any> = this.service.frontLogic(action,JSON.parse(JSON.stringify(this.context)),arg, showloading);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
const data = response.data;
this.onFormLoad(data,emitAction);
this.$emit(emitAction, data);
this.$nextTick(() => {
this.formState.next({ type: emitAction, data: data });
});
}).catch((response: any) => {
if (response && response.status && response.data) {
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: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
return;
}
});
}
/** /**
* 表单项更新 * 表单项更新
* *
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
<#if !uiactionDetail.isShowCaption()> <#if !uiactionDetail.isShowCaption()>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
</#if> </#if>
<a v-show="scope.row.${uiaction.getUIActionTag()}.visabled" <#if !preUIAction??>:class="{'grid-first-uiaction':scope.row.${uiaction.getUIActionTag()}.visabled && scope.row.${uiaction.getUIActionTag()}.visabled}"</#if> <#if preUIAction??>:class="{'grid-uiaction-divider':scope.row.${preUIAction.getUIActionTag()}.visabled && scope.row.${uiaction.getUIActionTag()}.visabled}"</#if> :style="{'pointer-events':scope.row.${uiaction.getUIActionTag()}.disabled?'none':'auto'}" @click="uiAction(scope.row, '${uiaction.getUIActionTag()}', $event)"> <a v-show="scope.row.${uiaction.getUIActionTag()}.visabled" <#if !preUIAction??>:class="{'grid-first-uiaction':scope.row.${uiaction.getUIActionTag()}.visabled && scope.row.${uiaction.getUIActionTag()}.visabled}"</#if> <#if preUIAction??>:class="{'grid-uiaction-divider':scope.row.${preUIAction.getUIActionTag()}.visabled && scope.row.${uiaction.getUIActionTag()}.visabled}"</#if> :style="{'pointer-events':scope.row.${uiaction.getUIActionTag()}.disabled?'none':'auto','color':scope.row.${uiaction.getUIActionTag()}.disabled?'#7b7979':'#2d8cf0'}" @click="uiAction(scope.row, '${uiaction.getUIActionTag()}', $event)">
<#-- 取消分割线标签,使用样式替代分割线 end --> <#-- 取消分割线标签,使用样式替代分割线 end -->
<#if uiactionDetail.isShowIcon()><i class='<#if uiaction.getIconCls?? && uiaction.getIconCls()??>${uiaction.getIconCls()}</#if>'></i></#if> <#if uiactionDetail.isShowIcon()><i class='<#if uiaction.getIconCls?? && uiaction.getIconCls()??>${uiaction.getIconCls()}</#if>'></i></#if>
<#if uiactionDetail.isShowCaption()>{{<#if langbase??>$t('${langbase}.uiactions.${uiaction.getFullCodeName()?lower_case}')<#else>'${uiaction.getCaption()}'</#if>}}</#if> <#if uiactionDetail.isShowCaption()>{{<#if langbase??>$t('${langbase}.uiactions.${uiaction.getFullCodeName()?lower_case}')<#else>'${uiaction.getCaption()}'</#if>}}</#if>
......
...@@ -21,7 +21,11 @@ ${ctrl.render.code} ...@@ -21,7 +21,11 @@ ${ctrl.render.code}
:highlight-current-row ="isSingleSelect" :highlight-current-row ="isSingleSelect"
:row-class-name="getRowClassName" :row-class-name="getRowClassName"
:cell-class-name="getCellClassName" :cell-class-name="getCellClassName"
:height="isEnablePagingBar && items.length > 0 ? 'calc(100% - 50px)' : '100%'" <#if ctrl.isEnablePagingBar()>
max-height="items.length > 0 ? 'calc(100%-50px)' : '100%'"
<#else>
max-height="100%"
</#if>
@row-click="rowClick($event)" @row-click="rowClick($event)"
@select-all="selectAll($event)" @select-all="selectAll($event)"
@select="select($event)" @select="select($event)"
...@@ -189,6 +193,14 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -189,6 +193,14 @@ import { FormItemModel } from '@/model/form-detail';
</#if> </#if>
</#list> </#list>
</#if> </#if>
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop({default:false}) public isformDruipart?: boolean;
/** /**
* 显示处理提示 * 显示处理提示
...@@ -1662,7 +1674,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1662,7 +1674,7 @@ import { FormItemModel } from '@/model/form-detail';
} }
this.$emit('save', successItems); this.$emit('save', successItems);
this.refresh([]); this.refresh([]);
if(errorItems.length === 0){ if(errorItems.length === 0 && successItems.length >0 && !this.isformDruipart){
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) }); this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{ }else{
errorItems.forEach((item:any,index:number)=>{ errorItems.forEach((item:any,index:number)=>{
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
height: 100%; height: 100%;
display:flex; display:flex;
flex-direction: column; flex-direction: column;
justify-content: start; justify-content: flex-start;
.el-table__row{ .el-table__row{
.grid-uiaction-divider { .grid-uiaction-divider {
padding:0 10px 0 10px; padding:0 10px 0 10px;
...@@ -67,13 +67,14 @@ ...@@ -67,13 +67,14 @@
} }
} }
.el-table__header-wrapper{ .el-table__header-wrapper{
display: contents; min-height: 45px;
} max-height: 100px;
.el-table__body-wrapper{ height: auto;
height: auto !important;
} }
.el-table__footer-wrapper{ .el-table__footer-wrapper{
display: contents; min-height: 45px;
max-height: 100px;
height: auto;
} }
} }
.grid-pagination { .grid-pagination {
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
<app-lang style='font-size: 15px;padding: 0 10px;'></app-lang> <app-lang style='font-size: 15px;padding: 0 10px;'></app-lang>
<app-orgsector></app-orgsector> <app-orgsector></app-orgsector>
<app-user></app-user> <app-user></app-user>
<app-lock-scren />
<app-full-scren />
<app-theme style="width:45px;display: flex;justify-content: center;"></app-theme> <app-theme style="width:45px;display: flex;justify-content: center;"></app-theme>
</div> </div>
</header> </header>
......
...@@ -208,7 +208,7 @@ import { Environment } from '@/environments/environment'; ...@@ -208,7 +208,7 @@ import { Environment } from '@/environments/environment';
<#assign counter = uiaction.getPSAppCounter() /> <#assign counter = uiaction.getPSAppCounter() />
counterService:this.${srfclassname('${counter.getCodeName()}')}counterservice, counterService:this.${srfclassname('${counter.getCodeName()}')}counterservice,
<#if uiaction.getCounterId()??>counterId:"${uiaction.getCounterId()}",</#if> <#if uiaction.getCounterId()??>counterId:"${uiaction.getCounterId()}",</#if>
noprivdisplaymode:'<#if uiaction.getNoPrivDisplayMode(view)??>${uiaction.getNoPrivDisplayMode(view)}</#if>', noprivdisplaymode:<#if uiaction.getNoPrivDisplayMode(view)??>${uiaction.getNoPrivDisplayMode(view)}<#else>''</#if>,
dataaccaction:'<#if uiaction.getDataAccessAction()??>${uiaction.getDataAccessAction()}</#if>', dataaccaction:'<#if uiaction.getDataAccessAction()??>${uiaction.getDataAccessAction()}</#if>',
visabled:true,disabled:false visabled:true,disabled:false
</#if> </#if>
......
...@@ -198,11 +198,11 @@ ${front_block} ...@@ -198,11 +198,11 @@ ${front_block}
<#assign nextPSUIAction = item.getNextPSUIAction()/> <#assign nextPSUIAction = item.getNextPSUIAction()/>
<#if !(nextPSUIAction.getPSAppDataEntity?? && nextPSUIAction.getPSAppDataEntity()??)> <#if !(nextPSUIAction.getPSAppDataEntity?? && nextPSUIAction.getPSAppDataEntity()??)>
if (_this.${nextPSUIAction.getFullCodeName()} && _this.${nextPSUIAction.getFullCodeName()} instanceof Function) { if (_this.${nextPSUIAction.getFullCodeName()} && _this.${nextPSUIAction.getFullCodeName()} instanceof Function) {
_this.${nextPSUIAction.getFullCodeName()}(result.datas[0],context,params, $event, xData,actionContext); _this.${nextPSUIAction.getFullCodeName()}(result.datas,context,params, $event, xData,actionContext);
} }
<#else> <#else>
if (this.${nextPSUIAction.getFullCodeName()} && this.${nextPSUIAction.getFullCodeName()} instanceof Function) { if (this.${nextPSUIAction.getFullCodeName()} && this.${nextPSUIAction.getFullCodeName()} instanceof Function) {
this.${nextPSUIAction.getFullCodeName()}(result.datas[0],context,params, $event, xData,actionContext); this.${nextPSUIAction.getFullCodeName()}(result.datas,context,params, $event, xData,actionContext);
} }
</#if> </#if>
</#if> </#if>
...@@ -229,11 +229,11 @@ ${front_block} ...@@ -229,11 +229,11 @@ ${front_block}
<#assign nextPSUIAction = item.getNextPSUIAction()/> <#assign nextPSUIAction = item.getNextPSUIAction()/>
<#if !(nextPSUIAction.getPSAppDataEntity?? && nextPSUIAction.getPSAppDataEntity()??)> <#if !(nextPSUIAction.getPSAppDataEntity?? && nextPSUIAction.getPSAppDataEntity()??)>
if (_this.${nextPSUIAction.getFullCodeName()} && _this.${nextPSUIAction.getFullCodeName()} instanceof Function) { if (_this.${nextPSUIAction.getFullCodeName()} && _this.${nextPSUIAction.getFullCodeName()} instanceof Function) {
_this.${nextPSUIAction.getFullCodeName()}(result.datas[0],context,params, $event, xData,actionContext); _this.${nextPSUIAction.getFullCodeName()}(result.datas,context,params, $event, xData,actionContext);
} }
<#else> <#else>
if (this.${nextPSUIAction.getFullCodeName()} && this.${nextPSUIAction.getFullCodeName()} instanceof Function) { if (this.${nextPSUIAction.getFullCodeName()} && this.${nextPSUIAction.getFullCodeName()} instanceof Function) {
this.${nextPSUIAction.getFullCodeName()}(result.datas[0],context,params, $event, xData,actionContext); this.${nextPSUIAction.getFullCodeName()}(result.datas,context,params, $event, xData,actionContext);
} }
</#if> </#if>
</#if> </#if>
...@@ -261,11 +261,11 @@ ${front_block} ...@@ -261,11 +261,11 @@ ${front_block}
<#assign nextPSUIAction = item.getNextPSUIAction()/> <#assign nextPSUIAction = item.getNextPSUIAction()/>
<#if !(nextPSUIAction.getPSAppDataEntity?? && nextPSUIAction.getPSAppDataEntity()??)> <#if !(nextPSUIAction.getPSAppDataEntity?? && nextPSUIAction.getPSAppDataEntity()??)>
if (_this.${nextPSUIAction.getFullCodeName()} && _this.${nextPSUIAction.getFullCodeName()} instanceof Function) { if (_this.${nextPSUIAction.getFullCodeName()} && _this.${nextPSUIAction.getFullCodeName()} instanceof Function) {
_this.${nextPSUIAction.getFullCodeName()}(result.datas[0],context,params, $event, xData,actionContext); _this.${nextPSUIAction.getFullCodeName()}(result.datas,context,params, $event, xData,actionContext);
} }
<#else> <#else>
if (this.${nextPSUIAction.getFullCodeName()} && this.${nextPSUIAction.getFullCodeName()} instanceof Function) { if (this.${nextPSUIAction.getFullCodeName()} && this.${nextPSUIAction.getFullCodeName()} instanceof Function) {
this.${nextPSUIAction.getFullCodeName()}(result.datas[0],context,params, $event, xData,actionContext); this.${nextPSUIAction.getFullCodeName()}(result.datas,context,params, $event, xData,actionContext);
} }
</#if> </#if>
</#if> </#if>
...@@ -295,11 +295,11 @@ ${front_block} ...@@ -295,11 +295,11 @@ ${front_block}
<#assign nextPSUIAction = item.getNextPSUIAction()/> <#assign nextPSUIAction = item.getNextPSUIAction()/>
<#if !(nextPSUIAction.getPSAppDataEntity?? && nextPSUIAction.getPSAppDataEntity()??)> <#if !(nextPSUIAction.getPSAppDataEntity?? && nextPSUIAction.getPSAppDataEntity()??)>
if (_this.${nextPSUIAction.getFullCodeName()} && _this.${nextPSUIAction.getFullCodeName()} instanceof Function) { if (_this.${nextPSUIAction.getFullCodeName()} && _this.${nextPSUIAction.getFullCodeName()} instanceof Function) {
_this.${nextPSUIAction.getFullCodeName()}(result.datas[0],context,params, $event, xData,actionContext); _this.${nextPSUIAction.getFullCodeName()}(result.datas,context,params, $event, xData,actionContext);
} }
<#else> <#else>
if (this.${nextPSUIAction.getFullCodeName()} && this.${nextPSUIAction.getFullCodeName()} instanceof Function) { if (this.${nextPSUIAction.getFullCodeName()} && this.${nextPSUIAction.getFullCodeName()} instanceof Function) {
this.${nextPSUIAction.getFullCodeName()}(result.datas[0],context,params, $event, xData,actionContext); this.${nextPSUIAction.getFullCodeName()}(result.datas,context,params, $event, xData,actionContext);
} }
</#if> </#if>
</#if> </#if>
...@@ -427,11 +427,11 @@ ${front_block} ...@@ -427,11 +427,11 @@ ${front_block}
<#assign nextPSUIAction = item.getNextPSUIAction()/> <#assign nextPSUIAction = item.getNextPSUIAction()/>
<#if !(nextPSUIAction.getPSAppDataEntity?? && nextPSUIAction.getPSAppDataEntity()??)> <#if !(nextPSUIAction.getPSAppDataEntity?? && nextPSUIAction.getPSAppDataEntity()??)>
if (_this.${nextPSUIAction.getFullCodeName()} && _this.${nextPSUIAction.getFullCodeName()} instanceof Function) { if (_this.${nextPSUIAction.getFullCodeName()} && _this.${nextPSUIAction.getFullCodeName()} instanceof Function) {
_this.${nextPSUIAction.getFullCodeName()}(result.datas[0],context, params, $event, xData,actionContext); _this.${nextPSUIAction.getFullCodeName()}(result.datas,context, params, $event, xData,actionContext);
} }
<#else> <#else>
if (this.${nextPSUIAction.getFullCodeName()} && this.${nextPSUIAction.getFullCodeName()} instanceof Function) { if (this.${nextPSUIAction.getFullCodeName()} && this.${nextPSUIAction.getFullCodeName()} instanceof Function) {
this.${nextPSUIAction.getFullCodeName()}(result.datas[0],context, params, $event, xData,actionContext); this.${nextPSUIAction.getFullCodeName()}(result.datas,context, params, $event, xData,actionContext);
} }
</#if> </#if>
</#if> </#if>
...@@ -470,11 +470,11 @@ ${front_block} ...@@ -470,11 +470,11 @@ ${front_block}
<#assign nextPSUIAction = item.getNextPSUIAction()/> <#assign nextPSUIAction = item.getNextPSUIAction()/>
<#if !(nextPSUIAction.getPSAppDataEntity?? && nextPSUIAction.getPSAppDataEntity()??)> <#if !(nextPSUIAction.getPSAppDataEntity?? && nextPSUIAction.getPSAppDataEntity()??)>
if (_this.${nextPSUIAction.getFullCodeName()} && _this.${nextPSUIAction.getFullCodeName()} instanceof Function) { if (_this.${nextPSUIAction.getFullCodeName()} && _this.${nextPSUIAction.getFullCodeName()} instanceof Function) {
_this.${nextPSUIAction.getFullCodeName()}(result.datas[0],context,params, $event, xData,actionContext); _this.${nextPSUIAction.getFullCodeName()}(result.datas,context,params, $event, xData,actionContext);
} }
<#else> <#else>
if (this.${nextPSUIAction.getFullCodeName()} && this.${nextPSUIAction.getFullCodeName()} instanceof Function) { if (this.${nextPSUIAction.getFullCodeName()} && this.${nextPSUIAction.getFullCodeName()} instanceof Function) {
this.${nextPSUIAction.getFullCodeName()}(result.datas[0],context,params, $event, xData,actionContext); this.${nextPSUIAction.getFullCodeName()}(result.datas,context,params, $event, xData,actionContext);
} }
</#if> </#if>
</#if> </#if>
...@@ -514,11 +514,11 @@ ${front_block} ...@@ -514,11 +514,11 @@ ${front_block}
<#assign nextPSUIAction = item.getNextPSUIAction()/> <#assign nextPSUIAction = item.getNextPSUIAction()/>
<#if !(nextPSUIAction.getPSAppDataEntity?? && nextPSUIAction.getPSAppDataEntity()??)> <#if !(nextPSUIAction.getPSAppDataEntity?? && nextPSUIAction.getPSAppDataEntity()??)>
if (_this.${nextPSUIAction.getFullCodeName()} && _this.${nextPSUIAction.getFullCodeName()} instanceof Function) { if (_this.${nextPSUIAction.getFullCodeName()} && _this.${nextPSUIAction.getFullCodeName()} instanceof Function) {
_this.${nextPSUIAction.getFullCodeName()}(result.datas[0],context, params, $event, xData,actionContext); _this.${nextPSUIAction.getFullCodeName()}(result.datas,context, params, $event, xData,actionContext);
} }
<#else> <#else>
if (this.${nextPSUIAction.getFullCodeName()} && this.${nextPSUIAction.getFullCodeName()} instanceof Function) { if (this.${nextPSUIAction.getFullCodeName()} && this.${nextPSUIAction.getFullCodeName()} instanceof Function) {
this.${nextPSUIAction.getFullCodeName()}(result.datas[0],context, params, $event, xData,actionContext); this.${nextPSUIAction.getFullCodeName()}(result.datas,context, params, $event, xData,actionContext);
} }
</#if> </#if>
</#if> </#if>
...@@ -556,11 +556,11 @@ ${front_block} ...@@ -556,11 +556,11 @@ ${front_block}
<#assign nextPSUIAction = item.getNextPSUIAction()/> <#assign nextPSUIAction = item.getNextPSUIAction()/>
<#if !(nextPSUIAction.getPSAppDataEntity?? && nextPSUIAction.getPSAppDataEntity()??)> <#if !(nextPSUIAction.getPSAppDataEntity?? && nextPSUIAction.getPSAppDataEntity()??)>
if (_this.${nextPSUIAction.getFullCodeName()} && _this.${nextPSUIAction.getFullCodeName()} instanceof Function) { if (_this.${nextPSUIAction.getFullCodeName()} && _this.${nextPSUIAction.getFullCodeName()} instanceof Function) {
_this.${nextPSUIAction.getFullCodeName()}(result.datas[0],context, params, $event, xData,actionContext); _this.${nextPSUIAction.getFullCodeName()}(result.datas,context, params, $event, xData,actionContext);
} }
<#else> <#else>
if (this.${nextPSUIAction.getFullCodeName()} && this.${nextPSUIAction.getFullCodeName()} instanceof Function) { if (this.${nextPSUIAction.getFullCodeName()} && this.${nextPSUIAction.getFullCodeName()} instanceof Function) {
this.${nextPSUIAction.getFullCodeName()}(result.datas[0],context, params, $event, xData,actionContext); this.${nextPSUIAction.getFullCodeName()}(result.datas,context, params, $event, xData,actionContext);
} }
</#if> </#if>
</#if> </#if>
......
...@@ -10,6 +10,17 @@ ...@@ -10,6 +10,17 @@
../@MACRO/VIEW_CONTENT-BASE.vue.ftl ../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
/**
* 打开编辑数据
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public opendata(args: any[],params?: any, $event?: any, xData?: any) {
if(xData && xData.opendata instanceof Function) {
xData.opendata(args);
}
}
<#ibizinclude> <#ibizinclude>
../@MACRO/VIEW_BOTTOM-BASE.vue.ftl ../@MACRO/VIEW_BOTTOM-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
...@@ -51,10 +51,14 @@ Vue.use(UserComponent); ...@@ -51,10 +51,14 @@ Vue.use(UserComponent);
Vue.use(PortletComponent); Vue.use(PortletComponent);
router.beforeEach((to: any, from: any, next: any) => { router.beforeEach((to: any, from: any, next: any) => {
if (to.meta && !to.meta.ignoreAddPage) { if(sessionStorage.getItem('lockState') && to.path != '/lock'){
router.app.$store.commit('addPage', to); next({ path: '/lock'});
}else{
if (to.meta && !to.meta.ignoreAddPage) {
router.app.$store.commit('addPage', to);
}
next();
} }
next();
}); });
Interceptors.getInstance(router,store); Interceptors.getInstance(router,store);
......
...@@ -308,6 +308,20 @@ const router = new Router({ ...@@ -308,6 +308,20 @@ const router = new Router({
}, },
component: () => import('@components/login/login.vue'), component: () => import('@components/login/login.vue'),
}, },
{
path: '/lock',
name: 'lock',
meta: {
caption: '锁屏',
viewType: 'lock',
requireAuth: false,
ignoreAddPage: true,
},
beforeEnter: (to: any, from: any, next: any) => {
next();
},
component: () => import('@components/app-lock/app-lock.vue'),
},
{ {
path: '/404', path: '/404',
component: () => import('@components/404/404.vue') component: () => import('@components/404/404.vue')
......
...@@ -30,10 +30,17 @@ export default class ${srfclassname('${item.getCodeName()}')}AuthServiceBase ext ...@@ -30,10 +30,17 @@ export default class ${srfclassname('${item.getCodeName()}')}AuthServiceBase ext
* @memberof ${srfclassname('${item.getCodeName()}')}AuthServiceBase * @memberof ${srfclassname('${item.getCodeName()}')}AuthServiceBase
*/ */
public getOPPrivs(mainSateOPPrivs:any):any{ public getOPPrivs(mainSateOPPrivs:any):any{
let curDefaultOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs)); let curDefaultOPPrivs:any = this.getSysOPPrivs();
let copyDefaultOPPrivs:any = JSON.parse(JSON.stringify(curDefaultOPPrivs));
if(mainSateOPPrivs){ if(mainSateOPPrivs){
Object.assign(curDefaultOPPrivs,mainSateOPPrivs); Object.assign(curDefaultOPPrivs,mainSateOPPrivs);
} }
// 统一资源优先
Object.keys(curDefaultOPPrivs).forEach((name:string) => {
if(this.sysOPPrivsMap.get(name) && copyDefaultOPPrivs[name] === 0){
curDefaultOPPrivs[name] = copyDefaultOPPrivs[name];
}
});
return curDefaultOPPrivs; return curDefaultOPPrivs;
} }
......
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
import store from '@/store';
/**
* 实体权限服务
*
* @export
* @class AuthService
*/
export default class AuthService {
/**
* Vue 状态管理器
*
* @public
* @type {(any | null)}
* @memberof AuthService
*/
public $store: any;
/**
* 系统操作标识映射统一资源Map
*
* @public
* @type {Map<string,any>}
* @memberof AuthService
*/
public sysOPPrivsMap:Map<string,any> = new Map();
/**
* 默认操作标识
*
* @public
* @type {(any)}
* @memberof AuthService
*/
public defaultOPPrivs: any = {<#if sys.getAllPSDEOPPrivs()??><#list sys.getAllPSDEOPPrivs() as sysOPPrivs>${sysOPPrivs.getName()}: 1<#if sysOPPrivs_has_next>,</#if></#list></#if>};
/**
* Creates an instance of AuthService.
*
* @param {*} [opts={}]
* @memberof AuthService
*/
constructor(opts: any = {}) {
this.$store = store;
this.registerSysOPPrivs();
}
/**
* 获取状态管理器
*
* @returns {(any | null)}
* @memberof AuthService
*/
public getStore(): any {
return this.$store;
}
/**
* 获取计算统一资源之后的系统操作标识
*
* @returns {}
* @memberof AuthService
*/
public getSysOPPrivs(){
let copySysOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs));
if(Object.keys(copySysOPPrivs).length === 0) return {};
Object.keys(copySysOPPrivs).forEach((name:any) =>{
if(this.sysOPPrivsMap.get(name)){
copySysOPPrivs[name] = this.getResourcePermission(this.sysOPPrivsMap.get(name))?1:0;
}
})
return copySysOPPrivs;
}
/**
* 获取实体权限服务
*
* @param {string} name 实体名称
* @returns {Promise<any>}
* @memberof AuthService
*/
public getService(name: string): Promise<any> {
return (window as any)['authServiceRegister'].getService(name);
}
/**
* 注册系统操作标识统一资源
*
* @param {string} name 实体名称
* @returns {Promise<any>}
* @memberof AuthService
*/
public registerSysOPPrivs(){
<#if sys.getAllPSDEOPPrivs()??>
<#list sys.getAllPSDEOPPrivs() as sysOPPrivs>
<#if sysOPPrivs.getMapPSSysUniRes()??>
this.sysOPPrivsMap.set('${sysOPPrivs.getName()}','${sysOPPrivs.getMapPSSysUniRes().getResCode()}');
</#if>
</#list>
</#if>
}
/**
* 根据当前数据获取实体操作标识
*
* @param {string} name 实体名称
* @returns {any}
* @memberof AuthService
*/
public getOPPrivs(data: any): any {
return null;
}
/**
* 根据菜单项获取菜单权限
*
* @param {*} item 菜单标识
* @returns {boolean}
* @memberof AuthService
*/
public getMenusPermission(item: any): boolean {
return this.$store.getters['authresource/getAuthMenu'](item);
}
/**
* 根据统一资源标识获取统一资源权限
*
* @param {*} tag 统一资源标识
* @returns {boolean}
* @memberof AuthService
*/
public getResourcePermission(tag: any): boolean {
return this.$store.getters['authresource/getResourceData'](tag);
}
}
\ No newline at end of file
...@@ -27,7 +27,7 @@ export default class ${srfclassname('${item.getCodeName()}')} { ...@@ -27,7 +27,7 @@ export default class ${srfclassname('${item.getCodeName()}')} {
* @type any * @type any
* @memberof ${srfclassname('${item.getCodeName()}')} * @memberof ${srfclassname('${item.getCodeName()}')}
*/ */
public expirationTime:any; public static expirationTime:any;
/** /**
* 预定义类型 * 预定义类型
...@@ -43,7 +43,7 @@ export default class ${srfclassname('${item.getCodeName()}')} { ...@@ -43,7 +43,7 @@ export default class ${srfclassname('${item.getCodeName()}')} {
* @type any * @type any
* @memberof ${srfclassname('${item.getCodeName()}')} * @memberof ${srfclassname('${item.getCodeName()}')}
*/ */
public cacheTimeout:any = ${item.getCacheTimeout()}; public cacheTimeout:any = ${item.getCacheTimeout()?c};
/** /**
* 代码表模型对象 * 代码表模型对象
...@@ -55,6 +55,26 @@ export default class ${srfclassname('${item.getCodeName()}')} { ...@@ -55,6 +55,26 @@ export default class ${srfclassname('${item.getCodeName()}')} {
codelistid:"${item.getCodeName()}" codelistid:"${item.getCodeName()}"
}; };
/**
* 获取过期时间
*
* @type any
* @memberof ${srfclassname('${item.getCodeName()}')}
*/
public getExpirationTime(){
return ${srfclassname('${item.getCodeName()}')}.expirationTime;
}
/**
* 设置过期时间
*
* @type any
* @memberof ${srfclassname('${item.getCodeName()}')}
*/
public setExpirationTime(value:any){
${srfclassname('${item.getCodeName()}')}.expirationTime = value;
}
/** /**
* 自定义参数集合 * 自定义参数集合
* *
......
...@@ -211,6 +211,7 @@ export default { ...@@ -211,6 +211,7 @@ export default {
back: "Back", back: "Back",
next: "Next", next: "Next",
complete: "Complete", complete: "Complete",
preactionmessage:"The calculation of the previous behavior is not configured"
}, },
viewLayoutPanel: { viewLayoutPanel: {
appLogoutView: { appLogoutView: {
......
...@@ -210,6 +210,7 @@ export default { ...@@ -210,6 +210,7 @@ export default {
back: "上一步", back: "上一步",
next: "下一步", next: "下一步",
complete: "完成", complete: "完成",
preactionmessage:"未配置计算上一步行为"
}, },
viewLayoutPanel: { viewLayoutPanel: {
appLogoutView: { appLogoutView: {
......
...@@ -534,9 +534,9 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr ...@@ -534,9 +534,9 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#list appdeAction.getAfterPSDEActionLogics() as afterlogic> <#list appdeAction.getAfterPSDEActionLogics() as afterlogic>
<#if afterlogic.getPSDELogic()?? && afterlogic.getPSDELogic().getLogicHolder?? && afterlogic.getPSDELogic().getLogicHolder()?? && (afterlogic.getPSDELogic().getLogicHolder() == 2 || afterlogic.getPSDELogic().getLogicHolder() == 3)> <#if afterlogic.getPSDELogic()?? && afterlogic.getPSDELogic().getLogicHolder?? && afterlogic.getPSDELogic().getLogicHolder()?? && (afterlogic.getPSDELogic().getLogicHolder() == 2 || afterlogic.getPSDELogic().getLogicHolder() == 3)>
<#assign singleLogic = 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>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)).data});</@compress>
<@compress single_line=true>let returndata:any = await ${singleLogic.getCodeName()?lower_case}.onExecute(context,res.data,isloading?true:false);</@compress> <@compress single_line=true>let ${singleLogic.getCodeName()?lower_case}Data:any = await ${singleLogic.getCodeName()?lower_case}.onExecute(context,res.data,isloading?true:false);</@compress>
res ={status:200,data:returndata}; res ={status:200,data:${singleLogic.getCodeName()?lower_case}Data};
</#if> </#if>
</#list> </#list>
</#if> </#if>
......
<#ibiztemplate> <#ibiztemplate>
TARGET=PSAPPDATAENTITY TARGET=PSAPPDATAENTITY
</#ibiztemplate> </#ibiztemplate>
<#macro getMainStateOPPrivs mainState dataEntity> <#macro getMainStateOPPrivs mainState >
<#compress> <#compress>
<#if dataEntity.getAllPSDEOPPrivs?? && dataEntity.getAllPSDEOPPrivs()??>
<#if mainState.getPSDEMainStateOPPrivs?? && mainState.getPSDEMainStateOPPrivs()??> <#if mainState.getPSDEMainStateOPPrivs?? && mainState.getPSDEMainStateOPPrivs()??>
{<#list mainState.getPSDEMainStateOPPrivs() as stateOPPriv><#if stateOPPriv.getPSDEOPPriv()?? && !stateOPPriv.getPSDEOPPriv().getPSDataEntity()??>'${stateOPPriv.getName()}':<#if mainState.isOPPrivAllowMode()>1<#else>0</#if>,</#if></#list><#list dataEntity.getAllPSDEOPPrivs() as mainStateOPPriv>'${mainStateOPPriv.getName()}':<#list mainState.getPSDEMainStateOPPrivs() as stateOPPriv><#if stateOPPriv.getName() == mainStateOPPriv.getName()><#assign iscurState = true/></#if></#list><#if iscurState?? && iscurState ><#if mainState.isOPPrivAllowMode()>1<#else>0</#if><#else><#if mainState.isOPPrivAllowMode()>0<#else>1</#if></#if><#assign iscurState = false/><#if mainStateOPPriv_has_next>,</#if></#list>} {<#list mainState.getPSDEMainStateOPPrivs() as stateOPPriv><#if stateOPPriv.getPSDEOPPriv()??>'${stateOPPriv.getName()}':<#if mainState.isOPPrivAllowMode()>1<#else>0</#if>,</#if></#list>}
<#else>
{}
</#if> </#if>
</#compress>
</#macro>
<#macro getDataEntityMainStateOPPrivs mainState dataEntity>
<#compress>
<#if dataEntity.getAllPSDEOPPrivs?? && dataEntity.getAllPSDEOPPrivs()??>
{<#list dataEntity.getAllPSDEOPPrivs() as mainStateOPPriv>'${mainStateOPPriv.getName()}':<#if mainState.isOPPrivAllowMode()>0<#else>1</#if><#if mainStateOPPriv_has_next>,</#if></#list>}
<#else> <#else>
{} {}
</#if> </#if>
...@@ -155,7 +162,7 @@ export default class ${srfclassname('${item.getCodeName()}')}UIServiceBase exten ...@@ -155,7 +162,7 @@ export default class ${srfclassname('${item.getCodeName()}')}UIServiceBase exten
<#if item.getPSDataEntity?? && item.getPSDataEntity()?? && item.getPSDataEntity().getAllPSDEMainStates()??> <#if item.getPSDataEntity?? && item.getPSDataEntity()?? && item.getPSDataEntity().getAllPSDEMainStates()??>
<#list item.getPSDataEntity().getAllPSDEMainStates() as demState> <#list item.getPSDataEntity().getAllPSDEMainStates() as demState>
<#if demState.getMSTag()??> <#if demState.getMSTag()??>
this.allDeMainStateOPPrivsMap.set('${demState.getMSTag()}',<@getMainStateOPPrivs mainState=demState dataEntity=item.getPSDataEntity() />); this.allDeMainStateOPPrivsMap.set('${demState.getMSTag()}',Object.assign(<@getDataEntityMainStateOPPrivs mainState=demState dataEntity=item.getPSDataEntity() />,<@getMainStateOPPrivs mainState=demState />));
</#if> </#if>
</#list> </#list>
</#if> </#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册