zhaoke 1 year ago
parent
commit
e75e143c58

+ 1 - 1
src/router/routes/routes-file-one.ts

@@ -52,7 +52,7 @@ const HomeRoutes = [
             component: () =>
               import('@/views/dashboard/internationalDeparture.vue'),
             meta: {
-              title: '国际出港',
+              title: '国际出港-直航',
               roles: ['international_departure_page'],
             },
           },

+ 58 - 125
src/views/systemSettings/securityPolicy/securityPolicyedit.vue

@@ -1,21 +1,10 @@
 <template>
   <div class="security-policy">
-    <el-form
-      ref="form"
-      :model="formData"
-      :rules="formRule"
-      size="default"
-      label-position="left"
-      label-width="95px"
-    >
+    <el-form ref="form" :model="formData" :rules="formRule" size="default" label-position="left" label-width="95px">
       <el-row :gutter="24">
         <el-col :span="8">
           <div class="security-policy-box">
-            <Minheader
-              :is-preser="true"
-              :is-statuser="true"
-              @preserForm="submitForm"
-            >
+            <Minheader :is-preser="true" :is-statuser="true" @preserForm="submitForm">
               <template #header>
                 <div class="status flex-wrap">
                   <div class="manageTitle">验证码策略</div>
@@ -24,44 +13,28 @@
             </Minheader>
             <el-row :gutter="24">
               <el-col :span="12">
-                <el-form-item
-                  label="验证码长度"
-                  prop="verification_code_length"
-                >
-                  <el-input
-                    v-model="formData.verification_code_length"
-                    placeholder="请输入验证码长度"
-                    clearable
-                  />
+                <el-form-item label="验证码长度" prop="verification_code_length">
+                  <el-select v-model="formData.verification_code_length" placeholder="请输入验证码长度" clearable>
+                    <el-option label="4" :value="4" />
+                    <el-option label="5" :value="5" />
+                    <el-option label="6" :value="6" />
+                    <el-option label="7" :value="7" />
+                    <el-option label="8" :value="8" />
+                  </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="验证码类型" prop="verification_code_type">
-                  <el-select
-                    style="width: 100%"
-                    v-model="formData.verification_code_type"
-                    class="input-shadow"
-                    filterable
-                    default-first-option
-                    clearable
-                    placeholder="请选择"
-                  >
+                  <el-select style="width: 100%" v-model="formData.verification_code_type" class="input-shadow" filterable default-first-option clearable placeholder="请选择">
                     <el-option :value="1" label="仅数字" />
+                    <el-option :value="3" label="仅英文" />
                     <el-option :value="2" label="数字英文" />
                   </el-select>
                 </el-form-item>
               </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%" 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>
@@ -80,11 +53,7 @@
         </el-col>
         <el-col :span="8">
           <div class="security-policy-box">
-            <Minheader
-              :is-preser="true"
-              :is-statuser="true"
-              @preserForm="submitForm"
-            >
+            <Minheader :is-preser="true" :is-statuser="true" @preserForm="submitForm">
               <template #header>
                 <div class="status flex-wrap">
                   <div class="manageTitle">密码策略</div>
@@ -93,33 +62,13 @@
             </Minheader>
             <el-row :gutter="24">
               <el-col :span="12">
-                <el-form-item
-                  label="密码长度"
-                  prop="pwd_cons"
-                  label-width="100px"
-                >
-                  <el-input
-                    v-model="formData.pwd_cons"
-                    placeholder="请输入密码长度"
-                    clearable
-                  />
+                <el-form-item label="密码长度" prop="pwd_cons" label-width="100px">
+                  <el-input v-model="formData.pwd_cons" placeholder="请输入密码长度" clearable />
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item
-                  label="密码类型"
-                  prop="pwd_type"
-                  label-width="100px"
-                >
-                <el-select
-                    style="width: 100%"
-                    v-model="formData.pwd_type"
-                    class="input-shadow"
-                    filterable
-                    default-first-option
-                    clearable
-                    placeholder="请选择"
-                  >
+                <el-form-item label="密码类型" prop="pwd_type" label-width="100px">
+                  <el-select style="width: 100%" v-model="formData.pwd_type" class="input-shadow" filterable default-first-option clearable placeholder="请选择">
                     <el-option :value="'1'" label="英文" />
                     <el-option :value="'2'" label="数字" />
                     <el-option :value="'3'" label="英文+数字" />
