Xiahai 10 місяців тому
батько
коміт
aef3e5ed69

+ 86 - 55
application/api/controller/User.php

@@ -512,6 +512,28 @@ class User extends Api
             if (!$params['reviewer']) $this->error('Reviewer Cannot be Empty');
         }
 
+        // TODO 作者信息为空时则返回
+        foreach ($params['author'] as $key => $author) {
+            if (!$author['email']) {
+                $this->error('The email address of the ' . ($key + 1) . ' author cannot be empty');
+            }
+            if (!$author['first_name']) {
+                $this->error('The first name of the ' . ($key + 1) . ' author cannot be empty');
+            }
+            if (!$author['display_email']) {
+                $this->error('The display email name of the ' . ($key + 1) . ' author cannot be empty');
+            }
+            if (!$author['correspondsing_author']) {
+                $this->error('The correspondsing author name of the ' . ($key + 1) . ' author cannot be empty');
+            }
+            if (!$author['author_affiliation']) {
+                $this->error('The author affiliation author name of the ' . ($key + 1) . ' author cannot be empty');
+            }
+            if (!$author['author_country']) {
+                $this->error('The author country author name of the ' . ($key + 1) . ' author cannot be empty');
+            }
+        }
+
         // 修改
         if ($params['id']) {
             // 修改操作
@@ -942,7 +964,7 @@ class User extends Api
     }
 
     /**
-     * 提交手稿(未全部提交)
+     * 提交手稿(未全部提交、实时
      *
      * @return void
      */
@@ -965,6 +987,29 @@ class User extends Api
             }
             $params['status'] = 'incomplete_submission';
             $params['user_id'] = $this->auth->id;
+
+            // TODO 作者信息为空时则返回
+            foreach ($params['author'] as $key => $author) {
+                if (!$author['email']) {
+                    $this->success('Success', $params['id']);
+                }
+                if (!$author['first_name']) {
+                    $this->success('Success', $params['id']);
+                }
+                if (!$author['display_email']) {
+                    $this->success('Success', $params['id']);
+                }
+                if (!$author['correspondsing_author']) {
+                    $this->success('Success', $params['id']);
+                }
+                if (!$author['author_affiliation']) {
+                    $this->success('Success', $params['id']);
+                }
+                if (!$author['author_country']) {
+                    $this->success('Success', $params['id']);
+                }
+            }
+
             // 因使用create方法返回自增id,但是验证字段有前端自定义字段所以需要删除
             unset($params['author']);
             unset($params['reviewer']);
@@ -1087,80 +1132,66 @@ class User extends Api
         $manuscript_id = $this->request->param('manuscript_id');
         $manuscript = AuthorManuscript::get($manuscript_id);
         $reviewers = InviteReviewer::where(['manuscript_id' => $manuscript_id])->select();
