general-basic-form 2.0.63 → 2.0.64
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/dist/index.js +1399 -0
- package/dist/index.umd.cjs +1 -0
- package/dist/style.css +1 -0
- package/package.json +15 -4
- 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 -107
- package/src/GeneralBasicForm.vue +0 -240
- package/src/InfiniteScrollList.vue +0 -163
- 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 -81
- package/src/components/CustomCom/input-mobile-verification/index.vue +0 -56
- package/src/components/CustomCom/input-mobile-verification/verification-button.vue +0 -82
- 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,163 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: 陈德立*******419287484@qq.com
|
|
3
|
-
* @Date: 2023-12-05 15:09:03
|
|
4
|
-
* @LastEditTime: 2024-11-21 19:37:38
|
|
5
|
-
* @LastEditors: 陈德立*******419287484@qq.com
|
|
6
|
-
* @Github: https://github.com/Alan1034
|
|
7
|
-
* @Description: 公共的无限滚动列表
|
|
8
|
-
* @FilePath: \GeneralBasicForm\src\InfiniteScrollList.vue
|
|
9
|
-
*
|
|
10
|
-
-->
|
|
11
|
-
<template>
|
|
12
|
-
<el-checkbox-group v-model="checkedList" v-loading="loading" v-bind="props" v-if="props.checkbox">
|
|
13
|
-
<ul v-infinite-scroll="loadList" class="list" :infinite-scroll-disabled="ifbottom" :style="{ height }">
|
|
14
|
-
<li v-for="i in list" :key="i[id]" class="list-item">
|
|
15
|
-
<el-checkbox :value="i[id]" class="checkbox">{{ i[name] }}
|
|
16
|
-
<ExtraComponent :i="i" v-if="props.extra"></ExtraComponent>
|
|
17
|
-
</el-checkbox>
|
|
18
|
-
</li>
|
|
19
|
-
</ul>
|
|
20
|
-
</el-checkbox-group>
|
|
21
|
-
<ul v-infinite-scroll="loadList" class="list" :infinite-scroll-disabled="ifbottom" :style="{ height }" v-else
|
|
22
|
-
v-bind="props">
|
|
23
|
-
<li v-for="i in list" :key="i[id]" class="list-item">
|
|
24
|
-
<div class="checkbox">
|
|
25
|
-
{{ i[name] }}
|
|
26
|
-
<ExtraComponent :i="i" v-if="props.extra"></ExtraComponent>
|
|
27
|
-
</div>
|
|
28
|
-
</li>
|
|
29
|
-
</ul>
|
|
30
|
-
</template>
|
|
31
|
-
|
|
32
|
-
<script lang="ts" setup>
|
|
33
|
-
import { ref, computed, watch } from "vue";
|
|
34
|
-
import type { PropType, FunctionalComponent, VNode } from "vue";
|
|
35
|
-
type SearchFunction = (page: Number) => Promise<[]>;
|
|
36
|
-
type ExtraFunction = "false" | ((item: any) => VNode | String);
|
|
37
|
-
const props = defineProps({
|
|
38
|
-
search: {
|
|
39
|
-
type: Function as PropType<SearchFunction>,
|
|
40
|
-
required: true,
|
|
41
|
-
},
|
|
42
|
-
checkbox: {
|
|
43
|
-
type: Boolean,
|
|
44
|
-
required: false,
|
|
45
|
-
},
|
|
46
|
-
id: {
|
|
47
|
-
type: String,
|
|
48
|
-
required: true,
|
|
49
|
-
},
|
|
50
|
-
name: {
|
|
51
|
-
type: String,
|
|
52
|
-
required: false,
|
|
53
|
-
},
|
|
54
|
-
extra: {
|
|
55
|
-
type: null as PropType<ExtraFunction>,
|
|
56
|
-
required: false,
|
|
57
|
-
},
|
|
58
|
-
defaultSelection: {
|
|
59
|
-
type: Array,
|
|
60
|
-
required: false,
|
|
61
|
-
},
|
|
62
|
-
height: {
|
|
63
|
-
type: String,
|
|
64
|
-
required: false,
|
|
65
|
-
default: "272px"
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
const { search, id, name, extra, height } = props;
|
|
69
|
-
const list = ref<any[]>([]);
|
|
70
|
-
const page = ref(1);
|
|
71
|
-
const ifbottom = ref(false); //判断是否到底部,是的话就不再请求
|
|
72
|
-
const checkedList = ref<any[]>([]);
|
|
73
|
-
const loading = ref(false);
|
|
74
|
-
type ExtraComponentProps = {
|
|
75
|
-
i: any;
|
|
76
|
-
};
|
|
77
|
-
type Events = {};
|
|
78
|
-
// 函数直接返回VNode模板会识别成[object Promise],因此需要转换成函数式组件
|
|
79
|
-
const ExtraComponent: FunctionalComponent<ExtraComponentProps, Events> = (
|
|
80
|
-
props,
|
|
81
|
-
context
|
|
82
|
-
) => {
|
|
83
|
-
const { i } = props;
|
|
84
|
-
// el-checkbox有固定高度,如果需要配置高度比较高,例如有换行的自定义extra,最好处理一下样式,例子:
|
|
85
|
-
// :deep(.el-checkbox) {
|
|
86
|
-
// padding: 6px 16px !important;
|
|
87
|
-
// display: flex;
|
|
88
|
-
// align-items: baseline;
|
|
89
|
-
// height: auto;
|
|
90
|
-
// }
|
|
91
|
-
return extra && extra !== "false" ? extra(i) : "";
|
|
92
|
-
};
|
|
93
|
-
const updateCheckedList = (newSelection: any[]) => {
|
|
94
|
-
checkedList.value = newSelection.map((item) => {
|
|
95
|
-
return typeof item === "object" ? item[id] : item;
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
watch(
|
|
99
|
-
() => props.defaultSelection,
|
|
100
|
-
(NewVal = [], oldVal = []) => {
|
|
101
|
-
updateCheckedList(NewVal);
|
|
102
|
-
},
|
|
103
|
-
{ immediate: true }
|
|
104
|
-
);
|
|
105
|
-
const reset = () => {
|
|
106
|
-
lowReset();
|
|
107
|
-
checkedList.value = [];
|
|
108
|
-
};
|
|
109
|
-
const lowReset = () => {
|
|
110
|
-
page.value = 1;
|
|
111
|
-
list.value = [];
|
|
112
|
-
ifbottom.value = false;
|
|
113
|
-
};
|
|
114
|
-
const loadList = async () => {
|
|
115
|
-
if (loading.value) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
if (ifbottom.value) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
loading.value = true;
|
|
122
|
-
const resList = await search(page.value);
|
|
123
|
-
if (resList && resList.length > 0) {
|
|
124
|
-
list.value = [...list.value, ...resList];
|
|
125
|
-
page.value += 1;
|
|
126
|
-
} else {
|
|
127
|
-
ifbottom.value = true;
|
|
128
|
-
}
|
|
129
|
-
loading.value = false;
|
|
130
|
-
return
|
|
131
|
-
};
|
|
132
|
-
const refreshList = async() => {
|
|
133
|
-
lowReset();
|
|
134
|
-
await loadList();
|
|
135
|
-
return
|
|
136
|
-
};
|
|
137
|
-
const selectInfo =
|
|
138
|
-
computed(() =>
|
|
139
|
-
list.value.filter((item) => checkedList.value.includes(item[id]))
|
|
140
|
-
) || {};
|
|
141
|
-
defineExpose({
|
|
142
|
-
reset,
|
|
143
|
-
lowReset,
|
|
144
|
-
loadList,
|
|
145
|
-
selectInfo,
|
|
146
|
-
list,
|
|
147
|
-
ifbottom,
|
|
148
|
-
refreshList,
|
|
149
|
-
loading,
|
|
150
|
-
});
|
|
151
|
-
</script>
|
|
152
|
-
|
|
153
|
-
<style lang="less" scoped>
|
|
154
|
-
.list {
|
|
155
|
-
overflow: auto;
|
|
156
|
-
padding: 0;
|
|
157
|
-
margin: 0;
|
|
158
|
-
.checkbox {
|
|
159
|
-
width: calc(100% - 32px);
|
|
160
|
-
padding: 0 16px;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
</style>
|
|
Binary file
|
package/src/assets/logo.png
DELETED
|
Binary file
|
|
@@ -1,79 +0,0 @@
|
|
|
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>
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
<!-- @format -->
|
|
2
|
-
|
|
3
|
-
<!--
|
|
4
|
-
* @Author: 陈德立*******419287484@qq.com
|
|
5
|
-
* @Date: 2023-11-09 10:01:20
|
|
6
|
-
* @LastEditTime: 2024-11-21 19:14:22
|
|
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 { inject, shallowRef, computed } from "vue";
|
|
18
|
-
import { formLoadingKey } from "../../../injectKey";
|
|
19
|
-
import ImgMask from "../img-mask/index.vue";
|
|
20
|
-
import type { InputGraphicVerification } from "../../../types/componentsProps";
|
|
21
|
-
import type { ComponentType } from "../../../types/componentType";
|
|
22
|
-
const { item, componentType = "Element Plus", loading = false } = defineProps<{ item: any, componentType?: ComponentType, loading?: boolean }>();
|
|
23
|
-
const {
|
|
24
|
-
graphicSrc = "",
|
|
25
|
-
graphicAlt = "",
|
|
26
|
-
getGraphic = () => { },
|
|
27
|
-
key,
|
|
28
|
-
}: InputGraphicVerification = item;
|
|
29
|
-
|
|
30
|
-
const { formLoading } = inject<any>(formLoadingKey, false);
|
|
31
|
-
const verificationLoading = computed(() => {
|
|
32
|
-
return formLoading?.value || loading
|
|
33
|
-
})
|
|
34
|
-
const graphicClick = async () => {
|
|
35
|
-
// console.log('click', getGraphic);
|
|
36
|
-
if (getGraphic && !verificationLoading?.value) {
|
|
37
|
-
await getGraphic();
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const inputType = shallowRef(EInput)
|
|
43
|
-
|
|
44
|
-
switch (componentType) {
|
|
45
|
-
case "Element Plus":
|
|
46
|
-
inputType.value = EInput
|
|
47
|
-
break;
|
|
48
|
-
case "Ant Design Vue":
|
|
49
|
-
inputType.value = AInput
|
|
50
|
-
break;
|
|
51
|
-
default:
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
</script>
|
|
55
|
-
|
|
56
|
-
<template>
|
|
57
|
-
<div class="input-graphic-verification">
|
|
58
|
-
<component :is="inputType" :item="item" class="input" />
|
|
59
|
-
<ImgMask class="graphic" :imgSrc="graphicSrc" v-if="verificationLoading" />
|
|
60
|
-
<img v-else class="graphic" @click="graphicClick" :src="graphicSrc" :alt="graphicAlt || `${key}`" />
|
|
61
|
-
</div>
|
|
62
|
-
</template>
|
|
63
|
-
|
|
64
|
-
<style lang="less" scoped>
|
|
65
|
-
.input-graphic-verification {
|
|
66
|
-
display: flex;
|
|
67
|
-
gap: 12px;
|
|
68
|
-
width: 100%;
|
|
69
|
-
|
|
70
|
-
.input {
|
|
71
|
-
flex: auto;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.graphic {
|
|
75
|
-
width: 108px;
|
|
76
|
-
height: 43px;
|
|
77
|
-
object-fit: fill;
|
|
78
|
-
flex: none;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
</style>
|
|
@@ -1,56 +0,0 @@
|
|
|
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, ref } 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
|
-
const VerificationButtonRef = ref()
|
|
23
|
-
switch (componentType) {
|
|
24
|
-
case "Element Plus":
|
|
25
|
-
inputType.value = EInput;
|
|
26
|
-
mobileItem.template = {
|
|
27
|
-
append: () => {
|
|
28
|
-
return h(VerificationButton, {
|
|
29
|
-
getSmscode: mobileItem.getSmscode,
|
|
30
|
-
item,
|
|
31
|
-
ref: VerificationButtonRef
|
|
32
|
-
});
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
break;
|
|
36
|
-
case "Ant Design Vue":
|
|
37
|
-
inputType.value = AInput
|
|
38
|
-
mobileItem.template = {
|
|
39
|
-
suffix: () => {
|
|
40
|
-
return h(VerificationButton, {
|
|
41
|
-
getSmscode: mobileItem.getSmscode,
|
|
42
|
-
item,
|
|
43
|
-
ref: VerificationButtonRef
|
|
44
|
-
});
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
break;
|
|
48
|
-
default:
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
defineExpose({ VerificationButtonRef })
|
|
52
|
-
</script>
|
|
53
|
-
|
|
54
|
-
<template>
|
|
55
|
-
<component :is="inputType" :item="mobileItem" class="input" />
|
|
56
|
-
</template>
|
|
@@ -1,82 +0,0 @@
|
|
|
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
|
-
defineExpose({ buttonClick, reset })
|
|
67
|
-
</script>
|
|
68
|
-
|
|
69
|
-
<template>
|
|
70
|
-
<component :is="buttonName" class="verifiaction-button" :style="{
|
|
71
|
-
color: buttonType
|
|
72
|
-
? 'var(--color-primary, #409EFF)'
|
|
73
|
-
: 'var(--text-color-placeholder, #A8ABB2)',
|
|
74
|
-
cursor: buttonType ? 'pointer' : 'default',
|
|
75
|
-
}" @click="buttonClick" v-bind="buttonSetting">{{ buttonType ? defaultText : buttonText + "s" }}</component>
|
|
76
|
-
</template>
|
|
77
|
-
|
|
78
|
-
<style lang="less" scoped>
|
|
79
|
-
.verifiaction-button {
|
|
80
|
-
width: 109px;
|
|
81
|
-
}
|
|
82
|
-
</style>
|
|
@@ -1,75 +0,0 @@
|
|
|
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>
|
|
@@ -1,32 +0,0 @@
|
|
|
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>
|
|
@@ -1,37 +0,0 @@
|
|
|
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>
|
|
@@ -1,31 +0,0 @@
|
|
|
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>
|
|
@@ -1,53 +0,0 @@
|
|
|
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>
|