Kaynağa Gözat

接口对接完成

lrf 3 ay önce
ebeveyn
işleme
7c8e07d9e3

+ 11 - 1
src/api/api.ts

@@ -168,5 +168,15 @@ const zjsw = {
     return res;
   }
 }
+const txtSearch = {
+  query: async (query: any) => {
+    const res = await axios.$get(`/search/query`, query)
+    return res;
+  },
+  fetch: async (content_id: string) => {
+    const res = await axios.$get(`/search/${content_id}`)
+    return res;
+  }
+}
 
-export { common, index, jtjs, jtxw, xxgk, xxgkDetail, myzj, gsxx, zjsw }
+export { common, index, jtjs, jtxw, xxgk, xxgkDetail, myzj, gsxx, zjsw, txtSearch }

+ 16 - 0
src/router/modules/winRouter.ts

@@ -63,6 +63,14 @@ export const winRouter = [
       title: '民意征集',
     },
   },
+  {
+    path: '/popularwillDetail',
+    component: () => import('../../views/win/popularwillDetail.vue'),
+    name: 'popularwillDetail',
+    meta: {
+      title: '民意征集',
+    },
+  },
   {
     path: '/watersupplyIndex',
     component: () => import('../../views/win/watersupplyIndex.vue'),
@@ -103,4 +111,12 @@ export const winRouter = [
       title: '全文检索列表',
     },
   },
+  {
+    path: '/queryDetail',
+    component: () => import('../../views/win/queryDetail.vue'),
+    name: 'queryDetail',
+    meta: {
+      title: '全文检索',
+    },
+  },
 ]

+ 0 - 1
src/views/win/inwaterParts/detail.vue

@@ -13,7 +13,6 @@
         </el-col>
       </el-col>
       <el-col :span="24" class="infoList">
-        <p>{{ viewData.title }}</p>
         <span v-html="viewData.txt"></span>
       </el-col>
     </el-col>

+ 3 - 2
src/views/win/popularwillParts/respondIndex.vue

@@ -21,7 +21,7 @@
           <el-col :span="24" class="other">
             <span>
               发布时间:
-              <span>{{ item.release_date }}</span>
+              <span>{{ tf(item.release_date) }}</span>
             </span>
             <span>
               作者:
@@ -46,6 +46,7 @@
 
 <script setup lang="ts">
 import { ref } from 'vue'
+import {tf} from '@/utils/timeFormat'
 /* 分页 */
 import pagesIndex from '../../../components/windows/pagesIndex.vue'
 
