Commit fd588ccc authored by 王康's avatar 王康

树形控件改进

parent e4cbf561
...@@ -46,15 +46,16 @@ ...@@ -46,15 +46,16 @@
// ] // ]
}, },
// 2下拉框 // 2下拉框
{ name: '用户名称', codeCamel: 'username', widgetType: 2, multiple: false, // { name: '用户名称', codeCamel: 'username', widgetType: 2, multiple: false,
change: this.inputChange, // default: [1], 如果开启多选,默认选中项用数组[1]、[1,2,3] // change: this.selectChange, // default: [1], 如果开启多选,默认选中项用数组[1]、[1,2,3]
options: [ // allowCreate: true,
{ value: '1', label: '企业' }, // 下拉框的label是选项文字,value是选中值 // options: [
{ value: '2', label: '代理商' }, // { value: '1', label: '企业' }, // 下拉框的label是选项文字,value是选中值
{ value: '3', label: '会员' }, // { value: '2', label: '代理商' },
{ value: '4', label: '访客' } // { value: '3', label: '会员' },
] // { value: '4', label: '访客' }
}, // ]
// },
// 3多选 不支持默认值 // 3多选 不支持默认值
{ name: '部门ID', codeCamel: 'departmentId', widgetType: 3, options: ['美女', '帅哥'], change: this.inputChange }, { name: '部门ID', codeCamel: 'departmentId', widgetType: 3, options: ['美女', '帅哥'], change: this.inputChange },
// 4密码 // 4密码
...@@ -71,9 +72,11 @@ ...@@ -71,9 +72,11 @@
{ label: 1, value: '会员' }, // 单选的value是选项文字,label是选中值 { label: 1, value: '会员' }, // 单选的value是选项文字,label是选中值
{ label: 2, value: '访客' } // 如果数据库中存的数据类型是number,label值写number如1,如果为string,label值写string ,如'1' { label: 2, value: '访客' } // 如果数据库中存的数据类型是number,label值写number如1,如果为string,label值写string ,如'1'
], // default: 1 ], // default: 1
change: this.inputChange }, change: this.inputChange
},
// 8文件 change: this.uploadChange // 8文件 change: this.uploadChange
{ name: '选择头像', codeCamel: 'avatar', widgetType: 8, url: '/api/upload', param: 'picture' } // url是后台接口地址 { name: '选择头像', codeCamel: 'avatar', widgetType: 8, url: '/api/upload', param: 'picture' }, // url是后台接口地址
{ name: '用户名称', codeCamel: 'username', widgetType: 8, url: '/api/upload', param: 'picture' } // url是后台接口地址
], ],
// CcSubject示例 // CcSubject示例
showUserColumns2: [ showUserColumns2: [
...@@ -103,11 +106,12 @@ ...@@ -103,11 +106,12 @@
includes: ['ccSubjectId'] includes: ['ccSubjectId']
} }
}, },
// userIncludes: { // 外查主
// 'hm_user': { userIncludes: {
// includes: ['user_id'] 'hm_user': {
// } includes: ['user_id']
// }, }
},
// 要显示按钮 // 要显示按钮
showUserButtons: [ showUserButtons: [
{ text: '确定', type: 1, method: this.method1, beforeSubmit: this.processData }, { text: '确定', type: 1, method: this.method1, beforeSubmit: this.processData },
...@@ -142,6 +146,7 @@ ...@@ -142,6 +146,7 @@
datePicker: { style: { width: '60%' }}, datePicker: { style: { width: '60%' }},
input: { style: { width: '60%' }}, input: { style: { width: '60%' }},
select: { style: { width: '60%' }}, select: { style: { width: '60%' }},
cascader: { style: { width: '60%' }},
textarea: { textarea: {
style: { width: '60%' }, style: { width: '60%' },
resize: 'none', resize: 'none',
...@@ -178,12 +183,15 @@ ...@@ -178,12 +183,15 @@
}, },
methods: { methods: {
inputChange(val, formModel) { inputChange(val, formModel) {
console.log(val) // console.log(val)
console.log(formModel) // console.log(formModel)
// formModel.email = val.length // formModel.email = val.length
}, },
selectChange(val, formModel) {
console.log('下拉框change', val, formModel)
},
processData(object, isCancel) { processData(object, isCancel) {
// isCancel.cancelSubmit = false // 如果要取消提交,设为true isCancel.cancelSubmit = false // 如果要取消提交,设为true
console.log(125, object) console.log(125, object)
return object // 将数据返回 return object // 将数据返回
}, },
...@@ -212,8 +220,8 @@ ...@@ -212,8 +220,8 @@
return formModel return formModel
}, },
uploadFun: function(response, formModel) { uploadFun: function(response, formModel) {
console.log(215, response) // console.log(215, response)
console.log(216, formModel) // console.log(216, formModel)
// 修改其他表单的值 // 修改其他表单的值
formModel.email = response.visitName formModel.email = response.visitName
} }
......
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