zhaoke 1 жил өмнө
parent
commit
9dea31c2d2

+ 7 - 7
src/router/routes/routes-file-two.ts

@@ -77,13 +77,13 @@ const HomeRoutes = {
       meta: { title: '应用管理', roles: ['application_managemen_page'] },
       component: () => import('@/views/userManagement/application/index.vue'),
     },
-    // {
-    //   path: "/userManagement/securityPolicy",
-    //   name: "SecurityPolicy",
-    //   meta: { title: "登录策略", roles: ["login_strategy_page"] },
-    //   component: () =>
-    //     import("@/views/systemSettings/securityPolicy/index.vue"),
-    // },
+    {
+      path: '/userManagement/securityPolicy',
+      name: 'SecurityPolicy',
+      meta: { title: '登录策略', roles: ['login_strategy_page'] },
+      component: () =>
+        import('@/views/systemSettings/securityPolicy/index.vue'),
+    },
   ],
 }
 

+ 40 - 161
src/views/systemSettings/securityPolicy/index.vue

@@ -1,129 +1,66 @@
 <template>
   <div class="airportInfo scroll-y">
     <div class="wrap">
-      <Minheader
-        :is-auth="true"
-        :is-statuser="true"
-        powerData="new_login_policy_button"
-        @addForm="addForm"
-      >
+      <Minheader :is-auth="true" :is-statuser="true" powerData="new_login_policy_button" @addForm="addForm">
         <template #header>
           <div class="status flex-wrap">
             <div class="manageTitle">登录策略</div>
           </div>
-        </template></Minheader
-      >
+        </template>
+      </Minheader>
       <div class="app-containers">
-        <el-table
-          :data="tableData"
-          style="width: 100%"
-          :row-style="rowStyle"
-          :row-class-name="tableRowClassName"
-          :cell-class-name="cellClassName"
-          :row-key="
+        <el-table :data="tableData" style="width: 100%" :row-style="rowStyle" :row-class-name="tableRowClassName" :cell-class-name="cellClassName" :row-key="
             props.tableProperty.rowKey
               ? props.tableProperty.rowKey
               : tablePropertyDefault.rowKey
-          "
-          :height="
+          " :height="
             props.tableProperty.height
               ? props.tableProperty.height
               : tablePropertyDefault.height
-          "
-          :max-height="
+          " :max-height="
             props.tableProperty.maxHeight
               ? props.tableProperty.maxHeight
               : tablePropertyDefault.maxHeight
-          "
-          :stripe="
+          " :stripe="
             props.tableProperty.stripe
               ? props.tableProperty.stripe
               : tablePropertyDefault.stripe
-          "
-          :border="
+          " :border="
             props.tableProperty.border
               ? props.tableProperty.border
               : tablePropertyDefault.border
-          "
-          :highlight-current-row="
+          " :highlight-current-row="
             props.tableProperty.highlightCurrentRow
               ? props.tableProperty.highlightCurrentRow
               : tablePropertyDefault.highlightCurrentRow
-          "
-          :header-cell-class-name="
+          " :header-cell-class-name="
             props.tableProperty.headerRowClassName
               ? props.tableProperty.headerRowClassName
               : tablePropertyDefault.headerRowClassName
-          "
-          :tooltip-effect="
+          " :tooltip-effect="
             props.tableProperty.tooltipEffect
               ? props.tableProperty.tooltipEffect
               : tablePropertyDefault.tooltipEffect
-          "
-          :show-summary="
+          " :show-summary="
             props.tableProperty.showSummary
               ? props.tableProperty.showSummary
               : tablePropertyDefault.showSummary
-          "
-        >
-          <el-table-column
-            prop="name"
-            label="名称"
-            class="infinite-list-item"
-          />
+          ">
+          <el-table-column prop="name" label="名称" class="infinite-list-item" />
           <el-table-column label="有效日期" class="infinite-list-item">
-            <el-table-column
-              prop="china"
-              label="开始日期"
-              class="infinite-list-item"
-            />
-            <el-table-column
-              prop="englin"
-              label="结束日期"
-              class="infinite-list-item"
-            />
+            <el-table-column prop="china" label="开始日期" class="infinite-list-item" />
+            <el-table-column prop="englin" label="结束日期" class="infinite-list-item" />
           </el-table-column>
           <el-table-column label="有效时间" class="infinite-list-item">
-            <el-table-column
-              prop="china"
-              label="开始时间"
-              class="infinite-list-item"
-            />
-            <el-table-column
-              prop="englin"
-              label="结束时间"
-              class="infinite-list-item"
-            />
+            <el-table-column prop="china" label="开始时间" class="infinite-list-item" />
+            <el-table-column prop="englin" label="结束时间" class="infinite-list-item" />
           </el-table-column>