@@ -128,20 +77,8 @@
                 </el-form-item>
               </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-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-option :value="'0'" label="英文区分大小写" />
                     <el-option :value="'1'" label="英文不区分大小写" />
                   </el-select>
@@ -152,11 +89,7 @@
         </el-col>
         <el-col :span="8">
           <div class="security-policy-box">
-            <Minheader
-              :is-preser="true"
-              :is-statuser="true"
-              @preserForm="submitForm"
-            >
+            <Minheader :is-preser="true" :is-statuser="true" @preserForm="submitForm">
               <template #header>
                 <div class="status flex-wrap">
                   <div class="manageTitle">多点登录</div>
@@ -181,11 +114,11 @@
 </template>
 
 <script setup lang="ts">
-import { Query, modifyData } from '@/api/webApi'
-import Minheader from '@/components/minheader/index.vue'
-import { ElMessage, FormInstance } from 'element-plus'
+import { Query, modifyData } from "@/api/webApi";
+import Minheader from "@/components/minheader/index.vue";
+import { ElMessage, FormInstance } from "element-plus";
 
-const form = ref<FormInstance | null>(null)
+const form = ref<FormInstance | null>(null);
 const formData = reactive({
   verification_code_length: null,
   verification_code_type: null,
@@ -195,48 +128,48 @@ const formData = reactive({
   pwd_type: "",
   pwd_case: "",
   user_officer_multi: true,
-})
+});
 const verificationCodeEnable = computed(() =>
   Boolean(formData.verification_code)
-)
+);
 const formRule = {
   verification_code_length: [
     {
       required: verificationCodeEnable,
-      message: '请输入验证码长度',
-      trigger: 'blur',
+      message: "请选择验证码长度",
+      trigger: "blur",
     },
   ],
   verification_code_type: [
     {
       required: verificationCodeEnable,
-      message: '请选择验证码类型',
-      trigger: 'blur',
+      message: "请选择验证码类型",
+      trigger: "blur",
     },
   ],
   verification_code_Aa: [
     {
       required: verificationCodeEnable,
-      message: '请选择验证码大小写',
-      trigger: 'blur',
+      message: "请选择验证码大小写",
+      trigger: "blur",
     },
   ],
   verification_code: [
-    { required: true, message: '请选择是否开启验证码', trigger: 'blur' },
+    { required: true, message: "请选择是否开启验证码", trigger: "blur" },
   ],
   // pwd_cons: [{ required: true, message: '请输入密码规则(正则表达式)', trigger: 'blur' }],
   user_officer_multi: [
-    { required: true, message: '请选择是否开启多点登录', trigger: 'blur' },
+    { required: true, message: "请选择是否开启多点登录", trigger: "blur" },
   ],
-}
+};
 
 const submitForm = () => {
-  form.value?.validate(valid => {
+  form.value?.validate((valid) => {
     if (valid) {
-      setSecurityPolicy()
+      setSecurityPolicy();
     }
-  })
-}
+  });
+};
 
 const getSecurityPolicy = async () => {
   try {
@@ -247,43 +180,43 @@ const getSecurityPolicy = async () => {
     } = await Query({
       id: DATACONTENT_ID.securityPolicy,
       dataContent: [],
-    })
-    if (String(code) !== '0') {
-      throw new Error(message ?? '失败')
+    });
+    if (String(code) !== "0") {
+      throw new Error(message ?? "失败");
     }
     if (!listValues.length) {
-      throw new Error('未查询到策略信息')
+      throw new Error("未查询到策略信息");
     }
-    const data = listValues[0]
-    Object.assign(formData, data)
+    const data = listValues[0];
+    Object.assign(formData, data);
   } catch (error) {
-    console.error(error)
+    console.error(error);
   }
-}
+};
 
 const setSecurityPolicy = async () => {
   try {
     const dataContent = {
       ...formData,
       event: 2,
-    }
+    };
     const { code, message } = await modifyData({
       serviceId: SERVICE_ID.securityPolicy,
       dataContent,
-    })
-    if (String(code) !== '0') {
-      throw new Error(message ?? '失败')
+    });
+    if (String(code) !== "0") {
+      throw new Error(message ?? "失败");
     }
-    ElMessage.success('操作成功')
-    getSecurityPolicy()
+    ElMessage.success("操作成功");
+    getSecurityPolicy();
   } catch (error) {
-    console.error(error)
+    console.error(error);
   }
-}
+};
 
 onMounted(() => {
-  getSecurityPolicy()
-})
+  getSecurityPolicy();
+});
 </script>
 
 <style lang="scss" scoped>