Commit 7307c7e6 authored by 王康's avatar 王康

form

parent 417ecb34
...@@ -504,7 +504,7 @@ ...@@ -504,7 +504,7 @@
// 下拉框多选时将字符串转为数组 // 下拉框多选时将字符串转为数组
_.each(self.columns, function(item, index) { _.each(self.columns, function(item, index) {
if (item.widgetType === 2) { if (item.widgetType === 2 && item.multiple === true) {
_.forEach(self.formModel, function(value, key) { _.forEach(self.formModel, function(value, key) {
if (item.codeCamel === key) { if (item.codeCamel === key) {
// console.log(11111, self.formModel[key]) // console.log(11111, self.formModel[key])
...@@ -605,10 +605,10 @@ ...@@ -605,10 +605,10 @@
transformRequest: transformRequest:
function(obj) { function(obj) {
var str = [] var str = []
// 删除空值的属性 // // 删除空值的属性
obj = _.omitBy(obj, function(value) { // obj = _.omitBy(obj, function(value) {
return !value // return !value
}) // })
for (var p in obj) { for (var p in obj) {
str.push(encodeURIComponent(p) + '=' + encodeURIComponent(obj[p])) str.push(encodeURIComponent(p) + '=' + encodeURIComponent(obj[p]))
} }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
:buttons="showUserButtons" :buttons="showUserButtons"
:layout="layout" :layout="layout"
:tips="tips" :tips="tips"
:tableId="tableId"
:refers="judgeRefers"> :refers="judgeRefers">
</hm-complex-form> </hm-complex-form>
</div> </div>
...@@ -43,7 +44,7 @@ ...@@ -43,7 +44,7 @@
// ] // ]
}, },
// 2下拉框 // 2下拉框
{ name: '用户名称', codeCamel: 'username', widgetType: 2, multiple: true, { name: '用户名称', codeCamel: 'username', widgetType: 2, multiple: false,
change: this.inputChange, // default: [1], 如果开启多选,默认选中项用数组[1]、[1,2,3] change: this.inputChange, // default: [1], 如果开启多选,默认选中项用数组[1]、[1,2,3]
options: [ options: [
{ value: '1', label: '企业' }, // 下拉框的label是选项文字,value是选中值 { value: '1', label: '企业' }, // 下拉框的label是选项文字,value是选中值
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment