detail.blade_bak.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. @extends('admin/layout')
  2. @section('header')
  3. <style>
  4. .summary::after {
  5. content: '';
  6. display: block;
  7. clear: both;
  8. }
  9. .fontBold {
  10. font-size: 14px;
  11. font-weight: 600;
  12. }
  13. .formHeader {
  14. padding: 5px;
  15. border: 1px solid #ddd;
  16. border-left: none;
  17. border-right: none;
  18. background-color: white;
  19. }
  20. </style>
  21. @endsection
  22. @section('content')
  23. <body class="gray-bg">
  24. <div class="wrapper wrapper-content animated fadeInRight">
  25. <div class="ibox float-e-margins">
  26. <div class="ibox-title">
  27. @if(in_array($data->status,[3]))
  28. <button class="btn btn-success" onclick="units.pass()">审核通过</button>
  29. <button class="btn btn-warning" onclick="units.noPass()">审核失败</button>
  30. @endif
  31. @if(in_array($data->status,[\App\Http\Models\Article::STATUS_TRANSLATING,\App\Http\Models\Article::STATUS_FAILED]))
  32. <button class="btn btn-info" onclick="units.release()">释放任务</button>
  33. @endif
  34. <button class="btn btn-default closeLayer">关闭页面</button>
  35. </div>
  36. <div class="ibox-title" style="padding-top: 7px;">
  37. <div class="row" style="padding-bottom: 7px;">
  38. <div class="col-sm-4">
  39. <span class="fontBold"> 公司中文名:</span> <span>{{$site->cn_title??''}}</span><br>
  40. <span class="fontBold"> 公司英文名:</span><span>{{$site->en_title??''}}</span><br>
  41. <span class="fontBold"> 公司品牌:</span> <span>{{$siteEnterprise->brand??''}}</span><br>
  42. <span class="fontBold"> 公司网址:</span><span>{{$site->domain??''}}</span><br>
  43. @foreach($data->group??[[]] as $key=>$item)
  44. <span class="fontBold"> 中文关键词:</span><span>{{$item['cn_keyword']??''}}</span><br>
  45. <span class="fontBold"> 英文关键词:</span><span>{{$item['en_keyword']??''}}</span><br>
  46. <span class="fontBold"> 锚点链接:</span><span>{{$item['anchor']??''}}</span><br>
  47. @endforeach
  48. </div>
  49. </div>
  50. <form id="translateForm">
  51. <div class="formHeader">
  52. <div class="row">
  53. <div class="col-sm-4">
  54. <div class="row">
  55. <div class="col-sm-12">
  56. <span
  57. style="width: 80px;display: inline-block;text-align: right">标题:</span><input
  58. type="text" class="form-control"
  59. style="width: calc(100% - 90px);display: inline-block;margin-bottom: 5px"
  60. value="{{$data->translate_title??''}}" name="translate_title">
  61. <span
  62. style="width: 80px;display: inline-block;text-align: right">绑定URI:</span><input
  63. type="text" class="form-control"
  64. style="width: calc(100% - 90px);display: inline-block"
  65. value="{{$data->translate_title2??''}}" name="translate_title2">
  66. </div>
  67. </div>
  68. <div class="col-sm-4">
  69. <button type="button" class="btn btn-primary" id="imageUpload">缩略图</button>
  70. </div>
  71. <div class="col-sm-8">
  72. <div @if (empty($data->thumb))style="display: none"
  73. @endif id="thumb_div">
  74. <div style="position: relative">
  75. <span style="position: absolute;left: 110px;cursor: pointer"
  76. id="delThumb">删除</span>
  77. <img style="height: 80px;" src="{{$data->thumb??''}}">
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <div class="ibox-content" style="background-color: white">
  85. <div class="row">
  86. <div class="col-sm-6">
  87. <div class="ibox ">
  88. <h5>{{$data->title??''}}</h5>
  89. <div class="ibox-content">
  90. <div class="m-b-lg" id="contentView">
  91. {!! $data->content??'' !!}
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. <div class="col-sm-6">
  97. <div class="ibox " style="position: relative">
  98. <script id="translate_content" name="translate_content"
  99. type="text/plain">{!! $data->translate_content??'' !!}</script>
  100. <div class="form-group">
  101. <div class="col-sm-6" style="padding: 10px 0 0">
  102. <button class="btn btn-primary" type="button" onclick="units.save()">
  103. 保存
  104. </button>
  105. <button class="btn btn-default closeLayer" type="button">取消</button>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </form>
  113. </div>
  114. </div>
  115. </div>
  116. </body>
  117. <div class="ibox-content" id="no-pass" style="display: none">
  118. <form class="form-horizontal">
  119. <div class="form-group">
  120. <div class="col-sm-12">
  121. <select class="form-control" name="score">
  122. <option value="">请选择</option>
  123. <option value="非常满意">非常满意</option>
  124. <option value="满意">满意</option>
  125. <option value="不满意">不满意</option>
  126. </select>
  127. </div>
  128. </div>
  129. <div class="form-group">
  130. <div class="col-sm-12">
  131. <textarea class="form-control" style="height: 200px" title=""></textarea>
  132. </div>
  133. </div>
  134. </form>
  135. </div>
  136. <div class="ibox-content" id="pass" style="display: none">
  137. <form class="form-horizontal">
  138. <div class="form-group">
  139. <div class="col-sm-12">
  140. <select class="form-control" name="passScore">
  141. <option value="1">1分</option>
  142. <option value="2">2分</option>
  143. <option value="3">3分</option>
  144. <option value="4">4分</option>
  145. <option value="5" selected>5分</option>
  146. </select>
  147. </div>
  148. </div>
  149. </form>
  150. </div>
  151. @endsection
  152. @section('footer')
  153. @include('vendor.ueditor.assets')
  154. <script src="{{asset('vendor/ueditor/ueditor.parse.js')}}"></script>
  155. <script>
  156. setTimeout(function () {
  157. uParse('#contentView',
  158. {
  159. 'highlightJsUrl': "{{asset('vendor/ueditor/third-party/SyntaxHighlighter/shCore.js')}}",
  160. 'highlightCssUrl': "{{asset('vendor/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css')}}"
  161. })
  162. }, 300);
  163. var ueTranslate = UE.getEditor('translate_content');
  164. ueTranslate.ready(function () {
  165. ueTranslate.setHeight(480);
  166. });
  167. var units = {
  168. pass: function () {
  169. layer.open({
  170. type: 1,
  171. content: $('#pass'),
  172. title: '审核通过',
  173. area: ['400px', '200px'],
  174. btn: ['确认', '取消'],
  175. yes: function (index, layero) {
  176. var passScore = $(layero).find("[name=passScore]").val();
  177. var ajaxConfig = {
  178. url: '/admin/articles/pass',
  179. type: 'put',
  180. data: {ids: ["{{$data->id??''}}"], passScore: passScore},
  181. success: function (result) {
  182. layer.msg(result.message, {icon: 6, time: 1000}, function () {
  183. tips.closeParentLayer();
  184. });
  185. }
  186. };
  187. tips.ajax(ajaxConfig);
  188. }
  189. });
  190. },
  191. noPass: function () {
  192. layer.open({
  193. type: 1,
  194. content: $('#no-pass'),
  195. title: '审核操作',
  196. area: ['400px', '400px'],
  197. btn: ['确认', '取消'],
  198. yes: function (index, layero) {
  199. var fail_reason = $(layero).find("textarea").val();
  200. var ajaxConfig = {
  201. url: '/admin/articles/no-pass',
  202. type: 'put',
  203. data: {ids: ["{{$data->id??''}}"], fail_reason: fail_reason},
  204. success: function (result) {
  205. layer.msg(result.message, {icon: 6, time: 1000}, function () {
  206. layer.close(index);
  207. window.location.reload();
  208. });
  209. }
  210. };
  211. tips.ajax(ajaxConfig);
  212. }
  213. });
  214. },
  215. release: function () {
  216. layer.confirm('您确定要释放该任务吗?', {icon: 3, title: '释放任务'}, function () {
  217. var url = '/admin/articles/' + "{{$data->id??''}}" + '/release';
  218. var ajaxConfig = {
  219. url: url,
  220. type: 'put',
  221. success: function (result) {
  222. layer.msg(result.message, {icon: 6, time: 1000}, function () {
  223. window.location.reload();
  224. });
  225. }
  226. };
  227. tips.ajax(ajaxConfig);
  228. });
  229. },
  230. save: function () {
  231. var url = '/admin/articles/' + "{{$data->id??''}}" + '/translate?admin=1';
  232. var data = tips.getFormValues('#translateForm');
  233. data.status = "{{$data->status}}";
  234. data.thumb = $("#thumb_div").find("img").attr('src');
  235. var ajaxConfig = {
  236. url: url,
  237. type: 'put',
  238. data: data,
  239. success: function (result) {
  240. layer.msg(result.message, {icon: 6, time: 1000}, function () {
  241. tips.closeParentLayer();
  242. window.parent.tips.tableRefresh('#table');
  243. });
  244. }
  245. };
  246. tips.ajax(ajaxConfig);
  247. }
  248. };
  249. $(document).on('click', '#imageUpload', function () {
  250. layer.open({
  251. title: "缩略图上传",
  252. type: 2,
  253. content: '/admin/image/index?siteId={{$site->id}}',
  254. area: ['900px', '530px'],
  255. btn: ['确定', '取消'],
  256. yes: function (index, layero) {
  257. var body = layer.getChildFrame('body', index);
  258. var imgSrc = body.find(".imageActive").find("img").attr('src');
  259. if (imgSrc) {
  260. $("#thumb_div").show().find("img").attr('src', imgSrc);
  261. }
  262. layer.close(index)
  263. }
  264. });
  265. });
  266. $(document).on('click', '#delThumb', function () {
  267. $("#thumb_div").hide().find("img").attr('src', '');
  268. });
  269. </script>
  270. @endsection