Explorar el Código

Merge branch 'dev' of http://192.168.0.115:3000/bill/4pc into dev

bill hace 1 año
padre
commit
1555a62b74

BIN
public/image/logo_sp.png


+ 1 - 1
src/request/index.ts

@@ -42,7 +42,7 @@ export const sendFetch = <T>(
         sendUrl + "?" + new URLSearchParams({ ...gParams, ...other.params });
     }
     if (other.noToken) {
-      delete gHeaders.token
+      delete gHeaders['relics-token']
     }
   }
   lifeHook.forEach(({ start }) => start());

+ 8 - 8
src/router.ts

@@ -1,5 +1,5 @@
 import { RouteRecordRaw, createRouter, createWebHashHistory } from "vue-router";
-import { UserStatus, logintAuth, userStatus, isSuper } from "./store/user";
+import { UserStatus, logintAuth, userStatus } from "./store/user";
 import { watch, watchEffect } from "vue";
 
 export const COORD_NAME = "map-coord";
@@ -218,13 +218,13 @@ router.beforeEach((to, _, next) => {
     return;
   }
   // organization
-  if (to.name === "organization") {
-    console.log('isSuper-organization', isSuper.value)
-    if (!isSuper.value) {
-      router.replace({ name: "scene" });
-      return
-    }
-  }
+  // if (to.name === "organization") {
+  //   console.log('isSuper-organization', isSuper.value)
+  //   if (!isSuper.value) {
+  //     router.replace({ name: "scene" });
+  //     return
+  //   }
+  // }
 
   if (to.name === "map") {
     router.replace({ name: COORD_NAME, params: to.params });

+ 2 - 2
src/store/user.ts

@@ -20,7 +20,7 @@ export const login = async (props: LoginProps) => {
     password: encodePwd(props.password),
   });
   user.value = data.user;
-  gHeaders.token = data.token;
+  gHeaders['relics-token'] = data.token;
   localStorage.setItem("token", data.token);
   await getUserInfo();
 };
@@ -46,7 +46,7 @@ export const logintAuth = getUserInfo;
 
 const token = localStorage.getItem("token");
 if (token) {
-  gHeaders.token = token;
+  gHeaders['relics-token'] = token;
 } else {
   userStatus.value = UserStatus.NOT_LOGIN;
 }

+ 91 - 21
src/view/layout/nav.vue

@@ -9,23 +9,43 @@
           @click="router.back()"
           v-if="showBack"
         />
-        <span v-if="!name">不可移动文物管理平台</span>
-      </span>
-      <el-dropdown placement="bottom-end" class="avatar" v-if="user">
-        <span class="avatar-left-label">
-          <span class="org"> {{ user.orgName }}</span>
-          <span class="name"> {{ user.nickName }}</span>
-          <el-avatar :src="user.head || avatarDefault" />
+
+        <span v-if="!name" class="logo-wrapper">
+          <img class="sp" src="/image/logo_sp.png" alt="logo" />
+          <span>不可移动文物管理平台</span>
         </span>
-        <template #dropdown>
-          <el-dropdown-menu>
-            <el-dropdown-item @click="passwordHandler"
-              >修改密码</el-dropdown-item
-            >
-            <el-dropdown-item @click="logoutHandler">退出登录</el-dropdown-item>
-          </el-dropdown-menu>
-        </template>
-      </el-dropdown>
+      </span>
+      <div class="right-panel" v-if="user && !['pano', 'map'].includes(name)">
+        <a
+          target="_blank"
+          class="helper"
+          href="https://showdoc.4dage.com/web/#/179?page_id=1007"
+        >
+          <el-icon :size="16">
+            <QuestionFilled />
+          </el-icon>
+          帮助
+        </a>
+        <el-dropdown placement="bottom-start" class="avatar" v-if="user">
+          <span class="avatar-left-label">
+            <el-avatar class="avatar" :src="user.head || avatarDefault" />
+          </span>
+
+          <template #dropdown>
+            <el-dropdown-menu>
+              <el-dropdown-item @click="passwordHandler"
+                >修改密码</el-dropdown-item
+              >
+              <el-dropdown-item @click="logoutHandler"
+                >退出登录</el-dropdown-item
+              >
+            </el-dropdown-menu>
+          </template>
+        </el-dropdown>
+
+        <span class="name" v-if="user"> {{ user.nickName }}</span>
+        <span class="org" v-if="user"> {{ user.orgName }}</span>
+      </div>
     </div>
     <div class="content">
       <ly-slide class="slide" v-if="user && !['pano', 'map'].includes(name)" />
