Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
22
议题
22
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7
提交
f8be8578
提交
f8be8578
编写于
8月 10, 2020
作者:
tony001
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
调整向导面板
上级
9fca5187
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
78 行增加
和
25 行删除
+78
-25
CONTROL-BASE.vue.ftl
@CONTROL/向导面板/CONTROL-BASE.vue.ftl
+78
-25
未找到文件。
@CONTROL/向导面板/CONTROL-BASE.vue.ftl
浏览文件 @
f8be8578
...
...
@@ -78,6 +78,14 @@ ${ctrl.render.code}
*/
public stateField: string = '${ctrl.getStatePSAppDEField().getCodeName()?lower_case}';
/**
* 步骤标识集合
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public stepTags: any = {};
/**
* 获取多项数据
*
...
...
@@ -167,7 +175,7 @@ ${ctrl.render.code}
*/
public created(): void {
this.regFormActions();
if(this.activeForm) {
if(this.activeForm
&& !this.stateField
) {
this.historyForms.push(this.activeForm);
}
if (this.viewState) {
...
...
@@ -203,7 +211,7 @@ ${ctrl.render.code}
public regFormActions() {
<#if ctrl.getPSDEWizard()?? && ctrl.getPSDEWizard().getPSDEWizardForms()??>
<#list ctrl.getPSDEWizard().getPSDEWizardForms() as form>
this.regFormAction('${ctrl.name}_form_${form.getFormTag()}',
<#if form.getPrevPSDEAction?? && form.getPrevPSDEAction()??>${form.getPrevPSDEAction()}</#if>[<#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>}
);
</#list>
</#if>
}
...
...
@@ -213,8 +221,9 @@ ${ctrl.render.code}
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public regFormAction(name: string, actions: Array<string>) {
this.stepActions[name] = actions;
public regFormAction(name: string, actionParams: any,stepTag:any) {
this.stepActions[name] = actionParams;
this.stepTags[name] = stepTag;
this.wizardForms.push(name);
}
...
...
@@ -235,7 +244,7 @@ ${ctrl.render.code}
if(response.data.${ctrl.getPSAppDataEntity().getCodeName()?lower_case}){
Object.assign(this.context,{${ctrl.getPSAppDataEntity().getCodeName()?lower_case}:response.data.${ctrl.getPSAppDataEntity().getCodeName()?lower_case}})
}
this.formLoad();
this.formLoad(
this.formParam
);
}
}).catch((response: any) => {
if (response && response.status === 401) {
...
...
@@ -251,9 +260,28 @@ ${ctrl.render.code}
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public formLoad() {
public formLoad(data:any) {
if(this.stateField) this.computedActiveForm(data);
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;
}
})
}
}
}
...
...
@@ -308,13 +336,24 @@ ${ctrl.render.code}
Object.assign(this.formParam, args);
if(Object.is(this.curState, 'NEXT')) {
this.historyForms.push(name);
if (this.getNextForm()) {
this.activeForm = this.getNextForm();
setTimeout(() => {
this.formLoad();
}, 1);
} else {
this.doFinish();
if(!this.stateField){
if (this.getNextForm()) {
this.activeForm = this.getNextForm();
setTimeout(() => {
this.formLoad(this.formParam);
}, 1);
} else {
this.doFinish();
}
}else{
this.computedActiveForm(args);
if(this.activeForm && Object.is(this.activeForm,this.wizardForms[this.wizardForms.length - 1]) ){
this.doFinish();
}else{
setTimeout(() => {
this.formLoad(this.formParam);
}, 1);
}
}
}else if(Object.is(this.curState, 'FINISH')) {
this.doFinish();
...
...
@@ -343,14 +382,28 @@ ${ctrl.render.code}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onClickPrev() {
const length = this.historyForms.length;
if(length > 1) {
this.curState = 'PREV';
this.activeForm = this.historyForms[length - 1];
setTimeout(() => {
this.formLoad();
}, 1);
this.historyForms.splice(length - 1, 1);
if(!this.stateField){
const length = this.historyForms.length;
if(length > 1) {
this.curState = 'PREV';
this.activeForm = this.historyForms[length - 1];
setTimeout(() => {
this.formLoad(this.formParam);
}, 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';
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) });
}
}
}
}
}
...
...
@@ -365,7 +418,7 @@ ${ctrl.render.code}
let form: any = this.$refs[this.activeForm];
if(form.formValidateStatus()) {
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 {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.rulesException') as string) });
}
...
...
@@ -384,7 +437,7 @@ ${ctrl.render.code}
let form: any = this.$refs[this.activeForm];
if(form.formValidateStatus()) {
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 {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.rulesException') as string) });
}
...
...
@@ -399,7 +452,7 @@ ${ctrl.render.code}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
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) {
return true;
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录