-          <el-table-column
-            prop="name"
-            label="黑名单"
-            class="infinite-list-item"
-          />
-          <el-table-column
-            prop="name"
-            label="白名单"
-            class="infinite-list-item"
-          />
-          <el-table-column
-            prop="name"
-            label="描述"
-            class="infinite-list-item"
-          />
-          <el-table-column
-            v-if="tableBtnGroup.length"
-            label="操作"
-            :align="props.tableColumnProperty.align"
-          >
+          <el-table-column prop="name" label="黑名单" class="infinite-list-item" />
+          <el-table-column prop="name" label="白名单" class="infinite-list-item" />
+          <el-table-column prop="name" label="描述" class="infinite-list-item" />
+          <el-table-column v-if="tableBtnGroup.length" label="操作" :align="props.tableColumnProperty.align">
             <template #default="scope">
-              <el-button
-                v-for="(btn, index) in tableBtnGroup"
-                :key="index"
-                size="small"
-                @click="handleClick(scope.$index, scope.row, btn.param)"
-                :class="btn.className"
-                >{{ btn.name }}</el-button
-              >
+              <el-button v-for="(btn, index) in tableBtnGroup" :key="index" size="small" @click="handleClick(scope.$index, scope.row, btn.param)" :class="btn.className">{{ btn.name }}</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -135,64 +72,36 @@
           @btnClick="btnClick"
         /> -->
       </div>
-      <Dialog
-        width="628px"
-        :flag="flag"
-        :type="type"
-        :msgTitle="msgTitle"
-        @resetForm="resetForm"
-        @delRest="delRest"
-      >
+      <Dialog width="628px" :flag="flag" :type="type" :msgTitle="msgTitle" @resetForm="resetForm" @delRest="delRest">
         <div class="diacont">
           <el-form :model="tableForm">
             <el-row :gutter="24">
               <el-col>
                 <el-form-item label="策略名称" size="default">
-                  <el-input
-                    v-model="tableForm.name"
-                    placeholder="请输入策略名称"
-                  />
+                  <el-input v-model="tableForm.name" placeholder="请输入策略名称" />
                 </el-form-item>
               </el-col>
               <el-col>
                 <el-form-item label="有效日期" size="default">
-                  <el-date-picker
-                    v-model="tableForm.china"
-                    type="date"
-                    placeholder="选择日期"
-                  >
+                  <el-date-picker v-model="tableForm.china" type="date" placeholder="选择日期">
                   </el-date-picker>
-                  <el-date-picker
-                    style="margin-left: 40px"
-                    v-model="tableForm.englin"
-                    type="date"
-                    placeholder="选择日期"
-                  >
+                  <el-date-picker style="margin-left: 40px" v-model="tableForm.englin" type="date" placeholder="选择日期">
                   </el-date-picker>
                 </el-form-item>
               </el-col>
               <el-col>
                 <el-form-item label="有效时间" size="default">
-                  <el-time-select
-                    v-model="tableForm.two"
-                    :picker-options="{
+                  <el-time-select v-model="tableForm.two" :picker-options="{
                       start: '08:30',
                       step: '00:15',
                       end: '18:30',
-                    }"
-                    placeholder="选择时间"
-                  >
+                    }" placeholder="选择时间">
                   </el-time-select>
-                  <el-time-select
-                    style="margin-left: 8px"
-                    v-model="tableForm.three"
-                    :picker-options="{
+                  <el-time-select style="margin-left: 8px" v-model="tableForm.three" :picker-options="{
                       start: '08:30',
                       step: '00:15',
                       end: '18:30',
-                    }"
-                    placeholder="选择时间"
-                  >
+                    }" placeholder="选择时间">
                   </el-time-select>
                 </el-form-item>
               </el-col>
@@ -200,25 +109,12 @@
                 <el-form-item label="黑名单" size="default">
                   <div class="father_box">
                     <!-- 生成的标签 -->
-                    <div
-                      v-for="(item, index) in TagsAll"
-                      :key="index"
-                      class="spanbox"
-                    >
+                    <div v-for="(item, index) in TagsAll" :key="index" class="spanbox">
                       <span class="tagspan">{{ item }}</span>
                       <i class="span_close" @click="removeTag(index, item)"></i>
                     </div>
                     <!-- 输入框 -->
