hailu
2024-02-28 a5c3d8a6a9dee5c50bb39b4b7b625eec81e7da34
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<template>
    <div class="rentClass receivableClass">
      <Card v-if="showTabTitle" class="customTitle">
        <div >
          <Icon custom="custom custom-fangkuan"></Icon>
          <span style="margin-left: 6px;">A股市场全景分析</span>
        </div>
      </Card>
      <Card style="padding-bottom:60px;margin-top:3px;">
        <div class="lists_readAndEdit2" style="margin-top: 0;padding-top: 0;display: flex;"
          v-if="showTabTitle">
          <div>
            <Select v-model="article" style="width:100px;padding-right: 12px" size="large">
              <Option value="0">标题</Option>
              <Option value="1">摘要</Option>
              <Option value="2">内容</Option>
  
            </Select>
            <Input v-model="searchName" clearable size="large" style="width: 400px;font-size:14px;margin-right: 12px;"
              placeholder="请输入标题摘要或内容"></Input>
            <Button size="large" icon="ios-search" type="primary" @click="searchClick">搜索</Button>
          </div>
  
        </div>
        <div class="rentScrollOut" style="margin-top: 12px">
          <Table ref="datalist" :data="datalist" :columns="datalistcol" transfer :loading="loading" border>
            <template slot="action" slot-scope="params">
              <Tooltip content="查看" class="tableActionMargin" theme="light" transfer max-width="200" placement="top">
                <Icon class="action_class" custom="custom custom-chakan" size="18" style="color:#2D8CF0;cursor: pointer;"
                  @click="checkArticle(params.row)" />
              </Tooltip>
            </template>
          </Table>
         
          <Page :current="CurrentPage" :total="totalItems" :page-size="8" @on-change="changePage"
            style="float: right;margin-top: 12px;" />
        </div>
      </Card>
    </div>
  </template>
  
  <script>
  import axios from '@/libs/api.request'
  import $ from 'jquery'
  export default {
    name: '',
    props: {
      showTabTitle: {
        type: Boolean,
        default: true
      },
      name: {
        type: String,
        default: ''
      },
      fullCompanyName: {
        type: String,
        default: ''
      }
    },
    data() {
      return {
        searchName: '',
        article: '0',
        pageIndex: 1,
        pageSize: 8,
        totalItems: 0,
        totalPages: 0,
        datalist: [],
        loading: false,
        titleKeyword: '',
        abstractKeyword: '',
        CurrentPage: 0,
      }
    },
    watch: {
  
    },
    mounted() {
      if (this.name) {
        console.log(this.fullCompanyName, this.name);
        this.searchName = this.name
        this.article = '2'
        this.searchClick()
        // this.getPage()
      } else {
        this.getPage()
      }
  
    },
    created() {
  
    },
    methods: {
      searchClick() {
        this.pageIndex = 1
        this.loading = true
        let data = {
          fullName: this.fullCompanyName,
          pageIndex: this.pageIndex,
          pageSize: this.pageSize,
          industryCategoryKeyword: 'A股市场全景分析',
          ArticleTypeKeyword: 'A股',
          titleKeyword: '',
          abstractKeyword: '',
          contentKeyword: '',
        }
        if (this.article === '0') {
          data.titleKeyword = this.searchName
          data.abstractKeyword = ''
          data.contentKeyword = ''
        } else if (this.article === '1') {
          data.titleKeyword = ''
          data.contentKeyword = ''
          data.abstractKeyword = this.searchName
        } else if (this.article === '2') {
          data.contentKeyword = this.searchName
          data.titleKeyword = ''
          data.abstractKeyword = ''
        }
        axios.request({
          url: '/IndustryChain/GetPage',
          data,
          method: 'post'
        }).then(res => {
          if (res.data.Check) {
            this.datalist = res.data.Data.Items
            this.loading = false
            this.totalItems = res.data.Data.TotalItems
            this.totalPages = res.data.Data.TotalPages
            this.CurrentPage = res.data.Data.CurrentPage
          } else {
            this.loading = false
  
          }
        }, res => {
  
        })
  
      },
      changePage(index) {
        this.pageIndex = index
        this.getPage()
  
      },
      getPage() {
        this.loading = true
        let data = {
          fullName: this.fullCompanyName,
          pageIndex: this.pageIndex,
          pageSize: this.pageSize,
          industryCategoryKeyword: 'A股市场全景分析',
          ArticleTypeKeyword: 'A股',
          titleKeyword: '',
          abstractKeyword: '',
          contentKeyword: '',
        }
        if (this.article === '0') {
          data.titleKeyword = this.searchName
          data.abstractKeyword = ''
          data.contentKeyword = ''
        } else if (this.article === '1') {
          data.titleKeyword = ''
          data.contentKeyword = ''
          data.abstractKeyword = this.searchName
        } else if (this.article === '2') {
          data.contentKeyword = this.searchName
          data.titleKeyword = ''
          data.abstractKeyword = ''
        }
        axios.request({
          url: '/IndustryChain/GetPage',
          data,
          method: 'post'
        }).then(res => {
          if (res.data.Check) {
            this.datalist = res.data.Data.Items
            this.loading = false
            this.totalItems = res.data.Data.TotalItems
            this.totalPages = res.data.Data.TotalPages
            this.CurrentPage = res.data.Data.CurrentPage
          } else {
            this.loading = false
  
          }
        }, res => {
  
        })
      },
      checkArticle(params) {
        // console.log(params);
        // this.$router.push('/artDetail')
        this.$router.push({
          name: "artDetail",
          query: {
            id: params.Id
          },
          params: {
            // name: params.Title
            name: params.Title.length > 15 ? params.Title.substring(0, 15) + '...' : params.Title,
  
          }
        });
      },
  
    },
    computed: {
      datalistcol() {
        // 标题 摘要 内容,发布时间 修改时间,浏览次数,发布者,附件,标签,行业分类 文章类型
        let columns = [];
        columns.push({
          title: "序号",
          key: "id",
          render: (h, params) => {
            return h("span", params.index + 1 + (this.pageIndex - 1) * 8);
          },
          width: 100,
          align: "center",
          fixed: 'left'
  
        });
        columns.push({
          title: "标题",
          key: "Title",
          minWidth: 200,
          render: (h, params) => {
            return h("span",
              {
                style: {
                  margin: '0 0 0 3px',
                }
              },
              params.row.Title);
          },
          className: 'tablecontent',
          align: 'center',
        });
        columns.push({
          title: "摘要",
          key: "Abstract",
          minWidth: 380,
          className: 'tablecontent',
          align: 'center',
          render: (h, params) => {
            return h('Tooltip', {
              props: {
                placement: 'bottom-start', transfer: true, maxWidth: 500,
              },
            },
              [
                h('div', {
                  style: {
                    width: '380px',
                    overflow: 'hidden',
                    whiteSpace: 'nowrap',
                    textOverflow: 'ellipsis',
                    margin: '0 0 0 3px',
                  }
                }, params.row.Abstract),
                h('span', {
                  slot: 'content',
                  style: {
                    whiteSpace: 'normal',
                    wordBreak: 'break-all',
  
                  }
                }, params.row.Abstract)
              ]
            )
          }
        });
        columns.push({
          title: "发布时间",
          key: "PubTime",
          width: 150,
          align: 'center'
        });
        // columns.push({
        //   title: "修改时间",
        //   key: "UpdateTime",
        //   width: 200,
        //   align: 'center'
        // });
  
        columns.push({
          title: "标签",
          key: "Tag",
          render: (h, params) => {
            return h("span", params.row.Tag.join());
          },
          width: 100,
          align: 'center'
        });
        // columns.push({
        //   title: "行业分类",
        //   key: "IndustryCategory",
        //   // solt: 'IndustryCategoryParams',
        //   width: 200,
        //   align: 'center',
  
  
        // });
        // columns.push({
        //   title: "文章类型",
        //   key: "ArticleType",
        //   // solt: "ArticleTypeParams",
        //   width: 200,
        //   align: 'center',
  
        // });
        columns.push({
          title: '操作',
          key: 'action',
          slot: 'action',
          width: 100,
          align: 'center',
          fixed: 'right'
        })
  
        return columns;
      },
    }
  }
  </script>
  
  <style scoped>
  
  </style>