n20-common-lib 3.0.87 → 3.0.88

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n20-common-lib",
3
- "version": "3.0.87",
3
+ "version": "3.0.88",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <Dialog class="n20-pivot-dialog" width="90%" max-dialog :visible.sync="visibleC" title="数据透视分析中心">
2
+ <Dialog class="n20-pivot-dialog" width="95%" max-dialog :visible.sync="visibleC" title="数据透视分析中心">
3
3
  <div class="n20-pivot-container">
4
4
  <!-- 左侧报表清单 -->
5
5
  <div class="pivot-sidebar-left" :class="{ collapsed: isLeftSidebarCollapsed }">
@@ -70,12 +70,14 @@
70
70
  <!-- 内容头部工具栏 -->
71
71
  <div class="main-toolbar">
72
72
  <div class="toolbar-left">
73
- <h2 class="report-title">{{ currentReport.name }}</h2>
74
- <div class="add-to-home-btn" @click="handleAddToHome">
75
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
76
- <path d="M7 1V13M1 7H13" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
77
- </svg>
78
- <span>添加到首页</span>
73
+ <div >
74
+ <h2 class="report-title">{{ currentReport.name }}</h2>
75
+ <div class="add-to-home-btn" @click="handleAddToHome">
76
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
77
+ <path d="M7 1V13M1 7H13" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
78
+ </svg>
79
+ <span>添加到首页</span>
80
+ </div>
79
81
  </div>
80
82
  <div class="report-stats">
81
83
  <span class="stat-item">计算耗时:{{ calculateTime }} ms</span>
@@ -404,7 +406,7 @@
404
406
 
405
407
  <script>
406
408
  import Dialog from '../Dialog/index.vue'
407
- import ViewToggle from './ViewToggle.vue'
409
+ import ViewToggle from '../ViewToggle/index.vue'
408
410
  import XEUtils from 'xe-utils'
409
411
  import importG from '../../utils/importGlobal.js'
410
412
 
@@ -1373,10 +1375,13 @@ export default {
1373
1375
  }
1374
1376
 
1375
1377
  .report-title {
1378
+ color: var(--text-1, #1d2129);
1379
+ /* 18/CN-Medium */
1380
+ font-family: 'PingFang SC';
1376
1381
  font-size: 18px;
1382
+ font-style: normal;
1377
1383
  font-weight: 500;
1378
- color: #1d2129;
1379
- margin: 0;
1384
+ line-height: 26px; /* 144.444% */
1380
1385
  }
1381
1386
 
1382
1387
  .add-to-home-btn {
@@ -764,7 +764,7 @@ export default {
764
764
  // 处理固定操作列的按钮事件
765
765
  handleOperateCommand(command, row, rowIndex) {
766
766
  this.$emit(command, row, rowIndex)
767
- this.$emit('hover-btn-click', { btn: { command }, row, rowIndex })
767
+ this.$emit('hover-btn-click', { btn, row, rowIndex })
768
768
  },
769
769
  // 处理 tableOperate 固定/取消固定切换
770
770
  handleToggleOperateFixed(fixed) {
@@ -1,132 +0,0 @@
1
- <template>
2
- <div class="view-toggle" :class="{ disabled }">
3
- <div class="toggle-container">
4
- <div
5
- v-for="(item, index) in options"
6
- :key="item.value"
7
- class="toggle-item"
8
- :class="{ active: value === item.value }"
9
- :style="itemStyle"
10
- @click="handleChange(item.value)"
11
- >
12
- {{ item.label }}
13
- </div>
14
- <div class="toggle-indicator" :style="indicatorStyle"></div>
15
- </div>
16
- </div>
17
- </template>
18
-
19
- <script>
20
- export default {
21
- name: 'ViewToggle',
22
- props: {
23
- value: {
24
- type: [String, Number],
25
- required: true
26
- },
27
- options: {
28
- type: Array,
29
- required: true,
30
- validator(value) {
31
- return value.every((item) => item.label && item.value !== undefined)
32
- }
33
- },
34
- itemWidth: {
35
- type: [Number, String],
36
- default: 80
37
- },
38
- itemHeight: {
39
- type: [Number, String],
40
- default: 30
41
- },
42
- disabled: {
43
- type: Boolean,
44
- default: false
45
- }
46
- },
47
- computed: {
48
- itemStyle() {
49
- const width = typeof this.itemWidth === 'number' ? `${this.itemWidth}px` : this.itemWidth
50
- const height = typeof this.itemHeight === 'number' ? `${this.itemHeight}px` : this.itemHeight
51
- return {
52
- width,
53
- height
54
- }
55
- },
56
- indicatorStyle() {
57
- const itemW = typeof this.itemWidth === 'number' ? this.itemWidth : parseInt(this.itemWidth)
58
- const itemH = typeof this.itemHeight === 'number' ? this.itemHeight : parseInt(this.itemHeight)
59
- const gap = 2
60
- const activeIndex = this.options.findIndex((item) => item.value === this.value)
61
- const translateX = activeIndex >= 0 ? activeIndex * itemW : 0
62
- return {
63
- width: `${itemW - 2 * gap}px`,
64
- height: `${itemH - 2 * gap}px`,
65
- top: `${gap}px`,
66
- left: `${gap}px`,
67
- transform: `translateX(${translateX}px)`
68
- }
69
- }
70
- },
71
- methods: {
72
- handleChange(val) {
73
- if (this.disabled) return
74
- if (val !== this.value) {
75
- this.$emit('input', val)
76
- this.$emit('change', val)
77
- }
78
- }
79
- }
80
- }
81
- </script>
82
-
83
- <style lang="scss" scoped>
84
- .view-toggle {
85
- background: #f2f3f5;
86
- border-radius: 4px;
87
- padding: 2px;
88
- display: inline-block;
89
- }
90
-
91
- .view-toggle.disabled {
92
- opacity: 0.6;
93
- cursor: not-allowed;
94
- pointer-events: none;
95
- }
96
-
97
- .toggle-container {
98
- display: flex;
99
- position: relative;
100
- }
101
-
102
- .toggle-item {
103
- display: flex;
104
- align-items: center;
105
- justify-content: center;
106
- color: var(--text-1, #1d2129);
107
- font-family: 'PingFang SC';
108
- font-size: 14px;
109
- font-style: normal;
110
- font-weight: 400;
111
- line-height: 22px;
112
- cursor: pointer;
113
- border-radius: 2px;
114
- transition: all 0.2s;
115
- z-index: 1;
116
- user-select: none;
117
- }
118
-
119
- .toggle-item.active {
120
- color: var(--primary-6, #007aff);
121
- font-weight: 500;
122
- }
123
-
124
- .toggle-indicator {
125
- position: absolute;
126
- background: #fff;
127
- box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.08);
128
- border-radius: 2px;
129
- transition: transform 0.2s;
130
- z-index: 0;
131
- }
132
- </style>