@@ -41,7 +61,7 @@
 </template>
 
 <script setup lang="ts">
-import { Back } from "@element-plus/icons-vue";
+import { Back, QuestionFilled } from "@element-plus/icons-vue";
 import { router } from "@/router";
 import { computed, reactive } from "vue";
 import { user, logout } from "@/store/user";
@@ -117,19 +137,37 @@ const showBack = computed(() => {
   display: flex;
   align-items: center;
   justify-content: space-between;
+  min-height: 60px;
   padding: 4px 10px;
 
-  .avatar-left-label {
+  .right-panel {
     display: inline-flex;
     align-items: center;
-    outline: none;
-
+    padding-right: 14px;
+    .avatar {
+      margin-right: 16px;
+      width: 32px;
+      height: 32px;
+      &:hover {
+        cursor: pointer;
+      }
+    }
     .name,
     .org {
-      padding-right: 10px;
+      font-size: 14px;
+      color: #606266;
+    }
+    .name {
+      padding-right: 8px;
     }
   }
 
+  .avatar-left-label {
+    display: inline-flex;
+    align-items: center;
+    outline: none;
+  }
+
   &:not(.pano, .map) {
     border-bottom: 1px solid var(--border-color);
     flex: 0 0 auto;
@@ -197,4 +235,36 @@ const showBack = computed(() => {
     margin-left: 10px;
   }
 }
+.logo-wrapper {
+  display: inline-flex;
+  font-family: Microsoft YaHei, Microsoft YaHei;
+  font-weight: bold;
+  font-size: 20px;
+  color: #303133;
+  line-height: 23px;
+  letter-spacing: 2px;
+  text-align: left;
+  font-style: normal;
+  justify-content: center;
+  align-items: center;
+  .sp {
+    height: 23px;
+    width: auto;
+    margin-right: 16px;
+  }
+}
+.helper {
+  font-size: 14px;
+  color: #177ddc;
+  margin-right: 32px;
+  display: inline-flex;
+  align-items: center;
+  text-decoration: none;
+  i {
+    margin-right: 4px;
+  }
+  &:hover {
+    color: #0b467d;
+  }
+}
 </style>

+ 9 - 1
src/view/layout/slide/index.vue

@@ -3,6 +3,7 @@
     <el-menu
       :default-active="(router.currentRoute.value.name as string)"
       @select="(name: string) => router.push({ name })"
+      style="border-right: none"
     >
       <sub-menu
         v-for="route in routes"
@@ -26,7 +27,14 @@ const isSuper = computed(
   () =>
     user.value.roles.filter((item) => item.roleKey === "super_admin").length > 0
 );
-const normal_name = ["scene", "relics", "device", "users", "no-persession"];
+const normal_name = [
+  "scene",
+  "relics",
+  "device",
+  "organization",
+  "users",
+  "no-persession",
+];
 const super_names = [
   "scene",
   "relics",

+ 115 - 72
src/view/login.vue

@@ -1,5 +1,8 @@
 <template>
-  <div class="system-layer" :style="{ backgroundImage: `url('/image/Frame 208@2x.png')` }">
+  <div
+    class="system-layer"
+    :style="{ backgroundImage: `url('/image/Frame 208@2x.png')` }"
+  >
     <div class="l-content">
       <div class="login-layer">
         <div class="content">
@@ -27,63 +30,96 @@
               <img class="code" src="/image/pic_camera@2x.png" />
             </div>
           </div>
-          <!-- login right panel -->
-          <template v-if="currentStatus(0)">
-            <el-form class="panel login" :model="form" @submit.stop>
-              <h2>欢迎登录</h2>
-              <el-form-item class="panel-form-item">
-                <p class="err-info">{{ verification.phone }}</p>
-                <el-input :maxlength="11" v-model.trim="form.phone" placeholder="手机号"
-                  @keydown.enter="submitClick"></el-input>
-              </el-form-item>
-              <el-form-item class="panel-form-item">
-                <p class="err-info">{{ verification.psw }}</p>
-                <el-input v-model="form.psw" :maxlength="16" placeholder="密码" :type="flag ? 'text' : 'password'"
-                  @keydown.enter="submitClick">
-                  <template v-slot:suffix>
-                    <el-icon :size="20" @click="flag = !flag" class="icon-style">
-                      <View v-if="flag" />
-                      <Hide v-else />
-                    </el-icon>
-                  </template>
-                </el-input>
-              </el-form-item>
-
-              <el-form-item class="panel-form-item" style="user-select: none">
-                <DragVerify ref="verify" :class="{ passing: isPassing2 }" :isPassing="isPassing2"
-                  @passcallback="isPassing2 = true" handlerIcon="el-icon-d-arrow-right" background="#D9D9D9"
-                  textColor="#333333" successIcon="el-icon-circle-check" :text="isPassing2 ? '已通过验证' : '登录需要拖拽验证'"
-                  successText="验证通过" :width="400">
-                  <template v-slot:handlerIcon>
-                    <el-icon :size="20" style="
-                      width: 20px;
-                      display: inline-block;
-                      line-height: 20px;
-                      margin-top: 8px;
-                    ">
-                      <DArrowRight v-if="!isPassing2" />
-                      <SuccessFilled v-else />
-                    </el-icon>
-                  </template>
-                </DragVerify>
-              </el-form-item>
-
-              <el-form-item class="panel-form-item">
-                <el-button type="primary" class="fill submit" @click="submitClick">登录</el-button>
-              </el-form-item>
-
-              <div class="register">
-                <span @click="handleForgetPassword"> 忘记密码</span> |
-                <span @click="handleRegister"> 单位注册</span>
-              </div>
-            </el-form>
-          </template>
-          <template v-if="currentStatus(1)">
-            <register @done="goTologin"></register>
-          </template>
-          <template v-if="currentStatus(2)">
-            <reset @done="goTologin"></reset>
-          </template>
+          <div class="right-panel">
+            <!-- login right panel -->
+            <template v-if="currentStatus(0)">
+              <el-form class="panel login" :model="form" @submit.stop>
+                <h2>欢迎登录</h2>
+                <el-form-item class="panel-form-item">
+                  <p class="err-info">{{ verification.phone }}</p>
+                  <el-input
+                    :maxlength="11"
+                    v-model.trim="form.phone"
+                    placeholder="手机号"
+                    @keydown.enter="submitClick"
+                  ></el-input>
+                </el-form-item>
+                <el-form-item class="panel-form-item">
+                  <p class="err-info">{{ verification.psw }}</p>
+                  <el-input
+                    v-model="form.psw"
+                    :maxlength="16"
+                    placeholder="密码"
+                    :type="flag ? 'text' : 'password'"
+                    @keydown.enter="submitClick"
+                  >
+                    <template v-slot:suffix>
+                      <el-icon
+                        :size="20"
+                        @click="flag = !flag"
+                        class="icon-style"
+                      >
+                        <View v-if="flag" />
+                        <Hide v-else />
+                      </el-icon>
+                    </template>
+                  </el-input>
+                </el-form-item>
+
+                <el-form-item class="panel-form-item" style="user-select: none">
+                  <DragVerify
+                    ref="verify"
+                    :class="{ passing: isPassing2 }"
+                    :isPassing="isPassing2"
+                    @passcallback="isPassing2 = true"
+                    handlerIcon="el-icon-d-arrow-right"
+                    background="#D9D9D9"
+                    textColor="#333333"
+                    successIcon="el-icon-circle-check"
+                    :text="isPassing2 ? '已通过验证' : '登录需要拖拽验证'"
+                    successText="验证通过"
+                    :width="400"
+                  >
+                    <template v-slot:handlerIcon>
+                      <el-icon
+                        :size="20"
+                        style="
+                          width: 20px;
+                          display: inline-block;
+                          line-height: 20px;
+                          margin-top: 8px;
+                        "
+                      >
+                        <DArrowRight v-if="!isPassing2" />
+                        <SuccessFilled v-else />
+                      </el-icon>
+                    </template>
+                  </DragVerify>
+                </el-form-item>
+
+                <el-form-item class="panel-form-item">
+                  <el-button
+                    type="primary"
+                    class="fill submit"
+                    @click="submitClick"
+                    >登录</el-button
+                  >
+                </el-form-item>
+
+                <div class="register">
+                  <span @click="handleForgetPassword"> 忘记密码</span> |
+                  <span @click="handleRegister"> 单位注册</span>
+                </div>
+              </el-form>
+            </template>
+
+            <template v-if="currentStatus(1)">
+              <register @done="goTologin"></register>
+            </template>
+            <template v-if="currentStatus(2)">
+              <reset @done="goTologin"></reset>
+            </template>
+          </div>
         </div>
       </div>
     </div>
@@ -92,14 +128,19 @@
 
 <script lang="ts" setup>
 import { reactive, watch, ref, computed } from "vue";
-import { View, Hide, DArrowRight, SuccessFilled } from "@element-plus/icons-vue";
+import {
+  View,
+  Hide,
+  DArrowRight,
+  SuccessFilled,
+} from "@element-plus/icons-vue";
 import { login } from "@/store/user";
 import { ElMessage } from "element-plus";
 import { router } from "@/router";
 import qrCode from "qrcode";
 import DragVerify from "@/components/drag-verify.vue";
-import register from '@/view/register/register.vue'
-import reset from '@/view/register/reset.vue'
+import register from "@/view/register/register.vue";
+import reset from "@/view/register/reset.vue";
 const PHONE = {
   REG: /^1(3|4|5|6|7|8|9)\d{9}$/,
   // REG: /^((13[0-9]|14[01456879]|15[0-3,5-9]|16[2567]|17[0-8]|18[0-9]|19[0-3,5-9])\d{8})|(8){11}$/,
@@ -111,7 +152,9 @@ const verify = ref<any>();
 const isPassing2 = ref(false);
 
 const registerStatus = ref(0);
-const currentStatus = computed(() => (status: number) => status === registerStatus.value)
+const currentStatus = computed(
+  () => (status: number) => status === registerStatus.value
+);
 // 表单
 const form = reactive({
   phone: import.meta.env.DEV ? "13800000001" : "",
@@ -182,18 +225,16 @@ const submitClick = async () => {
 
 // 忘记密码
 const handleForgetPassword = () => {
-  registerStatus.value = 2
-}
+  registerStatus.value = 2;
+};
 // 注册
 const handleRegister = () => {
-  registerStatus.value = 1
-}
+  registerStatus.value = 1;
+};
 // 业务回到login
 const goTologin = () => {
-  registerStatus.value = 0
-}
-
-
+  registerStatus.value = 0;
+};
 </script>
 
 <style lang="scss" scoped>
@@ -210,6 +251,7 @@ const goTologin = () => {
   box-sizing: border-box;
   max-width: 1620px;
   height: 100vh;
+  margin: 0 auto;
   padding: 0 50px 0 50px;
 }
 
@@ -274,7 +316,7 @@ const goTologin = () => {
         margin-top: 13px;
         position: relative;
 
-        >img {
+        > img {
           width: 100%;
         }
 
@@ -513,7 +555,7 @@ input[type="password"]::-ms-reveal {
 .panel-form-item .el-button,
 .panel-form-item .el-input__inner {
   height: 40px;
-  font-size: 1.14rem;
+  font-size: 16px;
 }
 
 .panel-form-item .el-button {
@@ -545,4 +587,5 @@ input[type="password"]::-ms-reveal {
 .register span {
   cursor: pointer;
 }
+
 </style>

+ 1 - 1
src/view/map/coord.vue

@@ -151,7 +151,7 @@ import {
   Delete,
   Grid,
   Download,
-  DeleteLocation,
+  // DeleteLocation,
   Edit,
 } from "@element-plus/icons-vue";
 import { computed, onBeforeUnmount, ref, watchEffect } from "vue";

+ 14 - 2
src/view/organization.vue

@@ -30,7 +30,9 @@
             >
               重置
             </el-button>
-            <el-button type="primary" @click="addHandler"> 新增单位 </el-button>
+            <el-button v-if="!isNotSuper" type="primary" @click="addHandler">
+              新增单位
+            </el-button>
           </el-form-item>
         </el-form>
       </div>
@@ -70,6 +72,7 @@
             <el-button
               link
               type="danger"
+              v-if="!isNotSuper" 
               @click="delOrganization(row)"
               size="small"
             >
@@ -94,7 +97,7 @@
 </template>
 
 <script lang="ts" setup>
-import { onActivated, ref, watch } from "vue";
+import { onActivated, ref, watch, computed } from "vue";
 import {
   getOrgListFetch,
   addOrgFetch,
@@ -106,6 +109,7 @@ import type { OrganizationType } from "@/request/organization";
 import { OrganizationTypeDesc } from "@/store/organization";
 import { organizationAdd, organizationEdit } from "./quisk";
 import { debounce } from "@/util";
+import { user } from "@/store/user";
 import { ElMessageBox } from "element-plus";
 import { openLoading, closeLoading } from "@/helper/loading";
 
@@ -120,6 +124,14 @@ const pageProps = ref({ ...initProps });
 const total = ref<number>(0);
 const relicsArray = ref<any[]>([]);
 
+const isNotSuper = computed(
+  () =>
+    user.value.roles.filter(
+      (item) =>
+        item.roleKey === "system_admin" || item.roleKey === "system_common"
+    ).length > 0
+);
+
 // 1省级 2市级 3县级 4服务商
 
 const refresh = debounce(async () => {

+ 6 - 3
src/view/register/register.vue

@@ -3,7 +3,7 @@
     <el-form class="panel" :model="form" :rules="rules" ref="baseFormRef">
       <h2>单位注册</h2>
       <span class="desc">
-        此功能仅用于注册单位及单位管理员,
+        此功能仅用于注册单位及单位管理员,<br/>
         单位内其它用户可由单位管理员登录后创建。
       </span>
       <el-form-item
@@ -324,7 +324,7 @@ const toLogin = () => {
 
     .el-select__wrapper {
       height: 100%;
-      font-size: 1.14rem;
+      font-size: 16px;
     }
   }
 
@@ -341,6 +341,9 @@ const toLogin = () => {
     top: 5px;
     height: 32px;
     line-height: 32px;
+    &:hover {
+      color: #93795d;
+    }
   }
 
   .fill {
@@ -350,7 +353,7 @@ const toLogin = () => {
 </style>
 <style>
 .register-select-option {
-  font-size: 1.14rem;
+  font-size: 16px;
   min-height: 50px;
   line-height: 50px;
   /* padding: 5px 0; */

+ 256 - 205
src/view/register/reset.vue

@@ -1,59 +1,106 @@
 <template>
-    <div class="register">
-        <el-form class="panel" :model="form" :rules="rules" ref="baseFormRef">
-            <h2>重置密码</h2>
-            <el-form-item class="panel-form-item" prop="userName" label="账号" required>
-                <el-input :maxlength="11" v-model.trim="form.userName" placeholder="请输入手机号码">
-                </el-input>
-            </el-form-item>
-
-            <el-form-item class="panel-form-item msgcode" prop="msgAuthCode" label="验证码" required>
-                <el-input :maxlength="8" v-model.trim="form.msgAuthCode" placeholder="输入验证码">
-                </el-input>
-                <el-button class="getMsgAuthCode" :loading="checkCodeBtn.loading" :disabled="checkCodeBtn.disabled"
-                    style="margin-left: 10px" @click="getCheckCode"> {{ checkCodeBtn.text }}</el-button>
-            </el-form-item>
-
-            <el-form-item class="panel-form-item" label="密码" prop="password" required>
-                <el-input autocomplete="off" readonly onfocus="this.removeAttribute('readonly');"
-                v-model.trim="form.password" :type="addPassFlag ? 'text' : 'password'" :maxlength="20"
-                    placeholder="请输入8-16位数字、字母大小写组合">
-                    <template #suffix>
-                        <span @click="addPassFlag = !addPassFlag" style="cursor: pointer;">
-                            <el-icon v-if="addPassFlag">
-                                <View />
-                            </el-icon>
-                            <el-icon v-else>
-                                <Hide />
-                            </el-icon>
-                        </span>
-                    </template>
-                </el-input>
+  <div class="register">
+    <el-form class="panel" :model="form" :rules="rules" ref="baseFormRef">
+      <h2>重置密码</h2>
+      <el-form-item
+        class="panel-form-item"
+        prop="userName"
+        label="账号"
+        required
+      >
+        <el-input
+          :maxlength="11"
+          v-model.trim="form.userName"
+          placeholder="请输入手机号码"
+        >
+        </el-input>
+      </el-form-item>
 
-            </el-form-item>
+      <el-form-item
+        class="panel-form-item msgcode"
+        prop="msgAuthCode"
+        label="验证码"
+        required
+      >
+        <el-input
+          :maxlength="8"
+          v-model.trim="form.msgAuthCode"
+          placeholder="输入验证码"
+        >
+        </el-input>
+        <el-button
+          class="getMsgAuthCode"
+          :loading="checkCodeBtn.loading"
+          :disabled="checkCodeBtn.disabled"
+          style="margin-left: 10px"
+          @click="getCheckCode"
+        >
+          {{ checkCodeBtn.text }}</el-button
+        >
+      </el-form-item>
 
-            <el-form-item class="panel-form-item" label="密码确认" prop="confirmPwd" required>
-                <el-input autocomplete="off" readonly onfocus="this.removeAttribute('readonly');"
-                v-model.trim="form.confirmPwd" :type="addPassFlag1 ? 'text' : 'password'" :maxlength="20"
-                    placeholder="输入再次输入密码">
-                    <template #suffix>
-                        <span @click="addPassFlag1 = !addPassFlag1" style="cursor: pointer;">
-                            <el-icon v-if="addPassFlag1">
-                                <View />
-                            </el-icon>
-                            <el-icon v-else>
-                                <Hide />
-                            </el-icon>
-                        </span>
-                    </template>
-                </el-input>
+      <el-form-item
+        class="panel-form-item"
+        label="密码"
+        prop="password"
+        required
+      >
+        <el-input
+          autocomplete="off"
+          readonly
+          onfocus="this.removeAttribute('readonly');"
+          v-model.trim="form.password"
+          :type="addPassFlag ? 'text' : 'password'"
+          :maxlength="20"
+          placeholder="请输入8-16位数字、字母大小写组合"
+        >
+          <template #suffix>
+            <span @click="addPassFlag = !addPassFlag" style="cursor: pointer">
+              <el-icon v-if="addPassFlag">
+                <View />
+              </el-icon>
+              <el-icon v-else>
+                <Hide />
+              </el-icon>
+            </span>
+          </template>
+        </el-input>
+      </el-form-item>
 
-            </el-form-item>
+      <el-form-item
+        class="panel-form-item"
+        label="密码确认"
+        prop="confirmPwd"
+        required
+      >
+        <el-input
+          autocomplete="off"
+          readonly
+          onfocus="this.removeAttribute('readonly');"
+          v-model.trim="form.confirmPwd"
+          :type="addPassFlag1 ? 'text' : 'password'"
+          :maxlength="20"
+          placeholder="输入再次输入密码"
+        >
+          <template #suffix>
+            <span @click="addPassFlag1 = !addPassFlag1" style="cursor: pointer">
+              <el-icon v-if="addPassFlag1">
+                <View />
+              </el-icon>
+              <el-icon v-else>
+                <Hide />
+              </el-icon>
+            </span>
+          </template>
+        </el-input>
+      </el-form-item>
 
-            <el-form-item class="panel-form-item">
-                <el-button type="primary" class="fill submit" @click="submitClick">确定</el-button>
-            </el-form-item>
-            <el-form-item class="panel-form-item">
+      <el-form-item class="panel-form-item">
+        <el-button type="primary" class="fill submit" @click="submitClick"
+          >确定</el-button
+        >
+      </el-form-item>
+      <el-form-item class="panel-form-item">
         <el-button
           text
           plain
@@ -63,132 +110,135 @@
           >立即登录</el-button
         >
       </el-form-item>
-
-        </el-form>
-    </div>
+    </el-form>
+  </div>
 </template>
 <script lang="ts" setup>
-import { reactive, ref, unref } from 'vue'
-import {
-    changePassword,
-} from "@/request";
+import { reactive, ref, unref } from "vue";
+import { changePassword } from "@/request";
 import { ElMessage, type FormInstance, type FormRules } from "element-plus";
 // import { OrganizationTypeDesc } from '@/store/organization';
-import { View, Hide } from '@element-plus/icons-vue';
+import { View, Hide } from "@element-plus/icons-vue";
 import { globalPasswordRex } from "@/util/regex";
 // import { registerOrganization } from '@/request/organization';
 // import { encodePwd } from "@/util";
 
-import {
-    getMsgAuthCode,
-} from "@/request";
+import { getMsgAuthCode } from "@/request";
 
-const emit =defineEmits(['done'])
+const emit = defineEmits(["done"]);
 
 const baseFormRef = ref<FormInstance>();
-const addPassFlag = ref(false) //图标显示标识
-const addPassFlag1 = ref(false) //图标显示标识
+const addPassFlag = ref(false); //图标显示标识
+const addPassFlag1 = ref(false); //图标显示标识
 
 let checkCodeBtn = reactive<any>({
-    text: '获取验证码',
-    loading: false,
-    disabled: false,
-    duration: 60,
-    timer: null
-})
+  text: "获取验证码",
+  loading: false,
+  disabled: false,
+  duration: 60,
+  timer: null,
+});
 
 const equalToPassword = (_, value: any, callback: any) => {
-    if (form.password !== value) {
-        callback(new Error("两次输入的密码不一致"));
-    } else {
-        callback();
-    }
+  if (form.password !== value) {
+    callback(new Error("两次输入的密码不一致"));
+  } else {
+    callback();
+  }
 };
 const rules = reactive<FormRules>({
-    orgName: [
-        { required: true, message: "请选择单位名称", trigger: "select" },
-    ],
-    msgAuthCode: [
-        { required: true, message: "请输入验证码", trigger: "change" },
-    ],
-    contact: [
-        { required: true, message: "请输入姓名", trigger: "blur" },
-    ],
-    userName: [
-        { required: true, message: "请输入手机号码", trigger: "blur" },
-        { required: true, pattern: /^1[3456789]\d{9}$/, message: "请输入手机号码", trigger: "blur" },
-    ],
-    password: [
-        { required: true, pattern:globalPasswordRex, message: "请输入8-16位数字、字母大小写组合", trigger: "blur" },
-        { required: true, min: 8, message: '密码太短!', trigger: "blur" },
-    ],
-    confirmPwd: [
-        { required: true, pattern: globalPasswordRex, message: "请输入8-16位数字、字母大小写组合", trigger: "blur" },
-        { required: true, min: 8, message: '密码太短!', trigger: "blur" },
-        { required: true, validator: equalToPassword, trigger: "blur" }
-    ],
-},)
-
+  orgName: [{ required: true, message: "请选择单位名称", trigger: "select" }],
+  msgAuthCode: [{ required: true, message: "请输入验证码", trigger: "change" }],
+  contact: [{ required: true, message: "请输入姓名", trigger: "blur" }],
+  userName: [
+    { required: true, message: "请输入手机号码", trigger: "blur" },
+    {
+      required: true,
+      pattern: /^1[3456789]\d{9}$/,
+      message: "请输入手机号码",
+      trigger: "blur",
+    },
+  ],
+  password: [
+    {
+      required: true,
+      pattern: globalPasswordRex,
+      message: "请输入8-16位数字、字母大小写组合",
+      trigger: "blur",
+    },
+    { required: true, min: 8, message: "密码太短!", trigger: "blur" },
+  ],
+  confirmPwd: [
+    {
+      required: true,
+      pattern: globalPasswordRex,
+      message: "请输入8-16位数字、字母大小写组合",
+      trigger: "blur",
+    },
+    { required: true, min: 8, message: "密码太短!", trigger: "blur" },
+    { required: true, validator: equalToPassword, trigger: "blur" },
+  ],
+});
 
 const form = reactive({
-    orgName: "",
-    type: "",
-    userName: "",
-    // userName: "",
-    password: "",
-    contact: "",
-    confirmPwd: "",
-    msgAuthCode: "",
+  orgName: "",
+  type: "",
+  userName: "",
+  // userName: "",
+  password: "",
+  contact: "",
+  confirmPwd: "",
+  msgAuthCode: "",
 });
 
 const getCheckCode = async () => {
-    // 倒计时期间按钮不能单击
-    await unref(baseFormRef)?.validateField('userName');
+  // 倒计时期间按钮不能单击
+  await unref(baseFormRef)?.validateField("userName");
 
-    const phoneNum = form.userName
-    console.log('getMsgCode', phoneNum)
-    const res = await getMsgAuthCode('+86', phoneNum)
-    if (res.success) {
-        ElMessage.success(res.data);
-    }
-    if (checkCodeBtn.duration == 60) {
-        checkCodeBtn.disabled = true
+  const phoneNum = form.userName;
+  console.log("getMsgCode", phoneNum);
+  const res = await getMsgAuthCode("+86", phoneNum);
+  if (res.success) {
+    ElMessage.success(res.data);
+  }
+  if (checkCodeBtn.duration == 60) {
+    checkCodeBtn.disabled = true;
+  }
+  // 清除掉定时器
+  checkCodeBtn.timer && clearInterval(checkCodeBtn.timer);
+  // 开启定时器
+  checkCodeBtn.timer = setInterval(() => {
+    const tmp = checkCodeBtn.duration--;
+    checkCodeBtn.text = `${tmp}秒`;
+    if (tmp <= 0) {
+      // 清除掉定时器
+      clearInterval(checkCodeBtn.timer);
+      checkCodeBtn.duration = 60;
+      checkCodeBtn.text = "重新获取";
+      // 设置按钮可以单击
+      checkCodeBtn.disabled = false;
     }
-    // 清除掉定时器
-    checkCodeBtn.timer && clearInterval(checkCodeBtn.timer)
-    // 开启定时器
-    checkCodeBtn.timer = setInterval(() => {
-        const tmp = checkCodeBtn.duration--
-        checkCodeBtn.text = `${tmp}秒`
-        if (tmp <= 0) {
-            // 清除掉定时器
-            clearInterval(checkCodeBtn.timer)
-            checkCodeBtn.duration = 60
-            checkCodeBtn.text = '重新获取'
-            // 设置按钮可以单击
-            checkCodeBtn.disabled = false
-        }
-        console.info(checkCodeBtn.duration)
-    }, 1000)
-}
+    console.info(checkCodeBtn.duration);
+  }, 1000);
+};
 
 const submitClick = async () => {
-    if (unref(baseFormRef)) {
-        const res = await unref(baseFormRef)?.validate();
-        if (res) {
-            console.log('form', form)
-            const result = await changePassword({
-                ...form,
-                phoneNum: form.userName
-            });
-            console.log('result', result)
-            ElMessage.success('重置密码成功!');
-            emit('done')
-        }
-    } else {
-        throw "";
+  if (unref(baseFormRef)) {
+    const res = await unref(baseFormRef)?.validate();
+    if (res) {
+      console.log("form", form);
+      const result = await changePassword({
+        ...form,
+        phoneNum: form.userName,
+      });
+      console.log("result", result);
+      ElMessage.success("重置密码成功!");
+      emit("done");
     }
-}
+  } else {
+    throw "";
+  }
+};
 const toLogin = () => {
   emit("done");
 };
@@ -196,76 +246,77 @@ const toLogin = () => {
 
 <style lang="scss" scoped>
 .register {
-    padding: 10px 0;
-
-    .panel {
-        width: 430px;
-    }
+  padding: 10px 0;
 
-    .panel-form-item {
-        padding-left: 0;
-        padding-right: 0;
-    }
+  .panel {
+    width: 430px;
+  }
 
-    h2 {
-        padding-left: 0;
-        margin-bottom: 0;
-    }
+  .panel-form-item {
+    padding-left: 0;
+    padding-right: 0;
+  }
 
-    .desc {
-        color: #93795D;
-        display: block;
-        margin-bottom: 20px;
-    }
+  h2 {
+    padding-left: 0;
+    margin-bottom: 0;
+  }
 
-    :deep(.panel-form-item .el-form-item__label) {
-        line-height: 40px;
-        font-size: 16px;
-        min-width: 90px;
-    }
+  .desc {
+    color: #93795d;
+    display: block;
+    margin-bottom: 20px;
+  }
 
-    :deep(.el-form-item__error) {
-        font-size: 14px;
-    }
+  :deep(.panel-form-item .el-form-item__label) {
+    line-height: 40px;
+    font-size: 16px;
+    min-width: 90px;
+  }
 
-    :deep(.el-select) {
-        width: 100%;
-        height: 42px;
-        line-height: 42px;
+  :deep(.el-form-item__error) {
+    font-size: 14px;
+  }
 
-        .el-select__wrapper {
-            height: 100%;
-            font-size: 1.14rem;
-        }
-    }
+  :deep(.el-select) {
+    width: 100%;
+    height: 42px;
+    line-height: 42px;
 
-    .msgcode {
-        position: relative;
+    .el-select__wrapper {
+      height: 100%;
+      font-size: 16px;
     }
+  }
 
-    .getMsgAuthCode {
-        border: 1px solid #93795D;
-        background: rgba(147, 121, 93, 0.05);
-        font-size: 14px;
-        position: absolute;
-        right: 5px;
-        top: 5px;
-        height: 32px;
-        line-height: 32px;
-    }
+  .msgcode {
+    position: relative;
+  }
 
-    .fill {
-        width: 100%;
+  .getMsgAuthCode {
+    border: 1px solid #93795d;
+    background: rgba(147, 121, 93, 0.05);
+    font-size: 14px;
+    position: absolute;
+    right: 5px;
+    top: 5px;
+    height: 32px;
+    line-height: 32px;
+    &:hover {
+      color: #93795d;
     }
+  }
 
-
+  .fill {
+    width: 100%;
+  }
 }
 </style>
 <style>
 .register-select-option {
-    font-size: 1.14rem;
-    min-height: 50px;
-    line-height: 50px;
-    /* padding: 5px 0; */
+  font-size: 16px;
+  min-height: 50px;
+  line-height: 50px;
+  /* padding: 5px 0; */
 }
-</style>
+</style>

+ 3 - 1
src/view/relics-edit.vue

@@ -37,9 +37,11 @@
     <el-form-item label="文物地址:">
       <el-input
         v-model="data.address"
-        style="width: 100%"
+        style="width: 100%;padding-bottom: 25px;"
         :maxlength="500"
         show-word-limit
+         :autosize="{ minRows: 3, maxRows: 6 }"
+      
         type="textarea"
         placeholder="请输入"
       />