starfish-form-custom 1.0.8 → 1.0.9
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/{formAction-f843601f.mjs → formAction-0ddf845a.mjs} +1 -1
- package/dist/{index-4562877b.mjs → index-179be68d.mjs} +1 -1
- package/dist/{index-12dcef92.mjs → index-931a17a2.mjs} +1 -1
- package/dist/{index-2e0c01c5.mjs → index-e5516f4b.mjs} +2 -2
- package/dist/{main-91ffa57a.mjs → main-5981b80d.mjs} +192 -110
- package/dist/{starfish-form-91475fa0.mjs → starfish-form-d3ef7415.mjs} +1 -1
- package/dist/starfish-form.mjs +1 -1
- package/dist/style.css +6 -0
- package/package.json +1 -1
- package/src/components/CheckBox/index.vue +2 -2
- package/src/components/Date/index.vue +44 -3
- package/src/components/InputNumber/index.vue +81 -37
- package/src/components/Radio/index.vue +73 -29
- package/src/components/Selected/index.vue +89 -37
- package/src/components/Selecteds/index.vue +91 -37
- package/src/components/Switch/index.vue +7 -1
- package/src/components/Text/index.vue +85 -37
- package/src/components/TextArea/index.vue +88 -38
- package/src/components/Time/index.vue +4 -2
- package/src/styles/formedit.scss +4 -0
- package/src/utils/fieldConfig.ts +45 -45
- package/stats.html +1 -1
|
@@ -1,50 +1,104 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
2
|
+
<div
|
|
3
|
+
class="starfish-formitem"
|
|
4
|
+
:class="{
|
|
5
|
+
formCover: drag,
|
|
6
|
+
'starfish-vertical': labelalign != 'top',
|
|
7
|
+
[item.data.csslist?.join(' ')]: !!item.data.csslist,
|
|
8
|
+
}"
|
|
9
|
+
>
|
|
10
|
+
<div
|
|
11
|
+
class="label"
|
|
12
|
+
:class="'label_' + labelalign"
|
|
13
|
+
:style="{ width: labelWidth + 'px' }"
|
|
14
|
+
>
|
|
4
15
|
<label>{{ item.data.label }}{{ suffix }}</label>
|
|
5
16
|
<span v-if="item.data.required" class="item_require">*</span>
|
|
6
|
-
<el-tooltip
|
|
17
|
+
<el-tooltip
|
|
18
|
+
v-if="item.data.tip"
|
|
19
|
+
class="item"
|
|
20
|
+
effect="dark"
|
|
21
|
+
:content="item.data.tip"
|
|
22
|
+
placement="top"
|
|
23
|
+
>
|
|
7
24
|
<span class="tip iconfontui icon-tishi"></span>
|
|
8
25
|
</el-tooltip>
|
|
9
26
|
</div>
|
|
10
|
-
<div
|
|
11
|
-
|
|
12
|
-
|
|
27
|
+
<div
|
|
28
|
+
class="control"
|
|
29
|
+
:style="{ marginLeft: labelalign != 'top' ? labelWidth + 'px' : '' }"
|
|
30
|
+
>
|
|
31
|
+
<el-select
|
|
32
|
+
v-model="item.data.itemConfig.value"
|
|
33
|
+
:placeholder="item.data.placeholder"
|
|
34
|
+
v-if="drag"
|
|
35
|
+
multiple
|
|
36
|
+
:disabled="item.data.state === 'disabled'"
|
|
37
|
+
:readonly="item.data.state === 'readonly'"
|
|
38
|
+
:size="size"
|
|
39
|
+
>
|
|
40
|
+
<el-option
|
|
41
|
+
v-for="items in item.data.itemConfig.items"
|
|
42
|
+
:key="items.value"
|
|
43
|
+
:label="items.label"
|
|
44
|
+
:value="items.value"
|
|
45
|
+
/>
|
|
13
46
|
</el-select>
|
|
14
|
-
<el-select
|
|
15
|
-
|
|
47
|
+
<el-select
|
|
48
|
+
v-model="data[item.data.fieldName]"
|
|
49
|
+
:placeholder="item.data.placeholder"
|
|
50
|
+
v-if="!drag"
|
|
51
|
+
multiple
|
|
52
|
+
:size="size"
|
|
53
|
+
:disabled="item.data.state === 'disabled'"
|
|
54
|
+
:readonly="item.data.state === 'readonly'"
|
|
55
|
+
@focus="execFunc('onFocus')"
|
|
56
|
+
@blur="execFunc('onBlur')"
|
|
57
|
+
>
|
|
58
|
+
<el-option
|
|
59
|
+
v-for="items in item.data.itemConfig.items"
|
|
60
|
+
:key="items.value"
|
|
61
|
+
:label="items.label"
|
|
62
|
+
:value="items.value"
|
|
63
|
+
/>
|
|
16
64
|
</el-select>
|
|
17
65
|
</div>
|
|
18
66
|
</div>
|
|
19
67
|
</template>
|
|
20
68
|
<script lang="ts">
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
69
|
+
import {
|
|
70
|
+
defineComponent,
|
|
71
|
+
getCurrentInstance,
|
|
72
|
+
ComponentInternalInstance,
|
|
73
|
+
} from "vue";
|
|
74
|
+
import { getFormConfig } from "../../utils/fieldConfig";
|
|
75
|
+
import fieldProps from "../../utils/fieldProps";
|
|
76
|
+
import { useWatch } from "../../utils/customHooks";
|
|
77
|
+
export default defineComponent({
|
|
78
|
+
ControlType: "Selecteds", // 必须与文件名匹配
|
|
79
|
+
nameCn: "选择器多选",
|
|
80
|
+
icon: "icon-xuanzeqi",
|
|
81
|
+
formConfig: getFormConfig("Selecteds", [
|
|
82
|
+
{ fieldName: "placeholder", component: "Text" },
|
|
83
|
+
{ fieldName: "itemConfig", component: "KeyValueConfigMult" },
|
|
84
|
+
{ fieldName: "state", component: "Radio" },
|
|
85
|
+
]),
|
|
86
|
+
actionType: ["onChange", "onFocus", "onBlur"],
|
|
87
|
+
props: {
|
|
88
|
+
...fieldProps,
|
|
89
|
+
},
|
|
90
|
+
setup(props) {
|
|
91
|
+
const vm = getCurrentInstance() as ComponentInternalInstance;
|
|
92
|
+
useWatch(props);
|
|
93
|
+
return {
|
|
94
|
+
execFunc(type: string) {
|
|
95
|
+
if (props.item.data.action && props.item.data.action[type]) {
|
|
96
|
+
window.VApp.$Flex.funcExec(props.item.data.action[type], vm.proxy, [
|
|
97
|
+
props.item.data.fieldName,
|
|
98
|
+
]);
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
},
|
|
103
|
+
});
|
|
50
104
|
</script>
|
|
@@ -28,11 +28,17 @@
|
|
|
28
28
|
class="control"
|
|
29
29
|
:style="{ marginLeft: labelalign != 'top' ? labelWidth + 'px' : '' }"
|
|
30
30
|
>
|
|
31
|
-
<el-switch
|
|
31
|
+
<el-switch
|
|
32
|
+
v-model="item.data.default"
|
|
33
|
+
v-if="drag"
|
|
34
|
+
:size="size"
|
|
35
|
+
:disabled="item.data.state === 'disabled' || item.data.state === 'readonly'"
|
|
36
|
+
/>
|
|
32
37
|
<el-switch
|
|
33
38
|
v-model="data[item.data.fieldName]"
|
|
34
39
|
v-if="!drag"
|
|
35
40
|
:size="size"
|
|
41
|
+
:disabled="item.data.state === 'disabled' || item.data.state === 'readonly'"
|
|
36
42
|
/>
|
|
37
43
|
</div>
|
|
38
44
|
</div>
|
|
@@ -1,48 +1,96 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
2
|
+
<div
|
|
3
|
+
class="starfish-formitem"
|
|
4
|
+
:class="{
|
|
5
|
+
formCover: drag,
|
|
6
|
+
'starfish-vertical': labelalign != 'top',
|
|
7
|
+
[item.data.csslist?.join(' ')]: !!item.data.csslist,
|
|
8
|
+
}"
|
|
9
|
+
>
|
|
10
|
+
<div
|
|
11
|
+
class="label"
|
|
12
|
+
:class="'label_' + labelalign"
|
|
13
|
+
:style="{ width: labelWidth + 'px' }"
|
|
14
|
+
>
|
|
4
15
|
<label>{{ item.data.label }}{{ suffix }}</label>
|
|
5
16
|
<span v-if="item.data.required" class="item_require">*</span>
|
|
6
|
-
<el-tooltip
|
|
17
|
+
<el-tooltip
|
|
18
|
+
v-if="item.data.tip"
|
|
19
|
+
class="item"
|
|
20
|
+
effect="dark"
|
|
21
|
+
:content="item.data.tip"
|
|
22
|
+
placement="top"
|
|
23
|
+
>
|
|
7
24
|
<span class="tip iconfontui icon-tishi"></span>
|
|
8
25
|
</el-tooltip>
|
|
9
26
|
</div>
|
|
10
|
-
<div
|
|
11
|
-
|
|
12
|
-
|
|
27
|
+
<div
|
|
28
|
+
class="control"
|
|
29
|
+
:style="{ marginLeft: labelalign != 'top' ? labelWidth + 'px' : '' }"
|
|
30
|
+
>
|
|
31
|
+
<el-input
|
|
32
|
+
v-model="item.data.default"
|
|
33
|
+
:placeholder="item.data.placeholder"
|
|
34
|
+
v-if="drag"
|
|
35
|
+
:size="size"
|
|
36
|
+
clearable
|
|
37
|
+
:disabled="item.data.state === 'disabled'"
|
|
38
|
+
:readonly="item.data.state === 'readonly'"
|
|
39
|
+
:maxlength="item.data.maxLength"
|
|
40
|
+
:minlength="item.data.minLength"
|
|
41
|
+
/>
|
|
42
|
+
<el-input
|
|
43
|
+
v-model="data[item.data.fieldName]"
|
|
44
|
+
:placeholder="item.data.placeholder"
|
|
45
|
+
v-if="!drag"
|
|
46
|
+
:size="size"
|
|
47
|
+
:disabled="item.data.state === 'disabled'"
|
|
48
|
+
:readonly="item.data.state === 'readonly'"
|
|
49
|
+
:maxlength="item.data.maxLength"
|
|
50
|
+
:minlength="item.data.minLength"
|
|
51
|
+
clearable
|
|
52
|
+
@focus="execFunc('onFocus')"
|
|
53
|
+
@blur="execFunc('onBlur')"
|
|
54
|
+
/>
|
|
13
55
|
</div>
|
|
14
56
|
</div>
|
|
15
57
|
</template>
|
|
16
58
|
<script lang="ts">
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
59
|
+
import {
|
|
60
|
+
defineComponent,
|
|
61
|
+
getCurrentInstance,
|
|
62
|
+
ComponentInternalInstance,
|
|
63
|
+
} from "vue";
|
|
64
|
+
import { getFormConfig } from "../../utils/fieldConfig";
|
|
65
|
+
import fieldProps from "../../utils/fieldProps";
|
|
66
|
+
import { useWatch } from "../../utils/customHooks";
|
|
67
|
+
export default defineComponent({
|
|
68
|
+
ControlType: "Text", // 必须与文件名匹配
|
|
69
|
+
nameCn: "文本框",
|
|
70
|
+
icon: "icon-wenbenkuang",
|
|
71
|
+
formConfig: getFormConfig("Text", [
|
|
72
|
+
{ fieldName: "default", component: "Text" },
|
|
73
|
+
{ fieldName: "placeholder", component: "Text" },
|
|
74
|
+
{ fieldName: "maxLength", component: "InputNumber" },
|
|
75
|
+
{ fieldName: "minLength", component: "InputNumber" },
|
|
76
|
+
{ fieldName: "state", component: "Radio" },
|
|
77
|
+
]),
|
|
78
|
+
actionType: ["onChange", "onFocus", "onBlur"],
|
|
79
|
+
props: {
|
|
80
|
+
...fieldProps,
|
|
81
|
+
},
|
|
82
|
+
setup(props) {
|
|
83
|
+
const vm = getCurrentInstance() as ComponentInternalInstance;
|
|
84
|
+
useWatch(props);
|
|
85
|
+
return {
|
|
86
|
+
execFunc(type: string) {
|
|
87
|
+
if (props.item.data.action && props.item.data.action[type]) {
|
|
88
|
+
window.VApp.$Flex.funcExec(props.item.data.action[type], vm.proxy, [
|
|
89
|
+
props.item.data.fieldName,
|
|
90
|
+
]);
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
});
|
|
48
96
|
</script>
|
|
@@ -1,49 +1,99 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
2
|
+
<div
|
|
3
|
+
class="starfish-formitem"
|
|
4
|
+
:class="{
|
|
5
|
+
formCover: drag,
|
|
6
|
+
'starfish-vertical': labelalign != 'top',
|
|
7
|
+
[item.data.csslist?.join(' ')]: !!item.data.csslist,
|
|
8
|
+
}"
|
|
9
|
+
>
|
|
10
|
+
<div
|
|
11
|
+
class="label"
|
|
12
|
+
:class="'label_' + labelalign"
|
|
13
|
+
:style="{ width: labelWidth + 'px' }"
|
|
14
|
+
>
|
|
4
15
|
<label>{{ item.data.label }}{{ suffix }}</label>
|
|
5
16
|
<span v-if="item.data.required" class="item_require">*</span>
|
|
6
|
-
<el-tooltip
|
|
17
|
+
<el-tooltip
|
|
18
|
+
v-if="item.data.tip"
|
|
19
|
+
class="item"
|
|
20
|
+
effect="dark"
|
|
21
|
+
:content="item.data.tip"
|
|
22
|
+
placement="top"
|
|
23
|
+
>
|
|
7
24
|
<span class="tip iconfontui icon-tishi"></span>
|
|
8
25
|
</el-tooltip>
|
|
9
26
|
</div>
|
|
10
|
-
<div
|
|
11
|
-
|
|
12
|
-
|
|
27
|
+
<div
|
|
28
|
+
class="control"
|
|
29
|
+
:style="{ marginLeft: labelalign != 'top' ? labelWidth + 'px' : '' }"
|
|
30
|
+
>
|
|
31
|
+
<el-input
|
|
32
|
+
type="textarea"
|
|
33
|
+
v-model="item.data.default"
|
|
34
|
+
:placeholder="item.data.placeholder"
|
|
35
|
+
v-if="drag"
|
|
36
|
+
:disabled="item.data.state === 'disabled'"
|
|
37
|
+
:readonly="item.data.state === 'readonly'"
|
|
38
|
+
:maxlength="item.data.maxLength"
|
|
39
|
+
:minlength="item.data.minLength"
|
|
40
|
+
:autosize="item.data.autoHeight"
|
|
41
|
+
:size="size"
|
|
42
|
+
/>
|
|
43
|
+
<el-input
|
|
44
|
+
type="textarea"
|
|
45
|
+
v-if="!drag"
|
|
46
|
+
v-model="data[item.data.fieldName]"
|
|
47
|
+
:placeholder="item.data.placeholder"
|
|
48
|
+
:disabled="item.data.state === 'disabled'"
|
|
49
|
+
:readonly="item.data.state === 'readonly'"
|
|
50
|
+
:maxlength="item.data.maxLength"
|
|
51
|
+
:minlength="item.data.minLength"
|
|
52
|
+
:autosize="item.data.autoHeight"
|
|
53
|
+
:size="size"
|
|
54
|
+
@focus="execFunc('onFocus')"
|
|
55
|
+
@blur="execFunc('onBlur')"
|
|
56
|
+
/>
|
|
13
57
|
</div>
|
|
14
58
|
</div>
|
|
15
59
|
</template>
|
|
16
60
|
<script lang="ts">
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
61
|
+
import {
|
|
62
|
+
defineComponent,
|
|
63
|
+
getCurrentInstance,
|
|
64
|
+
ComponentInternalInstance,
|
|
65
|
+
} from "vue";
|
|
66
|
+
import { getFormConfig } from "../../utils/fieldConfig";
|
|
67
|
+
import fieldProps from "../../utils/fieldProps";
|
|
68
|
+
import { useWatch } from "../../utils/customHooks";
|
|
69
|
+
export default defineComponent({
|
|
70
|
+
ControlType: "TextArea", // 必须与文件名匹配
|
|
71
|
+
nameCn: "文本域",
|
|
72
|
+
icon: "icon-textarea",
|
|
73
|
+
formConfig: getFormConfig("TextArea", [
|
|
74
|
+
{ fieldName: "default", component: "Text" },
|
|
75
|
+
{ fieldName: "placeholder", component: "Text" },
|
|
76
|
+
{ fieldName: "maxLength", component: "InputNumber" },
|
|
77
|
+
{ fieldName: "minLength", component: "InputNumber" },
|
|
78
|
+
{ fieldName: "autoHeight", component: "Switch" },
|
|
79
|
+
{ fieldName: "state", component: "Radio" },
|
|
80
|
+
]),
|
|
81
|
+
actionType: ["onChange", "onFocus", "onBlur"],
|
|
82
|
+
props: {
|
|
83
|
+
...fieldProps,
|
|
84
|
+
},
|
|
85
|
+
setup(props) {
|
|
86
|
+
const vm = getCurrentInstance() as ComponentInternalInstance;
|
|
87
|
+
useWatch(props);
|
|
88
|
+
return {
|
|
89
|
+
execFunc(type: string) {
|
|
90
|
+
if (props.item.data.action && props.item.data.action[type]) {
|
|
91
|
+
window.VApp.$Flex.funcExec(props.item.data.action[type], vm.proxy, [
|
|
92
|
+
props.item.data.fieldName,
|
|
93
|
+
]);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
});
|
|
49
99
|
</script>
|
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
</el-tooltip>
|
|
9
9
|
</div>
|
|
10
10
|
<div class="control" :style="{marginLeft: labelalign != 'top'?labelWidth + 'px': ''}">
|
|
11
|
-
<el-time-select v-model="item.data.default" start="08:30" step="00:15" end="18:30" :size="size" :
|
|
12
|
-
|
|
11
|
+
<el-time-select v-model="item.data.default" start="08:30" step="00:15" end="18:30" :size="size" :disabled="item.data.state === 'disabled'"
|
|
12
|
+
:readonly="item.data.state === 'readonly'" :placeholder="item.data.placeholder" v-if="drag"></el-time-select>
|
|
13
|
+
<el-time-select v-model="data[item.data.fieldName]" start="08:30" step="00:15" end="18:30" :size="size" :disabled="item.data.state === 'disabled'"
|
|
14
|
+
:readonly="item.data.state === 'readonly'" :placeholder="item.data.placeholder" v-if="!drag"></el-time-select>
|
|
13
15
|
</div>
|
|
14
16
|
</div>
|
|
15
17
|
</template>
|