@elementplus-kit/uikit 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/index.css +1 -0
  2. package/dist/index.mjs +1079 -0
  3. package/dist/index.umd.js +1 -0
  4. package/package.json +14 -4
  5. package/aaaindex.ts +0 -55
  6. package/build.log +0 -0
  7. package/components/button/index.ts +0 -4
  8. package/components/button/src/constants.ts +0 -50
  9. package/components/button/src/index.ts +0 -264
  10. package/components/button/style/index.scss +0 -3
  11. package/components/config.ts +0 -4
  12. package/components/dialog/index.ts +0 -6
  13. package/components/dialog/src/constants.ts +0 -3
  14. package/components/dialog/src/index.ts +0 -54
  15. package/components/dialog/style/index.scss +0 -18
  16. package/components/dictLabel/index.ts +0 -4
  17. package/components/dictLabel/src/index.vue +0 -21
  18. package/components/drawer/index.ts +0 -4
  19. package/components/drawer/src/constants.ts +0 -3
  20. package/components/drawer/src/index.ts +0 -53
  21. package/components/drawer/style/index.scss +0 -18
  22. package/components/form/index.ts +0 -4
  23. package/components/form/src/FormItem.ts +0 -397
  24. package/components/form/src/constants.ts +0 -161
  25. package/components/form/src/index.ts +0 -207
  26. package/components/form/src/types.ts +0 -39
  27. package/components/form/src/utils.ts +0 -4
  28. package/components/form/style/index.scss +0 -5
  29. package/components/pagination/index.ts +0 -4
  30. package/components/pagination/src/constants.ts +0 -5
  31. package/components/pagination/src/index.ts +0 -50
  32. package/components/search/index.ts +0 -4
  33. package/components/search/src/index.tsx +0 -276
  34. package/components/search/style/index.scss +0 -101
  35. package/components/table/index.ts +0 -4
  36. package/components/table/src/TableColumn.ts +0 -116
  37. package/components/table/src/constants.ts +0 -42
  38. package/components/table/src/index.ts +0 -250
  39. package/components/table/src/index2.ts +0 -219
  40. package/components/table/src/index3.ts +0 -233
  41. package/components/table/src/tableDictLabel.vue +0 -21
  42. package/components/table/src/tableaa.ts +0 -71
  43. package/components/table/src/type.ts +0 -0
  44. package/components/table/type/index.scss +0 -0
  45. package/components/table2/index.ts +0 -4
  46. package/components/table2/src/config.ts +0 -5
  47. package/components/table2/src/index.ts +0 -12
  48. package/components/table2/src/render.ts +0 -136
  49. package/components/table2/src/types.ts +0 -39
  50. package/components/table2/style/index.scss +0 -0
  51. package/components//346/250/241/346/235/277/index.tsx +0 -57
  52. package/components//346/250/241/346/235/277/ttt.ts +0 -66
  53. package/components//346/250/241/346/235/277/ttt.vue +0 -18
  54. package/index.ts +0 -2
  55. package/vite.config.ts +0 -26
  56. package//345/205/266/344/273/226/core/dialog/elementPlus/dialogWarp.vue +0 -151
  57. package//345/205/266/344/273/226/core/dialog/index.ts +0 -10
  58. package//345/205/266/344/273/226/core/form/elementPlus/elementWarp.ts +0 -15
  59. package//345/205/266/344/273/226/core/form/elementPlus/elementWarp.vue +0 -16
  60. package//345/205/266/344/273/226/core/form/elementPlus/formRender.ts +0 -55
  61. package//345/205/266/344/273/226/core/form/index.ts +0 -10
  62. package//345/205/266/344/273/226/core/table/config.ts +0 -5
  63. package//345/205/266/344/273/226/core/table/render.ts +0 -91
  64. package//345/205/266/344/273/226/core/table/warp.ts +0 -11
  65. package//345/205/266/344/273/226/core/utils/fetch.ts +0 -58
  66. package//345/205/266/344/273/226/useMessage.ts +0 -95
package/vite.config.ts DELETED
@@ -1,26 +0,0 @@
1
- import { defineConfig } from 'vite'
2
- import vue from '@vitejs/plugin-vue'
3
- import vueJsx from '@vitejs/plugin-vue-jsx'
4
- import dts from 'vite-plugin-dts'
5
- import { resolve } from 'path'
6
-
7
- export default defineConfig({
8
- plugins: [
9
- vue(),
10
- vueJsx(),
11
- // dts({
12
- // rollupTypes: false,
13
- // tsconfigPath: './tsconfig.json',
14
- // }),
15
- ],
16
- build: {
17
- lib: {
18
- entry: 'components/index.ts',
19
- name: 'ElementPlusKit',
20
- fileName: 'index',
21
- },
22
- rollupOptions: {
23
- external: ['vue', 'element-plus'],
24
- },
25
- },
26
- })
@@ -1,151 +0,0 @@
1
- <script setup lang="ts">
2
- import { FullScreen, Close } from '@element-plus/icons-vue'
3
-
4
- const emits = defineEmits(['afterClose', 'beforeOpen', 'afterOpen', 'beforeClose', 'innerOutput'])
5
-
6
- // 子组件属性
7
- const innerComponentOptions = ref({})
8
-
9
- // 子组件
10
- const innerComponent = shallowRef()
11
-
12
- // 弹窗显示隐藏关键属性
13
- const dialogShow = ref(false)
14
-
15
- // 弹窗组件基本属性
16
- const dialogOptions = ref({
17
- title: '',
18
- appendToBody: true,
19
- destroyOnClose: true,
20
- fullscreen: false,
21
- closeOnClickModal: false,
22
- closeOnPressEscape: false,
23
- showClose: false
24
- })
25
-
26
- /**
27
- * 源方法打开弹窗
28
- */
29
- const handleOpenDialog = () => {
30
- dialogShow.value = true
31
- }
32
-
33
- /**
34
- * 源方法关闭弹窗
35
- */
36
- const handleCloseDialog = () => {
37
- dialogShow.value = false
38
- }
39
-
40
- /**
41
- * 监听方法,监听来自子组件的事件
42
- * @param e
43
- */
44
- const handleCatchInnerOutput = (e: any) => {
45
- emits('innerOutput', e)
46
- }
47
-
48
- /**
49
- * 来自子组件的关闭请求处理
50
- * @param e
51
- */
52
- const handleInnerCommandClose = (e: any = false) => {
53
- emits('beforeClose', [e, innerComponentOptions, dialogOptions])
54
- handleCloseDialog()
55
- emits('afterClose', e)
56
- }
57
-
58
- /**
59
- * 来自弹窗组件自身的关闭回调处理
60
- * @param e
61
- */
62
- const handleWarpCommandClose = (e: any = false) => {
63
- emits('beforeClose', [e, innerComponentOptions, dialogOptions])
64
- handleCloseDialog()
65
- emits('afterClose', e)
66
- }
67
-
68
- /**
69
- * 全屏切换功能
70
- */
71
- const handleToggleFullscreen = () => {
72
- dialogOptions.value.fullscreen = !dialogOptions.value.fullscreen
73
- }
74
-
75
- /**
76
- * 打开弹窗
77
- * @param v
78
- * @param data
79
- * @param dialogOption
80
- */
81
- const open = async (v: any, data: any, dialogOption: any) => {
82
- innerComponent.value = v
83
- innerComponentOptions.value = data
84
- if (dialogOption) {
85
- dialogOptions.value = Object.assign(dialogOptions.value, dialogOption)
86
- }
87
- emits('beforeOpen', [innerComponentOptions.value, dialogOptions.value])
88
- handleOpenDialog()
89
- await nextTick()
90
- emits('afterOpen', [innerComponentOptions.value, dialogOptions.value])
91
- }
92
-
93
- /**
94
- * 关闭弹窗
95
- * @param e
96
- */
97
- const close = (e: any = false) => {
98
- emits('beforeClose', e)
99
- handleCloseDialog()
100
- emits('afterClose', e)
101
- }
102
-
103
- defineExpose({
104
- open,
105
- close
106
- })
107
- </script>
108
-
109
- <template>
110
- <el-dialog v-bind="dialogOptions" v-model="dialogShow" @close="handleWarpCommandClose">
111
- <template #header>
112
- <div class="dialog-header">
113
- <div class="title">{{ dialogOptions.title }}</div>
114
- <div class="operator-bar">
115
- <el-tooltip content="切换全屏" effect="dark">
116
- <el-icon class="operator-bar-item" @click="handleToggleFullscreen">
117
- <FullScreen />
118
- </el-icon>
119
- </el-tooltip>
120
- <el-tooltip content="关闭弹窗" effect="dark">
121
- <el-icon class="operator-bar-item" @click="handleWarpCommandClose(false)">
122
- <Close />
123
- </el-icon>
124
- </el-tooltip>
125
- </div>
126
- </div>
127
- </template>
128
- <component
129
- :is="innerComponent"
130
- v-bind="innerComponentOptions"
131
- @inner-output="handleCatchInnerOutput"
132
- @close="handleInnerCommandClose"
133
- />
134
- </el-dialog>
135
- </template>
136
-
137
- <style scoped lang="scss">
138
- .dialog-header {
139
- display: flex;
140
- flex-direction: row;
141
- align-items: center;
142
- justify-content: space-between;
143
-
144
- .operator-bar {
145
- .operator-bar-item {
146
- margin: 0 5px;
147
- cursor: pointer;
148
- }
149
- }
150
- }
151
- </style>
@@ -1,10 +0,0 @@
1
- import dialogWarp from './elementPlus/dialogWarp.vue'
2
-
3
- export const DynamicDialog = (uiFrame = 'elementPlus') => {
4
- switch (uiFrame) {
5
- case 'elementPlus':
6
- return dialogWarp
7
- default:
8
- return dialogWarp
9
- }
10
- }
@@ -1,15 +0,0 @@
1
- import {formRender} from './formRender.ts';
2
- import {cloneDeep} from 'lodash-es';
3
-
4
- export default {
5
- props: ['schema', 'modelValue'],
6
- emits: ['update:modelValue'],
7
- setup(props: any, {emit, slots}) {
8
-
9
- const privateModelValue = cloneDeep(props.modelValue);
10
-
11
- return () => {
12
- return formRender(props.schema, privateModelValue, emit, slots);
13
- }
14
- }
15
- }
@@ -1,16 +0,0 @@
1
- <script lang="ts" setup>
2
- // form-warp
3
- import { FieldSchema } from '../../pageSchema/fieldSchema.ts'
4
- import { formRender } from '@/core/form/elementPlus/formRender.ts'
5
-
6
- const props = defineProps<{
7
- schema: FieldSchema[]
8
- modelValue?: any
9
- }>()
10
- </script>
11
-
12
- <template>
13
- <component :is="formRender(props.schema, modelValue)" />
14
- </template>
15
-
16
- <style lang="scss" scoped></style>
@@ -1,55 +0,0 @@
1
- import {FieldSchema, FIELD_TYPE} from "@/core/pageSchema/fieldSchema.ts";
2
-
3
- import {h} from 'vue';
4
-
5
- import {ElInput, ElInputNumber, ElFormItem, ElForm} from 'element-plus';
6
-
7
- /**
8
- * input渲染器
9
- * @param sc
10
- * @param modelValue
11
- * @param emit
12
- */
13
- export const formInputRender = (sc: FieldSchema, modelValue: any, emit: any) => {
14
- let props = {
15
- modelValue,
16
- 'onUpdate:modelValues': (value: any) => {
17
- emit('update:modelValues', value);
18
- },
19
- }
20
-
21
- switch (sc.fieldType) {
22
- case FIELD_TYPE.STRING:
23
- return h(ElInput, props, []);
24
- case FIELD_TYPE.NUMBER:
25
- return h(ElInputNumber, props, []);
26
- }
27
- }
28
-
29
- /**
30
- * formItem渲染器
31
- * @param sc
32
- * @param modelValue
33
- * @param emit
34
- */
35
- export const formItemRender = (sc: FieldSchema, modelValue: any, emit: any) => {
36
- let innerInput = formInputRender(sc, modelValue, emit);
37
- let props = {...sc}
38
- return h(ElFormItem, props, [innerInput]);
39
- }
40
-
41
- /**
42
- * form渲染器
43
- * @param schema 表单描述
44
- * @param modelValues v-model值绑定
45
- * @param emit 事件触发器
46
- * @param slots 插槽
47
- */
48
- export const formRender = (schema: FieldSchema[], modelValues: any, emit: any, slots: any) => {
49
- let formItems = schema.map(sc => {
50
- return formItemRender(sc, modelValues[sc.prop], emit);
51
- })
52
- let props = {}
53
- let children = [...formItems, slots.default({model: modelValues})]
54
- return h(ElForm, props, children);
55
- }
@@ -1,10 +0,0 @@
1
- import elementPlus from './elementPlus/elementWarp.ts';
2
-
3
- export const schemaForm = (uiFrame = 'elementPlus') => {
4
- switch (uiFrame) {
5
- case 'elementPlus':
6
- return elementPlus;
7
- default:
8
- return elementPlus;
9
- }
10
- };
@@ -1,5 +0,0 @@
1
- export const TABLE_CONFIG = {
2
- OPERATION_COL_LABEL: '操作',
3
- OPERATION_SLOT_NAME: 'custom',
4
- CHILDREN_SLOT_KEY: 'children'
5
- }
@@ -1,91 +0,0 @@
1
- import { ElTable, ElTableColumn } from 'element-plus'
2
- import _ from 'lodash-es'
3
- import { TABLE_CONFIG } from './config.ts'
4
-
5
- function render(schema: any, data: any, emit: any, slots: any) {
6
- const renderSlots = {
7
- default: () => {
8
- return buildSlots(schema, slots)
9
- }
10
- }
11
- return h(ElTable, { data, emit }, renderSlots)
12
- }
13
-
14
- function buildSlots(schema: any, slots: any) {
15
- const children: any[] = []
16
- // 渲染表格列子组件
17
- let columnsKeys = Object.keys(schema)
18
- if (_.isObject(schema)) {
19
- columnsKeys.forEach((columnKey) => {
20
- let colSchema = schema[columnKey]
21
- let colSlots = slots[columnKey]
22
- children.push(buildColumns(columnKey, colSchema, colSlots, slots))
23
- })
24
- }
25
-
26
- // 额外插槽处理
27
- // 增加插槽式操作栏
28
- if (slots[TABLE_CONFIG.OPERATION_SLOT_NAME]) {
29
- let scopeProp = { label: TABLE_CONFIG.OPERATION_COL_LABEL }
30
- let scopeSlots = {
31
- default: (scope: any) => {
32
- return [slots[TABLE_CONFIG.OPERATION_SLOT_NAME](scope)]
33
- }
34
- }
35
- children.push(h(ElTableColumn, scopeProp, scopeSlots))
36
- }
37
- return children
38
- }
39
-
40
- function buildColumns(columnKey: any, option: any, slots: any, globalSlots: any) {
41
- // 组装props
42
- let props = buildColumnProps(columnKey, option)
43
- let renderSlotsArr = []
44
-
45
- // 多级表头组合
46
- if (option[TABLE_CONFIG.CHILDREN_SLOT_KEY] && _.isObject(option[TABLE_CONFIG.CHILDREN_SLOT_KEY])) {
47
- let scopeOption = option[TABLE_CONFIG.CHILDREN_SLOT_KEY]
48
- let columnsKeys = Object.keys(scopeOption)
49
- if (_.isObject(scopeOption)) {
50
- columnsKeys.forEach((columnKey) => {
51
- let colSchema = scopeOption[columnKey]
52
- let colSlots = globalSlots[columnKey]
53
- renderSlotsArr.push(buildColumns(columnKey, colSchema, colSlots, globalSlots))
54
- })
55
- }
56
- }
57
-
58
- let renderSlots = () => []
59
-
60
- if (slots) {
61
- renderSlots = {
62
- default: (scope) => {
63
- return [...renderSlotsArr, slots(scope)]
64
- }
65
- }
66
- } else {
67
- renderSlots = {
68
- default: () => {
69
- return [...renderSlotsArr]
70
- }
71
- }
72
- }
73
-
74
- return h(ElTableColumn, props, renderSlots)
75
- }
76
-
77
- function buildColumnProps(key: string, option: any) {
78
- if (_.isString(option)) {
79
- return {
80
- prop: key,
81
- label: option
82
- }
83
- } else if (_.isObject(option)) {
84
- return {
85
- prop: key,
86
- ...option
87
- }
88
- }
89
- }
90
-
91
- export default render
@@ -1,11 +0,0 @@
1
- import render from './render.ts'
2
-
3
- export default {
4
- props: ['schema', 'data'],
5
- emits: [],
6
- setup(props: any, { emit, slots }) {
7
- return () => {
8
- return render(props.schema, props.data, emit, slots)
9
- }
10
- }
11
- }
@@ -1,58 +0,0 @@
1
- import request from '@/config/axios'
2
-
3
- const defaultFetchRule = {
4
- page: {
5
- method: 'get',
6
- template: `/:path/:model/page`
7
- },
8
- detail: {
9
- method: 'get',
10
- template: `/:path/:model/get`
11
- },
12
- create: {
13
- method: 'post',
14
- template: `/:path/:model/create`
15
- },
16
- delete: {
17
- method: 'delete',
18
- template: `/:path/:model/delete`
19
- },
20
- update: {
21
- method: 'put',
22
- template: `/:path/:model/update`,
23
- }
24
- }
25
-
26
- export function schemaFetch(values: any, rule = defaultFetchRule) {
27
- let apis = {}
28
- rule = { ...defaultFetchRule, ...rule }
29
- Object.keys(rule).forEach((key) => {
30
- let url = ''
31
- if (rule[key].url) {
32
- url = rule[key].url
33
- } else {
34
- url = replaceParams(rule[key].template, values)
35
- }
36
- apis[key] = async (params: any, ...args: any) => {
37
- let method = rule[key].method
38
- switch (method) {
39
- case 'get':
40
- return await request[method]({ url, params }, ...args)
41
- case 'post':
42
- return await request[method]({ url, data: params }, ...args)
43
- case 'put':
44
- return await request[method]({ url, data: params }, ...args)
45
- case 'delete':
46
- return await request[method]({ url, params }, ...args)
47
- }
48
- }
49
- })
50
- return apis
51
- }
52
-
53
- function replaceParams(template, values) {
54
- const regexp = /:(\w+)/g
55
- return template.replace(regexp, (_, key) => {
56
- return values[key] || `${key}`
57
- })
58
- }
@@ -1,95 +0,0 @@
1
- import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
2
- import { useI18n } from './useI18n'
3
- export const useMessage = () => {
4
- const { t } = useI18n()
5
- return {
6
- // 消息提示
7
- info(content: string) {
8
- ElMessage.info(content)
9
- },
10
- // 错误消息
11
- error(content: string) {
12
- ElMessage.error(content)
13
- },
14
- // 成功消息
15
- success(content: string) {
16
- ElMessage.success(content)
17
- },
18
- // 警告消息
19
- warning(content: string) {
20
- ElMessage.warning(content)
21
- },
22
- // 弹出提示
23
- alert(content: string) {
24
- ElMessageBox.alert(content, t('common.confirmTitle'))
25
- },
26
- // 错误提示
27
- alertError(content: string) {
28
- ElMessageBox.alert(content, t('common.confirmTitle'), { type: 'error' })
29
- },
30
- // 成功提示
31
- alertSuccess(content: string) {
32
- ElMessageBox.alert(content, t('common.confirmTitle'), { type: 'success' })
33
- },
34
- // 警告提示
35
- alertWarning(content: string) {
36
- ElMessageBox.alert(content, t('common.confirmTitle'), { type: 'warning' })
37
- },
38
- // 通知提示
39
- notify(content: string) {
40
- ElNotification.info(content)
41
- },
42
- // 错误通知
43
- notifyError(content: string) {
44
- ElNotification.error(content)
45
- },
46
- // 成功通知
47
- notifySuccess(content: string) {
48
- ElNotification.success(content)
49
- },
50
- // 警告通知
51
- notifyWarning(content: string) {
52
- ElNotification.warning(content)
53
- },
54
- // 确认窗体
55
- confirm(content: string, tip?: string) {
56
- return ElMessageBox.confirm(content, tip ? tip : t('common.confirmTitle'), {
57
- confirmButtonText: t('common.ok'),
58
- cancelButtonText: t('common.cancel'),
59
- type: 'warning'
60
- })
61
- },
62
- // 删除窗体
63
- delConfirm(content?: string, tip?: string) {
64
- return ElMessageBox.confirm(
65
- content ? content : t('common.delMessage'),
66
- tip ? tip : t('common.confirmTitle'),
67
- {
68
- confirmButtonText: t('common.ok'),
69
- cancelButtonText: t('common.cancel'),
70
- type: 'warning'
71
- }
72
- )
73
- },
74
- // 导出窗体
75
- exportConfirm(content?: string, tip?: string) {
76
- return ElMessageBox.confirm(
77
- content ? content : t('common.exportMessage'),
78
- tip ? tip : t('common.confirmTitle'),
79
- {
80
- confirmButtonText: t('common.ok'),
81
- cancelButtonText: t('common.cancel'),
82
- type: 'warning'
83
- }
84
- )
85
- },
86
- // 提交内容
87
- prompt(content: string, tip: string) {
88
- return ElMessageBox.prompt(content, tip, {
89
- confirmButtonText: t('common.ok'),
90
- cancelButtonText: t('common.cancel'),
91
- type: 'warning'
92
- })
93
- }
94
- }
95
- }