Browse Source

修改数据加载中

zs 8 months ago
parent
commit
1a68cbff5b

BIN
public/images/friend.jpeg


+ 17 - 2
src/views/center/demand.vue

@@ -69,8 +69,9 @@
             </template>
           </custom-form>
         </el-col>
+        <!-- 加载界面 -->
         <transition name="why">
-          <el-col :span="24" v-if="dialog.type == '2'" class="dialog">
+          <el-col :span="24" v-if="dialog.type == '2'" class="dialog" v-loading="isLoading" element-loading-text="数据加载中..." :element-loading-svg="svg" element-loading-svg-view-box="-10,-10,50,50">
             <div class="list" v-for="(item, index) in supplyList" :key="index" @click="toView(item)">
               <h2 class="name textMore">
                 <span>{{ item.name || '暂无' }}</span>
@@ -120,7 +121,17 @@ const sectorStore = SectorStore()
 const supplyStore = SupplyStore()
 // 加载中
 const loading = ref(false)
-
+const isLoading = ref(false)
+const svg = ref(`
+          <path class="path" d="
+            M 30 15
+            L 28 17
+            M 25.61 25.61
+            A 15 15, 0, 0, 1, 15 30
+            A 15 15, 0, 1, 1, 27.99 7.5
+            L 15 15
+          " style="stroke-width: 4px; fill: rgba(0, 0, 0, 0)"/>
+        `)
 const router = useRouter()
 
 const searchForm = ref({})
@@ -306,9 +317,13 @@ const toExam = async (row) => {
 }
 // 供给列表查询
 const searchSupply = async () => {
+  isLoading.value = true
   const info = { skip: 0, limit: 5, is_use: '0', status: '1' }
   const res = await supplyStore.query(info)
   if (res.errcode == '0') supplyList.value = res.data
+  setTimeout(() => {
+    isLoading.value = false
+  }, 3000) // 假设3秒后加载完成
 }
 // 查看详情
 const toView = (item) => {

+ 16 - 1
src/views/center/project.vue

@@ -78,7 +78,7 @@
           </custom-form>
         </el-col>
         <transition name="why">
-          <el-col :span="24" v-if="dialog.type == '2'" class="dialog">
+          <el-col :span="24" v-if="dialog.type == '2'" class="dialog" v-loading="isLoading" element-loading-text="数据加载中..." :element-loading-svg="svg" element-loading-svg-view-box="-10,-10,50,50">
             <div class="list" v-for="(item, index) in demandList" :key="index" @click="toView(item)">
               <h2 class="name textMore">
                 <span>{{ item.name || '暂无' }}</span>
@@ -129,6 +129,17 @@ const sectorStore = SectorStore()
 const demandStore = DemandStore()
 // 加载中
 const loading = ref(false)
+const isLoading = ref(false)
+const svg = ref(`
+          <path class="path" d="
+            M 30 15
+            L 28 17
+            M 25.61 25.61
+            A 15 15, 0, 0, 1, 15 30
+            A 15 15, 0, 1, 1, 27.99 7.5
+            L 15 15
+          " style="stroke-width: 4px; fill: rgba(0, 0, 0, 0)"/>
+        `)
 const router = useRouter()
 const searchForm = ref({})
 // 列表
@@ -309,9 +320,13 @@ const toExam = async (row) => {
 }
 // 需求列表查询
 const searchDemand = async () => {
+  isLoading.value = true
   const info = { skip: 0, limit: 5, is_use: '0', status: '1' }
   const res = await demandStore.query(info)
   if (res.errcode == '0') demandList.value = res.data
+  setTimeout(() => {
+    isLoading.value = false
+  }, 3000) // 假设3秒后加载完成
 }
 // 查看详情
 const toView = (item) => {

+ 16 - 1
src/views/center/supply.vue

@@ -70,7 +70,7 @@
           </custom-form>
         </el-col>
         <transition name="why">
-          <el-col :span="24" v-if="dialog.type == '2'" class="dialog">
+          <el-col :span="24" v-if="dialog.type == '2'" class="dialog" v-loading="isLoading" element-loading-text="数据加载中..." :element-loading-svg="svg" element-loading-svg-view-box="-10,-10,50,50">
             <div class="list" v-for="(item, index) in demandList" :key="index" @click="toView(item)">
               <h2 class="name textMore">
                 <span>{{ item.name || '暂无' }}</span>
@@ -121,6 +121,17 @@ const sectorStore = SectorStore()
 const demandStore = DemandStore()
 // 加载中
 const loading = ref(false)
+const isLoading = ref(false)
+const svg = ref(`
+          <path class="path" d="
+            M 30 15
+            L 28 17
+            M 25.61 25.61
+            A 15 15, 0, 0, 1, 15 30
+            A 15 15, 0, 1, 1, 27.99 7.5
+            L 15 15
+          " style="stroke-width: 4px; fill: rgba(0, 0, 0, 0)"/>
+        `)
 const router = useRouter()
 const searchForm = ref({})
 // 列表
@@ -299,9 +310,13 @@ const toExam = async (row) => {
 }
 // 需求列表查询
 const searchDemand = async () => {
+  isLoading.value = true
   const info = { skip: 0, limit: 5, is_use: '0', status: '1' }
   const res = await demandStore.query(info)
   if (res.errcode == '0') demandList.value = res.data
+  setTimeout(() => {
+    isLoading.value = false
+  }, 3000) // 假设3秒后加载完成
 }
 // 查看详情
 const toView = (item) => {

+ 6 - 1
src/views/detail/industryDetail.vue

@@ -16,7 +16,11 @@
             </div>
             <div class="list">
               <div class="other_1" v-for="(tag, indexx) in info.partner" :key="indexx">
-                <el-image class="image" :src="getUrl(tag.url)" fit="fill" />
+                <el-image class="image" :src="getUrl(tag.url)" fit="fill">
+                  <template v-slot:error>
+                    <el-image class="image" :src="friend" fit="fill" />
+                  </template>
+                </el-image>
                 <div class="name">{{ tag.name }}</div>
               </div>
             </div>
@@ -28,6 +32,7 @@
 </template>
 
 <script setup>
+import friend from '/images/friend.jpeg'
 import { get } from 'lodash-es'
 import left from '/images/top-left.png'
 import right from '/images/top-right.png'