Procházet zdrojové kódy

表单验证、去空格

zhongxiaoyu před 3 roky
rodič
revize
4b600f890d

+ 4 - 4
src/components/loginpolicypop/index.vue

@@ -35,7 +35,7 @@
                     <el-input
                         disabled
                         placeholder=""
-                        v-model="itemData.TimeBegin">
+                        v-model.trim="itemData.TimeBegin">
                     </el-input>
                 </div>
                 <div class="juris_list">
@@ -43,7 +43,7 @@
                     <el-input
                         disabled
                         placeholder=""
-                        v-model="itemData.TimeEnd">
+                        v-model.trim="itemData.TimeEnd">
                     </el-input>
                 </div>
                 <div class="juris_lists">
@@ -52,7 +52,7 @@
                         type="textarea"
                         disabled
                         placeholder=""
-                        v-model="itemData.IpList">
+                        v-model.trim="itemData.IpList">
                     </el-input>
                 </div>
                 <div class="juris_lists">
@@ -61,7 +61,7 @@
                         type="textarea"
                         disabled
                         placeholder=""
-                        v-model="itemData.TacDesc">
+                        v-model.trim="itemData.TacDesc">
                     </el-input>
                 </div>
             </div>

+ 6 - 6
src/components/rulesofcompetency/index.vue

@@ -20,27 +20,27 @@
       </div>
       <div class="juris_list" :style="{ marginBottom: marginB }">
         <p>许可查询行</p>
-        <el-input v-model="form.input1" placeholder="请输入内容" size="mini"></el-input>
+        <el-input v-model.trim="form.input1" placeholder="请输入内容" size="mini"></el-input>
       </div>
       <div class="juris_list" :style="{ marginBottom: marginB }">
         <p>许可查询列</p>
-        <el-input v-model="form.input2" placeholder="请输入内容" size="mini"></el-input>
+        <el-input v-model.trim="form.input2" placeholder="请输入内容" size="mini"></el-input>
       </div>
       <div class="juris_list" :style="{ marginBottom: marginB }">
         <p>许可删除行</p>
-        <el-input v-model="form.input3" placeholder="请输入内容" size="mini"></el-input>
+        <el-input v-model.trim="form.input3" placeholder="请输入内容" size="mini"></el-input>
       </div>
       <div class="juris_list" :style="{ marginBottom: marginB }">
         <p>许可新增列</p>
-        <el-input v-model="form.input4" placeholder="请输入内容" size="mini"></el-input>
+        <el-input v-model.trim="form.input4" placeholder="请输入内容" size="mini"></el-input>
       </div>
       <div class="juris_list" :style="{ marginBottom: marginB }">
         <p>许可编辑行</p>
-        <el-input v-model="form.input5" placeholder="请输入内容" size="mini"></el-input>
+        <el-input v-model.trim="form.input5" placeholder="请输入内容" size="mini"></el-input>
       </div>
       <div class="juris_list" :style="{ marginBottom: marginB }">
         <p>许可编辑列</p>
-        <el-input v-model="form.input6" placeholder="请输入内容" size="mini"></el-input>
+        <el-input v-model.trim="form.input6" placeholder="请输入内容" size="mini"></el-input>
       </div>
     </div>
   </el-form>

+ 5 - 5
src/views/accountGroupManagement/components/accountGroupEdit.vue

@@ -27,8 +27,8 @@
             :label="`${accountGroupType}名称`"
           >
             <el-input
-              v-model="editForm.name"
-              :placeholder="`${accountGroupType}名称`"
+              v-model.trim="editForm.name"
+              :placeholder="`请输入${accountGroupType}名称`"
             />
           </el-form-item>
           <el-form-item
@@ -37,7 +37,7 @@
             style="margin-left: 40px"
           >
             <el-input
-              v-model="editForm.desc"
+              v-model.trim="editForm.desc"
               style="width: 640px"
               placeholder="请输入描述"
             />
