Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from vform666:master #1

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -8,6 +8,13 @@
### 立即体验
[在线Demo](http://120.92.142.115/)


### 🎉🎉<mark>基于VForm的全栈低代码平台已发布</mark>🎉🎉
![meta_low_code](https://vform666.com/mele.png)
<br/>
[美乐低代码——立即进入](https://melecode.com/) (私有部署、开箱即用️,已开源✌✌)️


### 立即体验VForm Pro高级版(提供商业支持)
[Pro Demo](https://www.vform666.com/pro/)

@@ -22,9 +29,9 @@


### 友情链接

[Fantastic-admin](https://hooray.gitee.io/fantastic-admin/) —— 一款开箱即用的 Vue 中后台管理系统框架(支持Vue2/Vue3)

[REBUILD](https://getrebuild.com/) —— 高度可定制化的企业管理系统

<br/>

@@ -48,7 +55,7 @@

### 安装依赖
```
npm install --registry=https://registry.npm.taobao.org
npm install --registry=https://registry.npmmirror.com
```

### 开发调试
4 changes: 2 additions & 2 deletions index_template/index_prod.html
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
<!-- 禁止浏览器缓存index.html end -->
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.7/theme-chalk/index.min.css">
<link rel="stylesheet" href="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/element-ui/2.15.7/theme-chalk/index.min.css">
</head>
<body>
<noscript>
@@ -23,6 +23,6 @@
<!-- built files will be auto injected -->

<script src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue/2.6.14/vue.min.js"></script>
<script src="https://cdn.staticfile.org/element-ui/2.15.7/index.min.js"></script>
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/element-ui/2.15.7/index.min.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -96,8 +96,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;
})
Original file line number Diff line number Diff line change
@@ -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}"
@@ -31,7 +31,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";

let selectFileText = "'" + translate('render.hint.selectFile') + "'"
@@ -93,6 +93,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() {
Original file line number Diff line number Diff line change
@@ -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}"
@@ -29,7 +29,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";

export default {
@@ -88,6 +88,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() {
22 changes: 15 additions & 7 deletions src/components/form-designer/widget-panel/index.vue
Original file line number Diff line number Diff line change
@@ -265,7 +265,8 @@

<style lang="scss" scoped>
.color-svg-icon {
color: $--color-primary;
-webkit-font-smoothing: antialiased;
color: #7c7d82;
}

.side-scroll-bar {
@@ -319,21 +320,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 {
6 changes: 6 additions & 0 deletions src/utils/util.js
Original file line number Diff line number Diff line change
@@ -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') {