shaogen1995 4 lat temu
rodzic
commit
11c25af9da

+ 1 - 1
src/views/tab1/index.vue

@@ -67,7 +67,7 @@
           </el-table-column>
           <el-table-column prop="application" label="展示形式" width="150">
           </el-table-column>
-          <el-table-column prop="updateTime" label="项目时间" width="180">
+          <el-table-column prop="age" label="项目时间" width="180">
           </el-table-column>
           <el-table-column prop="level" label="保密级别" width="120"></el-table-column>
           <el-table-column label="操作" width="230">

+ 24 - 1
src/views/tab1/tab1_add.vue

@@ -14,7 +14,7 @@
             :class="{ active: topTabInd === index }"
             @click="tabCut(index)"
           >
-            <a :href="item.id">{{ item.name }}</a>
+            <a href="javascript:;">{{ item.name }}</a>
           </li>
         </ul>
       </div>
@@ -384,6 +384,22 @@ export default {
     },
     // 上面的tab栏切换
     tabCut (index) {
+      const tabAll = document.querySelector('.tabAll')
+      const tab0 = document.querySelector('#tab0')
+      const tab1 = document.querySelector('#tab1')
+      const tab2 = document.querySelector('#tab2')
+      const tab3 = document.querySelector('#tab3')
+      if (index === 0 && this.topTabInd !== index) {
+        tabAll.scrollTop = 0
+      } else if (index === 1 && this.topTabInd !== index) {
+        tabAll.scrollTop = tab0.offsetHeight + 10
+      } else if (index === 2 && this.topTabInd !== index) {
+        tabAll.scrollTop = tab0.offsetHeight + tab1.offsetHeight + 20
+      } else if (index === 3 && this.topTabInd !== index) {
+        tabAll.scrollTop = tab0.offsetHeight + tab1.offsetHeight + tab2.offsetHeight + 30
+      } else if (index === 4 && this.topTabInd !== index) {
+        tabAll.scrollTop = tab0.offsetHeight + tab1.offsetHeight + tab2.offsetHeight + tab3.offsetHeight + 40
+      }
       this.topTabInd = index
     },
     // 点击添加网址
@@ -394,6 +410,8 @@ export default {
       ) {
         return this.$message.warning('网址名称或链接不能为空')
       }
