verce-vue-test 0.0.116 → 0.0.118
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/1.3.0.vue +0 -0
- package/package.json +1 -1
- package/src/App.vue +6 -0
- package/src/components/element-rewrite/DateRange.vue +47 -1
- package/src/components/index.ts +1 -1
- package/src/router/index.ts +5 -0
- package/src/views/DateRangeView.vue +737 -0
- package/src/views/fund-cockpit/index.vue +3 -3
- package/file-note-assistant-0.1.2.vsix +0 -0
package/1.3.0.vue
ADDED
|
Binary file
|
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
UserFilled,
|
|
12
12
|
EditPen,
|
|
13
13
|
DataLine,
|
|
14
|
+
Calendar,
|
|
14
15
|
Files,
|
|
15
16
|
InfoFilled,
|
|
16
17
|
TrendCharts,
|
|
@@ -42,6 +43,7 @@ const searchableMenus: MenuSearchItem[] = [
|
|
|
42
43
|
{ value: '员工管理', path: '/employee' },
|
|
43
44
|
{ value: '千分位输入', path: '/thousandth' },
|
|
44
45
|
{ value: '数字区间', path: '/number-range' },
|
|
46
|
+
{ value: '日期区间', path: '/date-range' },
|
|
45
47
|
{ value: '分行看板', path: '/position-forecast' },
|
|
46
48
|
{ value: '人民币头寸预报', path: '/rmb-position-forecast' },
|
|
47
49
|
{ value: '外币头寸预报', path: '/foreign-currency-position-forecast' },
|
|
@@ -147,6 +149,10 @@ function toggleCollapse() {
|
|
|
147
149
|
<el-icon><DataLine /></el-icon>
|
|
148
150
|
<span>数字区间</span>
|
|
149
151
|
</el-menu-item>
|
|
152
|
+
<el-menu-item index="/date-range">
|
|
153
|
+
<el-icon><Calendar /></el-icon>
|
|
154
|
+
<span>日期区间</span>
|
|
155
|
+
</el-menu-item>
|
|
150
156
|
<el-sub-menu index="dashboard-board">
|
|
151
157
|
<template #title>
|
|
152
158
|
<el-icon><TrendCharts /></el-icon>
|
|
@@ -52,6 +52,12 @@ export type DateRangeModelProp = ReadonlyArray<string | null>
|
|
|
52
52
|
|
|
53
53
|
export type MaxSpanDaysInput = number | [number]
|
|
54
54
|
|
|
55
|
+
/** 可选日期边界,字符串支持 YYYYMMDD、YYYY-MM-DD 及其他可被 Date 解析的格式 */
|
|
56
|
+
export type DateRangeBoundary = string | Date
|
|
57
|
+
|
|
58
|
+
/** 自定义日期禁用规则,返回 true 时该日期不可选择 */
|
|
59
|
+
export type DateRangeDisabledDate = (date: Date) => boolean
|
|
60
|
+
|
|
55
61
|
function resolveMaxSpanDays(v: MaxSpanDaysInput | undefined): number | null {
|
|
56
62
|
if (v === undefined) return null
|
|
57
63
|
const n = Array.isArray(v) ? v[0] : v
|
|
@@ -93,6 +99,12 @@ const props = withDefaults(
|
|
|
93
99
|
/** 传给 el-date-picker 的 format(显示格式) */
|
|
94
100
|
displayFormat?: string
|
|
95
101
|
disabled?: boolean
|
|
102
|
+
/** 最早可选日期,早于该日期的日期不可选择(边界当天可选) */
|
|
103
|
+
minDate?: DateRangeBoundary
|
|
104
|
+
/** 最晚可选日期,晚于该日期的日期不可选择(边界当天可选) */
|
|
105
|
+
maxDate?: DateRangeBoundary
|
|
106
|
+
/** 自定义禁用规则,会与日期边界、起止联动及最长区间规则共同生效 */
|
|
107
|
+
disabledDate?: DateRangeDisabledDate
|
|
96
108
|
/** 是否限制结束日期不能早于开始日期(禁用不合法的日期) */
|
|
97
109
|
linkage?: boolean
|
|
98
110
|
/**
|
|
@@ -115,6 +127,9 @@ const props = withDefaults(
|
|
|
115
127
|
valueFormat: "YYYYMMDD",
|
|
116
128
|
displayFormat: "YYYY-MM-DD",
|
|
117
129
|
disabled: false,
|
|
130
|
+
minDate: undefined,
|
|
131
|
+
maxDate: undefined,
|
|
132
|
+
disabledDate: undefined,
|
|
118
133
|
linkage: true,
|
|
119
134
|
maxSpanDays: undefined,
|
|
120
135
|
errorMessage: "结束日期不能早于开始日期",
|
|
@@ -142,17 +157,46 @@ const hasBlurred = ref(false)
|
|
|
142
157
|
/** 解析绑定值:支持 YYYYMMDD(与默认 valueFormat 一致)及 ISO 等可被 Date 解析的字符串 */
|
|
143
158
|
function toDate(val: any): Date | null {
|
|
144
159
|
if (!val) return null
|
|
145
|
-
if (/^\d{8}$/.test(val)) {
|
|
160
|
+
if (typeof val === "string" && /^\d{8}$/.test(val)) {
|
|
146
161
|
const y = Number(val.slice(0, 4))
|
|
147
162
|
const m = Number(val.slice(4, 6)) - 1
|
|
148
163
|
const day = Number(val.slice(6, 8))
|
|
149
164
|
const d = new Date(y, m, day)
|
|
150
165
|
return Number.isNaN(d.getTime()) ? null : d
|
|
151
166
|
}
|
|
167
|
+
if (typeof val === "string" && /^\d{4}-\d{2}-\d{2}$/.test(val)) {
|
|
168
|
+
const [y, m, day] = val.split("-").map(Number)
|
|
169
|
+
const d = new Date(y, m - 1, day)
|
|
170
|
+
return Number.isNaN(d.getTime()) ? null : d
|
|
171
|
+
}
|
|
152
172
|
const d = new Date(val)
|
|
153
173
|
return Number.isNaN(d.getTime()) ? null : d
|
|
154
174
|
}
|
|
155
175
|
|
|
176
|
+
/**
|
|
177
|
+
* 公共禁用规则:边界按本地自然日比较,因此传入 new Date() 时今天仍然可选。
|
|
178
|
+
* 自定义规则与边界规则采用“任一命中即禁用”。
|
|
179
|
+
*/
|
|
180
|
+
function isDateDisabled(date: Date): boolean {
|
|
181
|
+
const dateTime = startOfLocalDay(date).getTime()
|
|
182
|
+
const minDate = toDate(props.minDate)
|
|
183
|
+
const maxDate = toDate(props.maxDate)
|
|
184
|
+
|
|
185
|
+
if (
|
|
186
|
+
minDate !== null &&
|
|
187
|
+
dateTime < startOfLocalDay(minDate).getTime()
|
|
188
|
+
) {
|
|
189
|
+
return true
|
|
190
|
+
}
|
|
191
|
+
if (
|
|
192
|
+
maxDate !== null &&
|
|
193
|
+
dateTime > startOfLocalDay(maxDate).getTime()
|
|
194
|
+
) {
|
|
195
|
+
return true
|
|
196
|
+
}
|
|
197
|
+
return props.disabledDate?.(date) ?? false
|
|
198
|
+
}
|
|
199
|
+
|
|
156
200
|
const effectiveMaxSpan = computed(() => resolveMaxSpanDays(props.maxSpanDays))
|
|
157
201
|
|
|
158
202
|
const spanConstraintApplies = computed(
|
|
@@ -199,6 +243,7 @@ const activeErrorMessage = computed(() => {
|
|
|
199
243
|
})
|
|
200
244
|
|
|
201
245
|
const disabledStartDate = (date: Date): boolean => {
|
|
246
|
+
if (isDateDisabled(date)) return true
|
|
202
247
|
if (props.linkage && endVal.value) {
|
|
203
248
|
const e = toDate(endVal.value)
|
|
204
249
|
if (e !== null && date.getTime() > e.getTime()) return true
|
|
@@ -218,6 +263,7 @@ const disabledStartDate = (date: Date): boolean => {
|
|
|
218
263
|
}
|
|
219
264
|
|
|
220
265
|
const disabledEndDate = (date: Date): boolean => {
|
|
266
|
+
if (isDateDisabled(date)) return true
|
|
221
267
|
if (props.linkage && startVal.value) {
|
|
222
268
|
const s = toDate(startVal.value)
|
|
223
269
|
if (s !== null && date.getTime() < s.getTime()) return true
|
package/src/components/index.ts
CHANGED
|
@@ -46,7 +46,7 @@ const globalComponentDefinitions: GlobalComponentDefinition[] = [
|
|
|
46
46
|
name: 'DateRange',
|
|
47
47
|
component: DateRange,
|
|
48
48
|
category: '表单组件',
|
|
49
|
-
description: '
|
|
49
|
+
description: '支持数组或双字段绑定、可选日期边界、自定义日期禁用、日期联动和最长区间校验的日期范围组件。',
|
|
50
50
|
filePath: 'src/components/element-rewrite/DateRange.vue',
|
|
51
51
|
},
|
|
52
52
|
{
|
package/src/router/index.ts
CHANGED
|
@@ -65,6 +65,11 @@ const router = createRouter({
|
|
|
65
65
|
name: 'numberRange',
|
|
66
66
|
component: () => import('../views/NumberRangeView.vue'),
|
|
67
67
|
},
|
|
68
|
+
{
|
|
69
|
+
path: '/date-range',
|
|
70
|
+
name: 'dateRange',
|
|
71
|
+
component: () => import('../views/DateRangeView.vue'),
|
|
72
|
+
},
|
|
68
73
|
{
|
|
69
74
|
path: '/position-forecast',
|
|
70
75
|
name: 'positionForecast',
|
|
@@ -0,0 +1,737 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref } from 'vue'
|
|
3
|
+
import { Calendar, RefreshLeft } from '@element-plus/icons-vue'
|
|
4
|
+
import type { DateRangeValue } from '@/components/element-rewrite/DateRange.vue'
|
|
5
|
+
|
|
6
|
+
function startOfLocalDay(date: Date) {
|
|
7
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate())
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function formatDate(date: Date) {
|
|
11
|
+
const year = date.getFullYear()
|
|
12
|
+
const month = String(date.getMonth() + 1).padStart(2, '0')
|
|
13
|
+
const day = String(date.getDate()).padStart(2, '0')
|
|
14
|
+
return `${year}${month}${day}`
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const today = startOfLocalDay(new Date())
|
|
18
|
+
const currentMonthStart = new Date(today.getFullYear(), today.getMonth(), 1)
|
|
19
|
+
const currentMonthEnd = new Date(today.getFullYear(), today.getMonth() + 1, 0)
|
|
20
|
+
|
|
21
|
+
const basicRange = ref<DateRangeValue>([null, null])
|
|
22
|
+
const historyRange = ref<DateRangeValue>([null, null])
|
|
23
|
+
const futureRange = ref<DateRangeValue>([null, null])
|
|
24
|
+
const monthRange = ref<DateRangeValue>([null, null])
|
|
25
|
+
const workdayRange = ref<DateRangeValue>([null, null])
|
|
26
|
+
|
|
27
|
+
const selectedRangeCount = computed(() => (
|
|
28
|
+
[basicRange, historyRange, futureRange, monthRange, workdayRange]
|
|
29
|
+
.filter((item) => item.value.some(Boolean)).length
|
|
30
|
+
))
|
|
31
|
+
|
|
32
|
+
const todayText = computed(() => {
|
|
33
|
+
const month = String(today.getMonth() + 1).padStart(2, '0')
|
|
34
|
+
const day = String(today.getDate()).padStart(2, '0')
|
|
35
|
+
return `${today.getFullYear()}-${month}-${day}`
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const currentMonthWindow = computed(() => (
|
|
39
|
+
`${formatDate(currentMonthStart)} — ${formatDate(currentMonthEnd)}`
|
|
40
|
+
))
|
|
41
|
+
|
|
42
|
+
function disableWeekend(date: Date) {
|
|
43
|
+
return date.getDay() === 0 || date.getDay() === 6
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function formatRange(value: DateRangeValue) {
|
|
47
|
+
const [start, end] = value
|
|
48
|
+
if (!start && !end) return '等待选择'
|
|
49
|
+
return `${start ?? '未选择'} — ${end ?? '未选择'}`
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function resetAll() {
|
|
53
|
+
basicRange.value = [null, null]
|
|
54
|
+
historyRange.value = [null, null]
|
|
55
|
+
futureRange.value = [null, null]
|
|
56
|
+
monthRange.value = [null, null]
|
|
57
|
+
workdayRange.value = [null, null]
|
|
58
|
+
}
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<template>
|
|
62
|
+
<div class="date-range-demo-page">
|
|
63
|
+
<header class="demo-hero">
|
|
64
|
+
<div class="demo-hero__copy">
|
|
65
|
+
<div class="demo-eyebrow">
|
|
66
|
+
<span class="demo-eyebrow__icon">
|
|
67
|
+
<el-icon><Calendar /></el-icon>
|
|
68
|
+
</span>
|
|
69
|
+
FORM COMPONENT / 04
|
|
70
|
+
</div>
|
|
71
|
+
<h1>DateRange</h1>
|
|
72
|
+
<p>
|
|
73
|
+
一组专注于日期边界的交互样本。开始与结束日期保持联动,
|
|
74
|
+
同时支持最早日期、最晚日期与任意自定义禁用规则。
|
|
75
|
+
</p>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<div class="demo-hero__meta" aria-label="演示页信息">
|
|
79
|
+
<div class="meta-cell">
|
|
80
|
+
<span>TODAY</span>
|
|
81
|
+
<strong>{{ todayText }}</strong>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="meta-cell">
|
|
84
|
+
<span>VALUE FORMAT</span>
|
|
85
|
+
<strong>YYYYMMDD</strong>
|
|
86
|
+
</div>
|
|
87
|
+
<div class="meta-cell meta-cell--accent">
|
|
88
|
+
<span>ACTIVE SAMPLES</span>
|
|
89
|
+
<strong>{{ selectedRangeCount }} / 5</strong>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<button type="button" class="reset-button" @click="resetAll">
|
|
94
|
+
<el-icon><RefreshLeft /></el-icon>
|
|
95
|
+
重置所有示例
|
|
96
|
+
</button>
|
|
97
|
+
</header>
|
|
98
|
+
|
|
99
|
+
<section class="intro-strip" aria-label="组件能力">
|
|
100
|
+
<div>
|
|
101
|
+
<span class="intro-strip__index">01</span>
|
|
102
|
+
<p><strong>边界日期</strong>按本地自然日计算,边界当天始终可选。</p>
|
|
103
|
+
</div>
|
|
104
|
+
<div>
|
|
105
|
+
<span class="intro-strip__index">02</span>
|
|
106
|
+
<p><strong>组合规则</strong>会与起止联动、最长区间限制共同生效。</p>
|
|
107
|
+
</div>
|
|
108
|
+
<div>
|
|
109
|
+
<span class="intro-strip__index">03</span>
|
|
110
|
+
<p><strong>绑定格式</strong>支持数组模式,也兼容开始、结束双字段模式。</p>
|
|
111
|
+
</div>
|
|
112
|
+
</section>
|
|
113
|
+
|
|
114
|
+
<main class="demo-grid">
|
|
115
|
+
<article class="demo-card demo-card--wide demo-card--basic">
|
|
116
|
+
<div class="demo-card__heading">
|
|
117
|
+
<div>
|
|
118
|
+
<span class="demo-card__number">01 / BASIC</span>
|
|
119
|
+
<h2>基础日期区间</h2>
|
|
120
|
+
</div>
|
|
121
|
+
<span class="rule-tag">最长 15 天</span>
|
|
122
|
+
</div>
|
|
123
|
+
<p class="demo-card__description">
|
|
124
|
+
使用数组模式绑定开始和结束日期,并限制所选区间最多包含 15 个自然日。
|
|
125
|
+
</p>
|
|
126
|
+
<div class="picker-stage">
|
|
127
|
+
<DateRange
|
|
128
|
+
v-model="basicRange"
|
|
129
|
+
:max-span-days="15"
|
|
130
|
+
start-placeholder="选择开始日期"
|
|
131
|
+
end-placeholder="选择结束日期"
|
|
132
|
+
/>
|
|
133
|
+
</div>
|
|
134
|
+
<div class="value-readout">
|
|
135
|
+
<span>MODEL VALUE</span>
|
|
136
|
+
<code>{{ formatRange(basicRange) }}</code>
|
|
137
|
+
</div>
|
|
138
|
+
</article>
|
|
139
|
+
|
|
140
|
+
<article class="demo-card">
|
|
141
|
+
<div class="demo-card__heading">
|
|
142
|
+
<div>
|
|
143
|
+
<span class="demo-card__number">02 / MAX DATE</span>
|
|
144
|
+
<h2>禁止今天之后</h2>
|
|
145
|
+
</div>
|
|
146
|
+
<span class="status-dot status-dot--amber"></span>
|
|
147
|
+
</div>
|
|
148
|
+
<p class="demo-card__description">
|
|
149
|
+
将今天设置为最晚可选日期,适合历史查询、对账和已发生业务。
|
|
150
|
+
</p>
|
|
151
|
+
<div class="picker-stage">
|
|
152
|
+
<DateRange
|
|
153
|
+
v-model="historyRange"
|
|
154
|
+
:max-date="today"
|
|
155
|
+
start-placeholder="历史开始日期"
|
|
156
|
+
end-placeholder="历史结束日期"
|
|
157
|
+
/>
|
|
158
|
+
</div>
|
|
159
|
+
<div class="rule-code">
|
|
160
|
+
<span>RULE</span>
|
|
161
|
+
<code>:max-date="today"</code>
|
|
162
|
+
</div>
|
|
163
|
+
<div class="value-readout">
|
|
164
|
+
<span>MODEL VALUE</span>
|
|
165
|
+
<code>{{ formatRange(historyRange) }}</code>
|
|
166
|
+
</div>
|
|
167
|
+
</article>
|
|
168
|
+
|
|
169
|
+
<article class="demo-card">
|
|
170
|
+
<div class="demo-card__heading">
|
|
171
|
+
<div>
|
|
172
|
+
<span class="demo-card__number">03 / MIN DATE</span>
|
|
173
|
+
<h2>禁止今天之前</h2>
|
|
174
|
+
</div>
|
|
175
|
+
<span class="status-dot status-dot--green"></span>
|
|
176
|
+
</div>
|
|
177
|
+
<p class="demo-card__description">
|
|
178
|
+
将今天设置为最早可选日期,适合预约、计划和未来业务录入。
|
|
179
|
+
</p>
|
|
180
|
+
<div class="picker-stage">
|
|
181
|
+
<DateRange
|
|
182
|
+
v-model="futureRange"
|
|
183
|
+
:min-date="today"
|
|
184
|
+
start-placeholder="计划开始日期"
|
|
185
|
+
end-placeholder="计划结束日期"
|
|
186
|
+
/>
|
|
187
|
+
</div>
|
|
188
|
+
<div class="rule-code">
|
|
189
|
+
<span>RULE</span>
|
|
190
|
+
<code>:min-date="today"</code>
|
|
191
|
+
</div>
|
|
192
|
+
<div class="value-readout">
|
|
193
|
+
<span>MODEL VALUE</span>
|
|
194
|
+
<code>{{ formatRange(futureRange) }}</code>
|
|
195
|
+
</div>
|
|
196
|
+
</article>
|
|
197
|
+
|
|
198
|
+
<article class="demo-card">
|
|
199
|
+
<div class="demo-card__heading">
|
|
200
|
+
<div>
|
|
201
|
+
<span class="demo-card__number">04 / WINDOW</span>
|
|
202
|
+
<h2>指定日期窗口</h2>
|
|
203
|
+
</div>
|
|
204
|
+
<span class="rule-tag rule-tag--blue">本月</span>
|
|
205
|
+
</div>
|
|
206
|
+
<p class="demo-card__description">
|
|
207
|
+
同时传入最早和最晚日期,仅允许在当前自然月内选择。
|
|
208
|
+
</p>
|
|
209
|
+
<div class="picker-stage">
|
|
210
|
+
<DateRange
|
|
211
|
+
v-model="monthRange"
|
|
212
|
+
:min-date="currentMonthStart"
|
|
213
|
+
:max-date="currentMonthEnd"
|
|
214
|
+
start-placeholder="本月开始日期"
|
|
215
|
+
end-placeholder="本月结束日期"
|
|
216
|
+
/>
|
|
217
|
+
</div>
|
|
218
|
+
<div class="rule-code">
|
|
219
|
+
<span>WINDOW</span>
|
|
220
|
+
<code>{{ currentMonthWindow }}</code>
|
|
221
|
+
</div>
|
|
222
|
+
<div class="value-readout">
|
|
223
|
+
<span>MODEL VALUE</span>
|
|
224
|
+
<code>{{ formatRange(monthRange) }}</code>
|
|
225
|
+
</div>
|
|
226
|
+
</article>
|
|
227
|
+
|
|
228
|
+
<article class="demo-card demo-card--custom">
|
|
229
|
+
<div class="demo-card__heading">
|
|
230
|
+
<div>
|
|
231
|
+
<span class="demo-card__number">05 / CUSTOM RULE</span>
|
|
232
|
+
<h2>工作日选择</h2>
|
|
233
|
+
</div>
|
|
234
|
+
<span class="rule-tag rule-tag--dark">禁用周末</span>
|
|
235
|
+
</div>
|
|
236
|
+
<p class="demo-card__description">
|
|
237
|
+
通过 <code>disabledDate</code> 传入任意判断函数;本例禁用星期六和星期日。
|
|
238
|
+
</p>
|
|
239
|
+
<div class="picker-stage picker-stage--dark">
|
|
240
|
+
<DateRange
|
|
241
|
+
v-model="workdayRange"
|
|
242
|
+
:disabled-date="disableWeekend"
|
|
243
|
+
start-placeholder="工作日开始"
|
|
244
|
+
end-placeholder="工作日结束"
|
|
245
|
+
/>
|
|
246
|
+
</div>
|
|
247
|
+
<div class="rule-code rule-code--dark">
|
|
248
|
+
<span>CALLBACK</span>
|
|
249
|
+
<code>date => [0, 6].includes(date.getDay())</code>
|
|
250
|
+
</div>
|
|
251
|
+
<div class="value-readout value-readout--dark">
|
|
252
|
+
<span>MODEL VALUE</span>
|
|
253
|
+
<code>{{ formatRange(workdayRange) }}</code>
|
|
254
|
+
</div>
|
|
255
|
+
</article>
|
|
256
|
+
</main>
|
|
257
|
+
</div>
|
|
258
|
+
</template>
|
|
259
|
+
|
|
260
|
+
<style scoped>
|
|
261
|
+
.date-range-demo-page {
|
|
262
|
+
--demo-ink: #172033;
|
|
263
|
+
--demo-muted: #69758b;
|
|
264
|
+
--demo-line: #dfe5ec;
|
|
265
|
+
--demo-blue: #2768e8;
|
|
266
|
+
min-height: 100%;
|
|
267
|
+
padding: 26px;
|
|
268
|
+
color: var(--demo-ink);
|
|
269
|
+
font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
|
|
270
|
+
background:
|
|
271
|
+
linear-gradient(rgba(36, 54, 78, .035) 1px, transparent 1px),
|
|
272
|
+
linear-gradient(90deg, rgba(36, 54, 78, .035) 1px, transparent 1px),
|
|
273
|
+
#f4f6f9;
|
|
274
|
+
background-size: 28px 28px;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.demo-hero {
|
|
278
|
+
position: relative;
|
|
279
|
+
display: grid;
|
|
280
|
+
grid-template-columns: minmax(0, 1.45fr) minmax(320px, .8fr);
|
|
281
|
+
gap: 36px;
|
|
282
|
+
min-height: 260px;
|
|
283
|
+
padding: 42px 44px;
|
|
284
|
+
overflow: hidden;
|
|
285
|
+
color: #f7f9ff;
|
|
286
|
+
border-radius: 18px 18px 0 0;
|
|
287
|
+
background:
|
|
288
|
+
radial-gradient(circle at 83% 18%, rgba(66, 224, 181, .2), transparent 23%),
|
|
289
|
+
linear-gradient(122deg, #172036 0%, #1a3156 60%, #174b65 100%);
|
|
290
|
+
box-shadow: 0 22px 48px rgba(27, 44, 70, .18);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.demo-hero::after {
|
|
294
|
+
content: "";
|
|
295
|
+
position: absolute;
|
|
296
|
+
width: 340px;
|
|
297
|
+
height: 340px;
|
|
298
|
+
right: -170px;
|
|
299
|
+
bottom: -250px;
|
|
300
|
+
border: 1px solid rgba(255, 255, 255, .15);
|
|
301
|
+
border-radius: 50%;
|
|
302
|
+
box-shadow: 0 0 0 58px rgba(255, 255, 255, .035);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.demo-hero__copy,
|
|
306
|
+
.demo-hero__meta,
|
|
307
|
+
.reset-button {
|
|
308
|
+
position: relative;
|
|
309
|
+
z-index: 1;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.demo-eyebrow {
|
|
313
|
+
display: flex;
|
|
314
|
+
align-items: center;
|
|
315
|
+
gap: 10px;
|
|
316
|
+
margin-bottom: 20px;
|
|
317
|
+
color: #70dfc2;
|
|
318
|
+
font-size: 11px;
|
|
319
|
+
font-weight: 700;
|
|
320
|
+
letter-spacing: .16em;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.demo-eyebrow__icon {
|
|
324
|
+
display: grid;
|
|
325
|
+
width: 29px;
|
|
326
|
+
height: 29px;
|
|
327
|
+
place-items: center;
|
|
328
|
+
color: #132a3d;
|
|
329
|
+
border-radius: 8px;
|
|
330
|
+
background: #70dfc2;
|
|
331
|
+
font-size: 16px;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.demo-hero h1 {
|
|
335
|
+
margin: 0;
|
|
336
|
+
font-family: "SFMono-Regular", Consolas, monospace;
|
|
337
|
+
font-size: clamp(38px, 5vw, 62px);
|
|
338
|
+
line-height: 1;
|
|
339
|
+
letter-spacing: -.055em;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.demo-hero__copy p {
|
|
343
|
+
max-width: 680px;
|
|
344
|
+
margin: 22px 0 0;
|
|
345
|
+
color: rgba(233, 240, 252, .75);
|
|
346
|
+
font-size: 15px;
|
|
347
|
+
line-height: 1.9;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.demo-hero__meta {
|
|
351
|
+
align-self: center;
|
|
352
|
+
border: 1px solid rgba(255, 255, 255, .13);
|
|
353
|
+
border-radius: 13px;
|
|
354
|
+
background: rgba(7, 20, 38, .32);
|
|
355
|
+
backdrop-filter: blur(12px);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.meta-cell {
|
|
359
|
+
display: flex;
|
|
360
|
+
align-items: center;
|
|
361
|
+
justify-content: space-between;
|
|
362
|
+
gap: 16px;
|
|
363
|
+
min-height: 58px;
|
|
364
|
+
padding: 0 18px;
|
|
365
|
+
border-bottom: 1px solid rgba(255, 255, 255, .1);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.meta-cell:last-child {
|
|
369
|
+
border-bottom: 0;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.meta-cell span {
|
|
373
|
+
color: rgba(224, 234, 248, .5);
|
|
374
|
+
font-size: 9px;
|
|
375
|
+
font-weight: 700;
|
|
376
|
+
letter-spacing: .13em;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.meta-cell strong {
|
|
380
|
+
font-family: "SFMono-Regular", Consolas, monospace;
|
|
381
|
+
font-size: 13px;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.meta-cell--accent strong {
|
|
385
|
+
color: #70dfc2;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.reset-button {
|
|
389
|
+
position: absolute;
|
|
390
|
+
right: 44px;
|
|
391
|
+
bottom: 23px;
|
|
392
|
+
display: inline-flex;
|
|
393
|
+
align-items: center;
|
|
394
|
+
gap: 7px;
|
|
395
|
+
padding: 8px 0;
|
|
396
|
+
color: rgba(232, 239, 250, .64);
|
|
397
|
+
border: 0;
|
|
398
|
+
background: transparent;
|
|
399
|
+
font: inherit;
|
|
400
|
+
font-size: 12px;
|
|
401
|
+
cursor: pointer;
|
|
402
|
+
transition: color .2s;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.reset-button:hover {
|
|
406
|
+
color: #fff;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.intro-strip {
|
|
410
|
+
display: grid;
|
|
411
|
+
grid-template-columns: repeat(3, 1fr);
|
|
412
|
+
margin: 0 18px;
|
|
413
|
+
border: 1px solid var(--demo-line);
|
|
414
|
+
border-top: 0;
|
|
415
|
+
border-radius: 0 0 14px 14px;
|
|
416
|
+
background: rgba(255, 255, 255, .95);
|
|
417
|
+
box-shadow: 0 12px 28px rgba(34, 53, 79, .07);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.intro-strip > div {
|
|
421
|
+
display: flex;
|
|
422
|
+
align-items: center;
|
|
423
|
+
gap: 13px;
|
|
424
|
+
min-height: 78px;
|
|
425
|
+
padding: 16px 22px;
|
|
426
|
+
border-right: 1px solid var(--demo-line);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.intro-strip > div:last-child {
|
|
430
|
+
border-right: 0;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.intro-strip__index {
|
|
434
|
+
flex: 0 0 auto;
|
|
435
|
+
color: #a4adba;
|
|
436
|
+
font-family: "SFMono-Regular", Consolas, monospace;
|
|
437
|
+
font-size: 10px;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.intro-strip p {
|
|
441
|
+
margin: 0;
|
|
442
|
+
color: var(--demo-muted);
|
|
443
|
+
font-size: 12px;
|
|
444
|
+
line-height: 1.6;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
.intro-strip strong {
|
|
448
|
+
color: var(--demo-ink);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.demo-grid {
|
|
452
|
+
display: grid;
|
|
453
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
454
|
+
gap: 16px;
|
|
455
|
+
margin-top: 28px;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.demo-card {
|
|
459
|
+
position: relative;
|
|
460
|
+
min-width: 0;
|
|
461
|
+
padding: 25px;
|
|
462
|
+
overflow: hidden;
|
|
463
|
+
border: 1px solid var(--demo-line);
|
|
464
|
+
border-radius: 15px;
|
|
465
|
+
background: #fff;
|
|
466
|
+
box-shadow: 0 9px 24px rgba(33, 50, 73, .055);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.demo-card--wide {
|
|
470
|
+
grid-column: 1 / -1;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.demo-card--basic {
|
|
474
|
+
display: grid;
|
|
475
|
+
grid-template-columns: minmax(230px, .7fr) minmax(380px, 1.3fr);
|
|
476
|
+
column-gap: 46px;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.demo-card--basic .demo-card__description {
|
|
480
|
+
grid-column: 1;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.demo-card--basic .picker-stage {
|
|
484
|
+
grid-column: 2;
|
|
485
|
+
grid-row: 1 / span 2;
|
|
486
|
+
align-self: center;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.demo-card--basic .value-readout {
|
|
490
|
+
grid-column: 1 / -1;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.demo-card--custom {
|
|
494
|
+
color: #f6f9fd;
|
|
495
|
+
border-color: #1b2a3e;
|
|
496
|
+
background:
|
|
497
|
+
radial-gradient(circle at 88% 0, rgba(49, 205, 165, .15), transparent 26%),
|
|
498
|
+
#162235;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.demo-card__heading {
|
|
502
|
+
display: flex;
|
|
503
|
+
align-items: flex-start;
|
|
504
|
+
justify-content: space-between;
|
|
505
|
+
gap: 18px;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
.demo-card__number {
|
|
509
|
+
display: block;
|
|
510
|
+
margin-bottom: 7px;
|
|
511
|
+
color: #9aa6b8;
|
|
512
|
+
font-family: "SFMono-Regular", Consolas, monospace;
|
|
513
|
+
font-size: 9px;
|
|
514
|
+
font-weight: 700;
|
|
515
|
+
letter-spacing: .13em;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.demo-card h2 {
|
|
519
|
+
margin: 0;
|
|
520
|
+
color: inherit;
|
|
521
|
+
font-size: 21px;
|
|
522
|
+
letter-spacing: -.025em;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.rule-tag {
|
|
526
|
+
flex: 0 0 auto;
|
|
527
|
+
padding: 5px 9px;
|
|
528
|
+
color: #93600b;
|
|
529
|
+
border: 1px solid #f1d79e;
|
|
530
|
+
border-radius: 999px;
|
|
531
|
+
background: #fff8e7;
|
|
532
|
+
font-size: 10px;
|
|
533
|
+
font-weight: 600;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.rule-tag--blue {
|
|
537
|
+
color: #2862bc;
|
|
538
|
+
border-color: #cfe0fa;
|
|
539
|
+
background: #eef5ff;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
.rule-tag--dark {
|
|
543
|
+
color: #79e0c5;
|
|
544
|
+
border-color: rgba(112, 223, 194, .26);
|
|
545
|
+
background: rgba(112, 223, 194, .08);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
.status-dot {
|
|
549
|
+
width: 9px;
|
|
550
|
+
height: 9px;
|
|
551
|
+
flex: 0 0 auto;
|
|
552
|
+
margin-top: 6px;
|
|
553
|
+
border: 3px solid #fff;
|
|
554
|
+
border-radius: 50%;
|
|
555
|
+
box-shadow: 0 0 0 1px #d5dce5;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
.status-dot--amber {
|
|
559
|
+
background: #e3a12b;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
.status-dot--green {
|
|
563
|
+
background: #28ad7c;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.demo-card__description {
|
|
567
|
+
min-height: 44px;
|
|
568
|
+
margin: 14px 0 20px;
|
|
569
|
+
color: var(--demo-muted);
|
|
570
|
+
font-size: 13px;
|
|
571
|
+
line-height: 1.7;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.demo-card--custom .demo-card__description {
|
|
575
|
+
color: rgba(223, 232, 245, .66);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
.demo-card__description code {
|
|
579
|
+
color: #7ce2c6;
|
|
580
|
+
font-family: "SFMono-Regular", Consolas, monospace;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
.picker-stage {
|
|
584
|
+
padding: 21px;
|
|
585
|
+
border: 1px solid #e3e8ef;
|
|
586
|
+
border-radius: 12px;
|
|
587
|
+
background:
|
|
588
|
+
linear-gradient(rgba(37, 71, 118, .03) 1px, transparent 1px),
|
|
589
|
+
#f8fafc;
|
|
590
|
+
background-size: 100% 24px;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
.picker-stage--dark {
|
|
594
|
+
border-color: rgba(255, 255, 255, .1);
|
|
595
|
+
background: rgba(255, 255, 255, .055);
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
.rule-code,
|
|
599
|
+
.value-readout {
|
|
600
|
+
display: flex;
|
|
601
|
+
align-items: center;
|
|
602
|
+
justify-content: space-between;
|
|
603
|
+
gap: 14px;
|
|
604
|
+
min-width: 0;
|
|
605
|
+
margin-top: 14px;
|
|
606
|
+
padding: 9px 11px;
|
|
607
|
+
border-radius: 8px;
|
|
608
|
+
background: #f5f7fa;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
.rule-code span,
|
|
612
|
+
.value-readout span {
|
|
613
|
+
flex: 0 0 auto;
|
|
614
|
+
color: #97a2b2;
|
|
615
|
+
font-size: 8px;
|
|
616
|
+
font-weight: 700;
|
|
617
|
+
letter-spacing: .12em;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
.rule-code code,
|
|
621
|
+
.value-readout code {
|
|
622
|
+
min-width: 0;
|
|
623
|
+
overflow: hidden;
|
|
624
|
+
color: #31527d;
|
|
625
|
+
font-family: "SFMono-Regular", Consolas, monospace;
|
|
626
|
+
font-size: 10px;
|
|
627
|
+
text-overflow: ellipsis;
|
|
628
|
+
white-space: nowrap;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
.value-readout {
|
|
632
|
+
border: 1px solid #edf0f4;
|
|
633
|
+
background: #fff;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.value-readout code {
|
|
637
|
+
color: #167d65;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
.rule-code--dark,
|
|
641
|
+
.value-readout--dark {
|
|
642
|
+
border: 1px solid rgba(255, 255, 255, .08);
|
|
643
|
+
background: rgba(4, 12, 24, .35);
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.rule-code--dark code {
|
|
647
|
+
color: #93b8df;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
.value-readout--dark code {
|
|
651
|
+
color: #70dfc2;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
.picker-stage--dark :deep(.date-range__separator) {
|
|
655
|
+
color: rgba(238, 244, 252, .7);
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
@media (max-width: 1080px) {
|
|
659
|
+
.demo-hero {
|
|
660
|
+
grid-template-columns: 1fr;
|
|
661
|
+
padding-bottom: 72px;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
.demo-card--basic {
|
|
665
|
+
display: block;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
.demo-card--basic .picker-stage {
|
|
669
|
+
margin-top: 20px;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
@media (max-width: 820px) {
|
|
674
|
+
.date-range-demo-page {
|
|
675
|
+
padding: 16px;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
.demo-hero {
|
|
679
|
+
padding: 30px 24px 72px;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
.reset-button {
|
|
683
|
+
right: 24px;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
.intro-strip,
|
|
687
|
+
.demo-grid {
|
|
688
|
+
grid-template-columns: 1fr;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
.intro-strip > div {
|
|
692
|
+
border-right: 0;
|
|
693
|
+
border-bottom: 1px solid var(--demo-line);
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
.intro-strip > div:last-child {
|
|
697
|
+
border-bottom: 0;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
.demo-card--wide {
|
|
701
|
+
grid-column: auto;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
@media (max-width: 560px) {
|
|
706
|
+
.date-range-demo-page {
|
|
707
|
+
padding: 0;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
.demo-hero,
|
|
711
|
+
.demo-card {
|
|
712
|
+
border-radius: 0;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
.intro-strip {
|
|
716
|
+
margin: 0;
|
|
717
|
+
border-right: 0;
|
|
718
|
+
border-left: 0;
|
|
719
|
+
border-radius: 0;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
.demo-grid {
|
|
723
|
+
gap: 10px;
|
|
724
|
+
margin-top: 10px;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
.picker-stage {
|
|
728
|
+
padding: 15px;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
@media (prefers-reduced-motion: reduce) {
|
|
733
|
+
.reset-button {
|
|
734
|
+
transition: none;
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
</style>
|
|
@@ -361,8 +361,8 @@ const shiborScrollStyle = computed<Record<string, string> | undefined>(() => {
|
|
|
361
361
|
const projectMetricRows = computed<ProjectMetricRow[]>(() => [
|
|
362
362
|
{ project: '同业负债占比', dataTime: displayText(interbankRecord.value.tyfzzbTime), current: displayText(interbankRecord.value.tyfzzb) },
|
|
363
363
|
{ project: '同业活期存款余额', dataTime: displayText(interbankRecord.value.tyhqckyeTime), current: displayText(interbankRecord.value.tyhqckye) },
|
|
364
|
-
{ project: '同业活期存款占比', dataTime: displayText(interbankRecord.value.tyhqckzbTime), current: displayText(interbankRecord.value.tyhqckzb) },
|
|
365
|
-
{ project: '同业资产占比', dataTime: displayText(interbankRecord.value.tyzczbTime), current: displayText(interbankRecord.value.tyzczb) },
|
|
364
|
+
// { project: '同业活期存款占比', dataTime: displayText(interbankRecord.value.tyhqckzbTime), current: displayText(interbankRecord.value.tyhqckzb) },
|
|
365
|
+
// { project: '同业资产占比', dataTime: displayText(interbankRecord.value.tyzczbTime), current: displayText(interbankRecord.value.tyzczb) },
|
|
366
366
|
])
|
|
367
367
|
|
|
368
368
|
// ECharts 容器、实例与顶部趋势图的交互状态。
|
|
@@ -1018,7 +1018,7 @@ async function loadCockpitData(signal: AbortSignal) {
|
|
|
1018
1018
|
|
|
1019
1019
|
if (interbankResult.status === 'fulfilled') {
|
|
1020
1020
|
interbankRecord.value = Array.isArray(interbankResult.value.body.resultInfoObj)
|
|
1021
|
-
? interbankResult.value.body.resultInfoObj
|
|
1021
|
+
? Object.assign({}, ...interbankResult.value.body.resultInfoObj)
|
|
1022
1022
|
: {}
|
|
1023
1023
|
} else errors.push(getErrorMessage(interbankResult.reason, '同业指标加载失败'))
|
|
1024
1024
|
|
|
Binary file
|