sun-form-v3 1.0.65 → 1.0.67
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +8 -5
- package/src/App.vue +9 -0
- package/src/assets/font/YouSheBiaoTiHei-2.ttf +0 -0
- package/src/assets/font/demo.css +539 -0
- package/src/assets/font/demo_index.html +1200 -0
- package/src/assets/font/iconfont.css +191 -0
- package/src/assets/font/iconfont.js +1 -0
- package/src/assets/font/iconfont.json +317 -0
- package/src/assets/font/iconfont.ttf +0 -0
- package/src/assets/font/iconfont.woff +0 -0
- package/src/assets/font/iconfont.woff2 +0 -0
- package/src/assets/img/bg_footer.png +0 -0
- package/src/assets/img/bg_title.png +0 -0
- package/src/assets/img/file.png +0 -0
- package/src/assets/img/logo.png +0 -0
- package/src/assets/img/logo2.png +0 -0
- package/src/assets/img/logo22.png +0 -0
- package/src/assets/img/logo23.png +0 -0
- package/src/assets/img/logo3.png +0 -0
- package/src/assets/img//347/237/251/345/275/242@2x.png +0 -0
- package/src/assets/logo.svg +1 -0
- package/src/assets/styles/element/index.scss +15 -0
- package/src/assets/styles/index.css +3 -0
- package/src/components/a.js +14 -0
- package/src/components/aDesigner/config.vue +127 -0
- package/src/components/aDesigner/design.vue +20 -0
- package/src/components/aDesigner/designer.js +342 -0
- package/src/components/aDesigner/http.js +292 -0
- package/src/components/aDesigner/index.vue +144 -0
- package/src/components/aDesigner/panel.vue +144 -0
- package/src/components/aDesigner/show.vue +24 -0
- package/src/components/widgetCommonComps/commonApiConfig/index.vue +194 -0
- package/src/components/widgetCommonComps/commonCard/index.vue +36 -0
- package/src/components/widgetCommonComps/commonCodeEditor/editor.vue +219 -0
- package/src/components/widgetCommonComps/commonCodeEditor/modalEditor.vue +68 -0
- package/src/components/widgetCommonComps/commonCollapseCard/index.vue +10 -0
- package/src/components/widgetCommonComps/commonContainer/index.vue +95 -0
- package/src/components/widgetCommonComps/commonJsonInput/index.vue +59 -0
- package/src/components/widgetCommonComps/commonLabelContainer/index.vue +39 -0
- package/src/components/widgetCommonComps/commonSidetree/index.vue +61 -0
- package/src/components/widgetCommonComps/commonTypeInput/index.vue +75 -0
- package/src/components/widgetCommonComps/commonWidgetLabelContainer/index.vue +55 -0
- package/src/components/widgetCommonComps/index copy.js +17 -0
- package/src/components/widgetCommonComps/index.js +17 -0
- package/src/components/widgetConfigComps/config-input/index.vue +60 -0
- package/src/components/widgetConfigComps/index copy.js +13 -0
- package/src/components/widgetConfigComps/index.js +17 -0
- package/src/components/widgetShowComps/index.js +29 -0
- package/src/components/widgetShowComps/widget-form/index.vue +43 -0
- package/src/components/widgetShowComps/widget-homepage/index.vue +41 -0
- package/src/components/widgetShowComps/widget-input/index.vue +85 -0
- package/src/components/widgetShowComps/widget-select/index.vue +31 -0
- package/src/designer.js +342 -0
- package/src/http.js +292 -0
- package/src/index.js +24 -0
- package/src/index2.js +23 -0
- package/src/main.js +19 -0
- package/src/remark.js +708 -0
- package/src/testBtn.vue +11 -0
- package/src/testInput.vue +12 -0
- package/src/util/jsformat.js +568 -0
- package/src/widgetConfig.js +1112 -0
- package/dist/abap-DfvySaIJ.js +0 -1404
- package/dist/apex-B__0irD3.js +0 -332
- package/dist/assets/css.worker-OK053IOu.js +0 -84
- package/dist/assets/editor.worker-D9iUZyMP.js +0 -11
- package/dist/assets/html.worker-CL40hqKM.js +0 -458
- package/dist/assets/json.worker-6f9bhSHY.js +0 -42
- package/dist/assets/ts.worker-B6g3wjaE.js +0 -37021
- package/dist/azcli-CDMGhRmx.js +0 -74
- package/dist/bat-0Mk8aqzx.js +0 -106
- package/dist/bicep-BBi_I06Z.js +0 -108
- package/dist/cameligo-D0G_Zm6X.js +0 -180
- package/dist/clojure-o2ZKLeMp.js +0 -767
- package/dist/coffee-DOQff5VC.js +0 -238
- package/dist/cpp-CQGJnWhD.js +0 -395
- package/dist/csharp-C1jLsHl8.js +0 -332
- package/dist/csp-C_ttMQaW.js +0 -59
- package/dist/css-BC202kVV.js +0 -193
- package/dist/cssMode-B2c4O0YS.js +0 -1541
- package/dist/cypher-DwtEH7Fi.js +0 -269
- package/dist/dart-D9XknsP2.js +0 -287
- package/dist/dockerfile-DgsNjqqa.js +0 -136
- package/dist/ecl-BAMCHBl6.js +0 -462
- package/dist/elixir-CegIttP8.js +0 -575
- package/dist/favicon.ico +0 -0
- package/dist/flow9-9608t7UV.js +0 -148
- package/dist/freemarker2-C0V-2C6A.js +0 -995
- package/dist/fsharp-CCtt9-1_.js +0 -223
- package/dist/go-CGUIPbct.js +0 -224
- package/dist/graphql-BNRIFFIn.js +0 -157
- package/dist/handlebars-Dq-D2gGP.js +0 -425
- package/dist/hcl-C__KLIXe.js +0 -189
- package/dist/html-CHe4dRTt.js +0 -314
- package/dist/htmlMode-DmZav6BJ.js +0 -1551
- package/dist/index2-CDdAhO0H.js +0 -124690
- package/dist/ini-CeKYn_zA.js +0 -77
- package/dist/java-Dm24deQl.js +0 -238
- package/dist/javascript-e6NjSQC6.js +0 -76
- package/dist/jsonMode-pOauncTt.js +0 -1957
- package/dist/julia-BImNW7VE.js +0 -517
- package/dist/kotlin-BfE79GEb.js +0 -259
- package/dist/less-DglNOcaC.js +0 -168
- package/dist/lexon-BA0dRz9Q.js +0 -163
- package/dist/liquid-DGCC4WOg.js +0 -246
- package/dist/lua-DMkWzJcm.js +0 -168
- package/dist/m3-sA-5shO8.js +0 -216
- package/dist/markdown-OYRB1igA.js +0 -235
- package/dist/mdx-GitjX2xy.js +0 -171
- package/dist/mips-rRzkJ_7G.js +0 -204
- package/dist/msdax-DoVJdUhd.js +0 -381
- package/dist/mysql-Ty44IHXo.js +0 -884
- package/dist/objective-c-VUfyhYrA.js +0 -189
- package/dist/pascal-DkASiYyw.js +0 -257
- package/dist/pascaligo-p-ELPlVO.js +0 -170
- package/dist/perl-Cjl1FxLZ.js +0 -632
- package/dist/pgsql-DjVenF7s.js +0 -857
- package/dist/php-CwvGzZOO.js +0 -506
- package/dist/pla-Br1iaBIV.js +0 -143
- package/dist/postiats-BaeP8zZY.js +0 -913
- package/dist/powerquery-CLCshuo8.js +0 -896
- package/dist/powershell-CZV50w5N.js +0 -245
- package/dist/protobuf-MV3XTewJ.js +0 -426
- package/dist/pug-DkDg4c4l.js +0 -408
- package/dist/python-BxUPejAm.js +0 -282
- package/dist/qsharp-BAtiKA97.js +0 -291
- package/dist/r-8ocrd-h-.js +0 -249
- package/dist/razor-B0zHeS7k.js +0 -556
- package/dist/redis-9sZiddxc.js +0 -308
- package/dist/redshift-DQfTOGC0.js +0 -815
- package/dist/restructuredtext-DXU-vkgr.js +0 -180
- package/dist/ruby-DotfqwMf.js +0 -517
- package/dist/rust-BIauJ5KN.js +0 -349
- package/dist/sb-CmWMvDEV.js +0 -121
- package/dist/scala-C81brEbk.js +0 -376
- package/dist/scheme-D0pcFz2x.js +0 -114
- package/dist/scss-BOdN2fGG.js +0 -268
- package/dist/shell-6E09eAkU.js +0 -227
- package/dist/solidity-CWStzA1K.js +0 -1373
- package/dist/sophia-76Sb6CWe.js +0 -205
- package/dist/sparql-BmZTkOWT.js +0 -207
- package/dist/sql-Cs9TBAW5.js +0 -859
- package/dist/st-B-rqE1Bu.js +0 -422
- package/dist/style.css +0 -1
- package/dist/sun-form-v3.es.js +0 -4
- package/dist/sun-form-v3.umd.js +0 -1908
- package/dist/swift-Btsj6YxQ.js +0 -318
- package/dist/systemverilog-B3RHBRa2.js +0 -582
- package/dist/tcl-Dpj776pn.js +0 -238
- package/dist/tsMode-AhR0apFR.js +0 -886
- package/dist/twig-Bb9JmBsE.js +0 -398
- package/dist/typescript-DW_IjlW5.js +0 -349
- package/dist/typespec-CDWeg3SU.js +0 -123
- package/dist/vb-DEXnYwEI.js +0 -378
- package/dist/wgsl-D602c1lx.js +0 -445
- package/dist/xml-CraN90Vi.js +0 -101
- package/dist/yaml-D6yA8dTm.js +0 -212
@@ -0,0 +1,59 @@
|
|
1
|
+
<template>
|
2
|
+
<!-- <draggable :key="key" class="w-full" handle=".move_handle" :list="jsonValue" item-key="label"
|
3
|
+
:group="{ name: 'no', put: false, pull: false }">
|
4
|
+
<template #item="{ element, index }"> -->
|
5
|
+
<div class=" w-full flex items-center my-2 box-border" v-for="(element, index) in jsonValue" :key="index">
|
6
|
+
<el-input v-model="element.label" placeholder="请输入"></el-input>
|
7
|
+
<common-type-input v-model="element.value" class="ml-1 w-[100%]"></common-type-input>
|
8
|
+
<el-icon class="cursor-pointer ml-1" @click="deleteItem(index)">
|
9
|
+
<Delete />
|
10
|
+
</el-icon>
|
11
|
+
</div>
|
12
|
+
<!-- </template>
|
13
|
+
</draggable> -->
|
14
|
+
<div class="flex items-center justify-start">
|
15
|
+
<el-button icon="CirclePlus" type="primary" link @click="addItem">添加</el-button>
|
16
|
+
<el-button icon="CircleClose" v-if="jsonValue&&jsonValue.length" type="primary" link @click="clearItem">清空</el-button>
|
17
|
+
</div>
|
18
|
+
</template>
|
19
|
+
|
20
|
+
<script setup>
|
21
|
+
import draggable from "vuedraggable/src/vuedraggable";
|
22
|
+
import { ref, computed, watch } from 'vue';
|
23
|
+
|
24
|
+
defineOptions({ name: "commonJsonInput" })
|
25
|
+
|
26
|
+
const props = defineProps({
|
27
|
+
modelValue: [Array],
|
28
|
+
})
|
29
|
+
const emit = defineEmits(['update:modelValue'])
|
30
|
+
const jsonValue = computed({
|
31
|
+
get() {
|
32
|
+
return props.modelValue || []
|
33
|
+
},
|
34
|
+
set(value) {
|
35
|
+
emit('update:modelValue', value)
|
36
|
+
}
|
37
|
+
})
|
38
|
+
const deleteItem = (index) => {
|
39
|
+
jsonValue.value.splice(index, 1)
|
40
|
+
}
|
41
|
+
const addItem = () => {
|
42
|
+
jsonValue.value.push({
|
43
|
+
label: null,
|
44
|
+
value: null
|
45
|
+
})
|
46
|
+
}
|
47
|
+
const clearItem = () => {
|
48
|
+
jsonValue.value = []
|
49
|
+
}
|
50
|
+
// watch(() => props.modelValue, () => {
|
51
|
+
// if (props.modelValue === null || props.modelValue === undefined) {
|
52
|
+
// type.value = 'string';
|
53
|
+
// } else {
|
54
|
+
// type.value = typeof props.modelValue;
|
55
|
+
// }
|
56
|
+
// }, { immediate: true });
|
57
|
+
</script>
|
58
|
+
|
59
|
+
<style scoped lang="scss"></style>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="item">
|
3
|
+
<div class="lab">
|
4
|
+
{{ props.label }}
|
5
|
+
</div>
|
6
|
+
<div class="con">
|
7
|
+
<slot></slot>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
</template>
|
11
|
+
|
12
|
+
<script setup>
|
13
|
+
import { ref, reactive } from 'vue';
|
14
|
+
defineOptions({ name: "commonLabelContainer" })
|
15
|
+
let props = defineProps({
|
16
|
+
label: {
|
17
|
+
type: String,
|
18
|
+
default: ""
|
19
|
+
}
|
20
|
+
})
|
21
|
+
</script>
|
22
|
+
|
23
|
+
<style scoped lang="scss">
|
24
|
+
.item {
|
25
|
+
@apply flex items-center mb-2;
|
26
|
+
|
27
|
+
.lab {
|
28
|
+
@apply flex-none w-[90px] text-sm;
|
29
|
+
}
|
30
|
+
|
31
|
+
.con {
|
32
|
+
@apply flex-1;
|
33
|
+
}
|
34
|
+
|
35
|
+
// &:last-child {
|
36
|
+
// @apply mb-0;
|
37
|
+
// }
|
38
|
+
}
|
39
|
+
</style>
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="h-full">
|
3
|
+
<vxe-table ref="table" :show-header="false" show-overflow border="outer"
|
4
|
+
:row-config="{ isHover: false, useKey: true }" height="auto" :column-config="{ resizable: true }"
|
5
|
+
:tree-config="{ transform: false, childrenField: 'widgetList', showLine: true, expandAll: true }" :data="arr">
|
6
|
+
<vxe-column field="displayName" title="组件大纲" tree-node>
|
7
|
+
<template #default="{ row }">
|
8
|
+
<div @click="chooseHandle(row)" class="cursor-pointer pl-2 box-border hover:bg-gray-50"
|
9
|
+
:class="{ 'bg-blue-50': row.id == chosenId }">
|
10
|
+
<span class="text-sm">
|
11
|
+
{{ row.displayName }}
|
12
|
+
</span>
|
13
|
+
<span class="text-xs text-gray-400">
|
14
|
+
_{{ row.id }}
|
15
|
+
</span>
|
16
|
+
</div>
|
17
|
+
</template>
|
18
|
+
</vxe-column>
|
19
|
+
</vxe-table>
|
20
|
+
</div>
|
21
|
+
</template>
|
22
|
+
|
23
|
+
<script setup>
|
24
|
+
import { ref, reactive, watch, nextTick } from 'vue';
|
25
|
+
defineOptions({ name: "commonSidetree" })
|
26
|
+
let props = defineProps({
|
27
|
+
designer: {
|
28
|
+
type: Object,
|
29
|
+
default: {}
|
30
|
+
}, canAddApi: {
|
31
|
+
type: Boolean,
|
32
|
+
default: false
|
33
|
+
}
|
34
|
+
|
35
|
+
})
|
36
|
+
const emit = defineEmits(['addApi'])
|
37
|
+
let designer = props.designer
|
38
|
+
let table = ref()
|
39
|
+
let arr = ref([])
|
40
|
+
let chosenId = ref(null)
|
41
|
+
const chooseHandle = (row) => {
|
42
|
+
if (props.canAddApi) {
|
43
|
+
emit('addApi', row);
|
44
|
+
return
|
45
|
+
}
|
46
|
+
designer.setChosenId(row.id)
|
47
|
+
}
|
48
|
+
watch(() => designer.getWidgetConfig(), (val) => {
|
49
|
+
chosenId.value = designer.getChosenId()
|
50
|
+
arr.value = []
|
51
|
+
arr.value.push(designer.$utils.clone(val, true))
|
52
|
+
nextTick(() => {
|
53
|
+
table.value.setAllTreeExpand(true)
|
54
|
+
})
|
55
|
+
}, {
|
56
|
+
deep: true,
|
57
|
+
immediate: true
|
58
|
+
})
|
59
|
+
</script>
|
60
|
+
|
61
|
+
<style scoped lang="scss"></style>
|
@@ -0,0 +1,75 @@
|
|
1
|
+
<template>
|
2
|
+
<el-input v-model="inputValue" placeholder="请输入">
|
3
|
+
<template #append>
|
4
|
+
<el-select v-model="type" class="w-[75px]" @change="handleTypeChange">
|
5
|
+
<el-option label="字符" value="string" />
|
6
|
+
<el-option label="布尔" value="boolean" />
|
7
|
+
<el-option label="数字" value="number" />
|
8
|
+
</el-select>
|
9
|
+
</template>
|
10
|
+
</el-input>
|
11
|
+
</template>
|
12
|
+
|
13
|
+
<script setup>
|
14
|
+
import { ref, computed, watch } from 'vue';
|
15
|
+
|
16
|
+
defineOptions({ name: "commonTypeInput" })
|
17
|
+
|
18
|
+
const props = defineProps({
|
19
|
+
modelValue: [String, Number, Boolean, Object, null],
|
20
|
+
default: null
|
21
|
+
})
|
22
|
+
|
23
|
+
const emit = defineEmits(['update:modelValue'])
|
24
|
+
|
25
|
+
const type = ref("string")
|
26
|
+
const inputValue = computed({
|
27
|
+
get() {
|
28
|
+
let inType = typeof props.modelValue
|
29
|
+
switch (inType) {
|
30
|
+
case 'number':
|
31
|
+
return props.modelValue.toString()
|
32
|
+
case 'boolean':
|
33
|
+
return props.modelValue ? 'true' : 'false'
|
34
|
+
default: // string
|
35
|
+
return props.modelValue
|
36
|
+
}
|
37
|
+
},
|
38
|
+
set(value) {
|
39
|
+
let emitValue = null
|
40
|
+
switch (type.value) {
|
41
|
+
case 'number':
|
42
|
+
emitValue = Number(value) || null
|
43
|
+
break
|
44
|
+
case 'boolean':
|
45
|
+
if (/^t(rue)?$/i.test(value)) {
|
46
|
+
emitValue = true;
|
47
|
+
}
|
48
|
+
else if (/^f(alse)?$/i.test(value)) {
|
49
|
+
emitValue = false;
|
50
|
+
}
|
51
|
+
else {
|
52
|
+
emitValue = null;
|
53
|
+
}
|
54
|
+
break
|
55
|
+
default: // string
|
56
|
+
emitValue = value || null
|
57
|
+
}
|
58
|
+
emit('update:modelValue', emitValue)
|
59
|
+
}
|
60
|
+
})
|
61
|
+
|
62
|
+
const handleTypeChange = (newType) => {
|
63
|
+
inputValue.value = ""
|
64
|
+
}
|
65
|
+
|
66
|
+
watch(() => props.modelValue, () => {
|
67
|
+
if (props.modelValue === null || props.modelValue === undefined) {
|
68
|
+
type.value = 'string';
|
69
|
+
} else {
|
70
|
+
type.value = typeof props.modelValue;
|
71
|
+
}
|
72
|
+
}, { immediate: true });
|
73
|
+
</script>
|
74
|
+
|
75
|
+
<style scoped lang="scss"></style>
|
@@ -0,0 +1,55 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="item" :class="{ flex: props.labelPosition == 'left', 'hide': props.hide }">
|
3
|
+
<div class="lab" :class="{ required: props.required }" :style='{
|
4
|
+
width: props.labelWidth,
|
5
|
+
justifyContent: props.labelAlign == "left" ? "flex-start" : "flex-end"
|
6
|
+
}'>
|
7
|
+
{{ props.label }}
|
8
|
+
</div>
|
9
|
+
<div class="con">
|
10
|
+
<slot></slot>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
</template>
|
14
|
+
|
15
|
+
<script setup>
|
16
|
+
import { ref, reactive, computed } from 'vue';
|
17
|
+
defineOptions({ name: "commonWidgetLabelContainer" })
|
18
|
+
let p = defineProps({
|
19
|
+
props: {
|
20
|
+
type: Object,
|
21
|
+
default: {
|
22
|
+
label: "",
|
23
|
+
labelWidth: "90px",
|
24
|
+
labelAlign: "left",
|
25
|
+
labelPosition: "left",
|
26
|
+
required: false,
|
27
|
+
hide: false,
|
28
|
+
width: 24
|
29
|
+
}
|
30
|
+
},
|
31
|
+
})
|
32
|
+
let props = computed(() => p.props)
|
33
|
+
</script>
|
34
|
+
|
35
|
+
<style scoped lang="scss">
|
36
|
+
.item {
|
37
|
+
@apply items-center flex-wrap relative p-2;
|
38
|
+
|
39
|
+
.lab {
|
40
|
+
@apply flex-none text-sm flex box-border pr-2;
|
41
|
+
}
|
42
|
+
|
43
|
+
.con {
|
44
|
+
@apply flex-1;
|
45
|
+
}
|
46
|
+
|
47
|
+
.required {
|
48
|
+
@apply before:content-['*'] before:text-red-500 before:mr-1;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
.hide {
|
53
|
+
@apply after:content-['<隐藏状态>'] after:w-full after:h-full after:absolute after:top-0 after:left-0 after:flex after:items-center after:justify-center after:bg-gray-400 after:bg-opacity-10 after:text-sm after:text-gray-400;
|
54
|
+
}
|
55
|
+
</style>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
const modules =
|
2
|
+
import.meta.glob('./**/index.vue', {
|
3
|
+
eager: true
|
4
|
+
});
|
5
|
+
const components = Object.fromEntries(
|
6
|
+
Object.entries(modules).map(([path, module]) => {
|
7
|
+
const componentName = module.default.name
|
8
|
+
return [componentName, module.default];
|
9
|
+
})
|
10
|
+
);
|
11
|
+
export default{
|
12
|
+
install(app) {
|
13
|
+
Object.keys(components).forEach(key => {
|
14
|
+
app.component(key, components[key]);
|
15
|
+
});
|
16
|
+
}
|
17
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
const modules =
|
2
|
+
import.meta.glob('./**/index.vue', {
|
3
|
+
eager: true
|
4
|
+
});
|
5
|
+
const components = Object.fromEntries(
|
6
|
+
Object.entries(modules).map(([path, module]) => {
|
7
|
+
const componentName = module.default.name
|
8
|
+
return [componentName, module.default];
|
9
|
+
})
|
10
|
+
);
|
11
|
+
export default{
|
12
|
+
install(app) {
|
13
|
+
Object.keys(components).forEach(key => {
|
14
|
+
app.component(key, components[key]);
|
15
|
+
});
|
16
|
+
}
|
17
|
+
}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
<template>
|
2
|
+
<common-label-container label="组件尺寸">
|
3
|
+
<el-select v-model="props.widget.props.size">
|
4
|
+
<el-option label="大尺寸" value="large"></el-option>
|
5
|
+
<el-option label="默认" value="default"></el-option>
|
6
|
+
<el-option label="小尺寸" value="small"></el-option>
|
7
|
+
</el-select>
|
8
|
+
</common-label-container>
|
9
|
+
<common-label-container label="组件类型">
|
10
|
+
<el-select v-model="props.widget.props.type">
|
11
|
+
<el-option label="文字" value="text"></el-option>
|
12
|
+
<!-- <el-option label="数字" value="number"></el-option> -->
|
13
|
+
<el-option label="密码" value="password"></el-option>
|
14
|
+
</el-select>
|
15
|
+
</common-label-container>
|
16
|
+
<common-label-container label="占位文字">
|
17
|
+
<el-input v-model="props.widget.props.placeholder" placeholder="填写占位文字">
|
18
|
+
</el-input>
|
19
|
+
</common-label-container>
|
20
|
+
<common-label-container label="前置内容文字">
|
21
|
+
<el-input v-model="props.widget.props.prependText" placeholder="填写末尾按钮文字">
|
22
|
+
</el-input>
|
23
|
+
</common-label-container>
|
24
|
+
<common-label-container label="末尾按钮文字">
|
25
|
+
<el-input v-model="props.widget.props.appendText" placeholder="填写末尾按钮文字">
|
26
|
+
</el-input>
|
27
|
+
</common-label-container>
|
28
|
+
<common-label-container label="最大输入长度">
|
29
|
+
<el-input-number class="w-full" placeholder="填写最大输入长度" v-model="props.widget.props.maxlength" :min="0" controls-position="right" />
|
30
|
+
</common-label-container>
|
31
|
+
<common-label-container label="是否去空格">
|
32
|
+
<el-switch v-model="props.widget.props.isTrim" />
|
33
|
+
</common-label-container>
|
34
|
+
<common-label-container label="是否必填">
|
35
|
+
<el-switch v-model="props.widget.props.required" />
|
36
|
+
</common-label-container>
|
37
|
+
<common-label-container label="是否只读">
|
38
|
+
<el-switch v-model="props.widget.props.readonly" />
|
39
|
+
</common-label-container>
|
40
|
+
<common-label-container label="是否禁用">
|
41
|
+
<el-switch v-model="props.widget.props.disabled" />
|
42
|
+
</common-label-container>
|
43
|
+
</template>
|
44
|
+
|
45
|
+
<script setup>
|
46
|
+
import { ref, reactive } from 'vue';
|
47
|
+
defineOptions({ name: "config-input" })
|
48
|
+
let props = defineProps({
|
49
|
+
designer: {
|
50
|
+
type: Object,
|
51
|
+
default: {}
|
52
|
+
},
|
53
|
+
widget: {
|
54
|
+
type: Object,
|
55
|
+
default: {}
|
56
|
+
}
|
57
|
+
})
|
58
|
+
</script>
|
59
|
+
|
60
|
+
<style scoped lang="scss"></style>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
const modules =
|
2
|
+
import.meta.glob('./**/index.vue', {
|
3
|
+
eager: true
|
4
|
+
});
|
5
|
+
const components = Object.fromEntries(
|
6
|
+
Object.entries(modules).map(([path, module]) => {
|
7
|
+
const componentName = module.default.name
|
8
|
+
return [componentName, module.default];
|
9
|
+
})
|
10
|
+
);
|
11
|
+
export default {
|
12
|
+
...components,
|
13
|
+
};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
const modules =
|
2
|
+
import.meta.glob('./**/index.vue', {
|
3
|
+
eager: true
|
4
|
+
});
|
5
|
+
const components = Object.fromEntries(
|
6
|
+
Object.entries(modules).map(([path, module]) => {
|
7
|
+
const componentName = module.default.name
|
8
|
+
return [componentName, module.default];
|
9
|
+
})
|
10
|
+
);
|
11
|
+
export default{
|
12
|
+
install(app) {
|
13
|
+
Object.keys(components).forEach(key => {
|
14
|
+
app.component(key, components[key]);
|
15
|
+
});
|
16
|
+
}
|
17
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
const modules =
|
2
|
+
import.meta.glob('./**/index.vue', {
|
3
|
+
eager: true
|
4
|
+
});
|
5
|
+
const components = Object.fromEntries(
|
6
|
+
Object.entries(modules).map(([path, module]) => {
|
7
|
+
const componentName = module.default.name
|
8
|
+
return [componentName, module.default];
|
9
|
+
})
|
10
|
+
);
|
11
|
+
export default{
|
12
|
+
install(app) {
|
13
|
+
Object.keys(components).forEach(key => {
|
14
|
+
app.component(key, components[key]);
|
15
|
+
});
|
16
|
+
}
|
17
|
+
}
|
18
|
+
// import widgetForm from './widget-form/index.vue'
|
19
|
+
// import widgetHomepage from './widget-homepage/index.vue'
|
20
|
+
// import widgetInput from './widget-input/index.vue'
|
21
|
+
// import widgetSelect from './widget-select/index.vue'
|
22
|
+
|
23
|
+
|
24
|
+
// export default {
|
25
|
+
// 'widget-form': widgetForm,
|
26
|
+
// 'widget-homepage': widgetHomepage,
|
27
|
+
// 'widget-input': widgetInput,
|
28
|
+
// 'widget-select': widgetSelect,
|
29
|
+
// };
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<template>
|
2
|
+
<draggable ghostClass="ghost" handle=".handle" :list="widgetList" class="min-h-14"
|
3
|
+
:group="{ name: 'dragGroup', put: true }" item-key="id">
|
4
|
+
<template #item="{ element }">
|
5
|
+
<div>
|
6
|
+
<commonContainer :designer="designer" :widget="element" :parentWidget="widget">
|
7
|
+
<component :ref="element.id" :is="'widget-'+element.type" :widget="element" :designer="designer">
|
8
|
+
</component>
|
9
|
+
</commonContainer>
|
10
|
+
</div>
|
11
|
+
</template>
|
12
|
+
</draggable>
|
13
|
+
</template>
|
14
|
+
|
15
|
+
<script setup>
|
16
|
+
import { ref, reactive } from 'vue';
|
17
|
+
import draggable from "vuedraggable/src/vuedraggable";
|
18
|
+
let props = defineProps({
|
19
|
+
designer: {
|
20
|
+
type: Object,
|
21
|
+
default: () => {
|
22
|
+
return {}
|
23
|
+
}
|
24
|
+
},
|
25
|
+
widget: {
|
26
|
+
type: Object,
|
27
|
+
default: () => {
|
28
|
+
return {}
|
29
|
+
}
|
30
|
+
}
|
31
|
+
})
|
32
|
+
let designer = reactive(props.designer)
|
33
|
+
let widget = reactive(props.widget)
|
34
|
+
let widgetList = props.widget.widgetList
|
35
|
+
|
36
|
+
defineOptions({ name: "widget-form" })
|
37
|
+
</script>
|
38
|
+
|
39
|
+
<style scoped lang="scss">
|
40
|
+
.ghost {
|
41
|
+
@apply max-h-0 overflow-hidden border border-blue-700;
|
42
|
+
}
|
43
|
+
</style>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<template>
|
2
|
+
<draggable ghostClass="ghost" handle=".handle" :list="widgetList" class="min-h-full flex flex-wrap content-start"
|
3
|
+
:group="{ name: 'dragGroup', put: true }" item-key="id">
|
4
|
+
<template #item="{ element }">
|
5
|
+
<commonContainer :designer="designer" :widget="element" :parentWidget="widget">
|
6
|
+
<component :ref="element.id" :is="'widget-'+element.type" :widget="element" :designer="designer">
|
7
|
+
</component>
|
8
|
+
</commonContainer>
|
9
|
+
</template>
|
10
|
+
</draggable>
|
11
|
+
</template>
|
12
|
+
|
13
|
+
<script setup>
|
14
|
+
import { ref, reactive, computed } from 'vue';
|
15
|
+
import draggable from "vuedraggable/src/vuedraggable";
|
16
|
+
let props = defineProps({
|
17
|
+
designer: {
|
18
|
+
type: Object,
|
19
|
+
default: () => {
|
20
|
+
return {}
|
21
|
+
}
|
22
|
+
},
|
23
|
+
widget: {
|
24
|
+
type: Object,
|
25
|
+
default: () => {
|
26
|
+
return {}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
})
|
30
|
+
let designer = props.designer
|
31
|
+
let widget = computed(() => props.widget)
|
32
|
+
let widgetList = computed(() => designer.widgetConfig.widgetList)
|
33
|
+
|
34
|
+
defineOptions({ name: "widget-homepage" })
|
35
|
+
</script>
|
36
|
+
|
37
|
+
<style scoped lang="scss">
|
38
|
+
.ghost {
|
39
|
+
@apply max-h-0 overflow-hidden border border-blue-700;
|
40
|
+
}
|
41
|
+
</style>
|
@@ -0,0 +1,85 @@
|
|
1
|
+
<template>
|
2
|
+
<common-widget-label-container :props="p">
|
3
|
+
<el-input @change="changeHandle" @input="inputHandle" @focus="focusHandle" v-model="p.value" :type="p.type"
|
4
|
+
:size="p.size" @blur="blurHandle" :placeholder="p.placeholder" :maxlength="p.maxlength">
|
5
|
+
<template v-if="p.prependText" #prepend>{{ p.prependText }}</template>
|
6
|
+
<template v-if="p.appendText" #append>
|
7
|
+
<el-button @click="onHandle">{{ p.appendText }}</el-button>
|
8
|
+
</template>
|
9
|
+
</el-input>
|
10
|
+
</common-widget-label-container>
|
11
|
+
</template>
|
12
|
+
|
13
|
+
<script setup>
|
14
|
+
import { ref, reactive, computed, getCurrentInstance, onMounted } from 'vue';
|
15
|
+
|
16
|
+
let props = defineProps({
|
17
|
+
designer: {
|
18
|
+
type: Object,
|
19
|
+
default: () => {
|
20
|
+
return {}
|
21
|
+
}
|
22
|
+
},
|
23
|
+
widget: {
|
24
|
+
type: Object,
|
25
|
+
default: () => {
|
26
|
+
return {}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
})
|
30
|
+
props.designer.setVueIncetance(props.widget.id, getCurrentInstance())
|
31
|
+
|
32
|
+
let p = computed(() => props.widget.props)
|
33
|
+
|
34
|
+
const changeHandle = (value) => {
|
35
|
+
props.designer.eventHandle({
|
36
|
+
eventType: "onChange",
|
37
|
+
value: value,
|
38
|
+
widget: props.widget,
|
39
|
+
})
|
40
|
+
}
|
41
|
+
const inputHandle = (value) => {
|
42
|
+
props.designer.eventHandle({
|
43
|
+
eventType: "onInput",
|
44
|
+
value: value,
|
45
|
+
widget: props.widget,
|
46
|
+
})
|
47
|
+
}
|
48
|
+
const focusHandle = () => {
|
49
|
+
props.designer.eventHandle({
|
50
|
+
eventType: "onFocus",
|
51
|
+
value: props.widget.props.value,
|
52
|
+
widget: props.widget,
|
53
|
+
})
|
54
|
+
}
|
55
|
+
const blurHandle = (value) => {
|
56
|
+
props.designer.eventHandle({
|
57
|
+
eventType: "onBlur",
|
58
|
+
value: props.widget.props.value,
|
59
|
+
widget: props.widget,
|
60
|
+
})
|
61
|
+
}
|
62
|
+
const onHandle = () => {
|
63
|
+
props.designer.eventHandle({
|
64
|
+
eventType: "onHandle",
|
65
|
+
value: props.widget.props.value,
|
66
|
+
widget: props.widget,
|
67
|
+
})
|
68
|
+
}
|
69
|
+
props.designer.eventHandle({
|
70
|
+
eventType: "onCreated",
|
71
|
+
widget: props.widget,
|
72
|
+
})
|
73
|
+
onMounted(() => {
|
74
|
+
props.designer.eventHandle({
|
75
|
+
eventType: "onMounted",
|
76
|
+
widget: props.widget,
|
77
|
+
})
|
78
|
+
})
|
79
|
+
defineExpose({
|
80
|
+
changeHandle,
|
81
|
+
})
|
82
|
+
defineOptions({ name: "widget-input" })
|
83
|
+
</script>
|
84
|
+
|
85
|
+
<style scoped lang="scss"></style>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="widget-select">
|
3
|
+
<el-select v-model="widget.props.value" placeholder="请选择">
|
4
|
+
<el-option v-for="item in widget.props.list" :key="item.value" :label="item.label || ''"
|
5
|
+
:value="item.value || ''">
|
6
|
+
</el-option>
|
7
|
+
</el-select>
|
8
|
+
</div>
|
9
|
+
</template>
|
10
|
+
|
11
|
+
<script setup>
|
12
|
+
import { ref, reactive } from 'vue';
|
13
|
+
let props = defineProps({
|
14
|
+
designer: {
|
15
|
+
type: Object,
|
16
|
+
default: () => {
|
17
|
+
return {}
|
18
|
+
}
|
19
|
+
},
|
20
|
+
widget: {
|
21
|
+
type: Object,
|
22
|
+
default: () => {
|
23
|
+
return {}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
})
|
27
|
+
let designer = props.designer
|
28
|
+
defineOptions({ name: "widget-select" })
|
29
|
+
</script>
|
30
|
+
|
31
|
+
<style scoped lang="scss"></style>
|