Przeglądaj źródła

update SearchIndex.vue

reghao 7 miesięcy temu
rodzic
commit
d013a046cc
2 zmienionych plików z 98 dodań i 47 usunięć
  1. 3 3
      src/api/search.js
  2. 95 44
      src/views/search/SearchIndex.vue

+ 3 - 3
src/api/search.js

@@ -1,4 +1,4 @@
-import { get, post } from '@/utils/request'
+import { get } from '@/utils/request'
 
 const searchApi = {
   keywordSuggestApi: '/api/search/suggest',
@@ -24,8 +24,8 @@ export function hotKeyword() {
 }
 
 // 搜索裁判文书
-export function wenshuQuery(keyword) {
-  return get(searchApi.wenshuSearchApi + '?search=' + keyword)
+export function wenshuQuery(keyword, pageNumber) {
+  return get(searchApi.wenshuSearchApi + '?keyword=' + keyword + '&pn=' + pageNumber)
 }
 
 export function getWenshuDetail(id) {

+ 95 - 44
src/views/search/SearchIndex.vue

@@ -13,15 +13,15 @@
           @keyup.enter.native="searchHandler"
         >
           <el-select
-            v-model="searchType"
             slot="prepend"
+            v-model="searchType"
             placeholder="请选择"
           >
-            <el-option label="全部" value="1"></el-option>
-            <el-option label="视频" value="2"></el-option>
-            <el-option label="文书" value="3"></el-option>
+            <el-option label="全部" value="1" />
+            <el-option label="视频" value="2" />
+            <el-option label="文书" value="3" />
           </el-select>
-          <el-button slot="append" icon="el-icon-search" @click="searchHandler"></el-button>
+          <el-button slot="append" icon="el-icon-search" @click="searchHandler" />
         </el-input>
         <!---设置z-index优先级,防止被走马灯效果遮挡-->
         <el-card
@@ -67,8 +67,8 @@
               <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
                 <el-card class="box-card">
                   <div slot="header" class="clearfix">
-                    <span>{{ item.title }}</span>
-                    <el-button style="float: right; padding: 5px;" type="text" @click="getWenshuDetail(item.contentId)">查看详情</el-button>
+                    <span v-html="item.caseName" />
+                    <el-button style="float: right; padding: 5px;" type="text" @click="onGetWenshuDetail(item.id)">查看详情</el-button>
                   </div>
                   <div class="text item">
                     <el-row>
@@ -83,19 +83,19 @@
                       <el-col :md="20">
                         <el-row>
                           <div style="padding: 14px">
-                            <span style="left: 0;margin-bottom: 0px;color: black;">{{ item.title }}</span>
+                            <span style="left: 0;margin-bottom: 0px;color: black;">{{ item.caseId }}</span>
                           </div>
                         </el-row>
                         <el-row>
                           <div style="padding: 14px">
-                            <span style="left: 0;margin-bottom: 0px;color: black;">{{ item.excerpt }}</span>
+                            <span style="left: 0;margin-bottom: 0px;color: black;">{{ item.cause }}</span>
                           </div>
                         </el-row>
                       </el-col>
                     </el-row>
                     <el-row>
                       <div style="padding: 14px">
-                        <span style="left: 0;margin-bottom: 0px;color: black;">发布于: {{ item.publishAt }}</span>
+                        <span style="left: 0;margin-bottom: 0px;color: black;">发布于: {{ item.judgmentDate }}</span>
                       </div>
                     </el-row>
                   </div>
@@ -128,27 +128,96 @@
 
     <el-dialog title="裁判文书详情" :visible.sync="wenshuDetailDialog" width="70%" center>
       <el-card v-if="wenshuDetail !== null" :model="wenshuDetail">
-        <el-descriptions class="margin-top" :column="3" border>
+        <el-descriptions class="margin-top" :column="2" border>
+          <el-descriptions-item>
+            <template slot="label">
+              <i class="el-icon-location-outline" />
+              案号
+            </template>
+            <span> {{ wenshuDetail.caseId }} </span>
+          </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label">
               <i class="el-icon-user" />
-              案由
+              案件名称
             </template>
-            <span> {{ wenshuDetail.subject }} </span>
+            <span> {{ wenshuDetail.caseName }} </span>
           </el-descriptions-item>
+        </el-descriptions>
+        <el-descriptions class="margin-top" :column="2" border>
           <el-descriptions-item>
             <template slot="label">
               <i class="el-icon-mobile-phone" />
-              案号
+              法院
             </template>
-            <span> {{ wenshuDetail.typeStr }} </span>
+            <span> {{ wenshuDetail.court }} </span>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label">
+              <i class="el-icon-user" />
+              所属地区
+            </template>
+            <span> {{ wenshuDetail.region }} </span>
+          </el-descriptions-item>
+        </el-descriptions>
+        <el-descriptions class="margin-top" :column="2" border>
+          <el-descriptions-item>
+            <template slot="label">
+              <i class="el-icon-mobile-phone" />
+              案件类型
+            </template>
+            <span> {{ wenshuDetail.caseType }} </span>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label">
+              <i class="el-icon-location-outline" />
+              审理程序
+            </template>
+            <span> {{ wenshuDetail.procedure }} </span>
+          </el-descriptions-item>
+        </el-descriptions>
+        <el-descriptions class="margin-top" :column="2" border>
+          <el-descriptions-item>
+            <template slot="label">
+              <i class="el-icon-mobile-phone" />
+              当事人
+            </template>
+            <span> {{ wenshuDetail.parties }} </span>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label">
+              <i class="el-icon-mobile-phone" />
+              案由
+            </template>
+            <span> {{ wenshuDetail.cause }} </span>
+          </el-descriptions-item>
+        </el-descriptions>
+        <el-descriptions class="margin-top" :column="2" border>
+          <el-descriptions-item>
+            <template slot="label">
+              <i class="el-icon-user" />
+              审判日期
+            </template>
+            <span> {{ wenshuDetail.judgmentDate }} </span>
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label">
               <i class="el-icon-location-outline" />
               发布日期
             </template>
-            <span> {{ wenshuDetail.level }} </span>
+            <span> {{ wenshuDetail.publicDate }} </span>
+          </el-descriptions-item>
+        </el-descriptions>
+        <el-descriptions class="margin-top" :column="1" border>
+          <el-descriptions-item>
+            <template slot="label">
+              <i class="el-icon-user" />
+              法律依据
+            </template>
+            <span v-for="(item, index) in wenshuDetail.legalBasis.split(';')" :key="index">
+              <span>{{ item }}</span>
+              <br>
+            </span>
           </el-descriptions-item>
         </el-descriptions>
         <el-descriptions class="margin-top" :column="1" border>
@@ -157,7 +226,7 @@
               <i class="el-icon-user" />
               文书内容
             </template>
-            <span v-html="wenshuDetail.content" />
+            <span v-html="wenshuDetail.fullText" />
           </el-descriptions-item>
         </el-descriptions>
       </el-card>
@@ -237,7 +306,7 @@ export default {
     this.keyword = this.$route.query.keyword
     this.searchType = this.$route.query.searchType
     this.currentPage = parseInt(this.$route.query.pn)
-    this.videoQueryWrapper(this.keyword, this.currentPage)
+    this.searchHandler()
     document.title = '搜索 - ' + this.keyword
   },
   methods: {
@@ -272,39 +341,23 @@ export default {
       if (this.searchType === '3') {
         this.videoSearch = false
         this.wenshuSearch = true
-        wenshuQuery(this.keyword).then(resp => {
+        wenshuQuery(this.keyword, this.currentPage).then(resp => {
           if (resp.code === 0) {
-            console.log(resp.data)
+            const respData = resp.data
+            this.totalSize = respData.totalSize
+            this.dataList = respData.list
           }
         })
 
-        this.dataList.push(
+        /* this.dataList.push(
           {
             contentId: 111,
             title: 'aaa',
             coverUrl: 'bbb',
             excerpt: 'ccc'
-          },
-          {
-            contentId: 222,
-            title: '222',
-            coverUrl: 'bbb',
-            excerpt: 'ccc'
-          },
-          {
-            contentId: 333,
-            title: '333',
-            coverUrl: 'bbb',
-            excerpt: 'ccc'
-          },
-          {
-            contentId: 444,
-            title: '444',
-            coverUrl: 'bbb',
-            excerpt: 'ccc'
           }
         )
-        this.totalSize = this.dataList.length
+        this.totalSize = this.dataList.length*/
 
         // 随机生成搜索历史tag式样
         const n = RandomUtil.getRandomNumber(0, 5)
@@ -334,12 +387,10 @@ export default {
     removeAllHistory() {
       Store.removeAllHistory()
     },
-    getWenshuDetail(val) {
+    onGetWenshuDetail(val) {
       getWenshuDetail(val).then(resp => {
         if (resp.code === 0) {
-          console.log(resp.data)
-          this.$message.info('get wenshu -> ' + val)
-          this.wenshuDetail = {}
+          this.wenshuDetail = resp.data
         }
       }).finally(() => {
         this.wenshuDetailDialog = true