123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- @extends('admin/layout')
- @section('header')
- <link href="{{asset('css/plugins/chosen/chosen.css')}}" rel="stylesheet">
- <link href="{{asset('css/plugins/switchery/switchery.css')}}" rel="stylesheet">
- @endsection
- @section('content')
- <style>
- .links-lists-boxs {
- display: block;
- text-align: center;
- padding: 20px 0;
- position: fixed;
- left: 0;
- top: 0px;
- width: 100%;
- z-index: 999999;
- background: #f3f3f4;
- }
- .links-lists-boxs .lists {
- display: inline-block;
- vertical-align: top;
- text-align: center;
- padding: 0 2px;
- }
- .links-lists-boxs .lists span {
- display: inline-block;
- font-size: 14px;
- padding: 5px 10px;
- border: 6px;
- border-radius: 6px;
- color: #676a6c;
- }
- .links-lists-boxs .lists.active span {
- background: #fff;
- color: #2a94e0;
- }
- .links-lists-boxs .lists:hover span {
- background: #fff;
- color: #2a94e0;
- }
- .links-times-boxs {
- display: block;
- width: 100%;
- min-height: 30px;
- padding: 0 5px;
- text-align: center;
- }
- .links-times-boxs .times-lefts {
- display: inline-block;
- vertical-align: top;
- padding-right: 12px;
- }
- .links-times-boxs .times-lefts .spans {
- display: inline-block;
- vertical-align: top;
- font-size: 14px;
- color: #2a94e0;
- line-height: 24px;
- padding: 0 4px;
- }
- .links-times-boxs .times-lefts .spans + .spans:before {
- content: '|';
- margin-right: 4px;
- }
- .links-times-boxs .times-rights {
- display: inline-block;
- vertical-align: top;
- }
- .links-times-boxs .times-rights input {
- background: none;
- border: 1px solid #2a94e0;
- color: #2a94e0;
- font-size: 12px;
- line-height: 22px;
- outline: none;
- padding: 0 0 0 10px;
- }
- .links-times-boxs .times-rights .links-btn {
- background: #2a94e0;
- border: 1px solid #2a94e0;
- color: #fff;
- font-size: 12px;
- line-height: 22px;
- outline: none;
- }
- .fold {
- height: 45px;
- }
- </style>
- <body class="gray-bg">
- <div class="links-lists-boxs">
- @if(!$task)
- <div class="links-times-boxs">
- <div class="times-lefts">
- </div>
- <div class="times-rights">
- <input type="text" id="release_at">
- <button class="links-btn" onclick="utils.saveBtn()">保存</button>
- </div>
- </div>
- @endif
- <div class="lists-boxs">
- @php $count=0; @endphp
- @foreach($typeLinks as $type=>$links)
- @php $count++; @endphp
- <a href="javascript:;" class="lists @if($count==1) active @endif">
- <span>
- {{$typeList[$type]??''}}
- </span>
- </a>
- @endforeach
- </div>
- </div>
- <div class="wrapper wrapper-content animated fadeInRight" style="padding-top: 110px;">
- @php $count=0; @endphp
- @foreach($typeLinks as $type=>$links)
- @php $count++; @endphp
- <div class="row links-lists @if($count!=1) hide @endif">
- <div class="ibox float-e-margins">
- <div class="ibox-title">
- <h5>{{$typeList[$type]??''}}</h5>
- <div style="float: right">
- <label>
- <input type="checkbox" class="i-checks" name="toggle">
- 全选反选
- </label>
- </div>
- </div>
- @php $tagList=$links->groupBy('tag')->toArray(); @endphp
- <div class="ibox-content">
- @php $abandonList=[]; @endphp
- @php $tagInx=1; @endphp
- @foreach($tagList as $tag=>$items)
- @if ($tag=='放弃')
- @php $abandonList[$tag]=$items; @endphp
- @continue
- @endif
- <div class="alert @if($tagInx%2==0) alert-success @else alert-info @endif">
- <input type="checkbox" class="i-checks" name="localToggle">全选反选 <span
- style="margin-left: 20px">当前标签:{{empty($tag)?'无':$tag}} </span>
- <br>
- @foreach($items as $link)
- <div style="display: inline-block;width: 220px">
- <label title="{{$link['remark']}}"
- @if(in_array($link['id'],$linkHad)) style="color: red;opacity: .6" @endif>
- <input type="checkbox" class="i-checks" name="linkIds"
- data-url="{{$link['url']}}" data-type="{{$typeList[$type]??''}}"
- value="{{$link['id']}}"
- @if(in_array($link['id'],$hasLinkIds)) checked @endif>
- {{$link['url']}}
- </label>
- </div>
- @endforeach
- </div>
- @php $tagInx++@endphp
- @endforeach
- {{--放弃--}}
- @foreach($abandonList as $tag=>$items)
- <div class="alert alert-warning fold" style="position: relative;overflow: hidden">
- <button type="button"
- onclick="utils.toggleVisible(this)" style="display: block;margin-bottom: 4px">显示
- </button>
- <input type="checkbox" class="i-checks" name="localToggle">全选反选 <span
- style="margin-left: 20px">当前标签:{{empty($tag)?'无':$tag}} </span>
- <br>
- @foreach($items as $link)
- <div style="display: inline-block;width: 220px">
- <label title="{{$link['remark']}}"
- @if(in_array($link['id'],$linkHad)) style="color: red;opacity: .6" @endif>
- <input type="checkbox" class="i-checks" name="linkIds"
- data-url="{{$link['url']}}" data-type="{{$typeList[$type]??''}}"
- value="{{$link['id']}}"
- @if(in_array($link['id'],$hasLinkIds)) checked @endif>
- {{$link['url']}}
- </label>
- </div>
- @endforeach
- </div>
- @endforeach
- </div>
- </div>
- </div>
- @endforeach
- </div>
- <input type="hidden" id="choseData">
- </body>
- @endsection
- @section('footer')
- <script src="{{asset('js/plugins/iCheck/icheck.min.js')}}"></script>
- <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
- <script>
- $(function () {
- $(".links-lists-boxs .lists-boxs .lists").click(function () {
- var i = $(this).index();
- $(this).addClass("active").siblings().removeClass("active");
- $(".links-lists").eq(i).removeClass("hide").siblings(".links-lists").addClass("hide");
- });
- });
- $(function () {
- $(".i-checks").iCheck({checkboxClass: "icheckbox_square-green", radioClass: "iradio_square-green"});
- });
- var choseDataList = [];
- var utils = {
- toggleVisible: function (_this) {
- if ($(_this).parent().hasClass('fold')) {
- $(_this).parent().removeClass('fold');
- $(_this).text('隐藏')
- } else {
- $(_this).parent().addClass('fold');
- $(_this).text('显示')
- }
- },
- saveBtn: function () {
- if ($("#release_at").val() != '') {
- var selectIds = [], selectItems = [];
- $("[name=linkIds]input:checked").each(function () {
- selectIds.push($(this).val());
- selectItems.push({type: $(this).data('type'), url: $(this).data('url')})
- });
- if (selectIds.length < 1) {
- layer.alert("请选择外链库", {icon: 5});
- return;
- }
- var _val = $("#release_at").val();
- $(".links-times-boxs .times-lefts").append('<span class="spans">' + _val + '</span>');
- $("#release_at").val('');
- choseDataList.push({
- release_at: _val,
- link_ids: selectIds,
- selectItems: selectItems
- });
- var str = JSON.stringify(choseDataList);
- $("#choseData").val(str);
- $(".i-checks").iCheck('uncheck');
- }
- }
- };
- laydate.render({
- elem: '#release_at', //指定元素
- type: 'datetime'
- });
- $("[name=toggle]").on('ifChecked', function () {
- $(this).parent().parent().parent().parent().next().iCheck('check')
- }).on('ifUnchecked', function () {
- $(this).parent().parent().parent().parent().next().iCheck('uncheck');
- });
- $("[name=localToggle]").on('ifChecked', function () {
- $(this).parent().parent().iCheck('check')
- }).on('ifUnchecked', function () {
- $(this).parent().parent().iCheck('uncheck')
- });
- </script>
- @endsection
|