ff-ui-plus 2.0.7
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/.nvmrc +1 -0
- package/.prettierrc.cjs +41 -0
- package/.stylelintignore +5 -0
- package/LICENSE +21 -0
- package/README.md +265 -0
- package/commitlint.config.cjs +162 -0
- package/global.d.ts +27 -0
- package/index.html +16 -0
- package/lib.sh +9 -0
- package/lint-staged.config.cjs +8 -0
- package/package.json +149 -0
- package/packages/components/adaptive-page/index.ts +5 -0
- package/packages/components/adaptive-page/src/index.vue +85 -0
- package/packages/components/adaptive-page/src/type.ts +9 -0
- package/packages/components/adaptive-page/style/css.ts +1 -0
- package/packages/components/adaptive-page/style/index.ts +1 -0
- package/packages/components/button/index.ts +5 -0
- package/packages/components/button/src/index.vue +41 -0
- package/packages/components/button/src/type.ts +11 -0
- package/packages/components/button/style/css.ts +1 -0
- package/packages/components/button/style/index.ts +1 -0
- package/packages/components/chart/index.ts +5 -0
- package/packages/components/chart/src/index.vue +121 -0
- package/packages/components/chart/src/type.ts +7 -0
- package/packages/components/chart/style/css.ts +1 -0
- package/packages/components/chart/style/index.ts +1 -0
- package/packages/components/checkbox/index.ts +3 -0
- package/packages/components/checkbox/src/checkbox.d.ts +5 -0
- package/packages/components/checkbox/src/index.vue +67 -0
- package/packages/components/checkbox/style/css.ts +1 -0
- package/packages/components/checkbox/style/index.ts +1 -0
- package/packages/components/date-picker/index.ts +5 -0
- package/packages/components/date-picker/src/index.vue +228 -0
- package/packages/components/date-picker/src/type.ts +22 -0
- package/packages/components/date-picker/style/css.ts +1 -0
- package/packages/components/date-picker/style/index.ts +1 -0
- package/packages/components/detail/index.ts +5 -0
- package/packages/components/detail/src/index.vue +102 -0
- package/packages/components/detail/src/renderLabel.vue +15 -0
- package/packages/components/detail/src/renderTooltip.vue +15 -0
- package/packages/components/detail/src/type.ts +28 -0
- package/packages/components/detail/style/css.ts +1 -0
- package/packages/components/detail/style/index.ts +1 -0
- package/packages/components/form/index.ts +5 -0
- package/packages/components/form/src/index.vue +407 -0
- package/packages/components/form/src/renderBtn.vue +15 -0
- package/packages/components/form/src/renderComp.vue +15 -0
- package/packages/components/form/src/type.ts +26 -0
- package/packages/components/form/style/css.ts +1 -0
- package/packages/components/form/style/index.ts +1 -0
- package/packages/components/index.ts +20 -0
- package/packages/components/input/index.ts +5 -0
- package/packages/components/input/src/index.vue +225 -0
- package/packages/components/input/src/type.ts +14 -0
- package/packages/components/input/style/css.ts +1 -0
- package/packages/components/input/style/index.ts +1 -0
- package/packages/components/layout-page/index.ts +4 -0
- package/packages/components/layout-page/src/index.vue +74 -0
- package/packages/components/layout-page/style/css.ts +1 -0
- package/packages/components/layout-page/style/index.ts +1 -0
- package/packages/components/layout-page-item/index.ts +3 -0
- package/packages/components/layout-page-item/src/index.vue +16 -0
- package/packages/components/layout-page-item/style/css.ts +1 -0
- package/packages/components/layout-page-item/style/index.ts +1 -0
- package/packages/components/module-form/index.ts +4 -0
- package/packages/components/module-form/src/index.vue +243 -0
- package/packages/components/module-form/src/moduleDetail.vue +61 -0
- package/packages/components/module-form/src/moduleForm.vue +88 -0
- package/packages/components/module-form/src/type.ts +16 -0
- package/packages/components/module-form/style/css.ts +1 -0
- package/packages/components/module-form/style/index.ts +1 -0
- package/packages/components/package.json +9 -0
- package/packages/components/query-condition/index.ts +4 -0
- package/packages/components/query-condition/src/index.vue +478 -0
- package/packages/components/query-condition/src/moreChoose.vue +159 -0
- package/packages/components/query-condition/src/renderComp.vue +15 -0
- package/packages/components/query-condition/src/type.ts +22 -0
- package/packages/components/query-condition/src/useComputed.ts +94 -0
- package/packages/components/query-condition/style/css.ts +1 -0
- package/packages/components/query-condition/style/index.ts +1 -0
- package/packages/components/radio/index.ts +3 -0
- package/packages/components/radio/src/index.vue +73 -0
- package/packages/components/radio/src/radio.d.ts +12 -0
- package/packages/components/radio/style/css.ts +1 -0
- package/packages/components/radio/style/index.ts +1 -0
- package/packages/components/select/index.ts +4 -0
- package/packages/components/select/src/index.vue +240 -0
- package/packages/components/select/src/type.ts +43 -0
- package/packages/components/select/style/css.ts +1 -0
- package/packages/components/select/style/index.ts +1 -0
- package/packages/components/select-icon/index.ts +4 -0
- package/packages/components/select-icon/src/index.vue +128 -0
- package/packages/components/select-icon/style/css.ts +1 -0
- package/packages/components/select-icon/style/index.ts +1 -0
- package/packages/components/select-table/index.ts +4 -0
- package/packages/components/select-table/src/ClickOutside.ts +106 -0
- package/packages/components/select-table/src/index.vue +851 -0
- package/packages/components/select-table/src/renderCol.vue +20 -0
- package/packages/components/select-table/src/type.ts +56 -0
- package/packages/components/select-table/src/useVirtualized.ts +86 -0
- package/packages/components/select-table/style/css.ts +1 -0
- package/packages/components/select-table/style/index.ts +1 -0
- package/packages/components/step-wizard/index.ts +4 -0
- package/packages/components/step-wizard/src/index.vue +99 -0
- package/packages/components/step-wizard/src/type.ts +17 -0
- package/packages/components/step-wizard/style/css.ts +1 -0
- package/packages/components/step-wizard/style/index.ts +1 -0
- package/packages/components/table/index.ts +5 -0
- package/packages/components/table/src/ColumnSet.vue +176 -0
- package/packages/components/table/src/TTableColumn.vue +100 -0
- package/packages/components/table/src/densitySet.vue +91 -0
- package/packages/components/table/src/firstColumn.vue +132 -0
- package/packages/components/table/src/index.vue +926 -0
- package/packages/components/table/src/operator.vue +246 -0
- package/packages/components/table/src/renderCol.vue +20 -0
- package/packages/components/table/src/renderHeader.vue +18 -0
- package/packages/components/table/src/singleEdit.vue +354 -0
- package/packages/components/table/src/singleEditCell.vue +303 -0
- package/packages/components/table/src/tableProps.ts +162 -0
- package/packages/components/table/src/useExpose.ts +74 -0
- package/packages/components/table/src/useVirtualized.ts +70 -0
- package/packages/components/table/style/css.ts +1 -0
- package/packages/components/table/style/index.ts +1 -0
- package/packages/components/tabs/index.ts +4 -0
- package/packages/components/tabs/src/index.vue +50 -0
- package/packages/components/tabs/style/css.ts +1 -0
- package/packages/components/tabs/style/index.ts +1 -0
- package/packages/components/timer-btn/index.ts +4 -0
- package/packages/components/timer-btn/src/index.vue +57 -0
- package/packages/components/timer-btn/style/css.ts +1 -0
- package/packages/components/timer-btn/style/index.ts +1 -0
- package/packages/components/utils/index.ts +142 -0
- package/packages/components/utils/install.ts +16 -0
- package/packages/eslint-config/build.config.ts +16 -0
- package/packages/eslint-config/dist/index.cjs +122 -0
- package/packages/eslint-config/dist/index.d.cts +92 -0
- package/packages/eslint-config/dist/index.d.mts +92 -0
- package/packages/eslint-config/dist/index.d.ts +92 -0
- package/packages/eslint-config/dist/index.mjs +120 -0
- package/packages/eslint-config/package.json +34 -0
- package/packages/eslint-config/src/index.ts +121 -0
- package/packages/ff-ui-plus/component.ts +55 -0
- package/packages/ff-ui-plus/defaults.ts +4 -0
- package/packages/ff-ui-plus/index.ts +9 -0
- package/packages/ff-ui-plus/make-installer.ts +10 -0
- package/packages/ff-ui-plus/package.json +117 -0
- package/packages/ff-ui-plus/version.ts +1 -0
- package/packages/hooks/index.ts +1 -0
- package/packages/hooks/package.json +9 -0
- package/packages/hooks/useLocale.ts +53 -0
- package/packages/locale/index.ts +11 -0
- package/packages/locale/lang/en.ts +157 -0
- package/packages/locale/lang/zh-cn.ts +155 -0
- package/packages/locale/package.json +12 -0
- package/packages/resolver/package.json +23 -0
- package/packages/resolver/src/index.ts +99 -0
- package/packages/theme-chalk/build.ts +76 -0
- package/packages/theme-chalk/dist/index.css +1 -0
- package/packages/theme-chalk/dist/src/adaptive-page.scss +48 -0
- package/packages/theme-chalk/dist/src/button.scss +23 -0
- package/packages/theme-chalk/dist/src/chart.scss +10 -0
- package/packages/theme-chalk/dist/src/checkbox.scss +0 -0
- package/packages/theme-chalk/dist/src/date-picker.scss +3 -0
- package/packages/theme-chalk/dist/src/detail.scss +7 -0
- package/packages/theme-chalk/dist/src/form.scss +104 -0
- package/packages/theme-chalk/dist/src/index.scss +19 -0
- package/packages/theme-chalk/dist/src/input.scss +0 -0
- package/packages/theme-chalk/dist/src/layout-page-item.scss +10 -0
- package/packages/theme-chalk/dist/src/layout-page.scss +37 -0
- package/packages/theme-chalk/dist/src/module-form.scss +335 -0
- package/packages/theme-chalk/dist/src/query-condition.scss +132 -0
- package/packages/theme-chalk/dist/src/radio.scss +0 -0
- package/packages/theme-chalk/dist/src/select-icon.scss +61 -0
- package/packages/theme-chalk/dist/src/select-table.scss +71 -0
- package/packages/theme-chalk/dist/src/select.scss +7 -0
- package/packages/theme-chalk/dist/src/step-wizard.scss +51 -0
- package/packages/theme-chalk/dist/src/table.scss +381 -0
- package/packages/theme-chalk/dist/src/tabs.scss +20 -0
- package/packages/theme-chalk/dist/src/timer-btn.scss +21 -0
- package/packages/theme-chalk/dist/t-adaptive-page.css +1 -0
- package/packages/theme-chalk/dist/t-button.css +1 -0
- package/packages/theme-chalk/dist/t-chart.css +1 -0
- package/packages/theme-chalk/dist/t-checkbox.css +0 -0
- package/packages/theme-chalk/dist/t-date-picker.css +1 -0
- package/packages/theme-chalk/dist/t-detail.css +1 -0
- package/packages/theme-chalk/dist/t-form.css +1 -0
- package/packages/theme-chalk/dist/t-input.css +0 -0
- package/packages/theme-chalk/dist/t-layout-page-item.css +1 -0
- package/packages/theme-chalk/dist/t-layout-page.css +1 -0
- package/packages/theme-chalk/dist/t-module-form.css +1 -0
- package/packages/theme-chalk/dist/t-query-condition.css +1 -0
- package/packages/theme-chalk/dist/t-radio.css +0 -0
- package/packages/theme-chalk/dist/t-select-icon.css +1 -0
- package/packages/theme-chalk/dist/t-select-table.css +1 -0
- package/packages/theme-chalk/dist/t-select.css +1 -0
- package/packages/theme-chalk/dist/t-step-wizard.css +1 -0
- package/packages/theme-chalk/dist/t-table.css +1 -0
- package/packages/theme-chalk/dist/t-tabs.css +1 -0
- package/packages/theme-chalk/dist/t-timer-btn.css +1 -0
- package/packages/theme-chalk/mixins/config.scss +8 -0
- package/packages/theme-chalk/mixins/function.scss +71 -0
- package/packages/theme-chalk/mixins/mixins.scss +79 -0
- package/packages/theme-chalk/package.json +21 -0
- package/packages/theme-chalk/src/adaptive-page.scss +48 -0
- package/packages/theme-chalk/src/button.scss +23 -0
- package/packages/theme-chalk/src/chart.scss +10 -0
- package/packages/theme-chalk/src/checkbox.scss +0 -0
- package/packages/theme-chalk/src/date-picker.scss +3 -0
- package/packages/theme-chalk/src/detail.scss +7 -0
- package/packages/theme-chalk/src/form.scss +104 -0
- package/packages/theme-chalk/src/index.scss +19 -0
- package/packages/theme-chalk/src/input.scss +0 -0
- package/packages/theme-chalk/src/layout-page-item.scss +10 -0
- package/packages/theme-chalk/src/layout-page.scss +37 -0
- package/packages/theme-chalk/src/module-form.scss +335 -0
- package/packages/theme-chalk/src/query-condition.scss +132 -0
- package/packages/theme-chalk/src/radio.scss +0 -0
- package/packages/theme-chalk/src/select-icon.scss +61 -0
- package/packages/theme-chalk/src/select-table.scss +71 -0
- package/packages/theme-chalk/src/select.scss +7 -0
- package/packages/theme-chalk/src/step-wizard.scss +51 -0
- package/packages/theme-chalk/src/table.scss +381 -0
- package/packages/theme-chalk/src/tabs.scss +20 -0
- package/packages/theme-chalk/src/timer-btn.scss +21 -0
- package/packages/types/global.ts +34 -0
- package/packages/types/index.ts +1 -0
- package/packages/types/package.json +10 -0
- package/packages/utils/build.config.ts +23 -0
- package/packages/utils/dist/cookie.cjs +1 -0
- package/packages/utils/dist/cookie.d.cts +16 -0
- package/packages/utils/dist/cookie.d.mts +16 -0
- package/packages/utils/dist/cookie.d.ts +16 -0
- package/packages/utils/dist/cookie.mjs +1 -0
- package/packages/utils/dist/day.cjs +1 -0
- package/packages/utils/dist/day.d.cts +37 -0
- package/packages/utils/dist/day.d.mts +37 -0
- package/packages/utils/dist/day.d.ts +37 -0
- package/packages/utils/dist/day.mjs +1 -0
- package/packages/utils/dist/file.cjs +1 -0
- package/packages/utils/dist/file.d.cts +61 -0
- package/packages/utils/dist/file.d.mts +61 -0
- package/packages/utils/dist/file.d.ts +61 -0
- package/packages/utils/dist/file.mjs +1 -0
- package/packages/utils/dist/index.cjs +1 -0
- package/packages/utils/dist/index.d.cts +13 -0
- package/packages/utils/dist/index.d.mts +13 -0
- package/packages/utils/dist/index.d.ts +13 -0
- package/packages/utils/dist/index.mjs +1 -0
- package/packages/utils/dist/is.cjs +1 -0
- package/packages/utils/dist/is.d.cts +117 -0
- package/packages/utils/dist/is.d.mts +117 -0
- package/packages/utils/dist/is.d.ts +117 -0
- package/packages/utils/dist/is.mjs +1 -0
- package/packages/utils/dist/letter.cjs +1 -0
- package/packages/utils/dist/letter.d.cts +12 -0
- package/packages/utils/dist/letter.d.mts +12 -0
- package/packages/utils/dist/letter.d.ts +12 -0
- package/packages/utils/dist/letter.mjs +1 -0
- package/packages/utils/dist/number.cjs +1 -0
- package/packages/utils/dist/number.d.cts +23 -0
- package/packages/utils/dist/number.d.mts +23 -0
- package/packages/utils/dist/number.d.ts +23 -0
- package/packages/utils/dist/number.mjs +1 -0
- package/packages/utils/dist/openExe.cjs +1 -0
- package/packages/utils/dist/openExe.d.cts +9 -0
- package/packages/utils/dist/openExe.d.mts +9 -0
- package/packages/utils/dist/openExe.d.ts +9 -0
- package/packages/utils/dist/openExe.mjs +1 -0
- package/packages/utils/dist/storage.cjs +1 -0
- package/packages/utils/dist/storage.d.cts +46 -0
- package/packages/utils/dist/storage.d.mts +46 -0
- package/packages/utils/dist/storage.d.ts +46 -0
- package/packages/utils/dist/storage.mjs +1 -0
- package/packages/utils/dist/validate.cjs +1 -0
- package/packages/utils/dist/validate.d.cts +32 -0
- package/packages/utils/dist/validate.d.mts +32 -0
- package/packages/utils/dist/validate.d.ts +32 -0
- package/packages/utils/dist/validate.mjs +1 -0
- package/packages/utils/dist/ws.cjs +1 -0
- package/packages/utils/dist/ws.d.cts +86 -0
- package/packages/utils/dist/ws.d.mts +86 -0
- package/packages/utils/dist/ws.d.ts +86 -0
- package/packages/utils/dist/ws.mjs +1 -0
- package/packages/utils/package.json +42 -0
- package/packages/utils/src/cookie.ts +24 -0
- package/packages/utils/src/day.ts +66 -0
- package/packages/utils/src/file.ts +173 -0
- package/packages/utils/src/index.ts +10 -0
- package/packages/utils/src/is.ts +159 -0
- package/packages/utils/src/letter.ts +15 -0
- package/packages/utils/src/number.ts +37 -0
- package/packages/utils/src/openExe.ts +45 -0
- package/packages/utils/src/storage.ts +77 -0
- package/packages/utils/src/validate.ts +55 -0
- package/packages/utils/src/ws.ts +191 -0
- package/pnpm-workspace.yaml +3 -0
- package/publish.sh +37 -0
- package/resolver.sh +9 -0
- package/scripts/build/all.ts +152 -0
- package/scripts/build/build.config.ts +10 -0
- package/scripts/build/dist/index.cjs +7 -0
- package/scripts/build/dist/index.d.ts +2 -0
- package/scripts/build/dist/index.mjs +12 -0
- package/scripts/build/index.ts +63 -0
- package/scripts/build/modules.ts +141 -0
- package/scripts/build/package.json +14 -0
- package/scripts/release/gen-version.ts +12 -0
- package/scripts/release/index.ts +209 -0
- package/scripts/utils/excludeFiles.ts +14 -0
- package/scripts/utils/index.ts +88 -0
- package/scripts/utils/main.ts +14 -0
- package/scripts/utils/paths.ts +40 -0
- package/scripts/utils/plugin.ts +61 -0
- package/tsconfig.base.json +23 -0
- package/tsconfig.vitest.json +11 -0
- package/tsconfig.web.json +18 -0
- package/typings/env.d.ts +22 -0
- package/typings/index.d.ts +161 -0
- package/vitest.config.ts +22 -0
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
.t-table {
|
|
2
|
+
z-index: 0;
|
|
3
|
+
background-color: var(--el-bg-color);
|
|
4
|
+
|
|
5
|
+
.el-table__header-wrapper {
|
|
6
|
+
.el-table__header {
|
|
7
|
+
margin: 0;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.el-table__body-wrapper {
|
|
12
|
+
.el-table__body {
|
|
13
|
+
margin: 0;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.el-pagination {
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: flex-end;
|
|
20
|
+
align-items: center;
|
|
21
|
+
margin-top: 10px;
|
|
22
|
+
// margin-right: 60px;
|
|
23
|
+
margin-right: calc(2% - 20px);
|
|
24
|
+
background-color: var(--el-bg-color);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// ttable过长省略号
|
|
28
|
+
.el-table {
|
|
29
|
+
.el-tooltip {
|
|
30
|
+
div {
|
|
31
|
+
-webkit-box-sizing: border-box;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
text-overflow: ellipsis;
|
|
35
|
+
word-break: break-all;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.single_edit_cell {
|
|
39
|
+
overflow: visible;
|
|
40
|
+
margin-bottom: 0;
|
|
41
|
+
|
|
42
|
+
div {
|
|
43
|
+
overflow: visible;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.single_edit_cell {
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
|
|
51
|
+
.slot_edit_name {
|
|
52
|
+
width: 100%;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// 多级表头过长省略号
|
|
58
|
+
.multile_head_column {
|
|
59
|
+
.el-table__row {
|
|
60
|
+
.el-tooltip {
|
|
61
|
+
div {
|
|
62
|
+
-webkit-box-sizing: border-box;
|
|
63
|
+
box-sizing: border-box;
|
|
64
|
+
overflow: hidden;
|
|
65
|
+
text-overflow: ellipsis;
|
|
66
|
+
word-break: break-all;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// 单元格编辑且无规则校验
|
|
73
|
+
.el-table {
|
|
74
|
+
.cell {
|
|
75
|
+
div {
|
|
76
|
+
-webkit-box-sizing: border-box;
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
text-overflow: ellipsis;
|
|
80
|
+
word-break: break-all;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.single_edit_cell {
|
|
84
|
+
overflow: visible;
|
|
85
|
+
margin-bottom: 0;
|
|
86
|
+
|
|
87
|
+
div {
|
|
88
|
+
overflow: visible;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// 单元格编辑有规则校验
|
|
95
|
+
.el-table {
|
|
96
|
+
.cell {
|
|
97
|
+
.t_edit_cell_form_rules {
|
|
98
|
+
.single_edit_cell {
|
|
99
|
+
margin-bottom: 15px;
|
|
100
|
+
|
|
101
|
+
.el-form-item__content {
|
|
102
|
+
overflow: visible;
|
|
103
|
+
|
|
104
|
+
.el-form-item__error {
|
|
105
|
+
overflow: visible;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.el-table {
|
|
116
|
+
.cell {
|
|
117
|
+
.click_edit {
|
|
118
|
+
display: flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
line-height: 1;
|
|
121
|
+
|
|
122
|
+
.el-icon {
|
|
123
|
+
margin-left: 2px;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.el-table--border th:first-child .cell,
|
|
130
|
+
.el-table--border td:first-child .cell {
|
|
131
|
+
padding-left: 5px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.header_wrap {
|
|
135
|
+
display: flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
|
|
138
|
+
.toolbar_top {
|
|
139
|
+
flex: 1;
|
|
140
|
+
display: flex;
|
|
141
|
+
align-items: center;
|
|
142
|
+
justify-content: flex-end;
|
|
143
|
+
|
|
144
|
+
.toolbar {
|
|
145
|
+
display: flex;
|
|
146
|
+
justify-content: flex-end;
|
|
147
|
+
width: 100%;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.el-button--small {
|
|
151
|
+
height: 32px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.el-button--success {
|
|
155
|
+
background-color: #355db4;
|
|
156
|
+
border: 1px solid #355db4;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.header_right_wrap {
|
|
160
|
+
display: flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.header_title {
|
|
166
|
+
display: flex;
|
|
167
|
+
align-items: center;
|
|
168
|
+
flex: 1;
|
|
169
|
+
font-size: 16px;
|
|
170
|
+
font-weight: bold;
|
|
171
|
+
line-height: 35px;
|
|
172
|
+
margin-left: 10px;
|
|
173
|
+
color: var(--el-text-color-primary);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.title-tip {
|
|
178
|
+
display: flex;
|
|
179
|
+
align-items: center;
|
|
180
|
+
padding-left: 10px;
|
|
181
|
+
font-size: 14px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.marginBttom {
|
|
185
|
+
margin-bottom: -8px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// 单选样式
|
|
189
|
+
.radioStyle {
|
|
190
|
+
.el-radio {
|
|
191
|
+
.el-radio__label {
|
|
192
|
+
display: none;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
&:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner {
|
|
196
|
+
box-shadow: none;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
tbody {
|
|
201
|
+
.el-table__row {
|
|
202
|
+
cursor: pointer;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// 复制功能样式
|
|
208
|
+
.cursor {
|
|
209
|
+
tbody {
|
|
210
|
+
.el-table__row {
|
|
211
|
+
cursor: pointer;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// 行拖动
|
|
217
|
+
.row_sort {
|
|
218
|
+
tbody {
|
|
219
|
+
.el-table__row {
|
|
220
|
+
cursor: move;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.row_sort_none {
|
|
226
|
+
tbody {
|
|
227
|
+
.el-table__row {
|
|
228
|
+
cursor: default;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.row_drag {
|
|
232
|
+
cursor: move;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// treeTable样式
|
|
238
|
+
.tree_style {
|
|
239
|
+
.el-table__body-wrapper {
|
|
240
|
+
.el-table__body {
|
|
241
|
+
.cell {
|
|
242
|
+
display: flex;
|
|
243
|
+
align-items: center;
|
|
244
|
+
|
|
245
|
+
.el-table__expand-icon {
|
|
246
|
+
display: flex;
|
|
247
|
+
align-items: center;
|
|
248
|
+
justify-content: center;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// 选中行样式
|
|
256
|
+
.highlightCurrentRow {
|
|
257
|
+
.current-row {
|
|
258
|
+
cursor: pointer;
|
|
259
|
+
|
|
260
|
+
>td.el-table__cell {
|
|
261
|
+
background-color: var(--el-table-current-row-bg-color);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.el-table--scrollable-y .el-table__body-wrapper {
|
|
267
|
+
overflow-x: auto;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.handle_wrap {
|
|
271
|
+
position: sticky;
|
|
272
|
+
z-index: 10;
|
|
273
|
+
right: 0;
|
|
274
|
+
bottom: -8px;
|
|
275
|
+
margin: 0 -8px -8px;
|
|
276
|
+
padding: 12px 16px;
|
|
277
|
+
background-color: var(--el-bg-color);
|
|
278
|
+
border-top: 1px solid var(--el-table-border);
|
|
279
|
+
|
|
280
|
+
.el-btn {
|
|
281
|
+
margin-left: 8px;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.operator {
|
|
286
|
+
.operator_btn {
|
|
287
|
+
display: flex;
|
|
288
|
+
align-items: center;
|
|
289
|
+
|
|
290
|
+
.oper_more_dropdown {
|
|
291
|
+
margin-left: 8px;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.column_set {
|
|
298
|
+
.title {
|
|
299
|
+
font-weight: bold;
|
|
300
|
+
font-size: 14px;
|
|
301
|
+
display: flex;
|
|
302
|
+
justify-content: center;
|
|
303
|
+
align-items: center;
|
|
304
|
+
padding: 10px 10px 0 10px;
|
|
305
|
+
color: var(--el-text-color-primary);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.el-dropdown-menu {
|
|
309
|
+
padding: 0;
|
|
310
|
+
font-size: 14px;
|
|
311
|
+
|
|
312
|
+
.el-dropdown-menu__item {
|
|
313
|
+
display: flex;
|
|
314
|
+
flex-direction: column;
|
|
315
|
+
align-items: flex-start;
|
|
316
|
+
padding: 0;
|
|
317
|
+
|
|
318
|
+
.t_table_column_setting_dropdown {
|
|
319
|
+
display: flex;
|
|
320
|
+
flex-direction: column;
|
|
321
|
+
max-height: 400px;
|
|
322
|
+
overflow-y: auto;
|
|
323
|
+
width: 100%;
|
|
324
|
+
padding: 0 10px 0 12px;
|
|
325
|
+
gap: 10px;
|
|
326
|
+
|
|
327
|
+
&:hover {
|
|
328
|
+
background-color: transparent;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.el-tree-node {
|
|
332
|
+
.el-tree-node__content {
|
|
333
|
+
padding: 10px;
|
|
334
|
+
cursor: default;
|
|
335
|
+
|
|
336
|
+
&:hover {
|
|
337
|
+
color: var(--el-color-primary);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.el-tree-node__expand-icon {
|
|
341
|
+
display: none;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.el-tree-node__label {
|
|
345
|
+
display: inline-block;
|
|
346
|
+
cursor: move;
|
|
347
|
+
width: 100%;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.el-dropdown-menu__item:not(.is-disabled):hover {
|
|
355
|
+
background-color: transparent;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.oper_more_dropdown_menu {
|
|
361
|
+
display: flex;
|
|
362
|
+
flex-direction: column;
|
|
363
|
+
|
|
364
|
+
.el-dropdown-menu__item {
|
|
365
|
+
padding: 6px 12px;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.density_set {
|
|
370
|
+
.density_set_list {
|
|
371
|
+
display: flex;
|
|
372
|
+
flex-direction: column;
|
|
373
|
+
align-items: center;
|
|
374
|
+
gap: 10px;
|
|
375
|
+
padding: 10px;
|
|
376
|
+
|
|
377
|
+
.el-button {
|
|
378
|
+
margin: 0;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.t-timer-btn {
|
|
2
|
+
position: relative;
|
|
3
|
+
|
|
4
|
+
.sendSmsBtn {
|
|
5
|
+
height: 40px;
|
|
6
|
+
line-height: 40px;
|
|
7
|
+
border-radius: 4px;
|
|
8
|
+
background: #ef473a;
|
|
9
|
+
border: none;
|
|
10
|
+
padding: 0 6px;
|
|
11
|
+
color: #fff;
|
|
12
|
+
display: inline-block;
|
|
13
|
+
min-width: 92px;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.dissendSmsBtn {
|
|
18
|
+
opacity: 0.5;
|
|
19
|
+
cursor: auto;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Mutable } from "element-plus/es/utils"
|
|
2
|
+
|
|
3
|
+
export {}
|
|
4
|
+
/**
|
|
5
|
+
* ref 绑定的元素类型
|
|
6
|
+
*/
|
|
7
|
+
export type ElementRefType = HTMLElement | null
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* setTimeout 类型
|
|
11
|
+
*/
|
|
12
|
+
export type Timeout = ReturnType<typeof setTimeout>
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* setInterval 类型
|
|
16
|
+
*/
|
|
17
|
+
export type Interval = ReturnType<typeof setInterval>
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 普通的对象的泛型
|
|
21
|
+
*/
|
|
22
|
+
export type RecordType = {
|
|
23
|
+
[index: keyof any]: any
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 允许null的泛型
|
|
28
|
+
*/
|
|
29
|
+
export type Nullable<T> = T | null
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 去除只读状态
|
|
33
|
+
*/
|
|
34
|
+
export { Mutable }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./global"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import path from "node:path"
|
|
2
|
+
import { defineBuildConfig } from "unbuild"
|
|
3
|
+
import glob from "fast-glob"
|
|
4
|
+
|
|
5
|
+
const entries = glob.sync("./src/*", {
|
|
6
|
+
cwd: path.resolve(__dirname),
|
|
7
|
+
onlyFiles: true
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export default defineBuildConfig({
|
|
11
|
+
entries,
|
|
12
|
+
clean: true,
|
|
13
|
+
declaration: true,
|
|
14
|
+
rollup: {
|
|
15
|
+
emitCJS: true,
|
|
16
|
+
dts: {
|
|
17
|
+
respectExternal: true
|
|
18
|
+
},
|
|
19
|
+
esbuild: {
|
|
20
|
+
minify: true
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("js-cookie");function _interopDefaultCompat(e){return e&&typeof e=="object"&&"default"in e?e.default:e}const o__default=_interopDefaultCompat(o);function getCookie(e){return o__default.get(e)}function setCookie(e,t){return o__default.set(e,t)}function removeCookie(e){o__default.remove(e)}exports.getCookie=getCookie,exports.removeCookie=removeCookie,exports.setCookie=setCookie;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取 cookie
|
|
3
|
+
* @returns
|
|
4
|
+
*/
|
|
5
|
+
declare function getCookie(key: string): string | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* 设置 cookie
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
declare function setCookie(key: string, data: any): string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* 移除 cookie
|
|
13
|
+
*/
|
|
14
|
+
declare function removeCookie(key: string): void;
|
|
15
|
+
|
|
16
|
+
export { getCookie, removeCookie, setCookie };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取 cookie
|
|
3
|
+
* @returns
|
|
4
|
+
*/
|
|
5
|
+
declare function getCookie(key: string): string | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* 设置 cookie
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
declare function setCookie(key: string, data: any): string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* 移除 cookie
|
|
13
|
+
*/
|
|
14
|
+
declare function removeCookie(key: string): void;
|
|
15
|
+
|
|
16
|
+
export { getCookie, removeCookie, setCookie };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取 cookie
|
|
3
|
+
* @returns
|
|
4
|
+
*/
|
|
5
|
+
declare function getCookie(key: string): string | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* 设置 cookie
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
declare function setCookie(key: string, data: any): string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* 移除 cookie
|
|
13
|
+
*/
|
|
14
|
+
declare function removeCookie(key: string): void;
|
|
15
|
+
|
|
16
|
+
export { getCookie, removeCookie, setCookie };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"js-cookie";function r(o){return e.get(o)}function n(o,t){return e.set(o,t)}function i(o){e.remove(o)}export{r as getCookie,i as removeCookie,n as setCookie};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("dayjs");function _interopDefaultCompat(t){return t&&typeof t=="object"&&"default"in t?t.default:t}const n__default=_interopDefaultCompat(n);function formatDate(t,e="YYYY-MM-DD HH:mm:ss"){return n__default(t||new Date).format(e)}const formatDateToDay=t=>formatDate(t,"YYYY-MM-DD"),formatDateToMinute=t=>formatDate(t,"YYYY-MM-DD HH:mm");function diffDate(t,e=n__default(),a="second"){if(t)return n__default(t).diff(n__default(e),a)}function diffDateFromCurrent(t){return t>=60*60*24*365?`${parseInt(String(t/(60*60*24*365)))}\u5E74\u524D`:t>=60*60*24*30?`${parseInt(String(t/(60*60*24*30)))}\u6708\u524D`:t>=60*60*24?`${parseInt(String(t/(60*60*24)))}\u5929\u524D`:t>=60*60?`${parseInt(String(t/(60*60)))}\u5C0F\u65F6\u524D`:t>=60?`${parseInt(String(t/60))}\u5206\u949F\u524D`:`${parseInt(String(t))}\u79D2\u524D`}exports.diffDate=diffDate,exports.diffDateFromCurrent=diffDateFromCurrent,exports.formatDate=formatDate,exports.formatDateToDay=formatDateToDay,exports.formatDateToMinute=formatDateToMinute;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ConfigType, QUnitType, OpUnitType } from 'dayjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {string | number | Date | Dayjs | null | undefined} date
|
|
6
|
+
* @param format 默认 YYYY-MM-DD HH:mm:ss
|
|
7
|
+
* @returns YYYY-MM-DD HH:mm:ss
|
|
8
|
+
*/
|
|
9
|
+
declare function formatDate(date?: ConfigType, format?: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* 格式化时间到天
|
|
12
|
+
* @param {string | number | Date | Dayjs | null | undefined} date
|
|
13
|
+
* @returns YYYY-MM-DD
|
|
14
|
+
*/
|
|
15
|
+
declare const formatDateToDay: (date: ConfigType) => string;
|
|
16
|
+
/**
|
|
17
|
+
* 格式化时间到分钟
|
|
18
|
+
* @param {string | number | Date | Dayjs | null | undefined} date
|
|
19
|
+
* @returns YYYY-MM-DD HH:mm
|
|
20
|
+
*/
|
|
21
|
+
declare const formatDateToMinute: (date: ConfigType) => string;
|
|
22
|
+
/**
|
|
23
|
+
* 获取两个 Dayjs 对象的时间差,默认秒。
|
|
24
|
+
* @param date1
|
|
25
|
+
* @param date2
|
|
26
|
+
* @param format
|
|
27
|
+
* @returns {*}
|
|
28
|
+
*/
|
|
29
|
+
declare function diffDate(date1: ConfigType, date2?: ConfigType, format?: QUnitType | OpUnitType): number | string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* @desc 获取距离当前时间差,返回多少年(月/天/小时/分钟/秒)前
|
|
32
|
+
* @param date 秒数
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
declare function diffDateFromCurrent(date: number): string;
|
|
36
|
+
|
|
37
|
+
export { diffDate, diffDateFromCurrent, formatDate, formatDateToDay, formatDateToMinute };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ConfigType, QUnitType, OpUnitType } from 'dayjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {string | number | Date | Dayjs | null | undefined} date
|
|
6
|
+
* @param format 默认 YYYY-MM-DD HH:mm:ss
|
|
7
|
+
* @returns YYYY-MM-DD HH:mm:ss
|
|
8
|
+
*/
|
|
9
|
+
declare function formatDate(date?: ConfigType, format?: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* 格式化时间到天
|
|
12
|
+
* @param {string | number | Date | Dayjs | null | undefined} date
|
|
13
|
+
* @returns YYYY-MM-DD
|
|
14
|
+
*/
|
|
15
|
+
declare const formatDateToDay: (date: ConfigType) => string;
|
|
16
|
+
/**
|
|
17
|
+
* 格式化时间到分钟
|
|
18
|
+
* @param {string | number | Date | Dayjs | null | undefined} date
|
|
19
|
+
* @returns YYYY-MM-DD HH:mm
|
|
20
|
+
*/
|
|
21
|
+
declare const formatDateToMinute: (date: ConfigType) => string;
|
|
22
|
+
/**
|
|
23
|
+
* 获取两个 Dayjs 对象的时间差,默认秒。
|
|
24
|
+
* @param date1
|
|
25
|
+
* @param date2
|
|
26
|
+
* @param format
|
|
27
|
+
* @returns {*}
|
|
28
|
+
*/
|
|
29
|
+
declare function diffDate(date1: ConfigType, date2?: ConfigType, format?: QUnitType | OpUnitType): number | string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* @desc 获取距离当前时间差,返回多少年(月/天/小时/分钟/秒)前
|
|
32
|
+
* @param date 秒数
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
declare function diffDateFromCurrent(date: number): string;
|
|
36
|
+
|
|
37
|
+
export { diffDate, diffDateFromCurrent, formatDate, formatDateToDay, formatDateToMinute };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ConfigType, QUnitType, OpUnitType } from 'dayjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {string | number | Date | Dayjs | null | undefined} date
|
|
6
|
+
* @param format 默认 YYYY-MM-DD HH:mm:ss
|
|
7
|
+
* @returns YYYY-MM-DD HH:mm:ss
|
|
8
|
+
*/
|
|
9
|
+
declare function formatDate(date?: ConfigType, format?: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* 格式化时间到天
|
|
12
|
+
* @param {string | number | Date | Dayjs | null | undefined} date
|
|
13
|
+
* @returns YYYY-MM-DD
|
|
14
|
+
*/
|
|
15
|
+
declare const formatDateToDay: (date: ConfigType) => string;
|
|
16
|
+
/**
|
|
17
|
+
* 格式化时间到分钟
|
|
18
|
+
* @param {string | number | Date | Dayjs | null | undefined} date
|
|
19
|
+
* @returns YYYY-MM-DD HH:mm
|
|
20
|
+
*/
|
|
21
|
+
declare const formatDateToMinute: (date: ConfigType) => string;
|
|
22
|
+
/**
|
|
23
|
+
* 获取两个 Dayjs 对象的时间差,默认秒。
|
|
24
|
+
* @param date1
|
|
25
|
+
* @param date2
|
|
26
|
+
* @param format
|
|
27
|
+
* @returns {*}
|
|
28
|
+
*/
|
|
29
|
+
declare function diffDate(date1: ConfigType, date2?: ConfigType, format?: QUnitType | OpUnitType): number | string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* @desc 获取距离当前时间差,返回多少年(月/天/小时/分钟/秒)前
|
|
32
|
+
* @param date 秒数
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
declare function diffDateFromCurrent(date: number): string;
|
|
36
|
+
|
|
37
|
+
export { diffDate, diffDateFromCurrent, formatDate, formatDateToDay, formatDateToMinute };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n from"dayjs";function e(t,u="YYYY-MM-DD HH:mm:ss"){return n(t||new Date).format(u)}const a=t=>e(t,"YYYY-MM-DD"),r=t=>e(t,"YYYY-MM-DD HH:mm");function f(t,u=n(),D="second"){if(t)return n(t).diff(n(u),D)}function i(t){return t>=60*60*24*365?`${parseInt(String(t/(60*60*24*365)))}\u5E74\u524D`:t>=60*60*24*30?`${parseInt(String(t/(60*60*24*30)))}\u6708\u524D`:t>=60*60*24?`${parseInt(String(t/(60*60*24)))}\u5929\u524D`:t>=60*60?`${parseInt(String(t/(60*60)))}\u5C0F\u65F6\u524D`:t>=60?`${parseInt(String(t/60))}\u5206\u949F\u524D`:`${parseInt(String(t))}\u79D2\u524D`}export{f as diffDate,i as diffDateFromCurrent,e as formatDate,a as formatDateToDay,r as formatDateToMinute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=e=>e.toLowerCase(),a=e=>e&&e.slice(e.lastIndexOf(".")),isLegalFile=(e,o)=>{const s=o.filter(r=>r&&r!=="*").map(r=>i(r));if(!s.length)return!0;const t=a(e.name);return!!s.includes(i(t))},isMaxFileSize=(e,o)=>o?e.size/1024/1024<o:!0,fileToDataURL=e=>new Promise((o,s)=>{const t=new FileReader;t.onload=r=>{const n=r.target.result;o(n)},t.onerror=r=>{s(new Error(r))},t.readAsDataURL(e)}),fileToText=e=>new Promise((o,s)=>{const t=new FileReader;t.onload=r=>{const n=r.target.result;o(n)},t.onerror=r=>{s(new Error(r))},t.readAsText(e,"utf-8")}),loadImage=e=>new Promise((o,s)=>{const t=new Image;t.src=e,t.onload=()=>{const r={width:t.width,height:t.height,image:t};o(r)},t.onerror=()=>{const r=new Error("load file error");s(r)}}),isLegalResolutionRatio=async(e,o)=>{try{const{width:s,height:t}=o,r=await fileToDataURL(e),n=await loadImage(r);return n.width!==s||n.height!==t?Promise.reject(!1):!0}catch{return Promise.reject(!1)}},download=async(e,o,s)=>{if(!e)return Promise.reject("download fail: data is empt!");try{const t=await e.text();if(JSON.parse(t))return Promise.reject("download fail: server error!")}catch{}try{const{default:t}=await import("file-saver");return t.saveAs(e,o,s),Promise.resolve(e)}catch{return Promise.reject("download fail: server error!")}};exports.download=download,exports.fileToDataURL=fileToDataURL,exports.fileToText=fileToText,exports.isLegalFile=isLegalFile,exports.isLegalResolutionRatio=isLegalResolutionRatio,exports.isMaxFileSize=isMaxFileSize,exports.loadImage=loadImage;
|