Bladeren bron

app解除耦合 加强内聚

bill 2 jaren geleden
bovenliggende
commit
3a1ecf7e35

+ 2 - 2
src/App.vue

@@ -9,7 +9,7 @@
 
 <script setup lang="ts">
 import Locale from "@/config/locale.vue";
-import { appConfig } from "@/store/system";
+import { appConstant } from "@/app";
 
-document.title = appConfig.title;
+document.title = appConstant.title;
 </script>

+ 12 - 0
src/app/appType.ts

@@ -0,0 +1,12 @@
+export const enum AppType {
+  fire = "fire",
+  criminal = "criminal",
+}
+
+export type AppConstant = {
+  useScssPath: string;
+  title: string;
+  desc: string;
+  banner: string;
+  deptId: number;
+};

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

@@ -0,0 +1,9 @@
+import { AppConstant } from "../appType";
+
+export const appConstant: AppConstant = {
+  useScssPath: "@/app/criminal/useStyle.scss",
+  title: "刑侦三维远程勘验平台",
+  desc: "dimensional remote prospecting platform of fire scene of Fire Rescue",
+  banner: "./public/criminalBanner.png",
+  deptId: 2,
+};

+ 14 - 3
src/app/criminal/routeConfig.ts

@@ -1,15 +1,26 @@
 import { RouteName } from "@/router/routeName";
+import { Routes } from "@/router/config";
 
 export const CriminalRouteName = {
   ...RouteName,
   example: "example",
 } as const;
 
