Explorar o código

fix: 融合定制

bill hai 1 ano
pai
achega
c17d2f7f07

+ 1 - 1
index.html

@@ -4,7 +4,7 @@
 <head>
   <meta charset="UTF-8" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <title></title>
+  <link rel="icon" type="image/ico" href="/favicon.ico" id="app-icon" />
 </head>
 
 <body>

+ 9 - 2
src/app/criminal/constant.ts

@@ -1,13 +1,20 @@
 import { AppConstant } from "../";
 import banner from "@/assets/image/criminalBanner.png";
 import ico from "@/assets/image/criminal.ico";
+import linkIco from "@/assets/image/criminal-32.png";
+
 import { criminalDeptId } from "@/constant/appDeptId";
 
 export const appConstant: AppConstant = {
-  title: "刑事现场三维远程勘验平台",
-  desc: "Three-dimensional remote prospecting platform for criminal scenes",
+  title: "多尺度融合的现场3D数字化重建系统",
+  desc: "",
   ico,
+
   banner,
   name: "criminal",
+  loginComponent: () => import("./view/login/index.vue"),
   deptId: criminalDeptId,
 };
+
+const link = document.querySelector<HTMLLinkElement>("#app-icon")!;
+link.setAttribute("href", linkIco);

+ 293 - 0
src/app/criminal/view/login/index.vue

@@ -0,0 +1,293 @@
+<template>
+  <div class="login-layer">
+    <div class="content">
+      <div class="info">
+        <img src="@/assets/image/criminal.ico" alt="" />
+        <h1>{{ appConstant.title }}</h1>
+      </div>
+      <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 ? 'password' : 'text'"
+            @keydown.enter="submitClick"
+          >
+            <template v-slot:suffix>
+              <img
+                v-if="flag"
+                @click="flag = !flag"
+                style="width: 20px; margin: 10px 15px"
+                src="@/assets/image/pasword.png"
+                alt=""
+              />
+              <el-icon :size="20" @click="flag = !flag" class="icon-style" v-else>
+                <View />
+              </el-icon>
+            </template>
+          </el-input>
+        </el-form-item>
+
+        <el-form-item class="panel-form-item code-form-item">
+          <p class="err-info">{{ verification.code }}</p>
+          <el-input
+            v-model="form.code"
+            placeholder="验证码"
+            @keydown.enter="submitClick"
+            class="code-input"
+          >
+            <template v-slot:append>
+              <img :src="codeImg" class="code-img" @click="refer" />
+            </template>
+          </el-input>
+        </el-form-item>
+
+        <el-form-item class="panel-form-item" style="margin-top: 18px">
+          <el-button type="primary" class="fill" @click="submitClick">登录</el-button>
+        </el-form-item>
+
+        <!-- <div class="more">
+          <a @click="$router.push({ name: 'forget' })">忘记密码</a>
+        </div> -->
+      </el-form>
+    </div>
+
+    <p class="desc">
+      公安部鉴定中心 & 珠海市四维时代网络科技有限公司 |
+      公安部科技强警基础工作计划(2022JC13)
+    </p>
+  </div>
+</template>
+
+<script lang="ts" setup>
+import { reactive, watch, ref, computed } from "vue";
+import { openErrorMsg, baseURL, getCode } from "@/request";
+import { PHONE } from "@/constant/REG";
+import { guid, strToParams } from "@/util";
+import { RouteName, router } from "@/router";
+import { login } from "@/store/system";
+import { appConstant } from "@/app";
+import { user } from "@/store/user";
+
+// 是否显示明文密码
+const flag = ref(true);
+// 表单
+const form = reactive({
+  phone: localStorage.getItem("userName") || "",
+  psw: localStorage.getItem("password") || "",
+  code: "",
+  remember: import.meta.env.DEV || localStorage.getItem("remember") === "1",
+});
+const verification = reactive({ phone: "", psw: "", code: "" });
+// 验证
+watch(
+  form,
+  () => {
+    console.log("form", form);
+    if (!form.phone) {
+      verification.phone = "请输入手机号";
+    } else if (form.phone == "88888888888") {
+      verification.phone = "";
+    } else {
+      verification.phone = PHONE.REG.test(form.phone) ? "" : PHONE.tip;
+    }
+    if (!form.psw) {
+      verification.psw = "请输入密码";
+    } else {
+      verification.psw = "";
+    }
+    if (!form.code.trim()) {
+      verification.code = "请输入验证码";
+    } else {
+      verification.code = "";
+    }
+  },
+  { immediate: true }
+);
+
+// 图片验证码
+const imgKey = ref(guid());
+const refer = () => (imgKey.value = guid());
+const codeImg = computed(() => baseURL + getCode + "?key=" + imgKey.value);
+
+// 表单提交
+const submitClick = async () => {
+  if (verification.phone && verification.phone !== "88888888888") {
+    return openErrorMsg(verification.phone);
+  }
+  if (verification.psw) return openErrorMsg(verification.psw);
+  if (verification.code) return openErrorMsg(verification.code);
+
+  try {
+    await login({ phoneNum: form.phone, code: form.code, password: form.psw });
+
+    if (form.remember) {
+      localStorage.setItem("userName", form.phone);
+      localStorage.setItem("password", form.psw);
+      localStorage.setItem("remember", "1");
+    } else {
+      localStorage.setItem("userName", "");
+      localStorage.setItem("password", "");
+      localStorage.setItem("remember", "0");
+    }
+
+    const params = strToParams(window.location.search);
+    if ("redirect" in params) {
+      const url = new URL(unescape(params.redirect));
+      url.searchParams.delete("token");
+      url.searchParams.append("token", user.value.token);
+      window.location.replace(url);
+    } else {
+      router.replace({ name: RouteName.scene });
+    }
+  } catch (e) {
+    console.error(e);
+    return refer();
+  }
+};
+</script>
+
+<style lang="sass">
+@import "./style.scss"
+</style>
+
+<style lang="scss" scoped>
+.login-layer {
+  width: 100%;
+  height: 100%;
+  background: #eceff2 url("@/assets/image/criminalBanner.png") no-repeat center center;
+  background-size: cover;
+  position: inherit;
+
+  .desc {
+    position: absolute;
+    left: 50%;
+    transform: translateX(-50%);
+    bottom: 30px;
+    font-size: 14px;
+    color: #999999;
+    line-height: 30px;
+    letter-spacing: 1px;
+  }
+}
+.content {
+  display: flex;
+  justify-content: space-between;
+  align-items: flex-start;
+  height: 100%;
+}
+.info {
+  color: #fff;
+  margin-right: 143px;
+  padding-top: 40px;
+  padding-left: 44px;
+  flex: none;
+  text-align: left;
+  display: flex;
+  align-items: center;
+
+  img {
+    width: 40px;
+    height: 40px;
+    margin-right: 20px;
+  }
+  h1 {
+    font-size: 2.2rem;
+  }
+}
+
+.login {
+  width: 400px;
+  margin-right: 12.5%;
+  position: relative;
+  display: inline-block;
+  background: none;
+  box-shadow: none;
+  align-self: center;
+
+  h2 {
+    padding-left: 0;
+    padding-bottom: 0;
+    border-bottom: none;
+    margin-bottom: 2.14rem;
+    text-align: center;
+    font-weight: bold;
+    font-size: 36px;
+
+    span {
+      color: #646566;
+      font-size: 1.33rem;
+      margin-top: 0.71rem;
+      display: block;
+    }
+  }
+
+  .panel-form-item {
+    padding-left: 0;
+    padding-right: 0;
+    .icon-style {
+      margin-right: 14px;
+      font-size: 20px;
+      line-height: 50px;
+    }
+  }
+
+  .more a:first-child::after {
+    content: "";
+    position: absolute;
+    right: -5px;
+    width: 1px;
+    height: 8px;
+    background: #dcdee0;
+    top: 50%;
+    transform: translateY(-50%);
+  }
+}
+
+.code-img {
+  height: 40px;
+}
+</style>
+
+<style>
+.login-layer .el-input {
+  --el-input-bg-color: #f6f8fb;
+  /* var(--el-fill-color-blank) */
+}
+.login .code-form-item .el-input {
+  display: flex;
+}
+
+.login .code-form-item .el-input-group__append {
+  flex: none;
+  margin-left: 10px;
+  width: 95px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  padding: 0;
+}
+
+.login .code-form-item .el-input__inner {
+  flex: 1;
+}
+.login .code-form-item .el-input-group__append,
+.login .code-form-item .el-input__inner {
+  border-radius: 4px;
+}
+input[type="password"]::-ms-reveal {
+  display: none;
+}
+</style>