@@ -190,10 +190,10 @@ export default {
         // 表单验证
         name: [
           { required: true, message: `请输入${this.accountGroupType}名称`, trigger: 'blur' },
-          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] }
+          { validator: lengthValidator, max: 32, message: '长度在 1 到 32 个字符', trigger: ['change', 'blur'] }
         ],
         desc: [
-          { validator: lengthValidator, max: 128, message: '最多输入128个字符', trigger: ['change', 'blur'] }
+          { validator: lengthValidator, max: 128, message: '长度在 1 到 128 个字符', trigger: ['change', 'blur'] }
         ]
       },
       defaultProps: {

+ 6 - 5
src/views/accountManagement/components/accountEdit.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: Badguy
  * @Date: 2022-02-15 11:37:42
- * @LastEditTime: 2022-03-14 10:51:10
+ * @LastEditTime: 2022-03-16 15:24:22
  * @LastEditors: your name
  * @Description: 编辑账号
  * have a nice day!
@@ -35,7 +35,7 @@
           <el-row :gutter="40">
             <el-col :span="5">
               <el-form-item label="账号名称" prop="name">
-                <el-input v-model="accountForm.name" maxlength="32" placeholder="请输入名称" size="small" />
+                <el-input v-model.trim="accountForm.name" placeholder="请输入名称" size="small" />
               </el-form-item>
             </el-col>
             <el-col :span="5">
@@ -48,7 +48,7 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="描述" prop="desc">
-                <el-input v-model="accountForm.desc" maxlength="128" placeholder="描述内容···" size="small" />
+                <el-input v-model.trim="accountForm.desc" placeholder="请输入描述" size="small" />
               </el-form-item>
             </el-col>
           </el-row>
@@ -166,6 +166,7 @@ import { RoleAuths } from '@/api/apiAuthority'
 import { getAccountDetails, editAccount, addAccount } from '@/api/Account.js'
 import { pwdProduce } from '@/utils/validate'
 import { mapGetters } from 'vuex'
+import { lengthValidator } from '@/utils/validate'
 
 export default {
   components: {
@@ -205,9 +206,9 @@ export default {
       formRules: {
         name: [
           { required: true, message: '请输入账号名称', trigger: 'blur' },
-          { min: 1, max: 32, message: '长度在 1到 32 个字符', trigger: 'blur' }
+          { validator: lengthValidator, max: 32, message: '长度在 1 到 32 个字符', trigger: ['change', 'blur'] }
         ],
-        desc: [{ min: 1, max: 128, message: '长度最多128个字符', trigger: 'blur' }]
+        desc: [{ validator: lengthValidator, max: 128, message: '长度在 1 到 128 个字符', trigger: ['change', 'blur'] }]
       },
       accountForm: {
         name: null,

+ 18 - 16
src/views/authorityManagement/components/authorityAppAdd.vue

@@ -1,8 +1,8 @@
 <!--
  * @Author: your name
  * @Date: 2021-11-29 09:18:04
- * @LastEditTime: 2022-02-28 23:05:18
- * @LastEditors: Please set LastEditors
+ * @LastEditTime: 2022-03-16 15:17:14
+ * @LastEditors: your name
  * @Description: 新增/编辑应用
  * @FilePath: \Foshan4A2.0\src\views\authorityManagement\components\addApp.vue
 -->
@@ -20,7 +20,7 @@
         <el-form ref="form" class="form" :rules="rules" :model="form">
           <div class="flex">
             <el-form-item prop="name" label="应用名称">
-              <el-input placeholder="请输入应用名称" maxlength="32" v-model="form.name"></el-input>
+              <el-input placeholder="请输入应用名称" v-model.trim="form.name"></el-input>
             </el-form-item>
             <el-form-item label="请求类型">
               <el-select v-model="form.id" placeholder="请求类型">
@@ -34,14 +34,14 @@
                 <el-option label="header" value="1"></el-option>
                 <el-option label="body" value="2"></el-option>
               </el-select> -->
-              <el-input placeholder="请输入参数类型" v-model="form.app"></el-input>
+              <el-input placeholder="请输入参数类型" v-model.trim="form.app"></el-input>
             </el-form-item>
           </div>
-          <el-form-item class="url" prop="url" label="应用地址">
-            <el-input placeholder="请输入应用地址" maxlength="200" v-model="form.url"></el-input>
+          <el-form-item prop="url" class="url" label="应用地址">
+            <el-input placeholder="请输入应用地址" v-model.trim="form.url"></el-input>
           </el-form-item>
-          <el-form-item class="content" label="描述">
-            <el-input type="textarea" maxlength="200" rows="3" placeholder="请输入描述" v-model="form.content"></el-input>
+          <el-form-item prop="desc" class="desc" label="描述">
+            <el-input type="textarea" rows="3" placeholder="请输入描述" v-model.trim="form.desc"></el-input>
           </el-form-item>
         </el-form>
         <div class="addApp-form-title domain-title flex">
@@ -55,13 +55,13 @@
             <div class="flex" v-for="(domain, index) in dynamicValidateForm.domains" :key="index">
               <div class="flex-wrap">
                 <el-form-item label="参数名称" :prop="'domains.' + index + '.name'">
-                  <el-input v-model="domain.AppInputName"></el-input>
+                  <el-input v-model.trim="domain.AppInputName"></el-input>
                 </el-form-item>
                 <el-form-item label="参数类型" :prop="'domains.' + index + '.type'">
-                  <el-input placeholder="请输入参数类型" v-model="domain.AppInputType"></el-input>
+                  <el-input placeholder="请输入参数类型" v-model.trim="domain.AppInputType"></el-input>
                 </el-form-item>
                 <el-form-item label="参数位置" :prop="'domains.' + index + '.place'">
-                  <el-input placeholder="请输入参数位置" v-model="domain.AppInputSite"></el-input>
+                  <el-input placeholder="请输入参数位置" v-model.trim="domain.AppInputSite"></el-input>
                 </el-form-item>
               </div>
               <div>
@@ -103,16 +103,18 @@ export default {
         id: "",
         app: "",
         url: "",
-        content: "",
+        desc: "",
       },
       rules: {
         //表单验证
         name: [
           { required: true, message: "请输入应用名称", trigger: "blur" },
-          { validator: lengthValidator, max: 32, message: '长度在 1到 32 个字符', trigger: ['change', 'blur'] }],
-        content: [
+          { validator: lengthValidator, max: 32, message: '长度在 1 到 32 个字符', trigger: ['change', 'blur'] }
+        ],
+        url: [{ validator: lengthValidator, max: 128, message: '长度在 1 到 128 个字符', trigger: ['change', 'blur'] }],
+        desc: [
           { required: true, message: "请输入描述", trigger: "blur" },
-          { validator: lengthValidator, max: 200, message: '长度在 1到 200 个字符', trigger: ['change', 'blur'] }
+          { validator: lengthValidator, max: 128, message: '长度在 1 到 128 个字符', trigger: ['change', 'blur'] }
         ],
       },
       radio: "1",
@@ -141,7 +143,7 @@ export default {
       try {
         const res = await SaveApp({
           AppName: this.form.name,
-          AppDesc: this.form.content,
+          AppDesc: this.form.desc,
           AppUrl: this.form.url,
           RequestType: this.form.id,
           BodyType: this.form.app,

+ 18 - 16
src/views/authorityManagement/components/authorityAppEdit.vue

@@ -1,8 +1,8 @@
 <!--
  * @Author: your name
  * @Date: 2021-11-29 09:18:04
- * @LastEditTime: 2022-02-28 23:07:09
- * @LastEditors: Please set LastEditors
+ * @LastEditTime: 2022-03-16 15:18:03
+ * @LastEditors: your name
  * @Description: 新增/编辑应用
  * @FilePath: \Foshan4A2.0\src\views\authorityManagement\components\addApp.vue
 -->
@@ -30,7 +30,7 @@
         <el-form ref="form" class="form" :rules="rules" :model="form">
           <div class="flex">
             <el-form-item prop="name" label="应用名称">
-              <el-input placeholder="请输入应用名称" maxlength="32" v-model="form.name"></el-input>
+              <el-input placeholder="请输入应用名称" v-model.trim="form.name"></el-input>
             </el-form-item>
             <el-form-item label="请求类型">
               <el-select v-model="form.id" placeholder="请求类型">
@@ -40,14 +40,14 @@
               <!-- <el-input placeholder="请输入APPID" disabled v-model="form.id"></el-input> -->
             </el-form-item>
             <el-form-item label="参数类型">
-              <el-input placeholder="请输入参数类型" v-model="form.app"></el-input>
+              <el-input placeholder="请输入参数类型" v-model.trim="form.app"></el-input>
             </el-form-item>
           </div>
           <el-form-item class="url" prop="url" label="应用地址">
-            <el-input placeholder="请输入应用地址" maxlength="200" v-model="form.url"></el-input>
+            <el-input placeholder="请输入应用地址" v-model.trim="form.url"></el-input>
           </el-form-item>
-          <el-form-item class="content" label="描述">
-            <el-input type="textarea" maxlength="200" rows="3" placeholder="请输入描述" v-model="form.content"></el-input>
+          <el-form-item prop="desc" class="desc" label="描述">
+            <el-input type="textarea" rows="3" placeholder="请输入描述" v-model.trim="form.desc"></el-input>
           </el-form-item>
         </el-form>
         <div class="addApp-form-title domain-title flex">
@@ -61,13 +61,13 @@
             <div class="flex" v-for="(domain, index) in dynamicValidateForm.domains" :key="index">
               <div class="flex-wrap">
                 <el-form-item label="参数名称" :prop="'domains.' + index + '.name'">
-                  <el-input v-model="domain.AppInputName"></el-input>
+                  <el-input v-model.trim="domain.AppInputName"></el-input>
                 </el-form-item>
                 <el-form-item label="参数类型" :prop="'domains.' + index + '.type'">
-                  <el-input placeholder="请输入参数类型" v-model="domain.AppInputType"></el-input>
+                  <el-input placeholder="请输入参数类型" v-model.trim="domain.AppInputType"></el-input>
                 </el-form-item>
                 <el-form-item label="参数位置" :prop="'domains.' + index + '.place'">
-                  <el-input placeholder="请输入参数位置" v-model="domain.AppInputSite"></el-input>
+                  <el-input placeholder="请输入参数位置" v-model.trim="domain.AppInputSite"></el-input>
                 </el-form-item>
               </div>
               <div>
@@ -114,16 +114,18 @@ export default {
         id: "",
         app: "",
         url: "",
-        content: "",
+        desc: "",
       },
       rules: {
         //表单验证
         name: [
           { required: true, message: "请输入应用名称", trigger: "blur" },
-          { validator: lengthValidator, max: 32, message: '长度在 1到 32 个字符', trigger: ['change', 'blur'] }],
-        content: [
+          { validator: lengthValidator, max: 32, message: '长度在 1 到 32 个字符', trigger: ['change', 'blur'] }
+        ],
+        url: [{ validator: lengthValidator, max: 128, message: '长度在 1 到 128 个字符', trigger: ['change', 'blur'] }],
+        desc: [
           { required: true, message: "请输入描述", trigger: "blur" },
-          { validator: lengthValidator, max: 200, message: '长度在 1到 200 个字符', trigger: ['change', 'blur'] }
+          { validator: lengthValidator, max: 128, message: '长度在 1到 128 个字符', trigger: ['change', 'blur'] }
         ],
       },
       radio: 1,
@@ -168,7 +170,7 @@ export default {
           // this.form.app = AppShowSecret;
           this.form.id = Number(RequestType);
           this.form.app = BodyType;
-          this.form.content = AppDesc;
+          this.form.desc = AppDesc;
           this.form.url = AppUrl;
           this.dynamicValidateForm.domains = Inputs;
         } else {
@@ -208,7 +210,7 @@ export default {
       try {
         const res = await EditApp({
           AppId: this.AppId,
-          AppDesc: this.form.content,
+          AppDesc: this.form.desc,
           AppName: this.form.name,
           AppUrl: this.form.url,
           RequestType: this.form.id,

+ 13 - 13
src/views/authorityManagement/components/authorityPowerAdd.vue

@@ -1,8 +1,8 @@
 <!--
  * @Author: your name
  * @Date: 2021-11-29 11:26:07
- * @LastEditTime: 2022-02-28 16:30:03
- * @LastEditors: Please set LastEditors
+ * @LastEditTime: 2022-03-16 15:12:13
+ * @LastEditors: your name
  * @Description:权限项
  * @FilePath: \Foshan4A2.0\src\views\authorityManagement\components\authorityPower.vue
 -->
@@ -27,13 +27,13 @@
       <div class="addApp-form-content dialog-public-background">
         <el-form :inline="true" ref="form" :rules="rules" class="form" :model="form">
           <el-form-item prop="name" label="权限项名称">
-            <el-input placeholder="请输入权限项名称" v-model="form.name"></el-input>
+            <el-input placeholder="请输入权限项名称" v-model.trim="form.name"></el-input>
           </el-form-item>
           <el-form-item prop="id" label="标识符">
-            <el-input placeholder="请输入标识符" v-model="form.id"></el-input>
+            <el-input placeholder="请输入标识符" v-model.trim="form.id"></el-input>
           </el-form-item>
-          <el-form-item prop="app" label="描述">
-            <el-input style="width: 640px" placeholder="请输入描述" v-model="form.app"></el-input>
+          <el-form-item prop="desc" label="描述">
+            <el-input style="width: 640px" placeholder="请输入描述" v-model.trim="form.desc"></el-input>
           </el-form-item>
         </el-form>
       </div>
@@ -89,20 +89,20 @@ export default {
         //应用表单
         name: "",
         id: "",
-        app: "",
+        desc: "",
       },
       rules: {
         //表单验证
         name: [
           { required: true, message: "请输入权限项名称", trigger: "blur" },
-          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] }
+          { validator: lengthValidator, max: 32, message: '长度在 1 到 32 个字符', trigger: ['change', 'blur'] }
         ],
         id: [
           { required: true, message: "请输入标识符", trigger: "blur" },
-          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] }
+          { validator: lengthValidator, max: 32, message: '长度在 1 到 32 个字符', trigger: ['change', 'blur'] }
         ],
-        app: [
-          { validator: lengthValidator, max: 128, message: '最多输入128个字符', trigger: ['change', 'blur'] }
+        desc: [
+          { validator: lengthValidator, max: 128, message: '长度在 1 到 128 个字符', trigger: ['change', 'blur'] }
         ]
       },
       defaultProps: {
@@ -212,7 +212,7 @@ export default {
           } = res.returnData;
           this.form.name = AuthName;
           this.form.id = AuthIdent;
-          this.form.app = AuthDesc;
+          this.form.desc = AuthDesc;
           this.radio = AuthStatus;
           if (AuthTo) {
             this.authTo = AuthTo;
@@ -308,7 +308,7 @@ export default {
         const res = await SaveAuth({
           AuthName: this.form.name,
           AuthIdent: this.form.id,
-          AuthDesc: this.form.app,
+          AuthDesc: this.form.desc,
           UpAuthId: this.AppId,
           RoleInfo: this.openRole ? datas : [],
           UserInfo: this.openRole ? [] : datas,

+ 13 - 13
src/views/authorityManagement/components/authorityPowerEdit.vue

@@ -1,8 +1,8 @@
 <!--
  * @Author: your name
  * @Date: 2021-11-29 11:26:07
- * @LastEditTime: 2022-02-28 16:31:34
- * @LastEditors: Please set LastEditors
+ * @LastEditTime: 2022-03-16 15:15:12
+ * @LastEditors: your name
  * @Description:权限项
  * @FilePath: \Foshan4A2.0\src\views\authorityManagement\components\authorityPower.vue
 -->
@@ -27,13 +27,13 @@
       <div class="addApp-form-content dialog-public-background">
         <el-form :inline="true" ref="form" :rules="rules" class="form" :model="form">
           <el-form-item prop="name" label="权限项名称">
-            <el-input placeholder="请输入权限项名称" v-model="form.name"></el-input>
+            <el-input placeholder="请输入权限项名称" v-model.trim="form.name"></el-input>
           </el-form-item>
           <el-form-item prop="id" label="标识符">
-            <el-input placeholder="请输入标识符" v-model="form.id"></el-input>
+            <el-input placeholder="请输入标识符" v-model.trim="form.id"></el-input>
           </el-form-item>
-          <el-form-item prop="app" label="描述">
-            <el-input style="width: 640px" placeholder="请输入描述" v-model="form.app"></el-input>
+          <el-form-item prop="desc" label="描述">
+            <el-input style="width: 640px" placeholder="请输入描述" v-model.trim="form.desc"></el-input>
           </el-form-item>
         </el-form>
       </div>
@@ -89,20 +89,20 @@ export default {
         //应用表单
         name: "",
         id: "",
-        app: "",
+        desc: "",
       },
       rules: {
         //表单验证
         name: [
           { required: true, message: "请输入权限项名称", trigger: "blur" },
-          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] }
+          { validator: lengthValidator, max: 32, message: '长度在 1 到 32 个字符', trigger: ['change', 'blur'] }
         ],
         id: [
           { required: true, message: "请输入标识符", trigger: "blur" },
-          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] }
+          { validator: lengthValidator, max: 32, message: '长度在 1 到 32 个字符', trigger: ['change', 'blur'] }
         ],
-        app: [
-          { validator: lengthValidator, max: 128, message: '最多输入128个字符', trigger: ['change', 'blur'] }
+        desc: [
+          { validator: lengthValidator, max: 128, message: '长度在 1 到 128 个字符', trigger: ['change', 'blur'] }
         ]
       },
       defaultProps: {
@@ -213,7 +213,7 @@ export default {
           } = res.returnData;
           this.form.name = AuthName;
           this.form.id = AuthIdent;
-          this.form.app = AuthDesc;
+          this.form.desc = AuthDesc;
           this.radio = AuthStatus;
           if (AuthTo) {
             this.authTo = AuthTo;
@@ -309,7 +309,7 @@ export default {
         const res = await EditAuth({
           AuthName: this.form.name,
           AuthIdent: this.form.id,
-          AuthDesc: this.form.app,
+          AuthDesc: this.form.desc,
           UpAuthId: this.UpAuthId,
           AuthId: this.AppId,
           RoleInfo: this.openRole ? datas : [],

+ 9 - 9
src/views/authorityManagement/components/authorityRoleAdd.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-11-29 16:31:31
- * @LastEditTime: 2022-03-15 16:40:03
+ * @LastEditTime: 2022-03-16 15:14:59
  * @LastEditors: your name
  * @Description: 新增/编辑角色
  * @FilePath: \Foshan4A2.0\src\views\authorityManagement\components\authorityRoleStatus.vue
@@ -19,10 +19,10 @@
       <div class="addApp-form-content dialog-public-background">
         <el-form :inline="true" :rules="rules" ref="form" class="form" :model="form">
           <el-form-item prop="name" label="角色名称">
-            <el-input placeholder="请输入角色名称" v-model="form.name"></el-input>
+            <el-input placeholder="请输入角色名称" v-model.trim="form.name"></el-input>
           </el-form-item>
-          <el-form-item prop="app" label="描述">
-            <el-input style="width: 640px" maxlength="200" placeholder="请输入描述" v-model="form.app"></el-input>
+          <el-form-item prop="desc" label="描述">
+            <el-input style="width: 640px" placeholder="请输入描述" v-model.trim="form.desc"></el-input>
           </el-form-item>
         </el-form>
       </div>
@@ -64,16 +64,16 @@ export default {
         //应用表单
         name: "",
         id: "",
-        app: "",
+        desc: "",
       },
       rules: {
         //表单验证
         name: [
           { required: true, message: "请输入角色名称", trigger: "blur" },
-          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] }
+          { validator: lengthValidator, max: 32, message: '长度在 1 到 32 个字符', trigger: ['change', 'blur'] }
         ],
-        app: [
-          { validator: lengthValidator, max: 128, message: '最多输入128个字符', trigger: ['change', 'blur'] }
+        desc: [
+          { validator: lengthValidator, max: 128, message: '长度在 1 到 128 个字符', trigger: ['change', 'blur'] }
         ],
       },
       permission: false,
@@ -180,7 +180,7 @@ export default {
         });
         const res = await SaveRole({
           RoleName: this.form.name,
-          RoleDesc: this.form.app,
+          RoleDesc: this.form.desc,
           DefRoleList: this.checkedBoxs,
           AuthList: datas,
           RoleStatus: this.radio,

+ 10 - 10
src/views/authorityManagement/components/authorityRoleEdit.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-11-29 16:31:31
- * @LastEditTime: 2022-03-15 16:39:51
+ * @LastEditTime: 2022-03-16 15:14:49
  * @LastEditors: your name
  * @Description: 新增/编辑角色
  * @FilePath: \Foshan4A2.0\src\views\authorityManagement\components\authorityRoleStatus.vue
@@ -27,10 +27,10 @@
       <div class="addApp-form-content dialog-public-background">
         <el-form :inline="true" ref="form" :rules="rules" class="form" :model="form">
           <el-form-item prop="name" label="角色名称">
-            <el-input placeholder="请输入角色名称" maxlength="32" v-model="form.name"></el-input>
+            <el-input placeholder="请输入角色名称" v-model.trim="form.name"></el-input>
           </el-form-item>
-          <el-form-item label="描述">
-            <el-input style="width: 640px" maxlength="200" placeholder="请输入描述" v-model="form.app"></el-input>
+          <el-form-item prop="desc" label="描述">
+            <el-input style="width: 640px" placeholder="请输入描述" v-model.trim="form.desc"></el-input>
           </el-form-item>
         </el-form>
       </div>
@@ -71,16 +71,16 @@ export default {
         //应用表单
         name: "",
         id: "",
-        app: "",
+        desc: "",
       },
       rules: {
         //表单验证
         name: [
           { required: true, message: "请输入角色名称", trigger: "blur" },
-          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] }
+          { validator: lengthValidator, max: 32, message: '长度在 1 到 32 个字符', trigger: ['change', 'blur'] }
         ],
-        app: [
-          { validator: lengthValidator, max: 128, message: '最多输入128个字符', trigger: ['change', 'blur'] }
+        desc: [
+          { validator: lengthValidator, max: 128, message: '长度在 1 到 128 个字符', trigger: ['change', 'blur'] }
         ],
       },
       loading: false,
@@ -129,7 +129,7 @@ export default {
           const { RoleName, RoleDesc, AuthList, RoleStatus, DefRoleList } =
             res.returnData;
           this.form.name = RoleName;
-          this.form.app = RoleDesc;
+          this.form.desc = RoleDesc;
           this.radio = RoleStatus;
           if (AuthList && AuthList.length) {
             AuthList.forEach((item) => {
@@ -225,7 +225,7 @@ export default {
         });
         const res = await EditRole({
           RoleName: this.form.name,
-          RoleDesc: this.form.app,
+          RoleDesc: this.form.desc,
           DefRoleList: this.checkedBoxs,
           AuthList: datas,
           RoleStatus: this.radio,

+ 2 - 2
src/views/dashboard/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-10-14 17:17:53
- * @LastEditTime: 2022-03-14 11:02:48
+ * @LastEditTime: 2022-03-16 14:50:22
  * @LastEditors: your name
  * @Description: In User Settings Edit
  * @FilePath: \Foshan4A\src\views\dashboard\index.vue
@@ -35,7 +35,7 @@
           <el-select :style="inputFlag ? 'width:150px;':'width:200px;'" @change="handleChange" v-model="select" placeholder="功能菜单">
             <el-option v-for="(item,index) in routes" :key="index" :label="item.meta.title" :value="item.path"></el-option>
           </el-select>
-          <el-input v-show="inputFlag" :style="inputFlag ? 'width:330px;':'width:280px;'" placeholder="如需搜索,请输入" v-model="input" class="input-with-select">
+          <el-input v-show="inputFlag" :style="inputFlag ? 'width:330px;':'width:280px;'" placeholder="如需搜索,请输入" v-model.trim="input" class="input-with-select">
           </el-input>
           <!-- <el-select v-model="select" slot="prepend" placeholder="功能菜单">
             <el-option v-for="(item,index) in selectArr" :key="index" :label="item.name" :value="item.value"></el-option>

+ 7 - 10
src/views/jobsManagement/add.vue

@@ -27,13 +27,13 @@
         <el-form ref="form" :model="FormData" :rules="rules" label-width="80px">
           <el-row :gutter="40">
             <el-col :span="5">
-              <el-form-item label="职务名称" prop="JobName">
-                <el-input v-model="FormData.JobName" maxlength="32" :placeholder="`请输入${accountGroupType}名称`" size="small"></el-input>
+              <el-form-item prop="JobName" label="职务名称">
+                <el-input v-model.trim="FormData.JobName" :placeholder="`请输入${accountGroupType}名称`" size="small"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="10">
-              <el-form-item label="描述">
-                <el-input v-model="FormData.JobDesc" maxlength="128" placeholder="描述内容" size="small"></el-input>
+              <el-form-item prop="JobDesc" label="描述">
+                <el-input v-model.trim="FormData.JobDesc" placeholder="描述内容" size="small"></el-input>
               </el-form-item>
             </el-col>
           </el-row>
@@ -55,6 +55,7 @@
 import Organization from "@/components/organization";
 import treeData from "./minixs/treeData";
 import { SaveJob } from "@/api/jobApi";
+import { lengthValidator } from '@/utils/validate'
 export default {
   data () {
     return {
@@ -67,13 +68,9 @@ export default {
       rules: {
         JobName: [
           { required: true, message: `请输入${this.accountGroupType}名称`, trigger: "blur" },
-          {
-            min: 1,
-            max: 16,
-            message: "长度在 1 到 16 个字符",
-            trigger: "blur",
-          },
+          { validator: lengthValidator, max: 16, message: "长度在 1 到 16 个字符", trigger: ['change', 'blur'] },
         ],
+        JobDesc: [{ validator: lengthValidator, max: 128, message: '长度在 1 到 128 个字符', trigger: ['change', 'blur'] }]
       },
       defaultProps: {
         children: "children",

+ 7 - 10
src/views/jobsManagement/edit.vue

@@ -27,13 +27,13 @@
         <el-form ref="form" :model="FormData" :rules="rules" label-width="80px">
           <el-row :gutter="40">
             <el-col :span="5">
-              <el-form-item label="职务名称" prop="JobName">
-                <el-input v-model="FormData.JobName" maxlength="32" :placeholder="`请输入${accountGroupType}名称`" size="small"></el-input>
+              <el-form-item prop="JobName" label="职务名称">
+                <el-input v-model.trim="FormData.JobName" :placeholder="`请输入${accountGroupType}名称`" size="small"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="10">
-              <el-form-item label="描述" prop="diesc">
-                <el-input v-model="FormData.JobDesc" maxlength="128" placeholder="描述内容" size="small"></el-input>
+              <el-form-item prop="JobDesc" label="描述">
+                <el-input v-model.trim="FormData.JobDesc" placeholder="描述内容" size="small"></el-input>
               </el-form-item>
             </el-col>
           </el-row>
@@ -55,6 +55,7 @@
 import Organization from "@/components/organization";
 import treeData from "./minixs/treeData";
 import { GetJobDetails, EditJob } from "@/api/jobApi";
+import { lengthValidator } from '@/utils/validate'
 export default {
   data () {
     return {
@@ -67,13 +68,9 @@ export default {
       rules: {
         JobName: [
           { required: true, message: `请输入${this.accountGroupType}名称`, trigger: "blur" },
-          {
-            min: 1,
-            max: 16,
-            message: "长度在 1 到 16 个字符",
-            trigger: "blur",
-          },
+          { validator: lengthValidator, max: 16, message: "长度在 1 到 16 个字符", trigger: ['change', 'blur'] },
         ],
+        JobDesc: [{ validator: lengthValidator, max: 128, message: '长度在 1 到 128 个字符', trigger: ['change', 'blur'] }]
       },
       defaultProps: {
         children: "children",

+ 2 - 2
src/views/login/index.vue

@@ -11,7 +11,7 @@
           <span class="svg-container">
             <svg-icon style="color:#606266;" icon-class="user" />
           </span>
-          <el-input ref="username" v-model="loginForm.username" placeholder="请输入账号" name="username" type="text" tabindex="1" auto-complete="on" />
+          <el-input ref="username" v-model.trim="loginForm.username" placeholder="请输入账号" name="username" type="text" tabindex="1" auto-complete="on" />
         </el-form-item>
 
         <el-form-item prop="password">
@@ -23,7 +23,7 @@
 
         <div class="flex-wrap">
           <el-form-item class="flex1" prop="identify">
-            <el-input ref="identify" v-model="loginForm.identify" placeholder="请输入验证码" name="identify" tabindex="1" auto-complete="on" @keyup.enter.native="handleLogin" />
+            <el-input ref="identify" v-model.trim="loginForm.identify" placeholder="请输入验证码" name="identify" tabindex="1" auto-complete="on" @keyup.enter.native="handleLogin" />
           </el-form-item>
           <Identify @changeCode="changeCode" :identifyCode="loginForm.CheckCode" style="margin-left: 24px;" />
         </div>

+ 18 - 18
src/views/organizationManagement/components/organizationAdd.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-11-29 11:26:07
- * @LastEditTime: 2022-03-15 11:50:58
+ * @LastEditTime: 2022-03-16 15:27:34
  * @LastEditors: your name
  * @Description:新增组织
  * @FilePath: \Foshan4A2.0\src\views\authorityManagement\components\authorityPower.vue
@@ -19,7 +19,7 @@
       <div class="addApp-form-content dialog-public-background">
         <el-form :inline="true" ref="form" :rules="rules" class="form" :model="form">
           <el-form-item prop="name" label="组织名称">
-            <el-input placeholder="请输入组织名称" v-model="form.name"></el-input>
+            <el-input placeholder="请输入组织名称" v-model.trim="form.name"></el-input>
           </el-form-item>
           <el-form-item prop="id" label="组织类型">
             <el-select v-model="form.id" placeholder="请选择">
@@ -27,24 +27,24 @@
               <el-option label="集团外" :value="0"></el-option>
             </el-select>
           </el-form-item>
-          <el-form-item prop="app" label="描述">
-            <el-input style="width: 835px" placeholder="请输入描述" v-model="form.app"></el-input>
+          <el-form-item prop="desc" label="描述">
+            <el-input style="width: 835px" placeholder="请输入描述" v-model.trim="form.desc"></el-input>
           </el-form-item>
           <div class="top24">
             <el-form-item prop="oneCode" label="1级编码">
-              <el-input placeholder="最多输入2个字符" v-model="form.oneCode"></el-input>
+              <el-input placeholder="请输入编码" v-model.trim="form.oneCode"></el-input>
             </el-form-item>
             <el-form-item prop="twoCode" class="twoCode" label="2级编码">
-              <el-input placeholder="最多输入3个字符" style="width: 202px" v-model="form.twoCode"></el-input>
+              <el-input placeholder="请输入编码" style="width: 202px" v-model.trim="form.twoCode"></el-input>
             </el-form-item>
             <el-form-item prop="threeCode" label="3级编码">
-              <el-input placeholder="最多输入8个字符" v-model="form.threeCode"></el-input>
+              <el-input placeholder="请输入编码" v-model.trim="form.threeCode"></el-input>
             </el-form-item>
             <el-form-item prop="fourCode" label="4级编码">
-              <el-input placeholder="最多输入2个字符" v-model="form.fourCode"></el-input>
+              <el-input placeholder="请输入编码" v-model.trim="form.fourCode"></el-input>
             </el-form-item>
             <el-form-item prop="fiveCode" label="5级编码">
-              <el-input placeholder="最多输入2个字符" v-model="form.fiveCode"></el-input>
+              <el-input placeholder="请输入编码" v-model.trim="form.fiveCode"></el-input>
             </el-form-item>
           </div>
         </el-form>
@@ -88,7 +88,7 @@ export default {
         //应用表单
         name: "",
         id: "",
-        app: "",
+        desc: "",
         oneCode: "",
         twoCode: "",
         threeCode: "",
@@ -100,15 +100,15 @@ export default {
         //表单验证
         name: [
           { required: true, message: "请输入组织名称", trigger: "blur" },
-          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] }
+          { validator: lengthValidator, max: 32, message: '长度在 1 到 32 个字符', trigger: ['change', 'blur'] }
         ],
         id: [{ required: true, message: "请输入标识符", trigger: "blur" }],
-        app: [{ validator: lengthValidator, max: 128, message: '最多输入128个字符', trigger: ['change', 'blur'] }],
-        oneCode: [{ validator: lengthValidator, max: 2, message: '最多输入2个字符', trigger: ['change', 'blur'] }],
-        twoCode: [{ validator: lengthValidator, max: 3, message: '最多输入3个字符', trigger: ['change', 'blur'] }],
-        threeCode: [{ validator: lengthValidator, max: 8, message: '最多输入8个字符', trigger: ['change', 'blur'] }],
-        fourCode: [{ validator: lengthValidator, max: 2, message: '最多输入2个字符', trigger: ['change', 'blur'] }],
-        fiveCode: [{ validator: lengthValidator, max: 2, message: '最多输入2个字符', trigger: ['change', 'blur'] }],
+        desc: [{ validator: lengthValidator, max: 128, message: '长度在 1 到 128 个字符', trigger: ['change', 'blur'] }],
+        oneCode: [{ validator: lengthValidator, max: 2, message: '长度在 1 到 2 个字符', trigger: ['change', 'blur'] }],
+        twoCode: [{ validator: lengthValidator, max: 3, message: '长度在 1 到 3 个字符', trigger: ['change', 'blur'] }],
+        threeCode: [{ validator: lengthValidator, max: 8, message: '长度在 1 到 8 个字符', trigger: ['change', 'blur'] }],
+        fourCode: [{ validator: lengthValidator, max: 2, message: '长度在 1 到 2 个字符', trigger: ['change', 'blur'] }],
+        fiveCode: [{ validator: lengthValidator, max: 2, message: '长度在 1 到 2 个字符', trigger: ['change', 'blur'] }],
       },
       defaultProps: {
         children: "children",
@@ -236,7 +236,7 @@ export default {
         const res = await newOrgan({
           OrganName: this.form.name,
           OrganType: this.form.id,
-          OrganDesc: this.form.app,
+          OrganDesc: this.form.desc,
           OrganUpid: this.AppId,
           RoleList: this.openRole ? this.checkRoles : [],
           AuthList: this.openRole ? [] : datas,

+ 19 - 19
src/views/organizationManagement/components/organizationEdit.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-11-29 11:26:07
- * @LastEditTime: 2022-03-15 11:51:07
+ * @LastEditTime: 2022-03-16 15:27:43
  * @LastEditors: your name
  * @Description:新增组织
  * @FilePath: \Foshan4A2.0\src\views\authorityManagement\components\authorityPower.vue
@@ -19,7 +19,7 @@
       <div class="addApp-form-content dialog-public-background">
         <el-form :inline="true" ref="form" :rules="rules" class="form" :model="form">
           <el-form-item prop="name" label="组织名称">
-            <el-input placeholder="请输入组织名称" v-model="form.name"></el-input>
+            <el-input placeholder="请输入组织名称" v-model.trim="form.name"></el-input>
           </el-form-item>
           <el-form-item prop="id" label="组织类型">
             <el-select v-model="form.id" placeholder="请选择">
@@ -27,24 +27,24 @@
               <el-option label="集团外" :value="0"></el-option>
             </el-select>
           </el-form-item>
-          <el-form-item prop="app" label="描述">
-            <el-input style="width: 835px" placeholder="请输入描述" v-model="form.app"></el-input>
+          <el-form-item prop="desc" label="描述">
+            <el-input style="width: 835px" placeholder="请输入描述" v-model.trim="form.desc"></el-input>
           </el-form-item>
           <div class="top24">
             <el-form-item prop="oneCode" label="1级编码">
-              <el-input placeholder="最多输入2个字符" v-model="form.oneCode"></el-input>
+              <el-input placeholder="请输入编码" v-model.trim="form.oneCode"></el-input>
             </el-form-item>
             <el-form-item prop="twoCode" class="twoCode" label="2级编码">
-              <el-input placeholder="最多输入3个字符" style="width: 202px" v-model="form.twoCode"></el-input>
+              <el-input placeholder="请输入编码" style="width: 202px" v-model.trim="form.twoCode"></el-input>
             </el-form-item>
             <el-form-item prop="threeCode" label="3级编码">
-              <el-input placeholder="最多输入8个字符" v-model="form.threeCode"></el-input>
+              <el-input placeholder="请输入编码" v-model.trim="form.threeCode"></el-input>
             </el-form-item>
             <el-form-item prop="fourCode" label="4级编码">
-              <el-input placeholder="最多输入2个字符" v-model="form.fourCode"></el-input>
+              <el-input placeholder="请输入编码" v-model.trim="form.fourCode"></el-input>
             </el-form-item>
             <el-form-item prop="fiveCode" label="5级编码">
-              <el-input placeholder="最多输入2个字符" v-model="form.fiveCode"></el-input>
+              <el-input placeholder="请输入编码" v-model.trim="form.fiveCode"></el-input>
             </el-form-item>
           </div>
         </el-form>
@@ -88,7 +88,7 @@ export default {
         //应用表单
         name: "",
         id: "",
-        app: "",
+        desc: "",
         oneCode: "",
         twoCode: "",
         threeCode: "",
@@ -100,15 +100,15 @@ export default {
          //表单验证
         name: [
           { required: true, message: "请输入组织名称", trigger: "blur" },
-          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] }
+          { validator: lengthValidator, max: 32, message: '长度在 1 到 32 个字符', trigger: ['change', 'blur'] }
         ],
         id: [{ required: true, message: "请输入标识符", trigger: "blur" }],
-        app: [{ validator: lengthValidator, max: 128, message: '最多输入128个字符', trigger: ['change', 'blur'] }],
-        oneCode: [{ validator: lengthValidator, max: 2, message: '最多输入2个字符', trigger: ['change', 'blur'] }],
-        twoCode: [{ validator: lengthValidator, max: 3, message: '最多输入3个字符', trigger: ['change', 'blur'] }],
-        threeCode: [{ validator: lengthValidator, max: 8, message: '最多输入8个字符', trigger: ['change', 'blur'] }],
-        fourCode: [{ validator: lengthValidator, max: 2, message: '最多输入2个字符', trigger: ['change', 'blur'] }],
-        fiveCode: [{ validator: lengthValidator, max: 2, message: '最多输入2个字符', trigger: ['change', 'blur'] }],
+        desc: [{ validator: lengthValidator, max: 128, message: '长度在 1 到 128 个字符', trigger: ['change', 'blur'] }],
+        oneCode: [{ validator: lengthValidator, max: 2, message: '长度在 1 到 2 个字符', trigger: ['change', 'blur'] }],
+        twoCode: [{ validator: lengthValidator, max: 3, message: '长度在 1 到 3 个字符', trigger: ['change', 'blur'] }],
+        threeCode: [{ validator: lengthValidator, max: 8, message: '长度在 1 到 8 个字符', trigger: ['change', 'blur'] }],
+        fourCode: [{ validator: lengthValidator, max: 2, message: '长度在 1 到 2 个字符', trigger: ['change', 'blur'] }],
+        fiveCode: [{ validator: lengthValidator, max: 2, message: '长度在 1 到 2 个字符', trigger: ['change', 'blur'] }],
       },
       defaultProps: {
         children: "children",
@@ -267,7 +267,7 @@ export default {
           } = res.returnData;
           this.form.name = OrganName || '';
           this.form.id = OrganType || '';
-          this.form.app = OrganDesc || '';
+          this.form.desc = OrganDesc || '';
           this.form.oneCode = L1 || '';
           this.form.twoCode = L2 || '';
           this.form.threeCode = L3 || '';
@@ -361,7 +361,7 @@ export default {
         const res = await newOrganmod({
           OrganName: this.form.name,
           OrganType: this.form.id,
-          OrganDesc: this.form.app,
+          OrganDesc: this.form.desc,
           OrganUpid: this.OrganUpid,
           OrganId: this.AppId,
           Status: this.Status,

+ 9 - 10
src/views/staffManagement/compontents/staffAdd.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2022-02-10 14:49:20
- * @LastEditTime: 2022-03-16 10:57:58
+ * @LastEditTime: 2022-03-16 15:14:16
  * @LastEditors: your name
  * @Description: 编辑职员
  * @FilePath: \Foshan4A4.0\src\views\staffManagement\compontents\staffEdit.vue
@@ -33,8 +33,8 @@
           <el-form-item v-is="['officer_btn_resetpwd']">
             <el-button size="small" type="primary" @click="reSetPassWord">{{ doesPwdExist ? '重置' : '生成' }}密码</el-button>
           </el-form-item>
-          <el-form-item prop="app" label="描述">
-            <el-input class="lastInput" placeholder="请输入描述" v-model.trim="form.app"></el-input>
+          <el-form-item prop="desc" label="描述">
+            <el-input class="lastInput" placeholder="请输入描述" v-model.trim="form.desc"></el-input>
           </el-form-item>
         </el-form>
       </div>
@@ -140,7 +140,7 @@ export default {
         name: "",
         loginName: "",
         loginPwd: "",
-        app: "",
+        desc: "",
         phone: ""
       },
       title: "角色",
@@ -148,20 +148,19 @@ export default {
         //表单验证
         name: [
           { required: true, message: "请输入职员名称", trigger: "blur" },
-          { pattern: regular.name, message: regular.nameMessage, trigger: ['change', 'blur'] },
-          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] }
+          { validator: lengthValidator, max: 32, message: '长度在 1 到 32 个字符', trigger: ['change', 'blur'] }
         ],
         loginName: [
           { required: true, message: "请输入职员登录名", trigger: "blur" },
           { pattern: regular.name, message: regular.nameMessage, trigger: ['change', 'blur'] },
-          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] },
+          { validator: lengthValidator, max: 32, message: '长度在 1 到 32 个字符', trigger: ['change', 'blur'] },
         ],
         phone: [
           { pattern: regular.integer, message: '请输入纯数字', trigger: ['blur', 'change'] },
           { validator: lengthValidator, min: 11, max: 11, message: '请输入11位电话号码', trigger: ['change', 'blur'] }
         ],
-        app: [
-          { validator: lengthValidator, max: 128, message: '最多输入128个字符', trigger: ['change', 'blur'] },
+        desc: [
+          { validator: lengthValidator, max: 128, message: '长度在 1 到 128 个字符', trigger: ['change', 'blur'] },
         ],
         loginPwd: [
           { required: true, message: "请生成职员登录密码" }
@@ -430,7 +429,7 @@ export default {
         }
         const res = await newstaff({
           OfficerName: this.form.name,
-          OfficerDesc: this.form.app,
+          OfficerDesc: this.form.desc,
           OfficerLoginName: this.form.loginName,
           OfficerPwd: this.form.loginPwd,
           Phone: this.form.phone,

+ 10 - 11
src/views/staffManagement/compontents/staffEdit.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2022-02-10 14:49:20
- * @LastEditTime: 2022-03-16 11:04:46
+ * @LastEditTime: 2022-03-16 15:13:46
  * @LastEditors: your name
  * @Description: 编辑职员
  * @FilePath: \Foshan4A4.0\src\views\staffManagement\compontents\staffEdit.vue
@@ -33,8 +33,8 @@
           <el-form-item v-is="['officer_btn_resetpwd']">
             <el-button size="small" type="primary" @click="reSetPassWord">重置密码</el-button>
           </el-form-item>
-          <el-form-item prop="app" label="描述">
-            <el-input class="lastInput" placeholder="请输入描述" v-model.trim="form.app"></el-input>
+          <el-form-item prop="desc" label="描述">
+            <el-input class="lastInput" placeholder="请输入描述" v-model.trim="form.desc"></el-input>
           </el-form-item>
         </el-form>
       </div>
@@ -143,7 +143,7 @@ export default {
         name: "",
         loginName: "",
         loginPwd: "",
-        app: "",
+        desc: "",
         phone: ""
       },
       title: "角色",
@@ -151,20 +151,19 @@ export default {
         //表单验证
         name: [
           { required: true, message: "请输入职员名称", trigger: "blur" },
-          { pattern: regular.name, message: regular.nameMessage, trigger: ['change', 'blur'] },
-          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] }
+          { validator: lengthValidator, max: 32, message: '长度在 1 到 32 个字符', trigger: ['change', 'blur'] }
         ],
         loginName: [
           { required: true, message: "请输入职员登录名", trigger: "blur" },
           { pattern: regular.name, message: regular.nameMessage, trigger: ['change', 'blur'] },
-          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] },
+          { validator: lengthValidator, max: 32, message: '长度在 1 到 32 个字符', trigger: ['change', 'blur'] },
         ],
         phone: [
           { pattern: regular.integer, message: '请输入纯数字', trigger: ['blur', 'change'] },
           { validator: lengthValidator, min: 11, max: 11, message: '请输入11位电话号码', trigger: ['change', 'blur'] }
         ],
-        app: [
-          { validator: lengthValidator, max: 128, message: '最多输入128个字符', trigger: ['change', 'blur'] },
+        desc: [
+          { validator: lengthValidator, max: 128, message: '长度在 1 到 128 个字符', trigger: ['change', 'blur'] },
         ],
       },
       defaultProps: {
@@ -287,7 +286,7 @@ export default {
           } = obj;
           this.form.name = OfficerName;
           this.form.loginName = OfficerLoginName;
-          this.form.app = OfficerDesc;
+          this.form.desc = OfficerDesc;
           this.form.phone = Phone;
           this.orgCheckedKeys = [OrganId];
           this.oldOrganId = OrganId;
@@ -566,7 +565,7 @@ export default {
         }
         const res = await newstaffmod({
           OfficerName: this.form.name,
-          OfficerDesc: this.form.app,
+          OfficerDesc: this.form.desc,
           OfficerLoginName: this.form.loginName,
           OfficerPwd: this.form.loginPwd,
           Phone: this.form.phone,

+ 6 - 10
src/views/systemManagement/EditSystem/index.vue

@@ -20,7 +20,7 @@
             <el-form-item label="策略名称" prop="TacName">
               <el-input
                 placeholder="请输入"
-                v-model="FormData.TacName"
+                v-model.trim="FormData.TacName"
               ></el-input>
             </el-form-item>
           </div>
@@ -73,7 +73,7 @@
             <el-form-item label="IP段" prop="IpList">
               <el-input
                 placeholder="请输入IP,并以‘;’号隔开"
-                v-model="FormData.IpList"
+                v-model.trim="FormData.IpList"
               ></el-input>
             </el-form-item>
           </div>
@@ -81,7 +81,7 @@
             <el-form-item label="描述" prop="TacDesc">
               <el-input
                 placeholder="请输入"
-                v-model="FormData.TacDesc"
+                v-model.trim="FormData.TacDesc"
               ></el-input>
             </el-form-item>
           </div>
@@ -198,6 +198,7 @@
 import { EditTac, GetTacDetails, DeleteTac } from "@/api/systemConfiguration";
 import Dialog from "@/layout/components/Dialog";
 import { findarrays } from "@/utils/validate";
+import { lengthValidator } from '@/utils/validate'
 export default {
   data() {
     return {
@@ -235,12 +236,7 @@ export default {
       rules: {
         TacName: [
           { required: true, message: "请输入策略名称", trigger: "blur" },
-          {
-            min: 1,
-            max: 16,
-            message: "长度在 1 到 16 个字符",
-            trigger: "blur",
-          },
+          { validator: lengthValidator, max: 16, message: "长度在 1 到 16 个字符", trigger: ['change', 'blur'] },
         ],
         Date: [
           { required: true, message: "请选择登录日期", trigger: "change" },
@@ -249,7 +245,7 @@ export default {
           { required: true, message: "请选择登录时间", trigger: "change" },
         ],
         TacDesc: [
-          { min: 0, max: 200, message: "最大200个字", trigger: "blur" },
+          { validator: lengthValidator, max: 128, message: "长度在 1 到 128 个字符", trigger: ['change', 'blur'] },
         ],
       },
       editId: null,

+ 5 - 9
src/views/systemManagement/addSystem/index.vue

@@ -18,7 +18,7 @@
             <el-form-item label="策略名称" prop="TacName">
               <el-input
                 placeholder="请输入"
-                v-model="FormData.TacName"
+                v-model.trim="FormData.TacName"
               ></el-input>
             </el-form-item>
           </div>
@@ -71,7 +71,7 @@
             <el-form-item label="IP段" prop="IpList">
               <el-input
                 placeholder="请输入IP,并以‘;’号隔开"
-                v-model="FormData.IpList"
+                v-model.trim="FormData.IpList"
               ></el-input>
             </el-form-item>
           </div>
@@ -79,7 +79,7 @@
             <el-form-item label="描述" prop="IpList">
               <el-input
                 placeholder="请输入"
-                v-model="FormData.TacDesc"
+                v-model.trim="FormData.TacDesc"
               ></el-input>
             </el-form-item>
           </div>
@@ -187,6 +187,7 @@
 import { GetUserList } from "@/api/apiAuthority";
 import { SaveTac } from "@/api/systemConfiguration";
 import { findarrays } from "@/utils/validate";
+import { lengthValidator } from '@/utils/validate'
 export default {
   data() {
     return {
@@ -222,12 +223,7 @@ export default {
       rules: {
         TacName: [
           { required: true, message: "请输入策略名称", trigger: "blur" },
-          {
-            min: 1,
-            max: 16,
-            message: "长度在 1 到 16 个字符",
-            trigger: "blur",
-          },
+          { validator: lengthValidator, max: 16, message: "长度在 1 到 16 个字符", trigger: ['change', 'blur'] },
         ],
         Date: [
           { required: true, message: "请选择登录日期", trigger: "change" },

+ 7 - 7
src/views/systemManagement/index.vue

@@ -57,7 +57,7 @@
           <div class="riaStyle">
             <el-form-item prop="UserIdledays">
               <el-input
-                v-model="FormData.UserIdledays"
+                v-model.trim="FormData.UserIdledays"
                 placeholder="请输入"
               ></el-input>
             </el-form-item>
@@ -69,7 +69,7 @@
           <div class="riaStyle">
             <el-form-item prop="LockMins">
               <el-input
-                v-model="FormData.LockMins"
+                v-mode.trim="FormData.LockMins"
                 placeholder="请输入"
               ></el-input>
             </el-form-item>
@@ -83,7 +83,7 @@
               <el-form-item prop="PwdLengthBegin">
                 <el-input
                   class="ipt1"
-                  v-model="FormData.PwdLengthBegin"
+                  v-model.trim="FormData.PwdLengthBegin"
                   placeholder="最少位数"
                 ></el-input>
               </el-form-item>
@@ -95,7 +95,7 @@
               <el-form-item prop="PwdLengthEnd">
                 <el-input
                   class="ipt2"
-                  v-model="FormData.PwdLengthEnd"
+                  v-model.trim="FormData.PwdLengthEnd"
                   placeholder="最多位数"
                 ></el-input>
               </el-form-item>
@@ -135,7 +135,7 @@
           <div class="riaStyle">
             <el-form-item prop="PwdValidtime">
               <el-input
-                v-model="FormData.PwdValidtime"
+                v-model.trim="FormData.PwdValidtime"
                 placeholder="请输入"
               ></el-input>
             </el-form-item>
@@ -147,7 +147,7 @@
           <div class="riaStyle">
             <el-form-item prop="PwdValidtime">
               <el-input
-                v-model="FormData.LoginError"
+                v-model.trim="FormData.LoginError"
                 placeholder="请输入"
               ></el-input>
             </el-form-item>
@@ -159,7 +159,7 @@
           <div class="riaStyle">
             <el-form-item prop="PwdValidtime">
               <el-input
-                v-model="FormData.PwdMessage"
+                v-model.trim="FormData.PwdMessage"
                 placeholder="请输入"
               ></el-input>
             </el-form-item>