Преглед изворни кода

優化單元select2 問題

wuxw пре 6 година
родитељ
комит
dddfe9f92a

+ 3 - 3
WebService/src/main/resources/components/roomPackage/room-select2/roomSelect2.js

@@ -42,7 +42,7 @@
                 $('.roomSelector').select2({
                     placeholder: '必填,请选择房屋',
                     ajax: {
-                        url: "/callComponent/roomSelect2/loadRooms",
+                        url: "/callComponent/roomSelect2/listRoom",
                         dataType: 'json',
                         delay: 250,
                         data: function (params) {
@@ -68,7 +68,7 @@
                         cache: true
                     }
                 });
-                $('.floorSelector').on("select2:select", function (evt) {
+                $('.roomSelector').on("select2:select", function (evt) {
                     //这里是选中触发的事件
                     //evt.params.data 是选中项的信息
                     console.log('select',evt);
@@ -76,7 +76,7 @@
                     vc.component.roomSelect2Info.roomNum = evt.params.data.text;
                 });
 
-                $('.floorSelector').on("select2:unselect", function (evt) {
+                $('.roomSelector').on("select2:unselect", function (evt) {
                     //这里是取消选中触发的事件
                     //如配置allowClear: true后,触发
                     console.log('unselect',evt)

+ 2 - 2
WebService/src/main/resources/components/unitPackage/unit-select2/unitSelect2.js

@@ -69,7 +69,7 @@
                         cache: true
                     }
                 });
-                $('.floorSelector').on("select2:select", function (evt) {
+                $('.unitSelector').on("select2:select", function (evt) {
                     //这里是选中触发的事件
                     //evt.params.data 是选中项的信息
                     console.log('select',evt);
@@ -77,7 +77,7 @@
                     vc.component.unitSelect2Info.unitName = evt.params.data.text;
                 });
 
-                $('.floorSelector').on("select2:unselect", function (evt) {
+                $('.unitSelector').on("select2:unselect", function (evt) {
                     //这里是取消选中触发的事件
                     //如配置allowClear: true后,触发
                     console.log('unselect',evt)