123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317 |
- @extends('admin/layout')
- @section('header')
- <style>
- .summary::after {
- content: '';
- display: block;
- clear: both;
- }
- .fontBold {
- font-size: 14px;
- font-weight: 600;
- }
- .formHeader {
- padding: 5px;
- border: 1px solid #ddd;
- border-left: none;
- border-right: none;
- background-color: white;
- }
- </style>
- @endsection
- @section('content')
- <body class="gray-bg">
- <div class="wrapper wrapper-content animated fadeInRight">
- <div class="ibox float-e-margins">
- <div class="ibox-title">
- @if(in_array($data->status,[3]))
- <button class="btn btn-success" onclick="units.pass()">审核通过</button>
- <button class="btn btn-warning" onclick="units.noPass()">审核失败</button>
- @endif
- @if(in_array($data->status,[\App\Http\Models\Article::STATUS_TRANSLATING,\App\Http\Models\Article::STATUS_FAILED]))
- <button class="btn btn-info" onclick="units.release()">释放任务</button>
- @endif
- <button class="btn btn-default closeLayer">关闭页面</button>
- </div>
- <div class="ibox-title" style="padding-top: 7px;">
- <div class="row" style="padding-bottom: 7px;">
- <div class="col-sm-4">
- <span class="fontBold"> 公司中文名:</span> <span>{{$site->cn_title??''}}</span><br>
- <span class="fontBold"> 公司英文名:</span><span>{{$site->en_title??''}}</span><br>
- <span class="fontBold"> 公司品牌:</span> <span>{{$siteEnterprise->brand??''}}</span><br>
- <span class="fontBold"> 公司网址:</span><span>{{$site->domain??''}}</span><br>
- @foreach($data->group??[[]] as $key=>$item)
- <span class="fontBold"> 中文关键词:</span><span>{{$item['cn_keyword']??''}}</span><br>
- <span class="fontBold"> 英文关键词:</span><span>{{$item['en_keyword']??''}}</span><br>
- <span class="fontBold"> 锚点链接:</span><span>{{$item['anchor']??''}}</span><br>
- @endforeach
- </div>
- </div>
- <form id="translateForm">
- <div class="formHeader">
- <div class="row">
- <div class="col-sm-4">
- <div class="row">
- <div class="col-sm-12">
- <span
- style="width: 80px;display: inline-block;text-align: right">标题:</span><input
- type="text" class="form-control"
- style="width: calc(100% - 90px);display: inline-block;margin-bottom: 5px"
- value="{{$data->translate_title??''}}" name="translate_title">
- <span
- style="width: 80px;display: inline-block;text-align: right">绑定URI:</span><input
- type="text" class="form-control"
- style="width: calc(100% - 90px);display: inline-block"
- value="{{$data->translate_title2??''}}" name="translate_title2">
- </div>
- </div>
- <div class="col-sm-4">
- <button type="button" class="btn btn-primary" id="imageUpload">缩略图</button>
- </div>
- <div class="col-sm-8">
- <div @if (empty($data->thumb))style="display: none"
- @endif id="thumb_div">
- <div style="position: relative">
- <span style="position: absolute;left: 110px;cursor: pointer"
- id="delThumb">删除</span>
- <img style="height: 80px;" src="{{$data->thumb??''}}">
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="ibox-content" style="background-color: white">
- <div class="row">
- <div class="col-sm-6">
- <div class="ibox ">
- <h5>{{$data->title??''}}</h5>
- <div class="ibox-content">
- <div class="m-b-lg" id="contentView">
- {!! $data->content??'' !!}
- </div>
- </div>
- </div>
- </div>
- <div class="col-sm-6">
- <div class="ibox " style="position: relative">
- <script id="translate_content" name="translate_content"
- type="text/plain">{!! $data->translate_content??'' !!}</script>
- <div class="form-group">
- <div class="col-sm-6" style="padding: 10px 0 0">
- <button class="btn btn-primary" type="button" onclick="units.save()">
- 保存
- </button>
- <button class="btn btn-default closeLayer" type="button">取消</button>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </body>
- <div class="ibox-content" id="no-pass" style="display: none">
- <form class="form-horizontal">
- <div class="form-group">
- <div class="col-sm-12">
- <select class="form-control" name="score">
- <option value="">请选择</option>
- <option value="非常满意">非常满意</option>
- <option value="满意">满意</option>
- <option value="不满意">不满意</option>
- </select>
- </div>
- </div>
- <div class="form-group">
- <div class="col-sm-12">
- <textarea class="form-control" style="height: 200px" title=""></textarea>
- </div>
- </div>
- </form>
- </div>
- <div class="ibox-content" id="pass" style="display: none">
- <form class="form-horizontal">
- <div class="form-group">
- <div class="col-sm-12">
- <select class="form-control" name="passScore">
- <option value="1">1分</option>
- <option value="2">2分</option>
- <option value="3">3分</option>
- <option value="4">4分</option>
- <option value="5" selected>5分</option>
- </select>
- </div>
- </div>
- </form>
- </div>
- @endsection
- @section('footer')
- @include('vendor.ueditor.assets')
- <script src="{{asset('vendor/ueditor/ueditor.parse.js')}}"></script>
- <script>
- setTimeout(function () {
- uParse('#contentView',
- {
- 'highlightJsUrl': "{{asset('vendor/ueditor/third-party/SyntaxHighlighter/shCore.js')}}",
- 'highlightCssUrl': "{{asset('vendor/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css')}}"
- })
- }, 300);
- var ueTranslate = UE.getEditor('translate_content');
- ueTranslate.ready(function () {
- ueTranslate.setHeight(480);
- });
- var units = {
- pass: function () {
- layer.open({
- type: 1,
- content: $('#pass'),
- title: '审核通过',
- area: ['400px', '200px'],
- btn: ['确认', '取消'],
- yes: function (index, layero) {
- var passScore = $(layero).find("[name=passScore]").val();
- var ajaxConfig = {
- url: '/admin/articles/pass',
- type: 'put',
- data: {ids: ["{{$data->id??''}}"], passScore: passScore},
- success: function (result) {
- layer.msg(result.message, {icon: 6, time: 1000}, function () {
- tips.closeParentLayer();
- });
- }
- };
- tips.ajax(ajaxConfig);
- }
- });
- },
- noPass: function () {
- layer.open({
- type: 1,
- content: $('#no-pass'),
- title: '审核操作',
- area: ['400px', '400px'],
- btn: ['确认', '取消'],
- yes: function (index, layero) {
- var fail_reason = $(layero).find("textarea").val();
- var ajaxConfig = {
- url: '/admin/articles/no-pass',
- type: 'put',
- data: {ids: ["{{$data->id??''}}"], fail_reason: fail_reason},
- success: function (result) {
- layer.msg(result.message, {icon: 6, time: 1000}, function () {
- layer.close(index);
- window.location.reload();
- });
- }
- };
- tips.ajax(ajaxConfig);
- }
- });
- },
- release: function () {
- layer.confirm('您确定要释放该任务吗?', {icon: 3, title: '释放任务'}, function () {
- var url = '/admin/articles/' + "{{$data->id??''}}" + '/release';
- var ajaxConfig = {
- url: url,
- type: 'put',
- success: function (result) {
- layer.msg(result.message, {icon: 6, time: 1000}, function () {
- window.location.reload();
- });
- }
- };
- tips.ajax(ajaxConfig);
- });
- },
- save: function () {
- var url = '/admin/articles/' + "{{$data->id??''}}" + '/translate?admin=1';
- var data = tips.getFormValues('#translateForm');
- data.status = "{{$data->status}}";
- data.thumb = $("#thumb_div").find("img").attr('src');
- var ajaxConfig = {
- url: url,
- type: 'put',
- data: data,
- success: function (result) {
- layer.msg(result.message, {icon: 6, time: 1000}, function () {
- tips.closeParentLayer();
- window.parent.tips.tableRefresh('#table');
- });
- }
- };
- tips.ajax(ajaxConfig);
- }
- };
- $(document).on('click', '#imageUpload', function () {
- layer.open({
- title: "缩略图上传",
- type: 2,
- content: '/admin/image/index?siteId={{$site->id}}',
- area: ['900px', '530px'],
- btn: ['确定', '取消'],
- yes: function (index, layero) {
- var body = layer.getChildFrame('body', index);
- var imgSrc = body.find(".imageActive").find("img").attr('src');
- if (imgSrc) {
- $("#thumb_div").show().find("img").attr('src', imgSrc);
- }
- layer.close(index)
- }
- });
- });
- $(document).on('click', '#delThumb', function () {
- $("#thumb_div").hide().find("img").attr('src', '');
- });
- </script>
- @endsection
|