general-basic-form 2.0.51 → 2.0.53

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 (35) hide show
  1. package/README.assets/image-20210820173738506.png +0 -0
  2. package/README.md +6 -1
  3. package/package.json +3 -14
  4. package/script/link.ts +36 -0
  5. package/script/unlink.ts +45 -0
  6. package/src/Descriptions.vue +106 -0
  7. package/src/GeneralBasicForm.vue +277 -0
  8. package/src/InfiniteScrollList.vue +170 -0
  9. package/src/assets/image-20210820173037871.png +0 -0
  10. package/src/assets/logo.png +0 -0
  11. package/src/components/CustomCom/img-mask/index.vue +79 -0
  12. package/src/components/CustomCom/input-graphic-verification/index.vue +82 -0
  13. package/src/components/CustomCom/input-mobile-verification/index.vue +52 -0
  14. package/src/components/CustomCom/input-mobile-verification/verification-button.vue +81 -0
  15. package/src/components/VABasic/input/index.vue +75 -0
  16. package/src/components/VBasic/cascader/index.vue +32 -0
  17. package/src/components/VBasic/checkbox/index.vue +37 -0
  18. package/src/components/VBasic/date-picker/index.vue +31 -0
  19. package/src/components/VBasic/divider/index.vue +53 -0
  20. package/src/components/VBasic/input/index.vue +67 -0
  21. package/src/components/VBasic/input-number/index.vue +31 -0
  22. package/src/components/VBasic/radio/index.vue +37 -0
  23. package/src/components/VBasic/select/index.vue +37 -0
  24. package/src/components/setting.ts +28 -0
  25. package/src/index.ts +30 -0
  26. package/src/injectKey.ts +2 -0
  27. package/src/types/basicFrom.ts +63 -0
  28. package/src/types/componentType.ts +6 -0
  29. package/src/types/componentsProps.ts +18 -0
  30. package/tsconfig.json +14 -0
  31. package/vite.config.js +123 -0
  32. package/dist/index.js +0 -963
  33. package/dist/index.umd.cjs +0 -1
  34. package/dist/style.css +0 -1
  35. /package/{dist → public}/index.d.ts +0 -0
@@ -0,0 +1,37 @@
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>
@@ -0,0 +1,28 @@
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 ADDED
@@ -0,0 +1,30 @@
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;
@@ -0,0 +1,2 @@
1
+
2
+ export const formLoadingKey = Symbol()
@@ -0,0 +1,63 @@
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
+ };
@@ -0,0 +1,6 @@
1
+ /** @format */
2
+
3
+ export enum ComponentType {
4
+ "Ant Design Vue" = "Ant Design Vue",
5
+ "Element Plus" = "Element Plus",
6
+ }
@@ -0,0 +1,18 @@
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 ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "include": [
3
+ "public/index.d.ts",
4
+ "src/**/*",
5
+ "src/**/*.vue",
6
+ "public/*",
7
+ ],
8
+ "exclude": [],
9
+ "compilerOptions": {
10
+ "declaration": true,
11
+ "allowJs": true,
12
+ "composite": true
13
+ }
14
+ }
package/vite.config.js ADDED
@@ -0,0 +1,123 @@
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
+ })