nubomed-ui 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. package/{nubomed-ui/nubomed-ui.es.js → nubomed-ui.es.js} +547 -581
  2. package/{nubomed-ui/nubomed-ui.umd.js → nubomed-ui.umd.js} +1 -1
  3. package/package.json +7 -18
  4. package/.env.bi +0 -13
  5. package/.env.terminal +0 -13
  6. package/.vscode/extensions.json +0 -3
  7. package/README.md +0 -17
  8. package/index.html +0 -13
  9. package/src/App.vue +0 -31
  10. package/src/bi-demos/Header.vue +0 -29
  11. package/src/bi-demos/Table.vue +0 -69
  12. package/src/bi-demos/index.vue +0 -132
  13. package/src/bi-packages/components/Box/images/corner-error.png +0 -0
  14. package/src/bi-packages/components/Box/images/corner-warning.png +0 -0
  15. package/src/bi-packages/components/Box/images/corner.png +0 -0
  16. package/src/bi-packages/components/Box/index.scss +0 -86
  17. package/src/bi-packages/components/Box/index.vue +0 -53
  18. package/src/bi-packages/components/Carousel/CarouselItem.vue +0 -0
  19. package/src/bi-packages/components/Carousel/index.vue +0 -0
  20. package/src/bi-packages/components/Header/images/left-bg.png +0 -0
  21. package/src/bi-packages/components/Header/images/logo.png +0 -0
  22. package/src/bi-packages/components/Header/images/right-bg.png +0 -0
  23. package/src/bi-packages/components/Header/index.scss +0 -50
  24. package/src/bi-packages/components/Header/index.vue +0 -54
  25. package/src/bi-packages/components/Table/TableColgroup.vue +0 -43
  26. package/src/bi-packages/components/Table/index copy.vue +0 -107
  27. package/src/bi-packages/components/Table/index.scss +0 -118
  28. package/src/bi-packages/components/Table/index.vue +0 -108
  29. package/src/bi-packages/components/TableColumn/index.scss +0 -7
  30. package/src/bi-packages/components/TableColumn/index.vue +0 -60
  31. package/src/bi-packages/fonts/OPPOSans-B.ttf +0 -0
  32. package/src/bi-packages/fonts/OPPOSans-M.ttf +0 -0
  33. package/src/bi-packages/fonts/font.scss +0 -11
  34. package/src/bi-packages/iconfont-svg/demo.css +0 -539
  35. package/src/bi-packages/iconfont-svg/demo_index.html +0 -4811
  36. package/src/bi-packages/iconfont-svg/iconfont.css +0 -819
  37. package/src/bi-packages/iconfont-svg/iconfont.js +0 -1
  38. package/src/bi-packages/iconfont-svg/iconfont.json +0 -1416
  39. package/src/bi-packages/iconfont-svg/iconfont.ttf +0 -0
  40. package/src/bi-packages/iconfont-svg/iconfont.woff +0 -0
  41. package/src/bi-packages/iconfont-svg/iconfont.woff2 +0 -0
  42. package/src/bi-packages/index.js +0 -34
  43. package/src/bi-packages/styles/mixin.scss +0 -12
  44. package/src/bi-packages/styles/var.scss +0 -11
  45. package/src/demos/ActionBar.vue +0 -59
  46. package/src/demos/Badge.vue +0 -28
  47. package/src/demos/Button copy.vue +0 -302
  48. package/src/demos/Button.vue +0 -116
  49. package/src/demos/ButtonGroup.vue +0 -40
  50. package/src/demos/Check.vue +0 -29
  51. package/src/demos/Dialog.vue +0 -255
  52. package/src/demos/Empty.vue +0 -38
  53. package/src/demos/FooterMenu.vue +0 -49
  54. package/src/demos/Header.vue +0 -71
  55. package/src/demos/Icons.vue +0 -314
  56. package/src/demos/Input.vue +0 -87
  57. package/src/demos/InputKeyboard.vue +0 -30
  58. package/src/demos/InputNumber.vue +0 -34
  59. package/src/demos/LeftMenu.vue +0 -128
  60. package/src/demos/Menus.vue +0 -106
  61. package/src/demos/OpenCabinetBall.vue +0 -37
  62. package/src/demos/Statusbar.vue +0 -146
  63. package/src/demos/Steps.vue +0 -45
  64. package/src/demos/Tost.vue +0 -35
  65. package/src/demos/button/button.md +0 -19
  66. package/src/demos/data/terList.json +0 -145
  67. package/src/demos/images/cabinets/H3000-D.png +0 -0
  68. package/src/demos/images/cabinets/H3000-R.png +0 -0
  69. package/src/demos/images/cabinets/H3000-Rh.png +0 -0
  70. package/src/demos/images/cabinets/H3000-Rh2.png +0 -0
  71. package/src/demos/images/cabinets/H3010-R.png +0 -0
  72. package/src/demos/index.vue +0 -348
  73. package/src/docs/icons/Icon.vue +0 -72
  74. package/src/docs/icons/icon.md +0 -21
  75. package/src/docs/index.html +0 -15
  76. package/src/docs/index.vue +0 -301
  77. package/src/main.js +0 -23
  78. package/src/packages/components/ActionBar/images/error.png +0 -0
  79. package/src/packages/components/ActionBar/images/loading.gif +0 -0
  80. package/src/packages/components/ActionBar/images/success.png +0 -0
  81. package/src/packages/components/ActionBar/images/warning.png +0 -0
  82. package/src/packages/components/ActionBar/images/warning_yellow.png +0 -0
  83. package/src/packages/components/ActionBar/index.scss +0 -81
  84. package/src/packages/components/ActionBar/index.vue +0 -100
  85. package/src/packages/components/Badge/index.scss +0 -50
  86. package/src/packages/components/Badge/index.vue +0 -75
  87. package/src/packages/components/Button/index.scss +0 -241
  88. package/src/packages/components/Button/index.vue +0 -111
  89. package/src/packages/components/ButtonGroup/index.scss +0 -54
  90. package/src/packages/components/ButtonGroup/index.vue +0 -75
  91. package/src/packages/components/Check/Cate.vue +0 -138
  92. package/src/packages/components/Check/index.scss +0 -47
  93. package/src/packages/components/Check/index.vue +0 -105
  94. package/src/packages/components/Dialog/images/error.png +0 -0
  95. package/src/packages/components/Dialog/images/success.png +0 -0
  96. package/src/packages/components/Dialog/images/warning-red.png +0 -0
  97. package/src/packages/components/Dialog/images/warning-yellow.png +0 -0
  98. package/src/packages/components/Dialog/index.scss +0 -154
  99. package/src/packages/components/Dialog/index.vue +0 -305
  100. package/src/packages/components/Empty/images/empty-abnormal.png +0 -0
  101. package/src/packages/components/Empty/images/empty-data.png +0 -0
  102. package/src/packages/components/Empty/images/empty-search.png +0 -0
  103. package/src/packages/components/Empty/index.vue +0 -68
  104. package/src/packages/components/Form/FormItem.vue +0 -73
  105. package/src/packages/components/Form/index.vue +0 -76
  106. package/src/packages/components/Icon/index.vue +0 -30
  107. package/src/packages/components/Input/index.scss +0 -184
  108. package/src/packages/components/Input/index.vue +0 -189
  109. package/src/packages/components/InputKeyboard/index.scss +0 -63
  110. package/src/packages/components/InputKeyboard/index.vue +0 -117
  111. package/src/packages/components/InputNumber/index.scss +0 -103
  112. package/src/packages/components/InputNumber/index.vue +0 -160
  113. package/src/packages/components/Menu/index.scss +0 -559
  114. package/src/packages/components/Menu/index.vue +0 -211
  115. package/src/packages/components/OpenCabinetBall/CabinetStatus.vue +0 -94
  116. package/src/packages/components/OpenCabinetBall/index.scss +0 -204
  117. package/src/packages/components/OpenCabinetBall/index.vue +0 -113
  118. package/src/packages/components/Statusbar/CabinetList.vue +0 -125
  119. package/src/packages/components/Statusbar/CabinetListStatus.vue +0 -75
  120. package/src/packages/components/Statusbar/CabinetListTempHum.vue +0 -108
  121. package/src/packages/components/Statusbar/index.scss +0 -205
  122. package/src/packages/components/Statusbar/index.vue +0 -83
  123. package/src/packages/components/Steps/index.scss +0 -104
  124. package/src/packages/components/Steps/index.vue +0 -66
  125. package/src/packages/components/SvgIcon/index.vue +0 -41
  126. package/src/packages/components/Toast/index.vue +0 -72
  127. package/src/packages/fonts/OPPOSans-B.ttf +0 -0
  128. package/src/packages/fonts/OPPOSans-M.ttf +0 -0
  129. package/src/packages/fonts/font.scss +0 -11
  130. package/src/packages/iconfont-svg/demo.css +0 -539
  131. package/src/packages/iconfont-svg/demo_index.html +0 -4811
  132. package/src/packages/iconfont-svg/iconfont.css +0 -819
  133. package/src/packages/iconfont-svg/iconfont.js +0 -1
  134. package/src/packages/iconfont-svg/iconfont.json +0 -1416
  135. package/src/packages/iconfont-svg/iconfont.ttf +0 -0
  136. package/src/packages/iconfont-svg/iconfont.woff +0 -0
  137. package/src/packages/iconfont-svg/iconfont.woff2 +0 -0
  138. package/src/packages/index.js +0 -64
  139. package/src/packages/styles/var.scss +0 -24
  140. package/src/utils/create.js +0 -48
  141. package/src/utils/index.js +0 -13
  142. package/src/utils/validate.js +0 -3
  143. package/vite.config.js +0 -47
  144. /package/{nubomed-ui/style.css → style.css} +0 -0
