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

调整状态向导面板 --- fix6

上级 c7092304
...@@ -54,9 +54,9 @@ ...@@ -54,9 +54,9 @@
</view_${form.getName()}> </view_${form.getName()}>
</div> </div>
<div class="app-wizard-footer"> <div class="app-wizard-footer">
<i-button size="small" v-if="isVisiable('${form.name}','PREV')" @click="onClickPrev()" type="primary">上一步</i-button> <i-button size="small" v-if="isVisiable('${form.name}','PREV')" @click="onClickPrev('${form.name}')" type="primary">上一步</i-button>
<i-button size="small" v-if="isVisiable('${form.name}','NEXT')" @click="onClickNext()" type="primary">下一步</i-button> <i-button size="small" v-if="isVisiable('${form.name}','NEXT')" @click="onClickNext('${form.name}')" type="primary">下一步</i-button>
<i-button size="small" v-if="isVisiable('${form.name}','FINISH')" @click="onClickFinish()" type="primary">完成</i-button> <i-button size="small" v-if="isVisiable('${form.name}','FINISH')" @click="onClickFinish('${form.name}')" type="primary">完成</i-button>
</div> </div>
</div> </div>
</el-popover> </el-popover>
...@@ -323,9 +323,9 @@ ...@@ -323,9 +323,9 @@
* *
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public formLoad() { public formLoad(name:string) {
if(this.activeForm) { if(name) {
this.wizardState.next({ tag: this.activeForm, action: 'load', data: this.formParam }); this.wizardState.next({ tag: name, action: 'load', data: this.formParam });
} }
} }
...@@ -382,7 +382,7 @@ ...@@ -382,7 +382,7 @@
if (this.getNextForm()) { if (this.getNextForm()) {
this.activeForm = this.getNextForm(); this.activeForm = this.getNextForm();
setTimeout(() => { setTimeout(() => {
this.formLoad(); this.formLoad(this.activeForm);
}, 1); }, 1);
} else { } else {
this.doFinish(); this.doFinish();
...@@ -427,7 +427,7 @@ ...@@ -427,7 +427,7 @@
} }
this.stepVisiable[name] = !this.stepVisiable[name]; this.stepVisiable[name] = !this.stepVisiable[name];
if(this.stepVisiable[name]){ if(this.stepVisiable[name]){
this.formLoad(); this.formLoad(name);
} }
} }
...@@ -452,15 +452,14 @@ ...@@ -452,15 +452,14 @@
* *
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public onClickPrev() { public onClickPrev(name:string) {
const length = this.historyForms.length; const length = this.historyForms.length;
if(length > 1) { if(length > 1) {
this.curState = 'PREV'; this.curState = 'PREV';
this.activeForm = this.historyForms[length - 1]; let curIndex:number = this.historyForms.indexOf(name);
setTimeout(() => { setTimeout(() => {
this.formLoad(); this.formLoad(this.historyForms[curIndex - 1]);
}, 1); }, 1);
this.historyForms.splice(length - 1, 1);
} }
} }
...@@ -469,13 +468,13 @@ ...@@ -469,13 +468,13 @@
* *
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public onClickNext() { public onClickNext(name:string) {
if(this.activeForm) { if(name) {
if(this.$refs && this.$refs[this.activeForm]){ if(this.$refs && this.$refs[name]){
let form: any = this.$refs[this.activeForm]; let form: any = this.$refs[name];
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: name, action: 'save', data: this.formParam });
} else { } else {
this.$Notice.error({ title: '错误', desc: '值规则校验异常' }); this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
} }
...@@ -488,13 +487,13 @@ ...@@ -488,13 +487,13 @@
* *
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public onClickFinish() { public onClickFinish(name:string) {
if(this.activeForm) { if(name) {
if(this.$refs && this.$refs[this.activeForm]){ if(this.$refs && this.$refs[name]){
let form: any = this.$refs[this.activeForm]; let form: any = this.$refs[name];
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: name, action: 'save', data: this.formParam });
} else { } else {
this.$Notice.error({ title: '错误', desc: '值规则校验异常' }); this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册