shaogen1995 2 tahun lalu
induk
melakukan
c44612c2c5

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

@@ -65,7 +65,7 @@
           <span v-else>{{ scope.row[item.prop] || item.default || "-" }}</span>
         </template>
       </el-table-column>
-
+      <slot name="website" ></slot>
       <slot name="operate" ></slot>
     </el-table>
     <div class="e-pagination">

+ 54 - 7
backstage/src/pages/content/collection/componets/img.vue

@@ -2,7 +2,7 @@
   <div style="width: 50%">
     <el-form-item label="藏品名称:" prop="name">
       <el-input
-       class="goodNameInput"
+        class="goodNameInput"
         v-model="form.name"
         :maxlength="80"
         show-word-limit
@@ -74,7 +74,7 @@
       ></el-input>
     </el-form-item>
 
-    <el-form-item label="封面图片:" prop="thumb">
+    <!-- <el-form-item label="封面图片:" prop="thumb">
       <div v-if="!form.museumId">请选择所属博物馆</div>
       <uploadThumb
         v-else
@@ -87,7 +87,7 @@
         "
         :thumb="form.thumb"
       />
-    </el-form-item>
+    </el-form-item> -->
 
     <el-form-item label="图片:" prop="thumb">
       <div v-if="!form.museumId">请选择所属博物馆</div>
@@ -112,7 +112,20 @@
                 circle
               ></el-button>
             </div>
+
+            <!-- 选择封面图片的 -->
+            <div
+              @click="form.thumb = item.filePath"
+              class="selectThumb"
+              :class="{ selectActive: item.filePath === form.thumb }"
+            >
+              <div class="inco"></div>
+              <div>
+                {{ item.filePath === form.thumb ? "封面图片" : "设为封面" }}
+              </div>
+            </div>
           </li>
+
           <li>
             <uploadImg
               id="uli"
@@ -130,14 +143,15 @@
 
 <script>
 import uploadImg from "./plugin/uploadimg.vue";
