Showing
1 changed file
with
450 additions
and
105 deletions
@@ -8,7 +8,6 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist','tabl | @@ -8,7 +8,6 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist','tabl | ||
8 | var domainName = common.domainName; | 8 | var domainName = common.domainName; |
9 | var table = layui.table; | 9 | var table = layui.table; |
10 | var xmSelect = layui.xmSelect; | 10 | var xmSelect = layui.xmSelect; |
11 | - | ||
12 | //对外暴露的接口 | 11 | //对外暴露的接口 |
13 | exports('alarmpolicyAdd', function (data) { | 12 | exports('alarmpolicyAdd', function (data) { |
14 | var sessions = layui.sessions; | 13 | var sessions = layui.sessions; |
@@ -254,11 +253,69 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist','tabl | @@ -254,11 +253,69 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist','tabl | ||
254 | } | 253 | } |
255 | }); | 254 | }); |
256 | } | 255 | } |
256 | + function handleTree(data, id, parentId, children, title) { | ||
257 | + let config = { | ||
258 | + id: id || 'id', | ||
259 | + parentId: parentId || 'parentId', | ||
260 | + childrenList: children || 'children', | ||
261 | + title: title || 'title' | ||
262 | + }; | ||
263 | + | ||
264 | + var childrenListMap = {}; | ||
265 | + var nodeIds = {}; | ||
266 | + var tree = []; | ||
267 | + | ||
268 | + for (let d of data) { | ||
269 | + let parentId = d[config.parentId]; | ||
270 | + let title = d[config.title] | ||
271 | + if (childrenListMap[parentId] == null) { | ||
272 | + childrenListMap[parentId] = []; | ||
273 | + } | ||
274 | + d.title = title; | ||
275 | + nodeIds[d[config.id]] = d; | ||
276 | + childrenListMap[parentId].push(d); | ||
277 | + } | ||
278 | + | ||
279 | + for (let d of data) { | ||
280 | + let parentId = d[config.parentId]; | ||
281 | + let title = d[config.title] | ||
282 | + d.title = title; | ||
283 | + if (nodeIds[parentId] == null) { | ||
284 | + tree.push(d); | ||
285 | + } | ||
286 | + } | ||
287 | + | ||
288 | + for (let t of tree) { | ||
289 | + adaptToChildrenList(t); | ||
290 | + } | ||
291 | + | ||
292 | + function adaptToChildrenList(o) { | ||
293 | + if (childrenListMap[o[config.id]] !== null) { | ||
294 | + o[config.childrenList] = childrenListMap[o[config.id]]; | ||
295 | + } | ||
296 | + if (o[config.childrenList]) { | ||
297 | + for (let c of o[config.childrenList]) { | ||
298 | + adaptToChildrenList(c); | ||
299 | + } | ||
300 | + } | ||
301 | + } | ||
302 | + | ||
303 | + return tree; | ||
304 | + }; | ||
305 | + | ||
257 | form.on('select(serious_policy_param)', function(data){ | 306 | form.on('select(serious_policy_param)', function(data){ |
258 | var seriousvalue =$(this).closest(".cont-base").find("div#seriousvalue"); | 307 | var seriousvalue =$(this).closest(".cont-base").find("div#seriousvalue"); |
308 | + var devTypevalue =$(this).closest(".cont-base").find("div#seriousdevTypevalue"); | ||
309 | + var joinTypevalue =$(this).closest(".cont-base").find("div#seriousjoinTypevalue"); | ||
259 | if(seriousvalue){ | 310 | if(seriousvalue){ |
260 | seriousvalue.remove(); | 311 | seriousvalue.remove(); |
261 | } | 312 | } |
313 | + if(devTypevalue){ | ||
314 | + devTypevalue.remove(); | ||
315 | + } | ||
316 | + if(joinTypevalue){ | ||
317 | + joinTypevalue.remove(); | ||
318 | + } | ||
262 | if (data.value != ''){ | 319 | if (data.value != ''){ |
263 | //加载对应的参数 | 320 | //加载对应的参数 |
264 | if(data.value == "device_id"){ | 321 | if(data.value == "device_id"){ |
@@ -286,47 +343,165 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist','tabl | @@ -286,47 +343,165 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist','tabl | ||
286 | }) | 343 | }) |
287 | 344 | ||
288 | }else if(data.value== "dev_type"){ | 345 | }else if(data.value== "dev_type"){ |
289 | - var dev_type = $(this).closest(".cont-base").find("input[type=tel]"); | 346 | + //var dev_type = $(this).closest(".cont-base").find("input[type=tel]"); |
347 | + $(this).closest(".cont-base").find("input[type=tel]").before('<div id="seriousdevTypevalue" class="xm-select-demo" style="width:478px;position: absolute;z-index: 999"></div>'); | ||
348 | + var dev_type= $(this).closest(".cont-base").find("input[type=tel]"); | ||
290 | $(this).closest(".cont-base").find("input[type=tel]").unbind('click').on("click",function () { | 349 | $(this).closest(".cont-base").find("input[type=tel]").unbind('click').on("click",function () { |
291 | //回填数据 | 350 | //回填数据 |
292 | - common.openWin("baseconfig/resourcetype/index", "选择设备类型", | ||
293 | - { | ||
294 | - "resTypes": seriousresTypes | ||
295 | - }, ["选择"], function () { | ||
296 | - //找到选择的资源类型 并且订阅 | ||
297 | - var resourcetype = layui.resourcetype({"resTypes": seriousresTypes}); | ||
298 | - var data = resourcetype.getResTypeChecks(); | ||
299 | - var resTypes = '' | ||
300 | - seriousresTypes = []; | ||
301 | - if(data.length>0){ | ||
302 | - resTypes = data.substring(1,data.length) | ||
303 | - } | ||
304 | - seriousresTypes.push(resTypes.split(",")[0]) | ||
305 | - dev_type.val(resTypes); | ||
306 | - return resTypes; | ||
307 | - }); | 351 | + // common.openWin("baseconfig/resourcetype/index", "选择设备类型", |
352 | + // { | ||
353 | + // "resTypes": seriousresTypes | ||
354 | + // }, ["选择"], function () { | ||
355 | + // //找到选择的资源类型 并且订阅 | ||
356 | + // var resourcetype = layui.resourcetype({"resTypes": seriousresTypes}); | ||
357 | + // var data = resourcetype.getResTypeChecks(); | ||
358 | + // var resTypes = '' | ||
359 | + // seriousresTypes = []; | ||
360 | + // if(data.length>0){ | ||
361 | + // resTypes = data.substring(1,data.length) | ||
362 | + // } | ||
363 | + // seriousresTypes.push(resTypes.split(",")[0]) | ||
364 | + // dev_type.val(resTypes); | ||
365 | + // return resTypes; | ||
366 | + // }); | ||
367 | + $.ajax({ | ||
368 | + url:'http://192.168.0.44:8080' +"/log-access/v1/lm2_logfmt_dirs/queryTreeList?access_token="+accessToken, | ||
369 | + method:"get", | ||
370 | + success(res){ | ||
371 | + if (res.code==200) | ||
372 | + // 资源类型下拉框 | ||
373 | + var data = res.data; | ||
374 | + var logFmtList = res.data.map(item => { | ||
375 | + return { | ||
376 | + name: item.name, | ||
377 | + value: item.id, | ||
378 | + parentId: item.pId | ||
379 | + } | ||
380 | + }); | ||
381 | + let option = handleTree(res.data, 'id', 'pId','children','name'); | ||
382 | + xmSelect.render({ | ||
383 | + el: '#seriousdevTypevalue', | ||
384 | + name:'devType', | ||
385 | + tips: '=设备类型=', | ||
386 | + radio: false, | ||
387 | + clickClose: false, | ||
388 | + //checkChild:true, | ||
389 | + //radio: true, | ||
390 | + //clickClose: true, | ||
391 | + // initValue: [resType], | ||
392 | + prop: { | ||
393 | + name: 'name', | ||
394 | + value: 'id' | ||
395 | + }, | ||
396 | + filterable: true, | ||
397 | + layVerify: 'required', | ||
398 | + //layVerType: 'msg', | ||
399 | + //initValue: [seriousInkeys.split(",")[0]], | ||
400 | + toolbar: { | ||
401 | + show: true, | ||
402 | + list: ['CLEAR'] | ||
403 | + }, | ||
404 | + tree: { | ||
405 | + //是否显示树状结构 | ||
406 | + show: true, | ||
407 | + //是否展示三角图标 | ||
408 | + showFolderIcon: true, | ||
409 | + //是否显示虚线 | ||
410 | + showLine: false, | ||
411 | + //是否严格遵守父子模式 | ||
412 | + strict: true | ||
413 | + }, | ||
414 | + data:option, | ||
415 | + on: function (data) { | ||
416 | + seriousresTypes = data.arr.map(item => item.id).join(','); | ||
417 | + dev_type.val(seriousresTypes); | ||
418 | + if(data && data.isAdd) { | ||
419 | + //seriousvalue.remove(); | ||
420 | + //inkeys.show(); | ||
421 | + } | ||
422 | + return seriousresTypes | ||
423 | + } | ||
424 | + }); | ||
425 | + return data; | ||
426 | + } | ||
427 | + }); | ||
308 | }); | 428 | }); |
309 | }else if(data.value == "join_type"){ | 429 | }else if(data.value == "join_type"){ |
430 | + $(this).closest(".cont-base").find("input[type=tel]").before('<div id="seriousjoinTypevalue" class="xm-select-demo" style="width:478px;position: absolute;z-index: 999"></div>'); | ||
310 | var join_type= $(this).closest(".cont-base").find("input[type=tel]"); | 431 | var join_type= $(this).closest(".cont-base").find("input[type=tel]"); |
311 | $(this).closest(".cont-base").find("input[type=tel]").unbind('click').on("click",function () { | 432 | $(this).closest(".cont-base").find("input[type=tel]").unbind('click').on("click",function () { |
312 | //回填数据 | 433 | //回填数据 |
313 | - common.openWin("baseconfig/bustype/index", "选择业务类型", | ||
314 | - { | ||
315 | - "busIds": seriousJoinTypes | ||
316 | - }, ["选择"], function () { | ||
317 | - //找到选择的所有业务 并且订阅 | ||
318 | - var bustype = layui.bustype({"busIds": seriousJoinTypes}); | ||
319 | - var data = bustype.getData(); | ||
320 | - var joinTypes = '' | ||
321 | - seriousJoinTypes = []; | ||
322 | - if(data.length>0){ | ||
323 | - joinTypes = data.substring(1,data.length) | ||
324 | - } | ||
325 | - seriousJoinTypes.push(joinTypes.split(",")[0]); | ||
326 | - console.log(seriousJoinTypes); | ||
327 | - join_type.val(joinTypes); | ||
328 | - return joinTypes | ||
329 | - }); | 434 | + // common.openWin("baseconfig/bustype/index", "选择业务类型", |
435 | + // { | ||
436 | + // "busIds": seriousJoinTypes | ||
437 | + // }, ["选择"], function () { | ||
438 | + // //找到选择的所有业务 并且订阅 | ||
439 | + // var bustype = layui.bustype({"busIds": seriousJoinTypes}); | ||
440 | + // var data = bustype.getData(); | ||
441 | + // var joinTypes = '' | ||
442 | + // seriousJoinTypes = []; | ||
443 | + // if(data.length>0){ | ||
444 | + // joinTypes = data.substring(1,data.length) | ||
445 | + // } | ||
446 | + // seriousJoinTypes.push(joinTypes.split(",")[0]); | ||
447 | + // console.log(seriousJoinTypes); | ||
448 | + // join_type.val(joinTypes); | ||
449 | + // return joinTypes | ||
450 | + // }); | ||
451 | + $.ajax({ | ||
452 | + url:'http://192.168.0.44:8080' +"/log-access/v1/lm2_logjoin_dirs/queryTreeList?access_token="+accessToken, | ||
453 | + method:"get", | ||
454 | + success(res){ | ||
455 | + if (res.code==200) | ||
456 | + // 资源类型下拉框 | ||
457 | + var data = res.data; | ||
458 | + let option = handleTree(res.data, 'id', 'pId','children','name'); | ||
459 | + xmSelect.render({ | ||
460 | + el: '#seriousjoinTypevalue', | ||
461 | + name:'joinType', | ||
462 | + tips: '=业务类型=', | ||
463 | + radio: false, | ||
464 | + clickClose: false, | ||
465 | + //checkChild:true, | ||
466 | + //radio: true, | ||
467 | + //clickClose: true, | ||
468 | + // initValue: [resType], | ||
469 | + prop: { | ||
470 | + name: 'name', | ||
471 | + value: 'id' | ||
472 | + }, | ||
473 | + filterable: true, | ||
474 | + layVerify: 'required', | ||
475 | + //layVerType: 'msg', | ||
476 | + //initValue: [seriousInkeys.split(",")[0]], | ||
477 | + toolbar: { | ||
478 | + show: true, | ||
479 | + list: ['CLEAR'] | ||
480 | + }, | ||
481 | + tree: { | ||
482 | + //是否显示树状结构 | ||
483 | + show: true, | ||
484 | + //是否展示三角图标 | ||
485 | + showFolderIcon: true, | ||
486 | + //是否显示虚线 | ||
487 | + showLine: false, | ||
488 | + //是否严格遵守父子模式 | ||
489 | + strict: true | ||
490 | + }, | ||
491 | + data:option, | ||
492 | + on: function (data) { | ||
493 | + seriousJoinTypes = data.arr.map(item => item.id).join(','); | ||
494 | + join_type.val(seriousJoinTypes); | ||
495 | + if(data && data.isAdd) { | ||
496 | + //seriousvalue.remove(); | ||
497 | + //inkeys.show(); | ||
498 | + } | ||
499 | + return seriousJoinTypes | ||
500 | + } | ||
501 | + }); | ||
502 | + return data; | ||
503 | + } | ||
504 | + }); | ||
330 | }); | 505 | }); |
331 | }else if(data.value == "inKey"){ | 506 | }else if(data.value == "inKey"){ |
332 | //绑定资源类型下拉选择 | 507 | //绑定资源类型下拉选择 |
@@ -379,6 +554,15 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist','tabl | @@ -379,6 +554,15 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist','tabl | ||
379 | if(importantvalue){ | 554 | if(importantvalue){ |
380 | importantvalue.remove(); | 555 | importantvalue.remove(); |
381 | } | 556 | } |
557 | + var devTypevalue =$(this).closest(".cont-base").find("div#importantdevTypevalue"); | ||
558 | + var joinTypevalue =$(this).closest(".cont-base").find("div#importantjoinTypevalue"); | ||
559 | + | ||
560 | + if(devTypevalue){ | ||
561 | + devTypevalue.remove(); | ||
562 | + } | ||
563 | + if(joinTypevalue){ | ||
564 | + joinTypevalue.remove(); | ||
565 | + } | ||
382 | if (data.value != ''){ | 566 | if (data.value != ''){ |
383 | //加载对应的参数 | 567 | //加载对应的参数 |
384 | if(data.value == "device_id"){ | 568 | if(data.value == "device_id"){ |
@@ -407,46 +591,122 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist','tabl | @@ -407,46 +591,122 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist','tabl | ||
407 | }) | 591 | }) |
408 | 592 | ||
409 | }else if(data.value== "dev_type"){ | 593 | }else if(data.value== "dev_type"){ |
410 | - var dev_type = $(this).closest(".cont-base").find("input[type=tel]"); | 594 | + $(this).closest(".cont-base").find("input[type=tel]").before('<div id="importantdevTypevalue" class="xm-select-demo" style="width:478px;position: absolute;z-index: 999"></div>'); |
595 | + var dev_type= $(this).closest(".cont-base").find("input[type=tel]"); | ||
411 | $(this).closest(".cont-base").find("input[type=tel]").unbind('click').on("click",function () { | 596 | $(this).closest(".cont-base").find("input[type=tel]").unbind('click').on("click",function () { |
412 | - //回填数据 | ||
413 | - common.openWin("baseconfig/resourcetype/index", "选择设备类型", | ||
414 | - { | ||
415 | - "resTypes": importantresTypes | ||
416 | - }, ["选择"], function () { | ||
417 | - //找到选择的资源类型 并且订阅 | ||
418 | - var resourcetype = layui.resourcetype({"resTypes": importantresTypes}); | ||
419 | - var data = resourcetype.getResTypeChecks(); | ||
420 | - var resTypes = '' | ||
421 | - importantresTypes = []; | ||
422 | - if(data.length>0){ | ||
423 | - resTypes = data.substring(1,data.length) | ||
424 | - } | ||
425 | - importantresTypes.push(resTypes.split(",")[0]) | ||
426 | - dev_type.val(resTypes); | ||
427 | - return resTypes; | ||
428 | - }); | 597 | + $.ajax({ |
598 | + url:'http://192.168.0.44:8080' +"/log-access/v1/lm2_logfmt_dirs/queryTreeList?access_token="+accessToken, | ||
599 | + method:"get", | ||
600 | + success(res){ | ||
601 | + if (res.code==200) | ||
602 | + // 资源类型下拉框 | ||
603 | + var data = res.data; | ||
604 | + let option = handleTree(res.data, 'id', 'pId','children','name'); | ||
605 | + xmSelect.render({ | ||
606 | + el: '#importantdevTypevalue', | ||
607 | + name:'importantdevType', | ||
608 | + tips: '=设备类型=', | ||
609 | + radio: false, | ||
610 | + clickClose: false, | ||
611 | + //checkChild:true, | ||
612 | + //radio: true, | ||
613 | + //clickClose: true, | ||
614 | + // initValue: [resType], | ||
615 | + prop: { | ||
616 | + name: 'name', | ||
617 | + value: 'id' | ||
618 | + }, | ||
619 | + filterable: true, | ||
620 | + layVerify: 'required', | ||
621 | + //layVerType: 'msg', | ||
622 | + //initValue: [seriousInkeys.split(",")[0]], | ||
623 | + toolbar: { | ||
624 | + show: true, | ||
625 | + list: ['CLEAR'] | ||
626 | + }, | ||
627 | + tree: { | ||
628 | + //是否显示树状结构 | ||
629 | + show: true, | ||
630 | + //是否展示三角图标 | ||
631 | + showFolderIcon: true, | ||
632 | + //是否显示虚线 | ||
633 | + showLine: false, | ||
634 | + //是否严格遵守父子模式 | ||
635 | + strict: true | ||
636 | + }, | ||
637 | + data:option, | ||
638 | + on: function (data) { | ||
639 | + importantresTypes = data.arr.map(item => item.id).join(','); | ||
640 | + dev_type.val(importantresTypes); | ||
641 | + if(data && data.isAdd) { | ||
642 | + //seriousvalue.remove(); | ||
643 | + //inkeys.show(); | ||
644 | + } | ||
645 | + return importantresTypes; | ||
646 | + } | ||
647 | + }); | ||
648 | + return data; | ||
649 | + } | ||
650 | + }); | ||
429 | }); | 651 | }); |
430 | }else if(data.value == "join_type"){ | 652 | }else if(data.value == "join_type"){ |
653 | + $(this).closest(".cont-base").find("input[type=tel]").before('<div id="importantjoinTypevalue" class="xm-select-demo" style="width:478px;position: absolute;z-index: 999"></div>'); | ||
431 | var join_type= $(this).closest(".cont-base").find("input[type=tel]"); | 654 | var join_type= $(this).closest(".cont-base").find("input[type=tel]"); |
432 | $(this).closest(".cont-base").find("input[type=tel]").unbind('click').on("click",function () { | 655 | $(this).closest(".cont-base").find("input[type=tel]").unbind('click').on("click",function () { |
433 | - //回填数据 | ||
434 | - common.openWin("baseconfig/bustype/index", "选择业务类型", | ||
435 | - { | ||
436 | - "busIds": importantJoinTypes | ||
437 | - }, ["选择"], function () { | ||
438 | - //找到选择的所有业务 并且订阅 | ||
439 | - var bustype = layui.bustype({"busIds": importantJoinTypes}); | ||
440 | - var data = bustype.getData(); | ||
441 | - var joinTypes = '' | ||
442 | - importantJoinTypes = []; | ||
443 | - if(data.length>0){ | ||
444 | - joinTypes = data.substring(1,data.length) | ||
445 | - } | ||
446 | - importantJoinTypes.push(joinTypes.split(",")[0]); | ||
447 | - join_type.val(joinTypes); | ||
448 | - return joinTypes | ||
449 | - }); | 656 | + $.ajax({ |
657 | + url:'http://192.168.0.44:8080' +"/log-access/v1/lm2_logjoin_dirs/queryTreeList?access_token="+accessToken, | ||
658 | + method:"get", | ||
659 | + success(res){ | ||
660 | + if (res.code==200) | ||
661 | + // 资源类型下拉框 | ||
662 | + var data = res.data; | ||
663 | + let option = handleTree(res.data, 'id', 'pId','children','name'); | ||
664 | + xmSelect.render({ | ||
665 | + el: '#importantjoinTypevalue', | ||
666 | + name:'importantjoinType', | ||
667 | + tips: '=业务类型=', | ||
668 | + radio: false, | ||
669 | + clickClose: false, | ||
670 | + //checkChild:true, | ||
671 | + //radio: true, | ||
672 | + //clickClose: true, | ||
673 | + // initValue: [resType], | ||
674 | + prop: { | ||
675 | + name: 'name', | ||
676 | + value: 'id' | ||
677 | + }, | ||
678 | + filterable: true, | ||
679 | + layVerify: 'required', | ||
680 | + //layVerType: 'msg', | ||
681 | + //initValue: [seriousInkeys.split(",")[0]], | ||
682 | + toolbar: { | ||
683 | + show: true, | ||
684 | + list: ['CLEAR'] | ||
685 | + }, | ||
686 | + tree: { | ||
687 | + //是否显示树状结构 | ||
688 | + show: true, | ||
689 | + //是否展示三角图标 | ||
690 | + showFolderIcon: true, | ||
691 | + //是否显示虚线 | ||
692 | + showLine: false, | ||
693 | + //是否严格遵守父子模式 | ||
694 | + strict: true | ||
695 | + }, | ||
696 | + data:option, | ||
697 | + on: function (data) { | ||
698 | + importantJoinTypes = data.arr.map(item => item.id).join(','); | ||
699 | + join_type.val(importantJoinTypes); | ||
700 | + if(data && data.isAdd) { | ||
701 | + //seriousvalue.remove(); | ||
702 | + //inkeys.show(); | ||
703 | + } | ||
704 | + return importantJoinTypes | ||
705 | + } | ||
706 | + }); | ||
707 | + return data; | ||
708 | + } | ||
709 | + }); | ||
450 | }); | 710 | }); |
451 | }else if(data.value == "inKey"){ | 711 | }else if(data.value == "inKey"){ |
452 | //绑定资源类型下拉选择 | 712 | //绑定资源类型下拉选择 |
@@ -500,6 +760,15 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist','tabl | @@ -500,6 +760,15 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist','tabl | ||
500 | if(commonlyvalue){ | 760 | if(commonlyvalue){ |
501 | commonlyvalue.remove(); | 761 | commonlyvalue.remove(); |
502 | } | 762 | } |
763 | + var devTypevalue =$(this).closest(".cont-base").find("div#commonlydevTypevalue"); | ||
764 | + var joinTypevalue =$(this).closest(".cont-base").find("div#commonlyjoinTypevalue"); | ||
765 | + | ||
766 | + if(devTypevalue){ | ||
767 | + devTypevalue.remove(); | ||
768 | + } | ||
769 | + if(joinTypevalue){ | ||
770 | + joinTypevalue.remove(); | ||
771 | + } | ||
503 | if (data.value != ''){ | 772 | if (data.value != ''){ |
504 | //加载对应的参数 | 773 | //加载对应的参数 |
505 | if(data.value == "device_id"){ | 774 | if(data.value == "device_id"){ |
@@ -528,46 +797,122 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist','tabl | @@ -528,46 +797,122 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist','tabl | ||
528 | }) | 797 | }) |
529 | 798 | ||
530 | }else if(data.value== "dev_type"){ | 799 | }else if(data.value== "dev_type"){ |
531 | - var dev_type = $(this).closest(".cont-base").find("input[type=tel]"); | 800 | + $(this).closest(".cont-base").find("input[type=tel]").before('<div id="commonlydevTypevalue" class="xm-select-demo" style="width:478px;position: absolute;z-index: 999"></div>'); |
801 | + var dev_type= $(this).closest(".cont-base").find("input[type=tel]"); | ||
532 | $(this).closest(".cont-base").find("input[type=tel]").unbind('click').on("click",function () { | 802 | $(this).closest(".cont-base").find("input[type=tel]").unbind('click').on("click",function () { |
533 | - //回填数据 | ||
534 | - common.openWin("baseconfig/resourcetype/index", "选择设备类型", | ||
535 | - { | ||
536 | - "resTypes": commonlyresTypes | ||
537 | - }, ["选择"], function () { | ||
538 | - //找到选择的资源类型 并且订阅 | ||
539 | - var resourcetype = layui.resourcetype({"resTypes": commonlyresTypes}); | ||
540 | - var data = resourcetype.getResTypeChecks(); | ||
541 | - var resTypes = '' | ||
542 | - commonlyresTypes = []; | ||
543 | - if(data.length>0){ | ||
544 | - resTypes = data.substring(1,data.length) | ||
545 | - } | ||
546 | - commonlyresTypes.push(resTypes.split(",")[0]) | ||
547 | - dev_type.val(resTypes); | ||
548 | - return resTypes; | ||
549 | - }); | 803 | + $.ajax({ |
804 | + url:'http://192.168.0.44:8080' +"/log-access/v1/lm2_logfmt_dirs/queryTreeList?access_token="+accessToken, | ||
805 | + method:"get", | ||
806 | + success(res){ | ||
807 | + if (res.code==200) | ||
808 | + // 资源类型下拉框 | ||
809 | + var data = res.data; | ||
810 | + let option = handleTree(res.data, 'id', 'pId','children','name'); | ||
811 | + xmSelect.render({ | ||
812 | + el: '#commonlydevTypevalue', | ||
813 | + name:'commonlydevType', | ||
814 | + tips: '=设备类型=', | ||
815 | + radio: false, | ||
816 | + clickClose: false, | ||
817 | + //checkChild:true, | ||
818 | + //radio: true, | ||
819 | + //clickClose: true, | ||
820 | + // initValue: [resType], | ||
821 | + prop: { | ||
822 | + name: 'name', | ||
823 | + value: 'id' | ||
824 | + }, | ||
825 | + filterable: true, | ||
826 | + layVerify: 'required', | ||
827 | + //layVerType: 'msg', | ||
828 | + //initValue: [seriousInkeys.split(",")[0]], | ||
829 | + toolbar: { | ||
830 | + show: true, | ||
831 | + list: ['CLEAR'] | ||
832 | + }, | ||
833 | + tree: { | ||
834 | + //是否显示树状结构 | ||
835 | + show: true, | ||
836 | + //是否展示三角图标 | ||
837 | + showFolderIcon: true, | ||
838 | + //是否显示虚线 | ||
839 | + showLine: false, | ||
840 | + //是否严格遵守父子模式 | ||
841 | + strict: true | ||
842 | + }, | ||
843 | + data:option, | ||
844 | + on: function (data) { | ||
845 | + commonlyresTypes = data.arr.map(item => item.id).join(','); | ||
846 | + dev_type.val(commonlyresTypes); | ||
847 | + if(data && data.isAdd) { | ||
848 | + //seriousvalue.remove(); | ||
849 | + //inkeys.show(); | ||
850 | + } | ||
851 | + return commonlyresTypes; | ||
852 | + } | ||
853 | + }); | ||
854 | + return data; | ||
855 | + } | ||
856 | + }); | ||
550 | }); | 857 | }); |
551 | }else if(data.value == "join_type"){ | 858 | }else if(data.value == "join_type"){ |
859 | + $(this).closest(".cont-base").find("input[type=tel]").before('<div id="commonlyjoinTypevalue" class="xm-select-demo" style="width:478px;position: absolute;z-index: 999"></div>'); | ||
552 | var join_type= $(this).closest(".cont-base").find("input[type=tel]"); | 860 | var join_type= $(this).closest(".cont-base").find("input[type=tel]"); |
553 | $(this).closest(".cont-base").find("input[type=tel]").unbind('click').on("click",function () { | 861 | $(this).closest(".cont-base").find("input[type=tel]").unbind('click').on("click",function () { |
554 | - //回填数据 | ||
555 | - common.openWin("baseconfig/bustype/index", "选择业务类型", | ||
556 | - { | ||
557 | - "busIds": commonlyJoinTypes | ||
558 | - }, ["选择"], function () { | ||
559 | - //找到选择的所有业务 并且订阅 | ||
560 | - var bustype = layui.bustype({"busIds": commonlyJoinTypes}); | ||
561 | - var data = bustype.getData(); | ||
562 | - var joinTypes = '' | ||
563 | - commonlyJoinTypes = []; | ||
564 | - if(data.length>0){ | ||
565 | - joinTypes = data.substring(1,data.length) | ||
566 | - } | ||
567 | - commonlyJoinTypes.push(joinTypes.split(",")[0]); | ||
568 | - join_type.val(joinTypes); | ||
569 | - return joinTypes | ||
570 | - }); | 862 | + $.ajax({ |
863 | + url:'http://192.168.0.44:8080' +"/log-access/v1/lm2_logjoin_dirs/queryTreeList?access_token="+accessToken, | ||
864 | + method:"get", | ||
865 | + success(res){ | ||
866 | + if (res.code==200) | ||
867 | + // 资源类型下拉框 | ||
868 | + var data = res.data; | ||
869 | + let option = handleTree(res.data, 'id', 'pId','children','name'); | ||
870 | + xmSelect.render({ | ||
871 | + el: '#commonlyjoinTypevalue', | ||
872 | + name:'commonlyjoinType', | ||
873 | + tips: '=业务类型=', | ||
874 | + radio: false, | ||
875 | + clickClose: false, | ||
876 | + //checkChild:true, | ||
877 | + //radio: true, | ||
878 | + //clickClose: true, | ||
879 | + // initValue: [resType], | ||
880 | + prop: { | ||
881 | + name: 'name', | ||
882 | + value: 'id' | ||
883 | + }, | ||
884 | + filterable: true, | ||
885 | + layVerify: 'required', | ||
886 | + //layVerType: 'msg', | ||
887 | + //initValue: [seriousInkeys.split(",")[0]], | ||
888 | + toolbar: { | ||
889 | + show: true, | ||
890 | + list: ['CLEAR'] | ||
891 | + }, | ||
892 | + tree: { | ||
893 | + //是否显示树状结构 | ||
894 | + show: true, | ||
895 | + //是否展示三角图标 | ||
896 | + showFolderIcon: true, | ||
897 | + //是否显示虚线 | ||
898 | + showLine: false, | ||
899 | + //是否严格遵守父子模式 | ||
900 | + strict: true | ||
901 | + }, | ||
902 | + data:option, | ||
903 | + on: function (data) { | ||
904 | + commonlyJoinTypes = data.arr.map(item => item.id).join(','); | ||
905 | + join_type.val(commonlyJoinTypes); | ||
906 | + if(data && data.isAdd) { | ||
907 | + //seriousvalue.remove(); | ||
908 | + //inkeys.show(); | ||
909 | + } | ||
910 | + return commonlyJoinTypes; | ||
911 | + } | ||
912 | + }); | ||
913 | + return data; | ||
914 | + } | ||
915 | + }); | ||
571 | }); | 916 | }); |
572 | }else if(data.value == "inKey"){ | 917 | }else if(data.value == "inKey"){ |
573 | //绑定资源类型下拉选择 | 918 | //绑定资源类型下拉选择 |
-
Please register or login to post a comment