Compare commits

...

10 Commits

Author SHA1 Message Date
vform666 5849f15766
Merge pull request #30 from a847244052/master
Master
2024-03-28 15:05:04 +08:00
TTTTian 6514043e69 fix: width abnormal when collapse all closed 2024-03-25 08:38:36 +00:00
vdpAdmin 8561e54aea 更新友链。 2023-12-21 13:36:45 +08:00
xhliu ac90dca970 更新README。 2023-12-10 11:52:37 +08:00
vdpAdmin 21c036ed9d 更新README。 2023-11-20 13:42:00 +08:00
vdpAdmin 5559d6b31f 修复svg图标换行显示的问题。 2023-08-15 13:45:27 +08:00
vdpAdmin 3a0f61e316 解决element plus升级新版2.3.8后,项目启动报错的问题。 2023-07-20 11:46:09 +08:00
vdpAdmin 949a75ea29 图片、文件上传地址增加DSV变量支持。 2023-07-05 16:47:35 +08:00
vdpAdmin 6d66308fbb 优化组件库显示样式。 2023-04-22 11:04:02 +08:00
vdpAdmin bf15bcb963 修复几个小bug。 2023-04-18 16:46:59 +08:00
12 changed files with 59 additions and 41 deletions

View File

@ -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
### 功能一览
```

View File

@ -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() {

View File

@ -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
}
},

View File

@ -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;
})

View File

@ -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() {

View File

@ -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() {
/* 这里不能访问方法和属性!! */

View File

@ -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}">

View File

@ -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>

View File

@ -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 {

View File

@ -45,5 +45,6 @@
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
display: inline-block;
}
</style>

View File

@ -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

View File

@ -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') {