general-basic-form 2.0.53 → 2.0.55
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/README.md +1 -1
- package/dist/index.js +987 -0
- package/dist/index.umd.cjs +1 -0
- package/dist/style.css +1 -0
- package/package.json +14 -3
- package/README.assets/image-20210820173738506.png +0 -0
- package/script/link.ts +0 -36
- package/script/unlink.ts +0 -45
- package/src/Descriptions.vue +0 -106
- package/src/GeneralBasicForm.vue +0 -277
- package/src/InfiniteScrollList.vue +0 -170
- package/src/assets/image-20210820173037871.png +0 -0
- package/src/assets/logo.png +0 -0
- package/src/components/CustomCom/img-mask/index.vue +0 -79
- package/src/components/CustomCom/input-graphic-verification/index.vue +0 -82
- package/src/components/CustomCom/input-mobile-verification/index.vue +0 -52
- package/src/components/CustomCom/input-mobile-verification/verification-button.vue +0 -81
- package/src/components/VABasic/input/index.vue +0 -75
- package/src/components/VBasic/cascader/index.vue +0 -32
- package/src/components/VBasic/checkbox/index.vue +0 -37
- package/src/components/VBasic/date-picker/index.vue +0 -31
- package/src/components/VBasic/divider/index.vue +0 -53
- package/src/components/VBasic/input/index.vue +0 -67
- package/src/components/VBasic/input-number/index.vue +0 -31
- package/src/components/VBasic/radio/index.vue +0 -37
- package/src/components/VBasic/select/index.vue +0 -37
- package/src/components/setting.ts +0 -28
- package/src/index.ts +0 -30
- package/src/injectKey.ts +0 -2
- package/src/types/basicFrom.ts +0 -63
- package/src/types/componentType.ts +0 -6
- package/src/types/componentsProps.ts +0 -18
- package/tsconfig.json +0 -14
- package/vite.config.js +0 -123
- /package/{public → dist}/index.d.ts +0 -0
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: 陈德立*******419287484@qq.com
|
|
3
|
-
* @Date: 2024-09-04 19:17:23
|
|
4
|
-
* @LastEditTime: 2024-09-10 09:51:10
|
|
5
|
-
* @LastEditors: 陈德立*******419287484@qq.com
|
|
6
|
-
* @Github: https://github.com/Alan1034
|
|
7
|
-
* @Description:
|
|
8
|
-
* @FilePath: \GeneralBasicForm\src\components\VBasic\input\index.vue
|
|
9
|
-
*
|
|
10
|
-
-->
|
|
11
|
-
<template>
|
|
12
|
-
<el-input @keydown.enter="getList" v-model="queryParams[item.prop]" :size="size" v-bind="inputSetting">
|
|
13
|
-
<template v-for="(templateEle, name) in item.template" #[name]>
|
|
14
|
-
<component :key="name" v-if="templateEle" :is="currentInputComponent()" :templateEle="templateEle" />
|
|
15
|
-
</template>
|
|
16
|
-
</el-input>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script lang="ts">
|
|
20
|
-
import { defineComponent, inject } from "vue";
|
|
21
|
-
import { inputDefaultSetting } from "../../setting";
|
|
22
|
-
export default defineComponent({
|
|
23
|
-
components: {
|
|
24
|
-
InputArchive: (props) => {
|
|
25
|
-
const { templateEle } = props;
|
|
26
|
-
return templateEle();
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
props: {
|
|
30
|
-
item: null, // null就是any
|
|
31
|
-
},
|
|
32
|
-
setup() {
|
|
33
|
-
const queryParams = inject("queryParams", {});
|
|
34
|
-
const getList = inject("getList");
|
|
35
|
-
const size = inject("size", 'default');
|
|
36
|
-
return { queryParams, getList, size };
|
|
37
|
-
},
|
|
38
|
-
data() {
|
|
39
|
-
return {
|
|
40
|
-
inputSetting: {
|
|
41
|
-
...inputDefaultSetting,
|
|
42
|
-
...this.item.inputSetting,
|
|
43
|
-
...this.item.setting,
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
},
|
|
47
|
-
// created() {
|
|
48
|
-
// console.log("new", this.item);
|
|
49
|
-
// console.log("new", this.inputSetting);
|
|
50
|
-
// },
|
|
51
|
-
methods: {
|
|
52
|
-
currentInputComponent() {
|
|
53
|
-
return "input-archive";
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
// watch: {
|
|
57
|
-
// item(val) {
|
|
58
|
-
// console.log("item", val);
|
|
59
|
-
// },
|
|
60
|
-
// size(val) {
|
|
61
|
-
// console.log(val);
|
|
62
|
-
// },
|
|
63
|
-
// },
|
|
64
|
-
});
|
|
65
|
-
</script>
|
|
66
|
-
|
|
67
|
-
<style></style>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: 陈德立*******419287484@qq.com
|
|
3
|
-
* @Date: 2023-11-08 18:03:42
|
|
4
|
-
* @LastEditTime: 2023-11-14 15:35:38
|
|
5
|
-
* @LastEditors: 陈德立*******419287484@qq.com
|
|
6
|
-
* @Github: https://github.com/Alan1034
|
|
7
|
-
* @Description:
|
|
8
|
-
* @FilePath: \GeneralBasicForm\src\components\VBasic\input-number\index.vue
|
|
9
|
-
*
|
|
10
|
-
-->
|
|
11
|
-
<script setup lang="ts">
|
|
12
|
-
import { inputDefaultSetting } from "../../setting";
|
|
13
|
-
import { ref, inject } from "vue";
|
|
14
|
-
import { BasicFormComponentsProps } from "../../../types/componentsProps";
|
|
15
|
-
const { item } = defineProps<{item:any}>();
|
|
16
|
-
const queryParams = inject("queryParams", {});
|
|
17
|
-
const size = inject("size");
|
|
18
|
-
const inputSetting = ref({
|
|
19
|
-
...inputDefaultSetting,
|
|
20
|
-
...item.inputSetting,
|
|
21
|
-
...item.setting,
|
|
22
|
-
});
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<template>
|
|
26
|
-
<el-input-number
|
|
27
|
-
v-model="queryParams[item.prop]"
|
|
28
|
-
:size="size"
|
|
29
|
-
v-bind="inputSetting"
|
|
30
|
-
/>
|
|
31
|
-
</template>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: 陈德立*******419287484@qq.com
|
|
3
|
-
* @Date: 2023-11-08 18:03:42
|
|
4
|
-
* @LastEditTime: 2024-01-09 11:38:11
|
|
5
|
-
* @LastEditors: 陈德立*******419287484@qq.com
|
|
6
|
-
* @Github: https://github.com/Alan1034
|
|
7
|
-
* @Description: 单选框组件
|
|
8
|
-
* @FilePath: \GeneralBasicForm\src\components\VBasic\radio\index.vue
|
|
9
|
-
*
|
|
10
|
-
-->
|
|
11
|
-
<script setup lang="ts">
|
|
12
|
-
import { ref, inject } from "vue";
|
|
13
|
-
// import { BasicFormComponentsProps } from "../../../types/componentsProps";
|
|
14
|
-
const { item } = defineProps<{ item: any }>();
|
|
15
|
-
const queryParams = inject("queryParams", {});
|
|
16
|
-
const size = inject("size");
|
|
17
|
-
const radioGroupSetting = ref({
|
|
18
|
-
...item.radioGroupSetting,
|
|
19
|
-
...item.setting,
|
|
20
|
-
});
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<template>
|
|
24
|
-
<el-radio-group
|
|
25
|
-
v-model="queryParams[item.prop]"
|
|
26
|
-
:size="size"
|
|
27
|
-
v-bind="radioGroupSetting"
|
|
28
|
-
>
|
|
29
|
-
<el-radio
|
|
30
|
-
v-for="dict in item.option || []"
|
|
31
|
-
:size="size"
|
|
32
|
-
:key="dict.value"
|
|
33
|
-
v-bind="dict"
|
|
34
|
-
>{{ dict.label }}</el-radio
|
|
35
|
-
>
|
|
36
|
-
</el-radio-group>
|
|
37
|
-
</template>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: 陈德立*******419287484@qq.com
|
|
3
|
-
* @Date: 2023-11-08 18:03:42
|
|
4
|
-
* @LastEditTime: 2023-12-07 17:03:07
|
|
5
|
-
* @LastEditors: 陈德立*******419287484@qq.com
|
|
6
|
-
* @Github: https://github.com/Alan1034
|
|
7
|
-
* @Description:
|
|
8
|
-
* @FilePath: \GeneralBasicForm\src\components\VBasic\select\index.vue
|
|
9
|
-
*
|
|
10
|
-
-->
|
|
11
|
-
<script setup lang="ts">
|
|
12
|
-
import { selectDefaultSetting } from "../../setting";
|
|
13
|
-
import { ref, inject } from "vue";
|
|
14
|
-
import { BasicFormComponentsProps } from "../../../types/componentsProps";
|
|
15
|
-
const { item } = defineProps<{ item: any }>();
|
|
16
|
-
const queryParams = inject("queryParams", {});
|
|
17
|
-
const size = inject("size");
|
|
18
|
-
const selectSetting = ref({
|
|
19
|
-
...selectDefaultSetting,
|
|
20
|
-
...item.selectSetting,
|
|
21
|
-
...item.setting,
|
|
22
|
-
});
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<template>
|
|
26
|
-
<el-select
|
|
27
|
-
v-model="queryParams[item.prop]"
|
|
28
|
-
:size="size"
|
|
29
|
-
v-bind="selectSetting"
|
|
30
|
-
>
|
|
31
|
-
<el-option
|
|
32
|
-
v-for="dict in item.option || []"
|
|
33
|
-
:key="dict.value"
|
|
34
|
-
v-bind="dict"
|
|
35
|
-
/>
|
|
36
|
-
</el-select>
|
|
37
|
-
</template>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 陈德立*******419287484@qq.com
|
|
3
|
-
* @Date: 2023-11-08 18:01:09
|
|
4
|
-
* @LastEditTime: 2023-12-07 17:03:11
|
|
5
|
-
* @LastEditors: 陈德立*******419287484@qq.com
|
|
6
|
-
* @Github: https://github.com/Alan1034
|
|
7
|
-
* @Description:
|
|
8
|
-
* @FilePath: \GeneralBasicForm\src\components\setting.ts
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
export const inputDefaultSetting = {
|
|
12
|
-
placeholder: "请输入",
|
|
13
|
-
style: "width: 200px",
|
|
14
|
-
clearable: true,
|
|
15
|
-
}
|
|
16
|
-
export const datePackerDefaultSetting = {
|
|
17
|
-
style: "width: 227px",
|
|
18
|
-
"start-placeholder": "开始日期",
|
|
19
|
-
"end-placeholder": "结束日期",
|
|
20
|
-
type: "daterange",
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const selectDefaultSetting = {
|
|
24
|
-
placeholder: "请选择",
|
|
25
|
-
filterable: true,
|
|
26
|
-
clearable: true,
|
|
27
|
-
style: "width: 200px",
|
|
28
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @format
|
|
3
|
-
* @Author: 陈德立*******419287484@qq.com
|
|
4
|
-
* @Date: 2021-08-20 17:05:30
|
|
5
|
-
* @LastEditTime: 2024-09-04 18:57:56
|
|
6
|
-
* @LastEditors: 陈德立*******419287484@qq.com
|
|
7
|
-
* @Github: https://github.com/Alan1034
|
|
8
|
-
* @Description:
|
|
9
|
-
* @FilePath: \GeneralBasicForm\src\index.ts
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import GeneralBasicForm from "./GeneralBasicForm.vue";
|
|
13
|
-
|
|
14
|
-
export const VGeneralBasicForm = GeneralBasicForm;
|
|
15
|
-
|
|
16
|
-
import InfiniteScrollList from "./InfiniteScrollList.vue";
|
|
17
|
-
|
|
18
|
-
export const VInfiniteScrollList = InfiniteScrollList;
|
|
19
|
-
|
|
20
|
-
import Descriptions from "./Descriptions.vue";
|
|
21
|
-
|
|
22
|
-
export const VDescriptions = Descriptions;
|
|
23
|
-
|
|
24
|
-
import InputGraphicVerification from "./components/CustomCom/input-graphic-verification/index.vue";
|
|
25
|
-
|
|
26
|
-
export const VInputGraphicVerification = InputGraphicVerification;
|
|
27
|
-
|
|
28
|
-
import InputMobilecVerification from "./components/CustomCom/input-mobile-verification/index.vue";
|
|
29
|
-
|
|
30
|
-
export const VInputMobilecVerification = InputMobilecVerification;
|
package/src/injectKey.ts
DELETED
package/src/types/basicFrom.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
export enum FormType {
|
|
2
|
-
/**
|
|
3
|
-
* @description: 输入框
|
|
4
|
-
* @return {*}
|
|
5
|
-
*/
|
|
6
|
-
'input' = 'input',
|
|
7
|
-
/**
|
|
8
|
-
* @description: 输入框/图像验证码
|
|
9
|
-
* @return {*}
|
|
10
|
-
*/
|
|
11
|
-
'input-graphic-verification' = 'input-graphic-verification',
|
|
12
|
-
/**
|
|
13
|
-
* @description: 输入框/手机验证码
|
|
14
|
-
* @return {*}
|
|
15
|
-
*/
|
|
16
|
-
'input-mobile-verification' = 'input-mobile-verification',
|
|
17
|
-
/**
|
|
18
|
-
* @description: 分割线
|
|
19
|
-
* @return {*}
|
|
20
|
-
*/
|
|
21
|
-
'divider' = 'divider',
|
|
22
|
-
/**
|
|
23
|
-
* @description: 选择器
|
|
24
|
-
* @return {*}
|
|
25
|
-
*/
|
|
26
|
-
'select' = 'select',
|
|
27
|
-
/**
|
|
28
|
-
* @description: 级联选择器
|
|
29
|
-
* @return {*}
|
|
30
|
-
*/
|
|
31
|
-
'cascader' = 'cascader',
|
|
32
|
-
/**
|
|
33
|
-
* @description: 日期选择器
|
|
34
|
-
* @return {*}
|
|
35
|
-
*/
|
|
36
|
-
'date-picker' = 'date-picker',
|
|
37
|
-
/**
|
|
38
|
-
* @description: 数字输入框
|
|
39
|
-
* @return {*}
|
|
40
|
-
*/
|
|
41
|
-
'input-number' = 'input-number',
|
|
42
|
-
/**
|
|
43
|
-
* @description: 单选框
|
|
44
|
-
* @return {*}
|
|
45
|
-
*/
|
|
46
|
-
'radio' = 'radio',
|
|
47
|
-
/**
|
|
48
|
-
* @description: 自定义元素,插槽组件
|
|
49
|
-
* @return {*}
|
|
50
|
-
*/
|
|
51
|
-
'form-item-slot'='form-item-slot',
|
|
52
|
-
/**
|
|
53
|
-
* @description: 多选框
|
|
54
|
-
* @return {*}
|
|
55
|
-
*/
|
|
56
|
-
'checkbox'='checkbox',
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface ItemType {
|
|
60
|
-
type: FormType;
|
|
61
|
-
// 扩展属性
|
|
62
|
-
[key: string]: any
|
|
63
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export interface BasicFormComponentsProps {
|
|
3
|
-
item: any;
|
|
4
|
-
// queryParams: Object | String;
|
|
5
|
-
// size:String;
|
|
6
|
-
// getList?:Function
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export interface InputGraphicVerification {
|
|
11
|
-
graphicSrc?: any
|
|
12
|
-
graphicAlt?: string
|
|
13
|
-
getGraphic?: Function
|
|
14
|
-
key: string | number
|
|
15
|
-
};
|
|
16
|
-
export interface InputMobileVerification {
|
|
17
|
-
getSmscode: Function
|
|
18
|
-
};
|
package/tsconfig.json
DELETED
package/vite.config.js
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import legacy from '@vitejs/plugin-legacy'
|
|
2
|
-
import { fileURLToPath } from 'url'
|
|
3
|
-
import { defineConfig, loadEnv, splitVendorChunkPlugin } from 'vite'
|
|
4
|
-
import vue from '@vitejs/plugin-vue'
|
|
5
|
-
import vueJsx from '@vitejs/plugin-vue-jsx'
|
|
6
|
-
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer';
|
|
7
|
-
import path from 'path';
|
|
8
|
-
const __filenameNew = fileURLToPath(import.meta.url)
|
|
9
|
-
const __dirnameNew = path.dirname(__filenameNew)
|
|
10
|
-
const resolve = (dir) => path.resolve(__dirnameNew, dir);
|
|
11
|
-
// https://vitejs.dev/config/
|
|
12
|
-
export default defineConfig(({ command, mode }) => {
|
|
13
|
-
// 根据当前工作目录中的 `mode` 加载 .env 文件
|
|
14
|
-
// 设置第三个参数为 '' 来加载所有环境变量,而不管是否有 `VITE_` 前缀。
|
|
15
|
-
const env = loadEnv(mode, process.cwd(), '')
|
|
16
|
-
// console.log(command)
|
|
17
|
-
// console.log(env)
|
|
18
|
-
// console.log(env.CURRENT_ENV)
|
|
19
|
-
// console.log(env.APP_ENV)
|
|
20
|
-
// console.log(env.VUE_APP_BASE_API)
|
|
21
|
-
return {
|
|
22
|
-
// vite环境变量配置
|
|
23
|
-
define: {
|
|
24
|
-
"CURRENT_ENV": JSON.stringify(env.CURRENT_ENV),
|
|
25
|
-
},
|
|
26
|
-
server: {
|
|
27
|
-
open: true,
|
|
28
|
-
},
|
|
29
|
-
resolve: {
|
|
30
|
-
alias: {
|
|
31
|
-
'@': resolve('src'),//路径化名
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
plugins: [
|
|
38
|
-
/**
|
|
39
|
-
* @description: vite自带的文件分割配置
|
|
40
|
-
* @return {*}
|
|
41
|
-
*/
|
|
42
|
-
{
|
|
43
|
-
...splitVendorChunkPlugin(),
|
|
44
|
-
apply: 'build',
|
|
45
|
-
},
|
|
46
|
-
/**
|
|
47
|
-
* @description: 图片压缩插件
|
|
48
|
-
* @return {*}
|
|
49
|
-
*/
|
|
50
|
-
{
|
|
51
|
-
...ViteImageOptimizer({
|
|
52
|
-
/* pass your config */
|
|
53
|
-
}),
|
|
54
|
-
// enforce: 'pre',
|
|
55
|
-
apply: 'build',
|
|
56
|
-
},
|
|
57
|
-
/**
|
|
58
|
-
* @description: 兼容旧版本浏览器
|
|
59
|
-
* @return {*}
|
|
60
|
-
*/
|
|
61
|
-
{
|
|
62
|
-
...legacy({
|
|
63
|
-
targets: ['defaults'],
|
|
64
|
-
}),
|
|
65
|
-
apply: 'build',
|
|
66
|
-
},
|
|
67
|
-
vue(),
|
|
68
|
-
vueJsx(),
|
|
69
|
-
],
|
|
70
|
-
css: {
|
|
71
|
-
preprocessorOptions: {
|
|
72
|
-
less: {
|
|
73
|
-
// 支持内联 JavaScript
|
|
74
|
-
javascriptEnabled: true,
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
/**
|
|
79
|
-
* @description: 打包时才调用
|
|
80
|
-
* @return {*}
|
|
81
|
-
*/
|
|
82
|
-
build: {
|
|
83
|
-
lib: {
|
|
84
|
-
// Could also be a dictionary or array of multiple entry points
|
|
85
|
-
// 添加打包入口文件夹
|
|
86
|
-
entry: resolve(`${__dirnameNew}/src`, 'index.ts'),
|
|
87
|
-
// formats: ['es', 'cjs', 'umd', 'iife'],
|
|
88
|
-
name: 'Index',
|
|
89
|
-
// the proper extensions will be added
|
|
90
|
-
// fileName: (format) => `index.${format}.js`,
|
|
91
|
-
fileName: "index",
|
|
92
|
-
},
|
|
93
|
-
rollupOptions: {
|
|
94
|
-
// 确保外部化处理那些你不想打包进库的依赖
|
|
95
|
-
external: ['vue', 'vue-router', "element-plus"],
|
|
96
|
-
output: {
|
|
97
|
-
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
|
|
98
|
-
globals: {
|
|
99
|
-
vue: 'Vue',
|
|
100
|
-
'vue-router': 'vue-router',
|
|
101
|
-
"element-plus": "element-plus",
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
// minify: 'terser',
|
|
106
|
-
//打包环境移除console.log,debugger
|
|
107
|
-
// terserOptions: {
|
|
108
|
-
// compress: {
|
|
109
|
-
// drop_console: true,
|
|
110
|
-
// drop_debugger: true,
|
|
111
|
-
// },
|
|
112
|
-
// },
|
|
113
|
-
//打包文件按照类型分文件夹显示(貌似会导致性能下降)
|
|
114
|
-
// rollupOptions: {
|
|
115
|
-
// output: {
|
|
116
|
-
// chunkFileNames: 'js/[name]-chunk-[hash:7].js',
|
|
117
|
-
// entryFileNames: 'js/[name]-app-[hash:7].js',
|
|
118
|
-
// assetFileNames: '[ext]/[name]-chunk-[hash:7].[ext]',
|
|
119
|
-
// },
|
|
120
|
-
// },
|
|
121
|
-
},
|
|
122
|
-
}
|
|
123
|
-
})
|
|
File without changes
|