-import uploadThumb from "@/components/uploadThumb";
+// import uploadThumb from "@/components/uploadThumb";
 
 import { delImg } from "@/configue/api";
 
 export default {
   name: "imgCom",
   props: ["data", "rule", "filelist", "ageList", "textureList", "museumList"],
-  components: { uploadImg, uploadThumb },
+  // components: { uploadImg, uploadThumb },
+  components: { uploadImg },
   data() {
     return {
       form: this.data,
@@ -189,6 +203,7 @@ export default {
 
     updateImg(data) {
       console.log(data);
+      if (!this.form.thumb) this.form.thumb = data.filePath;
 
       this.filelist.push({
         ...data,
@@ -201,16 +216,48 @@ export default {
 
 <style lang="less" scoped>
 @gap: 20px;
-
+.selectThumb {
+  position: absolute;
+  bottom: -28px;
+  left: 0;
+  width: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  cursor: pointer;
+  .inco {
+    margin-right: 15px;
+    width: 16px;
+    height: 16px;
+    border: 1px solid #ccc;
+  }
+}
+.selectActive {
+  pointer-events: none;
+  color: #b63c25;
+  .inco {
+    position: relative;
+    &::before {
+      content: "";
+      position: absolute;
+      width: 8px;
+      height: 8px;
+      margin: 3px;
+      background-color: #b63c25;
+    }
+  }
+}
 .tuku {
   display: flex;
   margin-bottom: @gap;
   flex-wrap: wrap;
 
   li {
+    position: relative;
     width: 180px;
+    height: 190px;
     margin-right: @gap;
-    margin-bottom: @gap;
+    margin-bottom: 30px;
 
     .imgcon {
       cursor: pointer;

+ 11 - 12
backstage/src/pages/content/museum/componets/detail.vue

@@ -6,7 +6,7 @@
           <el-input
             v-model="form.num"
             maxlength="4"
-            :onkeyup="form.num=form.num.replace(/^(0+)|[^\d]+/g,'')"
+            :onkeyup="(form.num = form.num.replace(/^(0+)|[^\d]+/g, ''))"
             show-word-limit
           ></el-input>
         </el-form-item>
@@ -38,7 +38,7 @@
         </el-form-item>
       </div>
       <div class="right">
-        <el-form-item label="纬度:" prop="lat">
+        <el-form-item label="纬度:">
           <el-input
             :onkeyup="(form.lat = form.lat.replace(/^(0+)|[^\d\.]+/g, ''))"
             v-model="form.lat"
@@ -47,7 +47,7 @@
           ></el-input>
         </el-form-item>
 
-        <el-form-item label="经度:" prop="lng">
+        <el-form-item label="经度:">
           <el-input
             :onkeyup="(form.lng = form.lng.replace(/^(0+)|[^\d\.]+/g, ''))"
             v-model="form.lng"
@@ -73,7 +73,7 @@
           </el-select>
         </el-form-item>
 
-        <el-form-item label="营业时间:" prop="opening">
+        <el-form-item label="营业时间:">
           <el-input
             v-model="form.opening"
             type="textarea"
@@ -82,7 +82,7 @@
           ></el-input>
         </el-form-item>
 
-        <el-form-item label="描述:" prop="description">
+        <el-form-item label="描述:">
           <el-input
             type="textarea"
             maxlength="500"
@@ -115,13 +115,12 @@ export default {
 </script>
 
 <style lang="less" scoped>
-
-  /deep/.el-input__inner {
-    padding-right: 60px;
-  }
-  /deep/.el-input__count-inner {
-    background: transparent;
-  }
+/deep/.el-input__inner {
+  padding-right: 60px;
+}
+/deep/.el-input__count-inner {
+  background: transparent;
+}
 .bs {
   position: absolute;
   z-index: 99;

+ 19 - 0
backstage/src/pages/content/scene/componets/detail.vue

@@ -81,6 +81,20 @@
           />
         </el-form-item>
 
+        <el-form-item label="场景链接:">
+          <el-input
+          class="urlInput"
+            placeholder="请输入场景链接"
+            :maxlength="100"
+            show-word-limit
+            v-model="form.website"
+          ></el-input>
+        </el-form-item>
+
+        <el-form-item label="场景文件:" v-if="form.fileName">
+          <el-input disabled v-model="form.fileName"></el-input>
+        </el-form-item>
+
         <el-form-item label="描述:">
           <el-input
             type="textarea"
@@ -168,6 +182,11 @@ export default {
 </script>
 
 <style lang="less" scoped>
+.urlInput{
+  /deep/.el-input__inner{
+     padding-right: 80px;
+  }
+}
 .formcon {
   width: 100%;
 

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

@@ -21,14 +21,13 @@ let raw = {
       label: "状态",
     },
     {
-      prop: "fileName",
-      label: "场景文件",
-    },
-    {
       prop: "myTime",
       label: "展览时间",
     },
-
+    {
+      prop: "fileName",
+      label: "场景文件",
+    },
   ]
 }
 

+ 20 - 0
backstage/src/pages/content/scene/index.vue

@@ -61,6 +61,25 @@
             "
             :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>
+
             <el-table-column slot="operate" label="操作" width="190">
               <template slot-scope="scope">
                 <el-upload
@@ -153,6 +172,7 @@ export default {
       this.loading.close();
       let { data } = res;
       this.$emit("update", data.filePath);
+      this.getList();
     },
     uploadZip() {},
     getList() {

+ 4 - 4
backstage/src/pages/system/dict/data.js

@@ -1,9 +1,9 @@
 let raw = {
   scene: [
-    {
-      prop: "id",
-      label: "字典键值",
-    },
+    // {
+    //   prop: "id",
+    //   label: "字典键值",
+    // },
     {
       prop: "name",
       label: "字典名称",

+ 62 - 48
code/src/views/home/list.vue

@@ -1,22 +1,37 @@
 <template>
   <div class="museum-list">
     <div class="mcon">
-      <p v-if="list.length>0">{{list[0].cityName}} {{currentId === 'museum' ? '博物馆' : '虚拟场景'}}数量:{{list.length}}</p>
+      <p v-if="list.length > 0">
+        {{ list[0].cityName }}
+        {{ currentId === "museum" ? "博物馆" : "虚拟场景" }}数量:{{
+          list.length
+        }}
+      </p>
       <ul>
-        <li @click="onClickItem(item)" v-for="(item,i) in list" :key="i"
+        <li
+          @click="onClickItem(item)"
+          v-for="(item, i) in list"
+          :key="i"
           :title="item.name"
         >
-          {{item.name}}
+          <span v-show="item.museumName">{{ item.museumName }}-</span>
+          {{ item.name }}
         </li>
       </ul>
     </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>
@@ -27,62 +42,64 @@
 <script setup>
 import { ref, onMounted, watch, nextTick } from "vue";
 import { getMuseumList, getExhibitionList } from "@/config/api";
-import { useRoute,useRouter } from "vue-router";
+import { useRoute, useRouter } from "vue-router";
 
 const route = useRoute();
 const router = useRouter();
 
-const currentId = ref('')
+const currentId = ref("");
 
-const list = ref([])
+const list = ref([]);
 
 const onClickSelect = (data) => {
-  currentId.value = data.id
-}
+  currentId.value = data.id;
+};
 
-const onClickItem = data => {
-  if (currentId.value === 'museum') {
-    if (data.name === '广东省博物馆') {
-      router.push({name: 'gdmuseum'})
+const onClickItem = (data) => {
+  if (currentId.value === "museum") {
+    if (data.name === "广东省博物馆") {
+      router.push({ name: "gdmuseum" });
     } else {
-      router.push({name:'exhibition',query:{id:data.id}})
+      router.push({ name: "exhibition", query: { id: data.id } });
     }
   } else {
-    router.push({name:'zhanlan',params:{id:data.id}})
+    router.push({ name: "zhanlan", params: { id: data.id } });
   }
-}
+};
 
 const getList = () => {
-  let getData = currentId.value == 'museum' ? getMuseumList : getExhibitionList
-  getData({
-    "cityId": route.params.id,
-    "pageNum": 1,
-    "pageSize": 1000,
-    "searchKey": ""
-  }, data => {
-    list.value = data.data.records
-  })
-}
+  let getData = currentId.value == "museum" ? getMuseumList : getExhibitionList;
+  getData(
+    {
+      cityId: route.params.id,
+      pageNum: 1,
+      pageSize: 1000,
+      searchKey: "",
+    },
+    (data) => {
+      list.value = data.data.records;
+    }
+  );
+};
 
 watch(currentId, () => {
-  getList()
-})
+  getList();
+});
 
 onMounted(() => {
   if (route.query.type) {
-    currentId.value = route.query.type
-    router.replace({name: route.name, query: {}})
+    currentId.value = route.query.type;
+    router.replace({ name: route.name, query: {} });
   } else {
-    currentId.value = 'museum'
+    currentId.value = "museum";
   }
-  getList()
-})
-
+  getList();
+});
 </script>
 
 <style lang="scss" scoped>
 .museum-list {
-  background: #E8E3D1;
+  background: #e8e3d1;
   color: #333333;
 
   .mcon {
@@ -90,16 +107,15 @@ onMounted(() => {
     margin: 0 auto;
     padding-top: 50px;
 
-
-    >p {
+    > p {
       font-size: 24px;
     }
 
-    >ul {
+    > ul {
       display: flex;
       flex-wrap: wrap;
 
-      >li {
+      > li {
         width: 270px;
         height: 50px;
         margin: 40px 104px 0 0;
@@ -139,13 +155,13 @@ onMounted(() => {
     transform: translateX(-50%);
     color: #fff;
 
-    >li {
+    > li {
       display: flex;
       align-items: center;
       margin: 0 40px;
       cursor: pointer;
 
-      >span {
+      > span {
         margin-right: 6px;
         display: inline-block;
 
@@ -159,7 +175,7 @@ onMounted(() => {
       }
 
       &.active {
-        >span {
+        > span {
           &:first-of-type {
             &::before {
               content: "";
@@ -180,7 +196,6 @@ onMounted(() => {
 }
 
 @media screen and (max-width: 1000px) {
-
   .museum-list {
     color: #333333;
     width: 100%;
@@ -189,16 +204,16 @@ onMounted(() => {
       width: 90%;
       padding-top: 20px;
 
-      >p {
+      > p {
         font-size: 18px;
       }
 
-      >ul {
+      > ul {
         display: flex;
         flex-wrap: wrap;
         justify-content: space-between;
 
-        >li {
+        > li {
           width: 48%;
           height: 40px;
           margin: 10px 0;
@@ -221,6 +236,5 @@ onMounted(() => {
       }
     }
   }
-
 }
 </style>