tangning vor 4 Monaten
Ursprung
Commit
52f42192cb

+ 9 - 0
.env.cjzfire

@@ -0,0 +1,9 @@
+VITE_APP_APP="cjzfire"
+VITE_SEVER_URL="https://test-mix3d.4dkankan.com"
+VITE_DEVCODE_URL="https://test-mix3d.4dkankan.com/code"
+VITE_SWKK_URL="https://test.4dkankan.com"
+VITE_SERVICE_URL="https://test.4dkankan.com"
+VITE_SWSS_URL="https://uat-laser.4dkankan.com/uat"
+VITE_LASER_URL="https://uat-laser.4dkankan.com"
+VITE_FDKK_URL="https://uat-laser.4dkankan.com/uat"
+VITE_DOC_URL="https://192.168.0.25/docs/#/product/huodiao/README"

+ 3 - 0
package.json

@@ -5,11 +5,14 @@
   "type": "module",
   "scripts": {
     "dev": "vite --mode=fire",
+    "devxm": "vite --mode=xmfire",
+    "devcjz": "vite --mode=cjzfire",
     "build": "npm run build-quisk",
     "build-quisk": "vite build ./ --mode fire && vite build ./ --mode criminal && vite build ./ --mode xmfire && vite build ./ --mode ga",
     "build-fire": "vite build ./ --mode=fire",
     "build-criminal": "vite build ./ --mode=criminal",
     "build-xmfire": "vite build ./ --mode=xmfire",
+    "build-cjzfire": "vite build ./ --mode=cjzfire",
     "build-ga": "vite build ./ --mode=ga",
     "build-all": "npm-run-all --parallel build-fire build-criminal build-xmfire build-ga",
     "preview": "vite preview"

+ 14 - 0
src/app/cjzfire/constant.ts

@@ -0,0 +1,14 @@
+import { AppConstant } from "..";
+import banner from "@/app/cjzfire/images/bg@2x.jpg";
+import ico from "@/assets/image/jmlogo.png";
+import { cjzcriminalDeptId } from "@/constant/appDeptId";
+
+export const appConstant: AppConstant = {
+  title: "火灾调查三维远程勘验平台",
+  desc: "Three-dimensional remote prospecting platform for fire scenes",
+  ico,
+  name: "fire",
+  banner,
+  loginComponent: () => import("./view/login/index.vue"),
+  deptId: cjzcriminalDeptId,
+};

BIN
src/app/cjzfire/images/banner@2x.png


BIN
src/app/cjzfire/images/bg@2x.jpg


+ 35 - 0
src/app/cjzfire/routeConfig.ts

@@ -0,0 +1,35 @@
+import { RouteName } from "@/router/routeName";
+import { Routes } from "@/router/config";
+
+export const FireRouteName = {
+  ...RouteName,
+  dispatch: "dispatch",
+  teaching: "teaching",
+} as const;
+
+export const menuRouteNames = [
+  FireRouteName.statistics,
+  FireRouteName.downloadLog,
+  FireRouteName.vrmodel,
+  FireRouteName.camera,
+  FireRouteName.dispatch,
+  FireRouteName.teaching,
+  FireRouteName.organization,
+  FireRouteName.role,
+  FireRouteName.user,
+];
+
+export const routes: Routes = [
+  {
+    name: FireRouteName.dispatch,
+    path: "dispatch",
+    component: () => import("../fire/view/dispatch/index.vue"),
+    meta: { title: "火调管理", icon: "iconfire_management" },
+  },
+  {
+    name: FireRouteName.teaching,
+    path: "teaching",
+    component: () => import("../fire/view/dispatch/index.vue"),
+    meta: { title: "教学平台", icon: "iconfire_study" },
+  },
+];

+ 7 - 0
src/app/cjzfire/useStyle.scss

@@ -0,0 +1,7 @@
+@forward 'element-plus/theme-chalk/src/common/var.scss' with ($colors: ('primary': ('base': #D8000A, )),
+  $common-component-size: ('default': 40px));
+
+.delBtn {
+  color: #D8000A;
+  // color: rgb(250, 85, 85);
+}

+ 413 - 0
src/app/cjzfire/view/login/index.vue

@@ -0,0 +1,413 @@
+<template>
+  <div class="system-layer" :style="{ backgroundImage: `url(${appConstant.banner})` }">
+    <div class="content">
+      <div class="login-layer">
+        <div class="content" style="justify-content: space-between;width: 1200px;align-items: center;">
+          <div class="info" >
+            <img style="height: 64px;width: 64px" src="@/assets/image/logo_big.png" alt="">
+            <div class="left-text">
+              消防火调三维远程勘验平台
+              <p>昌吉州消防支队</p>
+            </div>
+          </div>
+          <el-form class="panel login" :model="form" @submit.stop>
+            <!-- <img :src="appConstant.ico" /> {{ appConstant.title }}-->
+            <div class="h2">欢迎登录</div>
+            <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: 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">
+              <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>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script lang="ts" setup>
+import { reactive, watch, ref, computed, onUnmounted } from "vue";
+import { openErrorMsg, baseURL, getCode } from "@/request";
+import { PHONE } from "@/constant/REG";
+import { guid, strToParams, dateFormat } from "@/util";
+import { RouteName, router } from "@/router";
+import { login } from "@/store/system";
+import { appConstant } from "@/app";
+import { user } from "@/store/user";
+
+const currentDate = ref(new Date());
+const interval = setInterval(() => {
+  currentDate.value = new Date();
+});
+onUnmounted(() => clearInterval(interval));
+
+// 是否显示明文密码
+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, deptId: 'DEP000011734134901809483776' });
+
+    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="scss" scoped>
+.system-layer {
+  width: 100%;
+  min-height: 100%;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: center;
+  background: no-repeat left bottom;
+  background-size: cover;
+}
+
+.content {
+  display: flex;
+  justify-content: space-between;
+  align-items: flex-start;
+}
+
+.login-layer {
+  text-align: right;
+}
+.content {
+  display: flex;
+  justify-content: center;
+  align-items: flex-start;
+}
+.info {
+  color: #fff;
+  flex: none;
+  text-align: left;
+  display: flex;
+  position: relative;
+  height: 100%;
+  pointer-events: none;
+  span {
+    position: absolute;
+    bottom: 20px;
+    left: 50%;
+    transform: translateX(-50%);
+    font-size: 18px;
+    color: #fff;
+  }
+  .left-text{
+    font-weight: bold;
+    font-size: 40px;
+    color: #FFFFFF;
+    line-height: 47px;
+    text-shadow: 0px 0px 6px rgba(0,0,0,0.4);
+    text-align: left;
+    margin-left: 22px;
+    font-size: 2.8rem;
+    line-height: 3.7rem;
+    p{
+      font-weight: 400;
+      font-size: 30px;
+      color: #FFFFFF;
+      line-height: 35px;
+      text-shadow: 0px 0px 6px rgba(0,0,0,0.4);
+      margin-top: 0.7rem;
+      text-align: left;
+    font-size: 2rem;
+    line-height: 2.2rem;
+    }
+  }
+  img {
+    height: 562px;
+  }
+  h1 {
+    font-size: 2.8rem;
+    line-height: 3.7rem;
+    margin-bottom: 0.7rem;
+  }
+  p {
+    font-size: 2rem;
+    line-height: 2.2rem;
+  }
+}
+
+.top-text {
+  margin-bottom: 50px;
+  pointer-events: none;
+  height: 153px;
+  min-width: 1200px;
+  img {
+    position: absolute;
+    right: 0;
+  }
+}
+.login {
+  width: 380px;
+  padding: 40px 40px 30px;
+  position: relative;
+  display: inline-block;
+
+  .h2 {
+    font-weight: bold;
+    font-size: 30px;
+    color: #323233;
+    line-height: 35px;
+    text-align: left;
+    font-style: normal;
+    margin-bottom: 38px;
+    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 {
+  width: 100%;
+  height: 100%;
+  // object-fit: cover;
+}
+</style>
+
+<style lang="scss" scoped>
+.system-layer .panel {
+  background: rgba(255, 255, 255, 0.7);
+  box-shadow: 0px 2px 20px 0px rgba(5, 38, 38, 0.15);
+  width: 380px;
+  padding: 40px 40px 30px;
+  text-align: initial;
+  text-align: center;
+  border-radius: 0;
+
+  img {
+    width: 100px;
+  }
+
+  h2 {
+    // font-weight: bold;
+    // font-size: 30px;
+    // color: #323233;
+    // line-height: 35px;
+    // text-align: left;
+    // font-style: normal;
+    // border: none;
+    // margin-bottom: 23px;
+  }
+
+  .panel-form-item {
+    position: relative;
+    padding-bottom: 2.14rem;
+    margin: 0;
+    padding-left: 0;
+    padding-right: 0;
+
+    &.remember {
+      padding: 0;
+    }
+
+    .err-info {
+      position: absolute;
+      top: 100%;
+      left: 0;
+      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: 50px;
+  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: 50px;
+}
+.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>

+ 13 - 2
src/app/index.ts

@@ -18,6 +18,13 @@ import {
   menuRouteNames as xmfirelMenuRouteNames,
 } from "./xmfire/routeConfig";
 
+import { appConstant as cjzfireConstant } from "./cjzfire/constant";
+import {
+  routes as cjzfireRoutes,
+  menuRouteNames as cjzfirelMenuRouteNames,
+} from "./cjzfire/routeConfig";
+
+
 import { appConstant as policeConstant } from "./ga/constant";
 import {
   routes as policeRoutes,
@@ -29,7 +36,7 @@ export type AppConstant = {
   ico: string;
   desc: string;
   banner: string;
-  deptId: number;
+  deptId: number | string;
   name: string;
   loginComponent?: any;
 };
@@ -38,7 +45,7 @@ export let appConstant: AppConstant;
 export let appRoutes: Routes;
 export let menuRouteNames: string[];
 const app = import.meta.env.VITE_APP_APP;
-console.log('app', app)
+console.log('app', app, import.meta.env.VITE_APP_APP)
 // 为了打包去除不需要的app只能固定写法
 if (app === "fire") {
   appRoutes = fireRoutes;
@@ -52,6 +59,10 @@ if (app === "fire") {
   appRoutes = xmfireRoutes;
   menuRouteNames = xmfirelMenuRouteNames;
   appConstant = xmfireConstant;
+} else if (app === "cjzfire") {
+  appRoutes = cjzfireRoutes;
+  menuRouteNames = cjzfirelMenuRouteNames;
+  appConstant = cjzfireConstant;
 } else if (app === "ga") {
   appRoutes = policeRoutes;
   menuRouteNames = policeMenuRouteNames;

+ 2 - 0
src/constant/appDeptId.ts

@@ -2,10 +2,12 @@ export const fireDeptId = 1;
 export const criminalDeptId = 2;
 export const xmfireDeptId = 3;
 export const policeDeptId = 4;
+export const cjzcriminalDeptId = 'DEP000011734134901809483776';
 
 export const topDeptIds = [
   fireDeptId,
   criminalDeptId,
   xmfireDeptId,
   policeDeptId,
+  cjzcriminalDeptId,
 ];

+ 1 - 1
src/setSystem.ts

@@ -20,7 +20,7 @@ const modules = import.meta.glob("@/assets/style/theme/*.scss", {
 
 const appId = import.meta.env.VITE_APP_APP
 
-
+console.log('获取后台当前色appId', appId)
 axios.get(getSysSetting, {
   params: {
     platformKey: appId

+ 1 - 0
src/store/system.ts

@@ -14,6 +14,7 @@ export type LoginProps = {
   phoneNum: string;
   code: string;
   password: string;
+  deptId?: string;
 };
 
 export const title = ref(appConstant.title);