+ 75 - 0
src/app/criminal/view/login/style.scss

@@ -0,0 +1,75 @@
+.panel {
+  background   : rgba(255, 255, 255, 0.7);
+  box-shadow   : 0px 2px 20px 0px rgba(5, 38, 38, 0.15);
+  border-radius: 10px;
+  width        : 600px;
+  padding      : 30px 0 40px;
+  text-align   : initial;
+
+  h2 {
+    color         : #323233;
+    font-size     : 1.85rem;
+    margin-bottom : 2.14rem;
+    font-weight   : normal;
+    padding-left  : 60px;
+    padding-bottom: 20px;
+    border-bottom : 1px solid #E9E9E9;
+  }
+
+  .panel-form-item {
+    position      : relative;
+    padding-bottom: 2.14rem;
+    margin        : 0;
+    padding-left  : 90px;
+    padding-right : 90px;
+
+    &.remember {
+      padding: 0;
+    }
+
+    .err-info {
+      position   : absolute;
+      top        : 100%;
+      left       : 20px;
+      font-size  : 1rem;
+      line-height: 2.14rem;
+      color      : #FA5555;
+    }
+
+  }
+
+  .more {
+    text-align: center;
+
+    a {
+      color          : #323233;
+      line-height    : 21px;
+      font-size      : 16px;
+      margin         : 0 5px;
+      position       : relative;
+      text-decoration: none;
+      cursor         : pointer;
+    }
+  }
+}
+
+
+.panel-form-item .el-select {
+  width: 100%;
+}
+
+.panel-form-item .el-button,
+.panel-form-item .el-input__inner {
+  height   : 40px;
+  font-size: 1.14rem;
+}
+
+.panel-form-item .el-button {
+  line-height: 26px;
+  font-weight: bold;
+  font-size  : 16px;
+}
+
+.panel-form-item .el-form-item__label {
+  line-height: 40px;
+}

BIN=BIN
src/assets/image/criminal-32.png


BIN=BIN
src/assets/image/criminal.ico


BIN=BIN
src/assets/image/criminalBanner.png


+ 1 - 1
vite.config.ts

@@ -3,7 +3,7 @@ import vue from "@vitejs/plugin-vue";
 import { resolve } from "path";
 import ElementPlus from "unplugin-element-plus/vite";
 
-let app = "fire";
+let app = "criminal";
 if (process.argv.length > 3) {
   app = process.argv[process.argv.length - 1].trim();
 }