@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
@@ -3,7 +3,7 @@
|
|
3
3
|
<div class="mt-mm" ui-note="@b risk">抠图和压缩处理需要较长时间,期间请耐心等待不要关闭本窗口或进行操作,本功能需要付费,请尽量珍惜每一次处理避免不必要的浪费~</div>
|
4
4
|
<div v-if="state.img" class="photo-editor-viewer bg-weak my-mm" ui-flex="row">
|
5
5
|
<div class="mr-mm" style="flex: 1">
|
6
|
-
<vue-cropper ref="cropperRef" :img="state.img" :
|
6
|
+
<vue-cropper ref="cropperRef" :img="state.img" :auto-crop="state.autoCrop" @real-time="realTime" />
|
7
7
|
</div>
|
8
8
|
<div style="flex: 1" class="photo-editor-transparent">
|
9
9
|
<img :src="state.previews || ''" />
|
@@ -32,14 +32,14 @@
|
|
32
32
|
import { VueCropper } from 'vue-cropper/next';
|
33
33
|
import Compressor from 'compressorjs';
|
34
34
|
import { LayerById } from '../basic';
|
35
|
-
import axios from 'axios';
|
35
|
+
// import axios from 'axios';
|
36
36
|
import 'vue-cropper/next/dist/index.css';
|
37
37
|
|
38
38
|
const props: any = defineProps({
|
39
39
|
layerId: {
|
40
40
|
type: String,
|
41
|
-
default: 'PhotoEditor'
|
42
|
-
}
|
41
|
+
default: 'PhotoEditor',
|
42
|
+
},
|
43
43
|
});
|
44
44
|
|
45
45
|
const state = reactive({
|
@@ -47,7 +47,7 @@
|
|
47
47
|
// outputType: 'jepg', // 裁剪生成图片格式
|
48
48
|
autoCrop: true,
|
49
49
|
previews: null, //base格式
|
50
|
-
cropLoad: 0
|
50
|
+
cropLoad: 0,
|
51
51
|
});
|
52
52
|
|
53
53
|
const emit = defineEmits(['fileChange']);
|
@@ -63,7 +63,7 @@
|
|
63
63
|
success: resolve,
|
64
64
|
maxWidth: 1000,
|
65
65
|
maxHeight: 700,
|
66
|
-
error: reject
|
66
|
+
error: reject,
|
67
67
|
});
|
68
68
|
});
|
69
69
|
const _file = blobToFile(blob);
|
@@ -91,36 +91,36 @@
|
|
91
91
|
if (!state.cropLoad) {
|
92
92
|
state.cropLoad = 1;
|
93
93
|
|
94
|
-
const formData = {
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
};
|
112
|
-
const res: any = await axios.post(
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
);
|
117
|
-
if (res.status === 200) {
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
}
|
94
|
+
// const formData = {
|
95
|
+
// image_file_b64: state.previews,
|
96
|
+
// image_url: '',
|
97
|
+
// size: 'preview',
|
98
|
+
// type: 'auto',
|
99
|
+
// type_level: '1',
|
100
|
+
// format: 'auto',
|
101
|
+
// roi: '0% 0% 100% 100%',
|
102
|
+
// crop: false,
|
103
|
+
// crop_margin: '0',
|
104
|
+
// scale: 'original',
|
105
|
+
// position: 'original',
|
106
|
+
// channels: 'rgba',
|
107
|
+
// add_shadow: false,
|
108
|
+
// semitransparency: true,
|
109
|
+
// bg_color: '',
|
110
|
+
// bg_image_url: '',
|
111
|
+
// };
|
112
|
+
// const res: any = await axios.post(
|
113
|
+
// 'https://api.remove.bg/v1.0/removebg',
|
114
|
+
// { ...formData },
|
115
|
+
// { responseType: 'arraybuffer', headers: { 'X-Api-Key': 'kg4jrcKZd6Gjdx5CmBYmksuN' } },
|
116
|
+
// );
|
117
|
+
// if (res.status === 200) {
|
118
|
+
// const blob = new Blob([res.data], { type: 'image/png' });
|
119
|
+
// blobToDataURI(blob, (data: any) => {
|
120
|
+
// state.previews = data;
|
121
|
+
// state.cropLoad = 0;
|
122
|
+
// });
|
123
|
+
// }
|
124
124
|
}
|
125
125
|
};
|
126
126
|
|
@@ -5,14 +5,14 @@
|
|
5
5
|
:initialSlide="initialSlide"
|
6
6
|
:spaceBetween="30"
|
7
7
|
:keyboard="{
|
8
|
-
enabled: true
|
8
|
+
enabled: true,
|
9
9
|
}"
|
10
10
|
:pagination="{
|
11
|
-
clickable: true
|
11
|
+
clickable: true,
|
12
12
|
}"
|
13
13
|
:navigation="true"
|
14
14
|
:modules="[Keyboard, Pagination, Navigation]"
|
15
|
-
class="
|
15
|
+
class="full"
|
16
16
|
>
|
17
17
|
<SwiperSlide v-for="item in files" :key="item.id" class="ac" ui-flex="col cm">
|
18
18
|
<img :src="item[srcName]" class="vc" />
|
@@ -32,19 +32,19 @@
|
|
32
32
|
const props: any = defineProps({
|
33
33
|
srcName: {
|
34
34
|
type: String,
|
35
|
-
default: '
|
35
|
+
default: 'url',
|
36
36
|
},
|
37
37
|
id: {
|
38
38
|
type: String,
|
39
|
-
default: 'PhotoViewer'
|
39
|
+
default: 'PhotoViewer',
|
40
40
|
},
|
41
41
|
initialSlide: {
|
42
42
|
type: Number,
|
43
|
-
default: 0
|
43
|
+
default: 0,
|
44
44
|
},
|
45
45
|
files: {
|
46
46
|
type: Array as () => any[],
|
47
|
-
default: () => []
|
48
|
-
}
|
47
|
+
default: () => [],
|
48
|
+
},
|
49
49
|
});
|
50
50
|
</script>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<template>
|
2
2
|
<ul :class="`${root ? '' : 'nl-ms'}`">
|
3
3
|
<li v-if="root" class="pr">
|
4
|
-
<div ui-form="@a sz: co:risk type:none :block" class="full
|
4
|
+
<div ui-form="@a sz: co:risk type:none :block" class="w-full">
|
5
5
|
<div style="left: 0.75em" :ui-form-tips="state.error.ontips">{{ state.error.tips }}</div>
|
6
6
|
</div>
|
7
7
|
</li>
|
@@ -156,7 +156,7 @@
|
|
156
156
|
line: false,
|
157
157
|
interacted: false,
|
158
158
|
rules: () => [],
|
159
|
-
block: false
|
159
|
+
block: false,
|
160
160
|
});
|
161
161
|
|
162
162
|
/*
|
@@ -227,7 +227,7 @@
|
|
227
227
|
error: {},
|
228
228
|
// 用户是否交互
|
229
229
|
interacted: false,
|
230
|
-
tree: [] as Array<Record<string, any
|
230
|
+
tree: [] as Array<Record<string, any>>,
|
231
231
|
});
|
232
232
|
|
233
233
|
watch(
|
@@ -247,7 +247,7 @@
|
|
247
247
|
return n;
|
248
248
|
});
|
249
249
|
},
|
250
|
-
{ deep: true, immediate: true }
|
250
|
+
{ deep: true, immediate: true },
|
251
251
|
);
|
252
252
|
|
253
253
|
// 获取节点勾选状态
|
@@ -300,7 +300,7 @@
|
|
300
300
|
change(state.selected);
|
301
301
|
}
|
302
302
|
},
|
303
|
-
{ deep: true, immediate: true }
|
303
|
+
{ deep: true, immediate: true },
|
304
304
|
);
|
305
305
|
|
306
306
|
// 校验
|
@@ -359,7 +359,7 @@
|
|
359
359
|
state.error = { tips: props.tips, ontips: props.tips ? 'show' : '', verify: '', co: '' };
|
360
360
|
}
|
361
361
|
},
|
362
|
-
{ deep: true, immediate: true }
|
362
|
+
{ deep: true, immediate: true },
|
363
363
|
);
|
364
364
|
</script>
|
365
365
|
<style lang="scss" scoped>
|
@@ -92,11 +92,11 @@
|
|
92
92
|
suffix: () => [],
|
93
93
|
active: () => ({ class: 'co-main' }),
|
94
94
|
optional: 'all',
|
95
|
-
multiple: false
|
95
|
+
multiple: false,
|
96
96
|
});
|
97
97
|
|
98
98
|
const state: any = reactive({
|
99
|
-
value: ''
|
99
|
+
value: '',
|
100
100
|
});
|
101
101
|
watch(
|
102
102
|
() => props.modelValue,
|
@@ -105,7 +105,7 @@
|
|
105
105
|
state.value = value;
|
106
106
|
}
|
107
107
|
},
|
108
|
-
{ deep: true, immediate: true }
|
108
|
+
{ deep: true, immediate: true },
|
109
109
|
);
|
110
110
|
watch(
|
111
111
|
() => state.value,
|
@@ -114,7 +114,7 @@
|
|
114
114
|
emits('update:modelValue', value);
|
115
115
|
}
|
116
116
|
},
|
117
|
-
{ deep: true, immediate: true }
|
117
|
+
{ deep: true, immediate: true },
|
118
118
|
);
|
119
119
|
|
120
120
|
// 事件处理
|
@@ -3,6 +3,6 @@ import Tree from './Tree.vue';
|
|
3
3
|
import Calendar from './Calendar.vue';
|
4
4
|
import PhotoEditor from './PhotoEditor.vue';
|
5
5
|
import TreeView from './TreeView.vue';
|
6
|
-
import ChartView from './ChartView.vue';
|
6
|
+
// import ChartView from './ChartView.vue';
|
7
7
|
|
8
|
-
export { Image, Tree, Calendar, PhotoEditor, TreeView
|
8
|
+
export { Image, Tree, Calendar, PhotoEditor, TreeView };
|
@@ -101,49 +101,49 @@
|
|
101
101
|
// 提示文案
|
102
102
|
tips: {
|
103
103
|
type: String,
|
104
|
-
default: ''
|
104
|
+
default: '',
|
105
105
|
},
|
106
106
|
placeholder: {
|
107
107
|
type: String,
|
108
|
-
default: ''
|
108
|
+
default: '',
|
109
109
|
},
|
110
110
|
options: {
|
111
111
|
type: Array as () => any[],
|
112
|
-
default: () => []
|
112
|
+
default: () => [],
|
113
113
|
},
|
114
114
|
ui: {
|
115
115
|
type: Object,
|
116
|
-
default: () => ({ sz: 'm' })
|
116
|
+
default: () => ({ sz: 'm' }),
|
117
117
|
},
|
118
118
|
modelValue: {
|
119
119
|
type: [String, Number, Array as () => any[]],
|
120
|
-
default: ''
|
120
|
+
default: '',
|
121
121
|
},
|
122
122
|
tools: {
|
123
123
|
type: Boolean,
|
124
|
-
default: true
|
124
|
+
default: true,
|
125
125
|
},
|
126
126
|
spare: {
|
127
127
|
type: String,
|
128
|
-
default: '当前没有可选项'
|
128
|
+
default: '当前没有可选项',
|
129
129
|
},
|
130
130
|
multiple: {
|
131
131
|
type: Boolean,
|
132
|
-
default: false
|
132
|
+
default: false,
|
133
133
|
},
|
134
134
|
// 单选时生效,当为true时选中任何一级节点都生效
|
135
135
|
changeOnSelect: {
|
136
136
|
type: Boolean,
|
137
|
-
default: false
|
137
|
+
default: false,
|
138
138
|
},
|
139
139
|
readonly: {
|
140
140
|
type: Boolean,
|
141
|
-
default: false
|
141
|
+
default: false,
|
142
142
|
},
|
143
143
|
disabled: {
|
144
144
|
type: Boolean,
|
145
|
-
default: false
|
146
|
-
}
|
145
|
+
default: false,
|
146
|
+
},
|
147
147
|
});
|
148
148
|
|
149
149
|
const emit = defineEmits(['update:modelValue']);
|
@@ -156,7 +156,7 @@
|
|
156
156
|
flatOpts: [], // 拉平的数据
|
157
157
|
selectd: { label: '', value: '' },
|
158
158
|
transSelected: { label: '', value: [] }, // 单选选中节点 - 单选过渡节点(记录选中的级联节点)
|
159
|
-
checkAll: false //全选
|
159
|
+
checkAll: false, //全选
|
160
160
|
});
|
161
161
|
|
162
162
|
// modelValue与input组件的v-model绑定属性重复,会造成覆盖问题。需要删掉
|
@@ -372,7 +372,7 @@
|
|
372
372
|
} else {
|
373
373
|
state.selectd = {
|
374
374
|
label: '',
|
375
|
-
value: props.multiple ? [] : ''
|
375
|
+
value: props.multiple ? [] : '',
|
376
376
|
};
|
377
377
|
handleCheck(true);
|
378
378
|
}
|
@@ -382,7 +382,7 @@
|
|
382
382
|
const remove = () => {
|
383
383
|
state.selectd = {
|
384
384
|
label: '',
|
385
|
-
value: props.multiple ? [] : ''
|
385
|
+
value: props.multiple ? [] : '',
|
386
386
|
};
|
387
387
|
if (props.multiple) {
|
388
388
|
handleCheck(true);
|
@@ -390,7 +390,7 @@
|
|
390
390
|
} else {
|
391
391
|
state.transSelected = {
|
392
392
|
label: '',
|
393
|
-
value: []
|
393
|
+
value: [],
|
394
394
|
};
|
395
395
|
}
|
396
396
|
ifollow.value.cancel();
|
@@ -405,7 +405,7 @@
|
|
405
405
|
() => {
|
406
406
|
init();
|
407
407
|
},
|
408
|
-
{ deep: true }
|
408
|
+
{ deep: true },
|
409
409
|
);
|
410
410
|
|
411
411
|
watch(
|
@@ -423,13 +423,13 @@
|
|
423
423
|
emit('update:modelValue', state.selectd.value);
|
424
424
|
}
|
425
425
|
},
|
426
|
-
{ deep: true }
|
426
|
+
{ deep: true },
|
427
427
|
);
|
428
428
|
|
429
429
|
defineExpose({
|
430
430
|
select,
|
431
431
|
remove,
|
432
|
-
cancel
|
432
|
+
cancel,
|
433
433
|
});
|
434
434
|
</script>
|
435
435
|
. .
|
@@ -0,0 +1,64 @@
|
|
1
|
+
<template>
|
2
|
+
<form class="m-sm-sub">
|
3
|
+
<label v-for="(item, idx) in state.lists" :key="idx" :ui-form="`${theme} type:checkbox${item.disabled ? ' disabled' : ''}`">
|
4
|
+
<input v-model="item.__checked" type="checkbox" :disabled="item.disabled" />
|
5
|
+
<slot>
|
6
|
+
<span>{{ item.label }}</span>
|
7
|
+
</slot>
|
8
|
+
</label>
|
9
|
+
</form>
|
10
|
+
</template>
|
11
|
+
<script setup lang="ts">
|
12
|
+
import { reactive, watch } from 'vue';
|
13
|
+
|
14
|
+
// 定义类型
|
15
|
+
interface OptionsTypes {
|
16
|
+
label: string;
|
17
|
+
value: any;
|
18
|
+
disabled?: boolean;
|
19
|
+
}
|
20
|
+
interface Props {
|
21
|
+
modelValue: any[];
|
22
|
+
options: OptionsTypes[];
|
23
|
+
theme?: string;
|
24
|
+
}
|
25
|
+
// 外部入参
|
26
|
+
const props = withDefaults(defineProps<Props>(), {
|
27
|
+
theme: '@a',
|
28
|
+
modelValue: () => [],
|
29
|
+
options: () => [],
|
30
|
+
});
|
31
|
+
|
32
|
+
// 定义事件
|
33
|
+
const emits = defineEmits(['update:modelValue']);
|
34
|
+
|
35
|
+
// 内部数据
|
36
|
+
const state: any = reactive({
|
37
|
+
lists: [],
|
38
|
+
});
|
39
|
+
|
40
|
+
// 监听数据
|
41
|
+
watch(
|
42
|
+
[() => props.options, () => props.modelValue],
|
43
|
+
([options, value]) => {
|
44
|
+
const lists = options?.map((item) => ({ ...item, __checked: value?.includes(item.value) }));
|
45
|
+
// 只有在内容变化时才更新
|
46
|
+
if (JSON.stringify(state.lists) !== JSON.stringify(lists)) {
|
47
|
+
state.lists = lists;
|
48
|
+
}
|
49
|
+
},
|
50
|
+
{
|
51
|
+
immediate: true,
|
52
|
+
},
|
53
|
+
);
|
54
|
+
watch(
|
55
|
+
() => state.lists,
|
56
|
+
(val) => {
|
57
|
+
const value = val.filter((item: any) => item.__checked).map((item: any) => item.value);
|
58
|
+
emits('update:modelValue', value);
|
59
|
+
},
|
60
|
+
{
|
61
|
+
deep: true,
|
62
|
+
},
|
63
|
+
);
|
64
|
+
</script>
|
@@ -91,30 +91,29 @@
|
|
91
91
|
prefix: () => [],
|
92
92
|
suffix: () => [],
|
93
93
|
interacted: false,
|
94
|
-
time: false
|
94
|
+
time: false,
|
95
95
|
});
|
96
96
|
|
97
97
|
const state: any = reactive({
|
98
|
-
// view: 1,
|
99
98
|
show: 0,
|
100
|
-
value:
|
99
|
+
value: null,
|
101
100
|
});
|
102
101
|
|
103
102
|
watch(
|
104
103
|
() => props.modelValue,
|
105
104
|
(value: any) => {
|
106
|
-
state.value = value;
|
105
|
+
state.value = value || null;
|
107
106
|
},
|
108
|
-
{ deep: true, immediate: true }
|
107
|
+
{ deep: true, immediate: true },
|
109
108
|
);
|
110
109
|
|
111
110
|
watch(
|
112
111
|
() => state.value,
|
113
112
|
(value: any) => {
|
114
|
-
emits('update:modelValue', value);
|
113
|
+
emits('update:modelValue', value || null);
|
115
114
|
ifollow.value?.hide();
|
116
115
|
},
|
117
|
-
{ deep: true, immediate: true }
|
116
|
+
{ deep: true, immediate: true },
|
118
117
|
);
|
119
118
|
|
120
119
|
const toggle = () => {
|
@@ -82,12 +82,12 @@
|
|
82
82
|
verify: false,
|
83
83
|
prefix: () => [],
|
84
84
|
suffix: () => [],
|
85
|
-
interacted: false
|
85
|
+
interacted: false,
|
86
86
|
});
|
87
87
|
|
88
88
|
const state: any = reactive({
|
89
89
|
show: 0,
|
90
|
-
value: []
|
90
|
+
value: [],
|
91
91
|
});
|
92
92
|
|
93
93
|
watch(
|
@@ -95,7 +95,7 @@
|
|
95
95
|
(value: any) => {
|
96
96
|
state.value = value;
|
97
97
|
},
|
98
|
-
{ deep: true, immediate: true }
|
98
|
+
{ deep: true, immediate: true },
|
99
99
|
);
|
100
100
|
|
101
101
|
watch(
|
@@ -106,7 +106,7 @@
|
|
106
106
|
ifollow.value?.hide();
|
107
107
|
}
|
108
108
|
},
|
109
|
-
{ deep: true, immediate: true }
|
109
|
+
{ deep: true, immediate: true },
|
110
110
|
);
|
111
111
|
|
112
112
|
const toggle = () => {
|
@@ -52,7 +52,7 @@
|
|
52
52
|
v-if="item.day"
|
53
53
|
:ui-date-day="item.day"
|
54
54
|
class="flex-block"
|
55
|
-
:class="`${item.range ? 'bg-main-xs' : ''} ${item.sta ? 'r-lt-sl r-lb-sl' : ''} ${item.end ? 'r-rt-sl r-rb-sl' : ''}`"
|
55
|
+
:class="`${item.range ? 'bg-main-o-xs' : ''} ${item.sta ? 'r-lt-sl r-lb-sl' : ''} ${item.end ? 'r-rt-sl r-rb-sl' : ''}`"
|
56
56
|
ui-flex="col cm"
|
57
57
|
@click="change(1, item)"
|
58
58
|
>
|
@@ -61,13 +61,13 @@
|
|
61
61
|
class="r-sm b-solid bk-none b-xs my-ss ux-scale"
|
62
62
|
style="width: 1.8em; height: 1.8em"
|
63
63
|
:class="`${item.isLastMonth || item.isNextMonth ? 'co-case' : item.holiday ? 'co-risk' : ''} ${
|
64
|
-
item.selected ? 'active bg-main-lm co-fore' : 'hover-bg-weak'
|
64
|
+
item.selected ? 'active bg-main-o-lm co-fore' : 'hover-bg-weak'
|
65
65
|
}`"
|
66
66
|
>
|
67
67
|
<span>{{ item.day }}</span>
|
68
68
|
</div>
|
69
69
|
</div>
|
70
|
-
<div class="pa full
|
70
|
+
<div class="pa w-full lh-xs ny-ss ob-no ol-no nowrap s-ml bold" style="transform-origin: 50% 110%" ui-flex="row ct" v-html="extras(item)"></div>
|
71
71
|
</div>
|
72
72
|
</li>
|
73
73
|
</ul>
|
@@ -126,7 +126,7 @@
|
|
126
126
|
v-if="item.day"
|
127
127
|
:ui-date-day="item.day"
|
128
128
|
class="flex-block"
|
129
|
-
:class="`${item.range ? 'bg-main-xs' : ''} ${item.sta ? 'r-lt-sl r-lb-sl' : ''} ${item.end ? 'r-rt-sl r-rb-sl' : ''}`"
|
129
|
+
:class="`${item.range ? 'bg-main-o-xs' : ''} ${item.sta ? 'r-lt-sl r-lb-sl' : ''} ${item.end ? 'r-rt-sl r-rb-sl' : ''}`"
|
130
130
|
ui-flex="col cm"
|
131
131
|
@click="change(2, item)"
|
132
132
|
>
|
@@ -135,13 +135,13 @@
|
|
135
135
|
class="r-sm b-solid bk-none b-xs my-ss ux-scale"
|
136
136
|
style="width: 1.8em; height: 1.8em"
|
137
137
|
:class="`${item.isLastMonth || item.isNextMonth ? 'co-case' : item.holiday ? 'co-risk' : ''} ${
|
138
|
-
item.selected ? 'active bg-main-lm co-fore' : 'hover-bg-weak'
|
138
|
+
item.selected ? 'active bg-main-o-lm co-fore' : 'hover-bg-weak'
|
139
139
|
}`"
|
140
140
|
>
|
141
141
|
<span>{{ item.day }}</span>
|
142
142
|
</div>
|
143
143
|
</div>
|
144
|
-
<div class="pa full
|
144
|
+
<div class="pa w-full lh-xs ny-ss ob-no ol-no nowrap s-ml bold" style="transform-origin: 50% 110%" ui-flex="row ct" v-html="extras(item)"></div>
|
145
145
|
</div>
|
146
146
|
</li>
|
147
147
|
</ul>
|
@@ -149,7 +149,7 @@
|
|
149
149
|
</div>
|
150
150
|
</div>
|
151
151
|
</div>
|
152
|
-
<div v-if="tools" ui-date-foot="" ui-flex="row xm" class="nx-sl ny-sl b-solid bk-line-ls bt-xs">
|
152
|
+
<div v-if="tools" ui-date-foot="" ui-flex="row xm" class="nx-sl ny-sl b-solid bk-line-o-ls bt-xs">
|
153
153
|
<div ui-flex="row lm" class="nl-ss">
|
154
154
|
<p v-if="sta.value || end.value">
|
155
155
|
<span class="nowrap">已选:</span>
|
@@ -158,8 +158,8 @@
|
|
158
158
|
<div v-else-if="com.shortcuts?.length" ui-flex="row lm">
|
159
159
|
<span class="nowrap">推荐:</span>
|
160
160
|
<div class="mr-sm-sub nx-sl-sub ny-ss-sub lh-ss nowrap fs-ss dib-sub" ui-scroll=":x y:hidden">
|
161
|
-
<p v-for="(item, idx) in com.shortcuts" :key="idx" class="bg-main-xs co-main r-xl" ui-btn="@a xs none :round" @click="item?.func">{{ item?.text }}</p>
|
162
|
-
<p class="bg-main-xs co-main r-xl" ui-btn="@a xs none :round"><Icon class="co-main" name="more" /></p>
|
161
|
+
<p v-for="(item, idx) in com.shortcuts" :key="idx" class="bg-main-o-xs co-main r-xl" ui-btn="@a xs none :round" @click="item?.func">{{ item?.text }}</p>
|
162
|
+
<p class="bg-main-o-xs co-main r-xl" ui-btn="@a xs none :round"><Icon class="co-main" name="more" /></p>
|
163
163
|
</div>
|
164
164
|
</div>
|
165
165
|
<div v-else> </div>
|
@@ -186,20 +186,20 @@
|
|
186
186
|
text: '昨天',
|
187
187
|
func() {
|
188
188
|
change(0, { date: idate(new Date().setDate(new Date().getDate() - 1)).format('YYYY-MM-DD') });
|
189
|
-
}
|
189
|
+
},
|
190
190
|
},
|
191
191
|
today: {
|
192
192
|
text: '今天',
|
193
193
|
func() {
|
194
194
|
change(0, { date: idate(new Date()).format('YYYY-MM-DD') });
|
195
|
-
}
|
195
|
+
},
|
196
196
|
},
|
197
197
|
tomorrow: {
|
198
198
|
text: '明天',
|
199
199
|
func() {
|
200
200
|
change(0, { date: idate(new Date().setDate(new Date().getDate() + 1)).format('YYYY-MM-DD') });
|
201
|
-
}
|
202
|
-
}
|
201
|
+
},
|
202
|
+
},
|
203
203
|
};
|
204
204
|
|
205
205
|
const emits: any = defineEmits(['update:modelValue', 'change']);
|
@@ -243,7 +243,7 @@
|
|
243
243
|
// 数据格式化
|
244
244
|
format: 'YYYY-MM-DD',
|
245
245
|
// 节假日
|
246
|
-
holiday: () => ({})
|
246
|
+
holiday: () => ({}),
|
247
247
|
});
|
248
248
|
|
249
249
|
// 公共数据
|
@@ -253,7 +253,7 @@
|
|
253
253
|
return props.shortcuts.map((item: any) => {
|
254
254
|
return isString(item) ? shortcutsList[item] : item;
|
255
255
|
});
|
256
|
-
})
|
256
|
+
}),
|
257
257
|
});
|
258
258
|
|
259
259
|
// 开始数据
|
@@ -268,7 +268,7 @@
|
|
268
268
|
const days = date.calendar({ group: true, value: [sta.value, end.value] });
|
269
269
|
const { y = 0, M: m = 0, d = 0 } = date.attr || {};
|
270
270
|
return { days, y, m, d };
|
271
|
-
})
|
271
|
+
}),
|
272
272
|
});
|
273
273
|
|
274
274
|
// 结束数据
|
@@ -281,11 +281,10 @@
|
|
281
281
|
const days = date.calendar({ group: true, value: [sta.value, end.value] });
|
282
282
|
const { y = 0, M: m = 0, d = 0 } = date.attr || {};
|
283
283
|
return { days, y, m, d };
|
284
|
-
})
|
284
|
+
}),
|
285
285
|
});
|
286
286
|
|
287
287
|
const init = ([a = '', b = '']: any = []) => {
|
288
|
-
console.log(a, b);
|
289
288
|
// 开始
|
290
289
|
if (a && isDateString(a)) {
|
291
290
|
sta.panel = a;
|
@@ -326,7 +325,7 @@
|
|
326
325
|
emits('update:modelValue', [sta, end]);
|
327
326
|
}
|
328
327
|
},
|
329
|
-
{ deep: true, immediate: true }
|
328
|
+
{ deep: true, immediate: true },
|
330
329
|
);
|
331
330
|
|
332
331
|
// 日期前翻
|