@cicctencent/formily 0.0.0-stage → 0.0.1
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/.eslintrc.js +40 -0
- package/.prettierrc.js +28 -0
- package/.vscode/launch.json +23 -0
- package/CHANGELOG.md +8 -0
- package/README.md +22 -2
- package/babel.config.js +3 -0
- package/build/build.js +96 -0
- package/build/rollup.config.bundle.js +63 -0
- package/build/update.version.js +35 -0
- package/dist/index.css +2516 -0
- package/dist/index.js +8377 -0
- package/dist/schema-field/index.css +2466 -0
- package/dist/schema-field/index.js +8213 -0
- package/dist/transform/index.js +551 -0
- package/dist/validate/index.js +1104 -0
- package/dist/vue-form/index.css +2516 -0
- package/dist/vue-form/index.js +8359 -0
- package/docs/.vuepress/client.ts +15 -0
- package/docs/.vuepress/components/code-preview.vue +203 -0
- package/docs/.vuepress/components/highlight.ts +53 -0
- package/docs/.vuepress/config.ts +39 -0
- package/docs/.vuepress/util.ts +7 -0
- package/docs/README.md +30 -0
- package/docs/components/anyOf.md +26 -0
- package/docs/components/array-cards.md +12 -0
- package/docs/components/array-collapse.md +12 -0
- package/docs/components/array-items.md +12 -0
- package/docs/components/array-table.md +12 -0
- package/docs/components/array-tabs.md +16 -0
- package/docs/components/cascader.md +12 -0
- package/docs/components/checkbox.md +12 -0
- package/docs/components/event.md +27 -0
- package/docs/components/hotArea.md +25 -0
- package/docs/components/index.md +4 -0
- package/docs/components/input.md +30 -0
- package/docs/components/layout-group.md +19 -0
- package/docs/components/link.md +22 -0
- package/docs/components/oneOf.md +8 -0
- package/docs/components/radio.md +12 -0
- package/docs/components/rich-editor.md +21 -0
- package/docs/components/select.md +34 -0
- package/docs/components/space.md +11 -0
- package/docs/components/switch.md +20 -0
- package/docs/components/text.md +21 -0
- package/docs/components/time-picker.md +11 -0
- package/docs/components/transfer.md +14 -0
- package/docs/components/upload-button.md +28 -0
- package/docs/demos/any-of/index.vue +66 -0
- package/docs/demos/array-cards/index.vue +105 -0
- package/docs/demos/array-collapse/index.vue +155 -0
- package/docs/demos/array-items/index.vue +171 -0
- package/docs/demos/array-table/index.vue +115 -0
- package/docs/demos/array-tabs/index.vue +56 -0
- package/docs/demos/cascader/index.vue +297 -0
- package/docs/demos/checkbox/index.vue +39 -0
- package/docs/demos/event/index.vue +436 -0
- package/docs/demos/hotArea/index.vue +240 -0
- package/docs/demos/index.vue +36 -0
- package/docs/demos/input/index.vue +46 -0
- package/docs/demos/layout-group/index.vue +51 -0
- package/docs/demos/link/index.vue +32 -0
- package/docs/demos/radio/index.vue +36 -0
- package/docs/demos/rich-editor/index.vue +22 -0
- package/docs/demos/select/index.vue +76 -0
- package/docs/demos/space/index.vue +93 -0
- package/docs/demos/switch/index.vue +31 -0
- package/docs/demos/text/index.vue +38 -0
- package/docs/demos/time-picker/index.vue +39 -0
- package/docs/demos/transfer/index.vue +26 -0
- package/docs/demos/upload-button/index.vue +27 -0
- package/docs/demos/x-data/add-button-title.vue +101 -0
- package/docs/demos/x-data/send-message.vue +33 -0
- package/docs/demos/x-reactions/any-of.vue +40 -0
- package/docs/demos/x-reactions/x-reactions.vue +39 -0
- package/docs/guide/component-extend.md +23 -0
- package/docs/guide/extra-bury-report.md +64 -0
- package/docs/guide/schema.md +22 -0
- package/docs/guide/x-data.md +41 -0
- package/docs/guide/x-reactions.md +20 -0
- package/example/.browserslistrc +4 -0
- package/example/.eslintrc.js +20 -0
- package/example/README.md +24 -0
- package/example/index.html +15 -0
- package/example/jest.config.js +26 -0
- package/example/package.json +50 -0
- package/example/public/favicon.ico +0 -0
- package/example/public/index.html +17 -0
- package/example/src/App.vue +25 -0
- package/example/src/assets/logo.png +0 -0
- package/example/src/components/HelloWorld.vue +148 -0
- package/example/src/components/group/index.vue +16 -0
- package/example/src/components/uploadBtn/index.vue +44 -0
- package/example/src/components/uploadBtn/upload-icon.svg +6 -0
- package/example/src/layout/component/Aside.vue +39 -0
- package/example/src/layout/component/Main.vue +9 -0
- package/example/src/layout/index.vue +15 -0
- package/example/src/main.ts +17 -0
- package/example/src/router/index.ts +99 -0
- package/example/src/shims-vue.d.ts +6 -0
- package/example/src/store/index.ts +9 -0
- package/example/src/views/demo/any-of/data.ts +38 -0
- package/example/src/views/demo/any-of/index.vue +35 -0
- package/example/src/views/demo/array-cards/data.ts +65 -0
- package/example/src/views/demo/array-cards/index.vue +33 -0
- package/example/src/views/demo/array-items/data.ts +29 -0
- package/example/src/views/demo/array-items/index.vue +33 -0
- package/example/src/views/demo/cloud-button/data.ts +14 -0
- package/example/src/views/demo/cloud-button/index.vue +22 -0
- package/example/src/views/demo/color-group/data.ts +15 -0
- package/example/src/views/demo/color-group/index.vue +22 -0
- package/example/src/views/demo/color-picker/data.ts +21 -0
- package/example/src/views/demo/color-picker/index.vue +33 -0
- package/example/src/views/demo/datatime/data.ts +62 -0
- package/example/src/views/demo/datatime/index.vue +22 -0
- package/example/src/views/demo/event/data.ts +184 -0
- package/example/src/views/demo/event/index.vue +33 -0
- package/example/src/views/demo/hot-area/data.ts +196 -0
- package/example/src/views/demo/hot-area/index.vue +33 -0
- package/example/src/views/demo/input/data.ts +39 -0
- package/example/src/views/demo/input/index.vue +33 -0
- package/example/src/views/demo/link/data.ts +23 -0
- package/example/src/views/demo/link/index.vue +22 -0
- package/example/src/views/demo/one-of/data.ts +139 -0
- package/example/src/views/demo/one-of/index.vue +33 -0
- package/example/src/views/demo/rich-editor/data.ts +12 -0
- package/example/src/views/demo/rich-editor/index.vue +24 -0
- package/example/src/views/demo/select/data.ts +38 -0
- package/example/src/views/demo/select/index.vue +33 -0
- package/example/src/views/demo/upload-button/data1.ts +11 -0
- package/example/src/views/demo/upload-button/data2.ts +12 -0
- package/example/src/views/demo/upload-button/index.vue +42 -0
- package/example/tsconfig.json +32 -0
- package/example/vite.config.ts +12 -0
- package/jest.config.js +4 -0
- package/package.json +92 -4
- package/src/components/__builtins__/configs/index.ts +1 -0
- package/src/components/__builtins__/index.ts +2 -0
- package/src/components/__builtins__/shared/create-context.ts +54 -0
- package/src/components/__builtins__/shared/index.ts +7 -0
- package/src/components/__builtins__/shared/loading.ts +20 -0
- package/src/components/__builtins__/shared/portal.ts +43 -0
- package/src/components/__builtins__/shared/resolve-component.ts +22 -0
- package/src/components/__builtins__/shared/transform-component.ts +33 -0
- package/src/components/__builtins__/shared/types.ts +8 -0
- package/src/components/__builtins__/shared/utils.ts +35 -0
- package/src/components/__builtins__/styles/common.scss +22 -0
- package/src/components/__builtins__/styles/element-plus.scss +1094 -0
- package/src/components/any-of/index.ts +20 -0
- package/src/components/array-base/index.ts +413 -0
- package/src/components/array-base/style.scss +53 -0
- package/src/components/array-base/style.ts +2 -0
- package/src/components/array-cards/index.ts +253 -0
- package/src/components/array-cards/style.scss +33 -0
- package/src/components/array-cards/style.ts +7 -0
- package/src/components/array-collapse/index.ts +381 -0
- package/src/components/array-collapse/style.scss +38 -0
- package/src/components/array-collapse/style.ts +10 -0
- package/src/components/array-items/index.ts +213 -0
- package/src/components/array-items/style.scss +82 -0
- package/src/components/array-items/style.ts +4 -0
- package/src/components/array-table/index.ts +567 -0
- package/src/components/array-table/style.scss +84 -0
- package/src/components/array-table/style.ts +11 -0
- package/src/components/array-tabs/index.ts +141 -0
- package/src/components/array-tabs/style.scss +16 -0
- package/src/components/array-tabs/style.ts +5 -0
- package/src/components/base/AnyOf/index.ts +155 -0
- package/src/components/base/AnyOf/index.vue +111 -0
- package/src/components/base/CloudButton/index.ts +46 -0
- package/src/components/base/CloudButton/index.vue +128 -0
- package/src/components/base/ColorGroup/index.ts +57 -0
- package/src/components/base/ColorGroup/index.vue +30 -0
- package/src/components/base/ColorPicker/index.ts +45 -0
- package/src/components/base/ColorPicker/index.vue +50 -0
- package/src/components/base/Container/index.vue +39 -0
- package/src/components/base/HotArea/index.ts +698 -0
- package/src/components/base/HotArea/index.vue +565 -0
- package/src/components/base/HotArea/type.ts +18 -0
- package/src/components/base/Input/index.vue +150 -0
- package/src/components/base/LayoutGroup/index.vue +40 -0
- package/src/components/base/Link/index.vue +43 -0
- package/src/components/base/Middleware/index.ts +235 -0
- package/src/components/base/Middleware/index.vue +169 -0
- package/src/components/base/OneOf/index.ts +105 -0
- package/src/components/base/OneOf/index.vue +85 -0
- package/src/components/base/RichEditor/index.ts +13 -0
- package/src/components/base/RichEditor/index.vue +120 -0
- package/src/components/base/RichEditor/options.ts +24 -0
- package/src/components/base/Select/index.ts +106 -0
- package/src/components/base/Select/index.vue +161 -0
- package/src/components/base/Switch/index.vue +42 -0
- package/src/components/base/Text/index.vue +47 -0
- package/src/components/base/event/index.ts +226 -0
- package/src/components/base/event/index.vue +356 -0
- package/src/components/cascader/index.ts +48 -0
- package/src/components/cascader/style.ts +5 -0
- package/src/components/checkbox/index.ts +166 -0
- package/src/components/checkbox/style.ts +5 -0
- package/src/components/cloud-button/index.ts +21 -0
- package/src/components/color-group/index.ts +18 -0
- package/src/components/color-picker/index.ts +18 -0
- package/src/components/container/index.ts +18 -0
- package/src/components/data-time/index.ts +24 -0
- package/src/components/date-picker/index.ts +51 -0
- package/src/components/date-picker/style.ts +4 -0
- package/src/components/editable/index.ts +261 -0
- package/src/components/editable/style.scss +55 -0
- package/src/components/editable/style.ts +5 -0
- package/src/components/el-form-item/index.ts +21 -0
- package/src/components/el-form-item/style.ts +3 -0
- package/src/components/event/index.ts +16 -0
- package/src/components/form/index.ts +94 -0
- package/src/components/form/style.scss +0 -0
- package/src/components/form/style.ts +3 -0
- package/src/components/form-button-group/index.ts +74 -0
- package/src/components/form-button-group/style.scss +0 -0
- package/src/components/form-button-group/style.ts +4 -0
- package/src/components/form-collapse/index.ts +215 -0
- package/src/components/form-collapse/style.scss +6 -0
- package/src/components/form-collapse/style.ts +4 -0
- package/src/components/form-dialog/index.ts +433 -0
- package/src/components/form-dialog/style.ts +4 -0
- package/src/components/form-drawer/index.ts +424 -0
- package/src/components/form-drawer/style.scss +21 -0
- package/src/components/form-drawer/style.ts +4 -0
- package/src/components/form-grid/index.ts +181 -0
- package/src/components/form-grid/style.scss +5 -0
- package/src/components/form-grid/style.ts +1 -0
- package/src/components/form-item/animation.scss +72 -0
- package/src/components/form-item/grid.scss +171 -0
- package/src/components/form-item/index.ts +642 -0
- package/src/components/form-item/style.scss +521 -0
- package/src/components/form-item/style.ts +2 -0
- package/src/components/form-item/var.scss +17 -0
- package/src/components/form-layout/index.ts +161 -0
- package/src/components/form-layout/style.scss +6 -0
- package/src/components/form-layout/style.ts +1 -0
- package/src/components/form-layout/useResponsiveFormLayout.ts +118 -0
- package/src/components/form-step/index.ts +210 -0
- package/src/components/form-step/style.ts +2 -0
- package/src/components/form-tab/index.ts +172 -0
- package/src/components/form-tab/style.scss +6 -0
- package/src/components/form-tab/style.ts +4 -0
- package/src/components/hot-area/index.ts +20 -0
- package/src/components/index.ts +49 -0
- package/src/components/input/index.ts +35 -0
- package/src/components/input/style.ts +4 -0
- package/src/components/input-number/index.ts +36 -0
- package/src/components/input-number/style.ts +3 -0
- package/src/components/layout-group/index.ts +18 -0
- package/src/components/link/index.ts +18 -0
- package/src/components/middleware/index.ts +21 -0
- package/src/components/one-of/index.ts +20 -0
- package/src/components/placeholder-input/index.ts +21 -0
- package/src/components/placeholder-input/index.vue +87 -0
- package/src/components/preview-text/index.ts +303 -0
- package/src/components/preview-text/style.ts +9 -0
- package/src/components/radio/index.ts +109 -0
- package/src/components/radio/style.ts +3 -0
- package/src/components/reset/index.ts +52 -0
- package/src/components/reset/style.ts +1 -0
- package/src/components/rich-editor/index.ts +18 -0
- package/src/components/row/index.ts +20 -0
- package/src/components/row/index.vue +53 -0
- package/src/components/select/index.ts +19 -0
- package/src/components/select/style.ts +5 -0
- package/src/components/space/index.ts +98 -0
- package/src/components/space/style.scss +24 -0
- package/src/components/space/style.ts +1 -0
- package/src/components/submit/index.ts +59 -0
- package/src/components/submit/style.ts +1 -0
- package/src/components/switch/index.ts +9 -0
- package/src/components/switch/style.ts +1 -0
- package/src/components/text/index.ts +21 -0
- package/src/components/time-picker/index.ts +21 -0
- package/src/components/time-picker/style.ts +4 -0
- package/src/components/transfer/index.ts +12 -0
- package/src/components/transfer/style.ts +1 -0
- package/src/components/upload/index.ts +136 -0
- package/src/components/upload/style.ts +2 -0
- package/src/components/upload-button/index.ts +21 -0
- package/src/components/upload-button/index.vue +199 -0
- package/src/createScemaField.ts +14 -0
- package/src/index.ts +41 -0
- package/src/schema-field/index.ts +11 -0
- package/src/scope.ts +29 -0
- package/src/transform/core.ts +404 -0
- package/src/transform/index.ts +11 -0
- package/src/transform/transform.ts +59 -0
- package/src/transform/utils/constant.ts +79 -0
- package/src/transform/utils/func.ts +145 -0
- package/src/typings/common.ts +37 -0
- package/src/typings/vue-shim.d.ts +7 -0
- package/src/typings/vue-test-utils.d.ts +11 -0
- package/src/utils/anyof_utils.ts +95 -0
- package/src/utils/common.ts +15 -0
- package/src/validate/index.ts +648 -0
- package/src/validate/utils/constant.ts +2 -0
- package/src/vue-form/index.ts +18 -0
- package/src/vue-form/index.vue +106 -0
- package/src/vue-form/useForm.ts +112 -0
- package/tests/data/anyof.ts +40 -0
- package/tests/data/image.ts +472 -0
- package/tests/fixtures/validate.ts +63 -0
- package/tests/unit/transform.spec.ts +253 -0
- package/tests/unit/utils.spec.ts +10 -0
- package/tests/unit/validate.spec.ts +256 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="formily-input-wrap" ref="triggerRef">
|
|
3
|
+
<el-input v-bind="$attrs" :modelValue="modelValue" @input="onChange">
|
|
4
|
+
<template #suffix>
|
|
5
|
+
<template v-if="appendToTrigger">
|
|
6
|
+
<el-tooltip
|
|
7
|
+
:raw-content="openRaw"
|
|
8
|
+
effect="light"
|
|
9
|
+
v-if="tipContent"
|
|
10
|
+
:content="tipContent"
|
|
11
|
+
:append-to="triggerRef"
|
|
12
|
+
>
|
|
13
|
+
<div class="tool-tip"></div>
|
|
14
|
+
</el-tooltip>
|
|
15
|
+
</template>
|
|
16
|
+
<template v-else>
|
|
17
|
+
<el-tooltip
|
|
18
|
+
:raw-content="openRaw"
|
|
19
|
+
effect="light"
|
|
20
|
+
v-if="tipContent"
|
|
21
|
+
:content="tipContent"
|
|
22
|
+
>
|
|
23
|
+
<div class="tool-tip"></div>
|
|
24
|
+
</el-tooltip>
|
|
25
|
+
</template>
|
|
26
|
+
</template>
|
|
27
|
+
<template #prepend v-if="prependSlot">
|
|
28
|
+
<span>{{ prependSlot }}</span>
|
|
29
|
+
</template>
|
|
30
|
+
<template #append v-if="appendSlot">
|
|
31
|
+
<span>{{ appendSlot }}</span>
|
|
32
|
+
</template>
|
|
33
|
+
</el-input>
|
|
34
|
+
<span class="description">{{ description }}</span>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script lang="ts">
|
|
39
|
+
import { defineComponent, computed, ref } from 'vue';
|
|
40
|
+
|
|
41
|
+
export default defineComponent({
|
|
42
|
+
name: 'FormilyInput',
|
|
43
|
+
props: {
|
|
44
|
+
modelValue: String,
|
|
45
|
+
toolTip: {
|
|
46
|
+
type: [String, Object],
|
|
47
|
+
default: '',
|
|
48
|
+
},
|
|
49
|
+
description: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: '',
|
|
52
|
+
},
|
|
53
|
+
// 挂载到Trigger
|
|
54
|
+
appendToTrigger: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false,
|
|
57
|
+
},
|
|
58
|
+
prependSlot: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: '',
|
|
61
|
+
},
|
|
62
|
+
appendSlot: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: '',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
emits: ['change'],
|
|
68
|
+
setup(props, { emit }) {
|
|
69
|
+
const triggerRef = ref();
|
|
70
|
+
const onChange = (value: string) => {
|
|
71
|
+
if (value.trim() === '') {
|
|
72
|
+
emit('change', value);
|
|
73
|
+
} else {
|
|
74
|
+
emit('change', value.trim());
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const tipContent = computed(() => {
|
|
79
|
+
if (props.toolTip.indexOf('埋点名') !== -1) {
|
|
80
|
+
return `<div class="buryReport-tip">输入埋点名,系统将补全埋点信息:<br>例 运营.可视化创造.<span>输入埋点名</span>.点击</div>`;
|
|
81
|
+
}
|
|
82
|
+
return props.toolTip;
|
|
83
|
+
});
|
|
84
|
+
// 是否打开HTML渲染
|
|
85
|
+
const openRaw = computed(() => {
|
|
86
|
+
return props.toolTip.indexOf('埋点名') !== -1;
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
return { tipContent, openRaw, onChange, triggerRef };
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<style lang="scss">
|
|
95
|
+
.buryReport-tip {
|
|
96
|
+
color: rgba(30, 37, 54, 0.4) !important;
|
|
97
|
+
font-weight: 500;
|
|
98
|
+
font-size: 14px;
|
|
99
|
+
line-height: 21px;
|
|
100
|
+
span {
|
|
101
|
+
background: #b9e2ff;
|
|
102
|
+
color: #b9c7d7;
|
|
103
|
+
padding: 3px 3px 3px 7px;
|
|
104
|
+
position: relative;
|
|
105
|
+
&::before {
|
|
106
|
+
content: '';
|
|
107
|
+
display: block;
|
|
108
|
+
width: 2px;
|
|
109
|
+
height: 13px;
|
|
110
|
+
background-color: #6b6a6a;
|
|
111
|
+
margin-right: 4px;
|
|
112
|
+
position: absolute;
|
|
113
|
+
left: 3px;
|
|
114
|
+
top: 5px;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
.formily-color-input {
|
|
119
|
+
.el-input--prefix .el-input__inner {
|
|
120
|
+
// padding-left: 34px !important;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.formily-input-wrap {
|
|
125
|
+
min-height: 40px;
|
|
126
|
+
.tool-tip {
|
|
127
|
+
width: 24px;
|
|
128
|
+
height: 24px;
|
|
129
|
+
object-fit: cover;
|
|
130
|
+
background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjMiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyMyAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CjxyZWN0IG9wYWNpdHk9IjAuNiIgd2lkdGg9IjIyLjIyMjIiIGhlaWdodD0iMjQiIGZpbGw9InVybCgjcGF0dGVybjApIi8+CjxkZWZzPgo8cGF0dGVybiBpZD0icGF0dGVybjAiIHBhdHRlcm5Db250ZW50VW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiB3aWR0aD0iMSIgaGVpZ2h0PSIxIj4KPHVzZSB4bGluazpocmVmPSIjaW1hZ2UwXzQzM183NDI2IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIC0wLjAwMzgxMjYyKSBzY2FsZSgwLjAxNDcwNTkgMC4wMTM2MTY2KSIvPgo8L3BhdHRlcm4+CjxpbWFnZSBpZD0iaW1hZ2UwXzQzM183NDI2IiB3aWR0aD0iNjgiIGhlaWdodD0iNzQiIHhsaW5rOmhyZWY9ImRhdGE6aW1hZ2UvcG5nO2Jhc2U2NCxpVkJPUncwS0dnb0FBQUFOU1VoRVVnQUFBRVFBQUFCS0NBWUFBQUFDR2ZMQ0FBQURNRWxFUVZSNEFlMlpNVzRiUVF4RmZjQTBQa0I2TjZtTkZHbmRHbkNYQXdSd2xTcElrMHRJY3VRN0NEbkVHbC93VDZpUGtiSkRjbFlTd0FFR0k2NVdKUC9iUDdNR2ZEUFZPQ0J3Y3hCVk1CVVFNVUVCS1NCQ1FNSnlTQUVSQWhLV1F3cUlFSkN3SEZKQWhJQ0U1WkFDSWdRa0xJY1VFQ0VnWVRua2tvQnNYbDRuem0vUDN5ZE9YcE5lRndrWGRRaUZmdjd5TUgyNC9UaHI0bDZBV21vc0FnUWdlaUFjZzBVSGpZUXpGTWovUUFBU0o4Vmk1YlZUWUVaQkdRWUV3bHFDSUJhZzVnNkNhdVhDZDlsakNKQVdqRjRRTGFHdHZObFEwb0ZBdUgyYUdTQVVUcXVHM3VPTlU0Rm9vOWxQejRwVXQ2QjJ4a2dEb2cyT2hFSGhJMnFtQUlrMnRsci9udTQrM2UvbmFyMmwzbGxydExZV0NRUEJHOE9lR2IzTzJPMytIUHdldVhDdFp5aVVucmVZMWdrRHNjMzB3a0F6OXZjRTY4bGp6Ni9JZVJJQ29tS1U5cHc0d3lHb28wNzF1aVFOaU9lcEV0aHFzLzEzaG16NnpoRG13SnJoa2hBUVdoenJKWXdNbDdpQjJPMFNjVWMyU09zU3o3WnhBN0dGbzBEd2Uwd0k4SWl3VUsxTFBJZXJHMGpXZHJGZ2tkTWp3Z0xCNTBodkxpRFJwMkFGS0pDTTg4am03SFhjMllHZ1lRdjRLb0ZndjlPVzBmT0RibUcrQXZKT0pCTkk1SUc1dGt5a0lCMmg2MVVEc1hzKzQ2MEFPQVZFTEpJSjVLcmZNdVJ5MVVDeUxaNmRMd0xYZGFoQ1FNU1dkSVZkSXlKc0hudmdlODQzTjVEc2czVUVFTS9mU0NsQUlBYUFJaU1MU0RTUEd3akUyMjNqc2VlUG43Lysvc2ZmQ3NHVHhjVDNQY051RjQ4N1VDc0V4RzZiWHBkQXJJVnc3SE1QRkp2akxFQWlMc2tHWXQzcWhSRjJDQktvUzNxYUFSVGNqL240OUhVL0dXT2Q2dzdjYTkyQnZyd2p0R1ZZVkJ0Q3ZOVElycDBDQk9Lekc1c0RkRVROTkNBUVlQY3hMRHpTS1FyRDg1WnJRVThGMG9LUzFTaWJ4NW1sNEROcnBBTkI0L3IwTXR6U0FwR1JsNkM1RGdGeURBb0Y5R3lsWXlDWWkwS3kxbUZBMkdETExSQ0RDYXRqNGg1T1hzUEsrM1RGZHdBMVlnd0hncVlwVm9YMXhpTkJFTzRpUUZpTWNFNDlmWVZFQ0tNY1lYdkQ1OFdCMkFZZ0VwTU93c3ByU3dHdy9ad2RpRFp6Q2ZGWkhYSUpBTFNIQWlKRUNrZ0JFUUlTbGtNS2lCQ1FzQnhTUUlTQWhPV1FBaUlFSkN5SEZCQWhJR0U1UklDOEFiM1VzWnR1eFNuaEFBQUFBRWxGVGtTdVFtQ0MiLz4KPC9kZWZzPgo8L3N2Zz4K');
|
|
131
|
+
background-repeat: no-repeat;
|
|
132
|
+
background-size: cover;
|
|
133
|
+
}
|
|
134
|
+
.color-box {
|
|
135
|
+
width: 20px !important;
|
|
136
|
+
display: block;
|
|
137
|
+
height: 20px;
|
|
138
|
+
border: 1px solid rgba(0, 0, 0, 0.08);
|
|
139
|
+
margin-right: 20px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.description {
|
|
143
|
+
display: block;
|
|
144
|
+
font-size: 12px;
|
|
145
|
+
color: #86909c;
|
|
146
|
+
line-height: 20px;
|
|
147
|
+
margin-top: 5px;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="style" class="layout-group" :class="{ borderBottom: borderBottom }">
|
|
3
|
+
<span v-if="title" class="layout-group-title">{{title}}</span>
|
|
4
|
+
<slot></slot>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
defineProps({
|
|
9
|
+
title:{
|
|
10
|
+
type:String,
|
|
11
|
+
default:"",
|
|
12
|
+
},
|
|
13
|
+
style:{
|
|
14
|
+
type:[Object,String],
|
|
15
|
+
default:""
|
|
16
|
+
},
|
|
17
|
+
borderBottom:{
|
|
18
|
+
type:Boolean,
|
|
19
|
+
default: true
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
</script>
|
|
23
|
+
<style lang="scss">
|
|
24
|
+
.layout-group{
|
|
25
|
+
padding:0 17px;
|
|
26
|
+
margin-bottom: 16px;
|
|
27
|
+
&.borderBottom{
|
|
28
|
+
border-bottom: 1px solid rgba(0,0,0,.1);
|
|
29
|
+
}
|
|
30
|
+
&-title{
|
|
31
|
+
font-weight: 600;
|
|
32
|
+
font-size: 16px;
|
|
33
|
+
line-height: 24px;
|
|
34
|
+
/* identical to box height, or 150% */
|
|
35
|
+
color: #020202;
|
|
36
|
+
display: block;
|
|
37
|
+
margin-bottom: 24px;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="link-wrap">
|
|
3
|
+
<el-link v-for="item in links" :key="item.href" :href="item.href" :type="type" :target="target">{{item.label}}</el-link>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
import {defineComponent,PropType} from 'vue'
|
|
11
|
+
|
|
12
|
+
export default defineComponent({
|
|
13
|
+
name:'Link',
|
|
14
|
+
props:{
|
|
15
|
+
links:{
|
|
16
|
+
type: Array as PropType<any[]>,
|
|
17
|
+
default:() =>{
|
|
18
|
+
return [] as any[]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
target:{
|
|
22
|
+
type:String,
|
|
23
|
+
default: '_blank'
|
|
24
|
+
},
|
|
25
|
+
type:{
|
|
26
|
+
type: String,
|
|
27
|
+
default: 'primary'
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
setup(){
|
|
31
|
+
|
|
32
|
+
return {}
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<style lang="scss" scoped>
|
|
38
|
+
.link-wrap{
|
|
39
|
+
.el-link+.el-link{
|
|
40
|
+
margin-left: 14px;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
</style>
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { createForm, Form, onFormInit, onFormValuesChange } from "@formily/core";
|
|
2
|
+
import { transformSchema } from "../../../transform/transform";
|
|
3
|
+
import { computed, getCurrentInstance, onMounted, ref, watch } from "vue";
|
|
4
|
+
import { ElMessage } from "@cicctencent/jtui";
|
|
5
|
+
import { cloneDeep, isEqual } from '@cicctencent/ark-util'
|
|
6
|
+
|
|
7
|
+
interface ParametersDescriptorConfig{
|
|
8
|
+
key: string;
|
|
9
|
+
schema: Record<string,any>;
|
|
10
|
+
form?: Form;
|
|
11
|
+
initValues?: any;
|
|
12
|
+
title: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default function(props,emits){
|
|
16
|
+
const ctx = getCurrentInstance();
|
|
17
|
+
// 显示对话框
|
|
18
|
+
const dialogVisible = ref<boolean>(false);
|
|
19
|
+
// 中间件name value
|
|
20
|
+
const nameValue = ref<string[]>([])
|
|
21
|
+
// 参数配置信息
|
|
22
|
+
const parametersDescriptorConfig = ref<ParametersDescriptorConfig[]>([])
|
|
23
|
+
// 是否存在未填字段
|
|
24
|
+
const parametersError = ref<boolean>(false);
|
|
25
|
+
// 中间件数据
|
|
26
|
+
const middlewareData = ref<any[]>([]);
|
|
27
|
+
// 额外参数配置信息
|
|
28
|
+
const parametersDescriptor = computed(()=> {
|
|
29
|
+
return JSON.parse(props.parametersDescriptor || '{}')
|
|
30
|
+
})
|
|
31
|
+
// 是否显示配置图标
|
|
32
|
+
const showConfigIcon = computed(()=>{
|
|
33
|
+
|
|
34
|
+
// 用来统计隐藏表单的数量
|
|
35
|
+
let hideCount = 0;
|
|
36
|
+
|
|
37
|
+
parametersDescriptorConfig.value.forEach(it => {
|
|
38
|
+
const res = showFormItem(it.schema);
|
|
39
|
+
// false 这个表单的数据是隐藏的
|
|
40
|
+
if(!res){
|
|
41
|
+
hideCount++;
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
// 所有表单都隐藏了,就不显示图标
|
|
45
|
+
if(hideCount === parametersDescriptorConfig.value.length){
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
return true
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
onMounted(() => {
|
|
52
|
+
// 初始化
|
|
53
|
+
initMiddleware();
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
watch(() => props.modelValue, (newVal,oldVal) =>{
|
|
57
|
+
if(!isEqual(newVal,oldVal)){
|
|
58
|
+
// 数据变化重新初始化
|
|
59
|
+
initMiddleware();
|
|
60
|
+
}
|
|
61
|
+
},{ deep: true})
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 点击配置额外属性
|
|
66
|
+
* @returns
|
|
67
|
+
*/
|
|
68
|
+
function handleConfigParametersDescriptor(){
|
|
69
|
+
// 没有选择中间件,不需要配置参数
|
|
70
|
+
if(!nameValue.value.length || props.readonly){
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
// 生成schema
|
|
74
|
+
// generateParametersDescriptorConfig();
|
|
75
|
+
dialogVisible.value = true;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* 初始化中间件
|
|
79
|
+
*/
|
|
80
|
+
function initMiddleware(){
|
|
81
|
+
// 初始化中间件选择框
|
|
82
|
+
console.log('initMiddleware',props.modelValue);
|
|
83
|
+
if(Array.isArray(props.modelValue)){
|
|
84
|
+
middlewareData.value = props.modelValue
|
|
85
|
+
nameValue.value = props.modelValue.map(it => it.name)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* 生成optionsSchema
|
|
90
|
+
*/
|
|
91
|
+
function generateParametersDescriptorConfig(){
|
|
92
|
+
// 生成配置之前,先清除之前的数据
|
|
93
|
+
parametersDescriptorConfig.value = []
|
|
94
|
+
middlewareData.value.forEach(it =>{
|
|
95
|
+
// 判断配置信息是否存在
|
|
96
|
+
if(parametersDescriptor.value[it.name] && !isEqual(parametersDescriptor.value[it.name], {})){
|
|
97
|
+
parametersDescriptorConfig.value.push({
|
|
98
|
+
key: it.name,
|
|
99
|
+
title: getMiddlewareName(it.name),
|
|
100
|
+
schema: transformSchema({schema: {
|
|
101
|
+
type: 'object',
|
|
102
|
+
properties: parametersDescriptor.value[it.name]
|
|
103
|
+
},ctx }),
|
|
104
|
+
initValues: it?.options || {}
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
parametersDescriptorConfig.value.forEach(it=>{
|
|
110
|
+
it.form = createForm({
|
|
111
|
+
effects(){
|
|
112
|
+
onFormInit(form => {
|
|
113
|
+
form.setValues(it.initValues)
|
|
114
|
+
})
|
|
115
|
+
onFormValuesChange(form => {
|
|
116
|
+
console.log('onFormValuesChange', form.values)
|
|
117
|
+
const middleware = middlewareData.value.find(m => m.name === it.key)
|
|
118
|
+
middleware.options = form.values
|
|
119
|
+
emitsData();
|
|
120
|
+
})
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* 获取中间件名称
|
|
127
|
+
* @param data
|
|
128
|
+
* @returns
|
|
129
|
+
*/
|
|
130
|
+
function getMiddlewareName(data: string){
|
|
131
|
+
let name = null;
|
|
132
|
+
for(let it of props.options){
|
|
133
|
+
if(it.value === data){
|
|
134
|
+
name = it.label
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return name;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* 校验表单
|
|
142
|
+
*/
|
|
143
|
+
async function validateForms(){
|
|
144
|
+
const forms = parametersDescriptorConfig.value.map(m => m.form)
|
|
145
|
+
for(let i in forms){
|
|
146
|
+
// 失败会调用 reject
|
|
147
|
+
await forms[i].validate();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* 提交额外属性配置
|
|
153
|
+
* @deprecated
|
|
154
|
+
*/
|
|
155
|
+
async function sumbitParametersDescripto(){
|
|
156
|
+
// 获取所有表单
|
|
157
|
+
const forms = parametersDescriptorConfig.value.map(m => m.form)
|
|
158
|
+
try {
|
|
159
|
+
for(let i in forms){
|
|
160
|
+
// 失败会调用 reject
|
|
161
|
+
await forms[i].validate();
|
|
162
|
+
}
|
|
163
|
+
// 关闭弹窗
|
|
164
|
+
dialogVisible.value = false;
|
|
165
|
+
// 更新中间件
|
|
166
|
+
emitsData()
|
|
167
|
+
return;
|
|
168
|
+
} catch (error) {
|
|
169
|
+
ElMessage.error({message: '请完善信息之后再提交', zIndex: 99999})
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* 更新数据
|
|
174
|
+
*/
|
|
175
|
+
let timer;
|
|
176
|
+
function emitsData(){
|
|
177
|
+
|
|
178
|
+
if(timer) clearTimeout(timer)
|
|
179
|
+
// 设置500毫秒的防抖
|
|
180
|
+
timer = setTimeout(async ()=>{
|
|
181
|
+
// 校验表单
|
|
182
|
+
try {
|
|
183
|
+
await validateForms()
|
|
184
|
+
parametersError.value = false
|
|
185
|
+
} catch (error) {
|
|
186
|
+
parametersError.value = true
|
|
187
|
+
}
|
|
188
|
+
emits('change', middlewareData.value);
|
|
189
|
+
},500)
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* 监听下拉选择框的变化
|
|
194
|
+
*/
|
|
195
|
+
watch(() => nameValue.value, () =>{
|
|
196
|
+
const _middlewareData = [];
|
|
197
|
+
nameValue.value.forEach(it =>{
|
|
198
|
+
const middleware = middlewareData.value.find(m => m.name === it)
|
|
199
|
+
// middlewareData存在了这个信息,不需要重新处理
|
|
200
|
+
if(middleware){
|
|
201
|
+
_middlewareData.push(middleware)
|
|
202
|
+
}else{
|
|
203
|
+
// 不存在
|
|
204
|
+
_middlewareData.push({name: it, options: {}})
|
|
205
|
+
}
|
|
206
|
+
})
|
|
207
|
+
middlewareData.value = cloneDeep(_middlewareData);
|
|
208
|
+
generateParametersDescriptorConfig();
|
|
209
|
+
emitsData();
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
function showFormItem(descriptor){
|
|
213
|
+
const keys = Object.keys(descriptor?.properties || {})
|
|
214
|
+
for(let i = 0; i < keys.length ; i++){
|
|
215
|
+
if(!descriptor.properties[keys[i]]?.['x-hidden']){
|
|
216
|
+
// 不完全是hiddle
|
|
217
|
+
return true;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
async function closeDialog(){
|
|
224
|
+
try {
|
|
225
|
+
// 批量校验表单
|
|
226
|
+
await validateForms();
|
|
227
|
+
} catch (error) {
|
|
228
|
+
//todo 处理校验失败的逻辑
|
|
229
|
+
}
|
|
230
|
+
dialogVisible.value = false;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
return { dialogVisible, parametersError, showConfigIcon, nameValue, parametersDescriptorConfig, handleConfigParametersDescriptor, sumbitParametersDescripto, showFormItem, closeDialog}
|
|
235
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="formily-middleware">
|
|
3
|
+
<div class="formily-middleware--select-box">
|
|
4
|
+
<div style="flex:1;">
|
|
5
|
+
<el-select collapse-tags multiple placeholder="请选择" v-model="nameValue" :disabled="readonly">
|
|
6
|
+
<el-option v-for="it in options" :label="it.label" :value="it.value"></el-option>
|
|
7
|
+
</el-select>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="formily-middleware--icon" @click="handleConfigParametersDescriptor" v-if="showConfigIcon">
|
|
10
|
+
<el-tooltip
|
|
11
|
+
content="参数配置"
|
|
12
|
+
placement="top-start"
|
|
13
|
+
effect="light"
|
|
14
|
+
>
|
|
15
|
+
<svg t="1678179509077" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2806" width="24" height="24"><path d="M660.992 997.376c-14.848 0-29.696-5.632-40.448-15.36-15.872-14.336-69.12-55.808-107.008-55.808-38.4 0-91.648 41.472-107.008 55.808-16.384 15.36-43.008 19.456-62.976 10.752l-3.072-1.536-154.112-89.088c-17.92-13.312-27.136-38.4-22.016-59.904 4.608-20.992 13.824-87.552-5.12-120.832-18.944-32.768-81.408-58.368-101.888-65.024-20.48-6.144-37.888-26.112-41.472-47.104-0.512-2.048-9.216-54.272-9.216-92.672 0-38.4 8.704-90.112 9.216-92.672 3.584-20.992 20.992-40.96 41.472-47.104 20.48-6.144 82.944-31.744 101.888-65.024 18.944-33.28 9.728-99.84 5.12-120.832-5.12-21.504 4.096-46.592 22.016-59.904l3.072-2.048L342.528 40.448c20.48-9.216 47.104-4.608 62.976 10.752 15.872 14.336 69.12 55.808 107.008 55.808 38.4 0 91.648-41.472 107.008-55.808 16.384-15.36 43.008-19.456 62.976-10.752l3.072 1.536L839.68 131.072c17.92 13.312 27.136 38.4 22.016 59.904-4.608 20.992-13.824 87.552 5.12 120.832 18.944 32.768 81.408 58.368 101.888 65.024 20.48 6.144 37.888 26.112 41.472 47.104 0.512 2.048 9.216 54.272 9.216 92.672 0 38.4-8.704 90.112-9.216 92.672-3.584 20.992-20.992 40.96-41.472 47.104s-82.944 31.744-101.888 65.024c-18.944 33.28-9.728 99.84-5.12 120.832 5.12 21.504-4.096 46.592-22.016 59.904l-3.072 2.048-154.112 89.088c-6.144 2.56-13.824 4.096-21.504 4.096zM225.28 852.48l140.288 81.408c15.36-13.824 82.432-70.656 147.456-70.656s132.096 56.832 147.456 70.656l140.288-81.408c-4.096-19.968-19.968-106.496 12.8-162.816 33.28-57.856 120.832-87.552 136.192-92.672 1.536-8.704 8.192-50.688 8.192-80.384 0-29.696-6.656-72.192-8.192-80.384-15.872-5.12-102.912-34.816-136.192-92.672-32.256-56.32-16.896-142.848-12.8-162.816L660.48 99.328c-15.36 13.824-82.432 70.656-147.456 70.656S380.928 113.152 365.568 99.328L225.28 180.224c4.096 19.968 19.968 106.496-12.8 162.816C179.2 400.896 92.16 430.592 76.288 435.712c-1.536 8.704-8.192 50.688-8.192 80.384 0 29.696 6.656 72.192 8.192 80.384 15.872 5.12 102.912 34.816 136.192 92.672 32.256 56.832 16.896 143.36 12.8 163.328z" :fill="parametersError?'#f56c6c':'#333333'" p-id="2807"></path><path d="M513.024 729.6c-117.76 0-212.992-95.744-212.992-213.504s95.744-213.504 213.504-213.504 212.992 95.744 212.992 213.504-95.744 213.504-213.504 213.504z m0-364.032c-82.944 0-150.528 67.584-150.528 150.528s67.584 150.528 150.528 150.528 150.528-67.584 150.528-150.528-67.584-150.528-150.528-150.528z" :fill="parametersError?'#f56c6c':'#333333'" p-id="2808"></path></svg>
|
|
16
|
+
<!-- :fill="parametersError? '#f56c6c':'#8A8A8A'" -->
|
|
17
|
+
</el-tooltip>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
<span style="color: #f56c6c;" v-if="parametersError">请配置额外参数</span>
|
|
21
|
+
<div v-show="dialogVisible">
|
|
22
|
+
<el-dialog
|
|
23
|
+
:modelValue="true"
|
|
24
|
+
title="中间件编辑"
|
|
25
|
+
:width="width"
|
|
26
|
+
:show-close="false"
|
|
27
|
+
:close-on-press-escape="false"
|
|
28
|
+
:close-on-click-modal="false"
|
|
29
|
+
>
|
|
30
|
+
<div class="formily-middleware--parameters-descriptor-config-item" v-for="item in parametersDescriptorConfig" :key="item.title" v-show="showFormItem(item.schema)">
|
|
31
|
+
<span class="title">{{ item.title }}</span>
|
|
32
|
+
<div class="formily-middleware--parameters-descriptor-config-item--schema-box">
|
|
33
|
+
<FormProvider :form="item.form">
|
|
34
|
+
<SchemaField :schema="item.schema"></SchemaField>
|
|
35
|
+
</FormProvider>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
<template #header>
|
|
39
|
+
<div class="dialog-header">
|
|
40
|
+
<span>中间件参数编辑</span>
|
|
41
|
+
<div @click="closeDialog">
|
|
42
|
+
<svg t="1678098563971" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2899" width="12" height="12"><path d="M512 456.310154L94.247385 38.557538a39.542154 39.542154 0 0 0-55.689847 0 39.266462 39.266462 0 0 0 0 55.689847L456.310154 512 38.557538 929.752615a39.542154 39.542154 0 0 0 0 55.689847 39.266462 39.266462 0 0 0 55.689847 0L512 567.689846l417.752615 417.752616c15.163077 15.163077 40.290462 15.36 55.689847 0a39.266462 39.266462 0 0 0 0-55.689847L567.689846 512 985.442462 94.247385a39.542154 39.542154 0 0 0 0-55.689847 39.266462 39.266462 0 0 0-55.689847 0L512 456.310154z" fill="#999999" p-id="2900"></path></svg>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
</el-dialog>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script setup lang="ts">
|
|
52
|
+
import useMiddleware from './index';
|
|
53
|
+
import { FormProvider, createSchemaField } from '@formily/vue';
|
|
54
|
+
const props = defineProps({
|
|
55
|
+
modelValue:{
|
|
56
|
+
type: Array,
|
|
57
|
+
default: () => []
|
|
58
|
+
},
|
|
59
|
+
options:{
|
|
60
|
+
type: Array,
|
|
61
|
+
default: []
|
|
62
|
+
},
|
|
63
|
+
parametersDescriptor:{
|
|
64
|
+
type: String,
|
|
65
|
+
default: ''
|
|
66
|
+
},
|
|
67
|
+
readonly:{
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: false
|
|
70
|
+
},
|
|
71
|
+
width:{
|
|
72
|
+
type: String,
|
|
73
|
+
default: '900px'
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
const emits = defineEmits(['change'])
|
|
77
|
+
|
|
78
|
+
const { dialogVisible, showConfigIcon, parametersError, nameValue, parametersDescriptorConfig, handleConfigParametersDescriptor, sumbitParametersDescripto, showFormItem, closeDialog } = useMiddleware(props,emits);
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<style scope lang="scss">
|
|
82
|
+
.proper-box{
|
|
83
|
+
/* z-index: 2044 !important; */
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.formily-middleware{
|
|
87
|
+
&--select-box{
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
width: 100%;
|
|
91
|
+
}
|
|
92
|
+
.formily-element-plus-form-item-label{
|
|
93
|
+
height: auto !important;
|
|
94
|
+
}
|
|
95
|
+
&--icon{
|
|
96
|
+
margin-left: 8px;
|
|
97
|
+
.el-tooltip__trigger,svg{
|
|
98
|
+
display: block;
|
|
99
|
+
height: 100%;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
&--parameters-descriptor-config-item{
|
|
103
|
+
width: 100%;
|
|
104
|
+
.title{
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
border-bottom: 1px solid #f5f6f7;
|
|
108
|
+
padding-bottom: 4px;
|
|
109
|
+
margin-bottom: 14px;
|
|
110
|
+
&:before{
|
|
111
|
+
content: "";
|
|
112
|
+
display: block;
|
|
113
|
+
width:2px;
|
|
114
|
+
height:14px;
|
|
115
|
+
background-color: #F5DBC1;
|
|
116
|
+
margin-right: 8px;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
&--schema-box{
|
|
120
|
+
display: flex !important;
|
|
121
|
+
flex-wrap: wrap;
|
|
122
|
+
align-items: center;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
svg{
|
|
127
|
+
/* margin-left: 8px; */
|
|
128
|
+
&:hover{
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.formily-element-plus-form-item{
|
|
134
|
+
width: 44% !important;
|
|
135
|
+
display: flex;
|
|
136
|
+
align-items: flex-start;
|
|
137
|
+
|
|
138
|
+
.formily-element-plus-form-item-label,
|
|
139
|
+
.formily-element-plus-form-item-label-content{
|
|
140
|
+
min-width: 102px;
|
|
141
|
+
max-width: 160px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.dialog-header{
|
|
147
|
+
width: 100%;
|
|
148
|
+
display: flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
justify-content: space-between;
|
|
151
|
+
}
|
|
152
|
+
.el-dialog__header{
|
|
153
|
+
padding: 12px 24px;
|
|
154
|
+
/* padding-bottom: 0; */
|
|
155
|
+
border-bottom: 1px solid #f5f6f7;
|
|
156
|
+
margin-right: 0;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.el-dialog{
|
|
160
|
+
padding: 0;
|
|
161
|
+
.el-dialog__body{
|
|
162
|
+
padding: 12px 24px;
|
|
163
|
+
height: 100%;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
</style>
|