general-basic-form 2.0.52 → 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 +1 -0
  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 -968
  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,79 @@
1
+ <!-- @format -->
2
+
3
+ <!--
4
+ * @Author: 陈德立*******419287484@qq.com
5
+ * @Date: 2024-09-05 16:09:07
6
+ * @LastEditTime: 2024-09-05 17:11:51
7
+ * @LastEditors: 陈德立*******419287484@qq.com
8
+ * @Github: https://github.com/Alan1034
9
+ * @Description: 制作遮罩层图片打碎与重组循环动画
10
+ * @FilePath: \GeneralBasicForm\src\components\CustomCom\img-mask\index.vue
11
+ *
12
+ -->
13
+ <!-- @format -->
14
+
15
+ <template>
16
+ <canvas ref="loadingCanvas"></canvas>
17
+ </template>
18
+ <script setup lang="ts">
19
+ import { onMounted, ref } from "vue";
20
+ const loadingCanvas = ref() as any
21
+ const { imgSrc } = defineProps<{ imgSrc: string }>();
22
+ onMounted(() => {
23
+ const img = new Image();
24
+ const pieces = [];
25
+ const piecesX = 8; // Number of horizontal pieces
26
+ const piecesY = 8; // Number of vertical pieces
27
+ let pieceHeight = 0;
28
+ let pieceWidth = 0;
29
+ const shatterAngle = 300; //
30
+ const canvas = loadingCanvas.value;
31
+ const ctx = canvas.getContext('2d');
32
+ img.onload = function () {
33
+ canvas.width = img.width;
34
+ canvas.height = img.height;
35
+ pieceWidth = Math.floor(img.width / piecesX);
36
+ pieceHeight = Math.floor(img.height / piecesY);
37
+ shatterImage();
38
+ animate(); // 开始对碎片的动画处理
39
+ };
40
+ img.src = imgSrc;
41
+ const shatterImage = () => {
42
+ for (let i = 0; i < piecesY; i++) {
43
+ for (let j = 0; j < piecesX; j++) {
44
+ pieces.push({
45
+ x: pieceWidth * j,
46
+ y: pieceHeight * i,
47
+ offsetX: (Math.random() - 0.5) * shatterAngle,
48
+ offsetY: (Math.random() - 0.5) * shatterAngle
49
+ });
50
+ }
51
+ }
52
+ }
53
+ const animate = () => {
54
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
55
+ let renderFinish = true
56
+ pieces.forEach((piece, index) => {
57
+ ctx.drawImage(img, piece.x, piece.y, pieceWidth, pieceHeight, piece.x + piece.offsetX, piece.y + piece.offsetY, pieceWidth, pieceHeight);
58
+ // Gradually reposition pieces to original position
59
+ if (Math.abs(piece.offsetX) > 0.5) {
60
+ renderFinish = false
61
+ piece.offsetX *= 0.95;
62
+ }
63
+ if (Math.abs(piece.offsetY) > 0.5) {
64
+ piece.offsetY *= 0.95;
65
+ renderFinish = false
66
+ }
67
+ });
68
+ if (renderFinish) {
69
+ setTimeout(() => {
70
+ shatterImage();
71
+ animate();
72
+ }, 300);
73
+ } else {
74
+ requestAnimationFrame(animate);
75
+ }
76
+
77
+ }
78
+ })
79
+ </script>
@@ -0,0 +1,82 @@
1
+ <!-- @format -->
2
+
3
+ <!--
4
+ * @Author: 陈德立*******419287484@qq.com
5
+ * @Date: 2023-11-09 10:01:20
6
+ * @LastEditTime: 2024-09-05 17:07:07
7
+ * @LastEditors: 陈德立*******419287484@qq.com
8
+ * @Github: https://github.com/Alan1034
9
+ * @Description: 图形验证码组件
10
+ * @FilePath: \GeneralBasicForm\src\components\CustomCom\input-graphic-verification\index.vue
11
+ *
12
+ -->
13
+
14
+ <script setup lang="ts">
15
+ import EInput from "../../VBasic/input/index.vue";
16
+ import AInput from "../../VABasic/input/index.vue";
17
+ import anime from 'animejs/lib/anime.es.js';
18
+ import { inject, shallowRef, computed } from "vue";
19
+ import { formLoadingKey } from "../../../injectKey";
20
+ import ImgMask from "../img-mask/index.vue";
21
+ import type { InputGraphicVerification } from "../../../types/componentsProps";
22
+ import type { ComponentType } from "../../../types/componentType";
23
+ const { item, componentType = "Element Plus", loading = false } = defineProps<{ item: any, componentType?: ComponentType, loading?: boolean }>();
24
+ const {
25
+ graphicSrc = "",
26
+ graphicAlt = "",
27
+ getGraphic = () => { },
28
+ key,
29
+ }: InputGraphicVerification = item;
30
+
31
+ const { formLoading } = inject<any>(formLoadingKey, false);
32
+ const verificationLoading = computed(() => {
33
+ return formLoading?.value || loading
34
+ })
35
+ const graphicClick = async () => {
36
+ // console.log('click', getGraphic);
37
+ if (getGraphic && !verificationLoading?.value) {
38
+ await getGraphic();
39
+
40
+ }
41
+ };
42
+
43
+ const inputType = shallowRef(EInput)
44
+
45
+ switch (componentType) {
46
+ case "Element Plus":
47
+ inputType.value = EInput
48
+ break;
49
+ case "Ant Design Vue":
50
+ inputType.value = AInput
51
+ break;
52
+ default:
53
+ break;
54
+ }
55
+ </script>
56
+
57
+ <template>
58
+ <div class="input-graphic-verification">
59
+ <component :is="inputType" :item="item" class="input" />
60
+ <ImgMask class="graphic" :imgSrc="graphicSrc" v-if="verificationLoading" />
61
+ <img v-else class="graphic" @click="graphicClick" :src="graphicSrc" :alt="graphicAlt || `${key}`" />
62
+ </div>
63
+ </template>
64
+
65
+ <style lang="less" scoped>
66
+ .input-graphic-verification {
67
+ display: flex;
68
+ gap: 12px;
69
+ width: 100%;
70
+
71
+ .input {
72
+ flex: auto;
73
+ }
74
+
75
+ .graphic {
76
+ width: 108px;
77
+ height: 43px;
78
+ object-fit: fill;
79
+ flex: none;
80
+ }
81
+ }
82
+ </style>
@@ -0,0 +1,52 @@
1
+ <!--
2
+ * @Author: 陈德立*******419287484@qq.com
3
+ * @Date: 2023-11-09 10:01:20
4
+ * @LastEditTime: 2024-09-18 10:47:17
5
+ * @LastEditors: 陈德立*******419287484@qq.com
6
+ * @Github: https://github.com/Alan1034
7
+ * @Description: 手机验证码组件
8
+ * @FilePath: \GeneralBasicForm\src\components\CustomCom\input-mobile-verification\index.vue
9
+ *
10
+ -->
11
+
12
+ <script setup lang="ts">
13
+ import EInput from "../../VBasic/input/index.vue";
14
+ import AInput from "../../VABasic/input/index.vue";
15
+ import { h, shallowRef } from "vue";
16
+ import type { ComponentType } from "../../../types/componentType";
17
+ import VerificationButton from "./verification-button.vue";
18
+ const { item, componentType = "Element Plus" } = defineProps<{ item: any, componentType?: ComponentType }>();
19
+ // 重新赋值一下触发下面的代码,否则响应会在内部进行
20
+ const mobileItem = item;
21
+ const inputType = <any>shallowRef(EInput)
22
+ switch (componentType) {
23
+ case "Element Plus":
24
+ inputType.value = EInput;
25
+ mobileItem.template = {
26
+ append: () => {
27
+ return h(VerificationButton, {
28
+ getSmscode: mobileItem.getSmscode,
29
+ item,
30
+ });
31
+ },
32
+ };
33
+ break;
34
+ case "Ant Design Vue":
35
+ inputType.value = AInput
36
+ mobileItem.template = {
37
+ suffix: () => {
38
+ return h(VerificationButton, {
39
+ getSmscode: mobileItem.getSmscode,
40
+ item,
41
+ });
42
+ },
43
+ };
44
+ break;
45
+ default:
46
+ break;
47
+ }
48
+ </script>
49
+
50
+ <template>
51
+ <component :is="inputType" :item="mobileItem" class="input" />
52
+ </template>
@@ -0,0 +1,81 @@
1
+ <!--
2
+ * @Author: 陈德立*******419287484@qq.com
3
+ * @Date: 2024-09-03 15:58:20
4
+ * @LastEditTime: 2024-09-18 10:54:40
5
+ * @LastEditors: 陈德立*******419287484@qq.com
6
+ * @Github: https://github.com/Alan1034
7
+ * @Description:
8
+ * @FilePath: \GeneralBasicForm\src\components\CustomCom\input-mobile-verification\verification-button.vue
9
+ *
10
+ -->
11
+ <script setup lang="ts">
12
+ import { ref, computed, onBeforeUnmount, Ref, shallowRef } from "vue";
13
+ import type { ComponentType } from "../../../types/componentType";
14
+ const { getSmscode, componentType = "Element Plus", item } = defineProps<{ getSmscode: Function, componentType?: ComponentType, item: any }>();
15
+
16
+ const defaultText = "获取验证码";
17
+ const restTime = 60;
18
+ const buttonText: Ref<string | number> = ref(defaultText);
19
+ const timer = ref(null);
20
+ const buttonType = computed(() => buttonText.value === defaultText);
21
+ const buttonName = shallowRef("el-button")
22
+ switch (componentType) {
23
+ case "Element Plus":
24
+ buttonName.value = "el-button"
25
+ break;
26
+ case "Ant Design Vue":
27
+ buttonName.value = "a-button"
28
+ break;
29
+ default:
30
+ break;
31
+ }
32
+ const reset = () => {
33
+ if (!timer) {
34
+ return;
35
+ }
36
+ clearInterval(timer.value);
37
+ timer.value = null;
38
+ buttonText.value = defaultText;
39
+ };
40
+ const buttonClick = async () => {
41
+ if (buttonText.value !== defaultText) {
42
+ return;
43
+ }
44
+ buttonText.value = restTime;
45
+ timer.value = setInterval(() => {
46
+ if (Number(buttonText.value) <= 0 || !buttonText.value) {
47
+ reset();
48
+ return;
49
+ } else {
50
+ buttonText.value = Number(buttonText.value) - 1;
51
+ }
52
+ }, 1000);
53
+ if (!getSmscode) {
54
+ return;
55
+ } else {
56
+ const statue = await getSmscode();
57
+ if (statue === false) {
58
+ reset();
59
+ }
60
+ }
61
+ };
62
+ onBeforeUnmount(() => {
63
+ reset();
64
+ });
65
+ const buttonSetting = { ...item.buttonSetting }
66
+ </script>
67
+
68
+ <template>
69
+ <component :is="buttonName" class="verifiaction-button" :style="{
70
+ color: buttonType
71
+ ? 'var(--color-primary, #409EFF)'
72
+ : 'var(--text-color-placeholder, #A8ABB2)',
73
+ cursor: buttonType ? 'pointer' : 'default',
74
+ }" @click="buttonClick" v-bind="buttonSetting">{{ buttonType ? defaultText : buttonText + "s" }}</component>
75
+ </template>
76
+
77
+ <style lang="less" scoped>
78
+ .verifiaction-button {
79
+ width: 109px;
80
+ }
81
+ </style>
@@ -0,0 +1,75 @@
1
+ <!--
2
+ * @Author: 陈德立*******419287484@qq.com
3
+ * @Date: 2024-09-04 18:01:00
4
+ * @LastEditTime: 2024-09-09 19:37:36
5
+ * @LastEditors: 陈德立*******419287484@qq.com
6
+ * @Github: https://github.com/Alan1034
7
+ * @Description:
8
+ * @FilePath: \GeneralBasicForm\src\components\VABasic\input\index.vue
9
+ *
10
+ -->
11
+ <template>
12
+ <a-input @keydown.enter="getList" @change="onInputChange" :value="queryParams[item.prop]" :size="size"
13
+ v-bind="inputSetting">
14
+ <template v-for="(templateEle, name) in item.template" #[name]>
15
+ <component :key="name" v-if="templateEle" :is="currentInputComponent()" :templateEle="templateEle" />
16
+ </template>
17
+ </a-input>
18
+ </template>
19
+
20
+ <script lang="ts">
21
+ import { defineComponent, inject } from "vue";
22
+ import { inputDefaultSetting } from "../../setting";
23
+
24
+ export default defineComponent({
25
+ components: {
26
+ InputArchive: (props) => {
27
+ const { templateEle } = props;
28
+ return templateEle();
29
+ },
30
+ },
31
+ props: {
32
+ item: null, // null就是any
33
+ },
34
+ setup() {
35
+ const queryParams = inject("queryParams", {});
36
+ const getList = inject("getList", () => { });
37
+ const size = inject("size", "default");
38
+ const Form = inject("Form") as any;
39
+ const formItemContext = Form.useInjectFormItemContext();
40
+ return { queryParams, getList, size, formItemContext };
41
+ },
42
+ data() {
43
+ return {
44
+ inputSetting: {
45
+ ...inputDefaultSetting,
46
+ ...this.item.inputSetting,
47
+ ...this.item.setting,
48
+ },
49
+ };
50
+ },
51
+ // created() {
52
+ // console.log("new", this.item);
53
+ // console.log("new", this.inputSetting);
54
+ // },
55
+ methods: {
56
+ currentInputComponent() {
57
+ return "input-archive";
58
+ },
59
+ onInputChange(e: any) {
60
+ this.queryParams[this.item.prop] = (e.target as any).value
61
+ this.formItemContext.onFieldChange();
62
+ }
63
+ },
64
+ // watch: {
65
+ // item(val) {
66
+ // console.log("item", val);
67
+ // },
68
+ // size(val) {
69
+ // console.log(val);
70
+ // },
71
+ // },
72
+ });
73
+ </script>
74
+
75
+ <style></style>
@@ -0,0 +1,32 @@
1
+ <!--
2
+ * @Author: 陈德立*******419287484@qq.com
3
+ * @Date: 2023-11-08 18:03:42
4
+ * @LastEditTime: 2023-12-07 17:06:11
5
+ * @LastEditors: 陈德立*******419287484@qq.com
6
+ * @Github: https://github.com/Alan1034
7
+ * @Description:
8
+ * @FilePath: \GeneralBasicForm\src\components\VBasic\cascader\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-cascader
27
+ v-model="queryParams[item.prop]"
28
+ :size="size"
29
+ :options="item.options || []"
30
+ v-bind="selectSetting"
31
+ ></el-cascader>
32
+ </template>
@@ -0,0 +1,37 @@
1
+ <!--
2
+ * @Author: 陈德立*******419287484@qq.com
3
+ * @Date: 2023-11-08 18:03:42
4
+ * @LastEditTime: 2023-12-28 14:51:25
5
+ * @LastEditors: 陈德立*******419287484@qq.com
6
+ * @Github: https://github.com/Alan1034
7
+ * @Description: 单选框组件
8
+ * @FilePath: \GeneralBasicForm\src\components\VBasic\checkbox\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 checkboxGroupSetting = ref({
18
+ ...item.checkboxGroupSetting,
19
+ ...item.setting,
20
+ });
21
+ </script>
22
+
23
+ <template>
24
+ <el-checkbox-group
25
+ v-model="queryParams[item.prop]"
26
+ :size="size"
27
+ v-bind="checkboxGroupSetting"
28
+ >
29
+ <el-checkbox
30
+ v-for="dict in item.option || []"
31
+ :size="size"
32
+ :key="dict.value"
33
+ v-bind="dict"
34
+ >{{ dict.label }}</el-checkbox
35
+ >
36
+ </el-checkbox-group>
37
+ </template>
@@ -0,0 +1,31 @@
1
+ <!--
2
+ * @Author: 陈德立*******419287484@qq.com
3
+ * @Date: 2023-11-08 18:03:42
4
+ * @LastEditTime: 2023-12-07 16:49:21
5
+ * @LastEditors: 陈德立*******419287484@qq.com
6
+ * @Github: https://github.com/Alan1034
7
+ * @Description:
8
+ * @FilePath: \GeneralBasicForm\src\components\VBasic\date-picker\index.vue
9
+ *
10
+ -->
11
+ <script setup lang="ts">
12
+ import { datePackerDefaultSetting } 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 datePackerSetting = ref({
19
+ ...datePackerDefaultSetting,
20
+ ...item.datePackerSetting,
21
+ ...item.setting,
22
+ });
23
+ </script>
24
+
25
+ <template>
26
+ <el-date-picker
27
+ v-model="queryParams[item.prop]"
28
+ :size="size"
29
+ v-bind="datePackerSetting"
30
+ />
31
+ </template>
@@ -0,0 +1,53 @@
1
+ <!--
2
+ * @Author: 陈德立*******419287484@qq.com
3
+ * @Date: 2023-11-09 10:01:20
4
+ * @LastEditTime: 2023-11-10 16:51:18
5
+ * @LastEditors: 陈德立*******419287484@qq.com
6
+ * @Github: https://github.com/Alan1034
7
+ * @Description: 分割线
8
+ * @FilePath: \deal-front-endd:\work\GeneralBasicForm\src\components\VBasic\divider\index.vue
9
+ *
10
+ -->
11
+
12
+ <template>
13
+ <el-divider v-bind="dividerSetting">
14
+ <template v-for="(templateEle, name) in item.template" #[name]>
15
+ <component
16
+ :key="name"
17
+ v-if="templateEle"
18
+ :is="currentInputComponent()"
19
+ :templateEle="templateEle"
20
+ />
21
+ </template>
22
+ </el-divider>
23
+ </template>
24
+
25
+ <script lang="ts">
26
+ import { defineComponent } from "vue";
27
+
28
+ export default defineComponent({
29
+ components: {
30
+ slotArchive: (props) => {
31
+ const { templateEle } = props;
32
+ return templateEle();
33
+ },
34
+ },
35
+ props: {
36
+ item: null, // null就是any
37
+ },
38
+ setup() {},
39
+ data() {
40
+ return {
41
+ dividerSetting: {
42
+ ...this.item.dividerSetting,
43
+ ...this.item.setting,
44
+ },
45
+ };
46
+ },
47
+ methods: {
48
+ currentInputComponent() {
49
+ return "slot-archive";
50
+ },
51
+ },
52
+ });
53
+ </script>
@@ -0,0 +1,67 @@
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>
@@ -0,0 +1,31 @@
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>
@@ -0,0 +1,37 @@
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>