|
|
@@ -1,465 +0,0 @@
|
|
|
-<template>
|
|
|
- <el-container>
|
|
|
- <el-main>
|
|
|
- <el-row style="padding: 5px">
|
|
|
- <el-input
|
|
|
- v-model="keyword"
|
|
|
- :placeholder="searchHint"
|
|
|
- class="input-with-select"
|
|
|
- clearable
|
|
|
- @focus="focus"
|
|
|
- @blur="blur"
|
|
|
- @input="inputEvent"
|
|
|
- @keyup.enter.native="handleOnSearch"
|
|
|
- >
|
|
|
- <el-select
|
|
|
- slot="prepend"
|
|
|
- v-model="searchType"
|
|
|
- placeholder="请选择"
|
|
|
- >
|
|
|
- <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="handleOnSearch" />
|
|
|
- </el-input>
|
|
|
- <!---设置z-index优先级,防止被走马灯效果遮挡-->
|
|
|
- <el-card
|
|
|
- v-if="isSearch"
|
|
|
- id="search-box"
|
|
|
- class="box-card"
|
|
|
- style="position:relative;z-index:15"
|
|
|
- >
|
|
|
- <dl v-if="isHistorySearch">
|
|
|
- <div class="search-title">热门搜索</div>
|
|
|
- <el-col v-if="hotSearchList.length === 0" :md="6" style="padding: 5px;">
|
|
|
- 暂无热门搜索
|
|
|
- </el-col>
|
|
|
- <el-col v-for="hotSearch in hotSearchList" :key="hotSearch.keyword" :md="6" style="padding: 5px;">
|
|
|
- <el-button style="padding: 5px;" type="text" @click="onClickHot(hotSearch.keyword)">
|
|
|
- {{ hotSearch.keyword }}
|
|
|
- </el-button>
|
|
|
- </el-col>
|
|
|
- </dl>
|
|
|
- <dl v-if="isSearchList">
|
|
|
- <div class="search-title">搜索建议</div>
|
|
|
- <el-col v-if="searchList.length === 0" :md="6" style="padding: 5px;">
|
|
|
- 暂无搜索建议
|
|
|
- </el-col>
|
|
|
- <el-col v-else v-for="searchSuggest in searchList" :key="searchSuggest.value" :md="6" style="padding: 5px;">
|
|
|
- <el-button style="padding: 5px;" type="text" @click="onClickHot(searchSuggest.value)">
|
|
|
- {{ searchSuggest.value }}
|
|
|
- </el-button>
|
|
|
- </el-col>
|
|
|
- </dl>
|
|
|
- </el-card>
|
|
|
- </el-row>
|
|
|
- <!-- 返回的搜索数据 -->
|
|
|
- <el-row style="padding: 5px">
|
|
|
- <el-col v-loading="loading" :md="18">
|
|
|
- <!-- 视频数据 -->
|
|
|
- <el-row v-if="videoSearch" class="movie-list">
|
|
|
- <el-col v-for="(video,index) in dataList" :key="index" :md="6" :sm="8" :xs="12">
|
|
|
- <search-video-card :video="video" />
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <!-- 裁判文书数据 -->
|
|
|
- <el-row v-if="wenshuSearch" class="movie-list">
|
|
|
- <el-col v-for="(item, index) in dataList" :key="index" :md="6" :sm="8" :xs="12">
|
|
|
- <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
|
|
|
- <el-card class="box-card">
|
|
|
- <div slot="header" class="clearfix">
|
|
|
- <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>
|
|
|
- <el-col :md="4">
|
|
|
- <el-image
|
|
|
- lazy
|
|
|
- fit="cover"
|
|
|
- :src="item.coverUrl"
|
|
|
- class="coverImg"
|
|
|
- />
|
|
|
- </el-col>
|
|
|
- <el-col :md="20">
|
|
|
- <el-row>
|
|
|
- <div style="padding: 14px">
|
|
|
- <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.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.judgmentDate }}</span>
|
|
|
- </div>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
- </el-card>
|
|
|
- </el-row>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <!-- 数据分页 -->
|
|
|
- <el-row>
|
|
|
- <el-col :span="18" class="pagination">
|
|
|
- <el-pagination
|
|
|
- :small="screenWidth <= 768"
|
|
|
- hide-on-single-page
|
|
|
- layout="prev, pager, next"
|
|
|
- :page-size="pageSize"
|
|
|
- :current-page="currentPage"
|
|
|
- :total="totalSize"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- />
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row v-if="showEmpty" style="padding: 5px">
|
|
|
- <div>
|
|
|
- <img src="@/assets/img/not-result.png">
|
|
|
- <span>没有结果</span>
|
|
|
- </div>
|
|
|
- </el-row>
|
|
|
- </el-main>
|
|
|
-
|
|
|
- <el-dialog title="裁判文书详情" :visible.sync="wenshuDetailDialog" width="70%" center>
|
|
|
- <el-card v-if="wenshuDetail !== null" :model="wenshuDetail">
|
|
|
- <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.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.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.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>
|
|
|
- <el-descriptions-item>
|
|
|
- <template slot="label">
|
|
|
- <i class="el-icon-user" />
|
|
|
- 文书内容
|
|
|
- </template>
|
|
|
- <span v-html="wenshuDetail.fullText" />
|
|
|
- </el-descriptions-item>
|
|
|
- </el-descriptions>
|
|
|
- </el-card>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="wenshuDetailDialog = false">关闭</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
- </el-container>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import SearchVideoCard from '@/components/card/SearchVideoCard'
|
|
|
-import { videoQuery, getWenshuDetail, wenshuQuery, keywordSuggest, hotKeyword } from '@/api/search'
|
|
|
-
|
|
|
-export default {
|
|
|
- name: 'SearchIndex',
|
|
|
- components: {
|
|
|
- SearchVideoCard
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- // 屏幕宽度, 为了控制分页条的大小
|
|
|
- screenWidth: document.body.clientWidth,
|
|
|
- currentPage: 1,
|
|
|
- pageSize: 12,
|
|
|
- totalSize: 0,
|
|
|
- dataList: [], // 搜索结果
|
|
|
- hotSearchList: ['暂无热门搜索'], // 热门搜索
|
|
|
- searchList: [], // 搜索建议
|
|
|
- searchHint: '想要搜点神马呢',
|
|
|
- showEmpty: false,
|
|
|
- loading: false,
|
|
|
- keyword: '', // 当前输入框的值
|
|
|
- searchType: '1',
|
|
|
- isFocus: false, // 是否聚焦
|
|
|
- wenshuDetailDialog: false,
|
|
|
- wenshuDetail: null,
|
|
|
- videoSearch: false,
|
|
|
- wenshuSearch: false
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
- isHistorySearch() {
|
|
|
- return this.isFocus && this.keyword === ''
|
|
|
- },
|
|
|
- isSearchList() {
|
|
|
- return this.isFocus && this.keyword !== ''
|
|
|
- },
|
|
|
- isSearch() {
|
|
|
- return this.isFocus
|
|
|
- }
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- hotKeyword().then(resp => {
|
|
|
- if (resp.code === 0) {
|
|
|
- this.hotSearchList = resp.data
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- created() {
|
|
|
- const keyword = this.$route.query.keyword
|
|
|
- const searchType = this.$route.query.searchType
|
|
|
- const currentPage = parseInt(this.$route.query.pn)
|
|
|
- if (keyword !== undefined && searchType !== undefined && currentPage !== undefined) {
|
|
|
- this.keyword = keyword
|
|
|
- this.searchType = searchType
|
|
|
- this.currentPage = currentPage
|
|
|
- this.searchHandler()
|
|
|
- document.title = '搜索 - ' + this.keyword
|
|
|
- } else {
|
|
|
- document.title = '搜索'
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- handleCurrentChange(currentPage) {
|
|
|
- this.$router.push({
|
|
|
- path: '/search',
|
|
|
- query: {
|
|
|
- searchType: this.searchType,
|
|
|
- keyword: this.keyword,
|
|
|
- pn: currentPage
|
|
|
- }
|
|
|
- })
|
|
|
- this.$router.go(0)
|
|
|
- },
|
|
|
- handleOnSearch() {
|
|
|
- this.$router.push({
|
|
|
- path: '/search',
|
|
|
- query: {
|
|
|
- searchType: this.searchType,
|
|
|
- keyword: this.keyword,
|
|
|
- pn: 1
|
|
|
- }
|
|
|
- })
|
|
|
- this.$router.go(0)
|
|
|
- },
|
|
|
- focus() {
|
|
|
- this.isFocus = true
|
|
|
- },
|
|
|
- blur() {
|
|
|
- this.isFocus = false
|
|
|
- },
|
|
|
- inputEvent() {
|
|
|
- const queryString = this.keyword
|
|
|
- if (queryString === '') {
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- setTimeout(() => {
|
|
|
- keywordSuggest(queryString).then(resp => {
|
|
|
- if (resp.code === 0) {
|
|
|
- this.searchList = []
|
|
|
- this.searchList = resp.data.map((item) => {
|
|
|
- return {
|
|
|
- value: item.keyword,
|
|
|
- rank: 1
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- }, 500)
|
|
|
- },
|
|
|
- searchHandler() {
|
|
|
- if (this.searchType === '3') {
|
|
|
- this.videoSearch = false
|
|
|
- this.wenshuSearch = true
|
|
|
- wenshuQuery(this.keyword, this.currentPage).then(resp => {
|
|
|
- if (resp.code === 0) {
|
|
|
- const respData = resp.data
|
|
|
- this.totalSize = respData.totalSize
|
|
|
- this.dataList = respData.list
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.videoSearch = true
|
|
|
- this.wenshuSearch = false
|
|
|
- this.videoQueryWrapper(this.keyword, this.currentPage)
|
|
|
- }
|
|
|
- },
|
|
|
- onGetWenshuDetail(val) {
|
|
|
- getWenshuDetail(val, this.keyword).then(resp => {
|
|
|
- if (resp.code === 0) {
|
|
|
- this.wenshuDetail = resp.data
|
|
|
- }
|
|
|
- }).finally(() => {
|
|
|
- this.wenshuDetailDialog = true
|
|
|
- })
|
|
|
- },
|
|
|
- videoQueryWrapper(keyword, pageNumber) {
|
|
|
- this.loading = true
|
|
|
- videoQuery(keyword, pageNumber).then(resp => {
|
|
|
- if (resp.code === 0) {
|
|
|
- const respData = resp.data
|
|
|
- this.totalSize = respData.totalSize
|
|
|
- this.dataList = respData.list
|
|
|
-
|
|
|
- if (this.total === 0) {
|
|
|
- this.showEmpty = true
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.$notify.error({
|
|
|
- message: resp.msg,
|
|
|
- type: 'warning',
|
|
|
- duration: 3000
|
|
|
- })
|
|
|
- }
|
|
|
- }).catch(error => {
|
|
|
- this.$notify.error({
|
|
|
- message: error.m,
|
|
|
- type: 'error',
|
|
|
- duration: 3000
|
|
|
- })
|
|
|
- }).finally(() => {
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
- },
|
|
|
- onClickHot(val) {
|
|
|
- this.keyword = val
|
|
|
- this.handleOnSearch()
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|
|
|
-
|
|
|
-<style>
|
|
|
-.left {
|
|
|
- margin-left: 200px;
|
|
|
-}
|
|
|
-.center {
|
|
|
- margin-top: 15px;
|
|
|
- margin-left: 50%;
|
|
|
-}
|
|
|
-#search {
|
|
|
- background-color: #c60d37;
|
|
|
- border-radius: 0%;
|
|
|
-}
|
|
|
-.search-title {
|
|
|
- color: #bdbaba;
|
|
|
- font-size: 15px;
|
|
|
- margin-bottom: 5px;
|
|
|
-}
|
|
|
-.remove-history {
|
|
|
- color: #bdbaba;
|
|
|
- font-size: 15px;
|
|
|
- float: right;
|
|
|
- margin-top: -22px;
|
|
|
-}
|
|
|
-#search-box {
|
|
|
- width: 555px;
|
|
|
- height: 300px;
|
|
|
- margin-top: 0px;
|
|
|
- padding-bottom: 20px;
|
|
|
-}
|
|
|
-
|
|
|
-.movie-list {
|
|
|
- padding-top: 5px;
|
|
|
- padding-left: 5px;
|
|
|
- padding-right: 5px;
|
|
|
-}
|
|
|
-
|
|
|
-.coverImg {
|
|
|
- width: 100%;
|
|
|
- height: 120px;
|
|
|
- display: block;
|
|
|
-}
|
|
|
-
|
|
|
-.el-select .el-input {
|
|
|
- width: 130px;
|
|
|
-}
|
|
|
-.input-with-select .el-input-group__prepend {
|
|
|
- background-color: #fff;
|
|
|
-}
|
|
|
-</style>
|