sun-form-v3 1.0.71 → 1.0.72
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/abap-DfvySaIJ.js +1404 -0
- package/dist/apex-B__0irD3.js +332 -0
- package/dist/assets/css.worker-OK053IOu.js +84 -0
- package/dist/assets/editor.worker-D9iUZyMP.js +11 -0
- package/dist/assets/html.worker-CL40hqKM.js +458 -0
- package/dist/assets/json.worker-6f9bhSHY.js +42 -0
- package/dist/assets/ts.worker-B6g3wjaE.js +37021 -0
- package/dist/azcli-CDMGhRmx.js +74 -0
- package/dist/bat-0Mk8aqzx.js +106 -0
- package/dist/bicep-BBi_I06Z.js +108 -0
- package/dist/cameligo-D0G_Zm6X.js +180 -0
- package/dist/clojure-o2ZKLeMp.js +767 -0
- package/dist/coffee-DOQff5VC.js +238 -0
- package/dist/cpp-CQGJnWhD.js +395 -0
- package/dist/csharp-C1jLsHl8.js +332 -0
- package/dist/csp-C_ttMQaW.js +59 -0
- package/dist/css-BC202kVV.js +193 -0
- package/dist/cssMode-D3INtz5D.js +1541 -0
- package/dist/cypher-DwtEH7Fi.js +269 -0
- package/dist/dart-D9XknsP2.js +287 -0
- package/dist/dockerfile-DgsNjqqa.js +136 -0
- package/dist/ecl-BAMCHBl6.js +462 -0
- package/dist/elixir-CegIttP8.js +575 -0
- package/dist/favicon.ico +0 -0
- package/dist/flow9-9608t7UV.js +148 -0
- package/dist/freemarker2-hasIzj0A.js +995 -0
- package/dist/fsharp-CCtt9-1_.js +223 -0
- package/dist/go-CGUIPbct.js +224 -0
- package/dist/graphql-BNRIFFIn.js +157 -0
- package/dist/handlebars-Cqza9dif.js +425 -0
- package/dist/hcl-C__KLIXe.js +189 -0
- package/dist/html-QpDlLWtS.js +314 -0
- package/dist/htmlMode-3p93KT8l.js +1551 -0
- package/dist/index2-jkDcibEo.js +120443 -0
- package/dist/ini-CeKYn_zA.js +77 -0
- package/dist/java-Dm24deQl.js +238 -0
- package/dist/javascript-CSPB5Brm.js +76 -0
- package/dist/jsonMode-qA6pURD0.js +1957 -0
- package/dist/julia-BImNW7VE.js +517 -0
- package/dist/kotlin-BfE79GEb.js +259 -0
- package/dist/less-DglNOcaC.js +168 -0
- package/dist/lexon-BA0dRz9Q.js +163 -0
- package/dist/liquid-BWuASSim.js +246 -0
- package/dist/lua-DMkWzJcm.js +168 -0
- package/dist/m3-sA-5shO8.js +216 -0
- package/dist/markdown-OYRB1igA.js +235 -0
- package/dist/mdx-CnHJXO9F.js +171 -0
- package/dist/mips-rRzkJ_7G.js +204 -0
- package/dist/msdax-DoVJdUhd.js +381 -0
- package/dist/mysql-Ty44IHXo.js +884 -0
- package/dist/objective-c-VUfyhYrA.js +189 -0
- package/dist/pascal-DkASiYyw.js +257 -0
- package/dist/pascaligo-p-ELPlVO.js +170 -0
- package/dist/perl-Cjl1FxLZ.js +632 -0
- package/dist/pgsql-DjVenF7s.js +857 -0
- package/dist/php-CwvGzZOO.js +506 -0
- package/dist/pla-Br1iaBIV.js +143 -0
- package/dist/postiats-BaeP8zZY.js +913 -0
- package/dist/powerquery-CLCshuo8.js +896 -0
- package/dist/powershell-CZV50w5N.js +245 -0
- package/dist/protobuf-MV3XTewJ.js +426 -0
- package/dist/pug-DkDg4c4l.js +408 -0
- package/dist/python-CRYsEVap.js +282 -0
- package/dist/qsharp-BAtiKA97.js +291 -0
- package/dist/r-8ocrd-h-.js +249 -0
- package/dist/razor-DyEtGntt.js +556 -0
- package/dist/redis-9sZiddxc.js +308 -0
- package/dist/redshift-DQfTOGC0.js +815 -0
- package/dist/restructuredtext-DXU-vkgr.js +180 -0
- package/dist/ruby-DotfqwMf.js +517 -0
- package/dist/rust-BIauJ5KN.js +349 -0
- package/dist/sb-CmWMvDEV.js +121 -0
- package/dist/scala-C81brEbk.js +376 -0
- package/dist/scheme-D0pcFz2x.js +114 -0
- package/dist/scss-BOdN2fGG.js +268 -0
- package/dist/shell-6E09eAkU.js +227 -0
- package/dist/solidity-CWStzA1K.js +1373 -0
- package/dist/sophia-76Sb6CWe.js +205 -0
- package/dist/sparql-BmZTkOWT.js +207 -0
- package/dist/sql-Cs9TBAW5.js +859 -0
- package/dist/st-B-rqE1Bu.js +422 -0
- package/dist/style.css +1 -0
- package/dist/sun-form-v3.es.js +4 -0
- package/dist/sun-form-v3.umd.js +1902 -0
- package/dist/swift-Btsj6YxQ.js +318 -0
- package/dist/systemverilog-B3RHBRa2.js +582 -0
- package/dist/tcl-Dpj776pn.js +238 -0
- package/dist/tsMode-BrlIPEQw.js +885 -0
- package/dist/twig-Bb9JmBsE.js +398 -0
- package/dist/typescript-CYTudnTM.js +349 -0
- package/dist/typespec-CDWeg3SU.js +123 -0
- package/dist/vb-DEXnYwEI.js +378 -0
- package/dist/wgsl-D602c1lx.js +445 -0
- package/dist/xml-B-x5164u.js +101 -0
- package/dist/yaml-Buq2hM65.js +212 -0
- package/package.json +7 -10
- package/src/App.vue +0 -9
- package/src/assets/font/YouSheBiaoTiHei-2.ttf +0 -0
- package/src/assets/font/demo.css +0 -539
- package/src/assets/font/demo_index.html +0 -1200
- package/src/assets/font/iconfont.css +0 -191
- package/src/assets/font/iconfont.js +0 -1
- package/src/assets/font/iconfont.json +0 -317
- 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 +0 -1
- package/src/assets/styles/element/index.scss +0 -15
- package/src/assets/styles/index.css +0 -3
- package/src/components/a.js +0 -14
- package/src/components/aDesigner/config.vue +0 -127
- package/src/components/aDesigner/design.vue +0 -20
- package/src/components/aDesigner/index.vue +0 -144
- package/src/components/aDesigner/panel.vue +0 -144
- package/src/components/aDesigner/show.vue +0 -24
- package/src/components/widgetCommonComps/commonApiConfig/index.vue +0 -194
- package/src/components/widgetCommonComps/commonCard/index.vue +0 -36
- package/src/components/widgetCommonComps/commonCodeEditor/editor.vue +0 -219
- package/src/components/widgetCommonComps/commonCodeEditor/modalEditor.vue +0 -68
- package/src/components/widgetCommonComps/commonCollapseCard/index.vue +0 -10
- package/src/components/widgetCommonComps/commonContainer/index.vue +0 -95
- package/src/components/widgetCommonComps/commonJsonInput/index.vue +0 -59
- package/src/components/widgetCommonComps/commonLabelContainer/index.vue +0 -39
- package/src/components/widgetCommonComps/commonSidetree/index.vue +0 -61
- package/src/components/widgetCommonComps/commonTypeInput/index.vue +0 -75
- package/src/components/widgetCommonComps/commonWidgetLabelContainer/index.vue +0 -55
- package/src/components/widgetCommonComps/index copy.js +0 -17
- package/src/components/widgetCommonComps/index.js +0 -17
- package/src/components/widgetConfigComps/config-input/index.vue +0 -60
- package/src/components/widgetConfigComps/index copy.js +0 -13
- package/src/components/widgetConfigComps/index.js +0 -17
- package/src/components/widgetShowComps/index.js +0 -29
- package/src/components/widgetShowComps/widget-form/index.vue +0 -43
- package/src/components/widgetShowComps/widget-homepage/index.vue +0 -41
- package/src/components/widgetShowComps/widget-input/index.vue +0 -85
- package/src/components/widgetShowComps/widget-select/index.vue +0 -31
- package/src/designer.js +0 -342
- package/src/http.js +0 -293
- package/src/index.js +0 -24
- package/src/index2.js +0 -23
- package/src/main.js +0 -19
- package/src/remark.js +0 -708
- package/src/testBtn.vue +0 -11
- package/src/testInput.vue +0 -12
- package/src/util/jsformat.js +0 -568
- package/src/widgetConfig.js +0 -1112
package/src/components/a.js
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
const modules =
|
2
|
-
import.meta.glob('./test**.vue', {
|
3
|
-
eager: true
|
4
|
-
});
|
5
|
-
console.log('modules',modules);
|
6
|
-
const components = Object.fromEntries(
|
7
|
-
Object.entries(modules).map(([path, module]) => {
|
8
|
-
const componentName = module.default.name
|
9
|
-
return [componentName, module.default];
|
10
|
-
})
|
11
|
-
);
|
12
|
-
export default {
|
13
|
-
...components,
|
14
|
-
};
|
@@ -1,127 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<common-card title="基础属性" class="mb-1">
|
3
|
-
<div class="w-full">
|
4
|
-
<common-label-container label="唯一名称">
|
5
|
-
<el-input v-model="chosenWidget.id" disabled>
|
6
|
-
<template #append>
|
7
|
-
<el-button icon="Refresh" />
|
8
|
-
</template>
|
9
|
-
</el-input>
|
10
|
-
</common-label-container>
|
11
|
-
<common-label-container label="组件标签">
|
12
|
-
<el-input v-model="chosenWidget.props.label">
|
13
|
-
</el-input>
|
14
|
-
</common-label-container>
|
15
|
-
<common-label-container label="字段名称">
|
16
|
-
<el-input v-model="chosenWidget.props.zdname" placeholder="填写会作为表单字段名称">
|
17
|
-
</el-input>
|
18
|
-
</common-label-container>
|
19
|
-
<common-label-container label="默认赋值">
|
20
|
-
<common-type-input v-model="chosenWidget.props.value"></common-type-input>
|
21
|
-
</common-label-container>
|
22
|
-
<common-label-container label="备注内容">
|
23
|
-
<el-input v-model="chosenWidget.props.remark" placeholder="填写会有备注提示内容">
|
24
|
-
</el-input>
|
25
|
-
</common-label-container>
|
26
|
-
<common-label-container label="组件宽度">
|
27
|
-
<el-slider v-model="chosenWidget.props.width" :step="2" show-stops :max="24" :min="6" />
|
28
|
-
</common-label-container>
|
29
|
-
<common-label-container label="标签宽度">
|
30
|
-
<el-input v-model="chosenWidget.props.labelWidth" placeholder="请填写标签信息">
|
31
|
-
</el-input>
|
32
|
-
</common-label-container>
|
33
|
-
<common-label-container label="标签位置">
|
34
|
-
<el-radio-group v-model="chosenWidget.props.labelPosition">
|
35
|
-
<el-radio-button value="left" label="居左"></el-radio-button>
|
36
|
-
<el-radio-button value="top" label="居上"></el-radio-button>
|
37
|
-
</el-radio-group>
|
38
|
-
</common-label-container>
|
39
|
-
<common-label-container label="标签对齐">
|
40
|
-
<el-radio-group v-model="chosenWidget.props.labelAlign">
|
41
|
-
<el-radio-button value="left" label="居左"></el-radio-button>
|
42
|
-
<el-radio-button value="right" label="居右"></el-radio-button>
|
43
|
-
</el-radio-group>
|
44
|
-
</common-label-container>
|
45
|
-
<common-label-container label="是否隐藏">
|
46
|
-
<el-radio-group v-model="chosenWidget.props.hide">
|
47
|
-
<el-radio-button :value="false" label="显示"></el-radio-button>
|
48
|
-
<el-radio-button :value="true" label="隐藏"></el-radio-button>
|
49
|
-
</el-radio-group>
|
50
|
-
</common-label-container>
|
51
|
-
</div>
|
52
|
-
<!-- <common-json-input v-model="data.chosenWidget.props.list"></common-json-input> -->
|
53
|
-
<common-api-config :designer="designer" v-if="chosenWidget.props.apiSet"
|
54
|
-
v-model="chosenWidget.props.apiSet"></common-api-config>
|
55
|
-
<component :ref="chosenWidget.id" :is="getComponent(chosenWidget.type)" :widget="chosenWidget" :designer="designer">
|
56
|
-
</component>
|
57
|
-
</common-card>
|
58
|
-
<common-card title="事件属性">
|
59
|
-
<common-label-container label="onCreated">
|
60
|
-
<modalEditor v-model="chosenWidget.props.onCreated" :params="['widget', 'self', 'app']" :designer="designer">
|
61
|
-
</modalEditor>
|
62
|
-
</common-label-container>
|
63
|
-
<common-label-container label="onMounted">
|
64
|
-
<modalEditor v-model="chosenWidget.props.onMounted" :params="['widget', 'self', 'app']" :designer="designer">
|
65
|
-
</modalEditor>
|
66
|
-
</common-label-container>
|
67
|
-
<common-label-container label="onInput">
|
68
|
-
<modalEditor v-model="chosenWidget.props.onInput" :params="['value', 'widget', 'self', 'app']"
|
69
|
-
:designer="designer">
|
70
|
-
</modalEditor>
|
71
|
-
</common-label-container>
|
72
|
-
<common-label-container label="onChange">
|
73
|
-
<modalEditor v-model="chosenWidget.props.onChange" :params="['value', 'widget', 'self', 'app']"
|
74
|
-
:designer="designer">
|
75
|
-
</modalEditor>
|
76
|
-
</common-label-container>
|
77
|
-
<common-label-container label="onFocus">
|
78
|
-
<modalEditor v-model="chosenWidget.props.onFocus" :params="['value', 'widget', 'self', 'app']"
|
79
|
-
:designer="designer">
|
80
|
-
</modalEditor>
|
81
|
-
</common-label-container>
|
82
|
-
<common-label-container label="onBlur">
|
83
|
-
<modalEditor v-model="chosenWidget.props.onBlur" :params="['value', 'widget', 'self', 'app']"
|
84
|
-
:designer="designer">
|
85
|
-
</modalEditor>
|
86
|
-
</common-label-container>
|
87
|
-
<common-label-container label="onHandle">
|
88
|
-
<modalEditor v-model="chosenWidget.props.onHandle" :params="['widget', 'self', 'app']" :designer="designer">
|
89
|
-
</modalEditor>
|
90
|
-
</common-label-container>
|
91
|
-
</common-card>
|
92
|
-
<!-- <common-code-editor v-model="data.chosenWidget.props.value"></common-code-editor> -->
|
93
|
-
<!-- <modalEditor v-model="data.chosenWidget.props.value"></modalEditor> -->
|
94
|
-
<!-- <CommonTypeInput v-model="data.chosenWidget.props.value"></CommonTypeInput> -->
|
95
|
-
<!-- <common-api-config :designer="designer" v-if="chosenWidget.props.apiSet"
|
96
|
-
v-model="chosenWidget.props.apiSet"></common-api-config>
|
97
|
-
{{ chosenWidget }} -->
|
98
|
-
<!-- {{ designer.widgetConfig }} -->
|
99
|
-
</template>
|
100
|
-
|
101
|
-
<script setup>
|
102
|
-
|
103
|
-
import { ref, reactive, watch, computed, defineAsyncComponent } from 'vue';
|
104
|
-
import commonCodeEditor from '../widgetCommonComps/commonCodeEditor/editor.vue'
|
105
|
-
import modalEditor from '../widgetCommonComps/commonCodeEditor/modalEditor.vue'
|
106
|
-
const modules = import.meta.glob('../widgetConfigComps/**/index.vue');
|
107
|
-
const components = Object.fromEntries(
|
108
|
-
Object.entries(modules).map(([path, importFn]) => {
|
109
|
-
const match = path.match(/\/([^/]+)\/index\.vue$/);
|
110
|
-
const componentName = match ? match[1] : null;
|
111
|
-
return [componentName, defineAsyncComponent(importFn)];
|
112
|
-
})
|
113
|
-
);
|
114
|
-
const getComponent = (type) => {
|
115
|
-
return components['config-' + type] || null;
|
116
|
-
};
|
117
|
-
defineOptions({ name: "config" })
|
118
|
-
let props = defineProps({
|
119
|
-
designer: {
|
120
|
-
type: Object,
|
121
|
-
default: {}
|
122
|
-
}
|
123
|
-
})
|
124
|
-
let designer = props.designer
|
125
|
-
let chosenWidget = computed(() => designer.chosenWidget)
|
126
|
-
</script>
|
127
|
-
<style scoped lang="scss"></style>
|
@@ -1,20 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<commonContainer class="h-full w-full" :widget="designer.widgetConfig" :designer="designer">
|
3
|
-
<widget-homepage :widget="designer.widgetConfig" :designer="designer"></widget-homepage>
|
4
|
-
</commonContainer>
|
5
|
-
</template>
|
6
|
-
|
7
|
-
<script setup>
|
8
|
-
import { ref, reactive, toRaw, markRaw } from 'vue';
|
9
|
-
let props = defineProps({
|
10
|
-
designer: {
|
11
|
-
type: Object,
|
12
|
-
default: {}
|
13
|
-
}
|
14
|
-
})
|
15
|
-
let designer = props.designer
|
16
|
-
let homeWidget = designer.widgetConfig
|
17
|
-
defineOptions({ name: "design" })
|
18
|
-
</script>
|
19
|
-
|
20
|
-
<style scoped lang="scss"></style>
|
@@ -1,144 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="h-[100vh] bg-gray-100 flex flex-col ">
|
3
|
-
<div class="head px-4 py-2 bg-gray-50 flex justify-between items-center">
|
4
|
-
<div class="logo">
|
5
|
-
<img class="h-[32px]" src="../../assets/img/logo.png" alt="">
|
6
|
-
</div>
|
7
|
-
<div class="menu">
|
8
|
-
<el-popover placement="bottom" :width="360" trigger="click">
|
9
|
-
<template #reference>
|
10
|
-
<el-button class="mr-3">历史记录</el-button>
|
11
|
-
</template>
|
12
|
-
<el-table :row-style="rowStyleHandle" :data="designer.historyList" @row-click="clickRowHandle"
|
13
|
-
max-height="300">
|
14
|
-
<el-table-column property="id" label="变更组件">
|
15
|
-
<template #default="scope">
|
16
|
-
<div>{{ scope.row.widgetConfig.chosenId }}</div>
|
17
|
-
</template>
|
18
|
-
</el-table-column>
|
19
|
-
<el-table-column width="100" property="time" label="操作时间" />
|
20
|
-
</el-table>
|
21
|
-
</el-popover>
|
22
|
-
<el-button-group class="mr-3">
|
23
|
-
<el-button @click="goBack" :disabled="designer.historyIndex === 0">
|
24
|
-
<i :class="`iconfont icon-xianghou`"></i>
|
25
|
-
</el-button>
|
26
|
-
<el-button @click="goForward" :disabled="designer.historyIndex === designer.historyList.length - 1">
|
27
|
-
<i :class="`iconfont icon-xiangqian`"></i>
|
28
|
-
</el-button>
|
29
|
-
</el-button-group>
|
30
|
-
<el-button @click="clearWidgetConfig">重置</el-button>
|
31
|
-
<el-button type="primary" @click="preview">预览</el-button>
|
32
|
-
</div>
|
33
|
-
</div>
|
34
|
-
<div class="content flex-1 flex border-t border-gray-200 overflow-hidden">
|
35
|
-
<!-- 左侧菜单栏 -->
|
36
|
-
<div class="left flex bg-gray-50 border-r border-gray-200">
|
37
|
-
<div class="w-12 border-r border-gray-200 pt-5">
|
38
|
-
<div class="btn_item" :class="{ active: data.activeSidebar === 0 }" @click="data.activeSidebar = 0">
|
39
|
-
<i :class="`iconfont icon-zujian`"></i>
|
40
|
-
</div>
|
41
|
-
<div class="btn_item" :class="{ active: data.activeSidebar === 1 }" @click="data.activeSidebar = 1">
|
42
|
-
<i :class="`iconfont icon-dagang`"></i>
|
43
|
-
</div>
|
44
|
-
<div class="btn_item" :class="{ active: data.activeSidebar === 2 }" @click="data.activeSidebar = 2">
|
45
|
-
<i :class="`iconfont icon-yuanma`"></i>
|
46
|
-
</div>
|
47
|
-
</div>
|
48
|
-
<div class="w-80">
|
49
|
-
<panel :designer="designer" :activeSidebar="data.activeSidebar"></panel>
|
50
|
-
</div>
|
51
|
-
</div>
|
52
|
-
<!-- 中间操作栏 -->
|
53
|
-
<div class="mid flex-1 py-2 px-2 box-border w-full h-full overflow-auto">
|
54
|
-
<div class="inner w-full h-full bg-gray-50 ">
|
55
|
-
<design :designer="designer"></design>
|
56
|
-
</div>
|
57
|
-
</div>
|
58
|
-
<!-- 右侧配置栏 -->
|
59
|
-
<div class="right bg-gray-50 w-80 border-l border-gray-200 overflow-y-auto overflow-x-hidden">
|
60
|
-
<config v-if="designer.chosenWidget" :designer="designer"></config>
|
61
|
-
</div>
|
62
|
-
</div>
|
63
|
-
</div>
|
64
|
-
<vxe-modal transfer v-model="showModal" width="99%" height="99%" show-footer>
|
65
|
-
<template #title>
|
66
|
-
<span>预览表单</span>
|
67
|
-
</template>
|
68
|
-
<template #default>
|
69
|
-
<show v-if="showModal" :widgetConfig="compWidgetConfig"></show>
|
70
|
-
</template>
|
71
|
-
<template #footer>
|
72
|
-
<el-button icon="Close" size="small" @click="showModal=false">关闭</el-button>
|
73
|
-
</template>
|
74
|
-
</vxe-modal>
|
75
|
-
</template>
|
76
|
-
|
77
|
-
<script setup>
|
78
|
-
import { ref, reactive, watch } from 'vue';
|
79
|
-
import panel from './panel.vue'
|
80
|
-
import design from './design.vue'
|
81
|
-
import config from './config.vue'
|
82
|
-
import show from './show.vue'
|
83
|
-
|
84
|
-
import Designer from '../../designer'
|
85
|
-
|
86
|
-
import widgetConfigPanelData from '../../widgetConfig'
|
87
|
-
let initWidgetConfig = widgetConfigPanelData.homepage
|
88
|
-
let originInitData = JSON.parse(JSON.stringify(initWidgetConfig))
|
89
|
-
let showModal = ref(false)
|
90
|
-
let compWidgetConfig = null
|
91
|
-
let designer = reactive(new Designer({
|
92
|
-
widgetConfig: initWidgetConfig
|
93
|
-
}))
|
94
|
-
let data = reactive({
|
95
|
-
activeSidebar: 0,
|
96
|
-
})
|
97
|
-
const preview = ()=>{
|
98
|
-
compWidgetConfig=designer.$utils.clone(designer.widgetConfig, true)
|
99
|
-
showModal.value=true;
|
100
|
-
}
|
101
|
-
const clearWidgetConfig = () => {
|
102
|
-
designer.updateWidget("homepage", designer.$utils.clone(originInitData, true), true)
|
103
|
-
}
|
104
|
-
const clickRowHandle = (row) => {
|
105
|
-
designer.historyIndex = row.index
|
106
|
-
designer.updateByHistory(row.widgetConfig)
|
107
|
-
|
108
|
-
}
|
109
|
-
const rowStyleHandle = ({ row, rowIndex }) => {
|
110
|
-
if (designer.historyIndex === rowIndex) {
|
111
|
-
return {
|
112
|
-
color: 'rgb(85, 132, 255)',
|
113
|
-
fontWeight: "bold"
|
114
|
-
// background: "rgb(85, 132, 255)"
|
115
|
-
}
|
116
|
-
}
|
117
|
-
}
|
118
|
-
const goBack = () => {
|
119
|
-
if (designer.historyIndex > 0) {
|
120
|
-
designer.historyIndex--
|
121
|
-
designer.updateByHistory(designer.historyList[designer.historyIndex].widgetConfig)
|
122
|
-
}
|
123
|
-
}
|
124
|
-
const goForward = () => {
|
125
|
-
if (designer.historyIndex < designer.historyList.length - 1) {
|
126
|
-
designer.historyIndex++
|
127
|
-
designer.updateByHistory(designer.historyList[designer.historyIndex].widgetConfig)
|
128
|
-
}
|
129
|
-
}
|
130
|
-
defineOptions({ name: "designer" })
|
131
|
-
</script>
|
132
|
-
|
133
|
-
<style scoped lang="scss">
|
134
|
-
@import url("../../assets/font/iconfont.css");
|
135
|
-
|
136
|
-
.btn_item {
|
137
|
-
transition: all .3s;
|
138
|
-
@apply w-full flex items-center box-border border-l-4 border-transparent justify-center h-12 mb-3 cursor-pointer hover:bg-blue-50 hover:text-blue-700;
|
139
|
-
}
|
140
|
-
|
141
|
-
.active {
|
142
|
-
@apply border-blue-700 text-blue-700 bg-blue-50;
|
143
|
-
}
|
144
|
-
</style>
|
@@ -1,144 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="flex flex-col h-full" v-if="props.activeSidebar === 0">
|
3
|
-
<!-- 工具栏 -->
|
4
|
-
<div class="px-4 py-2 text-lg text-gray-900 border-b border-gray-200">组件库</div>
|
5
|
-
<!-- 组件内容 -->
|
6
|
-
<div class="flex-1 overflow-auto select-none">
|
7
|
-
<commonCard :title="'容器组件'" class="mb-1">
|
8
|
-
<draggable ghostClass="ghost" class="content_wrap flex flex-wrap flex-shrink-0 justify-between "
|
9
|
-
:list="panelListContainer" :group="{ name: 'dragGroup', pull: 'clone', put: false }" item-key="id"
|
10
|
-
:clone="handleWidgetClone" :sort="false">
|
11
|
-
<template #item="{ element }">
|
12
|
-
<div @click="handleWidgetClick(element)"
|
13
|
-
class="group items w-[47%] flex-shrink-0 px-2 py-2 border border-gray-200 my-2 rounded cursor-pointer hover:shadow-md">
|
14
|
-
<i :class="`iconfont icon-${element.type} text-blue-700 group-hover:text-blue-500`"></i>
|
15
|
-
<span class="text-sm ml-1 group-hover:text-blue-500"> {{ element.displayName }} </span>
|
16
|
-
</div>
|
17
|
-
</template>
|
18
|
-
</draggable>
|
19
|
-
</commonCard>
|
20
|
-
<commonCard :title="'表单组件'" class="mb-1">
|
21
|
-
<draggable ghostClass="ghost" class="content_wrap flex flex-wrap flex-shrink-0 justify-between "
|
22
|
-
:list="panelListForm" :group="{ name: 'dragGroup', pull: 'clone', put: false }" item-key="id"
|
23
|
-
:clone="handleWidgetClone" :sort="false">
|
24
|
-
<template #item="{ element }">
|
25
|
-
<div @click="handleWidgetClick(element)"
|
26
|
-
class="group items w-[47%] flex-shrink-0 px-2 py-2 border border-gray-200 my-2 rounded cursor-pointer hover:shadow-md">
|
27
|
-
<i :class="`iconfont icon-${element.type} text-blue-700 group-hover:text-blue-500`"></i>
|
28
|
-
<span class="text-sm ml-1 group-hover:text-blue-500"> {{ element.displayName }} </span>
|
29
|
-
</div>
|
30
|
-
</template>
|
31
|
-
</draggable>
|
32
|
-
</commonCard>
|
33
|
-
<commonCard :title="'其他组件'">
|
34
|
-
<draggable ghostClass="ghost" class="content_wrap flex flex-wrap flex-shrink-0 justify-between "
|
35
|
-
:list="panelListOrther" :group="{ name: 'dragGroup', pull: 'clone', put: false }" item-key="id"
|
36
|
-
:clone="handleWidgetClone" :sort="false">
|
37
|
-
<template #item="{ element }">
|
38
|
-
<div @click="handleWidgetClick(element)"
|
39
|
-
class="group items w-[47%] flex-shrink-0 px-2 py-2 border border-gray-200 my-2 rounded cursor-pointer hover:shadow-md">
|
40
|
-
<i :class="`iconfont icon-${element.type} text-blue-700 group-hover:text-blue-500`"></i>
|
41
|
-
<span class="text-sm ml-1 group-hover:text-blue-500"> {{ element.displayName }} </span>
|
42
|
-
</div>
|
43
|
-
</template>
|
44
|
-
</draggable>
|
45
|
-
</commonCard>
|
46
|
-
|
47
|
-
</div>
|
48
|
-
</div>
|
49
|
-
<!-- 大纲 -->
|
50
|
-
<div class="flex flex-col h-full" v-if="props.activeSidebar === 1">
|
51
|
-
<common-sidetree :designer="designer"></common-sidetree>
|
52
|
-
</div>
|
53
|
-
<!-- 源码 -->
|
54
|
-
<div class="flex flex-col h-full box-border p-2" v-if="props.activeSidebar === 2">
|
55
|
-
<common-code-editor class="flex-1" theme="vs-dark" ref="editor" :tabSize="2" :pure="true" :minimap="false"
|
56
|
-
language="json" v-model="codeString"></common-code-editor>
|
57
|
-
<el-button @click="updateWidget">立即应用配置</el-button>
|
58
|
-
</div>
|
59
|
-
</template>
|
60
|
-
|
61
|
-
|
62
|
-
<script setup>
|
63
|
-
import draggable from "vuedraggable/src/vuedraggable";
|
64
|
-
import commonCodeEditor from '../widgetCommonComps/commonCodeEditor/editor.vue'
|
65
|
-
import { ref, reactive, watch, toRaw } from 'vue';
|
66
|
-
import widgetConfig from '../../widgetConfig';
|
67
|
-
import { js_beautify } from "../../util/jsformat";
|
68
|
-
//获取参数props传参
|
69
|
-
let props = defineProps({
|
70
|
-
designer: {
|
71
|
-
type: Object,
|
72
|
-
default: {}
|
73
|
-
},
|
74
|
-
activeSidebar: {
|
75
|
-
type: Number,
|
76
|
-
default: 0
|
77
|
-
}
|
78
|
-
})
|
79
|
-
let designer = props.designer
|
80
|
-
let panelList = reactive(widgetConfig);
|
81
|
-
let panelListContainer = reactive([]);
|
82
|
-
let panelListForm = reactive([]);
|
83
|
-
let panelListOrther = reactive([]);
|
84
|
-
let codeString = ref("")
|
85
|
-
let editor = ref()
|
86
|
-
let handleWidgetClone = (e) => {
|
87
|
-
return designer.getChosenInitData(e)
|
88
|
-
}
|
89
|
-
let handleWidgetClick = (e) => {
|
90
|
-
let chosenWidget = designer.chosenWidget;
|
91
|
-
let obj = designer.getChosenInitData(e)
|
92
|
-
if (!chosenWidget) {//没有选中时候默认添加到homeWidgetList
|
93
|
-
let homeWidgetList = designer.widgetConfig.widgetList;
|
94
|
-
homeWidgetList.push(obj)
|
95
|
-
} else {//选中时候
|
96
|
-
if (chosenWidget.isContainer) {//如果选中组件是容器就添加到容器中
|
97
|
-
chosenWidget.widgetList.push(obj)
|
98
|
-
} else {//如果选中组件不是容器就添加到选中组件后面
|
99
|
-
let { widgetList, index } = designer.getParentWidgetById(chosenWidget.id);
|
100
|
-
widgetList.splice(index + 1, 0, obj)
|
101
|
-
}
|
102
|
-
}
|
103
|
-
}
|
104
|
-
for (let i in panelList) {
|
105
|
-
let item = panelList[i];
|
106
|
-
if (item.addToPanel !== false && i != 'homepage') {
|
107
|
-
item.type = i;
|
108
|
-
if (item.isContainer) {
|
109
|
-
panelListContainer.push(item);
|
110
|
-
} else if (item.isForm) {
|
111
|
-
panelListForm.push(item);
|
112
|
-
} else {
|
113
|
-
panelListOrther.push(item);
|
114
|
-
}
|
115
|
-
}
|
116
|
-
}
|
117
|
-
const updateWidget = () => {
|
118
|
-
let chosenWidget = designer.chosenWidget;
|
119
|
-
designer.updateWidget(chosenWidget.id, JSON.parse(codeString.value))
|
120
|
-
|
121
|
-
}
|
122
|
-
watch(() => designer.widgetConfig, (val) => {
|
123
|
-
if (designer.chosenWidget) {
|
124
|
-
let str = js_beautify(JSON.stringify(designer.chosenWidget))
|
125
|
-
codeString.value = str
|
126
|
-
if (props.activeSidebar == 2) {
|
127
|
-
editor.value.setValue(str)
|
128
|
-
}
|
129
|
-
}
|
130
|
-
}, {
|
131
|
-
deep: true,
|
132
|
-
immediate: true
|
133
|
-
})
|
134
|
-
defineOptions({ name: "panel" })
|
135
|
-
|
136
|
-
</script>
|
137
|
-
|
138
|
-
<style scoped lang="scss">
|
139
|
-
@import url("../../assets/font/iconfont.css");
|
140
|
-
|
141
|
-
.ghost {
|
142
|
-
@apply max-h-0 overflow-hidden border border-blue-700 p-0 w-full;
|
143
|
-
}
|
144
|
-
</style>
|
@@ -1,24 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<commonContainer class="h-full w-full" :widget="designer.widgetConfig" :designer="designer">
|
3
|
-
<widget-homepage :widget="designer.widgetConfig" :designer="designer"></widget-homepage>
|
4
|
-
</commonContainer>
|
5
|
-
</template>
|
6
|
-
|
7
|
-
<script setup>
|
8
|
-
import { ref, reactive } from 'vue';
|
9
|
-
import Designer from '../../designer'
|
10
|
-
let props = defineProps({
|
11
|
-
widgetConfig: {
|
12
|
-
type: Object,
|
13
|
-
default: {}
|
14
|
-
},
|
15
|
-
})
|
16
|
-
let designer = reactive(new Designer({
|
17
|
-
widgetConfig: props.widgetConfig,
|
18
|
-
showMode: true
|
19
|
-
}))
|
20
|
-
defineOptions({ name: "sunForm" })
|
21
|
-
|
22
|
-
</script>
|
23
|
-
|
24
|
-
<style scoped lang="scss"></style>
|