田源
2024-04-07 2ac55ce0edf4870a29691b56bfad59f4830a11a2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
/**
 * 主题库分类的模板属性页面
 * @author weidy
 * @date 2022-01-24
 */
layui.define(['layer','element','form','table','dynamicCondition' ],function(exports){
        var webUtil = $webUtil;
    var Class = function(){
        this.MODELNAME = "mdm/CodeClassifyTemplateAttr";
        this.moduleKey = "CodeClassifyTemplateAttr";
        this.backPath =  configData.compatibility? path:configData.mdmService;
        this.url = {
            attrController:'codeClassifyAttrController/',
            classifyController:'codeClassifyController/',
            classifyTree:'referTree',
            attrRefer:'gridCodeClassifyAttribute',
            controller:'codeClassifyTempAttrController/',
            dataGrid:'gridCodeClassifyTemplateAttr',
            tree:'treeCodeClassifyTemplate',
            addSave:'addSave',
            editSave:'editSave',
            deleteUrl:'deleteData',
            getObjectByOid:'getObjectByOid',
            tempController:'codeClassifyTemplateController/',
            tempDataGrid:'gridCodeClassifyTemplate',
            addSaveTemp:'addSave',
            editSaveTemp:'editSave',
            deleteUrlTemp:'deleteData',
        };
        this.getContent=function() {
            var that = this;
            return '<div id="UIContent_' + that.id + '" style="overflow: auto;padding:0 5px"></div>';
        };
        this.showContent = function (){
            var that = this;
            var html=[
                '<div class="layui-layout easyui-layout UIContentLayout" id="easyuiLayout_',that.id,'" data-options="fit:true" style="display:block;overflow-y: hidden">',
                    '<div data-options="region:\'west\',split:true" title="主题库分类" style="width:270px;padding: 5px;">',
                        that.getWestToolbarHtml(),
                        '<div class="layui-vci-tree" style="overflow: auto">',
                            '<ul layui-filter="tree_',that.id,'"><ul>',
                        '</div>',
                    '</div>',
                    '<div data-options="region:\'center\'" style="border:0; " id="border_',that.id,'">',
                        '<div id="easyuiLayoutCenter_',that.id,'" class="easyui-layout" data-options="fit:true">',
                            '<div data-options="region:\'north\',split:true" title="模板管理"  style="height: 300px;padding: 5px">',
                                that.getNorthToolbarHtml(),
                                '<table id="temp_', that.id , '" lay-filter="temp',that.id , '" style="overflow-x:auto;"></table>',
                            '</div>',
                            '<div data-options="region:\'center\',split:true" title="模板属性" style="padding-left: 5px;padding-right: 5px;" id="border_center_',that.id,'">',
                                '<div class="layui-center" style="overflow-y:auto;">',
                                    that.getToolbarHtml(),
                                    '<table id="table_', that.id , '" lay-filter="',that.id , '" style="overflow-x:auto;"></table>',
                                '</div>',
                            '</div>',
                        '</div>',
                    '</div>',
                '</div>'
            ];
            $("#UIContent_"+that.id).html(html.join(''));
        };
        this.getWestToolbarHtml = function(){
            var that = this;
            var html = [
                '<div layui-filter="toolbar_west_',that.id,'" class="layui-btn-container layui-buttons">',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_west_',that.id,'_ADVQUERYCLF"><i class="layui-icon layui-icon-search"></i>查询</button>',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_west_',that.id,'_refreshCLF"><i class="layui-icon layui-icon-refresh"></i>刷新</button>',
                '</div>'
            ].join("");
            return html;
        };
        this.getNorthToolbarHtml = function(){
            var that = this;
            var html = [
                '<div layui-filter="toolbar_',that.id,'" class="layui-btn-container layui-buttons">',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_ADDTEMP"><i class="layui-icon layui-icon-add-1"></i>添加</button>',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_EDITTEMP"><i class="layui-icon layui-icon-edit"></i>修改</button>',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_DELTEMP"><i class="layui-icon layui-icon-delete"></i>删除</button>',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_UPTEMP"><i class="layui-icon layui-icon-upload-circle"></i>升版</button>',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_west_',that.id,'_ENABLETEMP"><i class="layui-icon layui-icon-ok-circle"></i>启用/发布</button>',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_west_',that.id,'_DISABLETEMP"><i class="layui-icon layui-icon-404"></i>停用/失效</button>',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_ADVQUERYTEMP"><i class="layui-icon layui-icon-search"></i>查询</button>',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_refreshTEMP"><i class="layui-icon layui-icon-refresh"></i>刷新</button>',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_cloneTEMP"><i class="layui-icon layui-icon-share"></i>从其他模板克隆</button>',
                '</div>'
            ].join("");
            return html;
        };
        this.getToolbarHtml =function(isFull){
            var that = this;
            var html = ['<div layui-filter="toolbar_',that.id,'" class="layui-btn-container layui-buttons">'];
            if(isFull){
                html.push('<div class="layui-btn-group">',
                    '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_EDIT"><i class="layui-icon layui-icon-ok"></i>保存</button>',
                    '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_CANCEL"><i class="layui-icon layui-icon-refresh-3"></i>重置</button>',
                    '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_UNBATCHEDIT"><i class="layui-icon layui-icon-screen-restore"></i>退出全屏编辑</button>',
                    '</div>')
            }else {
                html.push('<div class="layui-btn-group">',
                    '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_ADD"><i class="layui-icon layui-icon-add-1"></i>添加</button>',
                    '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_DEL"><i class="layui-icon layui-icon-delete"></i>删除</button>',
                    '</div>',
                    '<div class="layui-btn-group">',
                    '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_EDIT"><i class="layui-icon layui-icon-ok"></i>保存</button>',
                    '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_CANCEL"><i class="layui-icon layui-icon-refresh-3"></i>重置</button>',
                    '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_BATCHEDIT"><i class="layui-icon layui-icon-screen-full"></i>全屏编辑</button>',
                    '</div>')
            }
            html.push('<div class="layui-btn-group">',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_CLASSIFYUSE"><i class="layui-icon layui-icon-tree"></i>分类注入</button>',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_COMPUSE"><i class="layui-icon layui-icon-template"></i>组合规则</button>',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_VERIFYUSER"><i class="layui-icon layui-icon-auz"></i>验证规则</button>',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_ENUMUSE"><i class="layui-icon layui-icon-rss"></i>枚举注入</button>',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_GROUPATTR"><i class="layui-icon layui-icon-template-1"></i>属性分组</button>',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_UPSELECT"><i class="layui-icon layui-icon-up"></i>上移</button>',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_DOWNSELECT"><i class="layui-icon layui-icon-down"></i>下移</button>',
                '</div>',
                '<div class="layui-btn-group">',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_ADVQUERY"><i class="layui-icon layui-icon-search"></i>查询</button>',
                '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',that.id,'_syncAttr"><i class="layui-icon layui-icon-share"></i>同步到其他模板</button>',
                '</div>',
                '</div>')
            return html.join("");
        };
        this.createSearchHtml = function () {
            var that = this;
            webUtil.bindDefultButtonLisenter(that, that.id);
        };
        this.init = function(){
            var that = this;
            webUtil.copyConfig(that,that.moduleKey);
            setTimeout(function () {
                that.showContent();
                that.createWestSearchHtml();
                that.createSearchHtml();
                var easyuiLayout = $('#easyuiLayout_' + that.id)
                easyuiLayout.css({height: $('#portal_body').height() - 43, width: $('#portal_body').width() - 15})
                easyuiLayout.layout();
                $('#easyuiLayoutCenter_'+that.id).layout();
                that.initMainTable();
                that.initTempTable();
                that.initTree();
            },1)
        };
        this.initTree = function () {
            var that = this;
            var tree = layui.tree;
            var treeUL = $('[layui-filter="tree_' + that.id + '"]');
            var scrollHeight =  treeUL.closest('.panel-body').height();
            var treeHeight = scrollHeight - 100;
            treeUL.parent().height(treeHeight);
            tree.init("tree_" + that.id, treeUL, {
                url: that.url.classifyController + that.url.classifyTree,
                backPath: that.backPath,
                extraParams: {
                    isMuti: false,
                    isQueryAllColumn: true
                },
                showSearch:true,
                click: function (item, elem, options) {
                    that.currentItemOid = item.oid;
                    that.currentItemAttributes = item.attributes;
                    that.setFormValues();
                }
            });
        };
        this.setFormValues = function () {
            var that = this;
            //列表
            layui.table.reload('temp_' + that.id,{
                where:{
                    codeclassifyoid:that.currentItemAttributes.oid
                }
            })
        };
        this.initMainTable = function (parentFieldName) {
            var that = this;
            var table = layui.table;
            that.checkColumns();
            var tableWidth = $("#border_" + that.id).width();
            var options = {
                elem: '#table_' + that.id,
                id: 'table_' + that.id,
                backPath:that.backPath,
                url: that.url.controller + that.url.dataGrid,
                width:tableWidth,
                selectMode:table.selectMode.muti,
                cols: [that.columns],
                method:'get',
                done:function(res,cur,total){
                    if(!that.fristMainLoad ){
                        table.on('tool(' + that.id + ')',function(obj){
                            var data = obj.data;//当前选择行的数据
                            var layEvent = obj.event;//点的是什么按钮
                            if(layEvent == 'EDIT'){
                                that.addOrEdit(false,data.oid);
                            }
                        });
                    }else{
                        if(total>0) {
                            table.selectRecord('table_' + that.id, {index:0});
                        }
                    }
                    that.fristMainLoad = true;
                }
            };
            if(parentFieldName){
                options.treeConfig = {
                    treepid:parentFieldName,
                    treeid:'id',
                    showField:'name'
                };
            }
            table.render(options);
        };
        this.initTempTable = function (){
            var that = this;
            var table = layui.table;
            that.checkTempColumns();
            var tableWidth = $("#border_" + that.id).width()-10;
            var options = {
                elem: '#temp_' + that.id,
                id: 'temp_' + that.id,
                backPath:that.backPath,
                url: that.url.tempController + that.url.tempDataGrid,
                page: {
                    limit: 10,
                    page: 1
                },
                width:tableWidth,
                selectMode:table.selectMode.muti,
                cols: [that.tempColumns],
                method:'get',
                done:function(res,cur,total){
                    if(!that.fristMainLoad ){
                        table.on('tool(' + that.id + ')',function(obj){
                            var data = obj.data;//当前选择行的数据
                            var layEvent = obj.event;//点的是什么按钮
                            if(layEvent == 'EDIT'){
                                that.addOrEdit(false,data.oid);
                            }
                        });
                    }else{
                        if(total>0) {
                            table.selectRecord('temp_' + that.id, {index:0});
                        }
                    }
                    that.fristMainLoad = true;
                }
            };
            table.render(options);
        };
        this.checkTempColumns = function (){
            var that = this;
            var table = layui.table;
            if(that.tempColumns==null || that.tempColumns.length==0){
                that.tempColumns = [table.getIndexColumn(),table.getCheckColumn(),
                    {
                        field: 'id',
                        title: '模板编号',
                        sort:true,
                        width: 150
                    },{
                        field: 'name',
                        title: '模板名称',
                        sort:true,
                        width: 200
                    },{
                        field: 'description',
                        title: '模板描述',
                        sort:true,
                        width: 150
                    },{
                        field: 'revisionValue',
                        title: '版本号',
                        sort: true,
                        width: 70
                    },{
                        field: 'lcStatusText',
                        title: '状态',
                        sortField:'lcStatus',
                        sort:true,
                        width: 60
                    },
                    {
                        field:'options',
                        title:'操作',
                        width: 150,
                        templet:function(d){
                            return ['<a class="layui-btn layui-btn-intable" lay-event="EDIT">编辑</a>','<a class="layui-btn layui-btn-intable" lay-event="UPREVSION">升版</a>'].join("");
                        }
                    }];
            }
        };
        this.createWestSearchHtml = function () {
            var that = this;
            webUtil.bindDefultButtonLisenter(that,"west_" + that.id);
        };
        this.checkColumns = function(){
            var that = this;
            var table = layui.table;
            if(that.columns==null || that.columns.length==0){
                that.columns = [table.getIndexColumn(),table.getCheckColumn(),{
                    field: 'id',
                    title: '属性英文编号',
                    sort: true,
                    width: 150
                },{
                    field: 'name',
                    title: '属性中文名称',
                    sort: true,
                    width: 150
                },
                    {
                        title: '属性分组',
                        field: 'attributegroup',
                        sort:true,
                        width: 90
                    },
                    {
                        title: '类型',
                        field: 'attributedatatypeText',
                        sort:true,
                        type: 'combox',
                        data:[],
                        width: 60
                    },
                    {
                        title: '关键属性',
                        field: 'keyattrflag',
                        width: 60,
                        type:'combox',
                        data:[{key:"true",value:"是"},{key:"false",value:"否"}],
                        templet: function (d) {
                            return webUtil.formateBoolean(d.keyattrflag);
                        }
                    },
                    {
                        title: '查询属性',
                        field: 'queryattrflag',
                        width: 60,
                        type:'combox',
                        data:[{key:"true",value:"是"},{key:"false",value:"否"}],
                        templet: function (d) {
                            return webUtil.formateBoolean(d.queryattrflag);
                        }
                    },
                    {
                        title: '高级查询属性',
                        field: 'seniorqueryattrflag',
                        width: 90,
                        type:'combox',
                        data:[{key:"true",value:"是"},{key:"false",value:"否"}],
                        templet: function (d) {
                            return webUtil.formateBoolean(d.seniorqueryattrflag);
                        }
                    },
                    {
                        title: '相似查重属性',
                        field: 'samerepeatattrflag',
                        width: 90,
                        type:'combox',
                        data:[{key:"true",value:"是"},{key:"false",value:"否"}],
                        templet: function (d) {
                            return webUtil.formateBoolean(d.samerepeatattrflag);
                        }
                    },
                    {
                        title: '一维码',
                        field: 'barcodeflag',
                        width: 60,
                        type:'combox',
                        data:[{key:"true",value:"是"},{key:"false",value:"否"}],
                        templet: function (d) {
                            return webUtil.formateBoolean(d.barcodeflag);
                        }
                    },
                    {
                        title: '二维码',
                        field: 'qrcodeflag',
                        width: 60,
                        type:'combox',
                        data:[{key:"true",value:"是"},{key:"false",value:"否"}],
                        templet: function (d) {
                            return webUtil.formateBoolean(d.qrcodeflag);
                        }
                    },
                    {
                        title: '必输',
                        field: 'requireflag',
                        width: 60,
                        type:'combox',
                        data:[{key:"true",value:"是"},{key:"false",value:"否"}],
                        templet: function (d) {
                            return webUtil.formateBoolean(d.requireflag);
                        }
                    },
                    {
                        title: '表单显示',
                        field: 'formdisplayflag',
                        width: 60,
                        type:'combox',
                        data:[{key:"true",value:"是"},{key:"false",value:"否"}],
                        templet: function (d) {
                            return webUtil.formateBoolean(d.formdisplayflag);
                        }
                    },
                    {
                        title: '列表显示',
                        field: 'tabledisplayflag',
                        width: 60,
                        type:'combox',
                        data:[{key:"true",value:"是"},{key:"false",value:"否"}],
                        templet: function (d) {
                            return webUtil.formateBoolean(d.tabledisplayflag);
                        }
                    },
                    {
                        title: '只读',
                        field: 'readonlyflag',
                        width: 60,
                        type:'combox',
                        data:[{key:"true",value:"是"},{key:"false",value:"否"}],
                        templet: function (d) {
                            return webUtil.formateBoolean(d.readonlyflag);
                        }
                    },
                    {
                        title: '列表排序',
                        field: 'sortattrflag',
                        width: 60,
                        type:'combox',
                        data:[{key:"true",value:"是"},{key:"false",value:"否"}],
                        templet: function (d) {
                            return webUtil.formateBoolean(d.sortattrflag);
                        }
                    },
                    {
                        title: '长度',
                        field: 'controllength',
                        type:'number',
                        width: 60
                    },
                    {
                        title: '默认值',
                        field: 'defaultvalue',
                        sort:true,
                        width: 150
                    },
                    {
                        title: '前缀',
                        field: 'prefixvalue',
                        sort:true,
                        width: 60
                    },
                    {
                        title: '后缀',
                        field: 'suffixvalue',
                        sort:true,
                        width: 60
                    },
                    {
                        title: '小数精度(刻度)',
                        field: 'precisionlength',
                        type:'number',
                        width: 100
                    },
                    {
                        title: '组合规则',
                        field: 'componentrule',
                        sort:true,
                        width: 180
                    },
                    {
                        title: '验证规则',
                        field: 'verifyrule',
                        sort:true,
                        width: 150
                    },
                    {
                        title: '取值范围',
                        field: 'valuearea',
                        sort:true,
                        width: 150
                    },
                    {
                        title: '时间格式',
                        field: 'codedateformat',
                        sort:true,
                        width: 150
                    },
                    {
                        title: '分类注入(层级/名称)',
                        field: 'classifyinvokelevel',
                        sort:true,
                        width: 200
                    },
                    {
                        title: '枚举注入',
                        field: 'enumid',
                        sort:true,
                        width: 150
                    },
                    {
                        title: '参照配置',
                        field: 'referbtmid',
                        sort:true,
                        width: 150
                    },
                    {
                        title: '表单显示样式',
                        field: 'formdisplaystyle',
                        sort:true,
                        width: 150
                    },
                    {
                        title: '表格显示样式',
                        field: 'tabledisplaystyle',
                        sort:true,
                        width: 150
                    },
                    {
                        title: '表单超链接',
                        field: 'formhref',
                        sort:true,
                        width: 150
                    },
                    {
                        title: '表格超链接',
                        field: 'tablehref',
                        sort:true,
                        width: 150
                    },
                    {
                        title: '表格显示js',
                        field: 'tabledisplayjs',
                        sort:true,
                        width: 150
                    },
                    {
                        title: '多行文本',
                        field: 'textareaflag',
                        width: 60,
                        type:'combox',
                        data:[{key:"true",value:"是"},{key:"false",value:"否"}],
                        templet: function (d) {
                            return webUtil.formateBoolean(d.textareaflag);
                        }
                    },
                    {
                        title: '预览图',
                        field: 'imageflag',
                        width: 60,
                        type:'combox',
                        data:[{key:"true",value:"是"},{key:"false",value:"否"}],
                        templet: function (d) {
                            return webUtil.formateBoolean(d.imageflag);
                        }
                    },
                    {
                        field:'options',
                        title:'操作',
                        width: 150,
                        templet:function(d){
                            return ['<a class="layui-btn layui-btn-intable" lay-event="UP">上移</a>','<a class="layui-btn layui-btn-intable" lay-event="DOWN">下移</a>','<a class="layui-btn layui-btn-intable" lay-event="REM">移除</a>'];
                        }
                    }];
            }
        };
 
        this.getFormItems = function(onlyShow) {
            var that = this;
            var table = layui.table;
            return [
                {
                    field: 'classifytemplateoid',
                    title: '所属模板',
                    required: true,
                    type: 'refer',
                    showField: 'classifytemplateoidName',
                    referConfig: {
                        referBo:'codeclstemplate'
                    },
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'classifyattributeoid',
                    title: '所属分类中的属性主键',
                    required: true,
                    type: 'refer',
                    showField: 'classifyattributeoidName',
                    referConfig: {
                        referBo:'codeclsattr'
                    },
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'attributedatatype',
                    title: '属性的类型',
                    required: true,
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'keyattrflag',
                    title: '是否关键属性',
                    type: 'truefalse',
                    defaultValue:"false",
                    readOnly:onlyShow
                } ,                {
                    field: 'queryattrflag',
                    title: '是否快速查询属性',
                    type: 'truefalse',
                    defaultValue:"false",
                    readOnly:onlyShow
                } ,                {
                    field: 'seniorqueryattrflag',
                    title: '是否高级查询属性',
                    type: 'truefalse',
                    defaultValue:"false",
                    readOnly:onlyShow
                } ,                {
                    field: 'samerepeatattrflag',
                    title: '相似查重属性',
                    type: 'truefalse',
                    defaultValue:"false",
                    readOnly:onlyShow
                } ,                {
                    field: 'sortattrflag',
                    title: '是否排序',
                    type: 'truefalse',
                    defaultValue:"true",
                    readOnly:onlyShow
                } ,                {
                    field: 'qrcodeflag',
                    title: '是否生成二维码',
                    type: 'truefalse',
                    defaultValue:"false",
                    readOnly:onlyShow
                } ,                {
                    field: 'barcodeflag',
                    title: '是否生成一维码',
                    type: 'truefalse',
                    defaultValue:"false",
                    readOnly:onlyShow
                } ,                {
                    field: 'componentrule',
                    title: '组合规则',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'verifyrule',
                    title: '验证规则',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'classifyinvokelevel',
                    title: '分类注入层级',
                    type: 'text',
                    defaultValue:"none",
                    readOnly:onlyShow
                } ,                {
                    field: 'classifyinvokeattr',
                    title: '分类注入的属性英文名称',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'classifyinvokeattrname',
                    title: '分类注入的属性中文名称',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'classifyinvokeeditflag',
                    title: '分类注入是否可以编辑',
                    type: 'truefalse',
                    defaultValue:"false",
                    readOnly:onlyShow
                } ,                {
                    field: 'ordernum',
                    title: '码值序号',
                    verify: 'number',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'formdisplayflag',
                    title: '表单里是否显示',
                    type: 'truefalse',
                    defaultValue:"true",
                    readOnly:onlyShow
                } ,                {
                    field: 'tabledisplayflag',
                    title: '列表里是否显示',
                    type: 'truefalse',
                    defaultValue:"true",
                    readOnly:onlyShow
                } ,                {
                    field: 'attributegroup',
                    title: '所属属性分组',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'enumid',
                    title: '使用枚举英文编号',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'enumname',
                    title: '使用枚举中文名称',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'enumeditflag',
                    title: '枚举是否可以编辑',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'referbtmid',
                    title: '参照的业务类型英文名称',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'referbtmname',
                    title: '参照的业务类型中文名称',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'referconfig',
                    title: '参照窗口配置',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'requireflag',
                    title: '是否必输',
                    type: 'truefalse',
                    defaultValue:"false",
                    readOnly:onlyShow
                } ,                {
                    field: 'readonlyflag',
                    title: '是否只读',
                    type: 'truefalse',
                    defaultValue:"false",
                    readOnly:onlyShow
                } ,                {
                    field: 'controllength',
                    title: '属性控制输入的长度',
                    required: true,
                    verify: 'number',
                    defaultValue:"254",
                    readOnly:onlyShow
                } ,                {
                    field: 'formdisplaystyle',
                    title: '表单里显示的样式',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'tabledisplaystyle',
                    title: '表格里显示的样式',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'formhref',
                    title: '表单中超链接内容',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'tablehref',
                    title: '表格中超链接内容',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'precisionlength',
                    title: '小数精度',
                    verify: 'number',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'scalelength',
                    title: '小数刻度',
                    verify: 'number',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'valuearea',
                    title: '取值范围',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'codedateformat',
                    title: '时间格式',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'tabledisplayjs',
                    title: '表格里显示调用的js',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'textareaflag',
                    title: '是否显示多行文本',
                    type: 'truefalse',
                    defaultValue:"false",
                    readOnly:onlyShow
                } ,                {
                    field: 'imageflag',
                    title: '预览图',
                    type: 'truefalse',
                    defaultValue:"false",
                    readOnly:onlyShow
                } ,                {
                    field: 'defaultvalue',
                    title: '默认值',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'prefixvalue',
                    title: '前缀',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'suffixvalue',
                    title: '后缀',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'filtersourceattr',
                    title: '选择数据时过滤的属性',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                } ,                {
                    field: 'filtersourceattrname',
                    title: '选择数据时过滤的属性名称',
                    type: 'text',
                    defaultValue:"",
                    readOnly:onlyShow
                }             ];
        };
        this.ADD = function () {
            var that = this;
            var table =layui.table;
            var filter ="refer_attr_" + that.id;
            var addSaveIndex =webUtil.dialog({
                title:'从属性集中选择',
                btn:['确定选择','取消'],
                content:'<table id="table_' + filter + '" lay-filter="' + filter + '"  style="margin-top:5px" ></table>',
                success:function(layero,layerIndex,classP) {
                    layui.use('mdm/CodeClassify',function (){
                        var codeClassify = layui['mdm/CodeClassify'];
                        codeClassify.checkColumns(true);
                        var options = {
                            elem: '#table_' + filter,
                            id: 'table_' + filter,
                            backPath:that.backPath,
                            url: that.url.attrController + that.url.attrRefer,
                            selectMode:table.selectMode.muti,
                            cols: [codeClassify.columns]
                        };
                        table.render(options);
                        webUtil.relocationOpen(classP)
                    });
                },
                yes:function(layero){
 
                },
                btn2:function(layero){
                    layer.close(addSaveIndex);
                }
            });
        };
        this.EDIT = function(){
            var that = this;
            var oid = webUtil.getOidFromGrid("table_" + that.id,true,true);
            if(!oid){
                return false;
            }
            that.addOrEdit(false,oid);
        };
        this.addOrEdit = function(add,oid) {
            var that = this;
            var form = layui.form;
            var filter ="form_" + that.id;
            var addSaveIndex =webUtil.dialog({
                title:add?'添加主题库分类的模板属性':'修改主题库分类的模板属性',
                btn:['保存','取消'],
                content:'<form id="form_' + filter + '" lay-filter="' + filter + '" class="layui-form" style="margin-top:5px" ></form>',
                resizing:function(layero){
                    form.doResize(filter);
                },
                success:function(layero) {
                    form.addItems(filter,that.getFormItems(false),
                        function () {
                            if(!add){
                                form.load(filter,{
                                    backPath:that.backPath,
                                    url:that.url.controller + that.url.getObjectByOid,
                                    method:'get',
                                    params:{
                                        oid:oid
                                    }
                                });
                            }else{
                                var defaultValues = {};
                                //可以手动在此处添加默认值
                                form.setValues(defaultValues,filter);
                            }
                        }, {}, {defaultColumnOneRow: 2, labelWidth: 200});
                },
                yes:function(layero){
                    if(form.validata(filter)){
                        var values = form.getValues(filter,true);
                        var url = that.url.controller + (add?that.url.addSave:that.url.editSave);
                        webUtil.manualAjax(add?'post':'put',url,JSON.stringify(values),function(result){
                            if(result.success){
                                webUtil.showMsgFromResult(result,(add ? "添加成功" : "修改成功"));
                                layer.close(addSaveIndex);
                                that.refresh();
                            }else{
                                webUtil.showErrorMsg(result.msg);
                            }
                        },function(xhr,err){
                            webUtil.showErrorMsg("请求服务出现了错误,可能服务器未开启");
                        },that.backPath);
                    }
                },
                btn2:function(layero){
                    layer.close(addSaveIndex);
                }
            });
        };
        this.DEL = function(){
            var that = this;
            var oid = webUtil.getOidFromGrid("table_" +that.id,true,true);
            if(!oid){
                return false;
            }
            var ts= webUtil.getOidFromGrid("table_" +that.id,false,false,"ts");
            webUtil.showConfirmMsg("是否删除这条数据?如果被引用将不能被删除!",function () {
                webUtil.deleteRequest(that.url.controller + that.url.deleteUrl,{oid:oid,ts:ts},function(result){
                    if(result.success){
                        webUtil.showMsgFromResult(result,"删除成功");
                        that.refresh();
                    }else{
                        webUtil.showErrorMsg(result.msg);
                    }
                },function(xhr,err){
                    webUtil.showErrorMsg("请求服务出现了错误,可能服务器未开启");
                },that.backPath);
            });
        };
        this.BATCHEDIT=function (){
            var that=this;
            var filter ="fullScreen_" + that.id;
            var table=layui.table;
            that.BATCHEDITIndex =layer.open({
                type:1,
                title:'模板属性',
                content:'<div id="' + filter + '" lay-filter="' + filter + '" style="margin:5px" >'+that.getToolbarHtml(true)+'<table id="table_'+filter+ '" lay-filter="table_'+filter+'" style="overflow-x:auto;"></table></div>',
                fullScreen:true,
                closeBtn:0,
                shadeClose: false,
                resizing:function(layero){
                    form.doResize(filter);
                },
                success:function(layero) {
                    var options = table.getConfig('table_' + that.id);
                    options.elem = '#table_' + filter
                    options.id = 'table_' + filter;
                    options.width='auto';
                    table.render(options);
                    webUtil.bindDefultButtonLisenter(that, that.id);
                }
            });
        }
        this.UNBATCHEDIT=function (){
            var that=this;
            layer.close(that.BATCHEDITIndex)
        }
        //组合规则
        this.COMPUSE=function (){
            layui.use('mdm/CodeClassifyCompuse',function (){
                var CodeClassifyCompuse=layui['mdm/CodeClassifyCompuse'];
                CodeClassifyCompuse.showDialog()
            })
        }
        //效验规则
        this.VERIFYUSER=function (){
            var that=this;
            var form = layui.form;
            var table = layui.table;
            var filter ="verifyuser_" + that.id;
            var html=[
                '<div class="easyui-layout UIContentLayout"  id="easyuiLayout_',filter,'" data-options="fit:true" style="display:block;overflow-y: hidden;">',
                    '<div data-options="region:\'west\',split:true" style="width:400px;padding: 5px;">',
                        '<div>',
                            '<form id="form_' + filter + '" lay-filter="' + filter + '" class="layui-form" style="margin-top:5px" ></form>',
                            '<button class="layui-btn layui-btn-sm" layui-filter="toolbar_',filter,'" style="margin:0 0 0 110px"><i class="layui-icon layui-icon-ok"></i>检查</button>',
                        '</div>',
                    '</div>',
                    '<div data-options="region:\'center\'" style="padding-left: 5px;padding-right: 5px;" id="border_',filter,'">',
                        '<div class="layui-center" style="overflow-y:auto;">',
                            '<table class="layui-table" lay-size="sm" lay-even layui-filter="table_' + filter + '" id="table_' + filter + '" ></table>',
                        '</div>',
                    '</div>',
                '</div>'
            ];
 
            var verifyuserIndex =webUtil.dialog({
                title:'属性效验规则',
                btn:['保存','取消'],
                content:html.join(''),
                resizing:function(layero){
                    form.doResize(filter);
                },
                success:function(layero,layerIndex,classP) {
                    var easyuiLayout = $('#easyuiLayout_' + filter)
                    easyuiLayout.css({height: 600, width: 1050})
                    easyuiLayout.parent().parent().css({margin: '5px'})
                    easyuiLayout.layout();
                    form.addItems(filter, [{
                            field: 'regexp',
                            title: '正则表达式',
                            required: true,
                            type: 'textarea',
                            textWidth: 240,
                            textStyle:'height:200px;'
                        }, {
                            field: 'content',
                            title: '测试内容',
                            type: 'textarea',
                            textWidth: 240,
                            textStyle:'height:200px;'
                        }],
                        function () {
                            webUtil.relocationOpen(classP)
                        }, {}, {labelWidth: 110});
                    var tableData=[{name:'[\u3000\uff01-\uff5f]+',description:'全角符号'},
                        {name:'[^\u3000\uff01-\uff5f]+',description: '半角符号'},
                        {name:'(([-|+]{1}[\\d]+℃~[-|+]{1}[\\d]+℃)|无)',description: '温度范围,示例 -55℃~+125℃'},
                        {name:'[\\d]{15}|[\\d]{18}|[\\d]{17}X',description: '身份证号码(15或18位数字、17位数字X) '},
                        {name:'男|女|男性|女性',description: '中文性别'},
                        {name:'[\\d]+',description: '数字'},
                        {name:'[a-zA-Z]+',description: '字母'},
                        {name:'[A-Z]+',description: '大写字母'},
                        {name:'[a-z]+',description: '小写字母'},
                        {name:'[0-9a-zA-Z]+',description: '字母、数字组合'},
                        {name:'((0[\\d]{3}-[\\d]{7})|(0[\\d]{2}-[\\d]{8})|([\\d]{7,8}))',description: '电话号码'},
                        {name:'-?[1-9]\\d*',description: '整数'},
                        {name:'[1-9]\\d*',description: '正整数'},
                        {name:'-[1-9]\\d*',description: '负整数'},
                        {name:'-[1-9]\\d*|0',description: '非正整数(负整数+0)'},
                        {name:'[1-9]\\d*|0',description: '非负整数(正整数+0)'},
                        {name:'-?([1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*|0?\\.0+|0)',description: '浮点数'},
                        {name:'[1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*',description: '正浮点数'},
                        {name:'-[1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*',description: '负浮点数'},
                        {name:'[(-([1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*))|0?\\.0+|0',description: '非正浮点数(负浮点数 + 0)'},
                        {name:'[1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*|0?\\.0+|0',description: '非负浮点数(正浮点数 + 0)'},
                        {name:'x',description: '字符 x'},
                        {name:'\\\\',description: '反斜线字符'},
                        {name:'\\0n',description: '带有八进制值 0 的字符 n (0 <= n <= 7)'},
                        {name:'\\0nn',description: '带有八进制值 0 的字符 nn (0 <= n <= 7)'},
                        {name:'\\0mnn',description: '带有八进制值 0 的字符 mnn(0 <= m <= 3、0 <= n <= 7)'},
                        {name:'\\xhh',description: '带有十六进制值 0x 的字符 hh'},
                        {name:'\\uhhhh',description: '带有十六进制值 0x 的字符 hhhh'},
                        {name:'\\t',description: '制表符 (\'\u0009\')'},
                        {name:'\\n',description: '新行(换行)符 (\'\u000A\')'},
                        {name:'\\r',description: '回车符 (\'\u000D\')'},
                        {name:'\\f',description: '换页符 (\'\u000C\')'},
                        {name:'\\a',description: '报警 (bell) 符 (\'\u0007\')'},
                        {name:'\\e',description: '转义符 (\'\u001B\')'},
                        {name:'\\cx',description: '对应于 x 的控制符'},
                        {name:'[abc]',description: 'a、b 或 c(简单类)'},
                        {name:'[^abc]',description: '任何字符,除了 a、b 或 c(否定)'},
                        {name:'[a-zA-Z]',description: 'a 到 z 或 A 到 Z,两头的字母包括在内(范围)'},
                        {name:'[a-d[m-p]]',description: 'a 到 d 或 m 到 p:[a-dm-p](并集)'},
                        {name:'[a-z&&[def]]',description: '\td、e 或 f(交集)'},
                        {name:'[a-z&&[^bc]]',description: 'a 到 z,除了 b 和 c:[ad-z](减去)'},
                        {name:'[a-z&&[^m-p]]',description: 'a 到 z,而非 m 到 p:[a-lq-z](减去)'},
                        {name:'.',description: '任何字符(与行结束符可能匹配也可能不匹配)'},
                        {name:'\\d',description: '数字:[0-9]'},
                        {name:'\\D',description: '非数字: [^0-9]'},
                        {name:'\\s',description: '空白字符:[ \\t\\n\x0B\\f\\r]'},
                        {name:'\\S',description: '非空白字符:[^\\s]'},
                        {name:'\\w',description: '单词字符:[a-zA-Z_0-9]'},
                        {name:'\\W',description: '非单词字符:[^\\w]'},
                        {name:'\\p{Lower}',description: '小写字母字符:[a-z]'},
                        {name:'\\p{Upper}',description: '大写字母字符:[A-Z]'},
                        {name:'\\p{ASCII}',description: '所有 ASCII:[\x00-\x7F]'},
                        {name:'\\p{Alpha}',description: '字母字符:[\\p{Lower}\\p{Upper}]'},
                        {name:'\\p{Digit}',description: '十进制数字:[0-9]'},
                        {name:'\\p{Alnum}',description: '字母数字字符:[\\p{Alpha}\\p{Digit}]'},
                        {name:'\\p{Punct}',description: '标点符号:!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'},
                        {name:'\\p{Graph}',description: '可见字符:[\\p{Alnum}\\p{Punct}]'},
                        {name:'\\p{Print}',description: '可打印字符:[\\p{Graph}\x20]'},
                        {name:'\\p{Blank}',description: '空格或制表符:[ \\t]'},
                        {name:'\\p{Cntrl}',description: '控制字符:[\x00-\x1F\x7F]'},
                        {name:'\\p{XDigit}',description: '十六进制数字:[0-9a-fA-F]'},
                        {name:'\\p{Space}',description: '空白字符:[ \\t\\n\x0B\\f\\r]'},
                        {name:'\\p{javaLowerCase}',description: '等效于 java.lang.Character.isLowerCase()'},
                        {name:'\\p{javaUpperCase}',description: '等效于 java.lang.Character.isUpperCase()'},
                        {name:'\\p{javaWhitespace}',description: '等效于 java.lang.Character.isWhitespace()'},
                        {name:'\\p{javaMirrored}',description: '等效于 java.lang.Character.isMirrored()'},
                        {name:'\\p{InGreek}',description: 'Greek 块(简单块)中的字符'},
                        {name:'\\p{Lu}',description: '大写字母(简单类别)'},
                        {name:'\\p{Sc}',description: '货币符号'},
                        {name:'\\P{InGreek}',description: '所有字符,Greek 块中的除外(否定)'},
                        {name:'[\\p{L}&&[^\\p{Lu}]]',description: '所有字母,大写字母除外(减去)'},
                        {name:'^',description: '行的开头'},
                        {name:'$',description: '行的结尾'},
                        {name:'\\b',description: '单词边界'},
                        {name:'\\B',description: '非单词边界'},
                        {name:'\\A',description: '输入的开头'},
                        {name:'\\G',description: '上一个匹配的结尾'},
                        {name:'\\Z',description: '输入的结尾,仅用于最后的结束符(如果有的话)'},
                        {name:'\\z',description: '输入的结尾'},
                        {name:'X ?',description: 'X,一次或一次也没有'},
                        {name:'X *',description: 'X,零次或多次'},
                        {name:'X +',description: 'X,一次或多次'},
                        {name:'X {n }',description: 'X,恰好 n 次'},
                        {name:'X {n ,}',description: 'X,至少 n 次'},
                        {name:'X {n ,m }',description: 'X,至少 n 次,但是不超过 m 次'},
                        {name:'X ??',description: 'X,一次或一次也没有'},
                        {name:'X *?',description: 'X,零次或多次'},
                        {name:'X +?',description: 'X,一次或多次'},
                        {name:'X {n }?',description: 'X,恰好 n 次'},
                        {name:'X {n ,}?',description: 'X,至少 n 次'},
                        {name:'X {n ,m }?',description: 'X,至少 n 次,但是不超过 m 次'},
                        {name:'X ?+',description: 'X,一次或一次也没有'},
                        {name:'X *+',description: 'X,零次或多次'},
                        {name:'X ++',description: 'X,一次或多次'},
                        {name:'X {n }+',description: 'X,恰好 n 次'},
                        {name:'X {n ,}+',description: 'X,至少 n 次'},
                        {name:'X {n ,m }+',description: 'X,至少 n 次,但是不超过 m 次'},
                        {name:'XY',description: 'X 后跟 Y'},
                        {name:'X |Y',description: 'X 或 Y'},
                        {name:'(X )',description: 'X,作为捕获组'},
                        {name:'\\n',description: '任何匹配的 n<sup>th</sup> 捕获组'},
                        {name:'\\',description: 'Nothing,但是引用以下字符'},
                        {name:'\\Q',description: 'Nothing,但是引用所有字符,直到 \\E'},
                        {name:'\\E',description: 'Nothing,但是结束从 \\Q 开始的引用'},
                        {name:'(?:X )',description: 'X,作为非捕获组'},
                        {name:'(?idmsux-idmsux)',description: 'Nothing,但是将匹配标志由 on 转为 off'},
                        {name:'(?idmsux-idmsux:X )',description: 'X,作为带有给定标志 on - off 的非捕获组'},
                        {name:'(?=X )',description: 'X,通过零宽度的正 lookahead'},
                        {name:'(?!X )',description: 'X,通过零宽度的负 lookahead'},
                        {name:'(?<=X )',description: 'X,通过零宽度的正 lookbehind'},
                        {name:'(?<!X )',description: 'X,通过零宽度的负 lookbehind'},
                        {name:'(?>X )',description: 'X,作为独立的非捕获组'}
                    ]
                    table.render({
                        elem: '#table_' + filter,
                        id: 'table_' + filter,
                        height:585,
                        limit: -1,
                        cols: [[{
                            field: 'name',
                            title: '表达式',
                            width: 300
                        },{
                            field: 'description',
                            title: '使用说明',
                            width: 310
                        }]],
                        data:tableData,
                        done:function(res,cur,total){
                        },
                        rowDBLClick:function (thisTableFilter, record) {
                            var regexpValue=form.getValues(filter).regexp;
                            regexpValue+=record.name
                            form.setValues({regexp:regexpValue},filter);
                        }
                    });
                },
                yes:function(layero){
                    if(form.validata(filter)){
                        var values = form.getValues(filter,true);
                        layer.close(verifyuserIndex);
                    }
                },
                btn2:function(layero){
                    layer.close(verifyuserIndex);
                }
            });
        }
        this.refreshCLF = function () {
            var that = this;
            var tree = layui.tree;
            tree.reload("tree_" + that.id);
        };
        this.refresh = function () {
            var that = this;
            layui.table.reload("table_" + that.id);
            layui.table.reload("table_fullScreen_" + that.id);
        };
 
        this.refreshTEMP = function () {
            var that = this;
            layui.table.reload("temp_" + that.id);
        };
        this.ADVQUERY = function () {
            var that = this;
            if(!that.serinorQueryInstance) {
                var dynamicCondition = layui.dynamicCondition;
                $('[layui-filter="toolbar_' + that.id + '"]').append('<div  id="toolbar' + that.id + '" class="layui-inline"></div>');
                that.checkColumns();
                var dataFields = [];
                for(var i = 0 ; i < that.columns.length ; i ++){
                    dataFields[i] = that.columns[i];
                }
                that.serinorQueryInstance = dynamicCondition.create({
                    fields: dataFields//查询字段
                    , tableId: "table_" + that.id//需要查询的表格
                    , type: "complex"  //type:"simple"/"complex"  查询的方法  暂时写死为 complex
                    , queryCallBack: function (requestData) {//查询之后的callback
 
                    }
                });
            }
            that.serinorQueryInstance.open();
        };
        this.ADDTEMP = function () {
            var that = this;
            that.addOrEditTEMP(true);
        };
        this.EDITTEMP = function(){
            var that = this;
            if(webUtil.isNull(that.currentItemOid)){
                webUtil.showErrorMsg("请先从树上选择一条数据");
                return false;
            }
            that.addOrEditTEMP(false,that.currentItemOid);
        };
        this.addOrEditTEMP = function(add,oid) {
            var that = this;
            var form = layui.form;
            var filter ="form_" + that.id;
            var addSaveIndex =webUtil.dialog({
                title:add?'添加模板':'修改模板',
                btn:['保存','取消'],
                content:'<form id="form_' + filter + '" lay-filter="' + filter + '" class="layui-form" style="margin-top:5px" ></form>',
                resizing:function(layero){
                    form.doResize(filter);
                },
                success:function(layero,layerIndex,classP) {
                    form.addItems(filter,that.getFormTempItems(false),
                        function () {
                            if(!add){
                                form.load(filter,{
                                    backPath:that.backPath,
                                    url:that.url.tempController + that.url.getObjectByOidTemp,
                                    method:'get',
                                    params:{
                                        oid:oid
                                    }
                                });
                            }else{
                                var defaultValues = {};
                                if(that.currentItemAttributes) {
                                    defaultValues["codeClassifyOid"] = that.currentItemOid;
                                    defaultValues["codeClassifyOid" + "name"] = that.currentItemAttributes.name;
                                }
                                //可以手动在此处添加默认值
                                form.setValues(defaultValues,filter);
                            }
 
                            webUtil.relocationOpen(classP)
                        }, {}, {defaultColumnOneRow: 2});
                },
                yes:function(layero){
                    if(form.validata(filter)){
                        var values = form.getValues(filter,true);
                        var url = that.url.tempController + (add?that.url.addSaveTemp:that.url.editSaveTemp);
                        webUtil.manualAjax(add?'post':'put',url,JSON.stringify(values),function(result){
                            if(result.success){
                                webUtil.showMsgFromResult(result,(add ? "添加成功" : "修改成功"));
                                layer.close(addSaveIndex);
                                that.refresh();
                            }else{
                                webUtil.showErrorMsg(result.msg);
                            }
                        },function(xhr,err){
                            webUtil.showErrorMsg("请求服务出现了错误,可能服务器未开启");
                        },that.backPath);
                    }
                },
                btn2:function(layero){
                    layer.close(addSaveIndex);
                }
            });
        };
        this.getFormTempItems = function(onlyShow) {
            var that = this;
            var table = layui.table;
            return [{
                field: 'id',
                title: '模板编号',
                required: true
            },{
                field: 'name',
                title: '模板名称',
                required: true
            },{
                field: 'description',
                title: '描述',
                inputWidth:475,
                type:'textarea'
            }];
        };
    };
    var cs = new Class();
    exports(cs.MODELNAME,cs);
});