sohelp-eleplus 1.1.13
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/README.md +7 -0
- package/cache/DictCache.js +58 -0
- package/cache/ModuleCache.js +352 -0
- package/components.js +45 -0
- package/core-export.js +4 -0
- package/http/CrudHttp.js +115 -0
- package/http/DictHttp.js +12 -0
- package/http/ModuleHttp.js +68 -0
- package/http/SohelpHttp.js +125 -0
- package/index.js +6 -0
- package/installer.js +8 -0
- package/lang/en_US.js +4 -0
- package/lang/zh_CN.js +4 -0
- package/lang/zh_TW.js +4 -0
- package/package.json +9 -0
- package/sohelp-ace-editor/index.vue +198 -0
- package/sohelp-application-select/index.vue +15 -0
- package/sohelp-autocode/index.vue +53 -0
- package/sohelp-calendar-view/index.vue +11 -0
- package/sohelp-card-view/index.vue +11 -0
- package/sohelp-condition/index.vue +210 -0
- package/sohelp-cry-input/index.vue +64 -0
- package/sohelp-date/index.vue +27 -0
- package/sohelp-datetime/index.vue +44 -0
- package/sohelp-datetime-picker/index.vue +86 -0
- package/sohelp-datetime-range/index.vue +59 -0
- package/sohelp-dict/index.vue +207 -0
- package/sohelp-dict/props.js +68 -0
- package/sohelp-drawer/index.vue +31 -0
- package/sohelp-drop-card/index.vue +94 -0
- package/sohelp-drop-card/props.js +68 -0
- package/sohelp-dyn-select/index.vue +99 -0
- package/sohelp-dyn-select/props.js +67 -0
- package/sohelp-dyn-tree/index.vue +82 -0
- package/sohelp-dyn-tree-select/index.vue +114 -0
- package/sohelp-entity-form/index.vue +524 -0
- package/sohelp-entity-grid/index.vue +30 -0
- package/sohelp-file-upload/index.vue +218 -0
- package/sohelp-filter-scheme/components/condition.vue +102 -0
- package/sohelp-filter-scheme/components/filter.vue +45 -0
- package/sohelp-filter-scheme/components/keywords.vue +15 -0
- package/sohelp-filter-scheme/components/scheme.vue +49 -0
- package/sohelp-filter-scheme/index.vue +113 -0
- package/sohelp-grid/SohelpGridConfig.js~ +408 -0
- package/sohelp-grid/components/filter-condition-item.vue +298 -0
- package/sohelp-grid/index.vue +1886 -0
- package/sohelp-grid/js/ConditionType.js +101 -0
- package/sohelp-grid/js/DefaultGridOptions.js +141 -0
- package/sohelp-grid/js/DefaultProps.js +27 -0
- package/sohelp-grid/js/SohelpConfigFunction.js +0 -0
- package/sohelp-grid/js/SohelpGridConfig.js +101 -0
- package/sohelp-grid/js/useSohelpGridConfig.js +519 -0
- package/sohelp-grid-select/index.vue +245 -0
- package/sohelp-grid-view/filter/config/grid-filter-condition.vue +221 -0
- package/sohelp-grid-view/filter/config/grid-filter-config.vue +27 -0
- package/sohelp-grid-view/filter/config/grid-filter-field.vue +378 -0
- package/sohelp-grid-view/filter/config/grid-filter-keywords.vue +310 -0
- package/sohelp-grid-view/filter/config/grid-filter-list.vue +313 -0
- package/sohelp-grid-view/filter/config/grid-filter-scheme.vue +264 -0
- package/sohelp-grid-view/filter/config/grid-filter-sort.vue +310 -0
- package/sohelp-grid-view/filter/config/index.vue +206 -0
- package/sohelp-grid-view/filter/filter-form.vue +427 -0
- package/sohelp-grid-view/filter/filter-toolbar.vue +110 -0
- package/sohelp-grid-view/filter/index.vue +160 -0
- package/sohelp-grid-view/index.vue +379 -0
- package/sohelp-grid-view-select/index.vue +141 -0
- package/sohelp-group-view/index.vue +11 -0
- package/sohelp-icon-select/index.vue +96 -0
- package/sohelp-icon-select/vxeui-icon.js +90 -0
- package/sohelp-image-upload/index.vue +286 -0
- package/sohelp-input/index.vue +39 -0
- package/sohelp-modal/index.vue +49 -0
- package/sohelp-module/index.vue +54 -0
- package/sohelp-module/useModalManager.js +89 -0
- package/sohelp-module/useSohelpModule.js +66 -0
- package/sohelp-number-input/index.vue +32 -0
- package/sohelp-number-range/index.vue +135 -0
- package/sohelp-org-select/index.vue +30 -0
- package/sohelp-org-tree/index.vue +18 -0
- package/sohelp-org-tree-select/index.vue +93 -0
- package/sohelp-org-user-tree/index.vue +26 -0
- package/sohelp-org-user-tree-select/index.vue +11 -0
- package/sohelp-pagination/index.vue +11 -0
- package/sohelp-power/index.vue +105 -0
- package/sohelp-pro-form/components/pro-form-footer.vue +44 -0
- package/sohelp-pro-form/components/pro-form-item.vue +1133 -0
- package/sohelp-pro-form/index.vue +257 -0
- package/sohelp-pro-form/util.js +140 -0
- package/sohelp-pro-layout/index.vue +11 -0
- package/sohelp-pro-table/index.vue +14 -0
- package/sohelp-process/index.vue +216 -0
- package/sohelp-rate/index.vue +56 -0
- package/sohelp-rate/props.js +71 -0
- package/sohelp-relation/index.vue +11 -0
- package/sohelp-rich-text/index.vue +242 -0
- package/sohelp-rich-text/util.js +231 -0
- package/sohelp-richtext/index.vue +10 -0
- package/sohelp-role-select/index.vue +33 -0
- package/sohelp-search/components/search-config.vue +0 -0
- package/sohelp-search/index.vue +49 -0
- package/sohelp-search-pro-form/index.vue +11 -0
- package/sohelp-select/index.vue +120 -0
- package/sohelp-split-panel/index.vue +15 -0
- package/sohelp-switch/index.vue +56 -0
- package/sohelp-table/index.vue +151 -0
- package/sohelp-tenant-select/index.vue +128 -0
- package/sohelp-text/index.vue +14 -0
- package/sohelp-textarea-input/index.vue +36 -0
- package/sohelp-time/index.vue +10 -0
- package/sohelp-tree/index.vue +37 -0
- package/sohelp-tree-select/index.vue +18 -0
- package/sohelp-user-select/index.vue +44 -0
- package/sohelp-user-select/index.vue~ +53 -0
- package/sohelp-user-select/props.js +71 -0
- package/sohelp-user-tag/index.vue +12 -0
- package/sohelp-user-tree/index.vue +11 -0
- package/sohelp-vform-drawer/index.vue +40 -0
- package/sohelp-vform-eleplus/favicon.ico +0 -0
- package/sohelp-vform-eleplus/index.vue +297 -0
- package/sohelp-vform-eleplus/preview.html +91 -0
- package/sohelp-vform-eleplus/render.es.js +72433 -0
- package/sohelp-vform-eleplus/render.style.css +16 -0
- package/sohelp-vform-eleplus/render.umd.js +57 -0
- package/sohelp-vform-eleplus/tinymce/langs/zh_CN.js +462 -0
- package/sohelp-vform-eleplus/tinymce/langs/zh_TW.js +419 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.css +72 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/default/content.css +67 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/default/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/document/content.css +72 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/document/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.css +68 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.css +732 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.css +726 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.css +29 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.css +3047 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.css +673 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.css +37 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.css +714 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.css +726 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.css +29 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.css +3047 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.css +673 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +37 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +7 -0
- package/sohelp-vform-modal/index.vue +41 -0
- package/sohelp-vform-select/index.vue +11 -0
- package/sohelp-vform-vant/favicon.ico +0 -0
- package/sohelp-vform-vant/render.es.js +14608 -0
- package/sohelp-vform-vant/render.style.css +1 -0
- package/sohelp-vform-vant/render.umd.js +22 -0
- package/sohelp-vxe-grid/DefaultGridOptions.js +102 -0
- package/sohelp-vxe-grid/DefaultProps.js +37 -0
- package/sohelp-vxe-grid/SohelpGridConfig.js +142 -0
- package/sohelp-vxe-grid/index.vue +518 -0
- package/sohelp-vxe-grid-select/index.vue +148 -0
- package/sohelp-vxe-table/index.vue +184 -0
- package/sohelp-workflow/index.vue +495 -0
- package/sohelp-workflow/nodeWrap.vue +53 -0
- package/sohelp-workflow/nodes/addNode.vue +27 -0
- package/sohelp-workflow/nodes/approver.vue +125 -0
- package/sohelp-workflow/nodes/branch.vue +434 -0
- package/sohelp-workflow/nodes/promoter.vue +80 -0
- package/sohelp-workflow/nodes/send.vue +95 -0
- package/sohelp-workflow-drawer/components/approval-modal.vue +182 -0
- package/sohelp-workflow-drawer/components/draw-box.vue +141 -0
- package/sohelp-workflow-drawer/components/form.vue +79 -0
- package/sohelp-workflow-drawer/components/table.vue +153 -0
- package/sohelp-workflow-drawer/components/timeline.vue +189 -0
- package/sohelp-workflow-drawer/components/workflow.vue +68 -0
- package/sohelp-workflow-drawer/index.vue +311 -0
- package/sohelp-workflow-drawer/js/index.js +119 -0
- package/style/index.scss +0 -0
- package/utils/ProFormConvertUtil.js +76 -0
- package/utils/core.js +310 -0
- package/utils/use-form-data.js +48 -0
- package/utils/use-mobile.js +43 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 属性
|
|
3
|
+
*/
|
|
4
|
+
export const prop = {
|
|
5
|
+
url: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
mappingFields:{
|
|
12
|
+
type: Object,
|
|
13
|
+
default: () => {
|
|
14
|
+
return {
|
|
15
|
+
label: 'label',
|
|
16
|
+
value: 'value'
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
width: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: '200px'
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
placeholder: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: '请选择'
|
|
29
|
+
},
|
|
30
|
+
modelValue: {
|
|
31
|
+
type: Array || String,
|
|
32
|
+
required: true
|
|
33
|
+
},
|
|
34
|
+
filterable: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: true
|
|
37
|
+
},
|
|
38
|
+
clearable: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: true
|
|
41
|
+
},
|
|
42
|
+
disabled: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
},
|
|
46
|
+
type: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: 'select'
|
|
49
|
+
},
|
|
50
|
+
size: {
|
|
51
|
+
type: String,
|
|
52
|
+
validator: function (value) {
|
|
53
|
+
return ['large', 'default', 'small', ''].includes(value);
|
|
54
|
+
},
|
|
55
|
+
default: 'default'
|
|
56
|
+
},
|
|
57
|
+
multiple: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false
|
|
60
|
+
},
|
|
61
|
+
type: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: 'select'
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* 事件
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
export const emit = ['update:modelValue','change'];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sohelp-drawer>
|
|
3
|
+
<sohelp-vform v-bind="$attrs" :refid="refid" ref="sohelpVformRef">
|
|
4
|
+
<slot>
|
|
5
|
+
<template v-for="(slotProps, slotName) in $scopedSlots" :key="slotName">
|
|
6
|
+
<slot :name="slotName" v-bind="slotProps" />
|
|
7
|
+
</template>
|
|
8
|
+
</slot>
|
|
9
|
+
</sohelp-vform>
|
|
10
|
+
<div class="drawer__footer">
|
|
11
|
+
<slot name="footer" />
|
|
12
|
+
</div>
|
|
13
|
+
</sohelp-drawer>
|
|
14
|
+
</template>
|
|
15
|
+
<script lang="ts">
|
|
16
|
+
import SohelpVform from "../sohelp-vform/index.vue"
|
|
17
|
+
import SohelpDrawer from "../sohelp-drawer/index.vue"
|
|
18
|
+
import {ref} from "vue";
|
|
19
|
+
export default {
|
|
20
|
+
name: 'SohelpVformDrawer',
|
|
21
|
+
components: {SohelpDrawer, SohelpVform},
|
|
22
|
+
props: {
|
|
23
|
+
refid: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: true
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
setup(props, {emits, attrs}) {
|
|
29
|
+
const sohelpVformRef = ref(null);
|
|
30
|
+
const getFormJson =()=>{
|
|
31
|
+
return sohelpVformRef.value.getFormJson();
|
|
32
|
+
}
|
|
33
|
+
const getFormData =()=>{
|
|
34
|
+
return sohelpVformRef.value.getFormData();
|
|
35
|
+
}
|
|
36
|
+
return {sohelpVformRef,getFormJson,getFormData};
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
</script>
|
|
40
|
+
<style></style>
|
|
Binary file
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sohelp-vform-eleplus" :class="moduleType">
|
|
3
|
+
<div class="sohelp-vform-main">
|
|
4
|
+
<VFormRender
|
|
5
|
+
:form-json="formJson"
|
|
6
|
+
:option-data="optionData"
|
|
7
|
+
ref="vFormRenderRef"
|
|
8
|
+
class="v-form-render"
|
|
9
|
+
v-model="modelValue"
|
|
10
|
+
:data="data"
|
|
11
|
+
>
|
|
12
|
+
</VFormRender>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="vform-footer" v-if="toolbar?.length > 0">
|
|
15
|
+
<el-button
|
|
16
|
+
v-for="item in toolbar"
|
|
17
|
+
:key="item.id || item.title"
|
|
18
|
+
:type="buttonsType[item.type] || ''"
|
|
19
|
+
:icon="item.iconCls"
|
|
20
|
+
@click="toolbarButtonClick(item)"
|
|
21
|
+
>
|
|
22
|
+
{{ item.title }}
|
|
23
|
+
</el-button>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script setup>
|
|
29
|
+
import { defineProps, getCurrentInstance, inject, onMounted, reactive, ref, watch } from 'vue';
|
|
30
|
+
import { moduleCache } from '@/components/sohelp-eleplus/cache/ModuleCache.js';
|
|
31
|
+
import { useRoute } from 'vue-router';
|
|
32
|
+
import { EleMessage } from '@/components/ele-admin-plus/components/index.js';
|
|
33
|
+
import { usePageTab } from '@/utils/use-page-tab.js';
|
|
34
|
+
|
|
35
|
+
const instance = getCurrentInstance();
|
|
36
|
+
const { finishPageTab, setPageTabTitle, addPageTab } = usePageTab();
|
|
37
|
+
const globalConfig = inject('globalConfig');
|
|
38
|
+
const vFormRenderRef = ref(null);
|
|
39
|
+
const formJson = reactive({});
|
|
40
|
+
const optionData = reactive({});
|
|
41
|
+
|
|
42
|
+
const modelValue = defineModel('modelValue', { default: () => ({}), type: Object });
|
|
43
|
+
const data = defineModel('data', { default: () => ({}), type: Object });
|
|
44
|
+
|
|
45
|
+
const props = defineProps({
|
|
46
|
+
refid: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: ''
|
|
49
|
+
},
|
|
50
|
+
moduleType: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: 'tab'
|
|
53
|
+
},
|
|
54
|
+
title: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: ''
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const buttonsType = {
|
|
61
|
+
custom: 'primary',
|
|
62
|
+
create: 'primary',
|
|
63
|
+
save: 'primary',
|
|
64
|
+
delete: 'danger',
|
|
65
|
+
confirm: 'primary',
|
|
66
|
+
cancel: '',
|
|
67
|
+
close: '',
|
|
68
|
+
submit: 'primary',
|
|
69
|
+
print: 'primary',
|
|
70
|
+
refresh: 'primary'
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const route = useRoute();
|
|
74
|
+
const toolbar = ref([]);
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 加载配置
|
|
78
|
+
* @param refid 配置地址
|
|
79
|
+
* @returns {Promise<void>}
|
|
80
|
+
*/
|
|
81
|
+
const loadConfig = async (refid) => {
|
|
82
|
+
//从缓存中获取配置
|
|
83
|
+
const data = await moduleCache.getLayout(refid).catch((e) => {
|
|
84
|
+
EleMessage.error(e.message);
|
|
85
|
+
});
|
|
86
|
+
if (!data?.code) {
|
|
87
|
+
EleMessage.error('没有发现模块配置内容:' + route.meta.modulePath);
|
|
88
|
+
}
|
|
89
|
+
const config = JSON.parse(data?.code ?? '{}');
|
|
90
|
+
if (globalConfig?.size && config?.formConfig) {
|
|
91
|
+
config.formConfig.size = globalConfig.size;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
toolbar.value = data?.toolbar || [];
|
|
95
|
+
setFormJson(config);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const setFormJson = (json) => {
|
|
99
|
+
vFormRenderRef.value.setFormJson(json);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const convertObjectToId = (obj) => {
|
|
103
|
+
if (!obj || typeof obj !== 'object') return obj;
|
|
104
|
+
|
|
105
|
+
const result = { ...obj };
|
|
106
|
+
for (const key in result) {
|
|
107
|
+
if (result[key] && typeof result[key] === 'object') {
|
|
108
|
+
// 如果是对象,并且有 id 属性,则替换为 id
|
|
109
|
+
if ('id' in result[key]) {
|
|
110
|
+
result[key] = result[key].id;
|
|
111
|
+
} else {
|
|
112
|
+
// 否则递归处理子对象
|
|
113
|
+
result[key] = convertObjectToId(result[key]);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return result;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const setFormData = (data) => {
|
|
122
|
+
setTimeout(() => {
|
|
123
|
+
vFormRenderRef.value.setFormData(data);
|
|
124
|
+
modelValue.value = convertObjectToId(data.value);
|
|
125
|
+
}, 100);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const setModelValue = (value) => {
|
|
129
|
+
modelValue.value = value;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const getFormData = (validate = true) => {
|
|
133
|
+
return vFormRenderRef.value.getFormData(validate);
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
//加载布局配置
|
|
137
|
+
loadConfig(decodeURI(props.refid));
|
|
138
|
+
|
|
139
|
+
onMounted(async () => {
|
|
140
|
+
window.$message = instance?.appContext?.config.globalProperties.$message;
|
|
141
|
+
setPageTabTitle(route.query.title || props.title || '');
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
//工具栏点击事件
|
|
145
|
+
const toolbarButtonClick = (config) => {
|
|
146
|
+
if (config.handler) {
|
|
147
|
+
try {
|
|
148
|
+
const scope = {
|
|
149
|
+
$vform: vFormRenderRef.value,
|
|
150
|
+
$message: window.$message,
|
|
151
|
+
$modelValue: modelValue.value,
|
|
152
|
+
$refid: props.refid,
|
|
153
|
+
$data: data.value,
|
|
154
|
+
$param: route.query,
|
|
155
|
+
$config: config
|
|
156
|
+
};
|
|
157
|
+
const func = new Function('modelValue', config.handler);
|
|
158
|
+
func.call(scope, modelValue.value || {});
|
|
159
|
+
} catch (e) {
|
|
160
|
+
console.error('工具栏按钮单击事件出错:' + props.refid, e);
|
|
161
|
+
EleMessage.error(e);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
watch(
|
|
167
|
+
props.refid,
|
|
168
|
+
(val) => {
|
|
169
|
+
if (val) {
|
|
170
|
+
loadConfig(decodeURI(val));
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
{ immediate: true }
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
defineExpose({
|
|
177
|
+
loadConfig,
|
|
178
|
+
setFormJson,
|
|
179
|
+
setFormData,
|
|
180
|
+
setModelValue,
|
|
181
|
+
getFormData,
|
|
182
|
+
toolbarButtonClick
|
|
183
|
+
});
|
|
184
|
+
</script>
|
|
185
|
+
<style scoped lang="scss">
|
|
186
|
+
.sohelp-vform-eleplus.tab {
|
|
187
|
+
flex-direction: column-reverse;
|
|
188
|
+
|
|
189
|
+
.vform-footer {
|
|
190
|
+
justify-content: flex-start;
|
|
191
|
+
border-top: 0;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.sohelp-vform-eleplus {
|
|
196
|
+
height: 100%;
|
|
197
|
+
width: 100%;
|
|
198
|
+
box-sizing: border-box;
|
|
199
|
+
overflow: hidden;
|
|
200
|
+
display: flex;
|
|
201
|
+
flex-direction: column;
|
|
202
|
+
|
|
203
|
+
.sohelp-vform-main {
|
|
204
|
+
box-sizing: border-box;
|
|
205
|
+
overflow: auto;
|
|
206
|
+
display: flex;
|
|
207
|
+
flex: 1;
|
|
208
|
+
flex-direction: column;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.vform-footer {
|
|
212
|
+
padding: 10px 20px;
|
|
213
|
+
height: 55px;
|
|
214
|
+
line-height: 30px;
|
|
215
|
+
border-top: 1px solid #ebeef5;
|
|
216
|
+
width: 100%;
|
|
217
|
+
overflow: hidden;
|
|
218
|
+
display: flex;
|
|
219
|
+
box-sizing: border-box;
|
|
220
|
+
justify-content: flex-end;
|
|
221
|
+
flex-shrink: 0; /* 防止footer被压缩 */
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.vform-footer + .sohelp-vform-main {
|
|
225
|
+
/* 当footer存在时,调整main区域样式 */
|
|
226
|
+
max-height: calc(100% - 55px);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.v-form-render {
|
|
230
|
+
flex-shrink: 0;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.vform-footer .el-button:first-of-type {
|
|
234
|
+
margin-left: 0 !important;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.sohelp-page {
|
|
239
|
+
:deep(.sohelp-hidden-container) {
|
|
240
|
+
display: none !important;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.v-form-render {
|
|
245
|
+
border-radius: 10px;
|
|
246
|
+
background-color: white;
|
|
247
|
+
padding: 10px;
|
|
248
|
+
height: 100%;
|
|
249
|
+
box-sizing: border-box;
|
|
250
|
+
overflow: auto;
|
|
251
|
+
|
|
252
|
+
:deep(.sohelp-entity-form-widget-wrapper) {
|
|
253
|
+
& > .el-form-item:first-of-type > .el-form-item__label {
|
|
254
|
+
display: none;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.el-form-item {
|
|
258
|
+
margin-bottom: 18px !important;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
:deep(.vform-hide-el) {
|
|
263
|
+
display: none;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
:deep(.container-wrapper) {
|
|
267
|
+
height: 100%;
|
|
268
|
+
box-sizing: border-box;
|
|
269
|
+
|
|
270
|
+
.tab-container,
|
|
271
|
+
.el-tabs,
|
|
272
|
+
.el-container {
|
|
273
|
+
height: 100%;
|
|
274
|
+
box-sizing: border-box;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.el-main {
|
|
278
|
+
padding: 0px;
|
|
279
|
+
height: 100%;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.el-tabs__content {
|
|
283
|
+
height: calc(100% - 40px);
|
|
284
|
+
box-sizing: border-box;
|
|
285
|
+
|
|
286
|
+
.el-tab-pane {
|
|
287
|
+
height: 100%;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
:deep(.ele-split-panel) {
|
|
293
|
+
height: 100%;
|
|
294
|
+
box-sizing: border-box;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
</style>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport"
|
|
6
|
+
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
|
|
7
|
+
<title>模块预览-SohelpBoot</title>
|
|
8
|
+
<link rel="stylesheet" href="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/element-plus/2.0.4/index.min.css" />
|
|
9
|
+
<link rel="stylesheet" href="./render.style.css">
|
|
10
|
+
<style type="text/css">
|
|
11
|
+
</style>
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<div id="app">
|
|
15
|
+
<div v-loading="loading">
|
|
16
|
+
<v-form-render :form-json="formJson" :form-data="formData" :option-data="optionData" ref="vFormRef"></v-form-render>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
<script src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue/3.2.30/vue.global.min.js"></script>
|
|
20
|
+
<script src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/element-plus/2.0.4/index.full.min.js"></script>
|
|
21
|
+
<script src="https://ks3-cn-beijing.ksyun.com/vform3/render.umd.js?t=20220129"></script>
|
|
22
|
+
<!-- <script src="./render.umd.js?t=20220129"></script>-->
|
|
23
|
+
<script src="../../lib/axios.min.js"></script>
|
|
24
|
+
<script>
|
|
25
|
+
const url = window.location.href;
|
|
26
|
+
window.BASE_API_URL = url.substring(0,url.indexOf("/dev/"));
|
|
27
|
+
const { createApp } = Vue;
|
|
28
|
+
const token = localStorage.getItem("sohelp-boot-access-token");
|
|
29
|
+
window.$axios = axios.create({
|
|
30
|
+
baseURL: window.BASE_API_URL,
|
|
31
|
+
headers: {
|
|
32
|
+
'Authorization': token
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const app = createApp({
|
|
37
|
+
data() {
|
|
38
|
+
return {
|
|
39
|
+
formJson: {},
|
|
40
|
+
formData: {},
|
|
41
|
+
optionData: {},
|
|
42
|
+
loading: false
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
mounted() {
|
|
46
|
+
this.load();
|
|
47
|
+
},
|
|
48
|
+
methods: {
|
|
49
|
+
load() {
|
|
50
|
+
// 获取url参数
|
|
51
|
+
const refid = decodeURIComponent(this.getQueryParam("refid") || '');
|
|
52
|
+
if (refid) {
|
|
53
|
+
this.loading = true;
|
|
54
|
+
$axios.get('/engine/web/layout/read?refid=' + refid).then(res => {
|
|
55
|
+
const { data: { data } } = res;
|
|
56
|
+
if (data && data.code) {
|
|
57
|
+
let _data = JSON.parse(data.code);
|
|
58
|
+
this.$nextTick(() => {
|
|
59
|
+
this.$refs.vFormRef.setFormJson(_data);
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
this.loading = false;
|
|
63
|
+
}).catch(err => {
|
|
64
|
+
this.$message.error(err);
|
|
65
|
+
this.loading = false;
|
|
66
|
+
})
|
|
67
|
+
} else {
|
|
68
|
+
this.$message.error("refid参数未提供");
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
// 获取参数
|
|
72
|
+
getQueryParam(variable) {
|
|
73
|
+
let query = window.location.search.substring(1);
|
|
74
|
+
let vars = query.split("&")
|
|
75
|
+
for (let i = 0; i < vars.length; i++) {
|
|
76
|
+
let pair = vars[i].split("=")
|
|
77
|
+
if (pair[0] == variable) {
|
|
78
|
+
return pair[1]
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
app.use(ElementPlus)
|
|
86
|
+
app.use(VFormRender)
|
|
87
|
+
app.mount("#app");
|
|
88
|
+
</script>
|
|
89
|
+
</body>
|
|
90
|
+
|
|
91
|
+
</html>
|