+      if (this.tab1Arr[this.tab1Arr.length - 1].name.length > 32) return this.$message.warning('网址名称不能超过32个字')
+      if (this.tab1Arr[this.tab1Arr.length - 1].href.length > 128) return this.$message.warning('网址链接不能超过128个字')
       this.tab1Arr.push({ name: '', href: '' })
     },
     tab1Del (index) {
@@ -471,6 +489,9 @@ export default {
       if (this.ruleForm.name.trim() === '') {
         return this.$message.warning('项目名称不能为空')
       }
+      if (this.ruleForm.name.length > 32) return this.$message.warning('项目名称不能超过32个字')
+      if (this.ruleForm.age.length > 32) return this.$message.warning('项目时间不能超过32个字')
+      if (this.ruleForm.cooperation.length > 32) return this.$message.warning('项目合作方不能超过32个字')
       // 遍历文物数组,得到文物id
       const temp = []
       this.saveAntiqueArr.forEach((v) => {
@@ -840,6 +861,7 @@ export default {
       box-shadow: 0px 0px 5px 0px;
       height: 110px;
       background-color: #d8dadc;
+      margin-bottom: 10px;
       ul {
         margin-top: 15px;
         display: flex;
@@ -986,6 +1008,7 @@ export default {
       }
     }
     .tabAll {
+      border-radius: 10px;
       max-height: 600px;
       overflow-y: auto;
     }

+ 6 - 0
src/views/tab1/tab1_edit.vue

@@ -616,6 +616,9 @@ export default {
       ) {
         return this.$message.warning('网址名称或链接不能为空')
       }
+      if (this.tab1Arr[this.tab1Arr.length - 1].name.length > 32) return this.$message.warning('网址名称不能超过32个字')
+      if (this.tab1Arr[this.tab1Arr.length - 1].href.length > 128) return this.$message.warning('网址链接不能超过128个字')
+
       this.tab1Arr.push({ name: '', url: '', id: null })
     },
     tab1Del (index, id) {
@@ -665,6 +668,9 @@ export default {
         if (this.ruleForm.name.trim() === '') {
           return this.$message.warning('项目名称不能为空')
         }
+        if (this.ruleForm.name.length > 32) return this.$message.warning('项目名称不能超过32个字')
+        if (this.ruleForm.age.length > 32) return this.$message.warning('项目时间不能超过32个字')
+        if (this.ruleForm.cooperation.length > 32) return this.$message.warning('项目合作方不能超过32个字')
         const res = await projectEdit1(this.ruleForm)
         if (res.code === 0) {
           this.$message.success('项目详情编辑成功')

+ 24 - 3
src/views/tab1/tab1_look.vue

@@ -9,7 +9,7 @@
         <div class="txt">{{tab0Data.name}}</div>
         <ul>
           <li v-for="(item,index) in topTab" :key="index" :class="{active:topTabInd===index}" @click="tabCut(index)">
-            <a :href="item.id">{{item.name}}</a>
+            <a href="javascript:;">{{item.name}}</a>
             </li>
         </ul>
       </div>
@@ -27,11 +27,13 @@
       </div>
       <div id="tab1" class="conten_box">
         <div class="title">项目网址</div>
-        <div class="row" v-for="item in tab1Data" :key="item.id"><div>{{item.name?item.name:'暂无'}}:</div><a :href="item.url" target="_blank">{{item.url?item.url:'暂无'}}</a></div>
+        <div class="row" v-show="item.name&&item.url" v-for="item in tab1Data" :key="item.id"><div>{{item.name}}:</div><a :href="item.url" target="_blank">{{item.url}}</a></div>
+        <div class="noData" v-if="tab1Data.length===1&&tab1Data[0].name===''&&tab1Data[0].url===''">暂无数据</div>
       </div>
       <div id="tab2" class="conten_box">
         <div class="title">三维场景</div>
-        <div class="row" v-for="item in tab2Data" :key="item.id"><div>{{item.name?item.name:'暂无'}}:</div><a :href="item.url" target="_blank">{{item.url?item.url:'暂无'}}</a></div>
+        <div class="row" v-show="item.name&&item.url" v-for="item in tab2Data" :key="item.id"><div>{{item.name}}:</div><a :href="item.url" target="_blank">{{item.url}}</a></div>
+        <div class="noData" v-if="tab2Data.length===1&&tab2Data[0].name===''&&tab2Data[0].url===''">暂无数据</div>
       </div>
       <div id="tab3" class="conten_box">
         <div class="title">资料文档</div>
@@ -103,6 +105,22 @@ export default {
       })
     },
     tabCut (index) {
+      const tabAll = document.querySelector('.tabAll')
+      const tab0 = document.querySelector('#tab0')
+      const tab1 = document.querySelector('#tab1')
+      const tab2 = document.querySelector('#tab2')
+      const tab3 = document.querySelector('#tab3')
+      if (index === 0 && this.topTabInd !== index) {
+        tabAll.scrollTop = 0
+      } else if (index === 1 && this.topTabInd !== index) {
+        tabAll.scrollTop = tab0.offsetHeight + 10
+      } else if (index === 2 && this.topTabInd !== index) {
+        tabAll.scrollTop = tab0.offsetHeight + tab1.offsetHeight + 20
+      } else if (index === 3 && this.topTabInd !== index) {
+        tabAll.scrollTop = tab0.offsetHeight + tab1.offsetHeight + tab2.offsetHeight + 30
+      } else if (index === 4 && this.topTabInd !== index) {
+        tabAll.scrollTop = tab0.offsetHeight + tab1.offsetHeight + tab2.offsetHeight + tab3.offsetHeight + 40
+      }
       this.topTabInd = index
     }
   },
@@ -119,6 +137,7 @@ export default {
     this.tab0Data.application = this.myApplication(this.tab0Data.application)
     this.tab0Data.level = this.myLevel(this.tab0Data.level)
     this.tab1Data = res.data.website
+    // console.log(999, this.tab1Data.length, this.tab1Data[0].name, this.tab1Data[0].url)
     this.tab2Data = res.data.scene
     this.tab3Data = res.data.doc
     this.tab4Data = res.data.goods
@@ -174,6 +193,7 @@ export default {
       border-bottom: 1px solid #A3A2A9;
     }
     .search {
+      margin-bottom: 10px;
       position: relative;
       padding: 15px 20px 0;
       border-radius: 5px;
@@ -281,6 +301,7 @@ export default {
 
     }
     .tabAll{
+      border-radius: 10px;
       max-height: 600px;
       overflow-y: auto;
     }

+ 1 - 1
src/views/tab3/index.vue

@@ -55,7 +55,7 @@
             <span style="cursor: pointer;" @click="jump(row.projectId)">{{row.projectName}}</span>
           </el-table-column>
           <el-table-column prop="projectTypeName" label="所属项目分类" width="160"></el-table-column>
-          <el-table-column prop="updateTime" label="项目时间" width="180"> </el-table-column>
+          <el-table-column prop="age" label="项目时间" width="180"> </el-table-column>
           <el-table-column label="链接" #default="{ row }">
             <a :href="row.url" target="_blank">{{ row.url }}</a>
           </el-table-column>