-        // 邀请的审稿人信息
-        if ($status == 'reviewer_details') {
-            foreach ($reviewers as $reviewer) {
-                $reviewer_role = UserRoleContent::where(['id' => $reviewer['role_id']])->find();
+        // 邀请的审稿人信息{
+        foreach ($reviewers as $reviewer) {
+            $reviewer_role = UserRoleContent::where(['id' => $reviewer['role_id']])->field('user_id, affiliation')->find();
+            if ($reviewer_role) {
+                // 查询审稿人提交意见信息
+                $reviewer_comment = Comments::where(['user_id' => $reviewer_role['user_id'], 'manuscript_id' => $manuscript_id])
+                    ->order('createtime', 'DESC')
+                    ->field('createtime, recommendation, comments, id, is_send')
+                    ->find();
+                // 查询审稿人提交意见数量
+                $reviewer_comment_num = Comments::where(['user_id' => $reviewer_role['user_id'], 'manuscript_id' => $manuscript_id])
+                    ->count();
+                $reviewer_user = \app\admin\model\User::where(['id' => $reviewer_role['user_id']])->find();
+                if ($reviewer_comment) {
+                    $reviewer['reply_time'] = date('Y-m-d', $reviewer_comment['createtime'] ?? time());
+                    $reviewer['submission_time'] = date('Y-m-d', $reviewer_comment['createtime'] ?? time());
+                    $reviewer['status'] = $reviewer_comment['recommendation'] ?? '';
+                    $reviewer['createtime'] = date('Y-m-d', $reviewer_comment['createtime']);
+                }
+            }
+            if ($status == 'reviewer_details') {
                 $reviewer['reply_time'] = '';
                 $reviewer['submission_time'] = '';
-                if ($reviewer_role) {
-                    // 查询审稿人提交意见信息
-                    $reviewer_comment = Comments::where(['user_id' => $reviewer_role['user_id'], 'manuscript_id' => $manuscript_id])
-                        ->order('createtime', 'DESC')
-                        ->find();
-                    $reviewer_user = \app\admin\model\User::where(['id' => $reviewer_role['user_id']])->find();
-                    if ($reviewer_comment) {
-                        $reviewer['reply_time'] = date('Y-m-d', $reviewer_comment['createtime'] ?? time());
-                        $reviewer['submission_time'] = date('Y-m-d', $reviewer_comment['createtime'] ?? time());
-                        $reviewer['status'] = $reviewer_comment['recommendation'] ?? '';
-                    }
-                }
                 $reviewer['nickname'] = $reviewer_user['nickname'];
                 $reviewer['invited_time'] = date('Y-m-d', $reviewer['createtime']);
             }
-        }
-        // 审稿人信息
-        if ($status == 'reviewer_suggestion') {
-            foreach ($reviewers as $reviewer) {
-                $reviewer_role = UserRoleContent::where(['id' => $reviewer['role_id']])->find();
-                if ($reviewer_role) {
-                    // 查询审稿人提交意见数量
-                    $reviewer_comment_num = Comments::where(['user_id' => $reviewer_role['user_id'], 'manuscript_id' => $manuscript_id])
-                        ->count();
-                    $reviewer_user = \app\admin\model\User::where(['id' => $reviewer_role['user_id']])->find();
-                }
+
+            // 审稿人信息
+            if ($status == 'reviewer_suggestion') {
                 $reviewer['nickname'] = $reviewer_user['nickname'];
                 $reviewer['affiliation'] = $reviewer_role['affiliation'];
                 $reviewer['comment_num'] = $reviewer_comment_num;
             }
-        }
 
-        // 审稿人意见信息
-        if ($status == 'review_report') {
-            foreach ($reviewers as $reviewer) {
-                $reviewer_role = UserRoleContent::where(['id' => $reviewer['role_id']])->find();
+            // 审稿人意见信息
+            if ($status == 'review_report') {
                 $reviewer['createtime'] = '';
-                if ($reviewer_role) {
-                    // 查询审稿人提交意见信息
-                    $reviewer_comment = Comments::where(['user_id' => $reviewer_role['user_id'], 'manuscript_id' => $manuscript_id])
-                        ->order('createtime', 'DESC')
-                        ->find();
-                    $reviewer_user = \app\admin\model\User::where(['id' => $reviewer_role['user_id']])->find();
-                    if ($reviewer_comment) {
-                        $reviewer['createtime'] = date('Y-m-d', $reviewer_comment['createtime']);
-                    }
-                }
                 $reviewer['nickname'] = $reviewer_user['nickname'];
                 $reviewer['recommendation'] = $reviewer_comment['recommendation'] ?? '';
                 $reviewer['comment'] = $reviewer_comment['comments'] ?? '';
                 $reviewer['comment_id'] = $reviewer_comment['id'] ?? '';
                 $reviewer['is_send'] = $reviewer_comment['is_send'] ?? '';
             }
-        }
 
-        // 作者回复意见
-        if ($status == 'author_report') {
-            // 查询作者提交意见信息回复
-            $author_comment = Comments::where(['user_id' => $manuscript_id, 'manuscript_id' => $manuscript_id, 'type' => 'author'])
-                ->order('createtime', 'DESC')
-                ->find();
-            if ($author_comment) {
-                $author_user = \app\admin\model\User::where(['id' => $manuscript['user_id']])->find();
-                $author['nickname'] = $author_user['nickname'] ?? '';
-                $author['comment'] = $author_comment['comments'] ?? '';
-                $author['createtime'] = date('Y-m-d', $author_comment['createtime']);
+            // 作者回复意见
+            if ($status == 'author_report') {
+                // 查询作者提交意见信息回复
+                $author_comment = Comments::where(['user_id' => $manuscript_id, 'manuscript_id' => $manuscript_id, 'type' => 'author'])
+                    ->order('createtime', 'DESC')
+                    ->field('comments, createtime')
+                    ->find();
+                if ($author_comment) {
+                    $author_user = \app\admin\model\User::where(['id' => $manuscript['user_id']])->find();
+                    $author['nickname'] = $author_user['nickname'] ?? '';
+                    $author['comment'] = $author_comment['comments'] ?? '';
+                    $author['createtime'] = date('Y-m-d', $author_comment['createtime']);
+                }
             }
         }
+
         $data['reviewer'] = $reviewers;
         $data['author'] = $author ?? [];
         $data['user_id'] = $manuscript['user_id'];

Різницю між файлами не показано, бо вона завелика
+ 0 - 0
application/extra/site.php


+ 93 - 87
application/index/view/user/submit_manuscript.html

@@ -375,13 +375,15 @@
                         <!-- 作者信息 -->
                         <div class="form-item add-author-content" id="box" style="display: none">
                             {if condition="!$row.id"}
-                            <div class="add-author-item pt-4">
-                                <div class="form-group author-content-button-item">
-                                    <div class="author-sort-button text-sort-button text-button">
-                                        <i class="fa fa-sort"></i> Sort
+                            <div class="add-author-item">
+                                <div class="author-content-button-item">
+                                    <div class="author-sort-number">
+                                        <i class="fa fa-angle-down"></i> <span class="author-sort-number-text">Author 1</span>
                                     </div>
-                                    <div class="author-delete-button text-delete-button text-button">
-                                        <i class="fa fa-trash"></i> Delete
+                                    <div class="author-operate-button">
+                                        <div class="author-delete-button text-delete-button text-button">
+                                            <i class="fa fa-trash"></i> Delete
+                                        </div>
                                     </div>
                                 </div>
                                 <div class="form-group">
@@ -475,104 +477,108 @@
                             </div>
                             {else}
                             {foreach name="row.author_content" item="author"}
-                            <div class="add-author-item">
-                                <div class="form-group author-content-button-item">
-                                    <div class="author-sort-button text-sort-button text-button">
-                                        <i class="fa fa-sort"></i> Sort
-                                    </div>
-                                    <div class="author-delete-button text-delete-button text-button">
-                                        <i class="fa fa-trash"></i> Delete
+                            <label draggable="true" style="width: 100%">
+                                <div class="add-author-item">
+                                    <div class="author-content-button-item">
+                                        <div class="author-sort-number">
+                                            <i class="fa fa-angle-down"></i> <span class="author-sort-number-text">Author {$key + 1}</span>
+                                        </div>
+                                        <div class="author-operate-button">
+                                            <div class="author-delete-button text-delete-button text-button">
+                                                <i class="fa fa-trash"></i> Delete
+                                            </div>
+                                        </div>
                                     </div>
-                                </div>
-                                <div class="form-group">
-                                    <label class="control-label col-xs-12 col-sm-4">
-                                        <span style="color:#ed534b;margin-right: 10px;">*</span>Institution E-Mail Address:
-                                    </label>
-                                    <div class="col-xs-12 col-sm-8">
-                                        <input type="text" data-rule="required" class="form-control" id="c-email" name="row[author][{$key}][email]" value="{$author.email}" placeholder="Type here...">
-                                        <div class="input-group-addon no-border no-padding">
-                                            <span class="msg-box n-right" for="c-email"></span>
+                                    <div class="form-group">
+                                        <label class="control-label col-xs-12 col-sm-4">
+                                            <span style="color:#ed534b;margin-right: 10px;">*</span>Institution E-Mail Address:
+                                        </label>
+                                        <div class="col-xs-12 col-sm-8">
+                                            <input type="text" data-rule="required" class="form-control" id="c-email" name="row[author][{$key}][email]" value="{$author.email}" placeholder="Type here...">
+                                            <div class="input-group-addon no-border no-padding">
+                                                <span class="msg-box n-right" for="c-email"></span>
+                                            </div>
                                         </div>
                                     </div>
-                                </div>
-                                <div class="form-group">
-                                    <label class="control-label col-xs-12 col-sm-4">
-                                        <span style="color:#ed534b;margin-right: 10px;">*</span>First Name:
-                                    </label>
-                                    <div class="col-xs-12 col-sm-8">
-                                        <input type="text" data-rule="required" class="form-control" id="c-first-name" name="row[author][{$key}][first_name]" value="{$author.first_name}" placeholder="Type here...">
-                                        <div class="input-group-addon no-border no-padding">
-                                            <span class="msg-box n-right" for="c-first_name"></span>
+                                    <div class="form-group">
+                                        <label class="control-label col-xs-12 col-sm-4">
+                                            <span style="color:#ed534b;margin-right: 10px;">*</span>First Name:
+                                        </label>
+                                        <div class="col-xs-12 col-sm-8">
+                                            <input type="text" data-rule="required" class="form-control" id="c-first-name" name="row[author][{$key}][first_name]" value="{$author.first_name}" placeholder="Type here...">
+                                            <div class="input-group-addon no-border no-padding">
+                                                <span class="msg-box n-right" for="c-first_name"></span>
+                                            </div>
                                         </div>
                                     </div>
-                                </div>
-                                <div class="form-group">
-                                    <label class="control-label col-xs-12 col-sm-4">
-                                        Middle Name:
-                                    </label>
-                                    <div class="col-xs-12 col-sm-8">
-                                        <input type="text" class="form-control" id="c-middle-name" name="row[author][{$key}][middle_name]" value="{$author.middle_name}" placeholder="Type here...">
+                                    <div class="form-group">
+                                        <label class="control-label col-xs-12 col-sm-4">
+                                            Middle Name:
+                                        </label>
+                                        <div class="col-xs-12 col-sm-8">
+                                            <input type="text" class="form-control" id="c-middle-name" name="row[author][{$key}][middle_name]" value="{$author.middle_name}" placeholder="Type here...">
+                                        </div>
                                     </div>
-                                </div>
-                                <div class="form-group">
-                                    <label class="control-label col-xs-12 col-sm-4">
-                                        Last Name:
-                                    </label>
-                                    <div class="col-xs-12 col-sm-8">
-                                        <input type="text" class="form-control" id="c-last-name" name="row[author][{$key}][last_name]" value="{$author.last_name}" placeholder="Type here...">
+                                    <div class="form-group">
+                                        <label class="control-label col-xs-12 col-sm-4">
+                                            Last Name:
+                                        </label>
+                                        <div class="col-xs-12 col-sm-8">
+                                            <input type="text" class="form-control" id="c-last-name" name="row[author][{$key}][last_name]" value="{$author.last_name}" placeholder="Type here...">
+                                        </div>
                                     </div>
-                                </div>
-                                <div class="form-group">
-                                    <label class="control-label col-xs-12 col-sm-4">
-                                        <span style="color:#ed534b;margin-right: 10px;">*</span>Display E-Mail:
-                                    </label>
-                                    <div class="col-xs-12 col-sm-8">
-                                        <div class="input-group mb-3">
-                                            <div class="radio radio-inline pl-0">
-                                                <label for="c-e-mail-yes-{$key}"><input data-rule="required" id="c-e-mail-yes-{$key}" name="row[author][{$key}][display_email]" type="radio" value="yes" {if condition="$author.display_email == 'yes'"}checked{/if} />Yes</label>
-                                                <label for="c-e-mail-no-{$key}"><input data-rule="required" id="c-e-mail-no-{$key}" name="row[author][{$key}][display_email]" type="radio" value="no" {if condition="$author.display_email == 'no'"}checked{/if} />No</label>
+                                    <div class="form-group">
+                                        <label class="control-label col-xs-12 col-sm-4">
+                                            <span style="color:#ed534b;margin-right: 10px;">*</span>Display E-Mail:
+                                        </label>
+                                        <div class="col-xs-12 col-sm-8">
+                                            <div class="input-group mb-3">
+                                                <div class="radio radio-inline pl-0">
+                                                    <label for="c-e-mail-yes-{$key}"><input data-rule="required" id="c-e-mail-yes-{$key}" name="row[author][{$key}][display_email]" type="radio" value="yes" {if condition="$author.display_email == 'yes'"}checked{/if} />Yes</label>
+                                                    <label for="c-e-mail-no-{$key}"><input data-rule="required" id="c-e-mail-no-{$key}" name="row[author][{$key}][display_email]" type="radio" value="no" {if condition="$author.display_email == 'no'"}checked{/if} />No</label>
+                                                </div>
                                             </div>
                                         </div>
                                     </div>
-                                </div>
-                                <div class="form-group">
-                                    <label class="control-label col-xs-12 col-sm-4">
-                                        <span style="color:#ed534b;margin-right: 10px;">*</span>Correspondsing Author:
-                                    </label>
-                                    <div class="col-xs-12 col-sm-8">
-                                        <div class="input-group mb-3">
-                                            <div class="radio radio-inline pl-0">
-                                                <label for="c-correspondsing-author-yes-{$key}"><input data-rule="required" id="c-correspondsing-author-yes-{$key}" name="row[author][{$key}][correspondsing_author]" type="radio" value="yes" {if condition="$author.correspondsing_author == 'yes'"}checked{/if} />Yes</label>
-                                                <label for="c-correspondsing-author-no-{$key}"><input data-rule="required" id="c-correspondsing-author-no-{$key}" name="row[author][{$key}][correspondsing_author]" type="radio" value="no" {if condition="$author.correspondsing_author == 'no'"}checked{/if} />No</label>
+                                    <div class="form-group">
+                                        <label class="control-label col-xs-12 col-sm-4">
+                                            <span style="color:#ed534b;margin-right: 10px;">*</span>Correspondsing Author:
+                                        </label>
+                                        <div class="col-xs-12 col-sm-8">
+                                            <div class="input-group mb-3">
+                                                <div class="radio radio-inline pl-0">
+                                                    <label for="c-correspondsing-author-yes-{$key}"><input data-rule="required" id="c-correspondsing-author-yes-{$key}" name="row[author][{$key}][correspondsing_author]" type="radio" value="yes" {if condition="$author.correspondsing_author == 'yes'"}checked{/if} />Yes</label>
+                                                    <label for="c-correspondsing-author-no-{$key}"><input data-rule="required" id="c-correspondsing-author-no-{$key}" name="row[author][{$key}][correspondsing_author]" type="radio" value="no" {if condition="$author.correspondsing_author == 'no'"}checked{/if} />No</label>
+                                                </div>
                                             </div>
                                         </div>
                                     </div>
-                                </div>
-                                <div class="form-group">
-                                    <label class="control-label col-xs-12 col-sm-4">
-                                        <span style="color:#ed534b;margin-right: 10px;">*</span>Affiliation:
-                                    </label>
-                                    <div class="col-xs-12 col-sm-8">
-                                        <input data-rule="required" type="text" class="form-control" id="c-author-affiliation" name="row[author][{$key}][author_affiliation]" value="{$author.author_affiliation}" placeholder="Type here...">
-                                        <div class="input-group-addon no-border no-padding">
-                                            <span class="msg-box n-right" for="c-author-affiliation"></span>
+                                    <div class="form-group">
+                                        <label class="control-label col-xs-12 col-sm-4">
+                                            <span style="color:#ed534b;margin-right: 10px;">*</span>Affiliation:
+                                        </label>
+                                        <div class="col-xs-12 col-sm-8">
+                                            <input data-rule="required" type="text" class="form-control" id="c-author-affiliation" name="row[author][{$key}][author_affiliation]" value="{$author.author_affiliation}" placeholder="Type here...">
+                                            <div class="input-group-addon no-border no-padding">
+                                                <span class="msg-box n-right" for="c-author-affiliation"></span>
+                                            </div>
                                         </div>
                                     </div>
-                                </div>
-                                <div class="form-group">
-                                    <label class="control-label col-xs-12 col-sm-4">
-                                        <span style="color:#ed534b;margin-right: 10px;">*</span>Country / Temitory:
-                                    </label>
-                                    <div class="col-xs-12 col-sm-8">
-                                        <select id="c-author_country" data-rule="required" class="form-control" name="row[author][{$key}][author_country]">
-                                            <option value="">Please select</option>
-                                            {foreach name="site.country" item="vo"}
-                                            <option value="{$key}" {in name="key" value="$author.author_country" }selected{/in}>{$vo}</option>
-                                            {/foreach}
-                                        </select>
+                                    <div class="form-group">
+                                        <label class="control-label col-xs-12 col-sm-4">
+                                            <span style="color:#ed534b;margin-right: 10px;">*</span>Country / Temitory:
+                                        </label>
+                                        <div class="col-xs-12 col-sm-8">
+                                            <select id="c-author_country" data-rule="required" class="form-control" name="row[author][{$key}][author_country]">
+                                                <option value="">Please select</option>
+                                                {foreach name="site.country" item="vo"}
+                                                <option value="{$key}" {in name="key" value="$author.author_country" }selected{/in}>{$vo}</option>
+                                                {/foreach}
+                                            </select>
+                                        </div>
                                     </div>
                                 </div>
-                            </div>
+                            </label>
                             {/foreach}
                             {/if}
                         </div>

+ 24 - 5
public/assets/css/user/submit_manuscript.css

@@ -165,11 +165,6 @@
     height: 520px;
     border: 1px dashed #497BFF;
 }
-.author-content-button-item {
-    padding-right:20px;
-    display: flex;
-    justify-content: flex-end;
-}
 ul {
     list-style-type: none;
 }
@@ -177,5 +172,29 @@ ul {
     position: relative;
 }
 .add-author-item {
+    overflow: hidden;
     z-index: 1;
+    padding-bottom: 10px;
+    padding-right: 10px;
+    border: 1px solid #cccccc;
+    transition: height 0.2s;
+}
+.author-content-button-item {
+    width: 102%;
+    display: flex;
+    justify-content: space-between;
+    padding-top: 10px;
+    padding-bottom: 10px;
+    padding-right:20px;
+    background-color: #fafafa;
+    margin-bottom: 20px;
+}
+.author-sort-number {
+    padding-left: 40px;
+    width: 50%;
+}
+.author-operate-button {
+    display: flex;
+    width: 50%;
+    justify-content: flex-end;
 }

+ 211 - 159
public/assets/js/frontend/user.js

@@ -549,7 +549,7 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                 $(document).on('click', '.author-delete-button', function () {
                     let author_content_length = $('.add-author-content').children('.add-author-item').length;
                     if (author_content_length > 1) {
-                        $(this).parent().parent().remove();
+                        $(this).parent().parent().parent().remove();
 
                         // 删除后更新 input 的 name 值
                         updateInputNames();
@@ -1077,13 +1077,14 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                 // let input_index = author_content_length - 1;
                 // 克隆作者信息
                 let str = `<div class="add-author-item div">
-                                <hr style="background: #B8B8B8;">
-                                <div class="form-group author-content-button-item">
-                                    <div class="author-sort-button text-sort-button text-button">
-                                        <i class="fa fa-sort"></i> Sort
+                                <div class="author-content-button-item">
+                                    <div class="author-sort-number">
+                                        <i class="fa fa-angle-down"></i> <span class="author-sort-number-text">Author ${input_index + 1}</span>
                                     </div>
-                                    <div class="author-delete-button text-delete-button text-button">
-                                        <i class="fa fa-trash"></i> Delete
+                                    <div class="author-operate-button">
+                                        <div class="author-delete-button text-delete-button text-button">
+                                            <i class="fa fa-trash"></i> Delete
+                                        </div>
                                     </div>
                                 </div>
                                 <div class="form-group">
@@ -1193,7 +1194,7 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
 
             // 排序input 的 name 值
             function updateInputNames() {
-                drags('add-author-item', 'div-dash', 'dash');
+                // drags('add-author-item', 'div-dash', 'dash');
 
                 // 遍历所有的div元素
                 $(".add-author-item").each(function (index) {
@@ -1219,150 +1220,152 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                     correspondsing_author_yes_radio.attr('name', "row[author][" + index + "][correspondsing_author]");
                     correspondsing_author_no_radio.attr('name', "row[author][" + index + "][correspondsing_author]");
 
+                    $(this).find('.author-sort-number-text').html('Author' + (index + 1));
+
                     select.attr('name', "row[author][" + index + "][author_country]");
                 });
             };
 
             // 拖拽初始化
-            drags('add-author-item', 'div-dash', 'dash');
+            // drags('add-author-item', 'div-dash', 'dash');
 
             // 拖拽方法
-            function drags(name, name2, name3) {
-                var range = {x: 0, y: 0}; // 鼠标元素偏移量
-                var lastPos = {x: 0, y: 0, x1: 0, y1: 0}; // 拖拽对象的四个坐标
-                var tarPos = {x: 0, y: 0, x1: 0, y1: 0}; // 目标元素对象的坐标初始化
-                var thidDiv = null, move = false, choose = false; // 拖拽对象 拖拽状态 选中状态
-                //拖拽对象的索引、高度、的初始化。
-                var thidDivWidth = 0, thidDivHeight = 0, thidDivHalfW = 0, thidDivHalfH = 0, tarFirstX = 0,
-                    tarFirstY = 0;
-                var tarDiv = null, tarFirst, tempDiv; // 要插入的目标元素的对象, 临时的虚线对象
-                var initPos = {x: 0, y: 0};  // 记录拖拽元素初始鼠标元素偏移量
-
-                // 当鼠标按下时
-                $('.' + name).on('mousedown', function (event) {
-                    console.log(event.target.tagName);
-                    // 判断是否点击了 input 元素
-                    if (event.target.tagName === 'INPUT') {
-                        return;
-                    }
-
-                    if (event.target.tagName === 'SELECT') {
-                        return;
-                    }
-
-                    if (event.target.tagName === 'LABEL') {
-                        return;
-                    }
-
-                    // 判断如果鼠标是删除按钮则终止拖拽
-                    let class_name = event.target.className.split(" ");
-                    if (class_name[0] == 'author-delete-button') {
-                        return;
-                    }
-
-                    choose = true;
-                    // 拖拽对象
-                    thidDiv = $(this);
-                    // 记录拖拽元素初始位置
-                    initPos.x = thidDiv.offset().left;
-                    initPos.y = thidDiv.offset().top;
-                    // 鼠标元素相对偏移量
-                    range.x = event.pageX - thidDiv.offset().left;
-                    range.y = event.pageY - thidDiv.offset().top;
-
-                    thidDivWidth = thidDiv.width();
-                    thidDivHeight = thidDiv.height();
-                    thidDivHalfW = thidDivWidth / 2;
-                    thidDivHalfH = thidDivHeight / 2;
-                    thidDiv.attr("class", name2);
-                    thidDiv.css({
-                        left: (event.pageX + range.x) + 'px',
-                        top: (event.pageY + range.y) + 'px',
-                    });
-
-                    // 创建新元素 插入拖拽元素之前的位置(虚线框)
-                    $("<div class='" + name3 + "' style='float: right;'></div>").insertBefore(thidDiv);
-                    tempDiv = $("." + name3);
-                });
-
-                // 当鼠标抬起时
-                $(document).on('mouseup', function (event) {
-                    if (!choose) {
-                        return false;
-                    }
-
-                    if (!move) {
-                        thidDiv.attr("class", name);
-                        tempDiv.remove(); // 删除新建的虚线div
-                        choose = false;
-                        return false;
-                    }
-
-                    thidDiv.insertBefore(tempDiv); // 拖拽元素插入到 虚线div的位置上
-                    thidDiv.attr("class", name); //恢复对象的初始样式
-                    tempDiv.remove(); // 删除新建的虚线div
-                    move = false;
-                    choose = false;
-
-                    // 当鼠标移动时
-                }).on('mousemove', function (event) {
-
-                    if (!choose) return false;
-
-                    move = true;
-                    lastPos.x = event.pageX - range.x;
-                    lastPos.y = event.pageY - range.y;
-                    lastPos.x1 = lastPos.x + thidDivWidth;
-                    lastPos.y1 = lastPos.y + thidDivHeight;
-                    // 拖拽元素随鼠标移动
-                    thidDiv.css({
-                        left: lastPos.x - custom_mousemove_x + 'px',
-                        top: lastPos.y - custom_mousemove_y + 'px'
-                    });
-                    // 拖拽元素随鼠标移动 查找插入目标元素
-                    var $main = $('.' + name); // 局部变量:按照重新排列过的顺序 再次获取 各个元素的坐标,
-
-                    $main.each(function () {
-
-                        tarDiv = $(this);
-                        tarPos.x = tarDiv.offset().left;
-                        tarPos.y = tarDiv.offset().top;
-                        tarPos.x1 = tarPos.x + tarDiv.width() / 2;
-                        tarPos.y1 = tarPos.y + tarDiv.height() / 2;
-                        tarFirst = $main.eq(0); // 获得第一个元素
-                        tarFirstX = tarFirst.offset().left + thidDivHalfW; // 第一个元素对象的中心纵坐标
-                        tarFirstY = tarFirst.offset().top + thidDivHalfH; // 第一个元素对象的中心横坐标
-
-                        // 根据 拖拽对象x坐标 与 目标元素对象x坐标 对比,来显示 虚线div 在节点前、后出现的位置
-                        if (lastPos.x > tarPos.x) {
-
-                            // 判断要插入目标元素的 坐标后, 直接插入
-                            if (lastPos.x >= tarPos.x - thidDivHalfW && lastPos.x1 >= tarPos.x1 && lastPos.y >= tarPos.y - thidDivHalfH && lastPos.y1 >= tarPos.y1) {
-                                tempDiv.insertAfter(tarDiv);
-                            }
-
-                            //拖拽对象 移动到第一个位置
-                            if (lastPos.x <= tarFirstX && lastPos.y <= tarFirstY) {
-                                tempDiv.insertBefore(tarFirst);
-                            }
-
-                        } else {
-
-                            //拖拽对象 移动到第一个位置
-                            if (lastPos.x <= tarFirstX && lastPos.y <= tarFirstY) {
-                                tempDiv.insertBefore(tarFirst);
-                            }
-
-                            // 判断要插入目标元素的 坐标后, 直接插入
-                            if (lastPos.x >= tarPos.x - thidDivHalfW && lastPos.x1 >= tarPos.x1 && lastPos.y >= tarPos.y - thidDivHalfH && lastPos.y1 >= tarPos.y1) {
-                                tempDiv.insertAfter(tarDiv);
-                            }
-
-                        }
-
-                    });
-                });
-            }
+            // function drags(name, name2, name3) {
+            //     var range = {x: 0, y: 0}; // 鼠标元素偏移量
+            //     var lastPos = {x: 0, y: 0, x1: 0, y1: 0}; // 拖拽对象的四个坐标
+            //     var tarPos = {x: 0, y: 0, x1: 0, y1: 0}; // 目标元素对象的坐标初始化
+            //     var thidDiv = null, move = false, choose = false; // 拖拽对象 拖拽状态 选中状态
+            //     //拖拽对象的索引、高度、的初始化。
+            //     var thidDivWidth = 0, thidDivHeight = 0, thidDivHalfW = 0, thidDivHalfH = 0, tarFirstX = 0,
+            //         tarFirstY = 0;
+            //     var tarDiv = null, tarFirst, tempDiv; // 要插入的目标元素的对象, 临时的虚线对象
+            //     var initPos = {x: 0, y: 0};  // 记录拖拽元素初始鼠标元素偏移量
+            //
+            //     // 当鼠标按下时
+            //     $('.' + name).on('mousedown', function (event) {
+            //         console.log(event.target.tagName);
+            //         // 判断是否点击了 input 元素
+            //         if (event.target.tagName === 'INPUT') {
+            //             return;
+            //         }
+            //
+            //         if (event.target.tagName === 'SELECT') {
+            //             return;
+            //         }
+            //
+            //         if (event.target.tagName === 'LABEL') {
+            //             return;
+            //         }
+            //
+            //         // 判断如果鼠标是删除按钮则终止拖拽
+            //         let class_name = event.target.className.split(" ");
+            //         if (class_name[0] == 'author-delete-button') {
+            //             return;
+            //         }
+            //
+            //         choose = true;
+            //         // 拖拽对象
+            //         thidDiv = $(this);
+            //         // 记录拖拽元素初始位置
+            //         initPos.x = thidDiv.offset().left;
+            //         initPos.y = thidDiv.offset().top;
+            //         // 鼠标元素相对偏移量
+            //         range.x = event.pageX - thidDiv.offset().left;
+            //         range.y = event.pageY - thidDiv.offset().top;
+            //
+            //         thidDivWidth = thidDiv.width();
+            //         thidDivHeight = thidDiv.height();
+            //         thidDivHalfW = thidDivWidth / 2;
+            //         thidDivHalfH = thidDivHeight / 2;
+            //         thidDiv.attr("class", name2);
+            //         thidDiv.css({
+            //             left: (event.pageX + range.x) + 'px',
+            //             top: (event.pageY + range.y) + 'px',
+            //         });
+            //
+            //         // 创建新元素 插入拖拽元素之前的位置(虚线框)
+            //         $("<div class='" + name3 + "' style='float: right;'></div>").insertBefore(thidDiv);
+            //         tempDiv = $("." + name3);
+            //     });
+            //
+            //     // 当鼠标抬起时
+            //     $(document).on('mouseup', function (event) {
+            //         if (!choose) {
+            //             return false;
+            //         }
+            //
+            //         if (!move) {
+            //             thidDiv.attr("class", name);
+            //             tempDiv.remove(); // 删除新建的虚线div
+            //             choose = false;
+            //             return false;
+            //         }
+            //
+            //         thidDiv.insertBefore(tempDiv); // 拖拽元素插入到 虚线div的位置上
+            //         thidDiv.attr("class", name); //恢复对象的初始样式
+            //         tempDiv.remove(); // 删除新建的虚线div
+            //         move = false;
+            //         choose = false;
+            //
+            //         // 当鼠标移动时
+            //     }).on('mousemove', function (event) {
+            //
+            //         if (!choose) return false;
+            //
+            //         move = true;
+            //         lastPos.x = event.pageX - range.x;
+            //         lastPos.y = event.pageY - range.y;
+            //         lastPos.x1 = lastPos.x + thidDivWidth;
+            //         lastPos.y1 = lastPos.y + thidDivHeight;
+            //         // 拖拽元素随鼠标移动
+            //         thidDiv.css({
+            //             left: lastPos.x - custom_mousemove_x + 'px',
+            //             top: lastPos.y - custom_mousemove_y + 'px'
+            //         });
+            //         // 拖拽元素随鼠标移动 查找插入目标元素
+            //         var $main = $('.' + name); // 局部变量:按照重新排列过的顺序 再次获取 各个元素的坐标,
+            //
+            //         $main.each(function () {
+            //
+            //             tarDiv = $(this);
+            //             tarPos.x = tarDiv.offset().left;
+            //             tarPos.y = tarDiv.offset().top;
+            //             tarPos.x1 = tarPos.x + tarDiv.width() / 2;
+            //             tarPos.y1 = tarPos.y + tarDiv.height() / 2;
+            //             tarFirst = $main.eq(0); // 获得第一个元素
+            //             tarFirstX = tarFirst.offset().left + thidDivHalfW; // 第一个元素对象的中心纵坐标
+            //             tarFirstY = tarFirst.offset().top + thidDivHalfH; // 第一个元素对象的中心横坐标
+            //
+            //             // 根据 拖拽对象x坐标 与 目标元素对象x坐标 对比,来显示 虚线div 在节点前、后出现的位置
+            //             if (lastPos.x > tarPos.x) {
+            //
+            //                 // 判断要插入目标元素的 坐标后, 直接插入
+            //                 if (lastPos.x >= tarPos.x - thidDivHalfW && lastPos.x1 >= tarPos.x1 && lastPos.y >= tarPos.y - thidDivHalfH && lastPos.y1 >= tarPos.y1) {
+            //                     tempDiv.insertAfter(tarDiv);
+            //                 }
+            //
+            //                 //拖拽对象 移动到第一个位置
+            //                 if (lastPos.x <= tarFirstX && lastPos.y <= tarFirstY) {
+            //                     tempDiv.insertBefore(tarFirst);
+            //                 }
+            //
+            //             } else {
+            //
+            //                 //拖拽对象 移动到第一个位置
+            //                 if (lastPos.x <= tarFirstX && lastPos.y <= tarFirstY) {
+            //                     tempDiv.insertBefore(tarFirst);
+            //                 }
+            //
+            //                 // 判断要插入目标元素的 坐标后, 直接插入
+            //                 if (lastPos.x >= tarPos.x - thidDivHalfW && lastPos.x1 >= tarPos.x1 && lastPos.y >= tarPos.y - thidDivHalfH && lastPos.y1 >= tarPos.y1) {
+            //                     tempDiv.insertAfter(tarDiv);
+            //                 }
+            //
+            //             }
+            //
+            //         });
+            //     });
+            // }
 
             $.fn.serializeObject = function () {
                 var obj = {};
@@ -1381,24 +1384,28 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                 return obj;
             };
 
+            // 实时保存
             $(document).on('mouseup', function () {
                 let values = $('#submit-manuscript-form').serializeObject();
-                $.ajax({
-                    url: '/api/user/incomplete_submit',
-                    type: 'POST',
-                    dataType: 'json',
-                    data: values,
-                    success: function (res) {
-                        // 如果保存了就代表接下来都是修改,所以记录返回的id
-                        if (res.code == 1) {
-                            $('#c-manuscript_id').val(res.data);
+                if (index != 2) {
+                    $.ajax({
+                        url: '/api/user/incomplete_submit',
+                        type: 'POST',
+                        dataType: 'json',
+                        data: values,
+                        success: function (res) {
+                            // 如果保存了就代表接下来都是修改,所以记录返回的id
+                            if (res.code == 1) {
+                                $('#c-manuscript_id').val(res.data);
+                            }
+                        },
+                        error: function (xhr, status, error) {
+                            top.window.Toastr.error('Save failed');
                         }
-                    },
-                    error: function (xhr, status, error) {
-                        top.window.Toastr.error('Save failed');
-                    }
-                });
+                    });
+                }
             })
+
             // 单选框选择显示对应input
             $(document).on('click', '.radio-inline', function () {
                 let copyright_files_value = $("input[name='row[is_copyright]']:checked").val();
@@ -1430,6 +1437,51 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                 }
             });
 
+            // 折叠作者文本
+            $(document).on('click', '.author-content-button-item', function () {
+                var content = $(this).parent('.add-author-item')[0];
+                content.style.height = content.offsetHeight === 520 ? 42 + 'px' : 520 + 'px';
+
+                // 改为图片向上
+                if (content.style.height == '42px') {
+                    $(this).children('.author-sort-number').children('.fa').attr('class', 'fa fa-angle-up');
+                }
+
+                // 改为图片向下
+                if (content.style.height == '520px') {
+                    $(this).children('.author-sort-number').children('.fa').attr('class', 'fa fa-angle-down');
+                }
+            });
+
+            var moveItem = document.getElementsByTagName('label');
+
+            for (let i = 0; i < moveItem.length; i++) {
+                //动态设置label元素id
+                moveItem[i].setAttribute('id', 'label' + i);
+                moveItem[i].ondragstart = function (ev) {
+                    //dataTransfer.setData() 方法设置被拖数据的数据类型和值
+                    ev.dataTransfer.setData("Text", this.id);
+                };
+            }
+
+            //右-〉左
+            document.getElementById('box').ondragover = function (ev) {
+                ev.preventDefault(); //阻止向上冒泡
+            }
+            document.getElementById('box').ondrop = function (ev) {
+                ev.preventDefault();
+                var id = ev.dataTransfer.getData('Text');
+                var elem = document.getElementById(id);
+                var toElem = ev.toElement.id;
+                if (toElem == 'box') {
+                    //如果为container,元素放置在末尾
+                    this.appendChild(elem);
+                } else {
+                    //如果为container里的元素,则插入该元素之前
+                    this.insertBefore(elem, document.getElementById(toElem));
+                }
+            }
+
             Form.api.bindevent($("#submit-manuscript-form"), function () {
                 setTimeout(function () {
                     location.href = '/index/user/display_submitted';

Деякі файли не було показано, через те що забагато файлів було змінено