appsnbcbweicheng 1.2.25 → 1.2.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,637 +0,0 @@
1
- <template>
2
- <div class="event-interpretation">
3
- <!-- 筛选区域 -->
4
- <el-card class="filter-card" shadow="never">
5
- <el-form
6
- :inline="true"
7
- :model="searchForm"
8
- class="search-form"
9
- label-width="100px"
10
- size="small"
11
- >
12
- <!-- 统计时间(YYYY-MM) -->
13
- <el-form-item label="统计时间">
14
- <el-date-picker
15
- v-model="searchForm.timeCycle"
16
- type="month"
17
- placeholder="请选择统计月份"
18
- value-format="yyyy-MM"
19
- clearable
20
- style="width: 200px"
21
- />
22
- </el-form-item>
23
- <!-- 资产板块:多选二级下拉 -->
24
- <el-form-item label="资产板块">
25
- <el-cascader
26
- v-model="searchForm.assetSelections"
27
- :options="assetOptions"
28
- :props="{ multiple: true, checkStrictly: false, emitPath: true }"
29
- clearable
30
- collapse-tags
31
- placeholder="请选择资产类别 / 资产名称"
32
- style="width: 320px"
33
- />
34
- </el-form-item>
35
- <!-- 情绪方向 -->
36
- <el-form-item label="情绪方向">
37
- <el-select
38
- v-model="searchForm.emotion"
39
- placeholder="请选择情绪方向"
40
- clearable
41
- style="width: 160px"
42
- >
43
- <el-option
44
- v-for="item in emotionOptions"
45
- :key="item.value"
46
- :label="item.label"
47
- :value="item.value"
48
- />
49
- </el-select>
50
- </el-form-item>
51
- <el-form-item>
52
- <el-button type="primary" @click="handleSearch">查询</el-button>
53
- <el-button @click="handleReset">重置</el-button>
54
- </el-form-item>
55
- </el-form>
56
- </el-card>
57
-
58
- <!-- 展示区域 -->
59
- <el-card class="display-card" shadow="never">
60
- <!-- 描述部分 -->
61
- <div class="description-section">
62
- <div class="description-left">
63
- <span class="fund-summary">{{ fundSummary }}</span>
64
- </div>
65
- <div class="description-right">
66
- <span class="text">2025年12月24号新增789条数据,0条未操作。</span>
67
- <el-button type="primary" size="small" @click="openStatisticsDialog"
68
- >数据覆盖度统计</el-button
69
- >
70
- </div>
71
- </div>
72
-
73
- <!-- 表格 -->
74
- <el-table
75
- :data="tableData"
76
- border
77
- stripe
78
- class="result-table"
79
- size="small"
80
- :default-sort="{ prop: 'gmtModified', order: 'descending' }"
81
- @sort-change="handleSortChange"
82
- >
83
- <!-- 固定前三列 -->
84
- <el-table-column type="index" label="序号" width="60" fixed="left" />
85
- <el-table-column prop="timeCycle" label="统计时间范围" min-width="140" fixed="left" />
86
- <el-table-column prop="type" label="资产类别" min-width="120" fixed="left" />
87
-
88
- <el-table-column prop="plateName" label="资产名称" min-width="160" />
89
- <el-table-column prop="emotion" label="事件情绪" width="100" />
90
- <el-table-column prop="interpretation" label="完整解读" min-width="260">
91
- <template slot-scope="{ row }">
92
- <div class="expandable-content">
93
- <div
94
- :class="{
95
- 'content-collapse': !row.expandInterpretation,
96
- 'content-expanded': row.expandInterpretation,
97
- }"
98
- >
99
- {{ row.interpretation }}
100
- </div>
101
- <el-button
102
- v-if="shouldShowExpand(row.interpretation)"
103
- type="text"
104
- size="mini"
105
- @click="toggleExpand(row, 'interpretation')"
106
- >
107
- {{ row.expandInterpretation ? '收起' : '展开' }}
108
- </el-button>
109
- </div>
110
- </template>
111
- </el-table-column>
112
- <el-table-column prop="smallInterpretation" label="精简解读" min-width="220" />
113
- <el-table-column prop="gmtModified" label="解读发布时间" width="160" sortable="custom" />
114
- </el-table>
115
-
116
- <!-- 分页 -->
117
- <el-pagination
118
- background
119
- @size-change="handleSizeChange"
120
- @current-change="handleCurrentChange"
121
- :current-page="pagination.currentPage"
122
- :page-sizes="[10, 20, 50, 100]"
123
- :page-size="pagination.pageSize"
124
- layout="total, sizes, prev, pager, next, jumper"
125
- :total="pagination.total"
126
- style="margin-top: 20px; text-align: right"
127
- >
128
- </el-pagination>
129
- </el-card>
130
-
131
- <!-- 数据统计弹窗 -->
132
- <el-dialog
133
- title="数据统计"
134
- :visible.sync="statisticsDialogVisible"
135
- width="900px"
136
- :close-on-click-modal="false"
137
- >
138
- <!-- 上部分:概要信息 -->
139
- <div class="statistics-top">
140
- <div class="statistics-row">
141
- <div class="statistics-item-left">
142
- <span class="label">当前统计时间:</span>
143
- <span class="value">{{ searchForm.timeCycle || '-' }}</span>
144
- </div>
145
- <div class="statistics-item-right">
146
- <el-button type="primary" size="small" @click="handleExport"> 数据导出 </el-button>
147
- </div>
148
- </div>
149
- </div>
150
-
151
- <!-- 下部分:数据统计表 -->
152
- <div class="statistics-bottom">
153
- <el-table :data="statisticsTableData" border style="width: 100%; margin-bottom: 20px">
154
- <el-table-column type="index" label="序号" width="80" />
155
- <el-table-column prop="blockName" label="资产类别" min-width="120" />
156
- <el-table-column prop="plateName" label="资产名称" min-width="160" />
157
- <el-table-column prop="nums" label="解读数量" min-width="100" />
158
- <el-table-column prop="autoApprovedRate" label="审核完成率" min-width="120" />
159
- <el-table-column prop="auditApprovedRate" label="审核通过率" min-width="120" />
160
- </el-table>
161
- </div>
162
-
163
- <span slot="footer" class="dialog-footer">
164
- <el-button @click="statisticsDialogVisible = false">关 闭</el-button>
165
- </span>
166
- </el-dialog>
167
- </div>
168
- </template>
169
-
170
- <script>
171
- export default {
172
- name: 'MonthlyAssetSectorEventInterpretation',
173
- data() {
174
- return {
175
- // 筛选表单
176
- searchForm: {
177
- timeCycle: '',
178
- assetSelections: [],
179
- emotion: '',
180
- },
181
- // 资产板块二级选项
182
- assetOptions: [
183
- {
184
- value: '股票',
185
- label: '股票',
186
- children: [
187
- { value: '上证指数', label: '上证指数' },
188
- { value: '沪深300', label: '沪深300' },
189
- ],
190
- },
191
- {
192
- value: '债券',
193
- label: '债券',
194
- children: [
195
- { value: '国债', label: '国债' },
196
- { value: '信用债', label: '信用债' },
197
- ],
198
- },
199
- {
200
- value: '商品',
201
- label: '商品',
202
- children: [
203
- { value: '黄金', label: '黄金' },
204
- { value: '原油', label: '原油' },
205
- ],
206
- },
207
- ],
208
- // 情绪方向选项
209
- emotionOptions: [
210
- { label: '利空', value: '利空' },
211
- { label: '利好', value: '利好' },
212
- { label: '中性', value: '中性' },
213
- ],
214
- // 一句话描述
215
- fundSummary: '按统计时间和资产板块,展示资产板块事件情绪解读结果。',
216
- // 原始表格数据
217
- originalTableData: [
218
- {
219
- id: 1,
220
- timeCycle: '2024-01',
221
- type: '股票',
222
- plateName: '沪深300',
223
- emotion: '利好',
224
- interpretation:
225
- '这是一段关于沪深3011111111111111111111111111111111111111111111111111111111111111111110在当月资产板块事件的完整解读内容,当内容超过三行时会显示“展开/收起”按钮,用于查看全部内容。这里可以模拟较长的一段话,用于测试三行截断展示效果。',
226
- smallInterpretation: '沪深300当月整体偏利好,资金净流入,市场风险偏好回升。',
227
- gmtModified: '2024-01-20 10:30:00',
228
- expandInterpretation: false,
229
- },
230
- {
231
- id: 2,
232
- timeCycle: '2024-01',
233
- type: '债券',
234
- plateName: '国债',
235
- emotion: '中性',
236
- interpretation: '国债收益率小幅波动,总体维持震荡格局。',
237
- smallInterpretation: '国债收益率变化有限,情绪中性。',
238
- gmtModified: '2024-01-18 09:15:00',
239
- expandInterpretation: false,
240
- },
241
- {
242
- id: 3,
243
- timeCycle: '2024-02',
244
- type: '商品',
245
- plateName: '黄金',
246
- emotion: '利空',
247
- interpretation: '美元走强和实际利率抬升对黄金价格形成压制,避险情绪边际回落。',
248
- smallInterpretation: '美元走强打压黄金,情绪偏空。',
249
- gmtModified: '2024-02-05 14:00:00',
250
- expandInterpretation: false,
251
- },
252
- ],
253
- // 排序配置
254
- sortConfig: {
255
- prop: 'gmtModified',
256
- order: 'descending',
257
- },
258
- // 统计弹窗显示状态
259
- statisticsDialogVisible: false,
260
- // 统计表格数据
261
- statisticsTableData: [
262
- {
263
- blockName: '股票',
264
- plateName: '沪深300',
265
- nums: 15,
266
- autoApprovedRate: '90%',
267
- auditApprovedRate: '85%',
268
- },
269
- {
270
- blockName: '债券',
271
- plateName: '国债',
272
- nums: 10,
273
- autoApprovedRate: '80%',
274
- auditApprovedRate: '75%',
275
- },
276
- ],
277
- // 分页配置
278
- pagination: {
279
- currentPage: 1,
280
- pageSize: 10,
281
- total: 0,
282
- },
283
- // 表格显示数据
284
- tableData: [],
285
- }
286
- },
287
- mounted() {
288
- // 初始化原始数据
289
- this.originalTableData = JSON.parse(JSON.stringify(this.originalTableData))
290
- this.fetchData()
291
- },
292
- methods: {
293
- // 获取数据
294
- fetchData() {
295
- let data = [...this.originalTableData]
296
-
297
- // 统计时间筛选(YYYY-MM)
298
- if (this.searchForm.timeCycle) {
299
- data = data.filter(item => item.timeCycle === this.searchForm.timeCycle)
300
- }
301
-
302
- // 资产板块多选筛选(二维 path:[[assetCategory, plateName], ...])
303
- if (this.searchForm.assetSelections && this.searchForm.assetSelections.length > 0) {
304
- const selections = this.searchForm.assetSelections
305
- data = data.filter(item => {
306
- return selections.some(path => {
307
- const [assetCategory, plateName] = path
308
- const matchCategory = !assetCategory || item.type === assetCategory
309
- const matchPlate = !plateName || item.plateName === plateName
310
- return matchCategory && matchPlate
311
- })
312
- })
313
- }
314
-
315
- // 情绪方向筛选
316
- if (this.searchForm.emotion) {
317
- data = data.filter(item => item.emotion === this.searchForm.emotion)
318
- }
319
-
320
- // 排序
321
- if (this.sortConfig.prop) {
322
- data.sort((a, b) => {
323
- const aVal = a[this.sortConfig.prop]
324
- const bVal = b[this.sortConfig.prop]
325
- if (this.sortConfig.order === 'ascending') {
326
- return aVal > bVal ? 1 : aVal < bVal ? -1 : 0
327
- } else {
328
- return aVal < bVal ? 1 : aVal > bVal ? -1 : 0
329
- }
330
- })
331
- }
332
-
333
- // 更新总数
334
- this.pagination.total = data.length
335
-
336
- // 分页截取
337
- const start = (this.pagination.currentPage - 1) * this.pagination.pageSize
338
- const end = start + this.pagination.pageSize
339
- this.tableData = data.slice(start, end)
340
- },
341
- // 分页大小改变
342
- handleSizeChange(val) {
343
- this.pagination.pageSize = val
344
- this.pagination.currentPage = 1
345
- this.fetchData()
346
- },
347
- // 当前页改变
348
- handleCurrentChange(val) {
349
- this.pagination.currentPage = val
350
- this.fetchData()
351
- },
352
- // 查询
353
- handleSearch() {
354
- console.log('查询条件:', this.searchForm)
355
- this.pagination.currentPage = 1
356
- this.fetchData()
357
- },
358
- // 重置
359
- handleReset() {
360
- this.searchForm = {
361
- timeCycle: '',
362
- assetSelections: [],
363
- emotion: '',
364
- }
365
- this.pagination.currentPage = 1
366
- this.fetchData()
367
- },
368
- // 表格排序
369
- handleSortChange({ prop, order }) {
370
- if (!prop || !order) {
371
- this.sortConfig = { prop: 'gmtModified', order: 'descending' }
372
- this.fetchData()
373
- return
374
- }
375
- if (prop === 'gmtModified') {
376
- this.sortConfig = { prop, order }
377
- this.fetchData()
378
- }
379
- },
380
- // 判断是否需要显示展开按钮(超过3行)
381
- shouldShowExpand(content) {
382
- if (!content) return false
383
- // 简单的判断:如果内容长度超过某个阈值,认为超过3行
384
- // 实际可以使用更精确的方法,比如计算实际行数
385
- return content.length > 100
386
- },
387
- // 切换展开/收起
388
- toggleExpand(row, field) {
389
- const expandField = `expand${field.charAt(0).toUpperCase() + field.slice(1)}`
390
- this.$set(row, expandField, !row[expandField])
391
- },
392
- // 打开统计弹窗
393
- openStatisticsDialog() {
394
- // TODO: 根据当前表格数据查询统计数据
395
- this.statisticsDialogVisible = true
396
- },
397
- // 数据导出
398
- handleExport() {
399
- // TODO: 实现数据导出逻辑
400
- this.$message.success('导出功能开发中...')
401
- },
402
- },
403
- }
404
- </script>
405
-
406
- <style scoped lang="scss">
407
- .event-interpretation {
408
- padding: 20px;
409
- background-color: #f5f7fa;
410
- min-height: calc(100vh - 40px);
411
-
412
- .filter-card {
413
- margin-bottom: 20px;
414
- background-color: #fff;
415
-
416
- .search-form {
417
- padding: 10px 0;
418
- }
419
- }
420
-
421
- .display-card {
422
- background-color: #fff;
423
-
424
- .description-section {
425
- display: flex;
426
- justify-content: space-between;
427
- align-items: center;
428
- padding: 15px 0;
429
- border-bottom: 1px solid #ebeef5;
430
- margin-bottom: 15px;
431
-
432
- .description-left {
433
- flex: 1;
434
-
435
- .fund-summary {
436
- font-size: 14px;
437
- color: #606266;
438
- }
439
- }
440
-
441
- .description-right {
442
- display: flex;
443
- align-items: center;
444
- gap: 10px;
445
-
446
- .text {
447
- font-size: 14px;
448
- color: #606266;
449
- }
450
- }
451
- }
452
-
453
- .result-table {
454
- .expandable-content {
455
- width: 100%;
456
-
457
- /* 折叠状态样式(明确类名) */
458
- .content-collapse {
459
- display: -webkit-box;
460
- -webkit-line-clamp: 3;
461
- line-clamp: 3;
462
- -webkit-box-orient: vertical;
463
- overflow: hidden;
464
- text-overflow: ellipsis;
465
- white-space: normal;
466
- word-wrap: break-word;
467
- }
468
-
469
- /* 展开状态样式 */
470
- .content-expanded {
471
- white-space: normal;
472
- word-wrap: break-word;
473
- overflow: visible;
474
- /* 确保展开后内容完全显示 */
475
- }
476
-
477
- /* 按钮样式优化 */
478
- .el-button {
479
- margin-top: 5px;
480
- color: #409eff;
481
- }
482
- }
483
-
484
- // .expandable-content {
485
- // .content-expanded {
486
- // white-space: normal;
487
- // word-wrap: break-word;
488
- // }
489
-
490
- // div:not(.content-expanded) {
491
- // display: -webkit-box;
492
- // -webkit-line-clamp: 3;
493
- // line-clamp: 3;
494
- // -webkit-box-orient: vertical;
495
- // overflow: hidden;
496
- // text-overflow: ellipsis;
497
- // white-space: normal;
498
- // word-wrap: break-word;
499
- // }
500
- // }
501
- }
502
- }
503
-
504
- // 统计弹窗样式
505
- .statistics-top {
506
- margin-bottom: 30px;
507
-
508
- .statistics-row {
509
- display: flex;
510
- justify-content: space-between;
511
- align-items: center;
512
- margin-bottom: 20px;
513
-
514
- &.statistics-three-columns {
515
- display: flex;
516
- gap: 20px;
517
- margin-top: 20px;
518
-
519
- .statistics-column {
520
- flex: 1;
521
- padding: 15px;
522
- background-color: #f5f7fa;
523
- border-radius: 4px;
524
- text-align: center;
525
-
526
- .column-label {
527
- font-size: 14px;
528
- color: #606266;
529
- margin-bottom: 10px;
530
- }
531
-
532
- .column-value {
533
- font-size: 24px;
534
- font-weight: bold;
535
- color: #409eff;
536
- }
537
- }
538
- }
539
-
540
- .statistics-item-left,
541
- .statistics-item-right {
542
- display: flex;
543
- align-items: center;
544
-
545
- .label {
546
- font-size: 14px;
547
- color: #606266;
548
- margin-right: 5px;
549
- }
550
-
551
- .value {
552
- font-size: 14px;
553
- color: #303133;
554
- font-weight: 500;
555
- }
556
- }
557
- }
558
- }
559
-
560
- .statistics-bottom {
561
- .section-title {
562
- font-size: 16px;
563
- font-weight: bold;
564
- color: #303133;
565
- margin-bottom: 15px;
566
- }
567
-
568
- .distribution-table {
569
- .expand-icon {
570
- cursor: pointer;
571
- display: inline-block;
572
- width: 20px;
573
- text-align: center;
574
- color: #409eff;
575
- margin-right: 5px;
576
- user-select: none;
577
- }
578
-
579
- .index-text {
580
- cursor: pointer;
581
- user-select: none;
582
- color: #409eff;
583
-
584
- &:hover {
585
- text-decoration: underline;
586
- }
587
- }
588
- }
589
- }
590
-
591
- /* 电脑端表单样式 */
592
- .search-form {
593
- display: flex;
594
- align-items: center;
595
- gap: 15px;
596
- /* 统一表单项之间的间距,替代默认margin的混乱 */
597
- flex-wrap: wrap;
598
- /* 极端窄屏(如小尺寸电脑)时自动换行,避免溢出 */
599
- }
600
-
601
- /* 清除Element默认的表单项底边距,避免布局错位 */
602
- .search-form :deep(.el-form-item) {
603
- margin-bottom: 0;
604
- }
605
-
606
- .statistics-bottom {
607
- .section-title {
608
- font-size: 16px;
609
- font-weight: bold;
610
- color: #303133;
611
- margin-bottom: 15px;
612
- }
613
-
614
- .distribution-table {
615
- .expand-icon {
616
- cursor: pointer;
617
- display: inline-block;
618
- width: 20px;
619
- text-align: center;
620
- color: #409eff;
621
- margin-right: 5px;
622
- user-select: none;
623
- }
624
-
625
- .index-text {
626
- cursor: pointer;
627
- user-select: none;
628
- color: #409eff;
629
-
630
- &:hover {
631
- text-decoration: underline;
632
- }
633
- }
634
- }
635
- }
636
- }
637
- </style>