@neatui/nuxt 0.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.
- package/README.md +3 -0
- package/package.json +43 -0
- package/rollup.config.js +35 -0
- package/src/components/basic/IDraggable.vue +84 -0
- package/src/components/basic/IDraggable@b.vue +80 -0
- package/src/components/basic/IFollowView.vue +211 -0
- package/src/components/basic/IPickerView.vue +351 -0
- package/src/components/basic/IRouterView.vue +360 -0
- package/src/components/basic/IScrollView.vue +127 -0
- package/src/components/basic/Icon.vue +54 -0
- package/src/components/basic/LayerView/Layer.vue +339 -0
- package/src/components/basic/LayerView/index.ts +5 -0
- package/src/components/basic/index.ts +7 -0
- package/src/components/display/Avatar.vue +1 -0
- package/src/components/display/Badge.vue +1 -0
- package/src/components/display/Calendar.vue +245 -0
- package/src/components/display/CalendarReg.vue +245 -0
- package/src/components/display/Card.vue +1 -0
- package/src/components/display/Carousel.vue +1 -0
- package/src/components/display/ChartView.vue +123 -0
- package/src/components/display/Collapse.vue +1 -0
- package/src/components/display/Desriptions.vue +1 -0
- package/src/components/display/Empty.vue +1 -0
- package/src/components/display/Image.vue +112 -0
- package/src/components/display/List.vue +1 -0
- package/src/components/display/PhotoEditor.vue +181 -0
- package/src/components/display/PhotoViewer.vue +50 -0
- package/src/components/display/Popover.vue +1 -0
- package/src/components/display/QRCode.vue +1 -0
- package/src/components/display/Segmented.vue +1 -0
- package/src/components/display/Statistic.vue +1 -0
- package/src/components/display/Table.vue +1 -0
- package/src/components/display/Tabs.vue +1 -0
- package/src/components/display/Tag.vue +1 -0
- package/src/components/display/Timeline.vue +1 -0
- package/src/components/display/Tooltip.vue +1 -0
- package/src/components/display/Tour.vue +1 -0
- package/src/components/display/Tree.vue +431 -0
- package/src/components/display/TreeView.vue +225 -0
- package/src/components/display/index.ts +8 -0
- package/src/components/form/Cascader.vue +435 -0
- package/src/components/form/DatePicker.vue +124 -0
- package/src/components/form/DateRangePicker@v2.vue.backup +224 -0
- package/src/components/form/DateRangePicker@v3.vue +116 -0
- package/src/components/form/DateRangeView@v3.vue +386 -0
- package/src/components/form/DateView.vue +229 -0
- package/src/components/form/DateView@v2.vue +386 -0
- package/src/components/form/DateView@v3.vue +471 -0
- package/src/components/form/EditUpload.vue +4 -0
- package/src/components/form/ImgUpload.vue +174 -0
- package/src/components/form/Input.vue.backup +230 -0
- package/src/components/form/Input@v3.vue +267 -0
- package/src/components/form/InputNumber.vue +200 -0
- package/src/components/form/InputRange.vue +235 -0
- package/src/components/form/MoreSelect.vue.backup +144 -0
- package/src/components/form/MoreSelect@v3.vue +195 -0
- package/src/components/form/MoreSelectList.vue +125 -0
- package/src/components/form/MoreSelectPanel@v3.vue +190 -0
- package/src/components/form/MoreSelectPicker.vue +124 -0
- package/src/components/form/MoreSelectTags.vue +124 -0
- package/src/components/form/PageMoreSelect.vue +187 -0
- package/src/components/form/PageSelect.vue +189 -0
- package/src/components/form/SearchMoreSelect.vue +173 -0
- package/src/components/form/SearchSelect.vue.backup +194 -0
- package/src/components/form/SearchSelect@v3.vue +202 -0
- package/src/components/form/Select@v3.vue +201 -0
- package/src/components/form/SelectList.vue +58 -0
- package/src/components/form/SelectPicker.vue +97 -0
- package/src/components/form/SelectTags.vue +52 -0
- package/src/components/form/SelectTree/SelectTree@v1.vue +227 -0
- package/src/components/form/Switch.vue +135 -0
- package/src/components/form/TextArea.vue +193 -0
- package/src/components/form/TimePicker.vue +11 -0
- package/src/components/form/TimeView.vue +244 -0
- package/src/components/form/Upload.vue +346 -0
- package/src/components/form/index.ts +82 -0
- package/src/components/loader/FormLoader/FormLoader@v2.vue +422 -0
- package/src/components/loader/FormLoader/FormLoader@v3.vue.backup +318 -0
- package/src/components/loader/FormLoader/index.ts +2 -0
- package/src/components/loader/FormLoader@v1/FormLoader.vue +506 -0
- package/src/components/loader/FormLoader@v1/FormRender.vue +277 -0
- package/src/components/loader/LimitLoader/LimitLoader.vue.backup +131 -0
- package/src/components/loader/LimitLoader/LimitLoader@v2.vue.backup +174 -0
- package/src/components/loader/LimitLoader/LimitLoader@v3.vue +183 -0
- package/src/components/loader/LimitLoader/index.ts +2 -0
- package/src/components/loader/TableLoader/TableColView.vue +115 -0
- package/src/components/loader/TableLoader/TableLoader.vue +360 -0
- package/src/components/loader/TableLoader/index.ts +2 -0
- package/src/components/loader/ViewLoader/ViewLoader@v1.vue +256 -0
- package/src/components/loader/ViewLoader/index.ts +2 -0
- package/src/components/loader/index.ts +5 -0
- package/src/components/tools/FormDraftsView.vue +330 -0
- package/src/components/tools/FormVerifyView.vue +206 -0
- package/src/components/tools/MoreTools.vue +74 -0
- package/src/components/tools/MoreTools@v2.vue +74 -0
- package/src/components/tools/Pagination@a.vue +222 -0
- package/src/components/tools/Pagination@b.vue +221 -0
- package/src/components/tools/index.ts +5 -0
- package/src/index.ts +9 -0
- package/src/shims-vue.d.ts +5 -0
- package/src/store/myui.ts +50 -0
- package/tsconfig.json +24 -0
@@ -0,0 +1,244 @@
|
|
1
|
+
<template>
|
2
|
+
<div :class="`${frame ? 'b-solid bk-line b-xs r-sm' : ''}`" ui-flex="col xy">
|
3
|
+
<div ui-calendar-head="" class="nx-sl ny-sm b-solid bk-line bb-xs">
|
4
|
+
<div ui-flex="row lm"></div>
|
5
|
+
<div ui-flex="row cm" class="nx-ss-sub">
|
6
|
+
<p class="mx-ss-sub">
|
7
|
+
<b>{{ curr.y }}年</b>
|
8
|
+
<b>{{ curr.m }}月</b>
|
9
|
+
<b>{{ curr.d }}日</b>
|
10
|
+
</p>
|
11
|
+
</div>
|
12
|
+
<div ui-flex="row rm"></div>
|
13
|
+
</div>
|
14
|
+
<div ui-flex="row am" class="fs-xs bold nx-sl nt-sm"><span>日</span><span>一</span><span>二</span><span>三</span><span>四</span><span>五</span><span>六</span></div>
|
15
|
+
<div>
|
16
|
+
<ul ui-calendar-days="" ui-flex="row lm" class="flex-wrap nx-sm">
|
17
|
+
<li class="ew7 n-sm ux-none" v-for="(item, idx) in curr.days" :key="idx">
|
18
|
+
<div v-if="item.day" @click="change(item)" ui-cover="-xs">
|
19
|
+
<div
|
20
|
+
ui-flex="col cm"
|
21
|
+
class="r-sm 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'
|
24
|
+
}`"
|
25
|
+
>
|
26
|
+
<span>{{ item.day }}</span>
|
27
|
+
<sup style="font-size: 0.6em; margin-top: -0.3em; position: absolute; left: 100%; top: 0" v-if="item.holiday" class="lh-ss">休</sup>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
</li>
|
31
|
+
</ul>
|
32
|
+
</div>
|
33
|
+
<div ui-calendar-foot="" ui-flex="row xm" class="nx-sl nb-sl">
|
34
|
+
<div ui-flex="row lm">
|
35
|
+
<div ui-btn="@a s none :square" @click="prev('y')">
|
36
|
+
<svg style="width: 1em; height: 1em" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
|
37
|
+
<path
|
38
|
+
d="M220.1 481.5L502 199.3c7.6-7.6 17.8-11.8 28.5-11.8s20.9 4.2 28.5 11.8c7.5 7.6 11.8 17.8 11.8 28.5s-4.2 20.9-11.8 28.5L305.5 510l253.4 253.7c7.3 7.6 11.4 17.8 11.3 28.4-0.1 10.6-4.3 20.7-11.8 28.2-7.5 7.5-17.6 11.7-28.1 11.8-10.6 0.1-20.7-4-28.3-11.3L220.1 538.5c-7.5-7.6-11.8-17.8-11.8-28.5s4.2-21 11.8-28.5z"
|
39
|
+
p-id="3429"
|
40
|
+
></path>
|
41
|
+
<path
|
42
|
+
d="M453.3 514.5c0-10.7 4.2-20.9 11.8-28.5L747 203.9c7.6-7.6 17.8-11.8 28.5-11.8s20.9 4.2 28.5 11.8c7.5 7.6 11.8 17.8 11.8 28.5s-4.2 20.9-11.8 28.5L550.5 514.5l253.4 253.7c7.3 7.6 11.4 17.8 11.3 28.4-0.1 10.6-4.3 20.7-11.8 28.2-7.5 7.5-17.6 11.7-28.1 11.8-10.6 0.1-20.7-4-28.3-11.3L465.1 543c-7.5-7.5-11.8-17.8-11.8-28.5z"
|
43
|
+
p-id="3430"
|
44
|
+
></path>
|
45
|
+
</svg>
|
46
|
+
</div>
|
47
|
+
<div ui-btn="@a s none :square" @click="prev('m')">
|
48
|
+
<svg style="width: 1em; height: 1em" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
|
49
|
+
<path
|
50
|
+
d="M684.2 827.6c-7.7 7.7-18.1 12-28.9 12-10.9 0-21.3-4.3-28.9-12L339.8 540.7c-7.7-7.7-12-18.1-12-29 0-10.9 4.3-21.3 12-29l286.6-286.9c7.7-7.5 18.1-11.6 28.8-11.5 10.7 0.1 21 4.4 28.6 12 7.6 7.6 11.9 17.9 12 28.6 0.1 10.7-4 21.1-11.5 28.8L426.6 511.8l257.6 257.9c7.7 7.7 12 18.1 12 29s-4.3 21.2-12 28.9z"
|
51
|
+
p-id="1281"
|
52
|
+
></path>
|
53
|
+
</svg>
|
54
|
+
</div>
|
55
|
+
</div>
|
56
|
+
<div ui-flex="row cm" class="nx-ss-sub">
|
57
|
+
<ul class="fs-xs n-sm-sub" ui-flex="row lm">
|
58
|
+
<li ui-btn="@a s none">年</li>
|
59
|
+
<li ui-btn="@a s none">月</li>
|
60
|
+
<li ui-btn="@a s none">日</li>
|
61
|
+
</ul>
|
62
|
+
</div>
|
63
|
+
<div ui-flex="row rm">
|
64
|
+
<div ui-btn="@a s none :square" @click="next('m')">
|
65
|
+
<svg style="width: 1em; height: 1em" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
|
66
|
+
<path
|
67
|
+
d="M339.8 827.6c-7.7-7.7-12-18.1-12-29s4.3-21.3 12-29l257.6-257.9-257.6-257.9c-7.5-7.7-11.6-18.1-11.5-28.8 0.1-10.7 4.4-21 12-28.6 7.6-7.6 17.9-11.9 28.6-12 10.7-0.1 21.1 4 28.8 11.5l286.6 286.9c7.7 7.7 12 18.1 12 29 0 10.9-4.3 21.3-12 29L397.7 827.6c-7.7 7.7-18.1 12-28.9 12-10.9 0-21.4-4.3-29-12z"
|
68
|
+
p-id="3084"
|
69
|
+
></path>
|
70
|
+
</svg>
|
71
|
+
</div>
|
72
|
+
<div ui-btn="@a s none :square" @click="next('y')">
|
73
|
+
<svg style="width: 1em; height: 1em" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
|
74
|
+
<path
|
75
|
+
d="M803.9 481.5L522.1 199.3a40.18 40.18 0 0 0-28.5-11.8c-10.7 0-20.9 4.2-28.5 11.8-7.5 7.6-11.8 17.8-11.8 28.5s4.2 20.9 11.8 28.5L718.5 510 465.1 763.6c-7.3 7.6-11.4 17.8-11.3 28.4 0.1 10.6 4.3 20.7 11.8 28.2 7.5 7.5 17.6 11.7 28.1 11.8 10.6 0.1 20.7-4 28.3-11.3l281.9-282.2c7.5-7.6 11.8-17.8 11.8-28.5s-4.2-21-11.8-28.5z"
|
76
|
+
p-id="3256"
|
77
|
+
></path>
|
78
|
+
<path
|
79
|
+
d="M570.7 514.5c0-10.7-4.2-20.9-11.8-28.5L277 203.9a40.18 40.18 0 0 0-28.5-11.8c-10.7 0-20.9 4.2-28.5 11.8-7.5 7.6-11.8 17.8-11.8 28.5s4.2 20.9 11.8 28.5l253.4 253.7-253.3 253.6c-7.3 7.6-11.4 17.8-11.3 28.4 0.1 10.6 4.3 20.7 11.8 28.2 7.5 7.5 17.6 11.7 28.1 11.8 10.6 0.1 20.7-4 28.3-11.3L558.9 543c7.5-7.5 11.8-17.8 11.8-28.5z"
|
80
|
+
p-id="3257"
|
81
|
+
></path>
|
82
|
+
</svg>
|
83
|
+
</div>
|
84
|
+
</div>
|
85
|
+
</div>
|
86
|
+
</div>
|
87
|
+
</template>
|
88
|
+
<script setup lang="ts">
|
89
|
+
import { computed, reactive, toRefs } from 'vue';
|
90
|
+
import { idate } from '@fekit/utils';
|
91
|
+
// 创建日期
|
92
|
+
const cDate = (date: any = null) => {
|
93
|
+
const _date = new Date(date);
|
94
|
+
return date && _date instanceof Date && !isNaN(_date.getTime()) ? _date : new Date();
|
95
|
+
};
|
96
|
+
// 个位补零
|
97
|
+
const numfill = (num: string | number = '') => {
|
98
|
+
return Number(num) < 10 ? `0${num}` : num;
|
99
|
+
};
|
100
|
+
// 外部入参
|
101
|
+
const props = defineProps({
|
102
|
+
frame: { type: Boolean, default: false },
|
103
|
+
theme: { type: String, default: '@a' },
|
104
|
+
sz: { type: String, default: 'm' },
|
105
|
+
co: { type: String, default: '' },
|
106
|
+
block: { type: Boolean, default: true },
|
107
|
+
// 提示文案
|
108
|
+
tips: {
|
109
|
+
type: String,
|
110
|
+
default: ''
|
111
|
+
},
|
112
|
+
// 提示文案
|
113
|
+
placeholder: {
|
114
|
+
type: String,
|
115
|
+
default: ''
|
116
|
+
},
|
117
|
+
// 格式
|
118
|
+
format: {
|
119
|
+
type: String,
|
120
|
+
default: ''
|
121
|
+
},
|
122
|
+
// 值
|
123
|
+
value: {
|
124
|
+
type: [String, Number],
|
125
|
+
default: ''
|
126
|
+
},
|
127
|
+
// 值
|
128
|
+
modelValue: { type: [String, Number], default: '' },
|
129
|
+
// 节假日
|
130
|
+
holiday: {
|
131
|
+
type: Object,
|
132
|
+
default: () => ({})
|
133
|
+
},
|
134
|
+
// 校验规则
|
135
|
+
rules: {
|
136
|
+
type: Array,
|
137
|
+
default: () => []
|
138
|
+
},
|
139
|
+
// 是否是示校验图标
|
140
|
+
verify: {
|
141
|
+
type: Boolean,
|
142
|
+
default: false
|
143
|
+
}
|
144
|
+
});
|
145
|
+
|
146
|
+
// 内部数据
|
147
|
+
const state: any = reactive({
|
148
|
+
view: 1,
|
149
|
+
show: 0,
|
150
|
+
pos: 'bl',
|
151
|
+
selected: '',
|
152
|
+
date: props.value,
|
153
|
+
curr: computed(() => {
|
154
|
+
const date = cDate(state.date);
|
155
|
+
const calendar = [];
|
156
|
+
// 年
|
157
|
+
const y: any = date.getFullYear();
|
158
|
+
// 月
|
159
|
+
const m: any = date.getMonth() + 1;
|
160
|
+
// 日
|
161
|
+
const d: any = date.getDate();
|
162
|
+
// 本月第一天星期几
|
163
|
+
const w = new Date(`${y}-${m}-1`).getDay();
|
164
|
+
// 当前月份一共几天
|
165
|
+
const days = new Date(y, m, 0).getDate();
|
166
|
+
|
167
|
+
// 当前
|
168
|
+
const curr = new Date();
|
169
|
+
const curr_y = curr.getFullYear();
|
170
|
+
const curr_m = curr.getMonth() + 1;
|
171
|
+
const curr_d = curr.getDate();
|
172
|
+
|
173
|
+
// 上月
|
174
|
+
const last = new Date(y, m - 1, 0);
|
175
|
+
const last_y = last.getFullYear();
|
176
|
+
const last_m = last.getMonth() + 1;
|
177
|
+
|
178
|
+
// 下月
|
179
|
+
const next = new Date(y, m + 1, 0);
|
180
|
+
const next_y = next.getFullYear();
|
181
|
+
const next_m = next.getMonth() + 1;
|
182
|
+
let prevdays = last.getDate();
|
183
|
+
|
184
|
+
for (let i = 0; i < w; i++) {
|
185
|
+
calendar.unshift({
|
186
|
+
date: `${last_y}-${numfill(last_m)}-${prevdays}`,
|
187
|
+
day: prevdays,
|
188
|
+
isLastMonth: 1
|
189
|
+
});
|
190
|
+
prevdays = prevdays - 1;
|
191
|
+
}
|
192
|
+
for (let i = 1; i <= days; i++) {
|
193
|
+
const _i = numfill(i);
|
194
|
+
calendar.push({
|
195
|
+
date: `${y}-${numfill(m)}-${_i}`,
|
196
|
+
day: _i,
|
197
|
+
isToday: curr_y === y && curr_m === m && curr_d === i,
|
198
|
+
isHoliday: props.holiday[`${y}-${numfill(m)}-${_i}`]?.name ? 1 : 0,
|
199
|
+
holiday: props.holiday[`${y}-${numfill(m)}-${_i}`]?.name
|
200
|
+
});
|
201
|
+
}
|
202
|
+
for (let i = 1; calendar.length < 42; i++) {
|
203
|
+
const _i = numfill(i);
|
204
|
+
calendar.push({
|
205
|
+
date: `${next_y}-${numfill(next_m)}-${_i}`,
|
206
|
+
day: _i,
|
207
|
+
isNextMonth: 1
|
208
|
+
});
|
209
|
+
}
|
210
|
+
return { days: calendar, y, m, d };
|
211
|
+
}),
|
212
|
+
value: computed(() => {
|
213
|
+
return props.format ? idate(state.selected || props.value).format(props.format) : state.selected || props.value;
|
214
|
+
})
|
215
|
+
});
|
216
|
+
const { curr = {} }: any = toRefs(state);
|
217
|
+
|
218
|
+
const upload = (a: any = 'm', b: any = 1) => {
|
219
|
+
const date = cDate(state.date);
|
220
|
+
if (a === 'm') {
|
221
|
+
date.setMonth(date.getMonth() + b);
|
222
|
+
} else {
|
223
|
+
date.setFullYear(date.getFullYear() + b);
|
224
|
+
}
|
225
|
+
return date.toISOString().substring(0, 10);
|
226
|
+
};
|
227
|
+
|
228
|
+
// 日期前翻
|
229
|
+
const prev = (type: any = 'm') => {
|
230
|
+
state.date = upload(type, -1);
|
231
|
+
};
|
232
|
+
// 日期后翻
|
233
|
+
const next = (type: any = 'm') => {
|
234
|
+
state.date = upload(type, 1);
|
235
|
+
};
|
236
|
+
|
237
|
+
// 向外通信
|
238
|
+
const emits = defineEmits(['change']);
|
239
|
+
const change = (item: any) => {
|
240
|
+
state.selected = item.date;
|
241
|
+
state.date = item.date;
|
242
|
+
emits('change', item.date);
|
243
|
+
};
|
244
|
+
</script>
|
@@ -0,0 +1,346 @@
|
|
1
|
+
<template>
|
2
|
+
<ul ui-flex="row lm :wrap" class="mb-ss-sub mr-ss-sub" v-bind="{ ...attrs }">
|
3
|
+
<li v-for="(file, idx) in state.files" :key="idx" ui-flex="col cm" class="flex-fixed bg-fore n-sl w-ms h-ms b-solid bk-line b-xs">
|
4
|
+
<img v-if="file.type === 'image'" :src="file.path" alt="" />
|
5
|
+
<template v-else-if="file.type === 'pdf'">
|
6
|
+
<svg t="1705645350800" class="w-ss h-ss" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1913">
|
7
|
+
<path
|
8
|
+
d="M205.5 64H665l232 232v639c0 13.807-11.193 25-25 25H205.5c-13.807 0-25-11.193-25-25V89c0-13.807 11.193-25 25-25z m449.145 25H205.5v846H872V306.355L654.645 89z"
|
9
|
+
fill="#B7B7BD"
|
10
|
+
p-id="1914"
|
11
|
+
></path>
|
12
|
+
<path d="M665 64l-11 23.5v197c0 13.807 11.193 25 25 25h194.5L897 296 665 64z m14 49.355L850.145 284.5H679V113.355z" fill="#B7B7BD" p-id="1915"></path>
|
13
|
+
<path d="M255 571m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="1916"></path>
|
14
|
+
<path d="M255 707m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="1917"></path>
|
15
|
+
<path d="M255 639m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="1918"></path>
|
16
|
+
<path d="M255 774m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="1919"></path>
|
17
|
+
<path d="M255 842m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="1920"></path>
|
18
|
+
<path d="M67 193m16 0l287 0q16 0 16 16l0 287q0 16-16 16l-287 0q-16 0-16-16l0-287q0-16 16-16Z" fill="#FF4867" p-id="1921"></path>
|
19
|
+
<path
|
20
|
+
d="M314.229 459.289c-21.407 0-40.606-36.765-50.708-60.673-16.991-7.098-35.722-13.728-53.918-18.014-15.92 10.514-43.014 26.251-63.818 26.251-12.911 0-22.21-6.496-25.622-17.813-2.609-9.309-0.4-15.738 2.409-19.22 5.485-7.5 16.79-11.317 33.715-11.317 13.714 0 31.107 2.41 50.507 7.098 12.51-8.907 25.22-19.22 36.525-30.135-5.017-23.84-10.503-62.48 3.412-80.294 6.89-8.505 17.393-11.318 30.103-7.5 13.914 4.017 19.199 12.522 20.804 19.22 5.887 23.237-20.804 54.578-38.8 72.994 4.015 15.938 9.3 32.747 15.721 48.15 25.822 11.518 56.527 28.728 60.006 47.48 1.405 6.495-0.602 12.522-5.887 17.813-4.549 3.75-9.365 5.96-14.45 5.96z m-31.647-52.419c12.785 26.402 24.975 38.862 31.4 38.862 0.995 0 2.386-0.404 4.373-2.02 2.385-2.425 2.385-4.041 1.988-5.523-1.325-6.937-12.124-18.32-37.761-31.319z m-126.377-35.247c-16.73 0-21.33 4.093-22.73 6.003-0.399 0.614-1.599 2.455-0.399 7.23 1 4.092 3.8 8.458 12.464 8.458 10.865 0 26.595-6.207 44.857-17.325-13.063-2.933-24.594-4.366-34.192-4.366z m67.632-1.765c10.845 2.983 22.09 6.827 32.535 10.803-3.792-9.809-6.853-20.015-9.448-29.824-7.651 6.561-15.436 12.99-23.087 19.021zM265.9 259.556c-3.827 0-6.513 1.409-8.93 4.024-7.118 8.917-7.924 31.38-2.418 60.144 20.884-22.26 32.232-42.711 29.411-53.64-0.402-1.61-1.611-6.504-11.348-9.32-2.686-0.805-4.7-1.208-6.715-1.208z"
|
21
|
+
fill="#FFFFFF"
|
22
|
+
p-id="1922"
|
23
|
+
></path>
|
24
|
+
</svg>
|
25
|
+
</template>
|
26
|
+
<template v-else-if="file.type === 'xlsx'">
|
27
|
+
<svg t="1705645380770" class="w-ss h-ss" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2060">
|
28
|
+
<path
|
29
|
+
d="M205.799024 64.936585H664.850732l231.773658 231.773659v638.376585c0 13.79353-11.18208 24.97561-24.97561 24.97561H205.799024c-13.79353 0-24.97561-11.18208-24.975609-24.97561V89.912195c0-13.79353 11.18208-24.97561 24.975609-24.97561z m448.70681 24.97561H205.799024v845.174634H871.64878V307.055141L654.505834 89.912195z"
|
30
|
+
fill="#B7B7BD"
|
31
|
+
p-id="2061"
|
32
|
+
></path>
|
33
|
+
<path
|
34
|
+
d="M664.850732 64.936585l-10.989269 23.477074v196.807804c0 13.79353 11.18208 24.97561 24.97561 24.97561h194.310244L896.62439 296.710244 664.850732 64.936585z m13.986341 49.306849L849.815102 285.221463H678.837073V114.243434z"
|
35
|
+
fill="#B7B7BD"
|
36
|
+
p-id="2062"
|
37
|
+
></path>
|
38
|
+
<path
|
39
|
+
d="M255.250732 571.441951m9.990244 0l555.457561 0q9.990244 0 9.990243 9.990244l0 0q0 9.990244-9.990243 9.990244l-555.457561 0q-9.990244 0-9.990244-9.990244l0 0q0-9.990244 9.990244-9.990244Z"
|
40
|
+
fill="#B7B7BD"
|
41
|
+
p-id="2063"
|
42
|
+
></path>
|
43
|
+
<path
|
44
|
+
d="M255.250732 707.309268m9.990244 0l555.457561 0q9.990244 0 9.990243 9.990244l0 0q0 9.990244-9.990243 9.990244l-555.457561 0q-9.990244 0-9.990244-9.990244l0 0q0-9.990244 9.990244-9.990244Z"
|
45
|
+
fill="#B7B7BD"
|
46
|
+
p-id="2064"
|
47
|
+
></path>
|
48
|
+
<path
|
49
|
+
d="M255.250732 639.37561m9.990244 0l555.457561 0q9.990244 0 9.990243 9.990244l0 0q0 9.990244-9.990243 9.990244l-555.457561 0q-9.990244 0-9.990244-9.990244l0 0q0-9.990244 9.990244-9.990244Z"
|
50
|
+
fill="#B7B7BD"
|
51
|
+
p-id="2065"
|
52
|
+
></path>
|
53
|
+
<path
|
54
|
+
d="M255.250732 774.243902m9.990244 0l555.457561 0q9.990244 0 9.990243 9.990244l0 0q0 9.990244-9.990243 9.990244l-555.457561 0q-9.990244 0-9.990244-9.990244l0 0q0-9.990244 9.990244-9.990244Z"
|
55
|
+
fill="#B7B7BD"
|
56
|
+
p-id="2066"
|
57
|
+
></path>
|
58
|
+
<path
|
59
|
+
d="M255.250732 842.177561m9.990244 0l555.457561 0q9.990244 0 9.990243 9.990244l0 0q0 9.990244-9.990243 9.990244l-555.457561 0q-9.990244 0-9.990244-9.990244l0 0q0-9.990244 9.990244-9.990244Z"
|
60
|
+
fill="#B7B7BD"
|
61
|
+
p-id="2067"
|
62
|
+
></path>
|
63
|
+
<path
|
64
|
+
d="M67.434146 193.810732m15.984391 0l286.72 0q15.98439 0 15.98439 15.98439l0 286.72q0 15.98439-15.98439 15.98439l-286.72 0q-15.98439 0-15.984391-15.98439l0-286.72q0-15.98439 15.984391-15.98439Z"
|
65
|
+
fill="#00C090"
|
66
|
+
p-id="2068"
|
67
|
+
></path>
|
68
|
+
<path
|
69
|
+
d="M242.569116 353.23904l89.224866 84.502478c4.337764 4.107988 4.523582 10.954302 0.415595 15.291067-4.107988 4.337764-10.954302 4.523582-15.291068 0.415595l-89.224866-84.502479-84.502478 89.224867c-4.107988 4.337764-10.954302 4.523582-15.291067 0.415594-4.337764-4.107988-4.523582-10.954302-0.415595-15.291067l84.502478-89.224867-89.224866-84.502478c-4.337764-4.107988-4.523582-10.954302-0.415594-15.291067 4.107988-4.337764 10.954302-4.523582 15.291067-0.415594l89.224867 84.502478 84.502478-89.224867c4.107988-4.337764 10.954302-4.523582 15.291067-0.415594 4.337764 4.107988 4.523582 10.954302 0.415594 15.291068l-84.502478 89.224866z"
|
70
|
+
fill="#FFFFFF"
|
71
|
+
p-id="2069"
|
72
|
+
></path>
|
73
|
+
</svg>
|
74
|
+
</template>
|
75
|
+
<template v-else-if="file.type === 'docx'">
|
76
|
+
<svg t="1705645401993" class="w-ss h-ss" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2207">
|
77
|
+
<path
|
78
|
+
d="M205.5 64H665l232 232v639c0 13.807-11.193 25-25 25H205.5c-13.807 0-25-11.193-25-25V89c0-13.807 11.193-25 25-25z m449.145 25H205.5v846H872V306.355L654.645 89z"
|
79
|
+
fill="#B7B7BD"
|
80
|
+
p-id="2208"
|
81
|
+
></path>
|
82
|
+
<path d="M665 64l-11 23.5v197c0 13.807 11.193 25 25 25h194.5L897 296 665 64z m14 49.355L850.145 284.5H679V113.355z" fill="#B7B7BD" p-id="2209"></path>
|
83
|
+
<path d="M67 193m16 0l287 0q16 0 16 16l0 287q0 16-16 16l-287 0q-16 0-16-16l0-287q0-16 16-16Z" fill="#4297FC" p-id="2210"></path>
|
84
|
+
<path d="M255 571m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="2211"></path>
|
85
|
+
<path d="M255 707m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="2212"></path>
|
86
|
+
<path d="M255 639m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="2213"></path>
|
87
|
+
<path d="M255 774m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="2214"></path>
|
88
|
+
<path d="M255 842m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="2215"></path>
|
89
|
+
<path
|
90
|
+
d="M315.269 451.314c7.015 7.61 19.731 2.651 19.731-7.693V271h-22.737v143.524l-76.9-83.418c-4.503-4.885-12.223-4.885-16.726 0l-76.9 83.418V271H119v172.62c0 10.345 12.716 15.303 19.731 7.694L227 355.564l88.269 95.75z"
|
91
|
+
fill="#FFFFFF"
|
92
|
+
p-id="2216"
|
93
|
+
></path>
|
94
|
+
</svg>
|
95
|
+
</template>
|
96
|
+
<template v-else-if="file.type === 'pptx'">
|
97
|
+
<svg t="1705645414803" class="w-ss h-ss" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2354">
|
98
|
+
<path
|
99
|
+
d="M205.5 64H665l232 232v639c0 13.807-11.193 25-25 25H205.5c-13.807 0-25-11.193-25-25V89c0-13.807 11.193-25 25-25z m449.145 25H205.5v846H872V306.355L654.645 89z"
|
100
|
+
fill="#B7B7BD"
|
101
|
+
p-id="2355"
|
102
|
+
></path>
|
103
|
+
<path d="M665 64l-11 23.5v197c0 13.807 11.193 25 25 25h194.5L897 296 665 64z m14 49.355L850.145 284.5H679V113.355z" fill="#B7B7BD" p-id="2356"></path>
|
104
|
+
<path d="M255 571m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="2357"></path>
|
105
|
+
<path d="M255 707m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="2358"></path>
|
106
|
+
<path d="M255 639m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="2359"></path>
|
107
|
+
<path d="M255 774m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="2360"></path>
|
108
|
+
<path d="M255 842m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="2361"></path>
|
109
|
+
<path d="M67 193m16 0l287 0q16 0 16 16l0 287q0 16-16 16l-287 0q-16 0-16-16l0-287q0-16 16-16Z" fill="#FF7A64" p-id="2362"></path>
|
110
|
+
<path
|
111
|
+
d="M314 312.055c0 16.701-8.014 25.218-26.96 27.787H129c-5.523 0-10 4.477-10 10V451.5c0 5.523 4.477 10 10 10s10-4.477 10-10v-91.658h148.694a10 10 0 0 0 1.264-0.08C317.98 356.065 334 339.393 334 312.055c0-26.83-15.298-44.972-43.677-52.703a10 10 0 0 0-2.629-0.352H129c-5.523 0-10 4.477-10 10s4.477 10 10 10h157.317C305.466 284.553 314 295.032 314 312.055z"
|
112
|
+
fill="#FFFFFF"
|
113
|
+
p-id="2363"
|
114
|
+
></path>
|
115
|
+
</svg>
|
116
|
+
</template>
|
117
|
+
<template v-else>
|
118
|
+
<svg t="1705645436666" class="w-ss h-ss" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2501">
|
119
|
+
<path
|
120
|
+
d="M205.5 64H665l232 232v639c0 13.807-11.193 25-25 25H205.5c-13.807 0-25-11.193-25-25V89c0-13.807 11.193-25 25-25z m449.145 25H205.5v846H872V306.355L654.645 89z"
|
121
|
+
fill="#B7B7BD"
|
122
|
+
p-id="2502"
|
123
|
+
></path>
|
124
|
+
<path d="M665 64l-11 23.5v197c0 13.807 11.193 25 25 25h194.5L897 296 665 64z m14 49.355L850.145 284.5H679V113.355z" fill="#B7B7BD" p-id="2503"></path>
|
125
|
+
<path d="M255 571m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="2504"></path>
|
126
|
+
<path d="M255 707m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="2505"></path>
|
127
|
+
<path d="M255 639m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="2506"></path>
|
128
|
+
<path d="M255 774m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="2507"></path>
|
129
|
+
<path d="M255 842m10 0l556 0q10 0 10 10l0 0q0 10-10 10l-556 0q-10 0-10-10l0 0q0-10 10-10Z" fill="#B7B7BD" p-id="2508"></path>
|
130
|
+
<path d="M67 193m16 0l287 0q16 0 16 16l0 287q0 16-16 16l-287 0q-16 0-16-16l0-287q0-16 16-16Z" fill="#CCCCCC" p-id="2509"></path>
|
131
|
+
<path
|
132
|
+
d="M226.274 240c14.845 0 29.79 4.862 41.18 13.738C280.444 263.86 288 278.458 288 295.57c0 22.53-15.93 43.423-46.252 63.48l-0.31 0.203V387c0 6.525-5.208 11.834-11.695 11.996l-0.305 0.004c-6.627 0-12-5.373-12-12v-34.314a12 12 0 0 1 5.673-10.196C250.988 325.189 264 309.227 264 295.57c0-9.498-3.99-17.207-11.298-22.902-7.059-5.5-16.796-8.668-26.428-8.668-9.598 0-19.202 3.147-26.147 8.625-7.064 5.571-10.985 13.116-11.123 22.435l-0.004 0.51c0 6.628-5.373 12-12 12s-12-5.372-12-12c0-33.201 28.361-55.57 61.274-55.57zM230 453c9.389 0 17-7.611 17-17s-7.611-17-17-17-17 7.611-17 17 7.611 17 17 17z"
|
133
|
+
fill="#FFFFFF"
|
134
|
+
p-id="2510"
|
135
|
+
></path>
|
136
|
+
</svg>
|
137
|
+
</template>
|
138
|
+
<p ui-omit="1" class="fs-ss ac">{{ file.name }}</p>
|
139
|
+
</li>
|
140
|
+
<li v-if="(!multiple && state.files && state.files.length === 0) || (multiple && (!limit || (limit && state.files && state.files.length < limit)))">
|
141
|
+
<slot>
|
142
|
+
<label ui-flex="row cm" ui-form="@a type:upload tips:hover" :class="`upload w-ms h-ms n-sl bg-fore b-solid bk-line b-xs ${uploadClass}`" :style="uploadStyle">
|
143
|
+
<div v-if="tips" ui-form-tips>
|
144
|
+
{{ tips }}
|
145
|
+
</div>
|
146
|
+
<input style="display: none" type="file" class="pa input" :multiple="multiple" @change="change" />
|
147
|
+
<div class="co-note ac input-icon">
|
148
|
+
<svg t="1705642180833" style="width: 1em; height: 1em" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4215">
|
149
|
+
<path
|
150
|
+
d="M906.212134 565.732986 565.732986 565.732986 565.732986 906.212134C565.732986 926.013685 541.666486 959.972 511.97312 959.972 482.297674 959.972 458.213254 926.013685 458.213254 906.212134L458.213254 565.732986 117.734106 565.732986C97.950475 565.732986 63.97424 541.666486 63.97424 511.97312 63.97424 482.279754 97.950475 458.213254 117.734106 458.213254L458.213254 458.213254 458.213254 117.734106C458.213254 97.950475 482.297674 63.97424 511.97312 63.97424 541.666486 63.97424 565.732986 97.950475 565.732986 117.734106L565.732986 458.213254 906.212134 458.213254C925.995765 458.213254 959.972 482.279754 959.972 511.97312 959.972 541.666486 925.995765 565.732986 906.212134 565.732986Z"
|
151
|
+
p-id="4216"
|
152
|
+
></path>
|
153
|
+
</svg>
|
154
|
+
</div>
|
155
|
+
</label>
|
156
|
+
</slot>
|
157
|
+
</li>
|
158
|
+
</ul>
|
159
|
+
<Layer :id="layerId" am="as"></Layer>
|
160
|
+
</template>
|
161
|
+
<script setup lang="ts">
|
162
|
+
import { reactive, ref, watch } from 'vue';
|
163
|
+
import { Image } from '../display';
|
164
|
+
import draggable from 'vuedraggable';
|
165
|
+
import Compressor from 'compressorjs';
|
166
|
+
import { Layer, LayerById } from '../basic';
|
167
|
+
import { isArray, isFunction } from '@fekit/utils';
|
168
|
+
|
169
|
+
const layerId = Math.random().toString(36).slice(-6);
|
170
|
+
|
171
|
+
interface Props {
|
172
|
+
modelValue?: string | any[];
|
173
|
+
// 文件限制数量
|
174
|
+
limit?: number;
|
175
|
+
attrs?: object;
|
176
|
+
uploadClass?: string;
|
177
|
+
uploadStyle?: string;
|
178
|
+
id?: string;
|
179
|
+
tips?: string; // 提示文案
|
180
|
+
// 文件类型
|
181
|
+
accept?: string;
|
182
|
+
// 是否可以上传多个文件
|
183
|
+
multiple?: boolean;
|
184
|
+
// 是否需要抠图处理
|
185
|
+
crop?: boolean;
|
186
|
+
// 上传路径
|
187
|
+
action?: string;
|
188
|
+
// 请求上传接口
|
189
|
+
upload?: (formData: FormData) => Promise<any>;
|
190
|
+
}
|
191
|
+
|
192
|
+
const props = withDefaults(defineProps<Props>(), {
|
193
|
+
uploadClass: '',
|
194
|
+
uploadStyle: '',
|
195
|
+
id: '',
|
196
|
+
attrs: () => ({}),
|
197
|
+
tips: '',
|
198
|
+
modelValue: '',
|
199
|
+
accept: 'image/*',
|
200
|
+
multiple: false,
|
201
|
+
crop: false,
|
202
|
+
action: '/common/updateFile',
|
203
|
+
upload: async () => null
|
204
|
+
});
|
205
|
+
|
206
|
+
const state: any = reactive({
|
207
|
+
files: []
|
208
|
+
});
|
209
|
+
|
210
|
+
const emit = defineEmits(['update:modelValue', 'change']);
|
211
|
+
|
212
|
+
// const files = ref<any>(isArray(props.modelValue) ? props.modelValue : props.modelValue ? [{ imgUrl: props.modelValue }] : []);
|
213
|
+
|
214
|
+
// 删除图片
|
215
|
+
// const delImg = (src: any) => {
|
216
|
+
// files.value = files.value.filter((item: any) => {
|
217
|
+
// return item.imgUrl !== src.imgUrl;
|
218
|
+
// });
|
219
|
+
// };
|
220
|
+
|
221
|
+
// const uploadClick = () => {
|
222
|
+
// LayerById(layerId).show();
|
223
|
+
// };
|
224
|
+
|
225
|
+
// const update = () => {
|
226
|
+
// emit('update:modelValue', isArray(props.modelValue) ? files.value : files.value.length > 0 ? files.value[0].imgUrl : '');
|
227
|
+
// };
|
228
|
+
|
229
|
+
const change = async (e: any = {}) => {
|
230
|
+
const files = e?.target?.files || [];
|
231
|
+
for (let i = 0; i < files.length; i++) {
|
232
|
+
const _file: any = files[i];
|
233
|
+
|
234
|
+
// 文件类型
|
235
|
+
let type = '';
|
236
|
+
if (_file.type === 'application/msword' || _file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') {
|
237
|
+
type = 'docx';
|
238
|
+
} else if (_file.type === 'application/vnd.ms-excel' || _file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') {
|
239
|
+
type = 'xlsx';
|
240
|
+
} else if (_file.type === 'application/vnd.openxmlformats-officedocument.presentationml.presentation') {
|
241
|
+
type = 'pptx';
|
242
|
+
} else if (_file.type === 'application/pdf') {
|
243
|
+
type = 'pdf';
|
244
|
+
} else if (_file.type === 'text/html') {
|
245
|
+
type = 'html';
|
246
|
+
} else if (_file.type.startsWith('image/') && _file.type !== 'image/vnd.adobe.photoshop') {
|
247
|
+
type = 'image';
|
248
|
+
}
|
249
|
+
const file: any = { name: _file.name, type, path: URL.createObjectURL(_file), url: await props.upload(_file) };
|
250
|
+
// 上传文件
|
251
|
+
state.files.push(file);
|
252
|
+
|
253
|
+
// if (isFunction(props.upload)) {
|
254
|
+
// const src: any = await props.upload(_file);
|
255
|
+
// if (src) {
|
256
|
+
// file.src = src;
|
257
|
+
// }
|
258
|
+
// }
|
259
|
+
}
|
260
|
+
|
261
|
+
// const _files = [];
|
262
|
+
// for (let i = 0; i < files.length; i++) {
|
263
|
+
// const file = files[i];
|
264
|
+
// const blob = URL.createObjectURL(file);
|
265
|
+
// _files.push({ blob, file });
|
266
|
+
// }
|
267
|
+
// console.log(98, _files);
|
268
|
+
// for (let i = 0; i < _files.length; i++) {
|
269
|
+
// let { file = '' } = _files[i];
|
270
|
+
// // 若为图片,则进行压缩处理
|
271
|
+
// if (/image/.test(file.type)) {
|
272
|
+
// const _blob: any = await new Promise((resolve, reject) => {
|
273
|
+
// new Compressor(file, {
|
274
|
+
// quality: 1,
|
275
|
+
// checkOrientation: false,
|
276
|
+
// success: resolve,
|
277
|
+
// maxWidth: 1000,
|
278
|
+
// maxHeight: 700,
|
279
|
+
// error: reject
|
280
|
+
// });
|
281
|
+
// });
|
282
|
+
// const { name = '' }: any = _blob || {};
|
283
|
+
// file = new File([_blob], name);
|
284
|
+
// }
|
285
|
+
// const formData = new FormData();
|
286
|
+
// formData.append('file', file);
|
287
|
+
// if (isFunction(props.upload)) {
|
288
|
+
// const url: any = await props.upload(formData);
|
289
|
+
// console.log(126, url);
|
290
|
+
// if (url) {
|
291
|
+
// files.value = [...files.value, { url }];
|
292
|
+
// }
|
293
|
+
// }
|
294
|
+
// }
|
295
|
+
};
|
296
|
+
|
297
|
+
// watch(
|
298
|
+
// () => [props.modelValue, state.files],
|
299
|
+
// (n: any, o: any) => {
|
300
|
+
// if (n[0] !== o[0]) {
|
301
|
+
// files.value = isArray(props.modelValue) ? props.modelValue : props.modelValue ? [{ imgUrl: props.modelValue }] : [];
|
302
|
+
// }
|
303
|
+
// if (n[1] !== o[1]) {
|
304
|
+
// emit('update:modelValue', isArray(props.modelValue) ? files.value : files.value.length > 0 ? files.value[0].imgUrl : '');
|
305
|
+
// }
|
306
|
+
// },
|
307
|
+
// { deep: true }
|
308
|
+
// );
|
309
|
+
|
310
|
+
// defineExpose({ change, uploadClick });
|
311
|
+
</script>
|
312
|
+
<style lang="scss">
|
313
|
+
.mc-upload {
|
314
|
+
flex-wrap: wrap;
|
315
|
+
|
316
|
+
.upload {
|
317
|
+
width: 8em;
|
318
|
+
height: 8em;
|
319
|
+
border-radius: 0.25em;
|
320
|
+
transition:
|
321
|
+
all 0.35s,
|
322
|
+
background-color 0s;
|
323
|
+
// background-color: #ffffff;
|
324
|
+
position: relative;
|
325
|
+
|
326
|
+
.input {
|
327
|
+
opacity: 0;
|
328
|
+
height: 100%;
|
329
|
+
width: 100%;
|
330
|
+
}
|
331
|
+
.input-icon {
|
332
|
+
line-height: 1.3;
|
333
|
+
}
|
334
|
+
}
|
335
|
+
|
336
|
+
&-img {
|
337
|
+
display: flex;
|
338
|
+
flex-direction: row;
|
339
|
+
|
340
|
+
&-item {
|
341
|
+
margin-right: 0.75rem;
|
342
|
+
margin-bottom: 0.75rem;
|
343
|
+
}
|
344
|
+
}
|
345
|
+
}
|
346
|
+
</style>
|
@@ -0,0 +1,82 @@
|
|
1
|
+
import Input from './Input@v3.vue';
|
2
|
+
import InputRange from './InputRange.vue';
|
3
|
+
import Switch from './Switch.vue';
|
4
|
+
import TextArea from './TextArea.vue';
|
5
|
+
|
6
|
+
import Select from './Select@v3.vue';
|
7
|
+
import SelectList from './SelectList.vue';
|
8
|
+
import SelectTags from './SelectTags.vue';
|
9
|
+
import SelectPicker from './SelectPicker.vue';
|
10
|
+
import SearchSelect from './SearchSelect@v3.vue';
|
11
|
+
import MoreSelect from './MoreSelect@v3.vue';
|
12
|
+
import MoreSelectList from './MoreSelectList.vue';
|
13
|
+
import MoreSelectTags from './MoreSelectTags.vue';
|
14
|
+
import MoreSelectPicker from './MoreSelectPicker.vue';
|
15
|
+
import SearchMoreSelect from './SearchMoreSelect.vue';
|
16
|
+
import PageSelect from './PageSelect.vue';
|
17
|
+
import SelectTree from './SelectTree/SelectTree@v1.vue';
|
18
|
+
|
19
|
+
// import DateView from './DateView.vue';
|
20
|
+
import DateView from './DateView@v2.vue';
|
21
|
+
// import DateView from './DateView@v3.vue';
|
22
|
+
import DateRangeView from './DateRangeView@v3.vue';
|
23
|
+
import DatePicker from './DatePicker.vue';
|
24
|
+
import TimePicker from './TimePicker.vue';
|
25
|
+
import DateRangePicker from './DateRangePicker@v3.vue';
|
26
|
+
import ImgUpload from './ImgUpload.vue';
|
27
|
+
import Upload from './Upload.vue';
|
28
|
+
import Cascader from './Cascader.vue';
|
29
|
+
|
30
|
+
export {
|
31
|
+
Input,
|
32
|
+
InputRange,
|
33
|
+
Switch,
|
34
|
+
TextArea,
|
35
|
+
Select,
|
36
|
+
SelectList,
|
37
|
+
SelectTags,
|
38
|
+
SelectPicker,
|
39
|
+
SearchSelect,
|
40
|
+
PageSelect,
|
41
|
+
SelectTree,
|
42
|
+
MoreSelect,
|
43
|
+
MoreSelectList,
|
44
|
+
MoreSelectTags,
|
45
|
+
MoreSelectPicker,
|
46
|
+
SearchMoreSelect,
|
47
|
+
// 日期&时间
|
48
|
+
DateView,
|
49
|
+
DateRangeView,
|
50
|
+
DatePicker,
|
51
|
+
TimePicker,
|
52
|
+
DateRangePicker,
|
53
|
+
ImgUpload,
|
54
|
+
Upload,
|
55
|
+
Cascader
|
56
|
+
};
|
57
|
+
|
58
|
+
// 单选
|
59
|
+
// Select 下拉选择 (默认)
|
60
|
+
// SelectDrape 下拉选择 等同 Select
|
61
|
+
// SelectPanel 面板选择
|
62
|
+
// SelectLayer 弹层选择
|
63
|
+
// SelectCards 卡片选择
|
64
|
+
// SelectWheel 滚轮选择
|
65
|
+
// SelectTags 标签选择
|
66
|
+
|
67
|
+
// 多选
|
68
|
+
// MultiSelectDrape 下拉选择 (默认)
|
69
|
+
// MultiSelectPanel 面板选择
|
70
|
+
// MultiSelectLayer 弹层选择
|
71
|
+
// MultiSelectCards 卡片选择
|
72
|
+
// MultiSelectWheel 滚轮选择
|
73
|
+
// MultiSelectTags 标签选择
|
74
|
+
|
75
|
+
// 日期
|
76
|
+
// Date 日期选择核心
|
77
|
+
// DateDrape 日期下拉选择
|
78
|
+
// DatePanel 日期面板选择
|
79
|
+
// DateLayer 日期弹层选择
|
80
|
+
// DateWheel 日期滚轮选择
|
81
|
+
|
82
|
+
// MultiDateView 多选日期
|