From 568d9ab7628b05c446b3df756038cfccc690b442 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Mon, 15 May 2023 08:52:13 +0800 Subject: [PATCH] optimize repair --- .../addOwnerRepair/addOwnerRepair.html | 45 ++++++------------- .../property/roomSelect2/roomSelect2.js | 43 +++++++++--------- 2 files changed, 35 insertions(+), 53 deletions(-) diff --git a/public/components/property/addOwnerRepair/addOwnerRepair.html b/public/components/property/addOwnerRepair/addOwnerRepair.html index 4668f252b..382ab6336 100755 --- a/public/components/property/addOwnerRepair/addOwnerRepair.html +++ b/public/components/property/addOwnerRepair/addOwnerRepair.html @@ -13,9 +13,8 @@
- + @@ -24,26 +23,21 @@
-
+
- +
-
+
- +
@@ -52,9 +46,7 @@
- +
@@ -78,9 +70,7 @@
- +
@@ -88,9 +78,7 @@
- +
@@ -98,9 +86,7 @@
- +
@@ -108,18 +94,15 @@
-
- -
@@ -129,4 +112,4 @@ - + \ No newline at end of file diff --git a/public/components/property/roomSelect2/roomSelect2.js b/public/components/property/roomSelect2/roomSelect2.js index c1f31e087..f2f957b7b 100755 --- a/public/components/property/roomSelect2/roomSelect2.js +++ b/public/components/property/roomSelect2/roomSelect2.js @@ -1,4 +1,4 @@ -(function (vc) { +(function(vc) { vc.extends({ propTypes: { parentModal: vc.propTypes.string, @@ -21,7 +21,7 @@ watch: { roomSelect2Info: { deep: true, - handler: function () { + handler: function() { let _name = ''; if (this.roomSelect2Info.floorNum != '') { _name = this.roomSelect2Info.floorNum; @@ -39,26 +39,26 @@ } } }, - _initMethod: function () { + _initMethod: function() { this._initRoomSelect2(); }, - _initEvent: function () { + _initEvent: function() { //监听 modal 打开 /* $('#'+$props.parentModal).on('show.bs.modal', function () { this._initUnitSelect2(); })*/ - vc.on('roomSelect2', "transferRoom", function (_param) { + vc.on('roomSelect2', "transferRoom", function(_param) { vc.copyObject(_param, this.roomSelect2Info); this._initRoomSelect2(); }); - vc.on('roomSelect2', 'setRoom', function (_param) { + vc.on('roomSelect2', 'setRoom', function(_param) { vc.copyObject(_param, this.roomSelect2Info); /*$("#roomSelector").val(_param.roomId).select2();*/ var option = new Option(_param.roomNum, _param.roomId, true, true); this.roomSelect2Info.roomSelector.append(option); }); - vc.on('roomSelect2', 'clearRoom', function (_param) { + vc.on('roomSelect2', 'clearRoom', function(_param) { $('#roomSelector').val('').select2(); this.roomSelect2Info = { units: [], @@ -74,28 +74,27 @@ }); }, methods: { - _initRoomSelect2: function () { + _initRoomSelect2: function() { console.log("调用_initRoomSelect2 方法"); - $.fn.modal.Constructor.prototype.enforceFocus = function () { - }; + $.fn.modal.Constructor.prototype.enforceFocus = function() {}; $.fn.select2.defaults.set('width', '100%'); this.roomSelect2Info.roomSelector = $('#roomSelector').select2({ placeholder: '必填,请选择房屋', - allowClear: true,//允许清空 - escapeMarkup: function (markup) { + allowClear: true, //允许清空 + escapeMarkup: function(markup) { return markup; }, // 自定义格式化防止xss注入 ajax: { url: "/app/room.queryRooms", dataType: 'json', delay: 250, - headers:{ + headers: { 'APP-ID': '8000418004', - 'TRANSACTION-ID' : vc.uuid(), + 'TRANSACTION-ID': vc.uuid(), 'REQ-TIME': vc.getDateYYYYMMDDHHMISS(), - 'SIGN' : '' + 'SIGN': '' }, - data: function (params) { + data: function(params) { console.log("param", params); var _term = ""; if (params.hasOwnProperty("term")) { @@ -104,12 +103,12 @@ return { roomNum: _term, page: 1, - row: 100, + row: 200, unitId: this.roomSelect2Info.unitId, communityId: vc.getCurrentCommunity().communityId }; }, - processResults: function (data) { + processResults: function(data) { console.log(data, this._filterRoomData(data.rooms)); return { results: this._filterRoomData(data.rooms) @@ -118,7 +117,7 @@ cache: true } }); - $('#roomSelector').on("select2:select", function (evt) { + $('#roomSelector').on("select2:select", function(evt) { //这里是选中触发的事件 //evt.params.data 是选中项的信息 console.log('select', evt); @@ -126,7 +125,7 @@ this.roomSelect2Info.roomNum = evt.params.data.text; }); - $('#roomSelector').on("select2:unselect", function (evt) { + $('#roomSelector').on("select2:unselect", function(evt) { //这里是取消选中触发的事件 //如配置allowClear: true后,触发 console.log('unselect', evt); @@ -136,7 +135,7 @@ }); }, - _filterRoomData: function (_rooms) { + _filterRoomData: function(_rooms) { var _tmpRooms = []; for (var i = 0; i < _rooms.length; i++) { var _tmpRoom = { @@ -149,4 +148,4 @@ } } }); -})(window.vc); +})(window.vc); \ No newline at end of file