@hbdlzy/ui-core 0.1.3 → 0.1.4
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/components.manifest.json +35 -1
- package/dist/components/BaseDialog/BaseDialog.types.d.ts +25 -0
- package/dist/components/BaseDialog/BaseDialog.vue.d.ts +100 -0
- package/dist/components/BaseDialog/index.d.ts +3 -0
- package/dist/components/BaseEChart/BaseEChart.vue.d.ts +1 -1
- package/dist/components/BaseExportButton/BaseExportButton.vue.d.ts +4 -4
- package/dist/components/BaseSearchForm/BaseSearchForm.types.d.ts +42 -0
- package/dist/components/BaseSearchForm/BaseSearchForm.utils.d.ts +5 -0
- package/dist/components/BaseSearchForm/BaseSearchForm.vue.d.ts +88 -0
- package/dist/components/BaseSearchForm/index.d.ts +4 -0
- package/dist/components/BaseTable/BaseTable.types.d.ts +1 -1
- package/dist/components/OutlinedCascader/OutlinedCascader.vue.d.ts +1 -1
- package/dist/components/OutlinedTimePicker/OutlinedTimePicker.vue.d.ts +2 -2
- package/dist/components/OutlinedTreeSelect/OutlinedTreeSelect.vue.d.ts +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +527 -140
- package/dist/style.css +1 -1
- package/package.json +3 -1
- package/src/components/BaseDialog/BaseDialog.types.ts +28 -0
- package/src/components/BaseDialog/BaseDialog.vue +158 -0
- package/src/components/BaseDialog/README.md +69 -0
- package/src/components/BaseDialog/index.ts +10 -0
- package/src/components/BaseExportButton/BaseExportButton.vue +3 -1
- package/src/components/BaseSearchForm/BaseSearchForm.types.ts +46 -0
- package/src/components/BaseSearchForm/BaseSearchForm.utils.ts +41 -0
- package/src/components/BaseSearchForm/BaseSearchForm.vue +267 -0
- package/src/components/BaseSearchForm/README.md +66 -0
- package/src/components/BaseSearchForm/index.ts +20 -0
- package/src/components/BaseTable/BaseTable.types.ts +1 -1
- package/src/index.ts +4 -0
- package/src/components/BaseCard/BaseCard.types.d.ts +0 -36
- package/src/components/BaseCard/BaseCard.vue.d.ts +0 -122
- package/src/components/BaseCard/index.d.ts +0 -3
- package/src/components/BaseEChart/BaseEChart.types.d.ts +0 -26
- package/src/components/BaseEChart/BaseEChart.vue.d.ts +0 -66
- package/src/components/BaseEChart/index.d.ts +0 -3
- package/src/components/BaseExportButton/BaseExportButton.types.d.ts +0 -21
- package/src/components/BaseExportButton/BaseExportButton.utils.d.ts +0 -4
- package/src/components/BaseExportButton/BaseExportButton.vue.d.ts +0 -128
- package/src/components/BaseExportButton/index.d.ts +0 -5
- package/src/components/BaseTable/BaseTable.types.d.ts +0 -163
- package/src/components/BaseTable/BaseTable.vue.d.ts +0 -157
- package/src/components/BaseTable/index.d.ts +0 -3
- package/src/components/OutlinedCascader/OutlinedCascader.types.d.ts +0 -25
- package/src/components/OutlinedCascader/OutlinedCascader.vue.d.ts +0 -85
- package/src/components/OutlinedCascader/index.d.ts +0 -3
- package/src/components/OutlinedDatePicker/OutlinedDatePicker.types.d.ts +0 -27
- package/src/components/OutlinedDatePicker/OutlinedDatePicker.vue.d.ts +0 -88
- package/src/components/OutlinedDatePicker/index.d.ts +0 -3
- package/src/components/OutlinedDateTimePicker/OutlinedDateTimePicker.types.d.ts +0 -26
- package/src/components/OutlinedDateTimePicker/OutlinedDateTimePicker.vue.d.ts +0 -97
- package/src/components/OutlinedDateTimePicker/index.d.ts +0 -3
- package/src/components/OutlinedInput/OutlinedInput.types.d.ts +0 -29
- package/src/components/OutlinedInput/OutlinedInput.vue.d.ts +0 -97
- package/src/components/OutlinedInput/index.d.ts +0 -3
- package/src/components/OutlinedSelect/OutlinedSelect.types.d.ts +0 -38
- package/src/components/OutlinedSelect/OutlinedSelect.vue.d.ts +0 -116
- package/src/components/OutlinedSelect/index.d.ts +0 -3
- package/src/components/OutlinedTimePicker/OutlinedTimePicker.types.d.ts +0 -28
- package/src/components/OutlinedTimePicker/OutlinedTimePicker.vue.d.ts +0 -94
- package/src/components/OutlinedTimePicker/index.d.ts +0 -3
- package/src/components/OutlinedTreeSelect/OutlinedTreeSelect.types.d.ts +0 -46
- package/src/components/OutlinedTreeSelect/OutlinedTreeSelect.vue.d.ts +0 -137
- package/src/components/OutlinedTreeSelect/index.d.ts +0 -3
- package/src/echarts/index.d.ts +0 -9
- package/src/excel/exportExcel.d.ts +0 -18
- package/src/index.d.ts +0 -26
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="base-search-form">
|
|
3
|
+
<el-form
|
|
4
|
+
class="base-search-form__form"
|
|
5
|
+
:model="innerModel"
|
|
6
|
+
:label-width="normalizedLabelWidth"
|
|
7
|
+
@submit.prevent="submit"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
class="base-search-form__grid"
|
|
11
|
+
:style="gridStyle"
|
|
12
|
+
>
|
|
13
|
+
<el-form-item
|
|
14
|
+
v-for="field in visibleFields"
|
|
15
|
+
:key="field.key"
|
|
16
|
+
class="base-search-form__item"
|
|
17
|
+
:label="field.label"
|
|
18
|
+
:style="getFieldStyle(field)"
|
|
19
|
+
>
|
|
20
|
+
<slot
|
|
21
|
+
v-if="field.type === 'slot'"
|
|
22
|
+
:name="field.key"
|
|
23
|
+
:field="field"
|
|
24
|
+
:model="innerModel"
|
|
25
|
+
:value="innerModel[field.key]"
|
|
26
|
+
:set-value="(value: unknown) => setFieldValue(field.key, value)"
|
|
27
|
+
/>
|
|
28
|
+
|
|
29
|
+
<el-select
|
|
30
|
+
v-else-if="field.type === 'select'"
|
|
31
|
+
class="base-search-form__control"
|
|
32
|
+
:model-value="innerModel[field.key]"
|
|
33
|
+
:placeholder="field.placeholder || field.label"
|
|
34
|
+
:clearable="field.clearable !== false"
|
|
35
|
+
:disabled="field.disabled"
|
|
36
|
+
v-bind="field.props"
|
|
37
|
+
@update:model-value="(value: unknown) => handleFieldChange(field.key, value)"
|
|
38
|
+
>
|
|
39
|
+
<el-option
|
|
40
|
+
v-for="option in field.options || []"
|
|
41
|
+
:key="String(option.value)"
|
|
42
|
+
:label="option.label"
|
|
43
|
+
:value="option.value"
|
|
44
|
+
:disabled="option.disabled"
|
|
45
|
+
/>
|
|
46
|
+
</el-select>
|
|
47
|
+
|
|
48
|
+
<el-date-picker
|
|
49
|
+
v-else-if="field.type === 'date' || field.type === 'dateRange'"
|
|
50
|
+
class="base-search-form__control"
|
|
51
|
+
:model-value="innerModel[field.key]"
|
|
52
|
+
:type="field.type === 'dateRange' ? 'daterange' : 'date'"
|
|
53
|
+
:placeholder="field.placeholder || field.label"
|
|
54
|
+
:start-placeholder="field.props?.startPlaceholder as string || '开始日期'"
|
|
55
|
+
:end-placeholder="field.props?.endPlaceholder as string || '结束日期'"
|
|
56
|
+
:clearable="field.clearable !== false"
|
|
57
|
+
:disabled="field.disabled"
|
|
58
|
+
v-bind="field.props"
|
|
59
|
+
@update:model-value="(value: unknown) => handleFieldChange(field.key, value)"
|
|
60
|
+
/>
|
|
61
|
+
|
|
62
|
+
<el-input
|
|
63
|
+
v-else
|
|
64
|
+
class="base-search-form__control"
|
|
65
|
+
:model-value="innerModel[field.key]"
|
|
66
|
+
:placeholder="field.placeholder || field.label"
|
|
67
|
+
:clearable="field.clearable !== false"
|
|
68
|
+
:disabled="field.disabled"
|
|
69
|
+
v-bind="field.props"
|
|
70
|
+
@update:model-value="(value: unknown) => handleFieldChange(field.key, value)"
|
|
71
|
+
@keyup.enter="submit"
|
|
72
|
+
/>
|
|
73
|
+
</el-form-item>
|
|
74
|
+
|
|
75
|
+
<div class="base-search-form__actions">
|
|
76
|
+
<slot
|
|
77
|
+
name="actions-before"
|
|
78
|
+
:model="innerModel"
|
|
79
|
+
/>
|
|
80
|
+
<el-button
|
|
81
|
+
type="primary"
|
|
82
|
+
@click="submit"
|
|
83
|
+
>
|
|
84
|
+
{{ submitText }}
|
|
85
|
+
</el-button>
|
|
86
|
+
<el-button @click="reset">
|
|
87
|
+
{{ resetText }}
|
|
88
|
+
</el-button>
|
|
89
|
+
<el-button
|
|
90
|
+
v-if="showCollapse && hasCollapsedFields"
|
|
91
|
+
link
|
|
92
|
+
type="primary"
|
|
93
|
+
@click="toggleCollapsed"
|
|
94
|
+
>
|
|
95
|
+
{{ isCollapsed ? expandText : collapseText }}
|
|
96
|
+
</el-button>
|
|
97
|
+
<slot
|
|
98
|
+
name="actions-after"
|
|
99
|
+
:model="innerModel"
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</el-form>
|
|
104
|
+
</div>
|
|
105
|
+
</template>
|
|
106
|
+
|
|
107
|
+
<script setup lang="ts">
|
|
108
|
+
import { computed, ref, watch } from 'vue'
|
|
109
|
+
import type {
|
|
110
|
+
BaseSearchFormExpose,
|
|
111
|
+
BaseSearchFormField,
|
|
112
|
+
BaseSearchFormModel,
|
|
113
|
+
BaseSearchFormProps
|
|
114
|
+
} from './BaseSearchForm.types'
|
|
115
|
+
import {
|
|
116
|
+
cloneSearchFormModel,
|
|
117
|
+
getVisibleSearchFields,
|
|
118
|
+
resetSearchFormModel,
|
|
119
|
+
toSearchFormCssValue
|
|
120
|
+
} from './BaseSearchForm.utils'
|
|
121
|
+
|
|
122
|
+
defineOptions({
|
|
123
|
+
name: 'BaseSearchForm'
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
const props = withDefaults(defineProps<BaseSearchFormProps>(), {
|
|
127
|
+
modelValue: () => ({}),
|
|
128
|
+
collapsed: true,
|
|
129
|
+
showCollapse: true,
|
|
130
|
+
columns: 4,
|
|
131
|
+
labelWidth: 80,
|
|
132
|
+
fieldWidth: undefined,
|
|
133
|
+
gutter: 16,
|
|
134
|
+
submitText: '查询',
|
|
135
|
+
resetText: '重置',
|
|
136
|
+
expandText: '展开',
|
|
137
|
+
collapseText: '收起'
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
const emit = defineEmits<{
|
|
141
|
+
(event: 'update:modelValue', value: BaseSearchFormModel): void
|
|
142
|
+
(event: 'search', value: BaseSearchFormModel): void
|
|
143
|
+
(event: 'reset', value: BaseSearchFormModel): void
|
|
144
|
+
(event: 'field-change', key: string, value: unknown, model: BaseSearchFormModel): void
|
|
145
|
+
}>()
|
|
146
|
+
|
|
147
|
+
const innerModel = ref<BaseSearchFormModel>(cloneSearchFormModel(props.modelValue))
|
|
148
|
+
const isCollapsed = ref(props.collapsed)
|
|
149
|
+
|
|
150
|
+
watch(
|
|
151
|
+
() => props.modelValue,
|
|
152
|
+
(value) => {
|
|
153
|
+
innerModel.value = cloneSearchFormModel(value)
|
|
154
|
+
},
|
|
155
|
+
{ deep: true }
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
watch(
|
|
159
|
+
() => props.collapsed,
|
|
160
|
+
(value) => {
|
|
161
|
+
isCollapsed.value = value
|
|
162
|
+
}
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
const visibleFields = computed(() => getVisibleSearchFields(props.fields, isCollapsed.value))
|
|
166
|
+
const hasCollapsedFields = computed(() => props.fields.some((field) => field.collapsed && !field.hidden))
|
|
167
|
+
const normalizedLabelWidth = computed(() => toSearchFormCssValue(props.labelWidth))
|
|
168
|
+
|
|
169
|
+
const gridStyle = computed(() => ({
|
|
170
|
+
gridTemplateColumns: `repeat(${Math.max(1, props.columns)}, minmax(0, 1fr))`,
|
|
171
|
+
gap: `${props.gutter}px`
|
|
172
|
+
}))
|
|
173
|
+
|
|
174
|
+
function getFieldStyle(field: BaseSearchFormField) {
|
|
175
|
+
return {
|
|
176
|
+
gridColumn: field.span ? `span ${Math.max(1, field.span)}` : undefined,
|
|
177
|
+
'--base-search-form-field-width': toSearchFormCssValue(props.fieldWidth)
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function emitModelUpdate() {
|
|
182
|
+
emit('update:modelValue', cloneSearchFormModel(innerModel.value))
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function handleFieldChange(key: string, value: unknown) {
|
|
186
|
+
setFieldValue(key, value)
|
|
187
|
+
emit('field-change', key, value, cloneSearchFormModel(innerModel.value))
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function setFieldValue(key: string, value: unknown) {
|
|
191
|
+
innerModel.value = {
|
|
192
|
+
...innerModel.value,
|
|
193
|
+
[key]: value
|
|
194
|
+
}
|
|
195
|
+
emitModelUpdate()
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function submit() {
|
|
199
|
+
emit('search', cloneSearchFormModel(innerModel.value))
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function reset() {
|
|
203
|
+
innerModel.value = resetSearchFormModel(props.fields)
|
|
204
|
+
emitModelUpdate()
|
|
205
|
+
emit('reset', cloneSearchFormModel(innerModel.value))
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function toggleCollapsed() {
|
|
209
|
+
isCollapsed.value = !isCollapsed.value
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function getModel() {
|
|
213
|
+
return cloneSearchFormModel(innerModel.value)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
defineExpose<BaseSearchFormExpose>({
|
|
217
|
+
submit,
|
|
218
|
+
reset,
|
|
219
|
+
setFieldValue,
|
|
220
|
+
getModel
|
|
221
|
+
})
|
|
222
|
+
</script>
|
|
223
|
+
|
|
224
|
+
<style scoped>
|
|
225
|
+
.base-search-form {
|
|
226
|
+
width: 100%;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.base-search-form__grid {
|
|
230
|
+
display: grid;
|
|
231
|
+
align-items: start;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.base-search-form__item {
|
|
235
|
+
min-width: 0;
|
|
236
|
+
margin-bottom: 0;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.base-search-form__control {
|
|
240
|
+
width: var(--base-search-form-field-width, 100%);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.base-search-form__actions {
|
|
244
|
+
display: flex;
|
|
245
|
+
align-items: center;
|
|
246
|
+
justify-content: flex-end;
|
|
247
|
+
gap: 8px;
|
|
248
|
+
min-width: 0;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
@media (max-width: 960px) {
|
|
252
|
+
.base-search-form__grid {
|
|
253
|
+
grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
@media (max-width: 640px) {
|
|
258
|
+
.base-search-form__grid {
|
|
259
|
+
grid-template-columns: minmax(0, 1fr) !important;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.base-search-form__actions {
|
|
263
|
+
justify-content: flex-start;
|
|
264
|
+
flex-wrap: wrap;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
</style>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# BaseSearchForm
|
|
2
|
+
|
|
3
|
+
`BaseSearchForm` 用于统一列表页查询区,内置输入框、下拉框、日期和日期范围字段,以及查询、重置、展开/收起操作。
|
|
4
|
+
|
|
5
|
+
## 基础用法
|
|
6
|
+
|
|
7
|
+
```vue
|
|
8
|
+
<template>
|
|
9
|
+
<BaseSearchForm
|
|
10
|
+
v-model="query"
|
|
11
|
+
:fields="fields"
|
|
12
|
+
@search="loadList"
|
|
13
|
+
@reset="loadList"
|
|
14
|
+
/>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
import { reactive } from 'vue'
|
|
19
|
+
import { BaseSearchForm, type BaseSearchFormField } from '@hbdlzy/ui-core'
|
|
20
|
+
|
|
21
|
+
const query = reactive({})
|
|
22
|
+
const fields: BaseSearchFormField[] = [
|
|
23
|
+
{ key: 'keyword', label: '名称', type: 'input' },
|
|
24
|
+
{
|
|
25
|
+
key: 'status',
|
|
26
|
+
label: '状态',
|
|
27
|
+
type: 'select',
|
|
28
|
+
options: [
|
|
29
|
+
{ label: '启用', value: 'enabled' },
|
|
30
|
+
{ label: '停用', value: 'disabled' }
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{ key: 'createdAt', label: '创建日期', type: 'dateRange', collapsed: true }
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
function loadList(value: Record<string, unknown>) {
|
|
37
|
+
console.log(value)
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Props
|
|
43
|
+
|
|
44
|
+
- `modelValue`: 查询模型
|
|
45
|
+
- `fields`: 字段配置
|
|
46
|
+
- `collapsed`: 是否默认收起带 `collapsed` 标记的字段
|
|
47
|
+
- `showCollapse`: 是否显示展开/收起按钮
|
|
48
|
+
- `columns`: 每行列数
|
|
49
|
+
- `labelWidth`: 表单 label 宽度
|
|
50
|
+
- `fieldWidth`: 控件宽度
|
|
51
|
+
- `gutter`: 栅格间距
|
|
52
|
+
- `submitText`: 查询按钮文案
|
|
53
|
+
- `resetText`: 重置按钮文案
|
|
54
|
+
|
|
55
|
+
## Events
|
|
56
|
+
|
|
57
|
+
- `update:modelValue`: 字段值变更
|
|
58
|
+
- `search`: 点击查询或输入框回车
|
|
59
|
+
- `reset`: 点击重置
|
|
60
|
+
- `field-change`: 单个字段变更
|
|
61
|
+
|
|
62
|
+
## Slots
|
|
63
|
+
|
|
64
|
+
- `[field.key]`: 字段 `type` 为 `slot` 时的自定义字段内容
|
|
65
|
+
- `actions-before`: 操作按钮前扩展
|
|
66
|
+
- `actions-after`: 操作按钮后扩展
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import BaseSearchForm from './BaseSearchForm.vue'
|
|
2
|
+
|
|
3
|
+
export default BaseSearchForm
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
cloneSearchFormModel,
|
|
7
|
+
getVisibleSearchFields,
|
|
8
|
+
resetSearchFormModel,
|
|
9
|
+
toSearchFormCssValue
|
|
10
|
+
} from './BaseSearchForm.utils'
|
|
11
|
+
export type {
|
|
12
|
+
BaseSearchFormCssValue,
|
|
13
|
+
BaseSearchFormExpose,
|
|
14
|
+
BaseSearchFormField,
|
|
15
|
+
BaseSearchFormFieldType,
|
|
16
|
+
BaseSearchFormModel,
|
|
17
|
+
BaseSearchFormOption,
|
|
18
|
+
BaseSearchFormOptionValue,
|
|
19
|
+
BaseSearchFormProps
|
|
20
|
+
} from './BaseSearchForm.types'
|
|
@@ -105,7 +105,7 @@ export interface BaseTableNormalizedResult<Row = Record<string, any>> {
|
|
|
105
105
|
|
|
106
106
|
export type BaseTableRequestHandler<Row = Record<string, any>> = (
|
|
107
107
|
params: BaseTableRequestParams
|
|
108
|
-
) => Promise<BaseTableRequestResult<Row> | Row[]>
|
|
108
|
+
) => Promise<BaseTableRequestResult<Row> | Row[] | unknown>
|
|
109
109
|
|
|
110
110
|
export type BaseTableResultAdapter<Row = Record<string, any>> = (
|
|
111
111
|
result: unknown,
|
package/src/index.ts
CHANGED
|
@@ -9,6 +9,10 @@ export type {
|
|
|
9
9
|
} from './echarts'
|
|
10
10
|
export { default as BaseCard } from './components/BaseCard'
|
|
11
11
|
export * from './components/BaseCard'
|
|
12
|
+
export { default as BaseSearchForm } from './components/BaseSearchForm'
|
|
13
|
+
export * from './components/BaseSearchForm'
|
|
14
|
+
export { default as BaseDialog } from './components/BaseDialog'
|
|
15
|
+
export * from './components/BaseDialog'
|
|
12
16
|
export { default as BaseTable } from './components/BaseTable'
|
|
13
17
|
export * from './components/BaseTable'
|
|
14
18
|
export { default as BaseEChart } from './components/BaseEChart'
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export type BaseCardCssValue = string | number;
|
|
2
|
-
export interface BaseCardDefaultExportPayload {
|
|
3
|
-
title?: string;
|
|
4
|
-
metaText?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface BaseCardProps {
|
|
7
|
-
title?: string;
|
|
8
|
-
metaText?: string;
|
|
9
|
-
showHeader?: boolean;
|
|
10
|
-
showRight?: boolean;
|
|
11
|
-
showTitleMarker?: boolean;
|
|
12
|
-
showExport?: boolean;
|
|
13
|
-
exportText?: string;
|
|
14
|
-
exportDisabled?: boolean;
|
|
15
|
-
exportPayload?: unknown;
|
|
16
|
-
padding?: BaseCardCssValue;
|
|
17
|
-
radius?: BaseCardCssValue;
|
|
18
|
-
borderColor?: string;
|
|
19
|
-
backgroundColor?: string;
|
|
20
|
-
shadowColor?: string;
|
|
21
|
-
headerGap?: BaseCardCssValue;
|
|
22
|
-
headerMarginBottom?: BaseCardCssValue;
|
|
23
|
-
leftGap?: BaseCardCssValue;
|
|
24
|
-
rightGap?: BaseCardCssValue;
|
|
25
|
-
titleColor?: string;
|
|
26
|
-
titleSize?: BaseCardCssValue;
|
|
27
|
-
titleWeight?: string | number;
|
|
28
|
-
markerColor?: string;
|
|
29
|
-
markerWidth?: BaseCardCssValue;
|
|
30
|
-
markerHeight?: BaseCardCssValue;
|
|
31
|
-
markerRadius?: BaseCardCssValue;
|
|
32
|
-
markerGap?: BaseCardCssValue;
|
|
33
|
-
metaColor?: string;
|
|
34
|
-
metaSize?: BaseCardCssValue;
|
|
35
|
-
exportColor?: string;
|
|
36
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import type { BaseCardCssValue, BaseCardProps } from './BaseCard.types';
|
|
2
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<BaseCardProps>, {
|
|
3
|
-
title: string;
|
|
4
|
-
metaText: string;
|
|
5
|
-
showHeader: boolean;
|
|
6
|
-
showRight: boolean;
|
|
7
|
-
showTitleMarker: boolean;
|
|
8
|
-
showExport: boolean;
|
|
9
|
-
exportText: string;
|
|
10
|
-
exportDisabled: boolean;
|
|
11
|
-
padding: number;
|
|
12
|
-
radius: number;
|
|
13
|
-
borderColor: string;
|
|
14
|
-
backgroundColor: string;
|
|
15
|
-
shadowColor: string;
|
|
16
|
-
headerGap: number;
|
|
17
|
-
headerMarginBottom: number;
|
|
18
|
-
leftGap: number;
|
|
19
|
-
rightGap: number;
|
|
20
|
-
titleColor: string;
|
|
21
|
-
titleSize: number;
|
|
22
|
-
titleWeight: number;
|
|
23
|
-
markerColor: string;
|
|
24
|
-
markerWidth: number;
|
|
25
|
-
markerHeight: number;
|
|
26
|
-
markerRadius: string;
|
|
27
|
-
markerGap: number;
|
|
28
|
-
metaColor: string;
|
|
29
|
-
metaSize: number;
|
|
30
|
-
exportColor: string;
|
|
31
|
-
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
32
|
-
export: (payload?: unknown) => void;
|
|
33
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<BaseCardProps>, {
|
|
34
|
-
title: string;
|
|
35
|
-
metaText: string;
|
|
36
|
-
showHeader: boolean;
|
|
37
|
-
showRight: boolean;
|
|
38
|
-
showTitleMarker: boolean;
|
|
39
|
-
showExport: boolean;
|
|
40
|
-
exportText: string;
|
|
41
|
-
exportDisabled: boolean;
|
|
42
|
-
padding: number;
|
|
43
|
-
radius: number;
|
|
44
|
-
borderColor: string;
|
|
45
|
-
backgroundColor: string;
|
|
46
|
-
shadowColor: string;
|
|
47
|
-
headerGap: number;
|
|
48
|
-
headerMarginBottom: number;
|
|
49
|
-
leftGap: number;
|
|
50
|
-
rightGap: number;
|
|
51
|
-
titleColor: string;
|
|
52
|
-
titleSize: number;
|
|
53
|
-
titleWeight: number;
|
|
54
|
-
markerColor: string;
|
|
55
|
-
markerWidth: number;
|
|
56
|
-
markerHeight: number;
|
|
57
|
-
markerRadius: string;
|
|
58
|
-
markerGap: number;
|
|
59
|
-
metaColor: string;
|
|
60
|
-
metaSize: number;
|
|
61
|
-
exportColor: string;
|
|
62
|
-
}>>> & Readonly<{
|
|
63
|
-
onExport?: ((payload?: unknown) => any) | undefined;
|
|
64
|
-
}>, {
|
|
65
|
-
title: string;
|
|
66
|
-
metaText: string;
|
|
67
|
-
showHeader: boolean;
|
|
68
|
-
showRight: boolean;
|
|
69
|
-
showTitleMarker: boolean;
|
|
70
|
-
showExport: boolean;
|
|
71
|
-
exportText: string;
|
|
72
|
-
exportDisabled: boolean;
|
|
73
|
-
padding: BaseCardCssValue;
|
|
74
|
-
radius: BaseCardCssValue;
|
|
75
|
-
borderColor: string;
|
|
76
|
-
backgroundColor: string;
|
|
77
|
-
shadowColor: string;
|
|
78
|
-
headerGap: BaseCardCssValue;
|
|
79
|
-
headerMarginBottom: BaseCardCssValue;
|
|
80
|
-
leftGap: BaseCardCssValue;
|
|
81
|
-
rightGap: BaseCardCssValue;
|
|
82
|
-
titleColor: string;
|
|
83
|
-
titleSize: BaseCardCssValue;
|
|
84
|
-
titleWeight: string | number;
|
|
85
|
-
markerColor: string;
|
|
86
|
-
markerWidth: BaseCardCssValue;
|
|
87
|
-
markerHeight: BaseCardCssValue;
|
|
88
|
-
markerRadius: BaseCardCssValue;
|
|
89
|
-
markerGap: BaseCardCssValue;
|
|
90
|
-
metaColor: string;
|
|
91
|
-
metaSize: BaseCardCssValue;
|
|
92
|
-
exportColor: string;
|
|
93
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
|
|
94
|
-
"title-label"?(_: {}): any;
|
|
95
|
-
title?(_: {}): any;
|
|
96
|
-
"header-right"?(_: {}): any;
|
|
97
|
-
tip?(_: {}): any;
|
|
98
|
-
default?(_: {}): any;
|
|
99
|
-
}>;
|
|
100
|
-
export default _default;
|
|
101
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
102
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
103
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
104
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
105
|
-
} : {
|
|
106
|
-
type: import('vue').PropType<T[K]>;
|
|
107
|
-
required: true;
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
type __VLS_WithDefaults<P, D> = {
|
|
111
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
112
|
-
default: D[K];
|
|
113
|
-
}> : P[K];
|
|
114
|
-
};
|
|
115
|
-
type __VLS_Prettify<T> = {
|
|
116
|
-
[K in keyof T]: T[K];
|
|
117
|
-
} & {};
|
|
118
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
119
|
-
new (): {
|
|
120
|
-
$slots: S;
|
|
121
|
-
};
|
|
122
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { EChartInitOptions, EChartInstance, EChartLoadingOptions, EChartOption, EChartResizeOptions, EChartSetOptionOptions } from '../../echarts';
|
|
2
|
-
export interface BaseEChartProps {
|
|
3
|
-
option?: EChartOption;
|
|
4
|
-
theme?: string | Record<string, unknown>;
|
|
5
|
-
initOptions?: EChartInitOptions;
|
|
6
|
-
setOptionOptions?: boolean | EChartSetOptionOptions;
|
|
7
|
-
loading?: boolean;
|
|
8
|
-
loadingOptions?: EChartLoadingOptions;
|
|
9
|
-
autoResize?: boolean;
|
|
10
|
-
useDefaultColors?: boolean;
|
|
11
|
-
colorStorageKey?: string;
|
|
12
|
-
defaultColors?: string[];
|
|
13
|
-
group?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface BaseEChartExpose {
|
|
16
|
-
getInstance: () => EChartInstance | null;
|
|
17
|
-
setOption: (option: EChartOption, setOptionOptions?: boolean | EChartSetOptionOptions) => EChartInstance | null;
|
|
18
|
-
resize: (resizeOptions?: EChartResizeOptions) => void;
|
|
19
|
-
dispatchAction: (payload: Record<string, unknown>) => void;
|
|
20
|
-
showLoading: (type?: string, loadingOptions?: EChartLoadingOptions) => void;
|
|
21
|
-
hideLoading: () => void;
|
|
22
|
-
clear: () => void;
|
|
23
|
-
dispose: () => void;
|
|
24
|
-
on: (eventName: string, handler: (...args: any[]) => void, context?: unknown) => void;
|
|
25
|
-
off: (eventName?: string, handler?: (...args: any[]) => void) => void;
|
|
26
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { echarts } from '../../echarts';
|
|
2
|
-
import type { BaseEChartProps } from './BaseEChart.types';
|
|
3
|
-
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<BaseEChartProps>, {
|
|
4
|
-
option: () => {};
|
|
5
|
-
initOptions: () => echarts.EChartsInitOpts;
|
|
6
|
-
setOptionOptions: () => echarts.SetOptionOpts;
|
|
7
|
-
loading: boolean;
|
|
8
|
-
autoResize: boolean;
|
|
9
|
-
useDefaultColors: boolean;
|
|
10
|
-
colorStorageKey: string;
|
|
11
|
-
defaultColors: () => never[];
|
|
12
|
-
group: undefined;
|
|
13
|
-
}>>, {
|
|
14
|
-
getInstance: () => echarts.ECharts | null;
|
|
15
|
-
setOption: (option: echarts.EChartsOption, setOptionOptions?: boolean | echarts.SetOptionOpts | undefined) => echarts.ECharts | null;
|
|
16
|
-
resize: (resizeOptions?: echarts.ResizeOpts | undefined) => void;
|
|
17
|
-
dispatchAction: (payload: Record<string, unknown>) => void;
|
|
18
|
-
showLoading: (type?: string | undefined, loadingOptions?: object | undefined) => void;
|
|
19
|
-
hideLoading: () => void;
|
|
20
|
-
clear: () => void;
|
|
21
|
-
dispose: () => void;
|
|
22
|
-
on: (eventName: string, handler: (...args: any[]) => void, context?: unknown) => void;
|
|
23
|
-
off: (eventName?: string | undefined, handler?: ((...args: any[]) => void) | undefined) => void;
|
|
24
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
|
-
ready: (chart: echarts.ECharts) => void;
|
|
26
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<BaseEChartProps>, {
|
|
27
|
-
option: () => {};
|
|
28
|
-
initOptions: () => echarts.EChartsInitOpts;
|
|
29
|
-
setOptionOptions: () => echarts.SetOptionOpts;
|
|
30
|
-
loading: boolean;
|
|
31
|
-
autoResize: boolean;
|
|
32
|
-
useDefaultColors: boolean;
|
|
33
|
-
colorStorageKey: string;
|
|
34
|
-
defaultColors: () => never[];
|
|
35
|
-
group: undefined;
|
|
36
|
-
}>>> & Readonly<{
|
|
37
|
-
onReady?: ((chart: echarts.ECharts) => any) | undefined;
|
|
38
|
-
}>, {
|
|
39
|
-
option: echarts.EChartsOption;
|
|
40
|
-
loading: boolean;
|
|
41
|
-
initOptions: echarts.EChartsInitOpts;
|
|
42
|
-
setOptionOptions: boolean | echarts.SetOptionOpts;
|
|
43
|
-
autoResize: boolean;
|
|
44
|
-
useDefaultColors: boolean;
|
|
45
|
-
colorStorageKey: string;
|
|
46
|
-
defaultColors: string[];
|
|
47
|
-
group: string;
|
|
48
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
49
|
-
export default _default;
|
|
50
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
51
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
52
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
53
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
54
|
-
} : {
|
|
55
|
-
type: import('vue').PropType<T[K]>;
|
|
56
|
-
required: true;
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
type __VLS_WithDefaults<P, D> = {
|
|
60
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
61
|
-
default: D[K];
|
|
62
|
-
}> : P[K];
|
|
63
|
-
};
|
|
64
|
-
type __VLS_Prettify<T> = {
|
|
65
|
-
[K in keyof T]: T[K];
|
|
66
|
-
} & {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ExcelExportOptions } from '../../excel/exportExcel';
|
|
2
|
-
export interface ExportResponseHeaders {
|
|
3
|
-
[key: string]: string | undefined;
|
|
4
|
-
}
|
|
5
|
-
export interface ExportResponseLike {
|
|
6
|
-
data: Blob | BlobPart | ArrayBuffer;
|
|
7
|
-
headers?: ExportResponseHeaders;
|
|
8
|
-
}
|
|
9
|
-
export type ExportRequestHandler = () => Promise<ExportResponseLike>;
|
|
10
|
-
export type ExportMode = 'excel' | 'request' | 'none' | 'invalid';
|
|
11
|
-
export type ExportBeforeHandler = () => boolean | void | Promise<boolean | void>;
|
|
12
|
-
export interface ExportSuccessPayload {
|
|
13
|
-
mode: Exclude<ExportMode, 'none' | 'invalid'>;
|
|
14
|
-
fileName?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface BaseExportExcelConfig<Row = Record<string, any>> {
|
|
17
|
-
excelOptions: ExcelExportOptions<Row>;
|
|
18
|
-
}
|
|
19
|
-
export interface BaseExportRequestConfig {
|
|
20
|
-
requestHandler: ExportRequestHandler;
|
|
21
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ExportResponseLike } from './BaseExportButton.types';
|
|
2
|
-
export declare function extractFileNameFromDisposition(contentDisposition?: string): string;
|
|
3
|
-
export declare function normalizeExportFileName(fileName?: string): string;
|
|
4
|
-
export declare function downloadExportResponse(response: ExportResponseLike, fallbackFileName?: string): string;
|