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

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

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