Compare commits
10 Commits
aa29fe67c6
...
5849f15766
Author | SHA1 | Date |
---|---|---|
vform666 | 5849f15766 | |
TTTTian | 6514043e69 | |
vdpAdmin | 8561e54aea | |
xhliu | ac90dca970 | |
vdpAdmin | 21c036ed9d | |
vdpAdmin | 5559d6b31f | |
vdpAdmin | 3a0f61e316 | |
vdpAdmin | 949a75ea29 | |
vdpAdmin | 6d66308fbb | |
vdpAdmin | bf15bcb963 |
|
@ -8,6 +8,9 @@
|
|||
### 立即体验VForm 3
|
||||
[在线Demo](http://120.92.142.115:81/vform3/)
|
||||
|
||||
### 🎉🎉<mark>基于VForm3的全栈低代码平台已发布</mark>🎉🎉
|
||||
[美乐低代码——立即进入](https://melecode.com/) (私有部署、开箱即用️,已开源✌✌)️
|
||||
|
||||
### 立即体验VForm 3 Pro高级版(提供商业支持)
|
||||
[VForm 3 Pro Demo](https://www.vform666.com/pro/)
|
||||
|
||||
|
@ -18,9 +21,8 @@
|
|||
[点此查看](https://gitee.com/vdpadmin/variant-form)
|
||||
|
||||
### 友情链接
|
||||
[Fantastic-admin](https://hooray.gitee.io/fantastic-admin/) —— 一款开箱即用的 Vue 中后台管理系统框架(支持Vue2/Vue3)
|
||||
|
||||
[REBUILD](https://getrebuild.com/) —— 高度可定制化的企业管理系统
|
||||
[Fantastic-admin](https://hooray.gitee.io/fantastic-admin/) —— 一款开箱即用的 Vue 中后台管理系统框架(支持Vue2/Vue3)
|
||||
|
||||
### 功能一览
|
||||
```
|
||||
|
|
16
src/App.vue
16
src/App.vue
|
@ -1,5 +1,4 @@
|
|||
<template>
|
||||
<el-config-provider :locale="elLocale">
|
||||
<div id="app">
|
||||
<VFormDesigner ref="vfDesignerRef" :global-dsv="globalDsv">
|
||||
<!--
|
||||
|
@ -9,15 +8,11 @@
|
|||
-->
|
||||
</VFormDesigner>
|
||||
</div>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VFormDesigner from './components/form-designer/index.vue'
|
||||
|
||||
import zhCNLang from 'element-plus/lib/locale/lang/zh-cn'
|
||||
import enUSLang from 'element-plus/lib/locale/lang/en'
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {
|
||||
|
@ -25,11 +20,6 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
elLocaleMap: {
|
||||
'zh-CN': zhCNLang,
|
||||
'en-US': enUSLang,
|
||||
},
|
||||
|
||||
//全局数据源变量
|
||||
globalDsv: {
|
||||
testApiHost: 'http://www.test.com/api',
|
||||
|
@ -39,11 +29,7 @@ export default {
|
|||
}
|
||||
},
|
||||
computed: {
|
||||
elLocale() {
|
||||
let curLocale = localStorage.getItem('v_form_locale') || 'zh-CN'
|
||||
return this.elLocaleMap[curLocale]
|
||||
},
|
||||
|
||||
//
|
||||
},
|
||||
methods: {
|
||||
doTest() {
|
||||
|
|
|
@ -190,7 +190,7 @@
|
|||
this.layoutProps.span = this.widget.options.md || 12
|
||||
}
|
||||
} else {
|
||||
this.layoutProps.spn = this.widget.options.span
|
||||
this.layoutProps.span = this.widget.options.span
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -93,8 +93,7 @@
|
|||
},
|
||||
methods: {
|
||||
onTabClick(evt) {
|
||||
console.log('onTabClick', evt)
|
||||
let paneName = evt.name
|
||||
let paneName = evt.paneName
|
||||
this.widget.tabs.forEach((tp) => {
|
||||
tp.options.active = tp.options.name === paneName;
|
||||
})
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<!-- el-upload增加:name="field.options.name"后,会导致又拍云上传失败!故删除之!! -->
|
||||
<el-upload ref="fieldEditor" :disabled="field.options.disabled"
|
||||
:style="styleVariables" class="dynamicPseudoAfter"
|
||||
:action="field.options.uploadURL" :headers="uploadHeaders" :data="uploadData"
|
||||
:action="realUploadURL" :headers="uploadHeaders" :data="uploadData"
|
||||
:with-credentials="field.options.withCredentials"
|
||||
:multiple="field.options.multipleSelect" :file-list="fileList"
|
||||
:show-file-list="field.options.showFileList" :class="{'hideUploadDiv': uploadBtnHidden}"
|
||||
|
@ -37,7 +37,7 @@
|
|||
import FormItemWrapper from './form-item-wrapper'
|
||||
import emitter from '@/utils/emitter'
|
||||
import i18n, {translate} from "@/utils/i18n";
|
||||
import {deepClone} from "@/utils/util";
|
||||
import {deepClone, evalFn} from "@/utils/util";
|
||||
import fieldMixin from "@/components/form-designer/form-widget/field-widget/fieldMixin";
|
||||
import SvgIcon from "@/components/svg-icon/index";
|
||||
|
||||
|
@ -100,6 +100,16 @@
|
|||
}
|
||||
},
|
||||
computed: {
|
||||
realUploadURL() {
|
||||
let uploadURL = this.field.options.uploadURL
|
||||
if (!!uploadURL && ((uploadURL.indexOf('DSV.') > -1) || (uploadURL.indexOf('DSV[') > -1))) {
|
||||
let DSV = this.getGlobalDsv()
|
||||
console.log('test DSV: ', DSV) //防止DSV被打包工具优化!!!
|
||||
return evalFn(this.field.options.uploadURL, DSV)
|
||||
}
|
||||
|
||||
return this.field.options.uploadURL
|
||||
},
|
||||
|
||||
},
|
||||
beforeCreate() {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
:sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex" :sub-form-row-id="subFormRowId">
|
||||
<!-- el-upload增加:name="field.options.name"后,会导致又拍云上传失败!故删除之!! -->
|
||||
<el-upload ref="fieldEditor" :disabled="field.options.disabled"
|
||||
:action="field.options.uploadURL" :headers="uploadHeaders" :data="uploadData"
|
||||
:action="realUploadURL" :headers="uploadHeaders" :data="uploadData"
|
||||
:with-credentials="field.options.withCredentials"
|
||||
:multiple="field.options.multipleSelect" :file-list="fileList" :show-file-list="field.options.showFileList"
|
||||
list-type="picture-card" :class="{'hideUploadDiv': uploadBtnHidden}"
|
||||
|
@ -56,7 +56,7 @@
|
|||
import FormItemWrapper from './form-item-wrapper'
|
||||
import emitter from '@/utils/emitter'
|
||||
import i18n, {translate} from "@/utils/i18n";
|
||||
import {deepClone} from "@/utils/util";
|
||||
import {deepClone, evalFn} from "@/utils/util";
|
||||
import fieldMixin from "@/components/form-designer/form-widget/field-widget/fieldMixin";
|
||||
import SvgIcon from "@/components/svg-icon/index";
|
||||
|
||||
|
@ -118,7 +118,19 @@
|
|||
computed: {
|
||||
previewList() {
|
||||
return this.fileList.map(el => el.url);
|
||||
},
|
||||
|
||||
realUploadURL() {
|
||||
let uploadURL = this.field.options.uploadURL
|
||||
if (!!uploadURL && ((uploadURL.indexOf('DSV.') > -1) || (uploadURL.indexOf('DSV[') > -1))) {
|
||||
let DSV = this.getGlobalDsv()
|
||||
console.log('test DSV: ', DSV) //防止DSV被打包工具优化!!!
|
||||
return evalFn(this.field.options.uploadURL, DSV)
|
||||
}
|
||||
|
||||
return this.field.options.uploadURL
|
||||
},
|
||||
|
||||
},
|
||||
beforeCreate() {
|
||||
/* 这里不能访问方法和属性!! */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<el-container class="panel-container">
|
||||
<el-tabs v-model="activeTab" style="height: 100%; overflow: hidden">
|
||||
<el-tabs v-model="activeTab" style="height: 100%; width:100%; overflow: hidden">
|
||||
<el-tab-pane :label="i18nt('designer.hint.widgetSetting')" name="1">
|
||||
<el-scrollbar class="setting-scrollbar" :style="{height: scrollerHeight}">
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
</div>
|
||||
|
||||
<el-drawer :title="i18nt('designer.toolbar.nodeTreeTitle')" direction="ltr" v-model="showNodeTreeDrawerFlag" :modal="true" :size="280"
|
||||
:destroy-on-close="true" custom-class="node-tree-drawer">
|
||||
:destroy-on-close="true" class="node-tree-drawer">
|
||||
<el-tree ref="nodeTree" :data="nodeTreeData" node-key="id" default-expand-all highlight-current class="node-tree"
|
||||
icon-class="el-icon-arrow-right" @node-click="onNodeTreeClick"></el-tree>
|
||||
</el-drawer>
|
||||
|
|
|
@ -278,7 +278,8 @@
|
|||
|
||||
<style lang="scss" scoped>
|
||||
.color-svg-icon {
|
||||
color: $--color-primary;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
color: #7c7d82;
|
||||
}
|
||||
|
||||
.side-scroll-bar {
|
||||
|
@ -332,21 +333,28 @@
|
|||
|
||||
.container-widget-item, .field-widget-item {
|
||||
display: inline-block;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
width: 115px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
width: 98px;
|
||||
float: left;
|
||||
margin: 2px 6px 6px 0;
|
||||
cursor: move;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
background: #f1f2f3;
|
||||
background: #fff;
|
||||
border: 1px solid #e8e9eb;
|
||||
border-radius: 4px;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.container-widget-item:hover, .field-widget-item:hover {
|
||||
background: #EBEEF5;
|
||||
outline: 1px solid $--color-primary;
|
||||
background: #F1F2F3;
|
||||
border-color: $--color-primary;
|
||||
|
||||
.color-svg-icon {
|
||||
color: $--color-primary;
|
||||
}
|
||||
}
|
||||
|
||||
.drag-handler {
|
||||
|
|
|
@ -45,5 +45,6 @@
|
|||
vertical-align: -0.15em;
|
||||
fill: currentColor;
|
||||
overflow: hidden;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
import { createI18n } from './smart-vue-i18n/index'
|
||||
|
||||
import enLocaleElement from "element-plus/lib/locale/lang/en";
|
||||
import zhLocaleElement from "element-plus/lib/locale/lang/zh-cn";
|
||||
//import locale from "element-plus/lib/locale"
|
||||
|
||||
import enLocale from "@/lang/en-US";
|
||||
import zhLocale from "@/lang/zh-CN";
|
||||
import enLocale_render from "@/lang/en-US_render";
|
||||
|
@ -16,7 +12,6 @@ const langResources = {
|
|||
something: {
|
||||
//...
|
||||
},
|
||||
...enLocaleElement,
|
||||
...enLocale,
|
||||
...enLocale_render,
|
||||
...enLocale_extension
|
||||
|
@ -26,7 +21,6 @@ const langResources = {
|
|||
something: {
|
||||
//...
|
||||
},
|
||||
...zhLocaleElement,
|
||||
...zhLocale,
|
||||
...zhLocale_render,
|
||||
...zhLocale_extension
|
||||
|
|
|
@ -37,6 +37,12 @@ export const overwriteObj = function(obj1, obj2) { /* 浅拷贝对象属性,o
|
|||
})
|
||||
}
|
||||
|
||||
/* 用Function对象实现eval函数功能 */
|
||||
export const evalFn = function (fn, DSV = null, VFR = null) {
|
||||
let f = new Function('DSV', 'VFR', 'return ' + fn);
|
||||
return f(DSV, VFR);
|
||||
};
|
||||
|
||||
export const addWindowResizeHandler = function (handler) {
|
||||
let oldHandler = window.onresize
|
||||
if (typeof window.onresize != 'function') {
|
||||
|
|
Loading…
Reference in New Issue