Browse Source

字段管理bug修改,连续加2次,第二次index不会自动+1

master
z_yu 2 years ago
parent
commit
1079f0f1f9
  1. 2
      src/views/category/fieldManage/index.vue
  2. 4
      src/views/components/field/index.vue

2
src/views/category/fieldManage/index.vue

@ -158,7 +158,7 @@ export default {
return false return false
}, },
[CRUD.HOOK.beforeSubmit]() { [CRUD.HOOK.beforeSubmit]() {
if (!this.crud.form.isSequence) {
if (this.crud.add > CRUD.STATUS.NORMAL) {
this.crud.form.isSequence = this.crud.data.reduce((prev, cur) => { return { isSequence: Math.max(prev.isSequence, cur.isSequence) } }).isSequence + 1 this.crud.form.isSequence = this.crud.data.reduce((prev, cur) => { return { isSequence: Math.max(prev.isSequence, cur.isSequence) } }).isSequence + 1
} }
}, },

4
src/views/components/field/index.vue

@ -41,7 +41,7 @@
</div> </div>
<el-form :model="form" @submit.native.prevent> <el-form :model="form" @submit.native.prevent>
<el-form-item label="技术维护验证码" :label-width="formLabelWidth"> <el-form-item label="技术维护验证码" :label-width="formLabelWidth">
<el-input v-model="form.verifyCode" />
<el-input v-model="form.verifyCode" show-password />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -129,7 +129,7 @@ export default {
}, },
[CRUD.HOOK.beforeSubmit]() { [CRUD.HOOK.beforeSubmit]() {
this.crud.form.isType = this.isType this.crud.form.isType = this.isType
if (!this.crud.form.isSequence) {
if (this.crud.add > CRUD.STATUS.NORMAL) {
this.crud.form.isSequence = this.crud.data.reduce((prev, cur) => { return { isSequence: Math.max(prev.isSequence, cur.isSequence) } }).isSequence + 1 this.crud.form.isSequence = this.crud.data.reduce((prev, cur) => { return { isSequence: Math.max(prev.isSequence, cur.isSequence) } }).isSequence + 1
} }
}, },

Loading…
Cancel
Save