浏览代码

知识库引用,知识库搜索回车,表单回车提交BUG

seimin 3 年之前
父节点
当前提交
dd166063e5

+ 1 - 1
assets/css/styles.css

@@ -6592,7 +6592,7 @@ ul.sub-menu li ul.sub-menu li ul.sub-menu li a {
6592 6592
     border-bottom: 1px solid #c8c7cc !important;
6593 6593
     width: 545px;
6594 6594
     max-height: 500px;
6595
-    /* z-index: 99999; */
6595
+    z-index: 1;
6596 6596
     box-sizing: border-box;
6597 6597
     padding-bottom: 33px;
6598 6598
 }

+ 17 - 8
assets/js/controllers/customform/customformCtrl.js

@@ -7671,8 +7671,12 @@ appFormly.config(
7671 7671
                 }
7672 7672
             },
7673 7673
             controller: ['$scope', '$rootScope', '$modal', 'SweetAlert', 'api_bpm_data', 'api_solution', '$aside', 'api_zsk', 'api_bpm_domain', 'api_wechatfile', 'up_down_file', function ($scope, $rootScope, $modal, SweetAlert, api_bpm_data, api_solution, $aside, api_zsk, api_bpm_domain, api_wechatfile, up_down_file) {
7674
+                $scope.keypressModel = function(e,key){
7675
+                    if(e.keyCode === 13){
7676
+                        $scope.openModel(key);
7677
+                    }
7678
+                }
7674 7679
                 // 引用知识库点击
7675
-
7676 7680
                 $scope.searchKeyWord = '';
7677 7681
                 $scope.openModel = function (key) {
7678 7682
                     // alert(1)//重点
@@ -7727,11 +7731,13 @@ appFormly.config(
7727 7731
                         item.content = item.content.replace(/<p>/g, "").replace(/<\/p>/g, "").replace(/&nbsp;/g, '')
7728 7732
                     }
7729 7733
                     $scope.model.incident.handleDescription = item.content;
7730
-                    $scope.model.incident.category = item.category;
7731
-                    $scope.model.incident.priority.id = item.category.priority.id;
7732 7734
                     $scope.model.incident.title = $scope.model.incident.description = item.title;
7733
-                    item.category.label = item.category.category;
7734
-                    var categoryId = item.category.id;
7735
+                    $scope.model.incident.category = item.category;
7736
+                    if(item.category){
7737
+                        $scope.model.incident.priority.id = item.category.priority.id;
7738
+                        item.category.label = item.category.category;
7739
+                    }
7740
+                    var categoryId = item.category?item.category.id:'';
7735 7741
                     // 引用知识库事件分类后,修改事件分类选中状态,事件分类列表重载
7736 7742
                     function getres(nodes) {
7737 7743
                         if (!nodes || nodes.length == 0) {
@@ -7760,7 +7766,7 @@ appFormly.config(
7760 7766
                         }
7761 7767
                     })
7762 7768
                     // field.$parent.$parent.$parent.model.candidateGroups=item.category.group
7763
-                    $scope.model.candidateGroups = item.category.group
7769
+                    $scope.model.candidateGroups = item.category?item.category.group:{};
7764 7770
                     // 携带关联优先级,事件工单信息的时间
7765 7771
                     if ($scope.model && $scope.model.incident && item.category && item.category.priority && item.category.priority.id) {
7766 7772
                         api_bpm_domain.expectedTime('L' + (item.category.priority.id - 1559)).then(function (res) {
@@ -11017,8 +11023,11 @@ appFormly.config(
11017 11023
                                 options.value(options.model.requester);
11018 11024
                             }
11019 11025
                         },
11020
-                        addRequeter: function (size, options, modal) {
11021
-                            event.preventDefault();
11026
+                        addRequeter: function (size, options, modal, e) {
11027
+                            if(e.clientX === 0){
11028
+                                return;
11029
+                            }
11030
+                            e.preventDefault();
11022 11031
                             var modalInstance = modal.open({
11023 11032
                                 templateUrl: 'assets/views/customform/tpl/modal-add-callrequester.html',
11024 11033
                                 controller: function ($scope, sco, $rootScope, $modalInstance, items, SweetAlert, title, Restangular, APIService, UserService, api_user_data, api_statistic, api_wechatfile) {

+ 3 - 3
assets/views/customform/index.html

@@ -48,7 +48,7 @@
48 48
             </div>
49 49
         </formly-form>
50 50
     </form>
51
-    <form ng-submit="vm.submit(vm.model,'expand-right')" class="fontcolor-two" ng-if="!oldfromtype">
51
+    <div class="fontcolor-two" ng-if="!oldfromtype">
52 52
         <div class="col-xs-12 panel">
53 53
             <section id="page-title-form">
54 54
                 <div class="row">
@@ -95,10 +95,10 @@
95 95
                 </formly-form>
96 96
             </div>
97 97
             <div class="center col-xs-12  margin-top-30 margin-bottom-40 ">
98
-                <button type="submit" ladda="ldloading.expand_right " data-style="expand-right " class="btn btn-isok " ng-disabled="ldloading.expand_right ">{{vm.model.submit}}</button>
98
+                <button type="button" ng-click="vm.submit(vm.model,'expand-right')" ladda="ldloading.expand_right " data-style="expand-right " class="btn btn-isok " ng-disabled="ldloading.expand_right ">{{vm.model.submit}}</button>
99 99
                 <button type="close " class="btn btn-default default " ng-click="closeModel() ">{{vm.model.close}}</button>
100 100
                 <button type="button " class="btn btn-zancun" ng-click="save(vm.model) " ng-if="vm.model.startSave||vm.model.saveAgain">{{vm.model.save}}</button>
101 101
             </div>
102 102
         </div>
103
-    </form>
103
+    </div>
104 104
 </div>

+ 1 - 1
assets/views/customform/tpl/searchknowledge.html

@@ -8,7 +8,7 @@
8 8
 </div>
9 9
 <div class="container" style="border-top: 1px solid #c8c7cc;padding-right: 55px;">
10 10
     <div class="searchInp">
11
-        <input type="text" ng-model="searchKeyWord" placeholder="请输入...">
11
+        <input type="text" ng-model="searchKeyWord" placeholder="请输入..." ng-keypress="keypressModel($event,searchKeyWord)">
12 12
         <i class="iconfont icon-fangdajing1" ng-click="openModel(searchKeyWord)"></i>
13 13
     </div>
14 14
     <div class="mainlist">

+ 1 - 1
assets/views/customform/tpl/ui-requesterinformation.html

@@ -92,7 +92,7 @@
92 92
                     <a class="" ng-click="options.templateOptions['changeRequeter']('lg',options,to.modal,model);"><i class="icon iconfont icon-xiugai margin-right-5 fontsizes-14"></i>修改
93 93
                     </a> -->
94 94
                     
95
-        <button style=" margin: 0;line-height: 10px;" ng-click="options.templateOptions['addRequeter']('lg',options,to.modal);"
95
+        <button style=" margin: 0;line-height: 10px;" ng-click="options.templateOptions['addRequeter']('lg',options,to.modal,$event);"
96 96
             class="btn btn-addbutton  addbutton col-md-offset-5 col-md-12">添加报修人</button>
97 97
         <!-- <button class="btn btn-default default col-md-4 col-md-offset-1" ng-click="options.templateOptions['changeRequeter']('lg',options,to.modal,model)">修改</button> -->
98 98
         <!-- </div> -->