nubomed-ui 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. package/.env.bi +13 -0
  2. package/.env.terminal +13 -0
  3. package/.vscode/extensions.json +3 -0
  4. package/README.md +17 -0
  5. package/index.html +13 -0
  6. package/nubomed-ui/nubomed-ui.es.js +2005 -0
  7. package/nubomed-ui/nubomed-ui.umd.js +1 -0
  8. package/nubomed-ui/style.css +1 -0
  9. package/package.json +19 -7
  10. package/src/App.vue +31 -0
  11. package/src/bi-demos/Header.vue +29 -0
  12. package/src/bi-demos/Table.vue +69 -0
  13. package/src/bi-demos/index.vue +132 -0
  14. package/src/bi-packages/components/Box/images/corner-error.png +0 -0
  15. package/src/bi-packages/components/Box/images/corner-warning.png +0 -0
  16. package/src/bi-packages/components/Box/images/corner.png +0 -0
  17. package/src/bi-packages/components/Box/index.scss +86 -0
  18. package/src/bi-packages/components/Box/index.vue +53 -0
  19. package/src/bi-packages/components/Carousel/CarouselItem.vue +0 -0
  20. package/src/bi-packages/components/Carousel/index.vue +0 -0
  21. package/src/bi-packages/components/Header/images/left-bg.png +0 -0
  22. package/src/bi-packages/components/Header/images/logo.png +0 -0
  23. package/src/bi-packages/components/Header/images/right-bg.png +0 -0
  24. package/src/bi-packages/components/Header/index.scss +50 -0
  25. package/src/bi-packages/components/Header/index.vue +54 -0
  26. package/src/bi-packages/components/Table/TableColgroup.vue +43 -0
  27. package/src/bi-packages/components/Table/index copy.vue +107 -0
  28. package/src/bi-packages/components/Table/index.scss +118 -0
  29. package/src/bi-packages/components/Table/index.vue +108 -0
  30. package/src/bi-packages/components/TableColumn/index.scss +7 -0
  31. package/src/bi-packages/components/TableColumn/index.vue +60 -0
  32. package/src/bi-packages/fonts/OPPOSans-B.ttf +0 -0
  33. package/src/bi-packages/fonts/OPPOSans-M.ttf +0 -0
  34. package/src/bi-packages/fonts/font.scss +11 -0
  35. package/src/bi-packages/iconfont-svg/demo.css +539 -0
  36. package/src/bi-packages/iconfont-svg/demo_index.html +4811 -0
  37. package/src/bi-packages/iconfont-svg/iconfont.css +819 -0
  38. package/src/bi-packages/iconfont-svg/iconfont.js +1 -0
  39. package/src/bi-packages/iconfont-svg/iconfont.json +1416 -0
  40. package/src/bi-packages/iconfont-svg/iconfont.ttf +0 -0
  41. package/src/bi-packages/iconfont-svg/iconfont.woff +0 -0
  42. package/src/bi-packages/iconfont-svg/iconfont.woff2 +0 -0
  43. package/src/bi-packages/index.js +34 -0
  44. package/src/bi-packages/styles/mixin.scss +12 -0
  45. package/src/bi-packages/styles/var.scss +11 -0
  46. package/src/demos/ActionBar.vue +59 -0
  47. package/src/demos/Badge.vue +28 -0
  48. package/src/demos/Button copy.vue +302 -0
  49. package/src/demos/Button.vue +116 -0
  50. package/src/demos/ButtonGroup.vue +40 -0
  51. package/src/demos/Check.vue +29 -0
  52. package/src/demos/Dialog.vue +255 -0
  53. package/src/demos/Empty.vue +38 -0
  54. package/src/demos/FooterMenu.vue +49 -0
  55. package/src/demos/Header.vue +71 -0
  56. package/src/demos/Icons.vue +314 -0
  57. package/src/demos/Input.vue +87 -0
  58. package/src/demos/InputKeyboard.vue +30 -0
  59. package/src/demos/InputNumber.vue +34 -0
  60. package/src/demos/LeftMenu.vue +128 -0
  61. package/src/demos/Menus.vue +106 -0
  62. package/src/demos/OpenCabinetBall.vue +37 -0
  63. package/src/demos/Statusbar.vue +146 -0
  64. package/src/demos/Steps.vue +45 -0
  65. package/src/demos/Tost.vue +35 -0
  66. package/src/demos/button/button.md +19 -0
  67. package/src/demos/data/terList.json +145 -0
  68. package/src/demos/images/cabinets/H3000-D.png +0 -0
  69. package/src/demos/images/cabinets/H3000-R.png +0 -0
  70. package/src/demos/images/cabinets/H3000-Rh.png +0 -0
  71. package/src/demos/images/cabinets/H3000-Rh2.png +0 -0
  72. package/src/demos/images/cabinets/H3010-R.png +0 -0
  73. package/src/demos/index.vue +348 -0
  74. package/src/docs/icons/Icon.vue +72 -0
  75. package/src/docs/icons/icon.md +21 -0
  76. package/src/docs/index.html +15 -0
  77. package/src/docs/index.vue +301 -0
  78. package/src/main.js +23 -0
  79. package/src/packages/components/ActionBar/images/error.png +0 -0
  80. package/src/packages/components/ActionBar/images/loading.gif +0 -0
  81. package/src/packages/components/ActionBar/images/success.png +0 -0
  82. package/src/packages/components/ActionBar/images/warning.png +0 -0
  83. package/src/packages/components/ActionBar/images/warning_yellow.png +0 -0
  84. package/src/packages/components/ActionBar/index.scss +81 -0
  85. package/src/packages/components/ActionBar/index.vue +100 -0
  86. package/src/packages/components/Badge/index.scss +50 -0
  87. package/src/packages/components/Badge/index.vue +75 -0
  88. package/src/packages/components/Button/index.scss +241 -0
  89. package/src/packages/components/Button/index.vue +111 -0
  90. package/src/packages/components/ButtonGroup/index.scss +54 -0
  91. package/src/packages/components/ButtonGroup/index.vue +75 -0
  92. package/src/packages/components/Check/Cate.vue +138 -0
  93. package/src/packages/components/Check/index.scss +47 -0
  94. package/src/packages/components/Check/index.vue +105 -0
  95. package/src/packages/components/Dialog/images/error.png +0 -0
  96. package/src/packages/components/Dialog/images/success.png +0 -0
  97. package/src/packages/components/Dialog/images/warning-red.png +0 -0
  98. package/src/packages/components/Dialog/images/warning-yellow.png +0 -0
  99. package/src/packages/components/Dialog/index.scss +154 -0
  100. package/src/packages/components/Dialog/index.vue +305 -0
  101. package/src/packages/components/Empty/images/empty-abnormal.png +0 -0
  102. package/src/packages/components/Empty/images/empty-data.png +0 -0
  103. package/src/packages/components/Empty/images/empty-search.png +0 -0
  104. package/src/packages/components/Empty/index.vue +68 -0
  105. package/src/packages/components/Form/FormItem.vue +73 -0
  106. package/src/packages/components/Form/index.vue +76 -0
  107. package/src/packages/components/Icon/index.vue +30 -0
  108. package/src/packages/components/Input/index.scss +184 -0
  109. package/src/packages/components/Input/index.vue +189 -0
  110. package/src/packages/components/InputKeyboard/index.scss +63 -0
  111. package/src/packages/components/InputKeyboard/index.vue +117 -0
  112. package/src/packages/components/InputNumber/index.scss +103 -0
  113. package/src/packages/components/InputNumber/index.vue +160 -0
  114. package/src/packages/components/Menu/index.scss +559 -0
  115. package/src/packages/components/Menu/index.vue +211 -0
  116. package/src/packages/components/OpenCabinetBall/CabinetStatus.vue +94 -0
  117. package/src/packages/components/OpenCabinetBall/index.scss +204 -0
  118. package/src/packages/components/OpenCabinetBall/index.vue +113 -0
  119. package/src/packages/components/Statusbar/CabinetList.vue +125 -0
  120. package/src/packages/components/Statusbar/CabinetListStatus.vue +75 -0
  121. package/src/packages/components/Statusbar/CabinetListTempHum.vue +108 -0
  122. package/src/packages/components/Statusbar/index.scss +205 -0
  123. package/src/packages/components/Statusbar/index.vue +83 -0
  124. package/src/packages/components/Steps/index.scss +104 -0
  125. package/src/packages/components/Steps/index.vue +66 -0
  126. package/src/packages/components/SvgIcon/index.vue +41 -0
  127. package/src/packages/components/Toast/index.vue +72 -0
  128. package/src/packages/fonts/OPPOSans-B.ttf +0 -0
  129. package/src/packages/fonts/OPPOSans-M.ttf +0 -0
  130. package/src/packages/fonts/font.scss +11 -0
  131. package/src/packages/iconfont-svg/demo.css +539 -0
  132. package/src/packages/iconfont-svg/demo_index.html +4811 -0
  133. package/src/packages/iconfont-svg/iconfont.css +819 -0
  134. package/src/packages/iconfont-svg/iconfont.js +1 -0
  135. package/src/packages/iconfont-svg/iconfont.json +1416 -0
  136. package/src/packages/iconfont-svg/iconfont.ttf +0 -0
  137. package/src/packages/iconfont-svg/iconfont.woff +0 -0
  138. package/src/packages/iconfont-svg/iconfont.woff2 +0 -0
  139. package/src/packages/index.js +64 -0
  140. package/src/packages/styles/var.scss +24 -0
  141. package/src/utils/create.js +48 -0
  142. package/src/utils/index.js +13 -0
  143. package/src/utils/validate.js +3 -0
  144. package/vite.config.js +47 -0
  145. package/nubomed-ui.es.js +0 -152
  146. package/nubomed-ui.umd.js +0 -1
  147. package/style.css +0 -1
