bill 7 månader sedan
förälder
incheckning
860403c0de
4 ändrade filer med 74 tillägg och 115 borttagningar
  1. 44 17
      src/views/security/data.ts
  2. 3 3
      src/views/security/index.vue
  3. 10 6
      src/views/security/link.vue
  4. 17 89
      src/views/security/store.ts

+ 44 - 17
src/views/security/data.ts

@@ -1,3 +1,16 @@
+
+type Item = {
+  title: string;
+  link?: string;
+  content: { title: string; link?: string; zk?: string, type?: string }[];
+};
+type Items = {
+  title: string;
+  items: Item[];
+}[];
+type SStore = Record<string, Items>;
+
+
 const c573 = [
   {
     title: "职责要求",
@@ -62,9 +75,9 @@ const c573 = [
       {
         title: "关键区域",
         content: [
-          { link: "勤务区域", title: "勤务区域" },
-          { link: "交通疏导区域", title: "交通疏导区域" },
-          { link: "巡防线路", title: "巡防线路" },
+          { type: 'point', link: "勤务区域", title: "勤务区域" },
+          { type: 'point', link: "交通疏导区域", title: "交通疏导区域" },
+          { type: 'point', link: "巡防线路", title: "巡防线路" },
           { link: "保安室", title: "保安室" },
           { link: "医务室", title: "医务室" },
           { link: "防爆装备", title: "防爆装备" },
@@ -75,13 +88,17 @@ const c573 = [
       {
         title: "校园周边",
         content: [
-          { link: "警用汽车停放位置", title: "警用汽车停放位置" },
+          {
+            link: "警用汽车停放位置",
+            title: "警用汽车停放位置",
+            type: "point",
+          },
           {
             link: "两轮车停放区域",
             title: "摩托车、电动自行车、自行车停放位置",
           },
-          { link: "违停区域", title: "违停区域" },
-          { link: "禁行路段", title: "禁行路段" },
+          { link: "违停区域", title: "违停区域", type: "point" },
+          { link: "禁行路段", title: "禁行路段", type: "point" },
         ],
       },
     ],
@@ -214,9 +231,9 @@ const c585 = [
       {
         title: "关键区域",
         content: [
-          { title: "勤务区域", link: "勤务区域" },
-          { title: "交通疏导区域 ", link: "交通疏导区域" },
-          { title: "巡防线路", link: "巡防线路" },
+          { type: 'point', title: "勤务区域", link: "勤务区域" },
+          { type: 'point', title: "交通疏导区域 ", link: "交通疏导区域" },
+          { type: 'point', title: "巡防线路", link: "巡防线路" },
           { title: "保安室", link: "保安室" },
           { title: "医务室", link: "医务室" },
           { title: "防爆装备", link: "防爆装备" },
@@ -227,12 +244,17 @@ const c585 = [
       {
         title: "市场周边",
         content: [
-          { title: "警用汽车停放位置", link: "警用汽车停放位置" },
+          {
+            title: "警用汽车停放位置",
+            link: "警用汽车停放位置",
+            type: "point",
+          },
           {
             title: "摩托车、电动自行车、自行车停放位置",
             link: "两轮车停放区域",
+            type: "point",
           },
-          { title: "违停区域", link: "违停区域" },
+          { title: "违停区域", link: "违停区域", type: "point" },
         ],
       },
     ],
@@ -358,9 +380,9 @@ const c584 = [
       {
         title: "关键区域",
         content: [
-          { title: "勤务区域", link: "勤务区域" },
-          { title: "交通疏导区域 ", link: "交通疏导区域" },
-          { title: "巡防路线", link: "巡防路线" },
+          { type: 'point', title: "勤务区域", link: "勤务区域" },
+          { type: 'point', title: "交通疏导区域 ", link: "交通疏导区域" },
+          { type: 'point', title: "巡防路线", link: "巡防路线" },
           { title: "保安室", link: "保安室" },
           { title: "医务室", link: "医务室" },
           { title: "防爆装备", link: "防爆装备" },
@@ -371,12 +393,17 @@ const c584 = [
       {
         title: "市场周边",
         content: [
-          { title: "警用汽车停放位置", link: "警用汽车停放区域" },
+          {
+            title: "警用汽车停放位置",
+            link: "警用汽车停放区域",
+            type: "point",
+          },
           {
             title: "摩托车、电动自行车、自行车停放位置",
             link: "两轮车停放区域",
+            type: "point",
           },
-          { title: "违停区域", link: "违停区域" },
+          { title: "违停区域", link: "违停区域", type: "point" },
         ],
       },
     ],
@@ -460,4 +487,4 @@ export default {
   573: c573,
   585: c585,
   584: c584,
-};
+} as SStore;

+ 3 - 3
src/views/security/index.vue

@@ -17,7 +17,7 @@
           <div class="content">
             <p v-for="c in item.content" :class="{ link: c.link, zk: kzs.includes(c) }">
               {{ kzs.includes(c) ? c.zk : c.title }}
-              <Link :name="c.link" v-if="c.link" :fly-link="flyLink" />
+              <Link :name="c.link" v-if="c.link" :fly-link="flyLink" :type="c.type" />
               <span
                 class="mspan fun-ctrl"
                 v-else-if="c.zk"
@@ -41,9 +41,9 @@ import { data, flyLink as flyLinkRaw } from "./store";
 import Link from "./link.vue";
 
 const isFull = ref(false);
-const flyLink = async (name: string) => {
+const flyLink = async (name: string, type?: string) => {
   isFull.value = true;
-  await flyLinkRaw(name);
+  await flyLinkRaw(name, type);
   isFull.value = false;
 };
 

+ 10 - 6
src/views/security/link.vue

@@ -1,5 +1,5 @@
 <template>
-  <img :src="getLinkAttr(name)" v-if="getLinkAttr(name)" @click="cflyLink(name)" />
+  <img :src="getLinkAttr(name, type)" v-if="getLinkAttr(name, type)" @click="cflyLink" />
 
   <Preview
     :items="items"
@@ -15,13 +15,17 @@ import { ref } from "vue";
 import { getLinkAttr } from "./store";
 import { Preview, MediaItem } from "@/components/static-preview/index.vue";
 
-const props = defineProps<{ name: string; flyLink: (name: string) => void }>();
+const props = defineProps<{
+  name: string;
+  flyLink: (name: string, type?: string) => void;
+  type?: string;
+}>();
 const items = ref<MediaItem[]>([]);
-const cflyLink = (name: string) => {
-  if (name.includes("://")) {
-    items.value.push({ url: name });
+const cflyLink = () => {
+  if (props.name.includes("://")) {
+    items.value.push({ url: props.name });
   } else {
-    props.flyLink(name);
+    props.flyLink(props.name, props.type);
   }
 };
 </script>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 17 - 89
src/views/security/store.ts