flame-plus 0.1.33 → 0.1.36
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/flameDist/flame-plus.es.js +4 -4
- package/flameDist/flame-plus.es.js.map +1 -1
- package/flameDist/flame-plus.umd.js +1 -1
- package/flameDist/flame-plus.umd.js.map +1 -1
- package/flameDist/style.css +1 -1
- package/package.json +2 -2
- package/.vscode/extensions.json +0 -3
- package/index.html +0 -13
- package/pnpm-lock.yaml +0 -2107
- package/src/App.vue +0 -10
- package/src/assets/vue.svg +0 -1
- package/src/components/HelloWorld.vue +0 -33
- package/src/main.ts +0 -19
- package/src/packages/components/base/flmButton/flmButton.vue +0 -29
- package/src/packages/components/base/flmCascader/flmCascader.vue +0 -39
- package/src/packages/components/base/flmCheckbox/flmCheckbox.vue +0 -34
- package/src/packages/components/base/flmCheckbox/flmCheckboxGroup.vue +0 -71
- package/src/packages/components/base/flmColorPicker/flmColorPicker.vue +0 -34
- package/src/packages/components/base/flmDatePicker/flmDatePicker.vue +0 -47
- package/src/packages/components/base/flmDialog/flmDialog.vue +0 -39
- package/src/packages/components/base/flmInput/flmInput.vue +0 -38
- package/src/packages/components/base/flmInputNumber/flmInputNumber.vue +0 -36
- package/src/packages/components/base/flmPagination/flmPagination.vue +0 -37
- package/src/packages/components/base/flmRadio/flmRadio.vue +0 -64
- package/src/packages/components/base/flmRate/flmRate.vue +0 -34
- package/src/packages/components/base/flmRead/flmRead.vue +0 -18
- package/src/packages/components/base/flmSelect/flmSelect.vue +0 -74
- package/src/packages/components/base/flmSlider/flmSlider.vue +0 -35
- package/src/packages/components/base/flmSwitch/flmSwitch.vue +0 -29
- package/src/packages/components/base/flmTimePicker/flmTimePicker.vue +0 -37
- package/src/packages/components/base/flmTimeSelect/flmTimeSelect.vue +0 -36
- package/src/packages/components/base/flmTransfer/flmTransfer.vue +0 -42
- package/src/packages/components/complex/flmForm/flmForm.vue +0 -243
- package/src/packages/components/complex/flmSearch/flmSearch.vue +0 -145
- package/src/packages/components/complex/flmTable/flmTable.vue +0 -106
- package/src/packages/components/complex/flmToolbar/flmToolbar.vue +0 -55
- package/src/packages/components/index.ts +0 -30
- package/src/packages/components/page/flmExportPage/flmExportPage.vue +0 -219
- package/src/packages/components/page/flmReportPage/flmReportPage.vue +0 -496
- package/src/packages/index.ts +0 -96
- package/src/packages/utils/filterConfig.ts +0 -39
- package/src/packages/utils/index.ts +0 -2
- package/src/packages/utils/isValidKey.ts +0 -13
- package/src/shims-vue.d.ts +0 -9
- package/tsconfig.json +0 -39
- package/vite.config.js +0 -37
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="flm-toolbar">
|
|
3
|
-
<flm-button
|
|
4
|
-
v-for="buttonConfig in buttonGroup"
|
|
5
|
-
:config="{ ...config.publicConfig, ...buttonConfig }"
|
|
6
|
-
:key="buttonConfig.event"
|
|
7
|
-
@click="toolbarClick(buttonConfig.event)"
|
|
8
|
-
/>
|
|
9
|
-
<el-dropdown
|
|
10
|
-
v-if="props.config.buttons.length > maxButton"
|
|
11
|
-
style="margin-left: 12px;"
|
|
12
|
-
trigger="click"
|
|
13
|
-
@command="toolbarClick"
|
|
14
|
-
>
|
|
15
|
-
<flm-button :config="{ ...config.publicConfig, buttonText: '更多' }" />
|
|
16
|
-
<template #dropdown>
|
|
17
|
-
<el-dropdown-menu>
|
|
18
|
-
<el-dropdown-item
|
|
19
|
-
v-for="buttonConfig in dropdown"
|
|
20
|
-
:config="buttonConfig"
|
|
21
|
-
:key="buttonConfig.event"
|
|
22
|
-
:command="buttonConfig.event"
|
|
23
|
-
>{{ buttonConfig.buttonText }}</el-dropdown-item>
|
|
24
|
-
</el-dropdown-menu>
|
|
25
|
-
</template>
|
|
26
|
-
</el-dropdown>
|
|
27
|
-
</div>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
<script lang="ts" setup>
|
|
31
|
-
import { PropType, computed, ComputedRef } from 'vue'
|
|
32
|
-
import { flmButton } from '../../index'
|
|
33
|
-
import { ToolbarConfig, ToolbarButtonConfig } from 'flame-types'
|
|
34
|
-
|
|
35
|
-
const emit = defineEmits(['toolbarClick'])
|
|
36
|
-
const props = defineProps({
|
|
37
|
-
config: {
|
|
38
|
-
type: Object as PropType<ToolbarConfig>,
|
|
39
|
-
default(): ToolbarConfig {
|
|
40
|
-
return {
|
|
41
|
-
publicConfig: {},
|
|
42
|
-
maxButton: 3,
|
|
43
|
-
buttons: []
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
const maxButton = props.config.maxButton
|
|
50
|
-
const buttonGroup: ComputedRef<Array<ToolbarButtonConfig>> = computed(() => props.config.buttons.slice(0, maxButton))
|
|
51
|
-
const dropdown: ComputedRef<Array<ToolbarButtonConfig>> = computed(() => props.config.buttons.slice(maxButton))
|
|
52
|
-
|
|
53
|
-
// 工具栏
|
|
54
|
-
const toolbarClick = (event: string) => emit('toolbarClick', event)
|
|
55
|
-
</script>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// 基础组件
|
|
2
|
-
export { default as flmButton } from './base/flmButton/flmButton.vue' // 按钮
|
|
3
|
-
export { default as flmCascader } from './base/flmCascader/flmCascader.vue' // 级联选择器
|
|
4
|
-
export { default as flmCheckbox } from './base/flmCheckbox/flmCheckbox.vue' // 多选框
|
|
5
|
-
export { default as flmCheckboxGroup } from './base/flmCheckbox/flmCheckboxGroup.vue' // 多选框组
|
|
6
|
-
export { default as flmColorPicker } from './base/flmColorPicker/flmColorPicker.vue' // 取色器
|
|
7
|
-
export { default as flmDatePicker } from './base/flmDatePicker/flmDatePicker.vue' // 日期选择器
|
|
8
|
-
export { default as flmInput } from './base/flmInput/flmInput.vue' // 输入框
|
|
9
|
-
export { default as flmInputNumber } from './base/flmInputNumber/flmInputNumber.vue' // 数字输入框
|
|
10
|
-
export { default as flmPagination } from './base/flmPagination/flmPagination.vue' // 分页器
|
|
11
|
-
export { default as flmRadio } from './base/flmRadio/flmRadio.vue' // 单选框
|
|
12
|
-
export { default as flmRate } from './base/flmRate/flmRate.vue' // 评分
|
|
13
|
-
export { default as flmRead } from './base/flmRead/flmRead.vue' // 查看
|
|
14
|
-
export { default as flmSelect } from './base/flmSelect/flmSelect.vue' // 选择器
|
|
15
|
-
export { default as flmSlider } from './base/flmSlider/flmSlider.vue' // 滑块
|
|
16
|
-
export { default as flmSwitch } from './base/flmSwitch/flmSwitch.vue' // 开关
|
|
17
|
-
export { default as flmTimePicker } from './base/flmTimePicker/flmTimePicker.vue' // 时间选择器
|
|
18
|
-
export { default as flmTimeSelect } from './base/flmTimeSelect/flmTimeSelect.vue' // 时间选择
|
|
19
|
-
export { default as flmTransfer } from './base/flmTransfer/flmTransfer.vue' // 穿梭框
|
|
20
|
-
export { default as flmDialog } from './base/flmDialog/flmDialog.vue' // 弹窗
|
|
21
|
-
|
|
22
|
-
// 复合组件
|
|
23
|
-
export { default as flmForm } from './complex/flmForm/flmForm.vue' // 表单
|
|
24
|
-
export { default as flmTable } from './complex/flmTable/flmTable.vue' // 表格
|
|
25
|
-
export { default as flmToolbar } from './complex/flmToolbar/flmToolbar.vue' // 操作栏
|
|
26
|
-
export { default as flmSearch } from './complex/flmSearch/flmSearch.vue' // 搜索
|
|
27
|
-
|
|
28
|
-
// 页面组件
|
|
29
|
-
export { default as flmReportPage } from './page/flmReportPage/flmReportPage.vue' // 报表页面
|
|
30
|
-
export { default as flmExportPage } from './page/flmExportPage/flmExportPage.vue' // 导出页面
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="export-page" ref="exportPageRef">
|
|
3
|
-
<template v-if="isLoaded">
|
|
4
|
-
<div class="page-search">
|
|
5
|
-
<slot></slot>
|
|
6
|
-
</div>
|
|
7
|
-
<flmToolbar class="page-toolbar" :config="toolbarConfig" @toolbarClick="toolbarClick" />
|
|
8
|
-
<flmTable class="page-table" :config="exportPageConfig.table">
|
|
9
|
-
<template v-for="tableSlot in getTableSlots" #[tableSlot]="{ index, row, column }">
|
|
10
|
-
<slot :name="`table-${tableSlot}`" :index="index" :row="row" :column="column"></slot>
|
|
11
|
-
</template>
|
|
12
|
-
</flmTable>
|
|
13
|
-
<flmPagination
|
|
14
|
-
class="page-pagination"
|
|
15
|
-
:config="exportPageConfig.pagination"
|
|
16
|
-
@size-change="paginationEvent.sizeChange"
|
|
17
|
-
@current-change="paginationEvent.currentChange"
|
|
18
|
-
/>
|
|
19
|
-
</template>
|
|
20
|
-
</div>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<script lang="ts" setup>
|
|
24
|
-
import { PropType, ref, Ref, reactive, computed, onMounted } from 'vue'
|
|
25
|
-
import { ElMessage } from 'element-plus'
|
|
26
|
-
import { flmToolbar, flmTable, flmPagination } from '../../index'
|
|
27
|
-
import {
|
|
28
|
-
ButtonType,
|
|
29
|
-
ToolbarConfig,
|
|
30
|
-
FormConfig,
|
|
31
|
-
TableColumnConfig,
|
|
32
|
-
ExportPageSetting
|
|
33
|
-
} from 'flame-types'
|
|
34
|
-
import { isValidKey } from '../../../utils'
|
|
35
|
-
|
|
36
|
-
const props = defineProps({
|
|
37
|
-
// 表名
|
|
38
|
-
tableName: {
|
|
39
|
-
type: String,
|
|
40
|
-
required: true
|
|
41
|
-
},
|
|
42
|
-
// 请求方式
|
|
43
|
-
request: {
|
|
44
|
-
type: Object as PropType<any>,
|
|
45
|
-
required: true
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
const emit = defineEmits(['customEvent'])
|
|
50
|
-
const exportPageRef = ref()
|
|
51
|
-
|
|
52
|
-
const safeTableName = computed(() => props.tableName.replace(/_/g, ''))
|
|
53
|
-
|
|
54
|
-
let isLoaded: Ref<boolean> = ref(false)
|
|
55
|
-
let exportPageConfig: Ref<ExportPageSetting> = ref({
|
|
56
|
-
table: {},
|
|
57
|
-
pagination: {},
|
|
58
|
-
})
|
|
59
|
-
const searchParams: FormConfig['model'] = ref({}) // 搜索条件
|
|
60
|
-
|
|
61
|
-
onMounted(() => {
|
|
62
|
-
queryPageSetting()
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
// 表格高度
|
|
66
|
-
const tableHeight = () => {
|
|
67
|
-
const homeHeight = '100vh',
|
|
68
|
-
headerHight = '50px', // 页眉高度
|
|
69
|
-
mainSpacing = '30px', // 主体内容边距
|
|
70
|
-
pageSearch = '50px', // 搜索栏高度
|
|
71
|
-
pageFooter = '50px', // 分页高度
|
|
72
|
-
pageSpacing = '40px' // 页面边距
|
|
73
|
-
return `calc(${homeHeight} - ${headerHight} - ${mainSpacing} - ${pageSearch} - ${pageFooter} - ${pageSpacing})`
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// 查询页面配置
|
|
77
|
-
const queryPageSetting = () => {
|
|
78
|
-
props.request.flameprops.request({
|
|
79
|
-
tableName: 'flametableinfo',
|
|
80
|
-
flameMethod: 'webgetpagesetting',
|
|
81
|
-
data: { table_name: props.tableName, menu_id: null }
|
|
82
|
-
})
|
|
83
|
-
.then(({ items }: any) => {
|
|
84
|
-
const exportPageSetting: ExportPageSetting = items
|
|
85
|
-
exportPageSetting.table['height'] = tableHeight()
|
|
86
|
-
exportPageSetting.table['max-height'] = tableHeight()
|
|
87
|
-
exportPageConfig.value = exportPageSetting
|
|
88
|
-
queryPageData()
|
|
89
|
-
})
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// 查询页面数据
|
|
93
|
-
const queryPageData = () => {
|
|
94
|
-
const {
|
|
95
|
-
['current-page']: page_no = 1,
|
|
96
|
-
['page-size']: page_size = 20,
|
|
97
|
-
}: ExportPageSetting['pagination'] = exportPageConfig.value.pagination
|
|
98
|
-
props.request.flameApi.pageSearch({
|
|
99
|
-
tableName: safeTableName.value,
|
|
100
|
-
data: {
|
|
101
|
-
page_no,
|
|
102
|
-
page_size,
|
|
103
|
-
conditions: searchParams.value,
|
|
104
|
-
ref_level: 1,
|
|
105
|
-
order_by: "flame_id DESC"
|
|
106
|
-
}
|
|
107
|
-
})
|
|
108
|
-
.then(({ items, total }: any) => {
|
|
109
|
-
exportPageConfig.value.table.data = items
|
|
110
|
-
exportPageConfig.value.pagination['total'] = total
|
|
111
|
-
isLoaded.value = true
|
|
112
|
-
})
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// 页面刷新
|
|
116
|
-
const pageRefresh = () => {
|
|
117
|
-
exportPageConfig.value.pagination['current-page'] = 1
|
|
118
|
-
queryPageData()
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// 搜索栏提交
|
|
122
|
-
const searchSubmit = (event: object) => {
|
|
123
|
-
searchParams.value = event
|
|
124
|
-
pageRefresh()
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// 工具栏配置
|
|
128
|
-
const toolbarConfig: ToolbarConfig = reactive({
|
|
129
|
-
buttons: [{
|
|
130
|
-
type: ButtonType['success'],
|
|
131
|
-
plain: true,
|
|
132
|
-
buttonText: '导出',
|
|
133
|
-
event: 'pageExport'
|
|
134
|
-
}],
|
|
135
|
-
maxButton: 3,
|
|
136
|
-
publicConfig: {}
|
|
137
|
-
})
|
|
138
|
-
// 工具栏点击
|
|
139
|
-
const toolbarClick = (event: string) => {
|
|
140
|
-
isValidKey(event, pageDefaultEvent)
|
|
141
|
-
? pageDefaultEvent[event]()
|
|
142
|
-
: emit('customEvent', event)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// 分页器操作
|
|
146
|
-
const paginationEvent: Record<string, (event?: any) => void> = {
|
|
147
|
-
// 每页数量变化
|
|
148
|
-
sizeChange:(pageSize: number) => {
|
|
149
|
-
exportPageConfig.value.pagination['current-page'] = 1
|
|
150
|
-
exportPageConfig.value.pagination['page-size'] = pageSize
|
|
151
|
-
queryPageData()
|
|
152
|
-
},
|
|
153
|
-
// 当前页变化
|
|
154
|
-
currentChange:(current: number) => {
|
|
155
|
-
exportPageConfig.value.pagination['current-page'] = current
|
|
156
|
-
queryPageData()
|
|
157
|
-
},
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// 页面默认操作
|
|
161
|
-
const pageDefaultEvent: Record<string, (event?: any) => void> = {
|
|
162
|
-
// 页面导出
|
|
163
|
-
pageExport:() => {
|
|
164
|
-
props.request.flameApi.exportFile({
|
|
165
|
-
tableName: safeTableName.value,
|
|
166
|
-
data: {
|
|
167
|
-
conditions: searchParams.value,
|
|
168
|
-
ref_level: 1,
|
|
169
|
-
order_by: 'flame_id DESC'
|
|
170
|
-
}
|
|
171
|
-
})
|
|
172
|
-
.then(({ items }: any) => {
|
|
173
|
-
window.open(items.download_url)
|
|
174
|
-
ElMessage.success('导出成功')
|
|
175
|
-
})
|
|
176
|
-
},
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
defineExpose({ searchSubmit, pageRefresh })
|
|
180
|
-
|
|
181
|
-
// 表格插槽
|
|
182
|
-
const getTableSlots = computed((): Array<string> => {
|
|
183
|
-
const columns: Array<TableColumnConfig> = exportPageConfig.value.table.columns || []
|
|
184
|
-
const slotColumns: Array<string> = []
|
|
185
|
-
const slotFilter = (columns: Array<TableColumnConfig>) => {
|
|
186
|
-
columns.forEach(({ prop, isSlot, columns }: TableColumnConfig) => {
|
|
187
|
-
(isSlot && prop && prop !== 'tableAction') && slotColumns.push(prop)
|
|
188
|
-
columns?.length && slotFilter(columns)
|
|
189
|
-
})
|
|
190
|
-
}
|
|
191
|
-
slotFilter(columns)
|
|
192
|
-
return slotColumns
|
|
193
|
-
})
|
|
194
|
-
</script>
|
|
195
|
-
|
|
196
|
-
<style lang="scss" scoped>
|
|
197
|
-
.export-page {
|
|
198
|
-
display: grid;
|
|
199
|
-
grid-template-columns: repeat(24, 1fr);
|
|
200
|
-
grid-template-rows: 50px 1fr 50px;
|
|
201
|
-
padding: 20px;
|
|
202
|
-
border-radius: 2px;
|
|
203
|
-
background: #FFF;
|
|
204
|
-
.page-search {
|
|
205
|
-
grid-column: span 18;
|
|
206
|
-
}
|
|
207
|
-
.page-toolbar {
|
|
208
|
-
grid-column: span 6;
|
|
209
|
-
justify-self: end;
|
|
210
|
-
}
|
|
211
|
-
.page-table, .page-pagination {
|
|
212
|
-
grid-column: span 24;
|
|
213
|
-
}
|
|
214
|
-
.page-pagination {
|
|
215
|
-
align-self: end;
|
|
216
|
-
justify-self: end;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
</style>
|