project_show.blade.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. @extends('layout')
  2. @section('header')
  3. <link href="{{asset('css/plugins/chosen/chosen.css')}}" rel="stylesheet">
  4. <link href="{{asset('css/plugins/switchery/switchery.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">
  15. <label class="col-sm-2 control-label" for="title">项目名称:</label>
  16. <div class="col-sm-8">
  17. <input type="text" class="form-control" id="title" name="title"
  18. value="{{$data->title ?? ''}}">
  19. </div>
  20. </div>
  21. <div class="hr-line-dashed"></div>
  22. <div class="form-group">
  23. <label class="col-sm-2 control-label" for="password">域名:</label>
  24. <div class="col-sm-8">
  25. <input type="text" class="form-control" id="password" name="password" value="{{$data->domain??''}}">
  26. </div>
  27. </div>
  28. <div class="hr-line-dashed"></div>
  29. <div class="form-group">
  30. <label class="col-sm-2 control-label" for="ae_id">ae人员:</label>
  31. <div class="col-sm-8">
  32. <select data-placeholder="选择ae人员..." class="chosen-select" style="width:350px;"
  33. id="ae_id" name="ae_id">
  34. <option value="">请选择se</option>
  35. @foreach ($aes as $ae)
  36. <option value="{{$ae->id}}"
  37. @if(($data->ae_id??null)==$ae->id) selected @endif>{{$ae->name}}</option>
  38. @endforeach
  39. </select>
  40. </div>
  41. </div>
  42. {{--<div class="hr-line-dashed"></div>--}}
  43. {{--<div class="form-group">--}}
  44. {{--<label class="col-sm-2 control-label" for="status">状态:</label>--}}
  45. {{--<div class="col-sm-8">--}}
  46. {{--<input type="checkbox" id="status" name="status" class="js-switch"--}}
  47. {{--@if(!$user || $user->status) checked @endif>--}}
  48. {{--</div>--}}
  49. {{--</div>--}}
  50. <div class="form-group">
  51. <div class="col-sm-4 col-sm-offset-2">
  52. <button class="btn btn-primary" type="button" data-id="{{$user->id??0}}" id="save">
  53. 保存
  54. </button>
  55. <button class="btn btn-white" type="button" id="cancel">取消</button>
  56. </div>
  57. </div>
  58. </form>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </body>
  65. @endsection
  66. @section('footer')
  67. <script src="{{asset('js/plugins/chosen/chosen.jquery.js')}}"></script>
  68. <script src="{{asset('js/plugins/switchery/switchery.js')}}"></script>
  69. <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
  70. <script>
  71. $(document).on('click', '#cancel', function () {
  72. tips.closeParentLayer();
  73. });
  74. var config = {".chosen-select": {}};
  75. for (var selector in config) $(selector).chosen(config[selector]);
  76. var jsSwitch = document.querySelector(".js-switch");
  77. new Switchery(jsSwitch, {color: "#1AB394", size: 'small'});
  78. $(document).on('click', '#save', function () {
  79. var id = $(this).data('id');
  80. var url = '/system/user';
  81. var type = 'post';
  82. if (id > 0) { //编辑
  83. url += '/' + id;
  84. type = 'put';
  85. }
  86. var data = tips.getFormValues('#form');
  87. data.status = jsSwitch.checked ? 1 : 0;
  88. var ajaxConfig = {
  89. url: url,
  90. type: type,
  91. data: data,
  92. success: function (result) {
  93. layer.msg(result.message, {icon: 6, time: 3000}, function () {
  94. tips.closeParentLayer();
  95. window.parent.tips.tableRefresh('#table');
  96. });
  97. }
  98. };
  99. tips.ajax(ajaxConfig);
  100. });
  101. </script>
  102. @endsection