@@ -0,0 +1,211 @@
1
+ <!--
2
+ * @Author: chenghuan.dong
3
+ * @Date: 2023-06-29 14:51:21
4
+ * @LastEditors: chenghuan.dong
5
+ * @LastEditTime: 2023-07-25 17:35:09
6
+ * @Description: 菜单导航栏
7
+ -->
8
+ <template>
9
+ <div :class="classes">
10
+ <!-- 侧边栏 -->
11
+ <template v-if="position === 'left'">
12
+ <slot name="header"></slot>
13
+ <div v-if="title" :class="bem('title')">{{ title }}</div>
14
+ <ul v-for="(list, g) in leftMenus" :key="g" :class="bem('group')">
15
+ <li
16
+ v-for="(item, index) in list"
17
+ :key="index"
18
+ :class="itemClass(item, index)"
19
+ @click="handleChange(item, index)"
20
+ >
21
+ <nb-icon v-if="item.icon" :icon="item.icon" :class="bem('item__icon')" />
22
+ <div :class="bem('item__text')">
23
+ <nb-badge :value="item.badge" :hidden="!item.badge">{{ item.text }}</nb-badge>
24
+ </div>
25
+ <span v-if="item.hasOwnProperty('count')" :class="bem('item__count')">{{ item.count }}</span>
26
+ <nb-icon v-if="item.showArrow" icon="arrow-right" :class="bem('item__arrow')" />
27
+ </li>
28
+ </ul>
29
+ </template>
30
+
31
+ <!-- 底部导航 -->
32
+ <template v-if="position === 'footer'">
33
+ <div v-for="(item, index) in data" :key="index" :class="itemClass(item, index)">
34
+ <div :class="bem('item__text')" @click="handleChange(item, index)">
35
+ <span
36
+ >{{ item.text }}<i v-if="getBadge(item.badge)">{{ getBadge(item.badge) }}</i></span
37
+ >
38
+ </div>
39
+ <nb-icon v-if="index < data.length - 1" :class="bem('item__arrow')" icon="caret-right" />
40
+ </div>
41
+ </template>
42
+
43
+ <!-- 标题栏 -->
44
+ <template v-if="position === 'header'">
45
+ <div v-if="showBack" :class="bem('back')" @click="handleBack">
46
+ <nb-icon icon="back" />
47
+ <span :class="bem('back__text')">{{ backText }}</span>
48
+ </div>
49
+ <slot name="left" />
50
+ <ul v-if="data.length" :class="bem('menus')">
51
+ <li v-for="(item, index) in data" :key="index" :class="itemClass(item, index)">
52
+ <div :class="bem('item__text')" @click="handleChange(item, index)">
53
+ <span>{{ item.text }}</span>
54
+ </div>
55
+ </li>
56
+ </ul>
57
+ <!-- 标题,支持插槽 -->
58
+ <div v-if="title || $slots.title" :class="bem('title')">
59
+ <slot name="title">{{ title }}</slot>
60
+ </div>
61
+
62
+ <slot name="right" />
63
+
64
+ <div v-if="showLogout" :class="bem('logout')" @click="handleLogout">
65
+ <nb-icon icon="logout" />
66
+ <span :class="bem('logout__text')"
67
+ >退出
68
+ <template v-if="logoutTime > -1">({{ logoutTime }}s)</template>
69
+ </span>
70
+ </div>
71
+ </template>
72
+
73
+ <!-- 宫格菜单 -->
74
+ <template v-if="position === 'grid'">
75
+ <div v-for="(item, index) in data" :key="index" class="nb-menu__item" @click.stop="handleClickGrid(item)">
76
+ <nb-badge :value="getBadge(item.badge)">
77
+ <nb-icon :icon="item.icon" class="nb-menu__item__icon" />
78
+ </nb-badge>
79
+ <div>
80
+ <div class="nb-menu__item__name">{{ item.name }}</div>
81
+ <div class="nb-menu__item__desc">{{ item.desc }}</div>
82
+ </div>
83
+ </div>
84
+ </template>
85
+ </div>
86
+ </template>
87
+ <script setup>
88
+ import { ref, computed } from 'vue'
89
+ import { createNamespace } from '../../../utils/create.js'
90
+
91
+ const [name, bem] = createNamespace('menu')
92
+
93
+ // 定义名称
94
+ defineOptions({
95
+ name: 'nbMenu'
96
+ })
97
+
98
+ // 定义props
99
+ const props = defineProps({
100
+ // 位置,left-左侧菜单,footer-底部导航,header-头部导航,grid-宫格菜单
101
+ position: {
102
+ type: String,
103
+ required: true
104
+ },
105
+ // 标题
106
+ title: String,
107
+ // 值
108
+ data: {
109
+ type: Array,
110
+ required: true,
111
+ default: () => {
112
+ return []
113
+ }
114
+ },
115
+ // 当前选择的菜单,对应data里的value值
116
+ active: {
117
+ type: [String, Number],
118
+ default: '',
119
+ required: true
120
+ },
121
+ // header - 是否显示返回
122
+ showBack: {
123
+ type: Boolean,
124
+ default: true
125
+ },
126
+ // header - 返回文字
127
+ backText: {
128
+ type: String,
129
+ default: '返回'
130
+ },
131
+ // header - 是否显示退出
132
+ showLogout: {
133
+ type: Boolean,
134
+ default: true
135
+ },
136
+ // header - 退出倒计时(大于-1才显示)
137
+ logoutTime: {
138
+ type: Number,
139
+ default: -1
140
+ }
141
+ })
142
+
143
+ // 定义emits
144
+ const emits = defineEmits(['change', 'back', 'logout', 'clickGrid'])
145
+
146
+ // 菜单集合
147
+ const leftMenus = computed(() => {
148
+ if (props.position === 'left') {
149
+ if (Array.isArray(props.data[0])) {
150
+ return props.data
151
+ } else {
152
+ return [props.data]
153
+ }
154
+ }
155
+ return []
156
+ })
157
+
158
+ // 样式
159
+ const classes = bem([props.position, props.position === 'grid' ? `grid--${props.data.length}` : ''])
160
+
161
+ // 菜单项样式
162
+ const itemClass = (item) => {
163
+ return bem('item', {
164
+ active: props.active === item.value,
165
+ abnormal: props.active === item.value && item.abnormal,
166
+ disabled: item.disabled,
167
+ import: item.import
168
+ })
169
+ }
170
+
171
+ // 角标数量
172
+ const getBadge = (badge) => {
173
+ if (typeof badge === 'number') {
174
+ if (Number(badge) > 99) {
175
+ return '99+'
176
+ }
177
+ if (Number(badge) > 0) {
178
+ return badge
179
+ }
180
+ } else {
181
+ return badge
182
+ }
183
+ }
184
+
185
+ // 切换菜单
186
+ const handleChange = (item) => {
187
+ if (item.disabled) {
188
+ return
189
+ }
190
+ emits('change', item)
191
+ }
192
+
193
+ // header - 返回
194
+ const handleBack = () => {
195
+ emits('back')
196
+ }
197
+
198
+ // header - 退出
199
+ const handleLogout = () => {
200
+ emits('logout')
201
+ }
202
+
203
+ // grid - 点击菜单
204
+ const handleClickGrid = (item) => {
205
+ emits('clickGrid', item)
206
+ }
207
+ </script>
208
+
209
+ <style lang="scss">
210
+ @import './index.scss';
211
+ </style>
@@ -0,0 +1,94 @@
1
+ <!--
2
+ * @Author: chenghuan.dong
3
+ * @Date: 2023-07-06 15:17:06
4
+ * @LastEditors: chenghuan.dong
5
+ * @LastEditTime: 2023-08-07 08:58:25
6
+ * @Description: 柜子状态
7
+ -->
8
+ <template>
9
+ <div v-show="lockStatus === 0 || lockStatus === 2 || !connectionStatus" :class="['nb-ocb__status', classes]">
10
+ <!-- 已关:显示锁图标 -->
11
+ <nb-icon v-if="lockStatus === 0" icon="lock" />
12
+ <!-- 开锁中 -->
13
+ <span v-if="lockStatus === 2">加载中…</span>
14
+ <!-- 未连接 -->
15
+ <nb-icon v-if="!connectionStatus" icon="connect-error" />
16
+ </div>
17
+ </template>
18
+ <script setup>
19
+ import { computed } from 'vue'
20
+
21
+ // 定义props
22
+ const props = defineProps({
23
+ // 锁状态:0-关,1-开,2-开锁中
24
+ lockStatus: {
25
+ type: Number,
26
+ default: 0
27
+ },
28
+ // 连接状态,true-已连接,false-未连接
29
+ connectionStatus: {
30
+ type: Boolean,
31
+ default: true
32
+ }
33
+ })
34
+
35
+ const classes = computed(() => {
36
+ if (props.lockStatus === 0) {
37
+ return 'nb-ocb__status--lock'
38
+ }
39
+ if (props.lockStatus === 2) {
40
+ return 'nb-ocb__status--loading'
41
+ }
42
+ if (!props.connectionStatus) {
43
+ return 'nb-ocb__status--unconnected'
44
+ }
45
+ return ''
46
+ })
47
+ </script>
48
+
49
+ <style lang="scss">
50
+ // ocb 即 open cabinet ball
51
+ .nb-ocb__status {
52
+ position: absolute;
53
+ left: 0;
54
+ right: 0;
55
+ bottom: 0;
56
+ top: 0;
57
+ display: flex;
58
+ align-items: center;
59
+ justify-content: center;
60
+
61
+ &--lock {
62
+ background-color: rgba(#181d41, 0.5);
63
+ .svg-icon {
64
+ width: 36px;
65
+ height: 36px;
66
+ color: #fff;
67
+ position: absolute;
68
+ left: 50%;
69
+ top: 50%;
70
+ transform: translate(-50%, -50%);
71
+ }
72
+ }
73
+
74
+ &--loading {
75
+ background-color: rgba(#f4f6f9, 0.8);
76
+ color: var(--nb-theme-color);
77
+ font-size: 18px;
78
+ line-height: 27px;
79
+ }
80
+
81
+ &--unconnected {
82
+ background-color: rgba(#f4f6f9, 0.8);
83
+ .svg-icon {
84
+ width: 40px;
85
+ height: 40px;
86
+ color: var(--nb-abnormal-color);
87
+ position: absolute;
88
+ top: 50%;
89
+ left: 50%;
90
+ transform: translate(-50%, -50%);
91
+ }
92
+ }
93
+ }
94
+ </style>
@@ -0,0 +1,204 @@
1
+ .nb-open-cabinet {
2
+ &__hide {
3
+ width: 120px;
4
+ height: 120px;
5
+ background: linear-gradient(180deg, #3385e6 0%, #0066e0 100%);
6
+ box-shadow: 0px 2px 14px 0px rgba(24, 29, 65, 0.16), inset 0px 0px 8px 0px rgba(0, 66, 144, 0.18);
7
+ border: 4px solid #e8f3ff;
8
+ display: flex;
9
+ flex-direction: column;
10
+ justify-content: center;
11
+ align-items: center;
12
+ border-radius: 50%;
13
+ color: #ffff;
14
+ box-sizing: border-box;
15
+ overflow: hidden;
16
+ cursor: pointer;
17
+ .svg-icon {
18
+ width: 48px;
19
+ height: 48px;
20
+ }
21
+ p {
22
+ font-size: 24px;
23
+ line-height: 36px;
24
+ text-align: center;
25
+ }
26
+ }
27
+ &__show {
28
+ max-width: 846px;
29
+ min-height: 256px;
30
+ width: fit-content;
31
+ background: #ffffff;
32
+ box-shadow: 0px 2px 18px 0px rgba(0, 0, 0, 0.2);
33
+ border-radius: 80px 16px 16px 16px;
34
+ display: flex;
35
+ &__all {
36
+ display: flex;
37
+ flex-direction: column;
38
+ justify-content: space-between;
39
+ padding: 30px 15px 28px 30px;
40
+ box-sizing: border-box;
41
+ &__open {
42
+ width: 120px;
43
+ height: 120px;
44
+ background: linear-gradient(180deg, #3385e6 0%, #0066e0 100%);
45
+ box-shadow: 0px 2px 14px 0px rgba(24, 29, 65, 0.16), inset 0px 0px 8px 0px rgba(0, 66, 144, 0.18);
46
+ border: 4px solid #e8f3ff;
47
+ box-sizing: border-box;
48
+ display: flex;
49
+ flex-direction: column;
50
+ justify-content: center;
51
+ align-items: center;
52
+ font-size: 24px;
53
+ line-height: 36px;
54
+ color: #ffffff;
55
+ border-radius: 50%;
56
+ cursor: pointer;
57
+ }
58
+ &__toggle {
59
+ display: flex;
60
+ align-items: center;
61
+ color: var(--nb-theme-color);
62
+ cursor: pointer;
63
+ .svg-icon {
64
+ width: 32px;
65
+ height: 32px;
66
+ }
67
+ span {
68
+ font-size: 24px;
69
+ line-height: 36px;
70
+ }
71
+ }
72
+ }
73
+ &__list {
74
+ display: flex;
75
+ flex-wrap: wrap;
76
+ padding: 30px 17px 0 0;
77
+ box-sizing: border-box;
78
+ &__item {
79
+ width: 166px;
80
+ display: flex;
81
+ flex-direction: column;
82
+ align-items: center;
83
+ margin-bottom: 30px;
84
+ }
85
+ &__cover {
86
+ width: 100px;
87
+ height: 150px;
88
+ border-radius: 9px;
89
+ overflow: hidden;
90
+ position: relative;
91
+ background-color: #f4f6f9;
92
+ img {
93
+ width: 100%;
94
+ height: 100%;
95
+ }
96
+ &__all {
97
+ height: 100%;
98
+ height: 100%;
99
+ position: absolute;
100
+ top: 0;
101
+ left: 0;
102
+ right: 0;
103
+ bottom: 0;
104
+ }
105
+ &__top {
106
+ height: 74px;
107
+ width: 100%;
108
+ position: absolute;
109
+ top: 0;
110
+ left: 0;
111
+ }
112
+ &__bottom {
113
+ height: 74px;
114
+ width: 100%;
115
+ position: absolute;
116
+ bottom: 0;
117
+ left: 0;
118
+ }
119
+ &__line {
120
+ width: 100%;
121
+ height: 2px;
122
+ background-color: #ffff;
123
+ position: absolute;
124
+ left: 0;
125
+ top: 74px;
126
+ }
127
+ &__left {
128
+ width: 48px;
129
+ height: 100%;
130
+ position: absolute;
131
+ top: 0;
132
+ left: 0;
133
+ }
134
+ &__right {
135
+ width: 48px;
136
+ height: 100%;
137
+ position: absolute;
138
+ top: 0;
139
+ right: 0;
140
+ }
141
+ &__line2 {
142
+ width: 2px;
143
+ height: 100%;
144
+ background-color: #ffff;
145
+ position: absolute;
146
+ left: 48px;
147
+ top: 0;
148
+ }
149
+ }
150
+ &__name {
151
+ width: 100%;
152
+ height: 36px;
153
+ font-size: 24px;
154
+ line-height: 36px;
155
+ overflow: hidden;
156
+ text-overflow: ellipsis;
157
+ white-space: nowrap;
158
+ margin-top: 17px;
159
+ color: var(--nb-font-color-7);
160
+ text-align: center;
161
+ }
162
+ &--lock,
163
+ &--unconnected,
164
+ &--loading {
165
+ position: absolute;
166
+ top: 0;
167
+ right: 0;
168
+ bottom: 0;
169
+ left: 0;
170
+ display: flex;
171
+ align-items: center;
172
+ justify-content: center;
173
+ }
174
+ &--lock {
175
+ background: #181d41;
176
+ opacity: 0.5;
177
+
178
+ .svg-icon {
179
+ width: 36px;
180
+ height: 36px;
181
+ color: #ffffff;
182
+ }
183
+ }
184
+ &--unconnected {
185
+ background: #f4f6f9;
186
+ opacity: 0.8;
187
+ .svg-icon {
188
+ width: 36px;
189
+ height: 36px;
190
+ color: var(--nb-abnormal-color);
191
+ }
192
+ }
193
+ &--loading {
194
+ background: #f4f6f9;
195
+ opacity: 0.8;
196
+ font-size: 18px;
197
+ line-height: 27px;
198
+ word-wrap: break-word;
199
+ writing-mode: vertical-lr;
200
+ color: var(--nb-theme-color);
201
+ }
202
+ }
203
+ }
204
+ }
@@ -0,0 +1,113 @@
1
+ <!--
2
+ * @Author: chenghuan.dong
3
+ * @Date: 2023-07-19 14:49:23
4
+ * @LastEditors: chenghuan.dong
5
+ * @LastEditTime: 2023-08-07 09:03:32
6
+ * @Description: 开柜浮球
7
+ -->
8
+ <template>
9
+ <div v-show="!toggle" class="nb-open-cabinet__hide" @click.stop="handleOpen">
10
+ <nb-icon icon="door-opened" />
11
+ <p>开柜</p>
12
+ </div>
13
+ <div v-show="toggle" class="nb-open-cabinet__show">
14
+ <div class="nb-open-cabinet__show__all">
15
+ <div class="nb-open-cabinet__show__all__open" @click.stop="handleOpenAll">全部<br />开柜</div>
16
+ <div class="nb-open-cabinet__show__all__toggle" @click.stop="handleHide">
17
+ <nb-icon icon="caret-right" />
18
+ <span>收起</span>
19
+ </div>
20
+ </div>
21
+ <ul class="nb-open-cabinet__show__list">
22
+ <li v-for="(item, index) in terList" :key="index" class="nb-open-cabinet__show__list__item">
23
+ <div class="nb-open-cabinet__show__list__cover">
24
+ <img :src="item.terModelPic" />
25
+ <!-- 上下柜 -->
26
+ <template v-if="item.sTerModelCodeType === 2">
27
+ <div class="nb-open-cabinet__show__list__cover__top" @click.stop="handleOpenDoor(item, 0)">
28
+ <cabinet-status :lock-status="item.lockStatus[0]" :connection-status="item.connectionStatus[0]" />
29
+ </div>
30
+ <div class="nb-open-cabinet__show__list__cover__line" />
31
+ <div class="nb-open-cabinet__show__list__cover__bottom" @click.stop="handleOpenDoor(item, 1)">
32
+ <cabinet-status :lock-status="item.lockStatus[1]" :connection-status="item.connectionStatus[1]" />
33
+ </div>
34
+ </template>
35
+ <!-- 左右柜 -->
36
+ <template v-else-if="item.sTerModelCodeType === 3">
37
+ <div class="nb-open-cabinet__show__list__cover__left" @click.stop="handleOpenDoor(item, 0)">
38
+ <cabinet-status :lock-status="item.lockStatus[0]" :connection-status="item.connectionStatus[0]" />
39
+ </div>
40
+ <div class="nb-open-cabinet__show__list__cover__line2" />
41
+ <div class="nb-open-cabinet__show__list__cover__right" @click.stop="handleOpenDoor(item, 1)">
42
+ <cabinet-status :lock-status="item.lockStatus[1]" :connection-status="item.connectionStatus[1]" />
43
+ </div>
44
+ </template>
45
+ <!-- 一体柜 -->
46
+ <template v-else>
47
+ <div class="nb-open-cabinet__show__list__cover__all" @click.stop="handleOpenDoor(item, 0)">
48
+ <cabinet-status :lock-status="item.lockStatus[0]" :connection-status="item.connectionStatus[0]" />
49
+ </div>
50
+ </template>
51
+ </div>
52
+ <p class="nb-open-cabinet__show__list__name">{{ item.sTerDesc }}</p>
53
+ </li>
54
+ </ul>
55
+ </div>
56
+ </template>
57
+
58
+ <script setup>
59
+ import { ref, computed } from 'vue'
60
+ import { createNamespace } from '../../../utils/create.js'
61
+ import CabinetStatus from './CabinetStatus.vue'
62
+
63
+ const [name, bem] = createNamespace('open-cabinet-ball')
64
+
65
+ // 定义名称
66
+ defineOptions({
67
+ name: 'nbOpenCabinetBall'
68
+ })
69
+
70
+ // 定义props
71
+ const props = defineProps({
72
+ // 终端列表
73
+ terList: {
74
+ type: Array,
75
+ default: () => {
76
+ return []
77
+ }
78
+ },
79
+ // 默认是否展开
80
+ defaultToggle: {
81
+ type: Boolean,
82
+ default: false
83
+ }
84
+ })
85
+
86
+ // 定义emits
87
+ const emits = defineEmits(['openAll', 'open'])
88
+ const toggle = ref(props.defaultToggle) // 是否展开
89
+
90
+ // 展开
91
+ const handleOpen = () => {
92
+ toggle.value = true
93
+ }
94
+
95
+ // 收起
96
+ const handleHide = () => {
97
+ toggle.value = false
98
+ }
99
+
100
+ // 全部开柜
101
+ const handleOpenAll = () => {
102
+ emits('openAll', props.terList)
103
+ }
104
+
105
+ // 开柜
106
+ const handleOpenDoor = (item, index) => {
107
+ emits('open', item, index)
108
+ }
109
+ </script>
110
+
111
+ <style lang="scss">
112
+ @import './index.scss';
113
+ </style>