@@ -85,7 +86,7 @@ onMounted(() => {
 const toSearch = async ({ skip = 0, limit = 10, ...info } = {}) => {
   const result = await myzj.rdhy({ skip, limit, ...info })
   if (result.errcode == 0) {
-    const resultList = get(result, 'data', [])
+    const resultList = get(result, 'data.data', [])
     const resultTotal = get(result, 'data.total', 0)
     if (resultList.length > 0) {
       list.value = resultList

+ 69 - 0
src/views/win/queryDetail.vue

@@ -0,0 +1,69 @@
+<template>
+  <el-row class="introduce">
+    <el-col :span="24" class="bigImage"></el-col>
+    <el-col :span="24" class="info">
+      <el-col :span="24" class="menus">
+        <menusIndex />
+      </el-col>
+      <el-col :span="24" class="bottom">
+        <el-col :span="24" class="zero top">
+          <top-index :info="{ title: '全文检索列表', enTitle: 'Full Text Search List' }" />
+        </el-col>
+        <el-col :span="24" class="zero"> 
+          <detail></detail>
+        </el-col>
+        <el-col :span="24" class="foot">
+          <foot-index />
+        </el-col>
+      </el-col>
+    </el-col>
+  </el-row>
+</template>
+<script setup lang="ts">
+// TODO:需要自己排下版
+/* 菜单 */
+import menusIndex from '../../components/windows/menusIndex.vue'
+/* 底部信息 */
+import footIndex from '../../components/windows/footIndex.vue'
+import detail from './queryParts/detail.vue'
+</script>
+<style scoped lang="scss">
+.introduce {
+  position: relative;
+
+  .bigImage {
+    height: 480px;
+    overflow: hidden;
+    background-image: url('/water1.png');
+    background-repeat: no-repeat;
+    background-size: 100% 100%;
+  }
+
+  .info {
+    position: absolute;
+    top: 0;
+    width: 100%;
+    height: 100vh;
+    overflow: hidden;
+
+    .menus {
+      height: 66px;
+      overflow: hidden;
+    }
+
+    .bottom {
+      height: calc(100vh - 66px);
+      overflow-y: auto;
+      margin: 0 auto;
+
+      .zero {
+        margin: 0 0 40px 0;
+      }
+
+      .top {
+        padding: 0 17%;
+      }
+    }
+  }
+}
+</style>

Dosya farkı çok büyük olduğundan ihmal edildi
+ 87 - 0
src/views/win/queryParts/detail.vue


Dosya farkı çok büyük olduğundan ihmal edildi
+ 26 - 56
src/views/win/queryParts/listIndex.vue


+ 10 - 8
src/views/win/watersupplyParts/detail.vue

@@ -7,13 +7,13 @@
             <p class="title">{{ viewData.title }}</p>
           </el-col>
           <el-col :span="24" class="time">
-            <span>发布时间: {{ viewData.time }} </span>
-            <span>作者: {{ viewData.author }} </span>
-            <span> 来源: {{ viewData.source }}</span>
+            <span>发布时间: {{ tf(viewData.release_date) }} </span>
+            <span>作者: {{ viewData.author || '水务集团' }} </span>
+            <span> 来源: {{ viewData.source || '本站原创' }}</span>
             <span> 浏览次数: {{ viewData.views }}</span>
           </el-col>
         </el-row>
-        <span v-html="viewData.txt"></span>
+        <span v-html="getProp(viewData, 'txt.txt')"></span>
       </el-col>
     </el-col>
   </el-row>
@@ -22,10 +22,11 @@
 <script setup lang="ts">
 import { ref, onMounted } from 'vue'
 import { get } from 'lodash-es'
+import { tf } from '@/utils/timeFormat'
 const viewData = ref({
   channel_id: '',
   title: '集团召开2021年度安全生产委员会第一次全体(扩大)视频会议',
-  time: '2024-12-01 12:00:00',
+  release_date: '2024-12-01 12:00:00',
   author: '长春水务集团',
   source: '本站原创',
   views: 200,
@@ -47,11 +48,12 @@ const toSearch = async (id: any) => {
   const result = await gsxx.fetch(id)
   if (result.errcode == 0) {
     const data = get(result, 'data', {})
-    if (Object.keys(data).length > 1) {
-      viewData.value = data
-    }
+    viewData.value = data
   }
 }
+const getProp = (data: object, path: string) => {
+  return get(data, path)
+}
 </script>
 <style scoped lang="scss">
 .main {

+ 3 - 2
src/views/win/watersupplyParts/listIndex.vue

@@ -32,7 +32,7 @@
               {{ item.title }}
             </el-col>
             <el-col :span="4" class="date">
-              {{ item.date }}
+              {{ tf(item.date) }}
             </el-col>
           </el-col>
         </el-col>
@@ -51,7 +51,7 @@ import pagesIndex from '../../../components/windows/pagesIndex.vue'
 import payment from './payment.vue'
 import { get } from 'lodash-es'
 import { ElMessageBox } from 'element-plus'
-
+import { tf } from '@/utils/timeFormat'
 const tabList = ref([
   {
     id: '1',
@@ -171,6 +171,7 @@ const route = useRoute()
 onMounted(() => {
   const id: any = get(route, 'query.tag')
   if (id) dealNowTag(id)
+  else dealNowTag(tabActive.value)
 })
 const toDetail = (data: any) => {
   const content_id = get(data, 'content_id')