diff --git a/web/src/view/superAdmin/authority/authority.vue b/web/src/view/superAdmin/authority/authority.vue index a3f74e4c..0e283917 100644 --- a/web/src/view/superAdmin/authority/authority.vue +++ b/web/src/view/superAdmin/authority/authority.vue @@ -57,13 +57,7 @@ > - + @@ -111,6 +105,13 @@ export default { name: "Authority", mixins: [infoList], data() { + var mustUint = (rule, value, callback) => { + if (!(/^[0-9]*[1-9][0-9]*$/).test(value)){ + return callback(new Error("请输入正整数")); + } + return callback() + }; + return { AuthorityOption: [ { @@ -134,7 +135,8 @@ export default { }, rules: { authorityId: [ - { required: true, message: "请输入角色ID", trigger: "blur" } + { required: true, message: "请输入角色ID", trigger: "blur" }, + {validator: mustUint, trigger: 'blur' } ], authorityName: [ { required: true, message: "请输入角色名", trigger: "blur" } @@ -296,6 +298,7 @@ export default { this.setAuthorityOptions(this.tableData, this.AuthorityOption, false); }, setAuthorityOptions(AuthorityData, optionsData, disabled) { + this.form.authorityId = String(this.form.authorityId); AuthorityData && AuthorityData.map(item => { if (item.children && item.children.length) { @@ -350,9 +353,9 @@ export default {