@bdsoft/element 1.1.0

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.
Files changed (238) hide show
  1. package/README.md +90 -0
  2. package/global/index.ts +6 -0
  3. package/global/register-properties.ts +10 -0
  4. package/index.html +13 -0
  5. package/index.js +84 -0
  6. package/package-form/core/components/formCreate.js +274 -0
  7. package/package-form/core/components/fragment.js +12 -0
  8. package/package-form/core/factory/context.js +257 -0
  9. package/package-form/core/factory/creator.js +63 -0
  10. package/package-form/core/factory/maker.js +17 -0
  11. package/package-form/core/factory/manager.js +79 -0
  12. package/package-form/core/factory/node.js +85 -0
  13. package/package-form/core/factory/parser.js +28 -0
  14. package/package-form/core/frame/api.js +599 -0
  15. package/package-form/core/frame/attrs.js +12 -0
  16. package/package-form/core/frame/dataDriver.js +76 -0
  17. package/package-form/core/frame/fetch.js +119 -0
  18. package/package-form/core/frame/formCreate.js +274 -0
  19. package/package-form/core/frame/index.js +760 -0
  20. package/package-form/core/frame/provider.js +288 -0
  21. package/package-form/core/frame/util.js +274 -0
  22. package/package-form/core/handler/context.js +380 -0
  23. package/package-form/core/handler/effect.js +122 -0
  24. package/package-form/core/handler/index.js +111 -0
  25. package/package-form/core/handler/inject.js +145 -0
  26. package/package-form/core/handler/input.js +197 -0
  27. package/package-form/core/handler/lifecycle.js +43 -0
  28. package/package-form/core/handler/loader.js +373 -0
  29. package/package-form/core/handler/page.js +46 -0
  30. package/package-form/core/handler/render.js +29 -0
  31. package/package-form/core/index.js +12 -0
  32. package/package-form/core/package.json +15 -0
  33. package/package-form/core/parser/html.js +17 -0
  34. package/package-form/core/render/cache.js +47 -0
  35. package/package-form/core/render/index.js +31 -0
  36. package/package-form/core/render/render.js +393 -0
  37. package/package-form/element-form/components/checkbox/package.json +17 -0
  38. package/package-form/element-form/components/checkbox/src/component.jsx +110 -0
  39. package/package-form/element-form/components/checkbox/src/index.js +3 -0
  40. package/package-form/element-form/components/frame/package.json +17 -0
  41. package/package-form/element-form/components/frame/src/IconCircleClose.vue +14 -0
  42. package/package-form/element-form/components/frame/src/IconDelete.vue +12 -0
  43. package/package-form/element-form/components/frame/src/IconDocument.vue +12 -0
  44. package/package-form/element-form/components/frame/src/IconFolderOpened.vue +12 -0
  45. package/package-form/element-form/components/frame/src/IconView.vue +12 -0
  46. package/package-form/element-form/components/frame/src/component.jsx +349 -0
  47. package/package-form/element-form/components/frame/src/index.js +3 -0
  48. package/package-form/element-form/components/frame/src/style.css +66 -0
  49. package/package-form/element-form/components/group/package.json +17 -0
  50. package/package-form/element-form/components/group/src/component.jsx +314 -0
  51. package/package-form/element-form/components/group/src/index.js +3 -0
  52. package/package-form/element-form/components/group/src/style.css +125 -0
  53. package/package-form/element-form/components/index.js +22 -0
  54. package/package-form/element-form/components/radio/package.json +17 -0
  55. package/package-form/element-form/components/radio/src/component.jsx +101 -0
  56. package/package-form/element-form/components/radio/src/index.js +3 -0
  57. package/package-form/element-form/components/select/package.json +17 -0
  58. package/package-form/element-form/components/select/src/component.jsx +52 -0
  59. package/package-form/element-form/components/select/src/index.js +3 -0
  60. package/package-form/element-form/components/subform/package.json +14 -0
  61. package/package-form/element-form/components/subform/src/component.jsx +76 -0
  62. package/package-form/element-form/components/subform/src/index.js +3 -0
  63. package/package-form/element-form/components/tree/package.json +17 -0
  64. package/package-form/element-form/components/tree/src/component.jsx +62 -0
  65. package/package-form/element-form/components/tree/src/index.js +3 -0
  66. package/package-form/element-form/components/upload/package.json +17 -0
  67. package/package-form/element-form/components/upload/src/IconUpload.vue +12 -0
  68. package/package-form/element-form/components/upload/src/component.jsx +129 -0
  69. package/package-form/element-form/components/upload/src/index.js +3 -0
  70. package/package-form/element-form/components/upload/src/style.css +11 -0
  71. package/package-form/element-form/index.js +8 -0
  72. package/package-form/element-form/package.json +16 -0
  73. package/package-form/element-form/src/components/icon/IconWarning.vue +12 -0
  74. package/package-form/element-form/src/components/index.js +22 -0
  75. package/package-form/element-form/src/core/alias.js +34 -0
  76. package/package-form/element-form/src/core/api.js +208 -0
  77. package/package-form/element-form/src/core/config.js +62 -0
  78. package/package-form/element-form/src/core/index.js +60 -0
  79. package/package-form/element-form/src/core/maker.js +76 -0
  80. package/package-form/element-form/src/core/manager.js +315 -0
  81. package/package-form/element-form/src/core/provider.js +79 -0
  82. package/package-form/element-form/src/parsers/datePicker.js +31 -0
  83. package/package-form/element-form/src/parsers/hidden.js +12 -0
  84. package/package-form/element-form/src/parsers/index.js +17 -0
  85. package/package-form/element-form/src/parsers/input.js +21 -0
  86. package/package-form/element-form/src/parsers/row.js +10 -0
  87. package/package-form/element-form/src/parsers/select.js +15 -0
  88. package/package-form/element-form/src/parsers/slider.js +21 -0
  89. package/package-form/element-form/src/parsers/timePicker.js +17 -0
  90. package/package-form/element-form/src/style/index.css +52 -0
  91. package/package.json +17 -0
  92. package/src/App.vue +28 -0
  93. package/src/assets/css/element.scss +179 -0
  94. package/src/assets/css/layout.scss +215 -0
  95. package/src/assets/css/tailwind.scss +67 -0
  96. package/src/assets/images/banner.gif +0 -0
  97. package/src/assets/images/banner.png +0 -0
  98. package/src/assets/images/bg1.svg +22 -0
  99. package/src/assets/images/bg2.png +0 -0
  100. package/src/assets/images/ff.png +0 -0
  101. package/src/assets/images/home-file1.png +0 -0
  102. package/src/assets/images/ky.png +0 -0
  103. package/src/assets/images/menu/add.png +0 -0
  104. package/src/assets/images/menu/del.png +0 -0
  105. package/src/assets/images/menu/down.png +0 -0
  106. package/src/assets/images/menu/dr.png +0 -0
  107. package/src/assets/images/menu/edit.png +0 -0
  108. package/src/assets/images/menu/kx.png +0 -0
  109. package/src/assets/images/menu/mb.png +0 -0
  110. package/src/assets/images/menu/pz.png +0 -0
  111. package/src/assets/images/menu/save.png +0 -0
  112. package/src/assets/images/menu/sj.png +0 -0
  113. package/src/assets/images/menu/sjk.png +0 -0
  114. package/src/assets/images/menu/up.png +0 -0
  115. package/src/assets/images/po-i.png +0 -0
  116. package/src/assets/images/po1-i1.png +0 -0
  117. package/src/assets/images/po1-i2.png +0 -0
  118. package/src/assets/images/po1-i3.png +0 -0
  119. package/src/assets/images/po1-i4.png +0 -0
  120. package/src/assets/images/po1-i5.png +0 -0
  121. package/src/assets/images/po1-i6.png +0 -0
  122. package/src/assets/images/po1-i7.png +0 -0
  123. package/src/assets/images/po1-i8.png +0 -0
  124. package/src/assets/images/po2-i1.png +0 -0
  125. package/src/assets/images/po2-i2.png +0 -0
  126. package/src/assets/images/po3-i1.png +0 -0
  127. package/src/assets/images/po4-i1.png +0 -0
  128. package/src/assets/images/po5-i1.png +0 -0
  129. package/src/assets/images/po6-i1.png +0 -0
  130. package/src/assets/images/po6-i2.png +0 -0
  131. package/src/assets/images/po7-i1.png +0 -0
  132. package/src/assets/images/tj1.png +0 -0
  133. package/src/assets/images/tj2.png +0 -0
  134. package/src/assets/images/tj3.png +0 -0
  135. package/src/components/3dcloudwords/index.js +346 -0
  136. package/src/components/3dcloudwords/index.vue +99 -0
  137. package/src/components/3dcloudwords/readme.md +66 -0
  138. package/src/components/badge/index.js +167 -0
  139. package/src/components/badge/index.scss +166 -0
  140. package/src/components/badge/index.vue +98 -0
  141. package/src/components/badge/readme.md +18 -0
  142. package/src/components/basic/Finish.vue +107 -0
  143. package/src/components/basic/button.vue +19 -0
  144. package/src/components/basic/readme.md +7 -0
  145. package/src/components/button/index.vue +48 -0
  146. package/src/components/button/readme.md +62 -0
  147. package/src/components/carousel/index.vue +104 -0
  148. package/src/components/carousel/readme.md +12 -0
  149. package/src/components/chartconfig/index.vue +141 -0
  150. package/src/components/chartconfig/readme.md +25 -0
  151. package/src/components/contextMenu/hookContxtMenu.js +41 -0
  152. package/src/components/contextMenu/index.vue +245 -0
  153. package/src/components/contextMenu/readme.md +55 -0
  154. package/src/components/contextMenu/useElementBounding.js +40 -0
  155. package/src/components/countup/countUp.js +196 -0
  156. package/src/components/countup/index.vue +112 -0
  157. package/src/components/countup/readme.md +9 -0
  158. package/src/components/empty/assets/build.png +0 -0
  159. package/src/components/empty/assets/emptybg.gif +0 -0
  160. package/src/components/empty/assets/emptybg.png +0 -0
  161. package/src/components/empty/assets/emptybg2.jpg +0 -0
  162. package/src/components/empty/assets/emptybg3.jpg +0 -0
  163. package/src/components/empty/assets/wuxiao.png +0 -0
  164. package/src/components/empty/assets/wuxiao.webp +0 -0
  165. package/src/components/empty/building.vue +117 -0
  166. package/src/components/empty/empty.vue +120 -0
  167. package/src/components/empty/index.js +12 -0
  168. package/src/components/empty/invalid.vue +56 -0
  169. package/src/components/error/Error.vue +79 -0
  170. package/src/components/error/readme.md +20 -0
  171. package/src/components/form/Form.vue +84 -0
  172. package/src/components/form/FormItem.vue +143 -0
  173. package/src/components/form/data.js +52 -0
  174. package/src/components/form/readme.md +69 -0
  175. package/src/components/layout/banner.vue +412 -0
  176. package/src/components/layout/bar.vue +43 -0
  177. package/src/components/layout/layout1.vue +60 -0
  178. package/src/components/layout/layout2.vue +134 -0
  179. package/src/components/layout/layout3.vue +107 -0
  180. package/src/components/layout/layout4.vue +66 -0
  181. package/src/components/layout/nav.vue +333 -0
  182. package/src/components/layout/readme.md +61 -0
  183. package/src/components/loading/index.vue +122 -0
  184. package/src/components/loading/readme.md +6 -0
  185. package/src/components/notice/NoticeList.vue +198 -0
  186. package/src/components/notice/NoticeListPaging.vue +281 -0
  187. package/src/components/notice/NoticeView.vue +92 -0
  188. package/src/components/notice/readme.md +1 -0
  189. package/src/components/pagination/index.vue +100 -0
  190. package/src/components/pagination/readme.md +19 -0
  191. package/src/components/pagination/scroll-to.js +51 -0
  192. package/src/components/progress/bar.vue +72 -0
  193. package/src/components/progress/progress.vue +58 -0
  194. package/src/components/screenfull/index.js +3 -0
  195. package/src/components/screenfull/index.vue +65 -0
  196. package/src/components/screenfull/package.json +15 -0
  197. package/src/components/screenfull/readme.md +6 -0
  198. package/src/components/statisticalCount/index.vue +80 -0
  199. package/src/components/statisticalCount/readme.md +21 -0
  200. package/src/components/username/index.vue +79 -0
  201. package/src/components/username/readme.md +22 -0
  202. package/src/components/username//346/225/210/346/236/234/345/233/276.png +0 -0
  203. package/src/index.js +82 -0
  204. package/src/utils/index.js +32 -0
  205. package/src/xm_components/HeadSearch/hook/hookSearch.js +96 -0
  206. package/src/xm_components/HeadSearch/index.vue +206 -0
  207. package/src/xm_components/HeadSearch/readme.md +12 -0
  208. package/src/xm_components/HeadSearch//346/220/234/347/264/242/345/210/227/350/241/250.png +0 -0
  209. package/src/xm_components/Milestone/index.vue +212 -0
  210. package/src/xm_components/Milestone/readme.md +15 -0
  211. package/src/xm_components/readme.md +1 -0
  212. package/utils/coms/load.jsx +10 -0
  213. package/utils/func.js +32 -0
  214. package/utils/hookDialog.js +38 -0
  215. package/utils/hookPage.js +49 -0
  216. package/utils/index.js +5 -0
  217. package/utils/lib/console.js +39 -0
  218. package/utils/lib/debounce.js +19 -0
  219. package/utils/lib/deepextend.js +51 -0
  220. package/utils/lib/deepset.js +14 -0
  221. package/utils/lib/extend.js +28 -0
  222. package/utils/lib/index.js +13 -0
  223. package/utils/lib/json.js +90 -0
  224. package/utils/lib/mergeprops.js +62 -0
  225. package/utils/lib/mitt.js +43 -0
  226. package/utils/lib/modify.js +8 -0
  227. package/utils/lib/slot.js +19 -0
  228. package/utils/lib/toarray.js +5 -0
  229. package/utils/lib/tocase.js +11 -0
  230. package/utils/lib/todate.js +10 -0
  231. package/utils/lib/toline.js +10 -0
  232. package/utils/lib/tostring.js +7 -0
  233. package/utils/lib/type.js +45 -0
  234. package/utils/lib/unique.js +6 -0
  235. package/utils/message.js +166 -0
  236. package/utils/package.json +16 -0
  237. package/utils/type.js +45 -0
  238. package/vite.config.js +51 -0