@@ -1,105 +0,0 @@
1
- <!--
2
- * @Author: chenghuan.dong
3
- * @Date: 2023-07-10 17:51:28
4
- * @LastEditors: chenghuan.dong
5
- * @LastEditTime: 2023-08-07 09:05:04
6
- * @Description: 多选按钮组
7
- -->
8
- <template>
9
- <div class="nb-check-list">
10
- <div class="nb-check-list__item">
11
- <!-- 分类 -->
12
- <nb-check-cate />
13
- <!-- <div class="nb-check-list__item__cate">
14
- <nb-icon class="nb-check-list__arrow" icon="caret-right" />
15
- <nb-icon class="nb-check-list__item__cate__icon" icon="menu-in-store" />
16
- <strong class="nb-check-list__item__cate__text"
17
- >异常出库<small>2021/10/22</small></strong
18
- >
19
- <span class="nb-check-list__item__cate__count">
20
- <slot name="count"></slot>
21
- </span>
22
- </div> -->
23
- <!-- 分类下的列表 -->
24
- <ul class="nb-check-list__item__details">
25
- <li class="nb-check-list__item__detail">
26
- <!-- 品名 -->
27
- <div class="nb-check-list__item__detail__top">
28
- <nb-icon
29
- icon="caret-right"
30
- class="nb-check-list__item__detail__arrow"
31
- />
32
- <strong class="nb-check-list__item__detail__name"
33
- >非覆膜快速交换胆道金属支架系统</strong
34
- >
35
- <span>状态</span>
36
- </div>
37
- <!-- 规格/型号 -->
38
- </li>
39
- </ul>
40
- </div>
41
- </div>
42
- </template>
43
- <script setup>
44
- import NbCheckCate from "./Cate.vue";
45
- import { ref, computed } from "vue";
46
- import { createNamespace } from '../../../utils/create.js';
47
-
48
- const [name, bem] = createNamespace("check-list");
49
-
50
- // 定义名称
51
- defineOptions({
52
- name: "NbCheckList",
53
- });
54
-
55
- // 定义props
56
- const props = defineProps({
57
- // 值
58
- modelValue: {
59
- type: [String, Number, Object, Boolean],
60
- default: "",
61
- },
62
- // 选中项绑定值
63
- data: {
64
- type: Array,
65
- default: () => {
66
- return [];
67
- },
68
- },
69
- });
70
-
71
- // 定义emits
72
- const emits = defineEmits(["change"]);
73
-
74
- // 输入框值
75
- const inputValue = computed({
76
- get: () => props.modelValue,
77
- set: (value) => {
78
- emits("update:modelValue", value);
79
- },
80
- });
81
-
82
- // 样式
83
- const itemClassess = (item) => {
84
- return bem("item", {
85
- checked: (inputValue.value || []).includes(item.value),
86
- disabled: item.disabled,
87
- });
88
- };
89
-
90
- // 点击按钮
91
- const handleChange = (item) => {
92
- const newValue = inputValue.value;
93
- const index = newValue.findIndex((x) => x === item.value);
94
- if (index > -1) {
95
- newValue.splice(index, 1);
96
- } else {
97
- newValue.push(item.value);
98
- }
99
- emits("change", item);
100
- };
101
- </script>
102
-
103
- <style lang="scss">
104
- @import "./index.scss";
105
- </style>
@@ -1,154 +0,0 @@
1
- :root {
2
- // 通用
3
- --el-overlay-color-lighter: rgba(0, 0, 0, 0.7);
4
- // 按Size
5
- // size=large
6
- --nb-dialog-large-width: 1600px;
7
- --nb-dialog-large-height: 900px;
8
- // size=medium
9
- --nb-dialog-medium-width: 1000px;
10
- --nb-dialog-medium-height: 640px;
11
- // size=mini
12
- --nb-dialog-mini-width: 720px;
13
- --nb-dialog-mini-height: 520px;
14
- }
15
-
16
- .nb-overlay {
17
- position: fixed;
18
- top: 0;
19
- right: 0;
20
- bottom: 0;
21
- left: 0;
22
- z-index: 2000;
23
- height: 100%;
24
- background-color: var(--el-overlay-color-lighter);
25
- overflow: auto;
26
- }
27
-
28
- .nb-dialog {
29
- background: #ffffff;
30
- border-radius: 16px;
31
- overflow: hidden;
32
- display: flex;
33
- flex-direction: column;
34
- margin-left: auto;
35
- margin-right: auto;
36
- position: relative;
37
- &__close {
38
- height: 42px;
39
- width: 80px;
40
- text-align: right;
41
- position: absolute;
42
- top: 40px;
43
- right: 40px;
44
- cursor: pointer;
45
- .svg-icon {
46
- width: 40px;
47
- height: 40px;
48
- color: #8b8ea0;
49
- }
50
- }
51
- &__header {
52
- padding: 36px 40px 24px 40px;
53
- display: flex;
54
- align-items: center;
55
- &__title {
56
- flex: 1;
57
- font-size: 28px;
58
- line-height: 42px;
59
- &--center {
60
- text-align: center;
61
- }
62
- }
63
- }
64
- &__body {
65
- flex: 1;
66
- width: 100%;
67
- overflow: auto;
68
- &--center {
69
- display: flex;
70
- flex-direction: column;
71
- align-items: center;
72
- justify-content: center;
73
- text-align: center;
74
- }
75
- }
76
- &__footer {
77
- width: 100%;
78
- height: 100px;
79
- box-shadow: 0px -6px 16px 0px rgba(24, 29, 65, 0.08);
80
- display: flex;
81
- align-items: center;
82
- justify-content: space-between;
83
- &__tips {
84
- height: 100%;
85
- font-size: 28px;
86
- color: #00a572;
87
- line-height: 42px;
88
- flex: 1;
89
- padding: 0 40px;
90
- border-right: 1px solid #cad0e0;
91
- display: flex;
92
- align-items: center;
93
- }
94
- .nb-button {
95
- flex: 1;
96
- height: 100%;
97
- border-radius: 0;
98
- border: none;
99
- font-size: 36px;
100
- }
101
- &--has-tips {
102
- .nb-button {
103
- width: 400px;
104
- flex: inherit;
105
- }
106
- }
107
- }
108
- &--large {
109
- width: var(--nb-dialog-large-width);
110
- height: var(--nb-dialog-large-height);
111
- margin-top: 80px;
112
- }
113
- &--medium {
114
- width: var(--nb-dialog-medium-width);
115
- height: var(--nb-dialog-medium-height);
116
- margin-top: 80px;
117
- }
118
- &--mini {
119
- width: var(--nb-dialog-mini-width);
120
- min-height: var(--nb-dialog-mini-height);
121
- margin-top: 160px;
122
-
123
- .nb-dialog__body__icon {
124
- width: 160px;
125
- height: 160px;
126
- margin-bottom: 30px;
127
- }
128
- .nb-dialog__body__message {
129
- font-size: 36px;
130
- line-height: 54px;
131
- }
132
- .nb-dialog__body__desc {
133
- font-size: 28px;
134
- line-height: 42px;
135
- margin-top: 8px;
136
- color: var(--nb-font-color-5);
137
- }
138
- .nb-dialog__body__form {
139
- width: 100%;
140
- height: 100%;
141
- display: flex;
142
- flex-direction: column;
143
- align-items: flex-end;
144
- overflow-x: hidden;
145
- overflow-y: auto;
146
- .form__title {
147
- text-align: center;
148
- font-size: 36px;
149
- line-height: 54px;
150
- }
151
-
152
- }
153
- }
154
- }
@@ -1,305 +0,0 @@
1
- <!--
2
- * @Author: chenghuan.dong
3
- * @Date: 2023-06-29 15:15:27
4
- * @LastEditors: chenghuan.dong
5
- * @LastEditTime: 2023-07-04 20:46:00
6
- * @Description: 模态框
7
- -->
8
- <template>
9
- <teleport to="body" :disabled="!appendToBody">
10
- <transition name="dialog-fade" @after-enter="afterEnter" @after-leave="afterLeave" @before-leave="beforeLeave">
11
- <div v-show="visible" :class="['nb-overlay', modalClass]" :z-index="zIndex">
12
- <div :class="classes">
13
- <!-- 头部 -->
14
- <header v-if="title || $slots.title" :class="headerClasses">
15
- <slot name="title">
16
- <span :class="headerTitleClasses">{{ title }}</span>
17
- </slot>
18
- </header>
19
- <span v-if="showClose" :class="bem('close')" @click="handleClose">
20
- <svg-icon icon="close" />
21
- </span>
22
- <!-- 主体 -->
23
- <div :class="bodyClasses">
24
- <slot>
25
- <img v-if="icon === 'success'" :class="bem('body__icon')" src="./images/success.png" />
26
- <img v-if="icon === 'error'" :class="bem('body__icon')" src="./images/error.png" />
27
- <img v-if="icon === 'warning-yellow'" :class="bem('body__icon')" src="./images/warning-yellow.png" />
28
- <img v-if="icon === 'warning-red'" :class="bem('body__icon')" src="./images/warning-red.png" />
29
- <div v-if="message" v-html="message" :class="bem('body__message')"></div>
30
- <div v-if="desc" v-html="desc" :class="bem('body__desc')" :style="`color: ${descColor}`"></div>
31
- </slot>
32
- </div>
33
- <!-- 底部 -->
34
- <footer :class="footerClasses">
35
- <slot name="footer">
36
- <div v-if="footerTips" :class="bem('footer__tips')">{{ footerTips }}</div>
37
- <nb-button
38
- v-if="showCancelButton"
39
- type="default"
40
- :style="`color: ${cancelButtonColor}`"
41
- @click="handleCancel"
42
- >{{ cancelButtonText }}<template v-if="cancelButtonTime > -1">({{ cancelTime }}s)</template></nb-button
43
- >
44
- <nb-button v-if="showConfirmButton" type="primary" @click="handleConfirm"
45
- >{{ confirmButtonText
46
- }}<template v-if="confirmButtonTime > -1">({{ confirmTime }}s)</template></nb-button
47
- >
48
- </slot>
49
- </footer>
50
- </div>
51
- </div>
52
- </transition>
53
- </teleport>
54
- </template>
55
-
56
- <script setup>
57
- import { ref, computed, watch } from 'vue'
58
- import { createNamespace } from '../../../utils/create.js'
59
- import { isNumber } from '../../../utils/validate.js'
60
-
61
- defineOptions({
62
- name: 'NbDialog'
63
- })
64
-
65
- const props = defineProps({
66
- // 尺寸
67
- size: {
68
- type: String,
69
- default: 'medium'
70
- },
71
- // 自定义样式
72
- customClass: {
73
- type: String,
74
- default: ''
75
- },
76
- // 标题, 也可通过具名 slot (见下表)传入
77
- title: {
78
- type: String,
79
- default: ''
80
- },
81
- // 标题是否居中显示
82
- titleCenter: {
83
- type: String,
84
- default: false
85
- },
86
- // header和body内容是否居中显示
87
- center: {
88
- type: Boolean,
89
- default: false
90
- },
91
- // body的消息图标
92
- icon: {
93
- type: String
94
- },
95
- // body的消息内容
96
- message: {
97
- type: String
98
- },
99
- // body的消息描述
100
- desc: {
101
- type: String
102
- },
103
- // body的消息描述的字体颜色
104
- descColor: {
105
- type: String
106
- },
107
- // footer的左下角提示语,绿色字体
108
- footerTips: {
109
- type: String,
110
- default: ''
111
- },
112
- // 是否显示取消按钮
113
- showCancelButton: {
114
- type: Boolean,
115
- default: true
116
- },
117
- // 取消按钮的文本内容
118
- cancelButtonText: {
119
- type: String,
120
- default: '取消'
121
- },
122
- // 取消按钮的文字颜色,默认浅灰色
123
- cancelButtonColor: {
124
- type: String,
125
- default: ''
126
- },
127
- // 取消按钮是否开启倒计时
128
- cancelButtonTime: {
129
- type: Number,
130
- default: -1
131
- },
132
- // 是否显示确定按钮
133
- showConfirmButton: {
134
- type: Boolean,
135
- default: true
136
- },
137
- // 确定按钮的文本内容
138
- confirmButtonText: {
139
- type: String,
140
- default: '确定'
141
- },
142
- // 确定按钮是否开启倒计时
143
- confirmButtonTime: {
144
- type: Number,
145
- default: -1
146
- },
147
- fullscreen: {
148
- type: Boolean,
149
- default: false
150
- },
151
- // 右上角是否显示关闭按钮
152
- showClose: {
153
- type: Boolean,
154
- default: false
155
- },
156
- appendToBody: {
157
- type: Boolean,
158
- default: false
159
- },
160
- beforeClose: {
161
- type: Function
162
- },
163
- destroyOnClose: {
164
- type: Boolean,
165
- default: false
166
- },
167
- modal: {
168
- type: Boolean,
169
- default: true
170
- },
171
- openDelay: {
172
- type: Number,
173
- default: 0
174
- },
175
- closeDelay: {
176
- type: Number,
177
- default: 0
178
- },
179
- modelValue: {
180
- type: Boolean,
181
- default: false
182
- },
183
- modalClass: String,
184
- width: {
185
- type: [String, Number]
186
- },
187
- zIndex: {
188
- type: Number
189
- }
190
- })
191
- const slots = defineSlots()
192
-
193
- // 定义emits
194
- const emits = defineEmits(['opened', 'closed', 'close', 'cancel', 'confirm'])
195
-
196
- const [name, bem] = createNamespace('dialog')
197
- let cancelTimer = null
198
- const cancelTime = ref(-1)
199
- let confirmTimer = null
200
- const confirmTime = ref(-1)
201
-
202
- // 是否显示弹框
203
- const visible = computed({
204
- get: () => props.modelValue,
205
- set: (value) => {
206
- emits('update:modelValue', value)
207
- }
208
- })
209
-
210
- // 监听弹框显示,开启倒计时
211
- watch(visible, (val) => {
212
- clearInterval(cancelTimer)
213
- if (props.cancelButtonTime > -1 && props.showCancelButton) {
214
- if (val) {
215
- cancelTime.value = Number(JSON.parse(JSON.stringify(props.cancelButtonTime)))
216
- cancelTimer = setInterval(() => {
217
- cancelTime.value--
218
- if (cancelTime.value <= 0) {
219
- clearInterval(cancelTimer)
220
- emits('cancel')
221
- }
222
- }, 1000)
223
- } else {
224
- clearInterval(cancelTimer)
225
- }
226
- }
227
- clearInterval(confirmTimer)
228
- if (props.confirmButtonTime > -1 && props.showConfirmButton) {
229
- if (val) {
230
- confirmTime.value = Number(JSON.parse(JSON.stringify(props.confirmButtonTime)))
231
- confirmTimer = setInterval(() => {
232
- confirmTime.value--
233
- if (confirmTime.value <= 0) {
234
- clearInterval(confirmTimer)
235
- emits('confirm')
236
- }
237
- }, 1000)
238
- } else {
239
- clearInterval(confirmTimer)
240
- }
241
- }
242
- })
243
-
244
- // 样式
245
- const classes = bem([props.customClass, props.size])
246
-
247
- // header的样式
248
- const headerClasses = computed(() => {
249
- return bem('header')
250
- })
251
-
252
- // header的标题样式
253
- const headerTitleClasses = computed(() => {
254
- return bem('header__title', {
255
- center: props.center || props.titleCenter
256
- })
257
- })
258
-
259
- // body的样式
260
- const bodyClasses = bem('body', {
261
- center: props.center
262
- })
263
-
264
- // footer的样式
265
- const footerClasses = computed(() => {
266
- return bem('footer', {
267
- 'has-tips': props.footerTips
268
- })
269
- })
270
-
271
- function afterEnter() {
272
- emits('opened')
273
- }
274
-
275
- function afterLeave() {
276
- emits('closed')
277
- }
278
-
279
- function beforeLeave() {
280
- emits('close')
281
- }
282
-
283
- // 关闭弹框
284
- const handleClose = () => {
285
- emits('update:modelValue', false)
286
- clearInterval(cancelTimer)
287
- clearInterval(confirmTimer)
288
- }
289
-
290
- // 点击弹框的取消按钮
291
- const handleCancel = () => {
292
- clearInterval(cancelTimer)
293
- emits('cancel')
294
- }
295
-
296
- // 点击弹框的确定按钮
297
- const handleConfirm = () => {
298
- clearInterval(confirmTimer)
299
- emits('confirm')
300
- }
301
- </script>
302
-
303
- <style lang="scss">
304
- @import './index.scss';
305
- </style>
@@ -1,68 +0,0 @@
1
- <!--
2
- * @Author: chenghuan.dong
3
- * @Date: 2022-12-24 19:25:39
4
- * @LastEditors: chenghuan.dong
5
- * @LastEditTime: 2023-06-29 18:29:05
6
- * @Description: 空页面
7
- -->
8
- <template>
9
- <div class="nb-empty" :class="[!!$slots.default ? bem(['slot']) : '']">
10
- <img v-if="icon === 'data'" src="./images/empty-data.png" class="nb-empty-icon" />
11
- <img v-else-if="icon === 'abnormal'" src="./images/empty-abnormal.png" class="nb-empty-icon" />
12
- <img v-else src="./images/empty-search.png" class="nb-empty-icon" />
13
- <p v-if="text" class="nb-empty-text">{{ text }}</p>
14
- <slot></slot>
15
- </div>
16
- </template>
17
- <script setup>
18
- import { createNamespace } from '../../../utils/create.js'
19
- // 定义名称
20
- defineOptions({
21
- name: 'NbEmpty'
22
- })
23
-
24
- // 定义props
25
- const props = defineProps({
26
- // 定义Props
27
- // 提示语
28
- text: {
29
- type: String,
30
- default: ''
31
- },
32
- // 类型 search data abnormal
33
- icon: {
34
- type: String,
35
- default: 'search',
36
- validator(value) {
37
- return ['search', 'data', 'abnormal'].includes(value)
38
- }
39
- }
40
- })
41
-
42
- const [name, bem] = createNamespace('empty')
43
- </script>
44
-
45
- <style lang="scss" scoped>
46
- .nb-empty {
47
- display: flex;
48
- flex-direction: column;
49
- align-items: center;
50
- justify-content: center;
51
- width: 100%;
52
- height: 100%;
53
- .nb-empty-icon {
54
- width: 500px;
55
- height: 500px;
56
- }
57
- .nb-empty-text {
58
- font-size: 32px;
59
- line-height: 48px;
60
- margin-top: 30px;
61
- }
62
- &--slot {
63
- .nb-empty-text {
64
- margin-bottom: 32px;
65
- }
66
- }
67
- }
68
- </style>