@bdsoft/element 1.1.13 → 1.1.14
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/index.html +13 -0
- package/index.js +6 -6
- package/package.json +19 -23
- package/src/App.vue +28 -0
- package/src/assets/css/element.scss +196 -0
- package/src/assets/css/layout.scss +215 -0
- package/src/assets/css/tailwind.scss +67 -0
- package/src/assets/images/banner.gif +0 -0
- package/src/assets/images/banner.png +0 -0
- package/src/assets/images/bg1.svg +22 -0
- package/src/assets/images/bg2.png +0 -0
- package/src/assets/images/ff.png +0 -0
- package/src/assets/images/home-file1.png +0 -0
- package/src/assets/images/ky.png +0 -0
- package/src/assets/images/menu/add.png +0 -0
- package/src/assets/images/menu/del.png +0 -0
- package/src/assets/images/menu/down.png +0 -0
- package/src/assets/images/menu/dr.png +0 -0
- package/src/assets/images/menu/edit.png +0 -0
- package/src/assets/images/menu/kx.png +0 -0
- package/src/assets/images/menu/mb.png +0 -0
- package/src/assets/images/menu/pz.png +0 -0
- package/src/assets/images/menu/save.png +0 -0
- package/src/assets/images/menu/sj.png +0 -0
- package/src/assets/images/menu/sjk.png +0 -0
- package/src/assets/images/menu/up.png +0 -0
- package/src/assets/images/po-i.png +0 -0
- package/src/assets/images/po1-i1.png +0 -0
- package/src/assets/images/po1-i2.png +0 -0
- package/src/assets/images/po1-i3.png +0 -0
- package/src/assets/images/po1-i4.png +0 -0
- package/src/assets/images/po1-i5.png +0 -0
- package/src/assets/images/po1-i6.png +0 -0
- package/src/assets/images/po1-i7.png +0 -0
- package/src/assets/images/po1-i8.png +0 -0
- package/src/assets/images/po2-i1.png +0 -0
- package/src/assets/images/po2-i2.png +0 -0
- package/src/assets/images/po3-i1.png +0 -0
- package/src/assets/images/po4-i1.png +0 -0
- package/src/assets/images/po5-i1.png +0 -0
- package/src/assets/images/po6-i1.png +0 -0
- package/src/assets/images/po6-i2.png +0 -0
- package/src/assets/images/po7-i1.png +0 -0
- package/src/assets/images/tj1.png +0 -0
- package/src/assets/images/tj2.png +0 -0
- package/src/assets/images/tj3.png +0 -0
- package/src/components/3dcloudwords/index.js +346 -0
- package/src/components/3dcloudwords/index.vue +99 -0
- package/src/components/3dcloudwords/readme.md +66 -0
- package/src/components/badge/index.js +167 -0
- package/src/components/badge/index.scss +166 -0
- package/src/components/badge/index.vue +98 -0
- package/src/components/badge/readme.md +18 -0
- package/src/components/basic/Finish.vue +107 -0
- package/src/components/basic/button.vue +19 -0
- package/src/components/basic/readme.md +7 -0
- package/src/components/button/index.vue +48 -0
- package/src/components/button/readme.md +62 -0
- package/src/components/carousel/index.vue +104 -0
- package/src/components/carousel/readme.md +12 -0
- package/src/components/chartconfig/index.vue +141 -0
- package/src/components/chartconfig/readme.md +25 -0
- package/src/components/contextMenu/hookContxtMenu.js +41 -0
- package/src/components/contextMenu/index.vue +245 -0
- package/src/components/contextMenu/readme.md +55 -0
- package/src/components/contextMenu/useElementBounding.js +40 -0
- package/src/components/countup/countUp.js +196 -0
- package/src/components/countup/index.vue +114 -0
- package/src/components/countup/readme.md +9 -0
- package/src/components/empty/assets/build.png +0 -0
- package/src/components/empty/assets/emptybg.gif +0 -0
- package/src/components/empty/assets/emptybg.png +0 -0
- package/src/components/empty/assets/emptybg2.jpg +0 -0
- package/src/components/empty/assets/emptybg3.jpg +0 -0
- package/src/components/empty/assets/wuxiao.png +0 -0
- package/src/components/empty/assets/wuxiao.webp +0 -0
- package/src/components/empty/building.vue +117 -0
- package/src/components/empty/empty.vue +120 -0
- package/src/components/empty/index.js +12 -0
- package/src/components/empty/invalid.vue +56 -0
- package/src/components/error/Error.vue +79 -0
- package/src/components/error/readme.md +20 -0
- package/src/components/form/Form.vue +84 -0
- package/src/components/form/FormItem.vue +143 -0
- package/src/components/form/data.js +52 -0
- package/src/components/form/readme.md +69 -0
- package/src/components/layout/banner.vue +412 -0
- package/src/components/layout/bar.vue +43 -0
- package/src/components/layout/layout1.vue +60 -0
- package/src/components/layout/layout2.vue +134 -0
- package/src/components/layout/layout3.vue +107 -0
- package/src/components/layout/layout4.vue +66 -0
- package/src/components/layout/nav.vue +333 -0
- package/src/components/layout/readme.md +61 -0
- package/src/components/loading/index.vue +122 -0
- package/src/components/loading/readme.md +6 -0
- package/src/components/notice/NoticeList.vue +198 -0
- package/src/components/notice/NoticeListPaging.vue +281 -0
- package/src/components/notice/NoticeView.vue +92 -0
- package/src/components/notice/readme.md +1 -0
- package/src/components/pagination/index.vue +100 -0
- package/src/components/pagination/readme.md +19 -0
- package/src/components/pagination/scroll-to.js +51 -0
- package/src/components/progress/bar.vue +72 -0
- package/src/components/progress/progress.vue +58 -0
- package/src/components/screenfull/index.js +3 -0
- package/src/components/screenfull/index.vue +65 -0
- package/src/components/screenfull/package.json +15 -0
- package/src/components/screenfull/readme.md +6 -0
- package/src/components/statisticalCount/index.vue +80 -0
- package/src/components/statisticalCount/readme.md +21 -0
- package/src/components/username/index.vue +79 -0
- package/src/components/username/readme.md +22 -0
- package/src/components/username//346/225/210/346/236/234/345/233/276.png +0 -0
- package/src/global/index.ts +6 -0
- package/src/global/register-properties.ts +10 -0
- package/src/index.js +88 -0
- package/src/utils/coms/load.jsx +10 -0
- package/src/utils/func.js +32 -0
- package/src/utils/hookDialog.js +38 -0
- package/src/utils/hookPage.js +49 -0
- package/src/utils/index.js +5 -0
- package/src/utils/lib/console.js +39 -0
- package/src/utils/lib/debounce.js +19 -0
- package/src/utils/lib/deepextend.js +51 -0
- package/src/utils/lib/deepset.js +14 -0
- package/src/utils/lib/extend.js +28 -0
- package/src/utils/lib/index.js +13 -0
- package/src/utils/lib/json.js +90 -0
- package/src/utils/lib/mergeprops.js +62 -0
- package/src/utils/lib/mitt.js +43 -0
- package/src/utils/lib/modify.js +8 -0
- package/src/utils/lib/slot.js +19 -0
- package/src/utils/lib/toarray.js +5 -0
- package/src/utils/lib/tocase.js +11 -0
- package/src/utils/lib/todate.js +10 -0
- package/src/utils/lib/toline.js +10 -0
- package/src/utils/lib/tostring.js +7 -0
- package/src/utils/lib/type.js +45 -0
- package/src/utils/lib/unique.js +6 -0
- package/src/utils/message.js +164 -0
- package/src/utils/type.js +45 -0
- package/src/xm_components/HeadSearch/hook/hookSearch.js +96 -0
- package/src/xm_components/HeadSearch/index.vue +206 -0
- package/src/xm_components/HeadSearch/readme.md +12 -0
- package/src/xm_components/HeadSearch//346/220/234/347/264/242/345/210/227/350/241/250.png +0 -0
- package/src/xm_components/Milestone/index.vue +213 -0
- package/src/xm_components/Milestone/readme.md +15 -0
- package/src/xm_components/MultiStatisticalCard/image.png +0 -0
- package/src/xm_components/MultiStatisticalCard/index.vue +114 -0
- package/src/xm_components/MultiStatisticalCard/readme.md +29 -0
- package/src/xm_components/StatisticalCard/image.png +0 -0
- package/src/xm_components/StatisticalCard/index.vue +196 -0
- package/src/xm_components/StatisticalCard/readme.md +41 -0
- package/src/xm_components/readme.md +1 -0
- package/vite.config.js +58 -0
- package/dist/BdElement.js +0 -23432
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @FileDescription: 里程碑组件
|
|
3
|
+
* @Author: 李兵泉
|
|
4
|
+
* @Date: 2025-10-30
|
|
5
|
+
* @LastEditors: 最后更新作者
|
|
6
|
+
* @LastEditTime: 最后更新时间
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div class="milestone-container">
|
|
11
|
+
<div class="milestone-track " v-if="milestones && milestones != ''">
|
|
12
|
+
<div v-for="(item, index) in milestones" :key="index" class="milestone-item"
|
|
13
|
+
:class="{ 'odd-item': index % 2 === 0, 'even-item': index % 2 !== 0 }" :style="{
|
|
14
|
+
left: `${calculatePosition(item.rq)}%`,
|
|
15
|
+
opacity: index === milestones.length - 1 && hideLast ? '0' : '1'
|
|
16
|
+
}">
|
|
17
|
+
<template v-if="index % 2 === 0">
|
|
18
|
+
<!-- 信息面板 -->
|
|
19
|
+
<div class="milestone-info">
|
|
20
|
+
<!-- <div class="milestone-date">{{ dayjs(item.rq).format('YYYY-MM-DD') }}</div> -->
|
|
21
|
+
<div class="milestone-name">{{ item.name }}</div>
|
|
22
|
+
</div>
|
|
23
|
+
<!-- 竖线连接 -->
|
|
24
|
+
<div class="milestone-line"></div>
|
|
25
|
+
<!-- 原点 -->
|
|
26
|
+
<div class="milestone-dot"></div>
|
|
27
|
+
</template>
|
|
28
|
+
<template v-else>
|
|
29
|
+
<!-- 原点 -->
|
|
30
|
+
<div class="milestone-dot"></div>
|
|
31
|
+
<!-- 竖线连接 -->
|
|
32
|
+
<div class="milestone-line"></div>
|
|
33
|
+
<!-- 信息面板 -->
|
|
34
|
+
<div class="milestone-info">
|
|
35
|
+
<div class="milestone-name">{{ item.name }}</div>
|
|
36
|
+
<!-- <div class="milestone-date">{{ dayjs(item.rq).format('YYYY-MM-DD') }}</div> -->
|
|
37
|
+
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="with-arrow"></div>
|
|
42
|
+
</div>
|
|
43
|
+
<BdEmpty v-else imgType="svg" :imgSize="50" des="没有查询到相关数据">
|
|
44
|
+
|
|
45
|
+
</BdEmpty>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script setup>
|
|
50
|
+
import { ref, computed } from 'vue';
|
|
51
|
+
// import { dayjs } from '../../../index.js'
|
|
52
|
+
import BdEmpty from '../../components/empty/empty.vue'
|
|
53
|
+
// 接收父组件传递的里程碑数据 const bgColor = ref('#0ea5e9') // 0ea5e9
|
|
54
|
+
const props = defineProps({
|
|
55
|
+
// 标注色
|
|
56
|
+
bgColor: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: 'radial-gradient(circle, rgba(78, 171, 237, 1) 0%, rgb(81, 151, 244) 51%, rgba(78, 171, 237, 1) 100%)'
|
|
59
|
+
},
|
|
60
|
+
milestones: {
|
|
61
|
+
type: Array,
|
|
62
|
+
required: true,
|
|
63
|
+
default: () => []
|
|
64
|
+
},
|
|
65
|
+
hideLast: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: true
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// 计算是否显示终点箭头
|
|
72
|
+
const showArrow = computed(() => !props.hideLast);
|
|
73
|
+
|
|
74
|
+
// 计算每个节点的位置(基于起始日期的时间占比)
|
|
75
|
+
const calculatePosition = (startDate) => {
|
|
76
|
+
if (props.milestones.length === 0) return 0;
|
|
77
|
+
const firstDate = new Date(props.milestones[0].rq);
|
|
78
|
+
const lastDate = new Date(props.milestones[props.milestones.length - 1].rq);
|
|
79
|
+
const currentDate = new Date(startDate);
|
|
80
|
+
const totalDays = (lastDate - firstDate) / (1000 * 60 * 60 * 24);
|
|
81
|
+
const daysPassed = (currentDate - firstDate) / (1000 * 60 * 60 * 24);
|
|
82
|
+
return (daysPassed / totalDays) * 100;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<style lang="scss" scoped>
|
|
88
|
+
$bgColor: v-bind(bgColor);
|
|
89
|
+
|
|
90
|
+
.milestone-container {
|
|
91
|
+
width: 99%;
|
|
92
|
+
// padding: 100px 0;
|
|
93
|
+
/* 增加上下内边距给上下节点留出空间 */
|
|
94
|
+
position: relative;
|
|
95
|
+
display: flex;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.milestone-track {
|
|
99
|
+
width: calc(100% - 100px);
|
|
100
|
+
height: 14px;
|
|
101
|
+
margin: 0 auto;
|
|
102
|
+
background-color: #e5e7eb;
|
|
103
|
+
position: relative;
|
|
104
|
+
// 新增:为轨道右侧留出箭头空间
|
|
105
|
+
padding-right: 16px;
|
|
106
|
+
margin-right: calc(50px - 16px);
|
|
107
|
+
margin-top: 100px;
|
|
108
|
+
|
|
109
|
+
.with-arrow {
|
|
110
|
+
position: absolute;
|
|
111
|
+
right: -16px; // 定位到轨道最右侧
|
|
112
|
+
top: 0;
|
|
113
|
+
height: 1px;
|
|
114
|
+
// width: 16px;
|
|
115
|
+
|
|
116
|
+
top: 50%;
|
|
117
|
+
// left: 0;
|
|
118
|
+
transform: translateY(-50%); // 垂直居中
|
|
119
|
+
// 使用边框实现实心三角形箭头
|
|
120
|
+
border-top: 13px solid transparent;
|
|
121
|
+
border-bottom: 13px solid transparent;
|
|
122
|
+
border-left: 22px solid#e5e7eb;
|
|
123
|
+
/* 箭头颜色与主题色一致 */
|
|
124
|
+
z-index: 999;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.milestone-item {
|
|
129
|
+
position: absolute;
|
|
130
|
+
// background-color: rgba(255, 0, 0, 0.285);
|
|
131
|
+
left: 0;
|
|
132
|
+
top: 0;
|
|
133
|
+
transform: translateX(-50%);
|
|
134
|
+
/* 只水平居中,垂直位置由odd/even控制 */
|
|
135
|
+
display: flex;
|
|
136
|
+
flex-direction: column;
|
|
137
|
+
align-items: center;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// 基数项(0,2,4...)在轨道上方
|
|
141
|
+
.odd-item {
|
|
142
|
+
top: -44px;
|
|
143
|
+
|
|
144
|
+
.milestone-info {
|
|
145
|
+
transform: translateY(calc(-100% - 1px));
|
|
146
|
+
/* 信息面板在原点上方 */
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// 偶数项(1,3,5...)在轨道下方
|
|
151
|
+
.even-item {
|
|
152
|
+
top: -3px;
|
|
153
|
+
|
|
154
|
+
.milestone-info {
|
|
155
|
+
transform: translateY(calc(100% + 2px));
|
|
156
|
+
/* 信息面板在原点下方 */
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// 竖线连接
|
|
161
|
+
.milestone-line {
|
|
162
|
+
width: 2px;
|
|
163
|
+
background: $bgColor;
|
|
164
|
+
position: absolute;
|
|
165
|
+
bottom: 0;
|
|
166
|
+
z-index: 1;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// 基数项竖线向上
|
|
170
|
+
.odd-item .milestone-line {
|
|
171
|
+
height: 50px;
|
|
172
|
+
bottom: 10px;
|
|
173
|
+
/* 从原点中心向上延伸 */
|
|
174
|
+
// transform: translateY(100%);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// 偶数项竖线向下
|
|
178
|
+
.even-item .milestone-line {
|
|
179
|
+
height: 50px;
|
|
180
|
+
top: 10px;
|
|
181
|
+
/* 从原点中心向下延伸 */
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.milestone-dot {
|
|
185
|
+
width: 20px;
|
|
186
|
+
height: 20px;
|
|
187
|
+
border-radius: 50%;
|
|
188
|
+
// background-color: #1652f8 ; //
|
|
189
|
+
background: $bgColor;
|
|
190
|
+
position: relative;
|
|
191
|
+
z-index: 2;
|
|
192
|
+
/* 确保原点在轨道上方 */
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.milestone-info {
|
|
196
|
+
text-align: center;
|
|
197
|
+
white-space: nowrap;
|
|
198
|
+
/* 防止文本换行 */
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.milestone-date {
|
|
202
|
+
font-size: 16px;
|
|
203
|
+
font-weight: bold;
|
|
204
|
+
color: #333;
|
|
205
|
+
margin-bottom: 4px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.milestone-name {
|
|
209
|
+
font-size: 15px;
|
|
210
|
+
color: #666;
|
|
211
|
+
font-weight: bold;
|
|
212
|
+
}
|
|
213
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## 里程碑组件
|
|
2
|
+
|
|
3
|
+
注意:最后一个时间为虚拟时间不显示,进行定位使用
|
|
4
|
+
|
|
5
|
+
import {Milestone} from '@bdsoft/element'
|
|
6
|
+
<Milestone :milestones="milestoneData" :hide-last="true"></Milestone >
|
|
7
|
+
|
|
8
|
+
const milestoneData = [
|
|
9
|
+
{ rq: '2018-7-5', name: '规划设计' },
|
|
10
|
+
{ rq: '2018-7-10', name: '钻试' },
|
|
11
|
+
{ rq: '2018-8-5', name: '测井' },
|
|
12
|
+
{ rq: '2018-8-11', name: '完井' },
|
|
13
|
+
{ rq: '2018-9-1', name: '投产' },
|
|
14
|
+
{ rq: '2018-9-8', name: '' }
|
|
15
|
+
];
|
|
Binary file
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @FileDescription: 核心指标统计组件
|
|
3
|
+
* @Author: 李兵泉
|
|
4
|
+
* @Date: 2025-11-26
|
|
5
|
+
* @LastEditors: 最后更新作者
|
|
6
|
+
* @LastEditTime: 最后更新时间
|
|
7
|
+
-->
|
|
8
|
+
<template>
|
|
9
|
+
<el-row :gutter="0" class="basicwarp" :style="{ height: height }">
|
|
10
|
+
<!-- 动态渲染指标项 valueColor-->
|
|
11
|
+
<el-col
|
|
12
|
+
v-for="(item, index) in indicators"
|
|
13
|
+
:key="index"
|
|
14
|
+
@click="handleIndicatorClick(item, index)"
|
|
15
|
+
:md="item.colSize || 4"
|
|
16
|
+
class="text-center mb-4"
|
|
17
|
+
style="cursor: pointer"
|
|
18
|
+
>
|
|
19
|
+
<BdCountUp
|
|
20
|
+
class="infor-intro-num user-created-count"
|
|
21
|
+
:title="item.title"
|
|
22
|
+
:id-name="item.key"
|
|
23
|
+
|
|
24
|
+
:endVal="item.value"
|
|
25
|
+
countSize="30px"
|
|
26
|
+
:color="item.valueColor || ''"
|
|
27
|
+
:countWeight="700"
|
|
28
|
+
@click="handleItemClick(item, index)"
|
|
29
|
+
>
|
|
30
|
+
</BdCountUp>
|
|
31
|
+
</el-col>
|
|
32
|
+
</el-row>
|
|
33
|
+
</template>
|
|
34
|
+
<script setup>
|
|
35
|
+
import { ref, watch, onMounted, onUnmounted, nextTick } from 'vue'
|
|
36
|
+
// import { useTransition } from '@vueuse/core'
|
|
37
|
+
import BdCountUp from '../../components/countup/index.vue'
|
|
38
|
+
|
|
39
|
+
// 定义自定义事件,用于向父组件传递点击信息
|
|
40
|
+
const emit = defineEmits(['indicator-click'])
|
|
41
|
+
// 存储每个指标的过渡值
|
|
42
|
+
const indicatorValues = ref({})
|
|
43
|
+
// 组件props定义
|
|
44
|
+
const props = defineProps({
|
|
45
|
+
height: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: '200px'
|
|
48
|
+
},
|
|
49
|
+
// 指标数据列表
|
|
50
|
+
indicators: {
|
|
51
|
+
type: Array,
|
|
52
|
+
default: () => []
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
const handleItemClick = (item, index) => {
|
|
57
|
+
// 触发自定义事件,传递点击的指标项数据和索引
|
|
58
|
+
if (item.onClick) {
|
|
59
|
+
item.onClick(item, index)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// 处理指标项点击事件
|
|
63
|
+
const handleIndicatorClick = (item, index) => {
|
|
64
|
+
// 触发自定义事件,传递点击的指标项数据和索引
|
|
65
|
+
emit('indicator-click', {
|
|
66
|
+
item, // 点击的指标项完整数据
|
|
67
|
+
index // 点击的指标项索引
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
watch(
|
|
72
|
+
() => props.indicators,
|
|
73
|
+
(newIndicators) => {
|
|
74
|
+
if (newIndicators && newIndicators.length > 0) {
|
|
75
|
+
// nextTick(() => {
|
|
76
|
+
// props.indicators.forEach(item => {
|
|
77
|
+
// indicatorValues.value[item.key] = useNumberTransition(ref(0), {
|
|
78
|
+
// duration: item.duration || 1000,
|
|
79
|
+
// })
|
|
80
|
+
// })
|
|
81
|
+
// });
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
immediate: true
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
// 初始化过渡动画
|
|
90
|
+
onMounted(() => {})
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<style lang="scss" scoped>
|
|
94
|
+
.basicwarp {
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
height: 100%;
|
|
98
|
+
width: 100%;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:deep(.el-statistic__head) {
|
|
102
|
+
font-size: 17px;
|
|
103
|
+
text-align: center;
|
|
104
|
+
color: #737070 !important;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
:deep(.el-statistic__content) {
|
|
108
|
+
font-size: 28px;
|
|
109
|
+
text-align: center;
|
|
110
|
+
font-weight: 600;
|
|
111
|
+
color: #737070 !important;
|
|
112
|
+
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
113
|
+
}
|
|
114
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
## 多指标显示组件
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
<MultiStatisticalCard :indicators="indicators" ></MultiStatisticalCard>
|
|
5
|
+
</template>
|
|
6
|
+
<script setup>
|
|
7
|
+
import { ref, reactive, computed, watch, onMounted } from "vue";
|
|
8
|
+
import { MultiStatisticalCard } from '@bdsoft/element'
|
|
9
|
+
|
|
10
|
+
const indicators = [
|
|
11
|
+
{ key: 'oil_prod_cum', title: '累计油量(t)', valueColor:'red',value: 5656 },
|
|
12
|
+
{ key: 'bncl', title: '本年产量(t)', valueColor:'red',value: 16 },
|
|
13
|
+
{ key: 'sncl', title: '上年产量(t)',valueColor:'red', value: 116 },
|
|
14
|
+
// { key: 'sncl2', title: '上年产量(t)', valueColor:'red',value: 116 },
|
|
15
|
+
{ key: 'zrcl', title: '昨日产量(t)',valueColor:'red', value: 2346 }
|
|
16
|
+
]
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
### 触发点击事件
|
|
20
|
+
|
|
21
|
+
<MultiStatisticalCard :indicators="indicators" @indicator-click="handleClick"></MultiStatisticalCard>
|
|
22
|
+
|
|
23
|
+
<script setup>
|
|
24
|
+
const handleClick = (data) => {
|
|
25
|
+
console.log('点击了指标项:', data.item);
|
|
26
|
+
console.log('指标项索引:', data.index);
|
|
27
|
+
// 处理点击逻辑
|
|
28
|
+
};
|
|
29
|
+
</script>
|
|
Binary file
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @FileDescription: 统计组件
|
|
3
|
+
* @Author: 李兵泉
|
|
4
|
+
* @Date: 2025-11-26
|
|
5
|
+
* @LastEditors: 最后更新作者
|
|
6
|
+
* @LastEditTime: 最后更新时间
|
|
7
|
+
-->
|
|
8
|
+
<template>
|
|
9
|
+
<!-- 投资总额卡片容器 -->
|
|
10
|
+
<div
|
|
11
|
+
class="investment-card"
|
|
12
|
+
:style="{ width: width }"
|
|
13
|
+
v-if="_datas && _datas != ''"
|
|
14
|
+
>
|
|
15
|
+
<!-- 循环渲染数据项(空数据则不显示) -->
|
|
16
|
+
<div class="data-item">
|
|
17
|
+
<!-- 标题行(带提示图标) -->
|
|
18
|
+
<div class="title-row">
|
|
19
|
+
<span class="title">{{ _datas[0]?.title }}</span>
|
|
20
|
+
<el-tooltip v-if="tip" :content="tip" placement="top">
|
|
21
|
+
<el-icon size="16px" class="info-icon"><question-filled /></el-icon>
|
|
22
|
+
</el-tooltip>
|
|
23
|
+
</div>
|
|
24
|
+
<!-- 数值行 -->
|
|
25
|
+
<div
|
|
26
|
+
class="value"
|
|
27
|
+
:style="{
|
|
28
|
+
color: _datas[0]?.valueColor || '#000',
|
|
29
|
+
cursor: _datas[0]?.onClick ? 'pointer' : 'default',
|
|
30
|
+
}"
|
|
31
|
+
@click="handleItemClick(_datas[0], 0)"
|
|
32
|
+
>
|
|
33
|
+
{{ _datas[0]?.value }}
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<div style="display: flex" @click="handleItemClick(_datas[1], 1)">
|
|
37
|
+
<!-- 数组 up2 -->
|
|
38
|
+
<div v-if="_datas[1]" class="extra-row">
|
|
39
|
+
<span class="extra-item">
|
|
40
|
+
{{ _datas[1]?.title }}
|
|
41
|
+
<span :class="['trend', _datas[1]?.trend === 'up' ? 'up' : 'down']">
|
|
42
|
+
{{ _datas[1]?.value }}
|
|
43
|
+
<el-icon class="trend-icon">
|
|
44
|
+
<component
|
|
45
|
+
:is="_datas[1]?.trend === 'up' ? 'caret-top' : 'caret-bottom'"
|
|
46
|
+
/>
|
|
47
|
+
</el-icon>
|
|
48
|
+
</span>
|
|
49
|
+
</span>
|
|
50
|
+
</div>
|
|
51
|
+
<!-- 数组 down3 -->
|
|
52
|
+
<div
|
|
53
|
+
v-if="_datas[2]"
|
|
54
|
+
class="extra-row"
|
|
55
|
+
style="margin-left: 10%"
|
|
56
|
+
@click="handleItemClick(_datas[2], 2)"
|
|
57
|
+
>
|
|
58
|
+
<span class="extra-item">
|
|
59
|
+
{{ _datas[2]?.title }}
|
|
60
|
+
<span :class="['trend', _datas[2]?.trend === 'up' ? 'up' : 'down']">
|
|
61
|
+
{{ _datas[2]?.value }}
|
|
62
|
+
<el-icon class="trend-icon">
|
|
63
|
+
<component
|
|
64
|
+
:is="_datas[2]?.trend === 'up' ? 'caret-top' : 'caret-bottom'"
|
|
65
|
+
/>
|
|
66
|
+
</el-icon>
|
|
67
|
+
</span>
|
|
68
|
+
</span>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
<el-divider style="margin: 10px 0" />
|
|
72
|
+
<div
|
|
73
|
+
v-if="_datas[3]"
|
|
74
|
+
class="extra-row"
|
|
75
|
+
@click="handleItemClick(_datas[3], 3)"
|
|
76
|
+
>
|
|
77
|
+
<span class="extra-item" style="color: #595858">
|
|
78
|
+
{{ _datas[3]?.title }}
|
|
79
|
+
<span class="trend">
|
|
80
|
+
{{ _datas[3]?.value }}
|
|
81
|
+
</span>
|
|
82
|
+
</span>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
86
|
+
|
|
87
|
+
<script setup>
|
|
88
|
+
import { ref, watch } from "vue";
|
|
89
|
+
|
|
90
|
+
const _datas = ref([]);
|
|
91
|
+
// 接收父组件传入的4组数据(数组,每个对象对应一组数据)
|
|
92
|
+
const props = defineProps({
|
|
93
|
+
// 组件默认宽度
|
|
94
|
+
width: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: "350px",
|
|
97
|
+
},
|
|
98
|
+
// 右上角提示信息
|
|
99
|
+
tip: {
|
|
100
|
+
type: String,
|
|
101
|
+
default: "",
|
|
102
|
+
},
|
|
103
|
+
// 数据列表 格式参考readme
|
|
104
|
+
dataList: {
|
|
105
|
+
type: Array,
|
|
106
|
+
default: () => [],
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
const handleItemClick = (item, index) => {
|
|
110
|
+
// 触发自定义事件,传递点击的指标项数据和索引
|
|
111
|
+
if (item && item.onClick) {
|
|
112
|
+
item.onClick(item, index);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
watch(
|
|
116
|
+
() => props.dataList,
|
|
117
|
+
(newVal) => {
|
|
118
|
+
if (newVal && newVal.length > 0) {
|
|
119
|
+
_datas.value = newVal;
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
immediate: true,
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
</script>
|
|
127
|
+
|
|
128
|
+
<style scoped>
|
|
129
|
+
.investment-card {
|
|
130
|
+
background: #fff;
|
|
131
|
+
border-radius: 8px;
|
|
132
|
+
padding: 12px;
|
|
133
|
+
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.data-item {
|
|
137
|
+
margin-bottom: 12px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.title-row {
|
|
141
|
+
display: flex;
|
|
142
|
+
justify-content: space-between;
|
|
143
|
+
align-items: center;
|
|
144
|
+
margin-bottom: 8px;
|
|
145
|
+
color: #666;
|
|
146
|
+
font-size: 14px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.info-icon {
|
|
150
|
+
cursor: pointer;
|
|
151
|
+
color: #999;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.value {
|
|
155
|
+
font-size: 28px;
|
|
156
|
+
font-weight: bold;
|
|
157
|
+
margin-bottom: 8px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.extra-row {
|
|
161
|
+
display: flex;
|
|
162
|
+
gap: 16px;
|
|
163
|
+
margin-bottom: 8px;
|
|
164
|
+
font-size: 14px;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.extra-item {
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
color: #999;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.trend {
|
|
174
|
+
margin-left: 4px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.trend.up {
|
|
178
|
+
color: #f56c6c;
|
|
179
|
+
/* 红色-上升 */
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.trend.down {
|
|
183
|
+
color: #67c23a;
|
|
184
|
+
/* 绿色-下降 */
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.trend-icon {
|
|
188
|
+
font-size: 12px;
|
|
189
|
+
margin-left: 2px;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.additional {
|
|
193
|
+
font-size: 14px;
|
|
194
|
+
color: #666;
|
|
195
|
+
}
|
|
196
|
+
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
## 统计数组组件
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<StatisticalCard :dataList="dataList" tip="投资总额说明111"></StatisticalCard>
|
|
7
|
+
</template>
|
|
8
|
+
<script setup>
|
|
9
|
+
import { ref, reactive, computed, watch, onMounted } from "vue";
|
|
10
|
+
import { StatisticalCard } from '@bdsoft/element'
|
|
11
|
+
|
|
12
|
+
const dataList = ref([
|
|
13
|
+
{
|
|
14
|
+
title: '总用户数',
|
|
15
|
+
value: 1024,
|
|
16
|
+
valueColor:'red',
|
|
17
|
+
trend: '',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
title: '活跃用户数',
|
|
21
|
+
value: 768,
|
|
22
|
+
valueColor:'',
|
|
23
|
+
trend: 'up',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
title: '新增用户数',
|
|
27
|
+
value: 256,
|
|
28
|
+
valueColor:'',
|
|
29
|
+
trend: 'down',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
title: '付费用户数',
|
|
33
|
+
value: 128,
|
|
34
|
+
valueColor:'',
|
|
35
|
+
trend: ''
|
|
36
|
+
}
|
|
37
|
+
]);
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<style lang="scss" scoped></style>
|
|
41
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
项目组件说明
|
package/vite.config.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import { fileURLToPath } from 'node:url'
|
|
3
|
+
import { resolve } from 'path'
|
|
4
|
+
import vueJsx from '@vitejs/plugin-vue-jsx'
|
|
5
|
+
import vue from '@vitejs/plugin-vue'
|
|
6
|
+
import importToConst from 'rollup-plugin-import-to-const'
|
|
7
|
+
|
|
8
|
+
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js'
|
|
9
|
+
|
|
10
|
+
export default defineConfig({
|
|
11
|
+
resolve: {
|
|
12
|
+
alias: {
|
|
13
|
+
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
14
|
+
'utils': fileURLToPath(new URL('./utils', import.meta.url)),
|
|
15
|
+
'global': fileURLToPath(new URL('./global', import.meta.url)),
|
|
16
|
+
'~': fileURLToPath(new URL('./src/assets', import.meta.url))
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
build: {
|
|
20
|
+
lib: {
|
|
21
|
+
entry: './index.js',
|
|
22
|
+
name: '@bdsoft/element',
|
|
23
|
+
fileName: 'BdElement', // 输出的包文件名
|
|
24
|
+
formats: ['es'] // 这是默认值 'umd','cjs',
|
|
25
|
+
},
|
|
26
|
+
// outDir: 'esaaa', // 根输出目录
|
|
27
|
+
minify: false,
|
|
28
|
+
rollupOptions: {
|
|
29
|
+
//忽略打包vue文件
|
|
30
|
+
external: ['vue', 'element-plus', '@element-plus/icons-vue', 'vue/server-renderer', '@vue/server-renderer'], // 这里列出你想排除的外部依赖
|
|
31
|
+
output: [
|
|
32
|
+
{
|
|
33
|
+
//配置打包根目录
|
|
34
|
+
dir: 'dist',
|
|
35
|
+
globals: {
|
|
36
|
+
vue: 'Vue',
|
|
37
|
+
'element-plus': 'ElementPlus',
|
|
38
|
+
'@element-plus/icons-vue': 'ElementPlusIconVue'
|
|
39
|
+
},
|
|
40
|
+
esModule: true // 强制 ES 模块输出格式的兼容性
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
// 优化依赖:提前预构建 dayjs,避免打包时解析错误
|
|
45
|
+
optimizeDeps: {
|
|
46
|
+
include: ['dayjs']
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
css: {
|
|
50
|
+
preprocessorOptions: {
|
|
51
|
+
scss: {
|
|
52
|
+
api: 'modern-compiler',
|
|
53
|
+
silenceDeprecations: ['legacy-js-api']
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
plugins: [vue(), vueJsx(), importToConst(), cssInjectedByJsPlugin()]
|
|
58
|
+
})
|