link_count_save.blade.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. @extends('admin/layout')
  2. @section('header')
  3. <link href="{{asset('css/plugins/chosen/chosen.css')}}" rel="stylesheet">
  4. <link href="{{asset('js/plugins/bootstrap-select-1.13.5/css/bootstrap-select.min.css')}}" rel="stylesheet">
  5. @endsection
  6. @section('content')
  7. <body class="gray-bg">
  8. <div class="wrapper wrapper-content animated fadeInRight">
  9. <div class="row">
  10. <div class="col-sm-12">
  11. <div class="ibox float-e-margins">
  12. <div class="ibox-content">
  13. <form method="get" class="form-horizontal" id="form">
  14. <div class="form-group" id="siteAssign">
  15. <label class="col-sm-2 control-label" for="link_id">外链类型:</label>
  16. <div class="col-sm-8">
  17. <select class="chosen-select form-control" data-placeholder="选择类型..."
  18. id="link_id" name="link_id">
  19. <option value="">请选择</option>
  20. @foreach ($allLinks as $item)
  21. <option value="{{$item->id}}"
  22. @if(($data->link_id??null)==$item->id) selected @endif>{{$item->url}}</option>
  23. @endforeach
  24. </select>
  25. </div>
  26. </div>
  27. <div class="form-group">
  28. <label class="col-sm-2 control-label" for="username">用户名:</label>
  29. <div class="col-sm-8">
  30. <input type="text" class="form-control" id="username" name="username"
  31. value="{{$data->username??''}}">
  32. </div>
  33. </div>
  34. <div class="form-group">
  35. <label class="col-sm-2 control-label" for="password">密码:</label>
  36. <div class="col-sm-8">
  37. <input type="text" class="form-control" id="password" name="password" value="{{$data->password??''}}">
  38. </div>
  39. </div>
  40. <div class="form-group">
  41. <label class="col-sm-2 control-label" for="email">邮箱:</label>
  42. <div class="col-sm-8">
  43. <input type="text" class="form-control" id="email" name="email" value="{{$data->email??''}}">
  44. </div>
  45. </div>
  46. <div class="form-group">
  47. <label class="col-sm-2 control-label" for="url">演示地址:</label>
  48. <div class="col-sm-8">
  49. <input type="text" class="form-control" id="url" name="url" value="{{$data->url??''}}">
  50. </div>
  51. </div>
  52. <div class="form-group">
  53. <label class="col-sm-2 control-label" for="url">上传时间:</label>
  54. <div class="col-sm-8">
  55. <input type="text" class="form-control" id="created_at" name="created_at" value="{{$data->created_at??''}}">
  56. </div>
  57. </div>
  58. <div class="hr-line-dashed"></div>
  59. <div class="form-group">
  60. <div class="col-sm-4 col-sm-offset-2">
  61. <button class="btn btn-primary" type="button" onclick="units.save()">
  62. 保存
  63. </button>
  64. </div>
  65. </div>
  66. </form>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </body>
  73. @endsection
  74. @section('footer')
  75. <script src="{{asset('js/plugins/chosen/chosen.jquery.js')}}"></script>
  76. <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
  77. <script>
  78. var config = {".chosen-select": {}};
  79. for (var selector in config) $(selector).chosen(config[selector]);
  80. laydate.render({
  81. elem: '#created_at', //指定元素
  82. type: 'datetime'
  83. });
  84. var units = {
  85. save: function () {
  86. var data = tips.getFormValues('#form');
  87. // data.redundant_site_id =
  88. var ajaxConfig = {
  89. url: '/admin/link/link-count/{{$data->id??0}}?siteId={{$siteId}}',
  90. type: 'post',
  91. data: data,
  92. success: function (result) {
  93. layer.msg(result.message, {icon: 6, time: 1000}, function () {
  94. tips.closeParentLayer();
  95. window.parent.tips.tableRefresh('#table');
  96. });
  97. }
  98. };
  99. tips.ajax(ajaxConfig);
  100. }
  101. };
  102. </script>
  103. @endsection