|
...
|
...
|
@@ -13,9 +13,9 @@ layui.define(['jquery', 'form'], function () { |
|
|
|
$ = layui.jquery;
|
|
|
|
form = layui.form;
|
|
|
|
$form = $('form');
|
|
|
|
treeSelect(defaults);
|
|
|
|
//treeSelect(defaults);
|
|
|
|
});
|
|
|
|
function treeSelect(config) {alert(1);
|
|
|
|
function treeSelect(config) {
|
|
|
|
config.v1 = config.v1 ? config.v1 : '';
|
|
|
|
config.v2 = config.v2 ? config.v2 : '';
|
|
|
|
config.v3 = config.v3 ? config.v3 : '';
|
|
...
|
...
|
@@ -24,16 +24,15 @@ function treeSelect(config) {alert(1); |
|
|
|
});
|
|
|
|
form.render();
|
|
|
|
cityEvent(config);
|
|
|
|
//areaEvent(config);
|
|
|
|
areaEvent(config);
|
|
|
|
form.on('select(' + config.s1 + ')', function (data) {
|
|
|
|
cityEvent(data);
|
|
|
|
//form.on('select(' + config.s2 + ')', function (data) {
|
|
|
|
//areaEvent(data);
|
|
|
|
//});
|
|
|
|
form.on('select(' + config.s2 + ')', function (data) {
|
|
|
|
areaEvent(data);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
function cityEvent(data) {
|
|
|
|
alert(1);
|
|
|
|
$form.find('select[name=' + config.s2 + ']').html("");
|
|
|
|
config.v1 = data.value ? data.value : config.v1;
|
|
|
|
$.each(threeSelectData, function (k, v) {
|
|
...
|
...
|
@@ -47,7 +46,7 @@ function treeSelect(config) {alert(1); |
|
|
|
});
|
|
|
|
form.render();
|
|
|
|
config.v2 = $('select[name=' + config.s2 + ']').val();
|
|
|
|
//areaEvent(config);
|
|
|
|
areaEvent(config);
|
|
|
|
}
|
|
|
|
function areaEvent(data) {
|
|
|
|
$form.find('select[name=' + config.s3 + ']').html("");
|
...
|
...
|
|