flame-plus 0.1.26 → 0.1.28
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/.vscode/extensions.json +3 -0
- package/README.md +7 -1
- package/index.html +13 -0
- package/package.json +23 -48
- package/public/vite.svg +1 -0
- package/src/App.vue +12 -0
- package/src/assets/vue.svg +1 -0
- package/src/components/HelloWorld.vue +33 -0
- package/src/main.ts +16 -0
- package/{packages → src/packages}/components/base/flmButton/flmButton.vue +1 -1
- package/{packages → src/packages}/components/base/flmCascader/flmCascader.vue +1 -1
- package/{packages → src/packages}/components/base/flmCheckbox/flmCheckbox.vue +1 -1
- package/{packages → src/packages}/components/base/flmCheckbox/flmCheckboxGroup.vue +1 -1
- package/{packages → src/packages}/components/base/flmColorPicker/flmColorPicker.vue +1 -1
- package/{packages → src/packages}/components/base/flmDatePicker/flmDatePicker.vue +1 -1
- package/{packages → src/packages}/components/base/flmDialog/flmDialog.vue +1 -1
- package/{packages → src/packages}/components/base/flmInput/flmInput.vue +1 -1
- package/{packages → src/packages}/components/base/flmInputNumber/flmInputNumber.vue +1 -1
- package/{packages → src/packages}/components/base/flmPagination/flmPagination.vue +1 -1
- package/{packages → src/packages}/components/base/flmRadio/flmRadio.vue +1 -1
- package/{packages → src/packages}/components/base/flmRate/flmRate.vue +1 -1
- package/{packages → src/packages}/components/base/flmRead/flmRead.vue +2 -2
- package/{packages → src/packages}/components/base/flmSelect/flmSelect.vue +1 -1
- package/{packages → src/packages}/components/base/flmSlider/flmSlider.vue +1 -1
- package/{packages → src/packages}/components/base/flmSwitch/flmSwitch.vue +1 -1
- package/{packages → src/packages}/components/base/flmTimePicker/flmTimePicker.vue +1 -1
- package/{packages → src/packages}/components/base/flmTimeSelect/flmTimeSelect.vue +1 -1
- package/{packages → src/packages}/components/base/flmTransfer/flmTransfer.vue +1 -1
- package/{packages → src/packages}/components/complex/flmForm/flmForm.vue +2 -1
- package/{packages → src/packages}/components/complex/flmSearch/flmSearch.vue +1 -1
- package/{packages → src/packages}/components/complex/flmTable/flmTable.vue +1 -1
- package/{packages → src/packages}/components/complex/flmToolbar/flmToolbar.vue +2 -2
- package/{packages → src/packages}/components/index.ts +2 -1
- package/src/packages/components/page/flmExportPage/flmExportPage.vue +219 -0
- package/{packages → src/packages}/components/page/flmReportPage/flmReportPage.vue +71 -18
- package/src/packages/index.ts +96 -0
- package/src/shims-vue.d.ts +9 -0
- package/tsconfig.json +20 -73
- package/vite.config.js +41 -0
- package/.browserslistrc +0 -3
- package/.env +0 -0
- package/.eslintrc.js +0 -20
- package/packages/index.ts +0 -8
- package/packages/model/flmComponentConfig/base/flmButton.ts +0 -53
- package/packages/model/flmComponentConfig/base/flmCascader.ts +0 -77
- package/packages/model/flmComponentConfig/base/flmCheckbox.ts +0 -51
- package/packages/model/flmComponentConfig/base/flmColorPicker.ts +0 -30
- package/packages/model/flmComponentConfig/base/flmDatePicker.ts +0 -73
- package/packages/model/flmComponentConfig/base/flmDialog.ts +0 -49
- package/packages/model/flmComponentConfig/base/flmInput.ts +0 -57
- package/packages/model/flmComponentConfig/base/flmInputNumber.ts +0 -37
- package/packages/model/flmComponentConfig/base/flmPagination.ts +0 -37
- package/packages/model/flmComponentConfig/base/flmRadio.ts +0 -42
- package/packages/model/flmComponentConfig/base/flmRate.ts +0 -49
- package/packages/model/flmComponentConfig/base/flmRead.ts +0 -6
- package/packages/model/flmComponentConfig/base/flmSelect.ts +0 -104
- package/packages/model/flmComponentConfig/base/flmSlider.ts +0 -51
- package/packages/model/flmComponentConfig/base/flmSwitch.ts +0 -37
- package/packages/model/flmComponentConfig/base/flmTimePicker.ts +0 -61
- package/packages/model/flmComponentConfig/base/flmTimeSelect.ts +0 -44
- package/packages/model/flmComponentConfig/base/flmTransfer.ts +0 -51
- package/packages/model/flmComponentConfig/complex/flmForm.ts +0 -147
- package/packages/model/flmComponentConfig/complex/flmSearch.ts +0 -5
- package/packages/model/flmComponentConfig/complex/flmTable.ts +0 -132
- package/packages/model/flmComponentConfig/complex/flmToolbar.ts +0 -13
- package/packages/model/flmComponentConfig/index.ts +0 -31
- package/packages/model/flmComponentConfig/page/flmReportPage.ts +0 -31
- package/packages/model/flmComponentConfig/public.ts +0 -293
- package/typings/lodash.d.ts +0 -4
- package/webpack.config.js +0 -15
- /package/{packages → src/packages}/utils/filterConfig.ts +0 -0
- /package/{packages → src/packages}/utils/index.ts +0 -0
- /package/{packages → src/packages}/utils/isValidKey.ts +0 -0
package/README.md
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
# Vue 3 + Vite
|
|
2
|
+
|
|
3
|
+
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
|
4
|
+
|
|
5
|
+
## Recommended IDE Setup
|
|
6
|
+
|
|
7
|
+
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
|
package/index.html
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>flame-plus</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="app"></div>
|
|
11
|
+
<script type="module" src="/src/main.ts"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,58 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flame-plus",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.1.28",
|
|
5
5
|
"description": "基于 element-plus 的组件库",
|
|
6
|
-
"main": "
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
"main": "./dist/flame-plus.umd.js",
|
|
7
|
+
"module": "./dist/flame-plus.es.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/flame-plus.es.js",
|
|
11
|
+
"require": "./dist/flame-plus.umd.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"private": false,
|
|
10
15
|
"scripts": {
|
|
11
|
-
"
|
|
12
|
-
"build": "
|
|
13
|
-
"
|
|
14
|
-
"lib": "vue-cli-service build --target lib --name flame-plus --dest lib packages/index.ts"
|
|
16
|
+
"dev": "vite",
|
|
17
|
+
"build": "vite build",
|
|
18
|
+
"preview": "vite preview"
|
|
15
19
|
},
|
|
16
20
|
"dependencies": {
|
|
17
|
-
"@element-plus/icons-vue": "^
|
|
18
|
-
"@
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"html-loader": "^3.1.0",
|
|
25
|
-
"monaco-editor": "0.30.*",
|
|
26
|
-
"monaco-editor-esm-webpack-plugin": "^2.0.2",
|
|
27
|
-
"monaco-editor-nls": "^2.0.0",
|
|
28
|
-
"monaco-editor-webpack-plugin": "6.*.*",
|
|
29
|
-
"node-sass": "6.0.1",
|
|
30
|
-
"sass": "^1.49.9",
|
|
31
|
-
"sass-loader": "10.2.0",
|
|
32
|
-
"ts-xor": "^1.0.8",
|
|
33
|
-
"vue": "^3.0.0",
|
|
34
|
-
"vue-class-component": "^8.0.0-0",
|
|
35
|
-
"vue-router": "^4.0.0-0",
|
|
36
|
-
"vuex": "^4.0.0-0"
|
|
21
|
+
"@element-plus/icons-vue": "^2.1.0",
|
|
22
|
+
"@vitejs/plugin-vue-jsx": "^3.0.1",
|
|
23
|
+
"element-plus": "2.2.17",
|
|
24
|
+
"flame-types": "^1.0.0",
|
|
25
|
+
"sass": "^1.62.1",
|
|
26
|
+
"sass-loader": "^13.2.2",
|
|
27
|
+
"vue": "^3.2.16"
|
|
37
28
|
},
|
|
38
29
|
"devDependencies": {
|
|
39
|
-
"@
|
|
40
|
-
"
|
|
41
|
-
"@vue/cli-plugin-babel": "~4.5.0",
|
|
42
|
-
"@vue/cli-plugin-eslint": "~4.5.0",
|
|
43
|
-
"@vue/cli-plugin-router": "~4.5.0",
|
|
44
|
-
"@vue/cli-plugin-typescript": "~4.5.0",
|
|
45
|
-
"@vue/cli-plugin-vuex": "~4.5.0",
|
|
46
|
-
"@vue/cli-service": "~4.5.0",
|
|
47
|
-
"@vue/compiler-sfc": "^3.0.0",
|
|
48
|
-
"@vue/eslint-config-prettier": "^6.0.0",
|
|
49
|
-
"@vue/eslint-config-typescript": "^7.0.0",
|
|
50
|
-
"eslint": "^6.7.2",
|
|
51
|
-
"eslint-plugin-prettier": "^3.3.1",
|
|
52
|
-
"eslint-plugin-vue": "^7.0.0",
|
|
53
|
-
"prettier": "^2.2.1",
|
|
54
|
-
"typescript": "~4.1.5",
|
|
55
|
-
"unplugin-auto-import": "^0.5.3",
|
|
56
|
-
"unplugin-vue-components": "^0.17.6"
|
|
30
|
+
"@vitejs/plugin-vue": "^1.9.3",
|
|
31
|
+
"vite": "^3.2.6"
|
|
57
32
|
}
|
|
58
33
|
}
|
package/public/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/src/App.vue
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<myButton />
|
|
3
|
+
<el-button>ele-button</el-button>
|
|
4
|
+
<HelloWorld />
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { myButton } from './packages/index'
|
|
9
|
+
import HelloWorld from './components/HelloWorld.vue';
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<style lang="scss"></style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="tsx">
|
|
2
|
+
import { ElButton } from 'element-plus'
|
|
3
|
+
import { defineComponent, PropType, computed } from 'vue'
|
|
4
|
+
import { ButtonConfig, buttonDefaultConfig } from 'flame-types'
|
|
5
|
+
import { filterConfig } from '../packages/utils'
|
|
6
|
+
|
|
7
|
+
export default defineComponent({
|
|
8
|
+
emits: ['buttonClick'],
|
|
9
|
+
props: {
|
|
10
|
+
// 默认设置
|
|
11
|
+
config: {
|
|
12
|
+
type: Object as PropType<ButtonConfig>,
|
|
13
|
+
default: {}
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
setup(props, ctx) {
|
|
17
|
+
// 按钮设置
|
|
18
|
+
const buttonConfig = computed((): ButtonConfig => {
|
|
19
|
+
return filterConfig(buttonDefaultConfig, props.config)
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
return () => (
|
|
23
|
+
<ElButton>点我</ElButton>
|
|
24
|
+
)
|
|
25
|
+
// return () => (
|
|
26
|
+
// <el-button
|
|
27
|
+
// {...buttonConfig.value}
|
|
28
|
+
// onClick={() => ctx.emit('buttonClick')}
|
|
29
|
+
// >{buttonConfig.value.buttonText || '点击'}</el-button>
|
|
30
|
+
// )
|
|
31
|
+
},
|
|
32
|
+
})
|
|
33
|
+
</script>
|
package/src/main.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// main.ts
|
|
2
|
+
import { createApp } from 'vue'
|
|
3
|
+
import App from './App.vue'
|
|
4
|
+
|
|
5
|
+
import ElementPlus from 'element-plus'
|
|
6
|
+
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
|
7
|
+
import 'element-plus/dist/index.css'
|
|
8
|
+
// import * as icons from '@element-plus/icons-vue'
|
|
9
|
+
|
|
10
|
+
const app = createApp(App)
|
|
11
|
+
.use(ElementPlus, { locale: zhCn })
|
|
12
|
+
// Object.keys(icons).forEach((key) => {
|
|
13
|
+
// // isValidKey(key, icons) && app.component(key, icons[key])
|
|
14
|
+
// app.component(key, icons[key])
|
|
15
|
+
// })
|
|
16
|
+
app.mount("#app")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="tsx">
|
|
2
2
|
import { defineComponent, PropType, computed } from 'vue'
|
|
3
|
-
import { ButtonConfig, buttonDefaultConfig } from '
|
|
3
|
+
import { ButtonConfig, buttonDefaultConfig } from 'flame-types'
|
|
4
4
|
import { filterConfig } from '../../../utils'
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="tsx">
|
|
2
2
|
import { defineComponent, PropType, computed, reactive } from 'vue'
|
|
3
|
-
import { CascaderConfig, CascaderDefaultEvent, cascaderDefaultConfig } from '
|
|
3
|
+
import { CascaderConfig, CascaderDefaultEvent, cascaderDefaultConfig } from 'flame-types'
|
|
4
4
|
import { filterConfig } from '../../../utils'
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="tsx">
|
|
2
2
|
import { defineComponent, PropType, reactive, computed } from 'vue'
|
|
3
|
-
import { CheckboxConfig, CheckboxDefaultEvent, checkboxDefaultConfig } from '
|
|
3
|
+
import { CheckboxConfig, CheckboxDefaultEvent, checkboxDefaultConfig } from 'flame-types'
|
|
4
4
|
import { filterConfig } from '../../../utils'
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="tsx">
|
|
2
2
|
import { defineComponent, PropType, reactive, computed } from 'vue'
|
|
3
|
-
import { ColorPickerConfig, ColorPickerDefaultEvent, colorPickerDefaultConfig } from '
|
|
3
|
+
import { ColorPickerConfig, ColorPickerDefaultEvent, colorPickerDefaultConfig } from 'flame-types'
|
|
4
4
|
import { filterConfig } from '../../../utils'
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="tsx">
|
|
2
2
|
import { defineComponent, PropType, computed, reactive } from 'vue'
|
|
3
|
-
import { DatePickerConfig, DatePickerDefaultEvent, datePickerDefaultConfig } from '
|
|
3
|
+
import { DatePickerConfig, DatePickerDefaultEvent, datePickerDefaultConfig } from 'flame-types'
|
|
4
4
|
import { filterConfig } from '../../../utils'
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="tsx">
|
|
2
2
|
import { defineComponent, PropType, reactive, computed } from 'vue'
|
|
3
|
-
import { DialogConfig, DialogDefaultEvent, dialogDefaultConfig } from '
|
|
3
|
+
import { DialogConfig, DialogDefaultEvent, dialogDefaultConfig } from 'flame-types'
|
|
4
4
|
import { filterConfig } from '../../../utils'
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="tsx">
|
|
2
2
|
import { defineComponent, PropType, reactive, computed } from 'vue'
|
|
3
|
-
import { InputConfig, InputDefaultEvent, inputDefaultConfig } from '
|
|
3
|
+
import { InputConfig, InputDefaultEvent, inputDefaultConfig } from 'flame-types'
|
|
4
4
|
import { filterConfig } from '../../../utils'
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="tsx">
|
|
2
2
|
import { defineComponent, PropType, computed, reactive } from 'vue'
|
|
3
|
-
import { InputNumberConfig, InputNumberDefaultEvent, inputNumberDefaultConfig } from '
|
|
3
|
+
import { InputNumberConfig, InputNumberDefaultEvent, inputNumberDefaultConfig } from 'flame-types'
|
|
4
4
|
import { filterConfig } from '../../../utils'
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="tsx">
|
|
2
2
|
import { defineComponent, PropType, reactive, computed } from 'vue'
|
|
3
|
-
import { PaginationConfig, PaginationDefaultEvent, paginationDefaultConfig } from '
|
|
3
|
+
import { PaginationConfig, PaginationDefaultEvent, paginationDefaultConfig } from 'flame-types'
|
|
4
4
|
import { filterConfig } from '../../../utils'
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="tsx">
|
|
2
2
|
import { defineComponent, PropType, computed, reactive } from 'vue'
|
|
3
|
-
import { RateConfig, RateDefaultEvent, rateDefaultConfig } from '
|
|
3
|
+
import { RateConfig, RateDefaultEvent, rateDefaultConfig } from 'flame-types'
|
|
4
4
|
import { filterConfig } from '../../../utils'
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script lang="ts" setup>
|
|
8
|
-
import {
|
|
9
|
-
import { ReadConfig } from '
|
|
8
|
+
import { PropType } from 'vue'
|
|
9
|
+
import { ReadConfig } from 'flame-types'
|
|
10
10
|
|
|
11
11
|
const props = defineProps({
|
|
12
12
|
// 默认设置
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="tsx">
|
|
2
2
|
import { defineComponent, PropType, computed, reactive } from 'vue'
|
|
3
|
-
import { SliderConfig, SliderDefaultEvent, sliderDefaultConfig } from '
|
|
3
|
+
import { SliderConfig, SliderDefaultEvent, sliderDefaultConfig } from 'flame-types'
|
|
4
4
|
import { filterConfig } from '../../../utils'
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="tsx">
|
|
2
2
|
import { defineComponent, PropType, computed } from 'vue'
|
|
3
|
-
import { SwitchConfig, switchDefaultConfig } from '
|
|
3
|
+
import { SwitchConfig, switchDefaultConfig } from 'flame-types'
|
|
4
4
|
import { filterConfig } from '../../../utils'
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="tsx">
|
|
2
2
|
import { defineComponent, PropType, computed, reactive } from 'vue'
|
|
3
|
-
import { TimePickerConfig, TimePickerDefaultEvent, timePickerDefaultConfig } from '
|
|
3
|
+
import { TimePickerConfig, TimePickerDefaultEvent, timePickerDefaultConfig } from 'flame-types'
|
|
4
4
|
import { filterConfig } from '../../../utils'
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="tsx">
|
|
2
2
|
import { defineComponent, PropType, computed, reactive } from 'vue'
|
|
3
|
-
import { TimeSelectConfig, timeSelectDefaultConfig } from '
|
|
3
|
+
import { TimeSelectConfig, timeSelectDefaultConfig } from 'flame-types'
|
|
4
4
|
import { filterConfig } from '../../../utils'
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="tsx">
|
|
2
2
|
import { defineComponent, PropType, computed, reactive } from 'vue'
|
|
3
|
-
import { TransferConfig, TransferDefaultEvent, transferDefaultConfig } from '
|
|
3
|
+
import { TransferConfig, TransferDefaultEvent, transferDefaultConfig } from 'flame-types'
|
|
4
4
|
import { filterConfig } from '../../../utils'
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
FormItemConfig,
|
|
38
38
|
FormButtonConfig,
|
|
39
39
|
formDefaultConfig
|
|
40
|
-
} from '
|
|
40
|
+
} from 'flame-types'
|
|
41
41
|
import { filterConfig, isValidKey } from '../../../utils'
|
|
42
42
|
|
|
43
43
|
export default defineComponent({
|
|
@@ -232,6 +232,7 @@ export default defineComponent({
|
|
|
232
232
|
},
|
|
233
233
|
})
|
|
234
234
|
</script>
|
|
235
|
+
|
|
235
236
|
<style lang="scss" scoped>
|
|
236
237
|
$columnNumber: v-bind(columnNumber);
|
|
237
238
|
:deep(.el-form-item) {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
<script lang="ts" setup>
|
|
40
40
|
import { PropType, ref, Ref, computed, ComputedRef } from 'vue'
|
|
41
41
|
import { flmForm } from '../../index'
|
|
42
|
-
import {
|
|
42
|
+
import { ButtonType, FormItemConfig, SearchConfig } from 'flame-types'
|
|
43
43
|
import { isValidKey } from '../../../utils'
|
|
44
44
|
|
|
45
45
|
const emit = defineEmits(['searchSubmit', 'searchReset', 'searchCustomEvent'])
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
</template>
|
|
29
29
|
|
|
30
30
|
<script lang="ts" setup>
|
|
31
|
-
import {
|
|
31
|
+
import { PropType, computed, ComputedRef } from 'vue'
|
|
32
32
|
import { flmButton } from '../../index'
|
|
33
|
-
import { ToolbarConfig, ToolbarButtonConfig } from '
|
|
33
|
+
import { ToolbarConfig, ToolbarButtonConfig } from 'flame-types'
|
|
34
34
|
|
|
35
35
|
const emit = defineEmits(['toolbarClick'])
|
|
36
36
|
const props = defineProps({
|
|
@@ -26,4 +26,5 @@ export { default as flmToolbar } from './complex/flmToolbar/flmToolbar.vue'
|
|
|
26
26
|
export { default as flmSearch } from './complex/flmSearch/flmSearch.vue' // 搜索
|
|
27
27
|
|
|
28
28
|
// 页面组件
|
|
29
|
-
export { default as flmReportPage } from './page/flmReportPage/flmReportPage.vue' // 报表页面
|
|
29
|
+
export { default as flmReportPage } from './page/flmReportPage/flmReportPage.vue' // 报表页面
|
|
30
|
+
export { default as flmExportPage } from './page/flmExportPage/flmExportPage.vue' // 导出页面
|
|
@@ -0,0 +1,219 @@
|
|
|
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>
|