-                    <el-input
-                      style="width: 100%; border: none"
-                      placeholder="请输入黑名单"
-                      v-model="currentval"
-                      @keyup.enter="addTags"
-                      @keyup.delete="deleteTags"
-                      class="inputTag"
-                      ref="inputTag"
-                      type="text"
-                    />
+                    <el-input style="width: 100%; border: none" placeholder="请输入黑名单" v-model="currentval" @keyup.enter="addTags" @keyup.delete="deleteTags" class="inputTag" ref="inputTag" type="text" />
                   </div>
                 </el-form-item>
               </el-col>
@@ -226,38 +122,18 @@
                 <el-form-item label="白名单" size="default">
                   <div class="father_box">
                     <!-- 生成的标签 -->
-                    <div
-                      v-for="(item, index) in TagsAlls"
-                      :key="index"
-                      class="spanbox"
-                    >
+                    <div v-for="(item, index) in TagsAlls" :key="index" class="spanbox">
                       <span class="tagspan">{{ item }}</span>
-                      <i
-                        class="span_close"
-                        @click="removeTags(index, item)"
-                      ></i>
+                      <i class="span_close" @click="removeTags(index, item)"></i>
                     </div>
                     <!-- 输入框 -->
-                    <el-input
-                      style="width: 100%"
-                      placeholder="请输入白名单"
-                      v-model="currentvals"
-                      @keyup.enter="addTagss"
-                      @keyup.delete="deleteTagss"
-                      class="inputTag"
-                      ref="inputTag"
-                      type="text"
-                    />
+                    <el-input style="width: 100%" placeholder="请输入白名单" v-model="currentvals" @keyup.enter="addTagss" @keyup.delete="deleteTagss" class="inputTag" ref="inputTag" type="text" />
                   </div>
                 </el-form-item>
               </el-col>
               <el-col>
                 <el-form-item label="描述" size="default">
-                  <el-input
-                    type="textarea"
-                    v-model="tableForm.text"
-                    placeholder="请输入描述"
-                  />
+                  <el-input type="textarea" v-model="tableForm.text" placeholder="请输入描述" />
                 </el-form-item>
               </el-col>
             </el-row>
@@ -532,6 +408,9 @@ defineExpose({
   font-weight: bold;
   color: #101116;
 }
+::v-deep.el-table .cell {
+  text-align: center;
+}
 ::v-deep.el-table .editBtn {
   background: #ffffff;
   border: 1px solid #f79ec6;

+ 17 - 2
src/views/systemSettings/securityPolicy/securityPolicyedit.vue

@@ -34,7 +34,7 @@
               </el-col>
               <el-col :span="12">
                 <el-form-item label="大小写选择" prop="verification_code_Aa">
-                  <el-select style="width: 100%" v-model="formData.verification_code_Aa" class="input-shadow" filterable default-first-option clearable placeholder="请选择">
+                  <el-select style="width: 100%" :disabled="formData.verification_code_type == 1" v-model="formData.verification_code_Aa" class="input-shadow" filterable default-first-option clearable placeholder="请选择">
                     <el-option :value="true" label="英文区分大小写" />
                     <el-option :value="false" label="英文不区分大小写" />
                   </el-select>
@@ -78,7 +78,7 @@
               </el-col>
               <el-col :span="12">
                 <el-form-item label="大小写选择" prop="pwd_case" label-width="100px">
-                  <el-select style="width: 100%" v-model="formData.pwd_case" class="input-shadow" filterable default-first-option clearable placeholder="请选择">
+                  <el-select style="width: 100%" :disabled="formData.pwd_type == '2'" v-model="formData.pwd_case" class="input-shadow" filterable default-first-option clearable placeholder="请选择">
                     <el-option :value="'0'" label="英文区分大小写" />
                     <el-option :value="'1'" label="英文不区分大小写" />
                   </el-select>
@@ -132,6 +132,15 @@ const formData = reactive({
 const verificationCodeEnable = computed(() =>
   Boolean(formData.verification_code)
 );
+const validatePass = (rule: any, value: any, callback: any) => {
+  if (!value || Number(value) < 6) {
+    callback(new Error("密码长度不能小于6"));
+  } else if (!value || Number(value) > 32) {
+    callback(new Error("密码长度不能大于32"));
+  } else {
+    callback();
+  }
+};
 const formRule = {
   verification_code_length: [
     {
@@ -161,6 +170,12 @@ const formRule = {
   user_officer_multi: [
     { required: true, message: "请选择是否开启多点登录", trigger: "blur" },
   ],
+  pwd_cons: [
+    {
+      validator: validatePass,
+      trigger: "blur",
+    },
+  ],
 };
 
 const submitForm = () => {