@@ -0,0 +1,51 @@
1
+ Math.easeInOutQuad = function (t, b, c, d) {
2
+ t /= d / 2
3
+ if (t < 1) {
4
+ return c / 2 * t * t + b
5
+ }
6
+ t--
7
+ return -c / 2 * (t * (t - 2) - 1) + b
8
+ }
9
+
10
+ // requestAnimationFrame for Smart Animating http://goo.gl/sx5sts
11
+ var requestAnimFrame = (function () {
12
+ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function (callback) { window.setTimeout(callback, 1000 / 60) }
13
+ })()
14
+
15
+ // because it's so fucking difficult to detect the scrolling element, just move them all
16
+ function move (amount) {
17
+ document.documentElement.scrollTop = amount
18
+ document.body.parentNode.scrollTop = amount
19
+ document.body.scrollTop = amount
20
+ }
21
+
22
+ function position () {
23
+ return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop
24
+ }
25
+
26
+ export function scrollTo (to, duration, callback) {
27
+ const start = position()
28
+ const change = to - start
29
+ const increment = 20
30
+ let currentTime = 0
31
+ duration = (typeof (duration) === 'undefined') ? 500 : duration
32
+ var animateScroll = function () {
33
+ // increment the time
34
+ currentTime += increment
35
+ // find the value with the quadratic in-out easing function
36
+ var val = Math.easeInOutQuad(currentTime, start, change, duration)
37
+ // move the document.body
38
+ move(val)
39
+ // do the animation unless its over
40
+ if (currentTime < duration) {
41
+ requestAnimFrame(animateScroll)
42
+ } else {
43
+ if (callback && typeof (callback) === 'function') {
44
+ // the animation is done so lets callback
45
+ callback()
46
+ }
47
+ }
48
+ }
49
+ animateScroll()
50
+ }
51
+
@@ -0,0 +1,72 @@
1
+ <!--
2
+ * @FileDescription: 状态条
3
+ * @Author: 李兵泉
4
+ * @Date: 2021-06-08 09 时
5
+ * @LastEditors: 最后更新作者
6
+ * @LastEditTime: 最后更新时间
7
+ -->
8
+ <template>
9
+ <div class="status-bar-container" :style="containerStyle">
10
+ <div class="bar" v-for="index in barCount" :key="index" :style="barStyle"></div>
11
+ </div>
12
+ </template>
13
+ <script setup>
14
+ import { ref, reactive, computed, watch, onMounted } from "vue";
15
+ const props = defineProps({
16
+ containerWidth: {
17
+ type: Number,
18
+ default: 80
19
+ },
20
+ bgcolor: {
21
+ type: String,
22
+ default: '#409eff'
23
+ },
24
+ barWidth: {
25
+ type: Number,
26
+ default: 3
27
+ },
28
+ barSpacing: {
29
+ type: Number,
30
+ default: 3
31
+ }
32
+ })
33
+ // const containerWidth = ref(200); // 容器宽度
34
+ // const containerHeight = ref(40); // 容器高度
35
+ const barWidth = ref(props.barWidth); // 长条宽度
36
+ const barSpacing = ref(props.barSpacing); // 长条间隔
37
+
38
+ const containerStyle = computed(() => ({
39
+ width: `100%`,
40
+ height: `100%`,
41
+ // backgroundColor: props.bgcolor, // 容器背景颜色,根据需要调整
42
+ display: 'flex',
43
+ flexDirection: 'row',
44
+ alignItems: 'stretch'
45
+ }));
46
+
47
+ const barCount = computed(() => {
48
+ // 计算可以放置多少个长条
49
+ const totalBarWidth = barWidth.value + barSpacing.value; // 单个长条总占用宽度
50
+ return Math.floor(props.containerWidth / totalBarWidth); // 计算可以放置的长条数量
51
+ });
52
+
53
+ const barStyle = computed(() => ({
54
+ width: `${barWidth.value}px`,
55
+ marginRight: `${barSpacing.value}px`,
56
+ backgroundColor: props.bgcolor // 长条颜色,根据需要调整
57
+ }));
58
+
59
+ </script>
60
+
61
+ <style lang="scss" scoped>
62
+ /* 容器和长条的基本样式 */
63
+ .status-bar-container {
64
+ overflow: hidden;
65
+ /* 隐藏多余的长条 */
66
+ }
67
+
68
+ .bar {
69
+ height: 100%;
70
+ /* 长条高度充满容器 */
71
+ }
72
+ </style>
@@ -0,0 +1,58 @@
1
+ <!--
2
+ * @FileDescription: 进度条内显示百分比标识
3
+ * @Author: 李兵泉
4
+ * @Date: 2021-06-08 09 时
5
+ * @LastEditors: 最后更新作者
6
+ * @LastEditTime: 最后更新时间
7
+ -->
8
+ <template>
9
+ <el-progress class="bd-progress" :color="bgcolor" :text-inside="true" striped :stroke-width="strokeWidth"
10
+ :percentage="percentage" />
11
+ </template>
12
+ <script setup>
13
+ import { ref, reactive, computed, watch, onMounted } from "vue";
14
+ const props = defineProps({
15
+ width: {
16
+ type: Number,
17
+ default: 20
18
+ },
19
+ bgcolor: {
20
+ type: String,
21
+ default: '#409eff'
22
+ },
23
+ strokeWidth: {
24
+ type: Number,
25
+ default: 20
26
+ },
27
+ percentage: {
28
+ type: Number,
29
+ default: 50
30
+ }
31
+ })
32
+
33
+ const getColor = computed(() => {
34
+ let p = props.percentage
35
+ if (p < 30) {
36
+ return '#67c23a'
37
+ } else if (p < 50) {
38
+ return '#ffa724'
39
+ } else if (p > 70) {
40
+ return '#f56c6c'
41
+ }
42
+ })
43
+ </script>
44
+
45
+ <style lang="scss" scoped>
46
+ .bd-progress {
47
+ :deep(.el-progress-bar) {
48
+ .el-progress-bar__outer {
49
+ border-radius: 5px !important;
50
+ background-color: #07215c;
51
+
52
+ .el-progress-bar__inner {
53
+ border-radius: 5px !important;
54
+ }
55
+ }
56
+ }
57
+ }
58
+ </style>
@@ -0,0 +1,3 @@
1
+ import BdScreenfull from './index.vue'
2
+ export default BdScreenfull;
3
+ export { BdScreenfull as Screenfull }
@@ -0,0 +1,65 @@
1
+
2
+ <template>
3
+ <div>
4
+ <slot/>
5
+ </div>
6
+ </template>
7
+
8
+ <script setup>
9
+ import { ref, onMounted, onBeforeUnmount } from 'vue'
10
+ import screenfull from 'screenfull'
11
+
12
+ // 定义响应式变量
13
+ const isFullscreen = ref(false)
14
+
15
+ // 处理点击事件
16
+ const click = () => {
17
+ if (!screenfull.enabled) {
18
+ alert('你的浏览器不支持全屏模式')
19
+ return false
20
+ }
21
+ screenfull.toggle()
22
+ }
23
+
24
+ // 处理全屏状态变化
25
+ const change = () => {
26
+ isFullscreen.value = screenfull.isFullscreen
27
+ }
28
+
29
+ // 初始化事件监听
30
+ const init = () => {
31
+ if (screenfull.enabled) {
32
+ screenfull.on('change', change)
33
+ }
34
+ }
35
+
36
+ // 销毁事件监听
37
+ const destroy = () => {
38
+ if (screenfull.enabled) {
39
+ screenfull.off('change', change)
40
+ }
41
+ }
42
+
43
+ // 组件挂载时初始化
44
+ onMounted(() => {
45
+ init()
46
+ })
47
+
48
+ // 组件卸载前销毁事件监听
49
+ onBeforeUnmount(() => {
50
+ destroy()
51
+ })
52
+ </script>
53
+
54
+ <style scoped>
55
+ .screenfull-svg {
56
+ display: inline-block;
57
+ cursor: pointer;
58
+ fill: #5a5e66;
59
+ width: 20px;
60
+ height: 20px;
61
+ vertical-align: 10px;
62
+ }
63
+
64
+ </style>
65
+
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@bdsoft/element-screenfull",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC",
12
+ "dependencies": {
13
+ "screenfull": "^6.0.2"
14
+ }
15
+ }
@@ -0,0 +1,6 @@
1
+
2
+ ## 全屏组件
3
+
4
+ ```
5
+ pnpm install @bdsoft/element-screenfull
6
+ ```
@@ -0,0 +1,80 @@
1
+ <!--
2
+ * @FileDescription: 统计数组件
3
+ * @Author: 李兵泉
4
+ * @Date: 2021-06-08 09 时
5
+ * @LastEditors: 最后更新作者
6
+ * @LastEditTime: 最后更新时间
7
+ -->
8
+ <template>
9
+ <el-row style="height: 100%;width: 100%;border-radius: 10px;padding:0 10px;" :style="{ background: bgColor }">
10
+ <el-col :span="10">
11
+ <div
12
+ style="width: 100%;padding: 10px 0;display: flex;align-items: center;justify-content: center;">
13
+ <img :src="countIcon" alt="" height="30px">
14
+ </div>
15
+ <div style="height: 30px;width: 100%;display: flex;justify-content: center; line-height: 30px;text-align: center;color: #fff;">
16
+ <span>{{ countTitle }}</span>
17
+ </div>
18
+ </el-col>
19
+ <el-col :span="14" style="display: flex;align-items: center;justify-content: center;">
20
+ <div class="stepnum">
21
+ <count-up :id-name="idName" class="infor-intro-num user-created-count" id-name="idName3"
22
+ :end-val="countNum" :countSize="1033" :countWeight="700"> </count-up>
23
+ <span class="dw">{{ countDw }}</span>
24
+ </div>
25
+ </el-col>
26
+ </el-row>
27
+ </template>
28
+
29
+ <script setup>
30
+ import { ref, reactive, computed, watch, onMounted } from "vue";
31
+
32
+ // import countUp from '../coms/countup/countUp.vue';
33
+ import countUp from '../countup/index.vue'
34
+ const props = defineProps({
35
+ idName: {
36
+ type: String,
37
+ default: ''
38
+ },
39
+ countTitle: {
40
+ type: String,
41
+ default: ''
42
+ },
43
+ countIcon: {
44
+ type: String,
45
+ default: ''
46
+ },
47
+ countNum: {
48
+ type: Number,
49
+ default: 0,
50
+ require:true
51
+ },
52
+ countDw: {
53
+ type: String,
54
+ default: ''
55
+ },
56
+ bgColor: {
57
+ type: String,
58
+ default: '#0b2f6a'
59
+ }
60
+ })
61
+
62
+ </script>
63
+ <style lang="scss" scoped>
64
+ .stepnum {
65
+ color: #fff;
66
+ font-size: 32px;
67
+ font-weight: 700;
68
+
69
+ .infor-intro-num {
70
+ display: inline-block;
71
+ }
72
+
73
+ .dw {
74
+ font-size: 12px;
75
+ line-height: 1;
76
+ font-weight: normal;
77
+ margin-left: 5px;
78
+ }
79
+ }
80
+ </style>
@@ -0,0 +1,21 @@
1
+ ## 统计数组件
2
+
3
+
4
+ ```
5
+ import { BdStatisticalCount } from '@bdsoft/element'
6
+
7
+ <el-row style="height: 100px;margin-bottom: 10px;">
8
+ <el-col :span="12" style="padding: 10px;">
9
+ <BdStatisticalCount :idName="'id1'" :countTitle="'云服务器'" :countIcon="'count/yfwq.png'"
10
+ :countNum="statistics.servernum" :countDw="''"
11
+ bgColor=" linear-gradient( 135deg, #FDD819 10%, #E80505 100%)">
12
+ </BdStatisticalCount>
13
+ </el-col>
14
+ <el-col :span="12" style="padding: 10px;">
15
+ <BdStatisticalCount :idName="'id3'" :countTitle="'专业软件'" :countIcon="'syslog/yingyong1.png'"
16
+ :countNum="statistics.modulecount" :countDw="''"
17
+ :bgColor="'linear-gradient( 135deg, #6B73FF 10%, #000DFF 100%)'">
18
+ </BdStatisticalCount>
19
+ </el-col>
20
+ </el-row>
21
+ ```
@@ -0,0 +1,79 @@
1
+ <!--
2
+ * @FileDescription: 名字组件
3
+ * @Author: 李兵泉
4
+ * @Date: 2025-06-08 09 时
5
+ * @LastEditors: 最后更新作者
6
+ * @LastEditTime: 最后更新时间
7
+ -->
8
+ <template>
9
+ <div
10
+ class="name-container"
11
+ :style="{
12
+ backgroundColor: bgColor === 'random' ? getRandomColor() : bgColor,
13
+ color: textColor,
14
+ width: width,
15
+ height: height
16
+ }"
17
+ >
18
+ {{ displayName }}
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+ export default {
24
+ props: {
25
+ name: {
26
+ type: String,
27
+ required: true
28
+ },
29
+ // 定义背景颜色 传递random则随机生成颜色
30
+ bgColor: {
31
+ type: String,
32
+ default: '#007BFF'
33
+ },
34
+ // 定义文字颜色
35
+ textColor: {
36
+ type: String,
37
+ default: '#FFFFFF'
38
+ },
39
+ // 定义组件的宽高
40
+ width: {
41
+ type: String,
42
+ default: '28px'
43
+ },
44
+ height: {
45
+ type: String,
46
+ default: '28px'
47
+ }
48
+ },
49
+ computed: {
50
+ displayName() {
51
+ return this.name.slice(-2)
52
+ }
53
+ },
54
+ methods: {
55
+ getRandomColor() {
56
+ const letters = '0123456789ABCDEF'
57
+ let color = '#'
58
+ for (let i = 0; i < 6; i++) {
59
+ color += letters[Math.floor(Math.random() * 16)]
60
+ }
61
+ return color
62
+ }
63
+ }
64
+ }
65
+ </script>
66
+
67
+ <style scoped>
68
+ .name-container {
69
+ display: flex;
70
+ justify-content: center;
71
+ align-items: center;
72
+ width: 30px;
73
+ height: 30px;
74
+ border-radius: 50%;
75
+ font-size: 12px;
76
+ margin-right: 10px;
77
+ /* font-weight: bold; */
78
+ }
79
+ </style>
@@ -0,0 +1,22 @@
1
+
2
+ ## 名字组件
3
+ 功能:
4
+ 1. 显示用户名称(后两位)
5
+ 2. 随机背景色(bgColor="random")
6
+ 3. 修改组件宽高
7
+
8
+ 使用方法:
9
+
10
+ ```
11
+ import { BdUserName } from '@bdsoft/element'
12
+
13
+
14
+ <el-table-column label="用户名称" prop="user_name" width="200" show-overflow-tooltip>
15
+ <template #default="scope">
16
+ <span style="display: flex; align-items: center">
17
+ <BdUserName :name="scope.row.user_name" bgColor="random"></BdUserName>
18
+ {{ scope.row.user_name }}
19
+ </span>
20
+ </template>
21
+ </el-table-column>
22
+ ```
package/src/index.js ADDED
@@ -0,0 +1,82 @@
1
+ // 导出element 开发的相关的界面
2
+ import BdEmpty from './components/empty/empty.vue'
3
+ import BdInvalid from './components/empty/invalid.vue' // 无效页面组件
4
+ import BdBuilding from './components/empty/building.vue'
5
+ import BdBar from './components/layout/bar.vue'
6
+ import BdNav from './components/layout/nav.vue'
7
+ import BdBadge from './components/badge/index.vue'
8
+ import BdLayout1 from './components/layout/layout1.vue'
9
+ import BdLayout2 from './components/layout/layout2.vue'
10
+ import BdLayout3 from './components/layout/layout3.vue'
11
+ import BdLayout4 from './components/layout/layout4.vue'
12
+ // 搜索框组件
13
+ import HeadSearch from './xm_components/HeadSearch/index.vue'
14
+ // 里程碑组件
15
+ import Milestone from './xm_components/Milestone/index.vue'
16
+ import BDCarousel from './components/carousel/index.vue'
17
+ import BdFormItem from './components/form/FormItem.vue'
18
+ import BdForm from './components/form/Form.vue'
19
+ import Notice from './components/notice/NoticeList.vue'
20
+ import NoticePage from './components/notice/NoticeListPaging.vue'
21
+ import NoticeView from './components/notice/NoticeView.vue'
22
+ // 完成提示动画组件
23
+ import BdFinish from './components/basic/Finish.vue'
24
+ // 计数组件
25
+ import BdCountUp from './components/countup/index.vue'
26
+ // 按钮组件
27
+ import BdButton from './components/button/index.vue'
28
+ // 进度条
29
+ import BDProgress from './components/progress/progress.vue'
30
+ import BDProgressBar from './components/progress/bar.vue'
31
+ // 分页组件
32
+ import BdPagination from './components/pagination/index.vue'
33
+ // 词云组件
34
+ import BdWordsCloud from './components/3dcloudwords/index.vue'
35
+ // 右键菜单
36
+ import BdContextMenu from './components/contextMenu/index.vue'
37
+ // loading菜单
38
+ import BdLoading from './components/loading/index.vue'
39
+ // 异常页面
40
+ import BdError from './components/error/Error.vue'
41
+ // 名字组件
42
+ import BdUserName from './components/username/index.vue'
43
+ // 图表属性配置组件
44
+ import BdChartConfig from './components/chartconfig/index.vue'
45
+ // 统计数+图标组件
46
+ import BdStatisticalCount from './components/statisticalCount/index.vue'
47
+
48
+
49
+ export {
50
+ BdStatisticalCount,
51
+ BdBuilding,
52
+ BdChartConfig,
53
+ BdUserName,
54
+ BdError,
55
+ BdLoading,
56
+ BdContextMenu,
57
+ BdWordsCloud,
58
+ BdPagination,
59
+ BdNav,
60
+ BdBar,
61
+ BdBadge,
62
+ BdLayout1,
63
+ BdLayout2,
64
+ BdLayout3,
65
+ BdLayout4,
66
+ HeadSearch,
67
+ Milestone,
68
+ BdEmpty,
69
+ BdInvalid,
70
+ BDCarousel,
71
+ BDProgress,
72
+ BDProgressBar,
73
+ BdFormItem,
74
+ BdForm,
75
+ Notice,
76
+ NoticePage,
77
+ NoticeView,
78
+ BdButton,
79
+ BdCountUp,
80
+ BdFinish
81
+ }
82
+
@@ -0,0 +1,32 @@
1
+ export const headerCellStyle = { color: '#999', backgroundColor: '#F5F6FA', height: '40px', fontSize: '14px', fontWeight: 'normal', color: '#666' }
2
+
3
+ /**
4
+ * 日期格式化
5
+ * @param {*} time
6
+ * @param {*} format
7
+ * @returns
8
+ */
9
+ export function parseTime(time, format) {
10
+ if (!time) return ''
11
+ var t = new Date(time)
12
+ var tf = function (i) {
13
+ return (i < 10 ? '0' : '') + i
14
+ }
15
+ return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function (a) {
16
+ switch (a) {
17
+ case 'yyyy':
18
+ return tf(t.getFullYear())
19
+ case 'MM':
20
+ return tf(t.getMonth() + 1)
21
+ case 'mm':
22
+ return tf(t.getMinutes())
23
+ case 'dd':
24
+ return tf(t.getDate())
25
+ case 'HH':
26
+ return tf(t.getHours())
27
+ case 'ss':
28
+ return tf(t.getSeconds())
29
+ }
30
+ })
31
+ }
32
+
@@ -0,0 +1,96 @@
1
+ import { ref, reactive, onMounted, nextTick } from 'vue'
2
+
3
+ /**
4
+ *
5
+ * @param {*} prefix 前缀,解决项目冲突
6
+ * @returns
7
+ */
8
+ export default function useSearrch(prefix = '') {
9
+ const searchkeysArr = ref([])
10
+ const search_drop = ref(false)
11
+ const keyName = ref('')
12
+ /**
13
+ * 获取缓存搜索数据
14
+ * @returns
15
+ */
16
+ const getStorageKeys = () => {
17
+ var keys = localStorage.getItem('searchRerportkeys')
18
+
19
+ if (keys && keys !== 'undefined' && keys !== 'null') {
20
+ keys = JSON.parse(keys)
21
+ return keys
22
+ }
23
+ return []
24
+ }
25
+
26
+ /**
27
+ * 鼠标foucs
28
+ */
29
+ const focusfns = (type) => {
30
+ searchkeysArr.value = getStorageKeys()
31
+
32
+ if (type === 1 && searchkeysArr.value.length > 0) {
33
+ search_drop.value = true
34
+ } else {
35
+ setTimeout(function () {
36
+ nextTick(function () {
37
+ search_drop.value = false
38
+ })
39
+ }, 200)
40
+ }
41
+ }
42
+
43
+ /**
44
+ * 保存搜索记录
45
+ * @param {*} key
46
+ */
47
+ const setSearchKeys = (key) => {
48
+ if (!key || key == null || key == '' || key == 'null') return
49
+ let keys = localStorage.getItem('searchRerportkeys')
50
+
51
+ if (keys && keys !== 'undefined' && keys !== '{}') {
52
+ keys = JSON.parse(keys)
53
+
54
+ if (keys.length > 5 && keys instanceof Array) {
55
+ keys.splice(0, 1)
56
+ }
57
+ keys.push(key)
58
+
59
+ let keys2 = [...new Set(keys)]
60
+
61
+ localStorage.setItem('searchRerportkeys', JSON.stringify(keys2))
62
+ } else {
63
+ keys = []
64
+ keys.push(key)
65
+ localStorage.setItem('searchRerportkeys', JSON.stringify(keys))
66
+ }
67
+ }
68
+
69
+ // 在hookSearch.js中添加
70
+ const deleteSearchItem = (index) => {
71
+ debugger
72
+ // 删除数组中对应索引的记录
73
+ searchkeysArr.value.splice(index, 1)
74
+ // 同步更新本地存储
75
+ localStorage.setItem('searchRerportkeys', JSON.stringify(searchkeysArr.value))
76
+ }
77
+
78
+ /**
79
+ * 赋值文本
80
+ * @param {*} val
81
+ */
82
+ const setTxt = (val) => {
83
+ keyName.value = val
84
+ }
85
+
86
+ return {
87
+ keyName,
88
+ searchkeysArr,
89
+ search_drop,
90
+ focusfns,
91
+ setTxt,
92
+ deleteSearchItem,
93
+ setSearchKeys,
94
+ getStorageKeys
95
+ }
96
+ }