From cc3e08bda13360c88b7189e8f8d043b60783c7fb Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期四, 21 十一月 2024 16:46:32 +0800
Subject: [PATCH] 新增

---
 src/views/components/loginForm.vue |   36 +++++++++++++++++++++++++++---------
 1 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/src/views/components/loginForm.vue b/src/views/components/loginForm.vue
index 7d4fd1b..be9abc5 100644
--- a/src/views/components/loginForm.vue
+++ b/src/views/components/loginForm.vue
@@ -48,7 +48,7 @@
           </el-form-item>
           <div style="display: flex;justify-content: space-between;align-items: center;margin-bottom: 25px">
             <div class="btn-cont">
-              <button class="login-btn" @click.prevent="handleLogin">
+              <button class="login-btn" @click.prevent="handleLogin" v-preReClick>
                 <span v-if="!loading">登 录</span>
                 <span v-else>登 录 中...</span>
               </button>
@@ -59,8 +59,8 @@
           </div>
         </el-form>
         <div class="other-btns">
-          <el-button link type="primary" style="color: #fff" @click="openApply()">专家申请</el-button>
-          <el-button link type="primary" style="color: #fff" @click="openCheck">专家评定进度查询</el-button>
+          <el-button link type="primary" style="color: #fff" @click="openApply()" v-preReClick>专家申请</el-button>
+          <el-button link type="primary" style="color: #fff" @click="openCheck" v-preReClick>专家评定进度查询</el-button>
         </div>
       </div>
     </el-col>
@@ -72,6 +72,7 @@
 <script setup>
 import {onMounted, ref, watch, defineAsyncComponent, nextTick, computed} from "vue"
 import { getCodeImg } from "@/api/login";
+import {getSettings} from "@/api/backManage/evaluate";
 import Cookies from "js-cookie";
 import { encrypt, decrypt } from "@/utils/jsencrypt";
 import useUserStore from '@/store/modules/user'
@@ -79,6 +80,7 @@
 import { Base64 } from 'js-base64'
 import ExpertForm from "../safetyReview/expertManage/applyRecords/components/expertForm";
 import usePermissionStore from '@/store/modules/permission'
+import {ElMessage} from "element-plus";
 const permissionStore = usePermissionStore()
 const sidebarRouters =  computed(() => permissionStore.sidebarRouters);
 const userStore = useUserStore()
@@ -104,6 +106,7 @@
 const regRef = ref(null)
 // 验证码开关
 const captchaEnabled = ref(true);
+const applyStatus = ref('1')
 // 注册开关
 const isRegister = ref(true);
 const redirect = ref(undefined);
@@ -122,12 +125,27 @@
 
 
 const expertFormRef = ref()
-const openApply = () => {
-  // expertFormRef.value.openApply(type, value)
-  const routePath = '/fillForm';
-  const resolvedRoute = router.resolve(routePath);
-  const fullPath = resolvedRoute.href
-  window.open(fullPath, '_blank');
+
+const getApplyStatus = async ()=>{
+  const res = await getSettings()
+  if(res.code == 200){
+    return res.data
+  }else{
+    ElMessage.warning(res.msg)
+    return '0'
+  }
+}
+
+const openApply = async () => {
+  const status = await getApplyStatus();
+  if(status == '1'){
+    const routePath = '/fillForm';
+    const resolvedRoute = router.resolve(routePath);
+    const fullPath = resolvedRoute.href
+    window.open(fullPath, '_blank');
+  }else{
+    ElMessage.warning('抱歉,专家申请暂未开启,请联系相关人员进行处理')
+  }
 }
 
 

--
Gitblit v1.9.2