@neatui/nuxt 0.1.0 → 1.0.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.
- package/BUILD.md +128 -0
- package/README.md +98 -1
- package/SSR_COMPATIBILITY.md +201 -0
- package/USAGE.md +260 -0
- package/nuxt.config.example.ts +37 -0
- package/package.json +29 -11
- package/src/components/basic/IDraggable.vue +87 -65
- package/src/components/basic/IFollowView.vue +32 -23
- package/src/components/basic/IRouterView.vue +38 -23
- package/src/components/basic/IScrollView.vue +11 -7
- package/src/components/basic/Icon.vue +17 -17
- package/src/components/basic/LayerView/Layer.vue +33 -106
- package/src/components/basic/follow.ts +133 -0
- package/src/components/display/Calendar.vue +14 -14
- package/src/components/display/CalendarReg.vue +14 -14
- package/src/components/display/Image.vue +8 -8
- package/src/components/display/PhotoEditor.vue +36 -36
- package/src/components/display/PhotoViewer.vue +8 -8
- package/src/components/display/Tree.vue +6 -6
- package/src/components/display/TreeView.vue +4 -4
- package/src/components/display/index.ts +2 -2
- package/src/components/form/Cascader.vue +19 -19
- package/src/components/form/Checkbox.vue +64 -0
- package/src/components/form/DatePicker.vue +6 -7
- package/src/components/form/DateRangePicker@v3.vue +4 -4
- package/src/components/form/DateRangeView@v3.vue +18 -19
- package/src/components/form/DateView.vue +14 -14
- package/src/components/form/DateView@v2.vue +14 -14
- package/src/components/form/DateView@v3.vue +331 -318
- package/src/components/form/ImgUpload.vue +7 -7
- package/src/components/form/Input@v3.vue +11 -11
- package/src/components/form/MoreSelect@v3.vue +87 -17
- package/src/components/form/MoreSelectList.vue +8 -8
- package/src/components/form/MoreSelectPanel@v3.vue +3 -3
- package/src/components/form/MoreSelectPicker.vue +7 -7
- package/src/components/form/MoreSelectTags.vue +8 -8
- package/src/components/form/PageMoreSelect.vue +14 -14
- package/src/components/form/PageSelect.vue +16 -16
- package/src/components/form/SearchMoreSelect.vue +12 -12
- package/src/components/form/SearchSelect@v3.vue +3 -3
- package/src/components/form/Select@v3.vue +229 -23
- package/src/components/form/SelectList.vue +8 -8
- package/src/components/form/SelectPicker.vue +6 -6
- package/src/components/form/SelectTags.vue +7 -7
- package/src/components/form/SelectTree/SelectTree@v1.vue +5 -5
- package/src/components/form/Switch.vue +38 -103
- package/src/components/form/TextArea.vue +18 -18
- package/src/components/form/Textarea@v2.vue +275 -0
- package/src/components/form/TimeView.vue +14 -14
- package/src/components/form/Upload.vue +806 -297
- package/src/components/form/date.ts +321 -0
- package/src/components/form/index.ts +7 -5
- package/src/components/form/number.ts +3 -0
- package/src/components/form/type.ts +224 -0
- package/src/components/icon/OrderIcon.vue +113 -0
- package/src/components/loader/FormLoader/FormLoader@v2.vue +193 -195
- package/src/components/loader/FormLoader/FormLoader@v3.vue.backup +372 -291
- package/src/components/loader/FormLoader/FormRender@v3.vue.backup +4 -0
- package/src/components/loader/FormLoader/NodeLoader.vue +85 -0
- package/src/components/loader/FormLoader@v1/FormLoader.vue +1 -1
- package/src/components/loader/FormLoader@v1/FormRender.vue +49 -24
- package/src/components/loader/LayerLoader/LayerLoader.vue +318 -0
- package/src/components/loader/LayerLoader/index.ts +2 -0
- package/src/components/loader/LayerLoader/style.scss +77 -0
- package/src/components/loader/LimitLoader/LimitLoader@v3.vue +39 -28
- package/src/components/loader/MoveLoader/MoveLoader.vue +628 -0
- package/src/components/loader/MoveLoader/index.ts +2 -0
- package/src/components/loader/MoveLoader/style.scss +77 -0
- package/src/components/loader/TableLoader/TableLoader.vue +227 -195
- package/src/components/loader/TableLoader/TableRender.vue +141 -0
- package/src/components/loader/TableLoader/index.ts +47 -0
- package/src/components/loader/index.ts +3 -2
- package/src/components/tools/Pagination@a.vue +17 -18
- package/src/components/tools/Pagination@b.vue +16 -16
- package/src/index.ts +2 -1
- package/src/module.ts +169 -0
- package/src/runtime/types.d.ts +36 -0
- package/src/store/{myui.ts → frame.ts} +4 -4
- package/src/utils/theme.ts +14 -0
- package/tsconfig.json +1 -1
- package/src/components/loader/FormLoader/index.ts +0 -2
- package/src/components/loader/LimitLoader/LimitLoader.vue.backup +0 -131
- package/src/components/loader/LimitLoader/LimitLoader@v2.vue.backup +0 -174
- package/src/components/loader/TableLoader/TableColView.vue +0 -115
@@ -29,35 +29,35 @@
|
|
29
29
|
const props: any = defineProps({
|
30
30
|
zIndex: {
|
31
31
|
type: [String, Number],
|
32
|
-
default: ''
|
32
|
+
default: '',
|
33
33
|
},
|
34
34
|
area: {
|
35
35
|
type: String,
|
36
|
-
default: '#fekit'
|
36
|
+
default: '#fekit',
|
37
37
|
},
|
38
38
|
id: {
|
39
|
-
type: String
|
39
|
+
type: String,
|
40
40
|
},
|
41
41
|
am: {
|
42
42
|
type: String as PropType<'aa' | 'ab' | 'ac' | 'ad' | 'ae' | 'af' | 'ag' | 'ah' | 'ai' | 'aj' | 'ak' | 'al' | 'am' | 'an' | 'ao' | 'ap' | 'aq' | 'ar' | 'as' | 'at'>,
|
43
|
-
default: 'as'
|
43
|
+
default: 'as',
|
44
44
|
},
|
45
45
|
flex: {
|
46
46
|
type: String as PropType<'lt' | 'ct' | 'rt' | 'lm' | 'cm' | 'rm' | 'lb' | 'cb' | 'rb'>,
|
47
|
-
default: 'cm'
|
47
|
+
default: 'cm',
|
48
48
|
},
|
49
49
|
dark: {
|
50
50
|
type: [String, Number],
|
51
|
-
default: ''
|
51
|
+
default: '',
|
52
52
|
},
|
53
53
|
darkClickClose: {
|
54
54
|
type: Boolean,
|
55
|
-
default: true
|
55
|
+
default: true,
|
56
56
|
},
|
57
57
|
wrapStyle: {
|
58
58
|
type: String,
|
59
|
-
default: ''
|
60
|
-
}
|
59
|
+
default: '',
|
60
|
+
},
|
61
61
|
});
|
62
62
|
|
63
63
|
const _area: any = document.querySelector(props.area);
|
@@ -72,7 +72,7 @@
|
|
72
72
|
const state = reactive({
|
73
73
|
view: 0,
|
74
74
|
params: {},
|
75
|
-
top: 0
|
75
|
+
top: 0,
|
76
76
|
});
|
77
77
|
|
78
78
|
function disableScroll() {
|
@@ -101,7 +101,7 @@
|
|
101
101
|
enableScroll();
|
102
102
|
}
|
103
103
|
},
|
104
|
-
{ deep: true, immediate: true }
|
104
|
+
{ deep: true, immediate: true },
|
105
105
|
);
|
106
106
|
|
107
107
|
// 回调合集
|
@@ -109,7 +109,7 @@
|
|
109
109
|
show: [],
|
110
110
|
hide: [],
|
111
111
|
open: [],
|
112
|
-
none: []
|
112
|
+
none: [],
|
113
113
|
};
|
114
114
|
|
115
115
|
// 注入参数
|
@@ -167,7 +167,6 @@
|
|
167
167
|
if (state.view === 1) {
|
168
168
|
state.view = 0;
|
169
169
|
on.hide.forEach((fun: any) => {
|
170
|
-
// isFunction(fun) && fun();
|
171
170
|
if (isFunction(fun)) {
|
172
171
|
fun();
|
173
172
|
}
|
@@ -176,7 +175,6 @@
|
|
176
175
|
if (state.view === 2) {
|
177
176
|
state.view = 3;
|
178
177
|
on.show.forEach((fun: any) => {
|
179
|
-
// isFunction(fun) && fun();
|
180
178
|
if (isFunction(fun)) {
|
181
179
|
fun();
|
182
180
|
}
|
@@ -200,11 +198,6 @@
|
|
200
198
|
delete _tasks[id];
|
201
199
|
});
|
202
200
|
</script>
|
203
|
-
<!-- <script lang="ts">
|
204
|
-
export const LayerById = (id: any) => {
|
205
|
-
return (window as any)._FEKIT_LAYER_TASKS[id];
|
206
|
-
};
|
207
|
-
</script> -->
|
208
201
|
|
209
202
|
<style lang="scss">
|
210
203
|
// 弹层
|
@@ -234,106 +227,40 @@
|
|
234
227
|
}
|
235
228
|
|
236
229
|
&-close {
|
230
|
+
cursor: pointer;
|
237
231
|
position: absolute;
|
238
|
-
width:
|
239
|
-
height:
|
240
|
-
|
241
|
-
|
242
|
-
|
232
|
+
width: 2em;
|
233
|
+
height: 2em;
|
234
|
+
|
235
|
+
color: var(--co-read);
|
236
|
+
bottom: auto;
|
237
|
+
top: 0.5em;
|
238
|
+
right: 0.5em;
|
239
|
+
left: auto;
|
240
|
+
box-shadow: none;
|
241
|
+
|
243
242
|
padding: 0.25em;
|
243
|
+
margin-left: -1rem;
|
244
244
|
text-align: center;
|
245
|
-
transform: scale(
|
245
|
+
transform: scale(0.8);
|
246
246
|
transition: all 0.2s;
|
247
|
-
color: #fff;
|
248
|
-
box-shadow: 0 0 0 2px currentColor;
|
249
247
|
border-radius: 50%;
|
250
|
-
opacity: 0;
|
251
248
|
background:
|
252
|
-
linear-gradient(45deg, transparent 44%, currentColor 45%, currentColor
|
253
|
-
linear-gradient(-45deg, transparent 44%, currentColor 45%, currentColor
|
249
|
+
linear-gradient(45deg, transparent 44%, currentColor 45%, currentColor 55%, transparent 56%) no-repeat center / 50% 50%,
|
250
|
+
linear-gradient(-45deg, transparent 44%, currentColor 45%, currentColor 55%, transparent 56%) no-repeat center / 50% 50%;
|
254
251
|
|
255
252
|
&:active {
|
256
253
|
transform: scale(0.9);
|
257
254
|
}
|
258
255
|
}
|
259
256
|
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
257
|
+
.fekit-layer-close {
|
258
|
+
&:hover {
|
259
|
+
transform: scale(0.8) rotate(90deg);
|
260
|
+
}
|
261
|
+
&:active {
|
262
|
+
transform: scale(0.7) rotate(90deg);
|
264
263
|
}
|
265
264
|
}
|
266
|
-
|
267
|
-
// &-close {
|
268
|
-
// position: absolute;
|
269
|
-
// width: 2rem;
|
270
|
-
// height: 2rem;
|
271
|
-
// line-height: 2rem;
|
272
|
-
// right: 0.5rem;
|
273
|
-
// top: 0.5rem;
|
274
|
-
// text-align: center;
|
275
|
-
// transform: rotate(0deg);
|
276
|
-
// transition: all 0.2s;
|
277
|
-
|
278
|
-
// &:hover {
|
279
|
-
// transform: rotate(-90deg);
|
280
|
-
// }
|
281
|
-
// }
|
282
|
-
|
283
|
-
// &-close {
|
284
|
-
// position: absolute;
|
285
|
-
// width: 18px;
|
286
|
-
// height: 18px;
|
287
|
-
// right: 0.5em;
|
288
|
-
// top: 0.5em;
|
289
|
-
// padding: 0.25em;
|
290
|
-
// text-align: center;
|
291
|
-
// transition: all 0.2s;
|
292
|
-
// // box-shadow: 0 0 0 1px currentColor;
|
293
|
-
// border-radius: 50%;
|
294
|
-
// background: linear-gradient(45deg, transparent 44%, currentColor 46%, currentColor 54%, transparent 56%) no-repeat center / 50% 50%,
|
295
|
-
// linear-gradient(-45deg, transparent 44%, currentColor 46%, currentColor 54%, transparent 56%) no-repeat center / 50% 50%;
|
296
|
-
// transform: scale(1) rotate(0deg);
|
297
|
-
// opacity: 0.8;
|
298
|
-
// transition: all 0.25s;
|
299
|
-
|
300
|
-
// &:hover {
|
301
|
-
// transform: scale(1) rotate(-90deg);
|
302
|
-
// }
|
303
|
-
|
304
|
-
// &:active {
|
305
|
-
// transform: scale(0.8) rotate(-90deg);
|
306
|
-
// }
|
307
|
-
|
308
|
-
// &::before {
|
309
|
-
// position: absolute;
|
310
|
-
// content: '';
|
311
|
-
// width: 200%;
|
312
|
-
// height: 200%;
|
313
|
-
// left: -50%;
|
314
|
-
// top: -50%;
|
315
|
-
// }
|
316
|
-
// }
|
317
265
|
}
|
318
|
-
|
319
|
-
// html {
|
320
|
-
// &[size='xs'] {
|
321
|
-
// .fekit-layer-close {
|
322
|
-
// width: 16px;
|
323
|
-
// height: 16px;
|
324
|
-
// }
|
325
|
-
// }
|
326
|
-
// &[size='l'] {
|
327
|
-
// .fekit-layer-close {
|
328
|
-
// width: 20px;
|
329
|
-
// height: 20px;
|
330
|
-
// }
|
331
|
-
// }
|
332
|
-
// &[size='xl'] {
|
333
|
-
// .fekit-layer-close {
|
334
|
-
// width: 22px;
|
335
|
-
// height: 22px;
|
336
|
-
// }
|
337
|
-
// }
|
338
|
-
// }
|
339
266
|
</style>
|
@@ -0,0 +1,133 @@
|
|
1
|
+
import ResizeObserver from 'resize-observer-polyfill';
|
2
|
+
import raf from 'raf';
|
3
|
+
|
4
|
+
class Follow {
|
5
|
+
box: any[];
|
6
|
+
dom: any;
|
7
|
+
tip: any;
|
8
|
+
ing: any;
|
9
|
+
sub: any;
|
10
|
+
obs: any;
|
11
|
+
fun: (status: any) => void;
|
12
|
+
private css: () => void;
|
13
|
+
z: number;
|
14
|
+
constructor(dom: any, tip: any, fun = (_status: any) => {}) {
|
15
|
+
this.dom = dom;
|
16
|
+
this.tip = tip;
|
17
|
+
this.box = [];
|
18
|
+
this.css = this.setcss.bind(this);
|
19
|
+
this.fun = fun;
|
20
|
+
this.sub = this.tip.firstElementChild;
|
21
|
+
this.z = 0;
|
22
|
+
}
|
23
|
+
setcss() {
|
24
|
+
if (!this.ing) {
|
25
|
+
raf(() => {
|
26
|
+
this.ing = false;
|
27
|
+
const dr = this.dom?.getBoundingClientRect() || { width: 0, height: 0, top: 0, bottom: 0, left: 0, right: 0 };
|
28
|
+
const sr = this.sub?.getBoundingClientRect() || { height: 0 };
|
29
|
+
this.tip.style.inset = `${dr.top}px auto auto ${dr.left}px`;
|
30
|
+
this.tip.style.width = dr.width + 'px';
|
31
|
+
this.tip.style.height = dr.height + 'px';
|
32
|
+
this.fun('');
|
33
|
+
this.box.forEach((e: any) => {
|
34
|
+
const _ar = { top: 0, bottom: window.innerHeight, left: 0, right: window.innerWidth };
|
35
|
+
const ar = e === window ? _ar : e?.getBoundingClientRect() || _ar;
|
36
|
+
if (dr.bottom < ar.top || dr.top > ar.bottom || dr.right < ar.left || dr.left > ar.right) {
|
37
|
+
this.tip.style.opacity = '0';
|
38
|
+
this.sub.style.pointerEvents = 'none';
|
39
|
+
} else {
|
40
|
+
this.tip.style.opacity = '';
|
41
|
+
this.sub.style.pointerEvents = '';
|
42
|
+
}
|
43
|
+
if (dr.bottom + sr.height + 10 > ar.bottom) {
|
44
|
+
this.fun('b');
|
45
|
+
}
|
46
|
+
});
|
47
|
+
const tr = this.tip?.getBoundingClientRect() || { left: 0 };
|
48
|
+
const x = this.sub.offsetLeft + tr.left;
|
49
|
+
const arrow = this.sub.querySelector('[ui-tips-arrow]');
|
50
|
+
if (x < 0) {
|
51
|
+
this.sub.style.transform = `translate3d(${-x}px,0,0)`;
|
52
|
+
if (arrow && arrow.style) {
|
53
|
+
arrow.style.transform = `translateX(${x}px) rotate(45deg)`;
|
54
|
+
}
|
55
|
+
} else {
|
56
|
+
this.sub.style.transform = '';
|
57
|
+
if (arrow && arrow.style) {
|
58
|
+
arrow.style.transform = '';
|
59
|
+
}
|
60
|
+
}
|
61
|
+
});
|
62
|
+
this.ing = true;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
listen() {
|
66
|
+
// 向上查询有滚动条的元素
|
67
|
+
const _find = (e: any) => {
|
68
|
+
// 判断是否为DOM节点
|
69
|
+
if (e) {
|
70
|
+
if (e.nodeType === 1) {
|
71
|
+
const css: any = window.getComputedStyle(e);
|
72
|
+
// 查询所有父组节点的最高层级
|
73
|
+
if (!isNaN(css.zIndex) && css.zIndex >= this.z) {
|
74
|
+
this.z = Number(css.zIndex) + 10;
|
75
|
+
} else {
|
76
|
+
this.z += 1;
|
77
|
+
}
|
78
|
+
// 节点是否有滚动条
|
79
|
+
if (
|
80
|
+
(css.overflowY === 'auto' || css.overflowY === 'scroll' || css.overflowX === 'auto' || css.overflowX === 'scroll') &&
|
81
|
+
(e.scrollHeight > e.clientHeight || e.scrollWidth > e.clientWidth)
|
82
|
+
) {
|
83
|
+
this.box.push(e);
|
84
|
+
}
|
85
|
+
_find(e.parentNode);
|
86
|
+
} else if (e.nodeType === 9) {
|
87
|
+
console.log(42, e, e.nodeType);
|
88
|
+
this.box.push(window);
|
89
|
+
}
|
90
|
+
}
|
91
|
+
};
|
92
|
+
_find(this.dom);
|
93
|
+
|
94
|
+
// 自动层级
|
95
|
+
if (window.getComputedStyle(this.tip).zIndex) {
|
96
|
+
this.tip.style.zIndex = `${this.z}`;
|
97
|
+
}
|
98
|
+
|
99
|
+
this.css();
|
100
|
+
// 监听窗口尺寸变化
|
101
|
+
window.addEventListener('resize', this.css);
|
102
|
+
window.addEventListener('click', this.css);
|
103
|
+
// 监听滚动条的元素
|
104
|
+
this.box.forEach((e: any) => {
|
105
|
+
e.addEventListener('scroll', this.css);
|
106
|
+
});
|
107
|
+
// 监听移入事件
|
108
|
+
this.dom?.addEventListener('mouseenter', this.css);
|
109
|
+
// 监听参考元素变化
|
110
|
+
this.obs = new ResizeObserver(this.css);
|
111
|
+
if (this.dom) {
|
112
|
+
this.obs?.observe(this.dom);
|
113
|
+
}
|
114
|
+
if (this.sub) {
|
115
|
+
this.obs?.observe(this.sub);
|
116
|
+
}
|
117
|
+
}
|
118
|
+
remove() {
|
119
|
+
// console.log('移除监听');
|
120
|
+
// 清除窗口尺寸变化事件监听器
|
121
|
+
window.removeEventListener('resize', this.css);
|
122
|
+
window.removeEventListener('click', this.css);
|
123
|
+
// 清除滚动条元素的事件监听器
|
124
|
+
this.box.forEach((e: any) => {
|
125
|
+
e.removeEventListener('scroll', this.css);
|
126
|
+
});
|
127
|
+
// 清除鼠标移入事件监听器
|
128
|
+
this.dom?.removeEventListener('mouseenter', this.css);
|
129
|
+
// 清除监听参考元素变化
|
130
|
+
this.obs?.disconnect();
|
131
|
+
}
|
132
|
+
}
|
133
|
+
export default Follow;
|
@@ -19,8 +19,8 @@
|
|
19
19
|
<div
|
20
20
|
ui-flex="col cm"
|
21
21
|
class="r-ss b-solid bk-none b-xs"
|
22
|
-
:class="`${item.isToday ? 'bk-main-ls' : item.isLastMonth || item.isNextMonth ? 'co-note' : item.isHoliday ? 'co-risk' : ''} ${
|
23
|
-
state.selected && state.selected === item.date ? 'active bg-main-ls co-fore' : 'hover-bg-weak'
|
22
|
+
:class="`${item.isToday ? 'bk-main-o-ls' : item.isLastMonth || item.isNextMonth ? 'co-note' : item.isHoliday ? 'co-risk' : ''} ${
|
23
|
+
state.selected && state.selected === item.date ? 'active bg-main-o-ls co-fore' : 'hover-bg-weak'
|
24
24
|
}`"
|
25
25
|
>
|
26
26
|
<span>{{ item.day }}</span>
|
@@ -108,40 +108,40 @@
|
|
108
108
|
// 提示文案
|
109
109
|
tips: {
|
110
110
|
type: String,
|
111
|
-
default: ''
|
111
|
+
default: '',
|
112
112
|
},
|
113
113
|
// 提示文案
|
114
114
|
placeholder: {
|
115
115
|
type: String,
|
116
|
-
default: ''
|
116
|
+
default: '',
|
117
117
|
},
|
118
118
|
// 格式
|
119
119
|
format: {
|
120
120
|
type: String,
|
121
|
-
default: ''
|
121
|
+
default: '',
|
122
122
|
},
|
123
123
|
// 值
|
124
124
|
value: {
|
125
125
|
type: [String, Number],
|
126
|
-
default: ''
|
126
|
+
default: '',
|
127
127
|
},
|
128
128
|
// 值
|
129
129
|
modelValue: { type: [String, Number], default: '' },
|
130
130
|
// 节假日
|
131
131
|
holiday: {
|
132
132
|
type: Object,
|
133
|
-
default: () => ({})
|
133
|
+
default: () => ({}),
|
134
134
|
},
|
135
135
|
// 校验规则
|
136
136
|
rules: {
|
137
137
|
type: Array,
|
138
|
-
default: () => []
|
138
|
+
default: () => [],
|
139
139
|
},
|
140
140
|
// 是否是示校验图标
|
141
141
|
verify: {
|
142
142
|
type: Boolean,
|
143
|
-
default: false
|
144
|
-
}
|
143
|
+
default: false,
|
144
|
+
},
|
145
145
|
});
|
146
146
|
|
147
147
|
// 内部数据
|
@@ -186,7 +186,7 @@
|
|
186
186
|
calendar.unshift({
|
187
187
|
date: `${last_y}-${last_m}-${prevdays}`,
|
188
188
|
day: prevdays,
|
189
|
-
isLastMonth: 1
|
189
|
+
isLastMonth: 1,
|
190
190
|
});
|
191
191
|
prevdays = prevdays - 1;
|
192
192
|
}
|
@@ -197,7 +197,7 @@
|
|
197
197
|
day: _i,
|
198
198
|
isToday: curr_y === y && curr_m === m && curr_d === i,
|
199
199
|
isHoliday: props.holiday[`${y}-${m}-${_i}`]?.name ? 1 : 0,
|
200
|
-
holiday: props.holiday[`${y}-${m}-${_i}`]?.name
|
200
|
+
holiday: props.holiday[`${y}-${m}-${_i}`]?.name,
|
201
201
|
});
|
202
202
|
}
|
203
203
|
for (let i = 1; calendar.length < 42; i++) {
|
@@ -205,14 +205,14 @@
|
|
205
205
|
calendar.push({
|
206
206
|
date: `${next_y}-${next_m}-${_i}`,
|
207
207
|
day: _i,
|
208
|
-
isNextMonth: 1
|
208
|
+
isNextMonth: 1,
|
209
209
|
});
|
210
210
|
}
|
211
211
|
return { days: calendar, y, m, d };
|
212
212
|
}),
|
213
213
|
value: computed(() => {
|
214
214
|
return props.format ? idate(state.selected || props.value).format(props.format) : state.selected || props.value;
|
215
|
-
})
|
215
|
+
}),
|
216
216
|
});
|
217
217
|
const { curr = {} }: any = toRefs(state);
|
218
218
|
|
@@ -19,8 +19,8 @@
|
|
19
19
|
<div
|
20
20
|
ui-flex="col cm"
|
21
21
|
class="r-ss b-solid bk-none b-xs"
|
22
|
-
:class="`${item.isToday ? 'bk-main-ls' : item.isLastMonth || item.isNextMonth ? 'co-note' : item.isHoliday ? 'co-risk' : ''} ${
|
23
|
-
state.selected && state.selected === item.date ? 'active bg-main-ls co-fore' : 'hover-bg-weak'
|
22
|
+
:class="`${item.isToday ? 'bk-main-o-ls' : item.isLastMonth || item.isNextMonth ? 'co-note' : item.isHoliday ? 'co-risk' : ''} ${
|
23
|
+
state.selected && state.selected === item.date ? 'active bg-main-o-ls co-fore' : 'hover-bg-weak'
|
24
24
|
}`"
|
25
25
|
>
|
26
26
|
<span>{{ item.day }}</span>
|
@@ -108,40 +108,40 @@
|
|
108
108
|
// 提示文案
|
109
109
|
tips: {
|
110
110
|
type: String,
|
111
|
-
default: ''
|
111
|
+
default: '',
|
112
112
|
},
|
113
113
|
// 提示文案
|
114
114
|
placeholder: {
|
115
115
|
type: String,
|
116
|
-
default: ''
|
116
|
+
default: '',
|
117
117
|
},
|
118
118
|
// 格式
|
119
119
|
format: {
|
120
120
|
type: String,
|
121
|
-
default: ''
|
121
|
+
default: '',
|
122
122
|
},
|
123
123
|
// 值
|
124
124
|
value: {
|
125
125
|
type: [String, Number],
|
126
|
-
default: ''
|
126
|
+
default: '',
|
127
127
|
},
|
128
128
|
// 值
|
129
129
|
modelValue: { type: [String, Number], default: '' },
|
130
130
|
// 节假日
|
131
131
|
holiday: {
|
132
132
|
type: Object,
|
133
|
-
default: () => ({})
|
133
|
+
default: () => ({}),
|
134
134
|
},
|
135
135
|
// 校验规则
|
136
136
|
rules: {
|
137
137
|
type: Array,
|
138
|
-
default: () => []
|
138
|
+
default: () => [],
|
139
139
|
},
|
140
140
|
// 是否是示校验图标
|
141
141
|
verify: {
|
142
142
|
type: Boolean,
|
143
|
-
default: false
|
144
|
-
}
|
143
|
+
default: false,
|
144
|
+
},
|
145
145
|
});
|
146
146
|
|
147
147
|
// 内部数据
|
@@ -186,7 +186,7 @@
|
|
186
186
|
calendar.unshift({
|
187
187
|
date: `${last_y}-${last_m}-${prevdays}`,
|
188
188
|
day: prevdays,
|
189
|
-
isLastMonth: 1
|
189
|
+
isLastMonth: 1,
|
190
190
|
});
|
191
191
|
prevdays = prevdays - 1;
|
192
192
|
}
|
@@ -197,7 +197,7 @@
|
|
197
197
|
day: _i,
|
198
198
|
isToday: curr_y === y && curr_m === m && curr_d === i,
|
199
199
|
isHoliday: props.holiday[`${y}-${m}-${_i}`]?.name ? 1 : 0,
|
200
|
-
holiday: props.holiday[`${y}-${m}-${_i}`]?.name
|
200
|
+
holiday: props.holiday[`${y}-${m}-${_i}`]?.name,
|
201
201
|
});
|
202
202
|
}
|
203
203
|
for (let i = 1; calendar.length < 42; i++) {
|
@@ -205,14 +205,14 @@
|
|
205
205
|
calendar.push({
|
206
206
|
date: `${next_y}-${next_m}-${_i}`,
|
207
207
|
day: _i,
|
208
|
-
isNextMonth: 1
|
208
|
+
isNextMonth: 1,
|
209
209
|
});
|
210
210
|
}
|
211
211
|
return { days: calendar, y, m, d };
|
212
212
|
}),
|
213
213
|
value: computed(() => {
|
214
214
|
return props.format ? idate(state.selected || props.value).format(props.format) : state.selected || props.value;
|
215
|
-
})
|
215
|
+
}),
|
216
216
|
});
|
217
217
|
const { curr = {} }: any = toRefs(state);
|
218
218
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<template>
|
2
2
|
<div>
|
3
|
-
<div :class="`mc-img
|
3
|
+
<div :class="`mc-img ${imgClass}`" :style="imgStyle">
|
4
4
|
<img :src="src[srcName]" :style="`object-fit: ${fit}`" @click.stop="showPreview" />
|
5
5
|
<div v-if="tools" class="mc-img-tools">
|
6
6
|
<slot name="tools">
|
@@ -19,33 +19,33 @@
|
|
19
19
|
|
20
20
|
const props: any = defineProps({
|
21
21
|
tools: { type: Boolean, default: true },
|
22
|
-
srcName: { type: String, default: '
|
22
|
+
srcName: { type: String, default: 'url' },
|
23
23
|
theme: { type: String, default: '@a' },
|
24
24
|
co: { type: String, default: 'note' },
|
25
25
|
imgClass: { type: String, default: '' },
|
26
26
|
imgStyle: { type: String, default: '' },
|
27
27
|
src: {
|
28
28
|
type: Object,
|
29
|
-
default: () => ({})
|
29
|
+
default: () => ({}),
|
30
30
|
},
|
31
31
|
files: {
|
32
32
|
type: Array as () => any[],
|
33
|
-
default: () => []
|
33
|
+
default: () => [],
|
34
34
|
},
|
35
35
|
// 图片如何适应容器框,同原生object-fit
|
36
36
|
fit: {
|
37
37
|
type: String,
|
38
|
-
default: 'contain'
|
38
|
+
default: 'contain',
|
39
39
|
},
|
40
40
|
// 是否开启图片预览放大
|
41
41
|
preview: {
|
42
42
|
type: Boolean,
|
43
|
-
default: true
|
43
|
+
default: true,
|
44
44
|
},
|
45
45
|
initialSlide: {
|
46
46
|
type: Number,
|
47
|
-
default: 0
|
48
|
-
}
|
47
|
+
default: 0,
|
48
|
+
},
|
49
49
|
});
|
50
50
|
|
51
51
|
const emit = defineEmits(['delImg']);
|