shaogen1995 2 年之前
父节点
当前提交
772acb4a9e

+ 1 - 0
backstage/src/components/table/index.vue

@@ -175,6 +175,7 @@ export default {
 .table {
   .e-pagination {
     bottom: 10px;
+    
   }
 }
 </style>

+ 8 - 0
backstage/src/configue/api.js

@@ -393,4 +393,12 @@ export const museumGetCity = () => {
   return axios({
     url: 'cms/museum/getCity',
   })
+}
+
+
+// 删除场景文件
+export const delSceneAPI = (id) => {
+  return axios({
+    url: `cms/exhibition/delScene/${id}`,
+  })
 }

+ 1 - 1
backstage/src/pages/content/museum/data.js

@@ -38,7 +38,7 @@ let rules = {
   detail: {
     num: [{ required: true, message: "不能为空", trigger: "blur" }],
     name: [{ required: true, message: "不能为空", trigger: "blur" }],
-    tel: [{ required: true, message: "不能为空", trigger: "blur" }],
+    // tel: [{ required: true, message: "不能为空", trigger: "blur" }],
     address: [{ required: true, message: "不能为空", trigger: "blur" }],
     opening: [{ required: true, message: "不能为空", trigger: "blur" }],
     lat: [{ required: true, message: "不能为空", trigger: "blur" }],

+ 4 - 4
backstage/src/pages/content/scene/data.js

@@ -24,10 +24,10 @@ let raw = {
       prop: "myTime",
       label: "展览时间",
     },
-    {
-      prop: "fileName",
-      label: "场景文件",
-    },
+    // {
+    //   prop: "fileName",
+    //   label: "场景文件",
+    // },
   ]
 }
 

+ 52 - 19
backstage/src/pages/content/scene/index.vue

@@ -61,24 +61,40 @@
             "
             :tableData="list"
           >
-            <el-table-column slot="website" label="场景链接" width="190">
-              <template slot-scope="scope">
-                <a
-                  style="text-decoration: none"
-                  :href="scope.row.website"
-                  target="_blank"
-                  :title="scope.row.website"
-                >
-                  {{
-                    scope.row.website
-                      ? scope.row.website.length > 20
-                        ? scope.row.website.substring(0, 20) + "..."
-                        : scope.row.website
-                      : "-"
-                  }}
-                </a>
-              </template>
-            </el-table-column>
+            <template slot="website">
+              <el-table-column label="场景文件" width="190">
+                <template slot-scope="scope">
+                  <div style="display: flex; align-items: center;justify-content: center;">
+                    {{ scope.row.fileName ? scope.row.fileName : "-" }}
+                    <i
+                      @click="delFileNameFu(scope.row.id)"
+                      style="font-size: 20px; margin-left: 8px; cursor: pointer"
+                      class="el-icon-circle-close"
+                      v-if="scope.row.fileName"
+                    ></i>
+                  </div>
+                </template>
+              </el-table-column>
+
+              <el-table-column label="场景链接" width="190">
+                <template slot-scope="scope">
+                  <a
+                    style="text-decoration: none"
+                    :href="scope.row.website"
+                    target="_blank"
+                    :title="scope.row.website"
+                  >
+                    {{
+                      scope.row.website
+                        ? scope.row.website.length > 20
+                          ? scope.row.website.substring(0, 20) + "..."
+                          : scope.row.website
+                        : "-"
+                    }}
+                  </a>
+                </template>
+              </el-table-column>
+            </template>
 
             <el-table-column slot="operate" label="操作" width="190">
               <template slot-scope="scope">
@@ -115,7 +131,7 @@ import MainTop from "@/components/main-top";
 import search from "@/components/search";
 import vtable from "@/components/table";
 import { raw } from "./data";
-import { getMuseumAllList } from "@/configue/api";
+import { getMuseumAllList, delSceneAPI } from "@/configue/api";
 import { mapGetters } from "vuex";
 
 export default {
@@ -143,6 +159,23 @@ export default {
     vtable,
   },
   methods: {
+    // 点击删除场景文件
+    delFileNameFu(id) {
+      this.$confirm("删除后,信息无法恢复,是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          const res = await delSceneAPI(id);
+          if (res.code === 0) {
+            this.$message.success("删除成功");
+            this.getList();
+          } else this.$message.warning(res.msg);
+        })
+        .catch(() => {});
+    },
+
     showLoading() {
       this.loading = this.$loading(this.loadOption);
     },

+ 0 - 1
code/src/components/exItem/index.vue

@@ -41,7 +41,6 @@ const props = defineProps({
 
 
 let onClickExItem = (data) => {
-  console.log(data);
   router.push({ name: 'zhanlan', params: { id: data.id } })
 }
 

+ 8 - 1
code/src/components/maps/index.vue

@@ -13,7 +13,7 @@
       </font>
 
       <vmap />
-      <state :map="map" />
+      <state ref="stateRef" :map="map" />
     </svg>
   </div>
 </template>
@@ -35,9 +35,14 @@ import { map } from "@/data/map.js";
 import { getCityList } from "@/config/api";
 
 const hammer = ref("");
+const stateRef = ref(null);
+
 
 // 给父组件调用的改变地图数据的方法
 const changeMap = (id) => {
+
+  stateRef.value.clearClassFu()
+
   if (id === "scene") mapNumChane("exhibition");
   else mapNumChane("museum");
 };
@@ -59,6 +64,8 @@ const mapNumChane = async (type) => {
 
 
   map.forEach((item) => {
+
+
     if (item.sum == 0) {
       $("#state").find(`g[id="${item.id}"] rect`).css({
         fill: "#999",

文件差异内容过多而无法显示
+ 2079 - 762
code/src/components/maps/state.vue


+ 121 - 91
code/src/views/home/aside.vue

@@ -1,25 +1,37 @@
 <template>
   <div class="aside">
-    <div class="vtitle">{{currentId === 'museum' ? '博物馆列表' : '虚拟场景列表'}}</div>
+    <div class="vtitle">
+      {{ currentId === "museum" ? "博物馆列表" : "虚拟场景列表" }}
+    </div>
     <ul class="select">
-      <li @click="onClickSelect({id:'museum'})" :class="{ active: currentId == 'museum' }">
+      <li
+        @click="onClickSelect({ id: 'museum' })"
+        :class="{ active: currentId == 'museum' }"
+      >
         <span></span>
         <span>博物馆</span>
       </li>
-      <li @click="onClickSelect({id:'scene'})" :class="{ active: currentId == 'scene' }">
+      <li
+        @click="onClickSelect({ id: 'scene' })"
+        :class="{ active: currentId == 'scene' }"
+      >
         <span></span>
         <span>虚拟场景</span>
       </li>
     </ul>
 
     <div class="list">
-      <p class="gd" @click="router.push({name:'gdmuseum'})">广东省博物馆</p>
+      <p class="gd" @click="router.push({ name: 'gdmuseum' })">广东省博物馆</p>
       <section>
         <ul v-if="list.length > 0">
           <li v-for="(sub, idx) in list" :key="idx">
             <p :id="'aside-list-sidebar-' + sub.type">{{ sub.type }}</p>
             <ul v-if="sub.arr.length > 0">
-              <li @click="onClickItem(son)" v-for="(son, sonidx) in sub.arr" :key="sonidx">
+              <li
+                @click="onClickItem(son)"
+                v-for="(son, sonidx) in sub.arr"
+                :key="sonidx"
+              >
                 {{ son.name }}
               </li>
             </ul>
@@ -30,7 +42,11 @@
 
       <div class="sidebar">
         <ul>
-          <li v-for="(item, i) in charStrs" :key="i" @click="onClickSidebarItem(item)">
+          <li
+            v-for="(item, i) in charStrs"
+            :key="i"
+            @click="onClickSidebarItem(item)"
+          >
             {{ item }}
           </li>
         </ul>
@@ -40,104 +56,116 @@
     </div>
 
     <div class="search">
-      <input @keydown.enter="search" v-model="searchkey" type="text" placeholder="请输入关键字查询">
-      <img @click="search" :src="require('@/assets/images/icon/search_red.png')" alt="">
+      <input
+        @keydown.enter="search"
+        v-model="searchkey"
+        type="text"
+        placeholder="请输入关键字查询"
+      />
+      <img
+        @click="search"
+        :src="require('@/assets/images/icon/search_red.png')"
+        alt=""
+      />
     </div>
   </div>
 </template>
 
 <script setup>
-import { ref, onMounted, computed,watch, nextTick } from "vue";
-import { getMuseumList,getExhibitionList } from "@/config/api";
-
+import { ref, onMounted, computed, watch, nextTick } from "vue";
+import { getMuseumList, getExhibitionList } from "@/config/api";
+import { defineExpose } from "vue";
 import { useRouter, useRoute } from "vue-router";
 
 const router = useRouter();
 const route = useRoute();
 
-const isShow = ref(false)
-const currentId = ref('museum')
+const isShow = ref(false);
+const currentId = ref("museum");
 
-const charStrs = ref('')
+const charStrs = ref("");
 
 const list = ref([]);
 
 const emit = defineEmits(["changeMap"]);
 
 const onClickSelect = (data) => {
+  emit("changeMap", data.id);
 
-  emit('changeMap',data.id)
-
-  isShow.value = true
-  currentId.value = data.id
-}
+  isShow.value = true;
+  currentId.value = data.id;
+};
 const onClickSidebarItem = (item) => {
-  const targetNode = document.getElementById('aside-list-sidebar-' + item)
+  const targetNode = document.getElementById("aside-list-sidebar-" + item);
   if (targetNode) {
-    targetNode.scrollIntoView()
+    targetNode.scrollIntoView();
   }
-}
+};
 
-const searchkey = ref('')
+const searchkey = ref("");
 
-const onClickItem = data => {
-  if (currentId.value=='museum') {
-    router.push({name:'exhibition',query:{id:data.id}})
-  }else{
-    router.push({name:'zhanlan',params:{id:data.id}})
+const onClickItem = (data) => {
+  if (currentId.value == "museum") {
+    router.push({ name: "exhibition", query: { id: data.id } });
+  } else {
+    router.push({ name: "zhanlan", params: { id: data.id } });
   }
-}
-
-const getList = () => {
-  let getData = currentId.value == 'museum' ? getMuseumList : getExhibitionList
-  list.value = []
-  getData({
-    "cityId": '',
-    "pageNum": 1,
-    "pageSize": 1000,
-    "searchKey": searchkey.value
-  }, data => {
-    data.data.records.forEach(item => {
-      let ele = list.value.findIndex(sub => sub.type == item.initial.toUpperCase())
-      if (ele < 0) {
-        list.value.push({
-          type: item.initial.toUpperCase(),
-          arr: [
-            { ...item }
-          ],
-        })
-      } else {
-        list.value[ele].arr.push({ ...item })
-      }
-    })
-
-    list.value = list.value.sort((a, b) => {
-      if (a.type < b.type) {
-        return -1;
-      }
-      if (a.type > b.type) {
-        return 1;
-      }
-      return 0;
-    })
+};
+
+const getList = (cityId = "") => {
+  let getData = currentId.value == "museum" ? getMuseumList : getExhibitionList;
+  list.value = [];
+  getData(
+    {
+      cityId: cityId,
+      pageNum: 1,
+      pageSize: 1000,
+      searchKey: searchkey.value,
+    },
+    (data) => {
+      data.data.records.forEach((item) => {
+        let ele = list.value.findIndex(
+          (sub) => sub.type == item.initial.toUpperCase()
+        );
+        if (ele < 0) {
+          list.value.push({
+            type: item.initial.toUpperCase(),
+            arr: [{ ...item }],
+          });
+        } else {
+          list.value[ele].arr.push({ ...item });
+        }
+      });
 
-    charStrs.value = list.value.map(item => item.type)
-  })
-}
+      list.value = list.value.sort((a, b) => {
+        if (a.type < b.type) {
+          return -1;
+        }
+        if (a.type > b.type) {
+          return 1;
+        }
+        return 0;
+      });
 
-const search = ()=>{
-  getList()
-}
+      charStrs.value = list.value.map((item) => item.type);
+    }
+  );
+};
+defineExpose({
+  getList,
+});
 
-watch(currentId,()=>{
-  getList()
-})
+const search = () => {
+  getList();
+};
 
+watch(currentId, () => {
+  getList();
+});
 
 onMounted(() => {
-  getList()
-})
-
+  getList();
+});
 </script>
   
 <style lang="scss" scoped>
@@ -160,13 +188,13 @@ onMounted(() => {
     display: flex;
     margin: 20px 0;
 
-    >li {
+    > li {
       display: flex;
       align-items: center;
       margin-right: 30px;
       cursor: pointer;
 
-      >span {
+      > span {
         margin-right: 6px;
         display: inline-block;
 
@@ -180,7 +208,7 @@ onMounted(() => {
       }
 
       &.active {
-        >span {
+        > span {
           &:first-of-type {
             &::before {
               content: "";
@@ -215,7 +243,7 @@ onMounted(() => {
       cursor: pointer;
       position: relative;
       &::before {
-        content: '';
+        content: "";
         position: absolute;
         left: 0;
         top: 50%;
@@ -228,30 +256,32 @@ onMounted(() => {
       }
     }
 
-    >section {
+    > section {
       height: 95%;
       overflow-y: auto;
-      &::-webkit-scrollbar { display: none; } /*宽度是对垂直滚动条而言,高度是对水平滚动条而言*/
-      >ul {
+      &::-webkit-scrollbar {
+        display: none;
+      } /*宽度是对垂直滚动条而言,高度是对水平滚动条而言*/
+      > ul {
         padding-left: 16px;
 
-        >li {
+        > li {
           margin: 14px 0;
           cursor: pointer;
 
-          >p {
+          > p {
             font-weight: bold;
           }
 
-          >ul {
-            >li {
+          > ul {
+            > li {
               color: #999999;
               margin: 10px 0;
             }
           }
         }
       }
-      .searchNone{
+      .searchNone {
         color: #999999;
         width: 100%;
         height: 100%;
@@ -270,7 +300,7 @@ onMounted(() => {
       right: 10px;
       top: 18px;
 
-      >ul {
+      > ul {
         text-align: center;
         display: flex;
         flex-direction: column;
@@ -278,7 +308,7 @@ onMounted(() => {
         align-items: center;
         height: 100%;
 
-        >li {
+        > li {
           color: #999999;
           font-size: 12px;
           cursor: pointer;
@@ -299,19 +329,19 @@ onMounted(() => {
   .search {
     width: 100%;
     height: 40px;
-    background: #FFFEF6;
+    background: #fffef6;
     border-radius: 8px;
     margin-top: 16px;
     position: relative;
 
-    >input {
+    > input {
       line-height: 40px;
       text-align: left;
       width: 100%;
       padding: 0 40px 0 10px;
     }
 
-    >img {
+    > img {
       cursor: pointer;
       position: absolute;
       right: 10px;

+ 42 - 28
code/src/views/home/index.vue

@@ -1,13 +1,13 @@
 <template>
   <div class="home">
     <div class="map">
-      <maps ref="mapsRef"/>
+      <maps ref="mapsRef" />
     </div>
     <div class="cityname" v-if="currentCity">
-      <p>{{currentCity.name}}</p>
-      <p>{{currentCity.pingyin}}</p>
+      <p>{{ currentCity.name }}</p>
+      <p>{{ currentCity.pingyin }}</p>
     </div>
-    <vaside class="vaside" @changeMap='changeMap'/>
+    <vaside ref="asideRef" class="vaside" @changeMap="changeMap" />
   </div>
 </template>
 
@@ -19,48 +19,62 @@ import { ref, defineEmits, onMounted, watch, computed, nextTick } from "vue";
 import { Loading } from "@/components/UI";
 import { useRouter, useRoute } from "vue-router";
 
-let listType = 'museum'
+let listType = "museum";
 
 // 得到子组件的切换列表信息
 
-const mapsRef =ref(null);
-const changeMap =(id)=>{
-  listType = id
+const mapsRef = ref(null);
+const changeMap = (id) => {
+  listType = id;
   // 把id传给子组件地图
-  console.log(mapsRef.value);
-  mapsRef.value.changeMap(id)
+  // console.log(mapsRef.value);
+  mapsRef.value.changeMap(id);
+
+
+  currentCity.value = "";
   // console.log('------------',id);
-}
+};
 
 const router = useRouter();
 const route = useRoute();
 
-
-const currentCity = ref('')
+const currentCity = ref("");
 
 emitter.on("handleHover", (data) => {
-  currentCity.value = data
+  currentCity.value = data;
 });
 
+const asideRef = ref(null);
+
+
 emitter.on("handleClick", (data) => {
   if (data.num == "&nbsp;0") {
+    return;
+  }
+
+  if (data.name === currentCity.value.name) {
+    currentCity.value = '';
+    // 在次点击取消高亮 返回所有数据
+    asideRef.value.getList('')
     return
   }
-  router.push({
-    name: 'homelist',
-    params: {
-      id:data.rowid
-    },
-    query: {
-      type: listType,
-    }
-  })
+  // 点击筛选当前选中的数据
+  currentCity.value = data;
+  asideRef.value.getList(data.rowid)
+  // router.push({
+  //   name: 'homelist',
+  //   params: {
+  //     id:data.rowid
+  //   },
+  //   query: {
+  //     type: listType,
+  //   }
+  // })
 });
 
 onMounted(() => {
-  Loading.hide()
+  Loading.hide();
 });
-
 </script>
 
 <style lang="scss" scoped>
@@ -87,7 +101,7 @@ onMounted(() => {
     bottom: 10%;
     font-size: 20px;
     text-align: right;
-    >p {
+    > p {
       &:first-of-type {
         font-size: 64px;
         font-weight: bold;
@@ -111,8 +125,8 @@ onMounted(() => {
     transform: translateY(-50%);
     top: 50%;
   }
-
 }
 
-@media screen and (max-width: 1000px) {}
+@media screen and (max-width: 1000px) {
+}
 </style>

+ 136 - 100
code/src/views/home/maside.vue

@@ -2,22 +2,43 @@
   <div class="aside">
     <transition name="fade">
       <div class="vlist" v-if="isShow">
-        <img class="guanbi" @click="isShow=false" :src="require('@/assets/images/icon/guanbi.png')" alt="">
-
-        <div class="vtitle">{{currentId === 'museum' ? '博物馆列表' : '虚拟场景列表'}}</div>
+        <img
+          class="guanbi"
+          @click="isShow = false"
+          :src="require('@/assets/images/icon/guanbi.png')"
+          alt=""
+        />
+
+        <div class="vtitle">
+          {{ currentId === "museum" ? "博物馆列表" : "虚拟场景列表" }}
+        </div>
         <div class="search">
-          <input v-model="searchkey" type="text" placeholder="请输入关键字查询">
-          <img @click="search" :src="require('@/assets/images/icon/search_red.png')" alt="">
+          <input
+            v-model="searchkey"
+            type="text"
+            placeholder="请输入关键字查询"
+          />
+          <img
+            @click="search"
+            :src="require('@/assets/images/icon/search_red.png')"
+            alt=""
+          />
         </div>
 
         <div class="list">
-          <p class="gd"  @click="router.push({name:'gdmuseum'})">广东省博物馆</p>
+          <p class="gd" @click="router.push({ name: 'gdmuseum' })">
+            广东省博物馆
+          </p>
           <section>
             <ul v-if="list.length > 0">
               <li v-for="(sub, idx) in list" :key="idx">
                 <p :id="'aside-list-sidebar-' + sub.type">{{ sub.type }}</p>
                 <ul v-if="sub.arr.length > 0">
-                  <li  @click="onClickItem(son)" v-for="(son, sonidx) in sub.arr" :key="sonidx">
+                  <li
+                    @click="onClickItem(son)"
+                    v-for="(son, sonidx) in sub.arr"
+                    :key="sonidx"
+                  >
                     {{ son.name }}
                   </li>
                 </ul>
@@ -28,7 +49,11 @@
 
           <div class="sidebar">
             <ul>
-              <li v-for="(item, i) in charStrs" :key="i" @click="onClickSidebarItem(item)">
+              <li
+                v-for="(item, i) in charStrs"
+                :key="i"
+                @click="onClickSidebarItem(item)"
+              >
                 {{ item }}
               </li>
             </ul>
@@ -37,117 +62,128 @@
           <div class="sanjiao"></div>
         </div>
       </div>
-
     </transition>
 
     <ul class="select">
-      <li @click="onClickSelect({id:'museum'})" :class="{ active: currentId == 'museum' }">
+      <li
+        @click="onClickSelect({ id: 'museum' })"
+        :class="{ active: currentId == 'museum' }"
+      >
         <span></span>
         <span>博物馆</span>
       </li>
-      <li @click="onClickSelect({id:'scene'})" :class="{ active: currentId == 'scene' }">
+      <li
+        @click="onClickSelect({ id: 'scene' })"
+        :class="{ active: currentId == 'scene' }"
+      >
         <span></span>
         <span>虚拟场景</span>
       </li>
     </ul>
-
-
   </div>
 </template>
 
 <script setup>
-import { ref, onMounted, computed,watch, nextTick } from "vue";
-import { getMuseumList,getExhibitionList } from "@/config/api";
-
+import { ref, onMounted, computed, watch, nextTick } from "vue";
+import { getMuseumList, getExhibitionList } from "@/config/api";
+import { defineExpose } from "vue";
 import { useRouter, useRoute } from "vue-router";
 
 const router = useRouter();
 const route = useRoute();
-const isShow = ref(false)
-const currentId = ref('museum')
-const searchkey = ref('')
+const isShow = ref(false);
+const currentId = ref("museum");
+const searchkey = ref("");
 
-const charStrs = ref('')
+const charStrs = ref("");
 
 const list = ref([]);
 
 const emit = defineEmits(["changeMap"]);
 
-const onClickSelect = (data) => {
-
-emit('changeMap',data.id)
 
-  isShow.value = true
-  currentId.value = data.id
+// 给父组件调用 打开 列表
+const openIsShow =()=>{
+  isShow.value = true;
 }
+
+const onClickSelect = (data) => {
+  emit("changeMap", data.id);
+
+  isShow.value = true;
+  currentId.value = data.id;
+};
 const onClickSidebarItem = (item) => {
-  const targetNode = document.getElementById('aside-list-sidebar-' + item)
+  const targetNode = document.getElementById("aside-list-sidebar-" + item);
   if (targetNode) {
-    targetNode.scrollIntoView()
+    targetNode.scrollIntoView();
   }
-}
+};
 
-const onClickItem = data => {
-  if (currentId.value=='museum') {
-    router.push({name:'exhibition',query:{id:data.id}})
-  }else{
-    router.push({name:'zhanlan',params:{id:data.id}})
+const onClickItem = (data) => {
+  if (currentId.value == "museum") {
+    router.push({ name: "exhibition", query: { id: data.id } });
+  } else {
+    router.push({ name: "zhanlan", params: { id: data.id } });
   }
-}
-
-const getList = () => {
-  let getData = currentId.value == 'museum' ? getMuseumList : getExhibitionList
-  list.value = []
-  getData({
-    "cityId": '',
-    "pageNum": 1,
-    "pageSize": 1000,
-    "searchKey": searchkey.value
-  }, data => {
-    console.log(data);
-
-    data.data.records.forEach(item => {
-      let ele = list.value.findIndex(sub => sub.type == item.initial.toUpperCase())
-      if (ele < 0) {
-        list.value.push({
-          type: item.initial.toUpperCase(),
-          arr: [
-            { ...item }
-          ],
-        })
-      } else {
-        list.value[ele].arr.push({ ...item })
-      }
-    })
-
-    list.value = list.value.sort((a, b) => {
-      if (a.type < b.type) {
-        return -1;
-      }
-      if (a.type > b.type) {
-        return 1;
-      }
-      return 0;
-    })
-
-    charStrs.value = list.value.map(item => item.type)
-  })
-}
+};
+
+const getList = (cityId = "") => {
+  let getData = currentId.value == "museum" ? getMuseumList : getExhibitionList;
+  list.value = [];
+  getData(
+    {
+      cityId: cityId,
+      pageNum: 1,
+      pageSize: 1000,
+      searchKey: searchkey.value,
+    },
+    (data) => {
+
+      data.data.records.forEach((item) => {
+        let ele = list.value.findIndex(
+          (sub) => sub.type == item.initial.toUpperCase()
+        );
+        if (ele < 0) {
+          list.value.push({
+            type: item.initial.toUpperCase(),
+            arr: [{ ...item }],
+          });
+        } else {
+          list.value[ele].arr.push({ ...item });
+        }
+      });
 
-const search = ()=>{
-  getList()
-}
+      list.value = list.value.sort((a, b) => {
+        if (a.type < b.type) {
+          return -1;
+        }
+        if (a.type > b.type) {
+          return 1;
+        }
+        return 0;
+      });
 
-watch(currentId,()=>{
-  getList()
-})
+      charStrs.value = list.value.map((item) => item.type);
+    }
+  );
+};
+defineExpose({
+  getList,
+  openIsShow
+});
 
+const search = () => {
+  getList();
+};
 
+watch(currentId, () => {
+  getList();
+});
 
 onMounted(() => {
-  getList()
-})
-
+  getList();
+});
 </script>
 
 <style lang="scss" scoped>
@@ -180,7 +216,6 @@ onMounted(() => {
       font-weight: bold;
     }
 
-
     .list {
       background-color: #fffef6;
       border-radius: 5px;
@@ -195,11 +230,13 @@ onMounted(() => {
         font-size: 16px;
       }
 
-      >section {
+      > section {
         height: 95%;
         overflow-y: auto;
-        &::-webkit-scrollbar { display: none; } /*宽度是对垂直滚动条而言,高度是对水平滚动条而言*/
-        >p {
+        &::-webkit-scrollbar {
+          display: none;
+        } /*宽度是对垂直滚动条而言,高度是对水平滚动条而言*/
+        > p {
           color: var(--main-color);
           font-size: 16px;
           font-weight: bold;
@@ -220,17 +257,17 @@ onMounted(() => {
           }
         }
 
-        >ul {
-          >li {
+        > ul {
+          > li {
             margin: 14px 0;
             cursor: pointer;
 
-            >p {
+            > p {
               font-weight: bold;
             }
 
-            >ul {
-              >li {
+            > ul {
+              > li {
                 color: #999999;
                 margin: 10px 0;
               }
@@ -257,7 +294,7 @@ onMounted(() => {
         right: 10px;
         top: 18px;
 
-        >ul {
+        > ul {
           text-align: center;
           display: flex;
           flex-direction: column;
@@ -265,7 +302,7 @@ onMounted(() => {
           align-items: center;
           height: 100%;
 
-          >li {
+          > li {
             color: #999999;
             font-size: 12px;
             cursor: pointer;
@@ -287,18 +324,18 @@ onMounted(() => {
       width: 100%;
       height: 40px;
       border-radius: 8px;
-      background: #EBEAE7;
+      background: #ebeae7;
       margin-top: 16px;
       position: relative;
 
-      >input {
+      > input {
         line-height: 40px;
         text-align: left;
         width: 100%;
         padding: 0 40px 0 10px;
       }
 
-      >img {
+      > img {
         position: absolute;
         right: 10px;
         top: 50%;
@@ -320,13 +357,13 @@ onMounted(() => {
     bottom: 0;
     left: 0;
 
-    >li {
+    > li {
       display: flex;
       align-items: center;
       margin: 0 10px;
       cursor: pointer;
 
-      >span {
+      > span {
         margin-right: 6px;
         display: inline-block;
 
@@ -340,7 +377,7 @@ onMounted(() => {
       }
 
       &.active {
-        >span {
+        > span {
           &:first-of-type {
             &::before {
               content: "";
@@ -358,6 +395,5 @@ onMounted(() => {
       }
     }
   }
-
 }
 </style>

+ 46 - 27
code/src/views/home/mobile.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="home">
     <div class="map">
-      <maps ref="mapsRef"/>
+      <maps ref="mapsRef" />
     </div>
-    <vaside class="vaside" @changeMap='changeMap'/>
+    <vaside ref="asideRef" class="vaside" @changeMap="changeMap" />
   </div>
 </template>
 
@@ -16,47 +16,65 @@ import { ref, defineEmits, onMounted, watch, nextTick } from "vue";
 import { Loading } from "@/components/UI";
 import { useRouter, useRoute } from "vue-router";
 
-let listType = 'museum'
+let listType = "museum";
 
 // 得到子组件的切换列表信息
 
-const mapsRef =ref(null);
-const changeMap =(id)=>{
-  listType = id
+const mapsRef = ref(null);
+const changeMap = (id) => {
+  listType = id;
   // 把id传给子组件地图
-  console.log(mapsRef.value);
-  mapsRef.value.changeMap(id)
-  // console.log('------------',id);
-}
+  mapsRef.value.changeMap(id);
+
 
+  currentCity.value = "";
+  // console.log('------------',id);
+};
 
 const router = useRouter();
 
-const currentCity = ref('')
+const currentCity = ref("");
 
 emitter.on("handleHover", (data) => {
-  currentCity.value = data
+  currentCity.value = data;
 });
 
+const asideRef = ref(null);
+
 emitter.on("handleClick", (data) => {
   if (data.num == "&nbsp;0") {
-    return
+    return;
   }
-  router.push({
-    name: 'homelist',
-    params: {
-      id:data.rowid
-    },
-    query: {
-      type: listType,
-    }
-  })
+
+
+  if (data.name === currentCity.value.name) {
+    currentCity.value = "";
+    // 在次点击取消高亮 返回所有数据
+    asideRef.value.getList("");
+
+    return;
+  }
+  // 点击筛选当前选中的数据
+  currentCity.value = data;
+  asideRef.value.getList(data.rowid);
+      // 打开主页列表
+    asideRef.value.openIsShow();
+
+
+  // router.push({
+  //   name: 'homelist',
+  //   params: {
+  //     id:data.rowid
+  //   },
+  //   query: {
+  //     type: listType,
+  //   }
+  // })
 });
 
 onMounted(() => {
-  Loading.hide()
+  Loading.hide();
 });
-
 </script>
 
 <style lang="scss" scoped>
@@ -76,7 +94,7 @@ onMounted(() => {
     width: 100%;
     height: 100%;
 
-    >div {
+    > div {
       width: 100%;
       height: 100%;
     }
@@ -89,7 +107,7 @@ onMounted(() => {
     font-size: 20px;
     text-align: right;
 
-    >p {
+    > p {
       &:first-of-type {
         font-size: 64px;
         font-weight: bold;
@@ -116,5 +134,6 @@ onMounted(() => {
   }
 }
 
-@media screen and (max-width: 1000px) {}
+@media screen and (max-width: 1000px) {
+}
 </style>

+ 43 - 28
code/src/views/zhanlan/index.vue

@@ -1,21 +1,36 @@
 <template>
-    <div
-      class="zhanlan"
-      :class="{
-        mobile: isMobile,
-      }"
-    >
-      <iframe v-if="currentScene && currentScene.filePath && currentScene.fileName" :src="`https://gdbwg.4dage.com${currentScene.filePath}/wwwroot/spg.html?m=${currentScene.fileName.replace('.zip','')}`" frameborder="0"></iframe>
-      <div class="empty-tip" v-else>
-        <img src="@/assets/images/resource/searchNone.svg" alt="no result" draggable="false">
-        <span>暂无展览场景</span>
-        <img
-          class="close"
-          @click="onClickClose"
-          :src="require(`@/assets/images/icon/close.png`)"
-        />
-      </div>
+  <div
+    class="zhanlan"
+    :class="{
+      mobile: isMobile,
+    }"
+  >
+    <iframe
+      v-if="currentScene && currentScene.filePath && currentScene.fileName"
+      :src="`${
+        currentScene.filePath
+      }/wwwroot/spg.html?m=${currentScene.fileName.replace('.zip', '')}`"
+      frameborder="0"
+    ></iframe>
+    <iframe
+      v-else-if="currentScene && currentScene.website"
+      :src="currentScene.website"
+      frameborder="0"
+    ></iframe>
+    <div class="empty-tip" v-else>
+      <img
+        src="@/assets/images/resource/searchNone.svg"
+        alt="no result"
+        draggable="false"
+      />
+      <span>暂无展览场景</span>
+      <img
+        class="close"
+        @click="onClickClose"
+        :src="require(`@/assets/images/icon/close.png`)"
+      />
     </div>
+  </div>
 </template>
 
 <script setup>
@@ -25,27 +40,27 @@ import { useRouter, useRoute } from "vue-router";
 import { throttle } from "@/utils/index.js";
 
 const route = useRoute();
-const router = useRouter()
+const router = useRouter();
 
-const currentScene = ref(null)
+const currentScene = ref(null);
 
-getExhibitionDetail({id:route.params.id},data=>{
-  currentScene.value = data.data
-})
+getExhibitionDetail({ id: route.params.id }, (data) => {
+  currentScene.value = data.data;
+});
 
 const onClickClose = throttle(() => {
-  router.go(-1)
-}, 1000)
+  router.go(-1);
+}, 1000);
 
-import browser from '@/utils/browser'
-const isMobile = ref(false)
+import browser from "@/utils/browser";
+const isMobile = ref(false);
 onMounted(() => {
   if (browser.isMobile()) {
-    isMobile.value = true
+    isMobile.value = true;
   } else {
-    isMobile.value = false
+    isMobile.value = false;
   }
-})
+});
 </script>
 
 <style lang="scss" scoped>