-export const routes = [
+export const menuRouteNames = [
+  CriminalRouteName.home,
+  CriminalRouteName.vrmodel,
+  CriminalRouteName.camera,
+  CriminalRouteName.example,
+  CriminalRouteName.organization,
+  CriminalRouteName.role,
+  CriminalRouteName.user,
+];
+
+export const routes: Routes = [
   {
-    name: RouteName.example,
+    name: CriminalRouteName.example,
     path: "example",
-    component: () => import("@/view/example/index.vue"),
+    component: () => import("@/app/criminal/view/example/index.vue"),
     meta: { title: "案件管理", icon: "iconfire_management" },
   },
 ];

+ 1 - 1
src/store/example.ts

@@ -6,7 +6,7 @@ import {
   deleteExample,
   setExample as setExampleUrl,
 } from "@/request";
-import { Case } from "./case";
+import { Case } from "@/store/case";
 
 export type Example = Case;
 

+ 1 - 1
src/view/example/edit.vue

@@ -12,7 +12,7 @@
 
 <script setup lang="ts">
 import { ref } from "vue";
-import { Example, setExample, addExample } from "@/store/example";
+import { Example, setExample, addExample } from "@/app/criminal/store/example";
 import { ElMessage } from "element-plus";
 import { QuiskExpose } from "@/helper/mount";
 

+ 2 - 1
src/view/example/index.vue

@@ -62,8 +62,9 @@
 
 <script setup lang="ts">
 import comHead from "@/components/head/index.vue";
+import comPagination from "@/components/pagination/index.vue";
 import { usePagging } from "@/hook/pagging";
-import { Example, delExample, getExamplePagging } from "@/store/example";
+import { Example, delExample, getExamplePagging } from "@/app/criminal/store/example";
 import CaseEditMenu from "@/view/case/editMenu.vue";
 import { gotoQuery } from "@/view/case/help";
 import { addExample, editExample } from "./quisk";

src/view/example/quisk.ts → src/app/criminal/view/example/quisk.ts


+ 9 - 0
src/app/fire/constant.ts

@@ -0,0 +1,9 @@
+import { AppConstant } from "../appType";
+
+export const appConstant: AppConstant = {
+  useScssPath: "@/app/fire/useStyle.scss",
+  title: "消防火调三维远程勘验平台",
+  desc: "dimensional remote prospecting platform of fire scene of Fire Rescue",
+  banner: "./public/fireBanner.png",
+  deptId: 1,
+};

+ 582 - 0
src/app/fire/constant/fire.ts

@@ -0,0 +1,582 @@
+import { FireStatus } from "@/app/fire/store/fire";
+
+// 火灾原因
+export const reason = [
+  {
+    label: "放火",
+    value: "放火",
+    children: [
+      { value: "刑事防火", label: "刑事防火" },
+      { value: "精神病、智障等人士防火", label: "精神病、智障等人士防火" },
+      { value: "自焚", label: "自焚" },
+      { value: "其他", label: "其他" },
+    ],
+  },
+  {
+    value: "电气火灾",
+    label: "电气火灾",
+    children: [
+      { label: "蓄电池故障(热失控)", value: "蓄电池故障(热失控)" },
+      {
+        label: "电气线路故障(线路接插件、配电盘、控制装置等) ",
+        value: "电气线路故障(线路接插件、配电盘、控制装置等) ",
+      },
+      { label: "电动机及其他工业设备", value: "电动机及其他工业设备" },
+      { label: "电器设备故障", value: "电器设备故障" },
+      { label: "电加热器具火灾", value: "电加热器具火灾" },
+      { label: "其他", value: "其他" },
+    ],
+  },
+  {
+    value: "产作业",
+    label: "产作业",
+    children: [
+      { label: "焊割", value: "焊割" },
+      { label: "熬炼", value: "熬炼" },
+      { label: "化工生产", value: "化工生产" },
+      { label: "机械设备类故障", value: "机械设备类故障" },
+      { label: "烘烤", value: "烘烤" },
+      { label: "接触高温", value: "接触高温" },
+      { label: "其他", value: "其他" },
+    ],
+  },
+  {
+    value: "用火不慎",
+    label: "用火不慎",
+    children: [
+      { label: "余火复燃", value: "余火复燃" },
+      { label: "照明不慎", value: "照明不慎" },
+      { label: "烘烤不慎", value: "烘烤不慎" },
+      { label: "敬神祭祖", value: "敬神祭祖" },
+      { label: "油锅起火", value: "油锅起火" },
+      { label: "燃气炉具故障及使用不当", value: "燃气炉具故障及使用不当" },
+      { label: "燃油炉具故障及使用不当", value: "燃油炉具故障及使用不当" },
+      { label: "其他炉具故障及使用不当", value: "其他炉具故障及使用不当" },
+      { label: "烟道过热窜火、飞火等", value: "烟道过热窜火、飞火等" },
+      { label: "烧荒、野外生火不慎", value: "烧荒、野外生火不慎" },
+      { label: "使用蚊香不慎", value: "使用蚊香不慎" },
+      { label: "其他", value: "其他" },
+    ],
+  },
+  {
+    value: "吸烟",
+    label: "吸烟",
+    children: [
+      { label: "违章吸烟", value: "违章吸烟" },
+      { label: "乱扔烟头、火柴等", value: "乱扔烟头、火柴等" },
+      { label: "卧床吸烟", value: "卧床吸烟" },
+      { label: "其他", value: "其他" },
+    ],
+  },
+  {
+    value: "玩火",
+    label: "玩火",
+    children: [
+      { label: "小孩玩火", value: "小孩玩火" },
+      { label: "其他", value: "其他" },
+    ],
+  },
+  { label: "燃放烟花爆竹", value: "燃放烟花爆竹" },
+  { label: "自燃", value: "自燃" },
+  { label: "雷击", value: "雷击" },
+  { label: "静电", value: "静电" },
+  { label: "遗留火种", value: "遗留火种" },
+  { label: "其他", value: "其他" },
+  { label: "不排除原因", value: "不排除原因" },
+];
+
+// 起火场所
+export const place = [
+  {
+    label: "非建构筑物",
+    value: "非建构筑物",
+    children: [
+      { label: "室外集贸市场", value: "室外集贸市场" },
+      { label: "露天堆垛", value: "露天堆垛" },
+      {
+        label: "露天农副业场所",
+        value: "露天农副业场所",
+        children: [
+          { label: "农田", value: "农田" },
+          { label: "经济林木(含果园)", value: "经济林木(含果园)" },
+          { label: "苗圃", value: "苗圃" },
+          { label: "花卉", value: "花卉" },
+          { label: "养殖场", value: "养殖场" },
+          { label: "大棚", value: "大棚" },
+          { label: "其他", value: "其他" },
+        ],
+      },
+      {
+        label: "室外独立生产设施设备",
+        value: "室外独立生产设施设备",
+        children: [
+          { label: "风力发电设施", value: "风力发电设施" },
+          { label: "光伏发电设施", value: "光伏发电设施" },
+          {
+            label: "小型变压器、配电柜等室外输配电设备",
+            value: "小型变压器、配电柜等室外输配电设备",
+          },
+          { label: "变电站", value: "变电站" },
+          { label: "通讯基站", value: "通讯基站" },
+          { label: "其他室外独立式生产设施", value: "其他室外独立式生产设施" },
+        ],
+      },
+      { label: "公园", value: "公园" },
+      { label: "森林", value: "森林" },
+      { label: "草原", value: "草原" },
+      { label: "道路绿化带、隔离带", value: "道路绿化带、隔离带" },
+      { label: "其他", value: "其他" },
+    ],
+  },
+  {
+    label: "交通工具",
+    value: "交通工具",
+    children: [
+      {
+        label: "客车",
+        value: "客车",
+        children: [
+          { label: "燃油车", value: "燃油车" },
+          { label: "燃气车", value: "燃气车" },
+          { label: "电动车", value: "电动车" },
+          { label: "混合电动车", value: "混合电动车" },
+        ],
+      },
+      {
+        label: "货车",
+        value: "货车",
+        children: [
+          { label: "燃油车", value: "燃油车" },
+          { label: "燃气车", value: "燃气车" },
+          { label: "电动车", value: "电动车" },
+          { label: "混合电动车", value: "混合电动车" },
+        ],
+      },
+      {
+        label: "轿车",
+        value: "轿车",
+        children: [
+          { label: "燃油车", value: "燃油车" },
+          { label: "燃气车", value: "燃气车" },
+          { label: "电动车", value: "电动车" },
+          { label: "混合电动车", value: "混合电动车" },
+        ],
+      },
+      {
+        label: "特种车",
+        value: "特种车",
+        children: [
+          { label: "燃油车", value: "燃油车" },
+          { label: "燃气车", value: "燃气车" },
+          { label: "电动车", value: "电动车" },
+          { label: "混合电动车", value: "混合电动车" },
+        ],
+      },
+      { label: "摩托车", value: "摩托车" },
+      { label: "铁路列车", value: "铁路列车" },
+      { label: "船舶", value: "船舶" },
+      { label: "航空(天)", value: "航空(天)" },
+      { label: "城市轨道交通工具", value: "城市轨道交通工具" },
+      { label: "农用机械", value: "农用机械" },
+      {
+        label: "电动助力车(三轮车、自行车)",
+        value: "电动助力车(三轮车、自行车)",
+      },
+      { label: "其他", value: "其他" },
+    ],
+  },
+  {
+    label: "建构筑物",
+    value: "建构筑物",
+    children: [
+      {
+        label: "居住场所",
+        value: "居住场所",
+        children: [
+          { label: "自建住宅", value: "自建住宅" },
+          {
+            label: "非自建住宅",
+            value: "非自建住宅",
+            children: [
+              { label: "商品房	", value: "商品房	" },
+              { label: "经适房	", value: "经适房	" },
+              { label: "集资房	", value: "集资房	" },
+              { label: "公寓房	", value: "公寓房	" },
+            ],
+          },
+          { label: "员工集体宿舍", value: "员工集体宿舍" },
+        ],
+      },
+      { label: "办公场所", value: "办公场所" },
+      {
+        label: "学校",
+        value: "学校",
+        children: [
+          {
+            label: "幼儿园托儿所",
+            value: "幼儿园托儿所",
+            children: [
+              { label: "教学场所	", value: "教学场所	" },
+              { label: "实验场所	", value: "实验场所	" },
+              { label: "学生集体宿舍	", value: "学生集体宿舍	" },
+              { label: "食堂	", value: "食堂	" },
+              { label: "礼堂等室内活动场馆	", value: "礼堂等室内活动场馆	" },
+              { label: "其他	", value: "其他	" },
+            ],
+          },
+          {
+            label: "小学",
+            value: "小学",
+            children: [
+              { label: "教学场所	", value: "教学场所	" },
+              { label: "实验场所	", value: "实验场所	" },
+              { label: "学生集体宿舍	", value: "学生集体宿舍	" },
+              { label: "食堂	", value: "食堂	" },
+              { label: "礼堂等室内活动场馆	", value: "礼堂等室内活动场馆	" },
+              { label: "其他	", value: "其他	" },
+            ],
+          },
+          {
+            label: "中学",
+            value: "中学",
+            children: [
+              { label: "教学场所	", value: "教学场所	" },
+              { label: "实验场所	", value: "实验场所	" },
+              { label: "学生集体宿舍	", value: "学生集体宿舍	" },
+              { label: "食堂	", value: "食堂	" },
+              { label: "礼堂等室内活动场馆	", value: "礼堂等室内活动场馆	" },
+              { label: "其他	", value: "其他	" },
+            ],
+          },
+          {
+            label: "大学",
+            value: "大学",
+            children: [
+              { label: "教学场所	", value: "教学场所	" },
+              { label: "实验场所	", value: "实验场所	" },
+              { label: "学生集体宿舍	", value: "学生集体宿舍	" },
+              { label: "食堂	", value: "食堂	" },
+              { label: "礼堂等室内活动场馆	", value: "礼堂等室内活动场馆	" },
+              { label: "其他	", value: "其他	" },
+            ],
+          },
+          {
+            label: "校外培训机构",
+            value: "校外培训机构",
+            children: [
+              { label: "教学场所	", value: "教学场所	" },
+              { label: "实验场所	", value: "实验场所	" },
+              { label: "学生集体宿舍	", value: "学生集体宿舍	" },
+              { label: "食堂	", value: "食堂	" },
+              { label: "礼堂等室内活动场馆	", value: "礼堂等室内活动场馆	" },
+              { label: "其他	", value: "其他	" },
+            ],
+          },
+          {
+            label: "成人教育机构",
+            value: "成人教育机构",
+            children: [
+              { label: "教学场所	", value: "教学场所	" },
+              { label: "实验场所	", value: "实验场所	" },
+              { label: "学生集体宿舍	", value: "学生集体宿舍	" },
+              { label: "食堂	", value: "食堂	" },
+              { label: "礼堂等室内活动场馆	", value: "礼堂等室内活动场馆	" },
+              { label: "其他	", value: "其他	" },
+            ],
+          },
+        ],
+      },
+      {
+        label: "商业场所",
+        value: "商业场所",
+        children: [
+          { label: "商场", value: "商场" },
+          { label: "超市", value: "超市" },
+          { label: "室内市场", value: "室内市场" },
+          { label: "经营性小场所", value: "经营性小场所" },
+          { label: "其他", value: "其他" },
+        ],
+      },
+      {
+        label: "宾馆、饭店、招待所",
+        value: "宾馆、饭店、招待所",
+        children: [
+          { label: "客房", value: "客房" },
+          { label: "餐饮", value: "餐饮" },
+          { label: "办公室", value: "办公室" },
+          { label: "会议室", value: "会议室" },
+          { label: "民宿", value: "民宿" },
+        ],
+      },
+      {
+        label: "纯餐饮场所",
+        value: "纯餐饮场所",
+        children: [
+          { label: "餐馆酒家", value: "餐馆酒家" },
+          { label: "农家乐", value: "农家乐" },
+          { label: "露天大排档", value: "露天大排档" },
+          { label: "私房菜馆", value: "私房菜馆" },
+        ],
+      },
+      {
+        label: "医疗机构",
+        value: "医疗机构",
+        children: [
+          { label: "医院", value: "医院" },
+          { label: "诊所", value: "诊所" },
+          { label: "康复中心", value: "康复中心" },
+          { label: "精神病院", value: "精神病院" },
+        ],
+      },
+      {
+        label: "养老院",
+        value: "养老院",
+        children: [
+          { label: "公办养老院", value: "公办养老院" },
+          { label: "私营养老院", value: "私营养老院" },
+        ],
+      },
+      { label: "福利院", value: "福利院" },
+      {
+        label: "公共娱乐场所",
+        value: "公共娱乐场所",
+        children: [
+          {
+            label: "影剧院、礼堂等演出、放映场所",
+            value: "影剧院、礼堂等演出、放映场所",
+          },
+          {
+            label: "舞厅、卡拉OK厅等歌舞娱乐场所",
+            value: "舞厅、卡拉OK厅等歌舞娱乐场所",
+          },
+          {
+            label: "具有娱乐功能的夜总会、音乐茶座场所",
+            value: "具有娱乐功能的夜总会、音乐茶座场所",
+          },
+          {
+            label:
+              "保龄球馆、旱冰场、按摩、沐足、棋牌、桑拿浴室等营业性健身、休闲场所",
+            value:
+              "保龄球馆、旱冰场、按摩、沐足、棋牌、桑拿浴室等营业性健身、休闲场所",
+          },
+          { label: "儿童娱乐、活动场所", value: "儿童娱乐、活动场所" },
+          { label: "游艺等其他公共娱乐场所", value: "游艺等其他公共娱乐场所" },
+        ],
+      },
+      {
+        label: "体育场馆",
+        value: "体育场馆",
+        children: [
+          { label: "室内部分", value: "室内部分" },
+          { label: "露天部分", value: "露天部分" },
+        ],
+      },
+      {
+        label: "金融交易场所",
+        value: "金融交易场所",
+        children: [
+          { label: "证券交易所", value: "证券交易所" },
+          { label: "银行网点", value: "银行网点" },
+        ],
+      },
+      {
+        label: "交通枢纽(站)",
+        value: "交通枢纽(站)",
+        children: [
+          { label: "候机场所", value: "候机场所" },
+          { label: "候船场所", value: "候船场所" },
+          {
+            label: "候车场所",
+            value: "候车场所",
+            children: [
+              { label: "汽车客运站	", value: "汽车客运站	" },
+              {
+                label: "铁路、高铁、城轨候车场所	",
+                value: "铁路、高铁、城轨候车场所	",
+              },
+            ],
+          },
+          { label: "地铁站", value: "地铁站" },
+          { label: "公交站", value: "公交站" },
+          { label: "交通综合枢纽", value: "交通综合枢纽" },
+        ],
+      },
+      {
+        label: "文物古建筑",
+        value: "文物古建筑",
+        children: [
+          { label: "国家级", value: "国家级" },
+          { label: "省级", value: "省级" },
+          { label: "市、县级", value: "市、县级" },
+          { label: "其他", value: "其他" },
+        ],
+      },
+      {
+        label: "文博馆(图书馆、博物馆、档案馆等)",
+        value: "文博馆(图书馆、博物馆、档案馆等)",
+      },
+      { label: "科研试验场所", value: "科研试验场所" },
+      { label: "广播电视中心", value: "广播电视中心" },
+      {
+        label: "通信场所",
+        value: "通信场所",
+        children: [
+          { label: "营业厅", value: "营业厅" },
+          { label: "机房", value: "机房" },
+          { label: "其他", value: "其他" },
+        ],
+      },
+      {
+        label: "宗教场所",
+        value: "宗教场所",
+        children: [
+          { label: "寺庙", value: "寺庙" },
+          { label: "教堂", value: "教堂" },
+          { label: "道观", value: "道观" },
+          { label: "其他民间信仰场所", value: "其他民间信仰场所" },
+        ],
+      },
+      { label: "会议、展览中心", value: "会议、展览中心" },
+      {
+        label: "物资仓储场所",
+        value: "物资仓储场所",
+        children: [
+          {
+            label: "危险品",
+            value: "危险品",
+            children: [
+              { label: "甲类	", value: "甲类	" },
+              { label: "乙类	", value: "乙类	" },
+              { label: "丙类	", value: "丙类	" },
+              { label: "丁类	", value: "丁类	" },
+              { label: "戊类	", value: "戊类	" },
+            ],
+          },
+          { label: "棉花", value: "棉花" },
+          { label: "粮食", value: "粮食" },
+          { label: "百货", value: "百货" },
+          { label: "综合", value: "综合" },
+          { label: "物流快递", value: "物流快递" },
+          { label: "三合一、多合一", value: "三合一、多合一" },
+          { label: "经营性小场所", value: "经营性小场所" },
+        ],
+      },
+      {
+        label: "厂房",
+        value: "厂房",
+        children: [
+          { label: "甲乙类生产", value: "甲乙类生产" },
+          { label: "丙类生产", value: "丙类生产" },
+          { label: "丁戊类生产", value: "丁戊类生产" },
+          { label: "劳动密集型", value: "劳动密集型" },
+          { label: "三合一、多合一", value: "三合一、多合一" },
+          { label: "经营性小场所", value: "经营性小场所" },
+          { label: "其他", value: "其他" },
+        ],
+      },
+      {
+        label: "加油加气站充电站",
+        value: "加油加气站充电站",
+        children: [
+          { label: "加油站", value: "加油站" },
+          { label: "加气站", value: "加气站" },
+          { label: "充电站", value: "充电站" },
+          { label: "加油加气站", value: "加油加气站" },
+          { label: "其他", value: "其他" },
+        ],
+      },
+      {
+        label: "汽车库",
+        value: "汽车库",
+        children: [
+          { label: "高层", value: "高层" },
+          { label: "多层", value: "多层" },
+          { label: "地下", value: "地下" },
+          { label: "半地下", value: "半地下" },
+          { label: "机械", value: "机械" },
+          { label: "敞开式", value: "敞开式" },
+        ],
+      },
+      {
+        label: "修车库",
+        value: "修车库",
+        children: [
+          { label: "简易修理厂", value: "简易修理厂" },
+          { label: "临时搭建修理厂", value: "临时搭建修理厂" },
+        ],
+      },
+      {
+        label: "工地",
+        value: "工地",
+        children: [
+          {
+            label: "建设工地",
+            value: "建设工地",
+            children: [
+              {
+                label: "建筑物、构筑物、设施等	",
+                value: "建筑物、构筑物、设施等	",
+              },
+              { label: "临时宿舍	", value: "临时宿舍	" },
+              { label: "临时办公场所	", value: "临时办公场所	" },
+              { label: "临时食堂	", value: "临时食堂	" },
+              { label: "临时室内仓库	", value: "临时室内仓库	" },
+              { label: "临时建材堆放场所	", value: "临时建材堆放场所	" },
+            ],
+          },
+          { label: "装修、改造工地", value: "装修、改造工地" },
+          { label: "动拆迁工地", value: "动拆迁工地" },
+        ],
+      },
+      {
+        label: "室内农副业场所",
+        value: "室内农副业场所",
+        children: [
+          { label: "温室", value: "温室" },
+          { label: "养殖场", value: "养殖场" },
+        ],
+      },
+      {
+        label: "石油化工企业",
+        value: "石油化工企业",
+        children: [
+          { label: "生产装置", value: "生产装置" },
+          { label: "储罐区", value: "储罐区" },
+          { label: "生活区", value: "生活区" },
+          { label: "办公区", value: "办公区" },
+        ],
+      },
+      { label: "其他", value: "其他" },
+    ],
+  },
+  {
+    label: "垃圾及废弃物",
+    value: "垃圾及废弃物",
+    children: [
+      { label: "垃圾箱", value: "垃圾箱" },
+      { label: "垃圾堆", value: "垃圾堆" },
+      { label: "垃圾场", value: "垃圾场" },
+      { label: "垃圾中转站", value: "垃圾中转站" },
+      { label: "废品回收场所", value: "废品回收场所" },
+      { label: "其他", value: "其他" },
+    ],
+  },
+];
+
+export const fireStatusDesc = {
+  [FireStatus.all]: "全部",
+  [FireStatus.incomplete]: "未认定",
+  [FireStatus.complete]: "已认定",
+};
+
+export const fireStatuOptions = [
+  {
+    value: FireStatus.all,
+    label: fireStatusDesc[FireStatus.all],
+  },
+  {
+    value: FireStatus.incomplete,
+    label: fireStatusDesc[FireStatus.incomplete],
+  },
+  { value: FireStatus.complete, label: fireStatusDesc[FireStatus.complete] },
+];

+ 34 - 0
src/app/fire/routeConfig.ts

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

src/store/fire.ts → src/app/fire/store/fire.ts


+ 2 - 2
src/view/dispatch/editFire.vue

@@ -72,8 +72,8 @@
 <script setup lang="ts">
 import companySelect from "@/components/company-select/index.vue";
 import { ref } from "vue";
-import { Fire, setFire } from "@/store/fire";
-import { reason, place } from "@/constant/fire";
+import { Fire, setFire } from "@/app/fire/store/fire";
+import { reason, place } from "@/app/fire/constant/fire";
 import { ElMessage } from "element-plus";
 import { dateFormat } from "@/util";
 import { genCascaderValue, getCode } from "@/helper/cascader";

+ 1 - 1
src/view/dispatch/editLeaveMsg.vue

@@ -15,7 +15,7 @@
 import { ElMessage } from "element-plus";
 import { ref } from "vue";
 import { QuiskExpose } from "@/helper/mount";
-import { addFireLeaveMsg } from "@/store/fire";
+import { addFireLeaveMsg } from "@/app/fire/store/fire";
 
 const props = defineProps<{
   projectId: string;

+ 1 - 1
src/view/dispatch/header.vue

@@ -66,7 +66,7 @@
 import { FirePagging } from "./pagging";
 import comCompany from "@/components/company-select/index.vue";
 import { genCascaderValue, getCode, getRaw } from "@/helper/cascader";
-import { reason, place, fireStatuOptions } from "@/constant/fire";
+import { reason, place, fireStatuOptions } from "@/app/fire/constant/fire";
 import comHead from "@/components/head/index.vue";
 import { computed, ref, watchEffect } from "vue";
 

+ 1 - 1
src/view/dispatch/index.vue

@@ -66,7 +66,7 @@
 import Header from "./header.vue";
 import List from "./list.vue";
 import { useFirePagging } from "./pagging";
-import { Fire, revokeFireTeachs, setFireTeachs } from "@/store/fire";
+import { Fire, revokeFireTeachs, setFireTeachs } from "@/app/fire/store/fire";
 import CaseEditMenu from "@/view/case/editMenu.vue";
 import { gotoQuery } from "@/view/case/help";
 import { confirm } from "@/helper/message";

+ 1 - 2
src/view/dispatch/leaveMsgList.vue

@@ -44,9 +44,8 @@
 
 <script setup lang="ts">
 import { usePagging } from "@/hook/pagging";
-import { getMessageList } from "@/request";
 import comPagination from "@/components/pagination/index.vue";
-import { FireLeaveMsg, getFireLeaveMsgPagging } from "@/store/fire";
+import { FireLeaveMsg, getFireLeaveMsgPagging } from "@/app/fire/store/fire";
 import { dateFormat } from "@/util";
 import { QuiskExpose } from "@/helper/mount";
 

+ 2 - 2
src/view/dispatch/list.vue

@@ -96,8 +96,8 @@
 
 <script lang="ts" setup>
 import comPagination from "@/components/pagination/index.vue";
-import { fireStatusDesc } from "@/constant/fire";
-import { FireStatus } from "@/store/fire";
+import { fireStatusDesc } from "@/app/fire/constant/fire";
+import { FireStatus } from "@/app/fire/store/fire";
 import { operateIsPermissionByPath } from "@/directive/permission";
 import { FirePagging } from "./pagging";
 

+ 4 - 3
src/view/dispatch/pagging.ts

@@ -4,13 +4,14 @@ import {
   FireStatus,
   delFire,
   getFirePagging,
-} from "@/store/fire";
+} from "@/app/fire/store/fire";
 import { computed, watchEffect } from "vue";
-import { RouteName, router } from "@/router";
+import { router } from "@/router";
+import { FireRouteName } from "@/app/fire/routeConfig";
 
 export const useFirePagging = () => {
   const isTeached = computed(
-    () => router.currentRoute.value.name === RouteName.teaching
+    () => router.currentRoute.value.name === FireRouteName.teaching
   );
 
   const pagging = usePagging({

src/view/dispatch/quisk.ts → src/app/fire/view/dispatch/quisk.ts


+ 1 - 2
src/view/dispatch/share.vue

@@ -23,11 +23,10 @@
 <script setup lang="ts">
 import { computed, onMounted, ref, watchEffect } from "vue";
 import { EPSW } from "@/constant/REG";
-import { axios, fireDetail, fireSetPsw, getFirePsw } from "@/request";
 import { ElMessage } from "element-plus";
 import { copyText } from "@/util";
 import { getQuery } from "@/view/case/help";
-import { Fire, getFire, getFireSharePWD, setFireSharePWD } from "@/store/fire";
+import { Fire, getFire, getFireSharePWD, setFireSharePWD } from "@/app/fire/store/fire";
 import { QuiskExpose } from "@/helper/mount";
 
 const props = defineProps<{ projectId: string }>();

+ 32 - 3
src/app/index.ts

@@ -1,4 +1,33 @@
-export const enum AppType {
-  fire = "1",
-  criminal = "2",
+import { AppConstant, AppType } from "./appType";
+import { Routes } from "@/router";
+
+import { appConstant as criminalConstant } from "./criminal/constant";
+import { appConstant as fireConstant } from "./fire/constant";
+import {
+  routes as criminalRoutes,
+  menuRouteNames as criminalMenuRouteNames,
+} from "./criminal/routeConfig";
+import {
+  routes as fireRoutes,
+  menuRouteNames as firelMenuRouteNames,
+} from "./fire/routeConfig";
+
+export { AppType };
+export let appRoutes: Routes;
+export let appConstant: AppConstant;
+export let menuRouteNames: string[];
+
+switch (VITE_APP_APP as AppType) {
+  case AppType.fire: {
+    appRoutes = fireRoutes;
+    appConstant = fireConstant;
+    menuRouteNames = firelMenuRouteNames;
+    break;
+  }
+  case AppType.criminal: {
+    appRoutes = criminalRoutes;
+    appConstant = criminalConstant;
+    menuRouteNames = criminalMenuRouteNames;
+    break;
+  }
 }

+ 0 - 21
src/config/criminal.scss

@@ -1,21 +0,0 @@
-@forward 'element-plus/theme-chalk/src/common/var.scss'with ($colors: ('primary': ('base': #26559B, )),
-  $common-component-size: ('default': 40px));
-
-.delBtn {
-  color   : #26559B;
-  // color: rgb(250, 85, 85);
-}
-
-body {
-
-
-  .home-content h1,
-  .info h1 {
-    color: rgba(0, 0, 0, 0.85);
-  }
-
-  .home-content p,
-  .info p {
-    color: rgba(0, 0, 0, 0.45);
-  }
-}

+ 0 - 7
src/config/fire.scss

@@ -1,7 +0,0 @@
-@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);
-}

+ 0 - 14
src/constant/sys.ts

@@ -1,15 +1 @@
-import { RouteName } from "@/router";
-
-export const menuRouteNames = [
-  RouteName.home,
-  RouteName.vrmodel,
-  RouteName.camera,
-  RouteName.dispatch,
-  RouteName.example,
-  RouteName.organization,
-  RouteName.teaching,
-  RouteName.role,
-  RouteName.user,
-];
-
 export const UN_REQ_NUM = -99999;

+ 0 - 31
src/router/appConfig.ts

@@ -1,31 +0,0 @@
-import { AppType } from "@/constant/app";
-import { Routes } from "./config";
-import { RouteName } from "./routeName";
-
-export const appRoutes: Routes = [];
-switch (import.meta.env.VITE_APP_APP) {
-  case AppType.fire:
-    appRoutes.push(
-      {
-        name: RouteName.dispatch,
-        path: "dispatch",
-        component: () => import("@/view/dispatch/index.vue"),
-        meta: { title: "火调管理", icon: "iconfire_management" },
-      },
-      {
-        name: RouteName.teaching,
-        path: "teaching",
-        component: () => import("@/view/dispatch/index.vue"),
-        meta: { title: "教学平台", icon: "iconfire_study" },
-      }
-    );
-    break;
-  case AppType.criminal:
-    appRoutes.push({
-      name: RouteName.example,
-      path: "example",
-      component: () => import("@/view/example/index.vue"),
-      meta: { title: "案件管理", icon: "iconfire_management" },
-    });
-    break;
-}

+ 4 - 4
src/router/config.ts

@@ -1,11 +1,11 @@
-import { AppType } from "@/constant/app";
-import { RouteName, RouteNameType } from "./routeName";
-import { appRoutes } from "./appConfig";
+import { RouteName } from "./routeName";
+import { appRoutes } from "@/app";
 
+export { RouteName };
 export type Routes = Route[];
 export type RouteMeta = { title: string; icon?: string };
 export type Route = {
-  name: RouteNameType;
+  name: string;
   path: string;
   component: any;
   meta: RouteMeta;

+ 2 - 2
src/router/index.ts

@@ -1,6 +1,6 @@
 import { createRouter, createWebHashHistory } from "vue-router";
 import { Routes, routes, system, Route } from "./config";
-import { RouteName, RouteNameType } from "./routeName";
+import { RouteName } from "./routeName";
 
 export * from "./config";
 export * from "./routeName";
@@ -47,7 +47,7 @@ export const routeIsSystem = (proutes = routes) => {
 };
 
 export const findRoute = (
-  routeName: RouteNameType,
+  routeName: string,
   fullPath = false,
   routeAll = routes
 ): Route | null => {

+ 0 - 3
src/router/routeName.ts

@@ -14,9 +14,6 @@ export const RouteName = {
   role: "role",
   sceneInitiator: "sceneInitiator",
   sceneVisitor: "sceneVisitor",
-  dispatch: "dispatch",
-  teaching: "teaching",
-  example: "example",
 } as const;
 
 type RouteNamesType = typeof RouteName;

+ 2 - 5
src/store/system.ts

@@ -2,7 +2,7 @@ import { axios, userLogin, uploadFile as uploadFileUrl } from "@/request";
 import { encodePwd } from "@/util";
 import { user } from "./user";
 import { refreshRole } from "./role";
-import { AppConfig, AppType } from "@/constant/app";
+import { appConstant } from "@/app";
 
 export type LoginProps = {
   phoneNum: string;
@@ -10,13 +10,10 @@ export type LoginProps = {
   password: string;
 };
 
-export const app: AppType = import.meta.env.VITE_APP_APP as AppType;
-export const appConfig = AppConfig[app];
-
 export const login = async (props: LoginProps) => {
   const res = await axios.post(userLogin, {
     ...props,
-    deptId: Number(app),
+    deptId: appConstant.deptId,
     password: encodePwd(props.password),
   });
 

+ 0 - 1
src/view/camera/bind.vue

@@ -28,7 +28,6 @@ import comCompany from "@/components/company-select/index.vue";
 import { Camera, addCamera } from "@/store/camera";
 import { UserInfo, getUsers } from "@/store/user";
 import { ref, watchEffect } from "vue";
-import { axios, getUserListSelect } from "@/request";
 import { ElMessage } from "element-plus";
 import { QuiskExpose } from "@/helper/mount";
 

+ 4 - 4
src/view/home/index.vue

@@ -1,9 +1,9 @@
 <template>
   <com-head :options="[{ name: '首页', value: '1' }]" class="frame-head" not-content />
-  <div class="home-layer" :style="{ backgroundImage: `url(${appConfig.banner})` }">
+  <div class="home-layer" :style="{ backgroundImage: `url(${appConstant.banner})` }">
     <div class="home-content">
-      <h1>{{ appConfig.title }}</h1>
-      <p>{{ appConfig.desc }}</p>
+      <h1>{{ appConstant.title }}</h1>
+      <p>{{ appConstant.desc }}</p>
     </div>
     <div class="foot">
       <p>珠海市四维时代网络科技有限公司</p>
@@ -13,7 +13,7 @@
 
 <script setup lang="ts">
 import comHead from "@/components/head/index.vue";
-import { appConfig } from "@/store/system";
+import { appConstant } from "@/app";
 </script>
 
 <style lang="scss" scoped>

+ 3 - 3
src/view/layout/index.vue

@@ -22,14 +22,14 @@
 <script lang="ts" setup>
 import lyTop from "./top/index.vue";
 import lySlide from "./slide/index.vue";
-import { RouteName, routeIsSystem, router } from "@/router";
+import { routeIsSystem, router } from "@/router";
 import { computed } from "vue";
-import { menuRouteNames } from "@/constant/sys";
+import { menuRouteNames } from "@/app";
 
 const isSystem = computed(() => routeIsSystem());
 
 const hiddenSlide = computed(
-  () => !menuRouteNames.includes(router.currentRoute.value.name as RouteName)
+  () => !menuRouteNames.includes(router.currentRoute.value.name as string)
 );
 </script>
 

+ 4 - 4
src/view/layout/top/index.vue

@@ -2,8 +2,8 @@
   <div class="header-top">
     <div class="title">
       <h2>
-        {{ appConfig.title }}
-        <span>{{ appConfig.desc }}</span>
+        {{ appConstant.title }}
+        <span>{{ appConstant.desc }}</span>
       </h2>
     </div>
     <div class="oper-btns" v-if="user.info">
@@ -29,14 +29,14 @@
   </div>
 </template>
 <script lang="ts" setup>
-import { userLogout, axios, openErrorMsg } from "@/request";
+import { openErrorMsg } from "@/request";
 import { user, logout as logoutRaw } from "@/store/user";
 import defAvatar from "@/assets/image/top_my.png";
 import { refreshRole, roleId } from "@/store/role";
 import { RouteName, router } from "@/router";
 import { confirm } from "@/helper/message";
 import { updatePwd } from "@/view/system/quisk";
-import { appConfig } from "@/store/system";
+import { appConstant } from "@/app";
 
 refreshRole();
 

+ 2 - 2
src/view/system/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="system-layer" :style="{ backgroundImage: `url(${appConfig.banner})` }">
+  <div class="system-layer" :style="{ backgroundImage: `url(${appConstant.banner})` }">
     <div class="content">
       <component :is="component" />
     </div>
@@ -12,7 +12,7 @@ import register from "./register.vue";
 import forget from "./forget.vue";
 import { computed } from "vue";
 import { RouteName, router } from "@/router";
-import { appConfig } from "@/store/system";
+import { appConstant } from "@/app";
 
 const components = {
   [RouteName.login]: login,

+ 4 - 3
src/view/system/login.vue

@@ -2,8 +2,8 @@
   <div class="login-layer">
     <div class="content">
       <div class="info">
-        <h1>{{ appConfig.title }}</h1>
-        <p>{{ appConfig.desc }}</p>
+        <h1>{{ appConstant.title }}</h1>
+        <p>{{ appConstant.desc }}</p>
       </div>
       <el-form class="panel login" :model="form" @submit.stop>
         <h2>欢迎登录</h2>
@@ -70,7 +70,8 @@ import { openErrorMsg, baseURL, getCode } from "@/request";
 import { PHONE } from "@/constant/REG";
 import { guid } from "@/util";
 import { RouteName, router } from "@/router";
-import { appConfig, login } from "@/store/system";
+import { login } from "@/store/system";
+import { appConstant } from "@/app";
 
 // 是否显示明文密码
 const flag = ref(true);

+ 1 - 3
src/vite-env.d.ts

@@ -3,9 +3,7 @@
 declare module "qs";
 declare module "element-plus/dist/locale/zh-cn.mjs";
 
-interface ImportMetaEnv {
-  readonly VITE_APP_APP: string;
-}
+declare const VITE_APP_APP: string;
 
 interface ImportMeta {
   readonly env: ImportMetaEnv;

+ 2 - 1
tsconfig.node.json

@@ -7,6 +7,7 @@
   },
   "include": [
     "vite.config.ts",
-    "src/constant/app.ts"
+    "src/app/**/constant.ts",
+    "src/app/appType.ts",
   ]
 }

+ 11 - 6
vite.config.ts

@@ -1,15 +1,20 @@
 import { defineConfig, loadEnv } from "vite";
 import vue from "@vitejs/plugin-vue";
 import { resolve } from "path";
-import { AppConfig, AppType } from "./src/constant/app";
 import ElementPlus from "unplugin-element-plus/vite";
+import { AppType, AppConstant } from "./src/app/appType";
+import { appConstant } from "./src/app/fire/constant";
+// import { appConstant } from "./src/app/criminal/constant";
 
-// https://vitejs.dev/config/
-export default ({ mode }) => {
-  const env = loadEnv(mode, process.cwd());
-  const config = AppConfig[env.VITE_APP_APP as AppType];
+export default async ({ mode }) => {
+  const app = AppType.fire;
+  // const appConstant = (await import(`./src/app/${app}/constant`))
+  //   .AppConstant as AppConstant;
 
   return defineConfig({
+    define: {
+      VITE_APP_APP: JSON.stringify(app),
+    },
     resolve: {
       alias: [
         {
@@ -21,7 +26,7 @@ export default ({ mode }) => {
     css: {
       preprocessorOptions: {
         scss: {
-          additionalData: `@use "${config.useScssPath}" as *;`,
+          additionalData: `@use "${appConstant.useScssPath}" as *;`,
         },
       },
     },