natasha vor 1 Jahr
Ursprung
Commit
f4e0109125

+ 2 - 3
src/components/Setting.vue

@@ -543,13 +543,12 @@ export default {
             .then((res) => {
                 this.loading = false
                 if(res.status===1){
+                    this.$emit("getInfo")
                     this.$message({
                         message: '修改成功',
                         type: 'success',
                         duration: 3000
-                    }).then(()=>{
-                        this.$emit("getInfo")
-                    });
+                    })
                 }
             }).catch((res) =>{
                 this.loading = false

+ 4 - 4
src/components/Upload.vue

@@ -132,8 +132,8 @@ export default {
           return false; // 必须返回false
         }
       } else if (this.uploadType === 'mp4') {
-        if (file.size > 500 * 1024 * 1024) {
-          this.$message.warning('上传视频大小不能超过500M');
+        if (file.size > 2000 * 1024 * 1024) {
+          this.$message.warning('上传视频大小不能超过2G');
           return false; // 必须返回false
         }
       }else if(this.uploadType === 'video&radio'){
@@ -141,8 +141,8 @@ export default {
           this.$message.warning('上传文件大小不能超过500M');
           return false; // 必须返回false
         }
-      } else if (file.size > 20 * 1024 * 1024) {
-        this.$message.warning('上传文件大小不能超过20M');
+      } else if (file.size > 200 * 1024 * 1024) {
+        this.$message.warning('上传文件大小不能超过200M');
         return false; // 必须返回false
       }
       this.loading = this.$loading({

+ 3 - 3
src/utils/request.js

@@ -56,7 +56,7 @@ service.interceptors.response.use(
                 message: res.msg || res.error || 'Error',
                 type: 'error',
                 showClose: true,
-                duration: 0
+                duration: 3000
             })
             return Promise.reject(new Error(res.message || res.error || 'Error'))
         } else if (res.status === -1) {
@@ -70,7 +70,7 @@ service.interceptors.response.use(
                 message: '登录会话失效,请重新登录',
                 type: 'error',
                 showClose: true,
-                duration: 0
+                duration: 3000
             })
             if (process.env.NODE_ENV === 'development') {
                 router.push(`/login`)
@@ -79,7 +79,7 @@ service.interceptors.response.use(
             }
             return false
         } else {
-            Message.closeAll()
+            // Message.closeAll()
             return res
         }
     },

+ 1 - 1
src/views/content_manage/course_manage/CreateRecorded.vue

@@ -169,7 +169,7 @@
                             />
                         </el-form-item>
                         <el-form-item label="课节资源" prop="resource">
-                            <upload :datafileList="createCourseForm.resource" :changeFillId="handleAvatarSuccess" :fileName="'courseResource'" :filleNumber="99" tips="支持上传图片、文档、音频、视频等资料,单个最大200MB,总共不超1GB,支持预览功能" :showList="true" />
+                            <upload :datafileList="createCourseForm.resource" :changeFillId="handleAvatarSuccess" :fileName="'courseResource'" :filleNumber="99" tips="支持上传图片、文档、音频、视频等资料,单个最大200MB,支持预览功能" :showList="true" />
                             <ul v-if="createCourseForm.resource.length>0" class="resource-list">
                                 <li v-for="(itemR,indexR) in createCourseForm.resource" :key="indexR">
                                     <a @click="handlePreview(itemR)"><svg-icon :icon-class="itemR.type" class="icon-logo"></svg-icon><span>{{itemR.name}}</span></a>

+ 157 - 65
src/views/content_manage/newspaper_manage/CreateArticle.vue

@@ -2,52 +2,54 @@
   <div class="manage-root create-article">
     <Header/>
     <breadcrumb :breadcrumbList="breadcrumbList" class="breadcrumb-box"></breadcrumb>
-    <div class="manage-root-contain">
+    <div class="manage-root-contain" v-loading="subtitleLoading">
         <div class="manage-root-contain-inner" :style="{height:tableHeight+'px'}">
             <el-form :inline="true" :model="articleForm" :rules="articleRules" ref="articleForm" label-width="100px" class="registerForm" label-position="top">
-                <el-form-item label="标题" prop="title" class="title-box">
-                    <el-input v-model="articleForm.title" autocomplete="off" placeholder="请输入标题" @blur="handleTrim('articleForm','title')" >
+                <el-form-item label="标题" prop="art_title" class="title-box">
+                    <el-input v-model="articleForm.art_title" autocomplete="off" placeholder="请输入标题" @blur="handleTrim('articleForm','art_title')" >
                     </el-input>
                 </el-form-item>
-                <el-form-item label="来源" prop="source" class="source-box">
-                    <el-input v-model="articleForm.source" autocomplete="off" placeholder="请输入来源" @blur="handleTrim('articleForm','source')" >
+                <el-form-item label="来源" prop="art_author" class="source-box">
+                    <el-input v-model="articleForm.art_author" autocomplete="off" placeholder="请输入来源" @blur="handleTrim('articleForm','art_author')" >
                     </el-input>
                 </el-form-item>
-                <el-form-item label="Page" prop="page" class="page-box">
-                    <el-input v-model="articleForm.page" autocomplete="off" placeholder="请输入" type="number" :min="1">
+                <el-form-item label="Page" prop="page_no_in_pub" class="page-box">
+                    <el-input v-model="articleForm.page_no_in_pub" autocomplete="off" placeholder="请输入" type="number" :min="1">
                     </el-input>
                 </el-form-item>
             </el-form>
-            <template v-if="type==='cn'">
-                <Editor
-                    id="article-cn"
-                    v-model="articleForm.articleCn"
-                    :init="init"
-                />
-            </template>
-            <template v-else>
+            <template v-if="en_flag===1">
                 <label class="item-label">课文读音</label>
                 <div class="article-mp3-box">
-                    <ul v-if="articleForm.articleMp3.length>0" class="article-mp3-list">
+                    <ul v-if="articleForm.articleMp3&&articleForm.articleMp3.length>0" class="article-mp3-list">
                         <li v-for="(item,index) in articleForm.articleMp3" :key="index">
                             <a><svg-icon :icon-class="'mp3'" class="icon-logo"></svg-icon><span>{{item.name}}</span></a>
                             <i class="el-icon-error" @click="handleDelResource(index)"></i>
                         </li>
                     </ul>
                     <upload :class="['article-mp3']" :datafileList="articleForm.articleMp3" :changeFillId="handleAvatarSuccess" :fileName="'articleMp3'" uploadType="mp3" tips=' ' :filleNumber="1" :showList="true" />
-                    <el-button type="primary" size="small" @click="handleSubtitle" :loading="subtitleLoading" v-if="!substitleReault">生成字幕</el-button>
+                    <!-- <el-button type="primary" size="small" @click="handleSubtitle" :loading="subtitleLoading" v-if="!substitleReault">生成字幕</el-button>
                     <el-button size="small" @click="handleSubtitle" :loading="subtitleLoading" v-else>重新生成</el-button>
-                    <p class="error-tips"><svg-icon icon-class="error-warning-line"></svg-icon>生成失败</p>
+                    <p class="error-tips"><svg-icon icon-class="error-warning-line"></svg-icon>生成失败</p> -->
                 </div>
-                <el-input
+            </template>
+            <Editor
+                id="article-cn"
+                v-model="articleForm.art_content"
+                :init="init"
+            />
+            <template v-if="en_flag===0">
+            </template>
+            <template v-else>
+                <!-- <el-input
                     style="width: 100%"
                     type="textarea"
                     :autosize="{ minRows: 20 }"
                     placeholder="请输入文章"
                     v-model="articleForm.articleEn"
-                    @blur="onBlur(articleForm, 'articleEn')"
-                ></el-input>
-                <el-form :model="articleRecourseForm" :rules="articleResourceRules" ref="articleResourceForm" label-width="80px" class="registerForm" style="margin-top:16px">
+                    @blur="handleTrim('articleForm', 'articleEn')"
+                ></el-input> -->
+                <el-form :model="articleRecourseForm" ref="articleResourceForm" label-width="80px" class="registerForm" style="margin-top:16px">
                     <el-form-item label="生词" prop="newWordList">
                         <el-button type="primary" size="small" plain class="add-btn"><i class="el-icon-plus"></i> 添加生词</el-button>
                     </el-form-item>
@@ -68,13 +70,13 @@
                                             :preview-src-list="[itemR.url]">
                                         </el-image>
                                         <span>{{itemR.name}}</span>
-                                        <svg-icon icon-class="download" style="cursor: pointer;" @click="handleDownloadPic(itemR.url)"></svg-icon>
+                                        <svg-icon icon-class="download" style="cursor: pointer;" @click="handlePreview(itemR)"></svg-icon>
                                     </div>
                                     <i class="el-icon-delete" @click="handleDelPicture(indexR)"></i>
                                 </li>
                             </ul>   
                         </el-form-item>
-                        <el-divider></el-divider>
+                        <!-- <el-divider></el-divider>
                         <el-form-item label="讲解教师" prop="teacher">
                             <el-input v-model="articleRecourseForm.teacher" autocomplete="off" placeholder="请输入" @blur="handleTrim('articleRecourseForm','teacher')" >
                             </el-input>
@@ -87,13 +89,13 @@
                                     <i class="el-icon-delete" @click="handleDelExplanContent(indexR)"></i>
                                 </li>
                             </ul>   
-                        </el-form-item>
+                        </el-form-item> -->
                 </el-form>
                 
             </template>
         </div>
         <div class="save-btn">
-            <el-button type="primary" size="small" @click="handleSaveArticle('articleForm')" :loading="loading">保存</el-button>
+            <el-button type="primary" size="small" @click="handleSaveArticle('articleForm')" :loading="loading">下一步</el-button>
             <el-button size="small" @click="onCancel('articleForm')">取消</el-button>
         </div>
         <el-button type="primary" size="small" class="preview-btn">预览</el-button>
@@ -147,6 +149,7 @@ import "tinymce/plugins/colorpicker";
 import Upload from "../../../components/Upload.vue"
 const Base64 = require("js-base64").Base64;
 import { mapState } from 'vuex';
+import { getToken } from '@/utils/auth'
 
 export default {
   //import引入的组件需要注入到对象中才能使用
@@ -167,7 +170,7 @@ export default {
     };
     return {
         id:this.$route.query.id?this.$route.query.id:'',
-        type:this.$route.query.type?this.$route.query.type:'cn',
+        en_flag:this.$route.query.en_flag?this.$route.query.en_flag*1:0,
         breadcrumbList:[
             {
                 icon:'file-list-line',
@@ -183,24 +186,24 @@ export default {
             {
                 icon:'',
                 url:'',
-                text:this.$route.query.articleId?'编辑报纸':'创建报纸'
+                text:this.$route.query.isCreate?'创建报纸':'编辑报纸'
             },
             {
                 icon:'',
                 url:'',
-                text:this.$route.query.id?this.$route.query.type==='en'?'编辑英文内容':'编辑中文内容':this.$route.query.type==='en'?'创建英文内容':'创建中文内容'
+                text:this.$route.query.id?this.$route.query.en_flag*1===1?'编辑英文内容':'编辑中文内容':this.$route.query.en_flag*1===1?'创建英文内容':'创建中文内容'
             }
         ],
         tableHeight: "",
         loading: false,
         articleForm: {
-            title:'', // 标题
-            source: '', // 来源
-            page: null, // 页码
-            articleCn: '', // 中文文章
+            art_title:'', // 标题
+            art_author: '', // 来源
+            page_no_in_pub: null, // 页码
+            art_content: '', // 中文文章
             articleEn: '', // 英文文章
             articleMp3: [], // 课文音频
-            articleMp3_id: '', // 音频文件id  
+            articleMp3_id: '', // 音频文件id 
         },
         articleRecourseForm:{
             newWordList: [], // 生词
@@ -211,29 +214,29 @@ export default {
             explanContent: [], // 讲解内容
         },
         articleRules:{
-            title:[
+            art_title:[
                 { required: true, message: '请输入标题', trigger: 'blur' }
             ],
-            source:[
+            art_author:[
                 { required: true, message: '请输入来源', trigger: 'blur' }
             ],
-            page:[
+            page_no_in_pub:[
                 { validator: validatePage, trigger: 'blur' }
             ],
-        },
-        articleResourceRules:{
-            teacher:[
-                { required: true, message: '请输入讲解教师', trigger: 'blur' }
+            art_content: [
+                { required: true, message: '请输入', trigger: 'blur' }
+            ],
+            articleEn:[
+                { required: true, message: '请输入', trigger: 'blur' }
             ],
-            explanContent: [
-                { type: 'array', required: true, message: '请上传讲解内容', trigger: 'change' }
-            ]
         },
         init: null,
         subtitleLoading: false, //生成字幕loading
         substitleReault: false,
         resourceUrl: '', // 课节资源预览地址
         resourceFlag: false,
+        vlInfo: null, // 词表信息
+        articleId: null
     }
   },
   //计算属性 类似于data概念
@@ -254,23 +257,62 @@ export default {
       }
     },
     // 取消 恢复到修改前状态
-    onCancel(formName){
-        this.$refs[formName].resetFields();
+    onCancel(){
+        this.$router.go(-1)
     },
-    handleSaveArticle(formName){
+    handleSaveArticle(formName,flag){
         this.$refs[formName].validate((valid) => {
-          if (valid) {
-
-          } else {
-            return false;
-          }
-        });
-        this.$refs.articleResourceForm.validate((valid) => {
-          if (valid) {
-
-          } else {
-            return false;
-          }
+            if (valid) {
+                let MethodName = '/PaperServer/Manager/ArticleManager/AddArticle'
+                let data = {
+                    art_title: this.articleForm.art_title,
+                    page_no_in_pub: this.articleForm.page_no_in_pub*1,
+                    art_author: this.articleForm.art_author,
+                    art_content: this.articleForm.art_content,
+                    iss_id: this.$route.query.issueId,
+                    chn_item: this.$route.query.chn_name,
+                    en_flag: this.en_flag
+                }
+                if(this.id){
+                    MethodName = '/PaperServer/Manager/ArticleManager/EditArticle'
+                    data.id = this.id,
+                    data.updater_id = JSON.parse(getToken()).user_id
+                }
+                if(!this.articleForm.art_content.trim()){
+                    this.$message.warning('文章内容不能为空')
+                    return false
+                }
+                if(this.en_flag===0){
+                    
+                }else{
+                    data.art_content = this.id?this.articleForm.art_content:null
+                    data.art_org_content = this.articleForm.art_content.trim()
+                    data.art_sounds = this.articleForm.articleMp3_id?[this.articleForm.articleMp3_id]:null
+                    let resource_file_id_list = []
+                    this.articleRecourseForm.pictureList.forEach(item => {
+                        if(item.file_id){
+                            resource_file_id_list.push(item.file_id)
+                        }else if(item.response&&item.response.file_info_list&&item.response.file_info_list[0]){
+                            resource_file_id_list.push(item.response.file_info_list[0].file_id)
+                        }
+                        
+                    });
+                    data.art_images = resource_file_id_list
+                }
+                getLogin(MethodName, data)
+                .then((res) => {
+                    if(res.status===1){
+                        if(flag){
+                            this.articleId = res.data.id
+                        }else{
+                            this.$message.success('文章保存成功')
+                            this.$router.go(-1)
+                        }
+                    }
+                })
+            } else {
+                return false;
+            }
         });
     },
     // 去掉前后空格
@@ -281,6 +323,7 @@ export default {
         if(name==='articleMp3'){
             this.articleForm.articleMp3 = fileList
             this.articleForm.articleMp3_id = fileList[0]&&fileList[0].response&&fileList[0].response.file_info_list&&fileList[0].response.file_info_list[0]?fileList[0].response.file_info_list[0].file_id:''
+            this.$forceUpdate()
         }else if(name==='pictureList'){
             fileList.forEach(item=>{
                 if(item.response&&item.response.file_info_list&&item.response.file_info_list[0]){
@@ -334,6 +377,7 @@ export default {
             type: "warning",
         }).then(() => {
             this.articleForm.articleMp3.splice(i, 1);
+            this.$forceUpdate()
         });
     },
     handleDelPicture(i){
@@ -361,6 +405,7 @@ export default {
     },
     // 下载图片
     handleDownloadPic(url){
+
         window.open(url, "_blank");
     },
     // 预览文件
@@ -372,14 +417,58 @@ export default {
         getLogin(MethodName, data)
         .then((res) => {
             if(res.status===1){
-                let path =
-                `${this.file_preview_url}/onlinePreview?url=` +
-                Base64.encode(res.file_url);
-                this.resourceUrl = path;
-                this.resourceFlag = true
+                window.open(res.file_url, "_blank");
             }
         })
-        
+    },
+    // 获取文章信息
+    getArticleInfo(){
+        this.subtitleLoading = true
+        let MethodName = '/PaperServer/Manager/ArticleManager/FindArticleById'
+        let data = {
+            id: this.id
+        }
+        getLogin(MethodName, data)
+        .then((res) => {
+            if(res.status===1){
+                this.articleForm = JSON.parse(JSON.stringify(res.data.art))
+                this.vlInfo = res.data.vl
+                this.articleForm.articleEn = JSON.parse(JSON.stringify(res.data.art)).art_org_content
+                if(res.data.art.art_sounds&&res.data.art.art_sounds.length>0){
+                    this.articleForm.articleMp3_id = res.data.art.art_sounds[0]
+                    getLogin('/FileServer/GetFileInfo', {file_id:res.data.art.art_sounds[0]})
+                    .then((res) => {
+                        if(res.status===1){
+                            this.articleForm.articleMp3=[{
+                                name:res.file_name,
+
+                            }]
+                        }
+                    })
+                }else{
+                    this.articleForm.articleMp3_id = ''
+                    this.articleForm.articleMp3 = []
+                }
+                this.articleRecourseForm.pictureList = []
+                if(res.data.art.art_images&&res.data.art.art_images.length>0){
+                    res.data.art.art_images.forEach(item=>{
+                        getLogin('/FileServer/GetFileInfo', {file_id:item})
+                        .then((res) => {
+                            if(res.status===1){
+                                this.articleRecourseForm.pictureList.push({
+                                    name:res.file_name,
+                                    url:res.file_url,
+                                    file_id: item
+                                })
+                            }
+                        })
+                    })
+                }
+                this.subtitleLoading = false
+            }
+        }).catch(()=>{
+            this.subtitleLoading = false
+        })
     },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -408,6 +497,9 @@ export default {
             "preview bold italic underline strikethrough | fontsizeselect | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent blockquote | undo redo | link unlink image code | removeformat",
         branding: false,
     }; //富文本初始化
+    if(this.id){
+        this.getArticleInfo()
+    }
   },
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {

+ 189 - 115
src/views/content_manage/newspaper_manage/CreateNewspaper.vue

@@ -110,7 +110,7 @@
                             <el-input
                                 type="textarea"
                                 :rows="4"
-                                readonly="readonly"
+                                disabled
                                 style="margin-top: 20px"
                                 v-model="newspaperForm.chn_data_str">
                             </el-input>
@@ -186,45 +186,54 @@
                     </el-form>
                 </template>
                 <div v-if="stepIndex===1">
-                    <div class="issue-channel">
+                    <div class="issue-channel" v-if="issueChannel">
                         <div class="issue-top">
                             <h4 class="issue-top-left">
                                 栏目
-                                <span>共 {{issueChannel.channelNumber}} 个栏目 {{issueChannel.articleNumber}} 篇文章</span>
+                                <span>共 {{issueChannel.chn_count}} 个栏目 {{issueChannel.art_count}} 篇文章</span>
                             </h4>
                             <el-button type="primary" size="small">预览</el-button>
                         </div>
-                        <div class="channel-item" v-for="(item,index) in issueChannel.channelList" :key="index">
+                        <div class="channel-item" v-for="(item,index) in issueChannel.chn_art_data" :key="index">
                             <div class="channel-top">
                                 <i class="el-icon-caret-bottom" v-if="item.show" @click="item.show=!item.show"></i>
                                 <i class="el-icon-caret-top" v-else @click="item.show=!item.show"></i>
-                                <span @click="item.show=!item.show">{{item.channelName}}</span>
-                                <el-button type="text" @click="handleArticle('','en')"><i class="el-icon-plus"></i>新增英文内容</el-button>
-                                <el-button type="text" @click="handleArticle('','cn')"><i class="el-icon-plus"></i>新增中文内容</el-button>
+                                <div class="channel-top-name">
+                                    <template v-if="!item.editFlag">
+                                        <span>{{item.chn_name}}</span>
+                                        <svg-icon icon-class="edit" class="edit-chn-name" @click="item.editFlag = true"></svg-icon>
+                                    </template>
+                                    <template v-else>
+                                        <el-input v-model="item.edit_name"></el-input>
+                                        <svg-icon icon-class="save-line" class="edit-chn-name" @click="saveChnDate(item.edit_name,index)"></svg-icon>
+                                    </template>
+                                </div>
+                                <el-button type="text" @click="handleArticle('',1,item.chn_name)"><i class="el-icon-plus"></i>新增英文内容</el-button>
+                                <el-button type="text" @click="handleArticle('',0,item.chn_name)"><i class="el-icon-plus"></i>新增中文内容</el-button>
                             </div>
                             <el-collapse-transition>
                                 <template v-if="item.show">
                                     <draggable
-                                        v-model="item.articleList"
+                                        v-model="item.arts"
                                         chosenClass="chosen"
                                         forceFallback="true"
                                         group="people"
                                         animation="1000"
                                         @start="onStart"
-                                        @end="onEnd"
+                                        @end="onEnd()"
                                         class="article-list"
                                     >
-                                        <li v-for="(itema,indexa) in item.articleList" :key="indexa">
+                                        <li v-for="(itema,indexa) in item.arts" :key="indexa">
                                             <svg-icon icon-class="sort" draggable="true"></svg-icon>
                                             <div class="items">
-                                                <h6>{{itema.title}}</h6>
-                                                <span>BY {{itema.author}}</span>
-                                                <span>创建人:{{itema.creator}}</span>
-                                                <span>{{itema.time}}</span>
+                                                <h6>{{itema.art_title}}</h6>
+                                                <span>BY {{itema.art_author}}</span>
+                                                <span>创建人:{{itema.creator_real_name||itema.creator_user_name}}</span>
+                                                <span>{{itema.create_time}}</span>
                                             </div>
-                                            <svg-icon icon-class="edit" class="edit-article" @click="handleArticle(itema.id,itema.type)"></svg-icon>
+                                            <svg-icon icon-class="edit" class="edit-article" @click="handleArticle(itema.id,itema.en_flag,item.chn_name)"></svg-icon>
                                             <span class="border"></span>
-                                            <i class="el-icon-delete" @click="handleDeleteArticle(item.articleList,indexa)"></i>
+                                            <i class="el-icon-delete" @click="handleDeleteArticle(item.arts,indexa,itema.id)"></i>
                                         </li>
                                     </draggable>
                                 </template>
@@ -411,77 +420,7 @@ export default {
         tplList: [], // 栏目列表
         tabsList:['中英双语','少儿必读'],
         issueId: '',
-        issueChannel:{
-            channelNumber: '12',
-            articleNumber: '4',
-            channelList:[
-                {
-                    channelName: 'FRONT PAGE',
-                    articleList: [
-                        {
-                            title: 'Silly science',
-                            author: 'TEENS',
-                            creator: '张老师',
-                            time: '2012-12-12 12:23',
-                            id: '123',
-                            type: 'cn'
-                        },
-                        {
-                            title: 'Silly science1',
-                            author: 'TEENS',
-                            creator: '张老师',
-                            time: '2012-12-12 12:23',
-                            id: '123',
-                            type: 'en'
-                        },
-                        {
-                            title: 'Silly science2',
-                            author: 'TEENS',
-                            creator: '张老师',
-                            time: '2012-12-12 12:23',
-                            id: '123'
-                        },
-                        {
-                            title: 'Silly science3',
-                            author: 'TEENS',
-                            creator: '张老师',
-                            time: '2012-12-12 12:23'
-                        }
-                    ],
-                    show: true
-                },
-                {
-                    channelName: 'STORY LAND', 
-                    articleList: [],
-                    show: false
-                },
-                {
-                    channelName: 'STORY LAND', 
-                    articleList: [],
-                    show: false
-                },
-                {
-                    channelName: 'STORY LAND', 
-                    articleList: [],
-                    show: false
-                },
-                {
-                    channelName: 'STORY LAND', 
-                    articleList: [],
-                    show: false
-                },
-                {
-                    channelName: 'STORY LAND', 
-                    articleList: [],
-                    show: false
-                },
-                {
-                    channelName: 'STORY LAND', 
-                    articleList: [],
-                    show: false
-                },
-            ]
-        },
+        issueChannel: null,
         drag: false,
         loading: false
     }
@@ -510,7 +449,7 @@ export default {
                     }
                 });
             }else if(this.stepIndex===1){
-                this.stepIndex++
+                this.handleEditIssue()
             }
         }
     },
@@ -561,13 +500,19 @@ export default {
         }
       });
     },
-    handleDeleteArticle(item,i){
+    handleDeleteArticle(item,i,id){
         this.$confirm("确定删除吗?", "提示", {
             confirmButtonText: "确定",
             cancelButtonText: "取消",
             type: "warning",
         }).then(() => {
             item.splice(i, 1);
+            getLogin('/PaperServer/Manager/ArticleManager/DeleteArticle', {id:id})
+            .then((res) => {
+                if(res.status===1){
+                this.vendorList = res.data
+                }
+            })
         });
     },
     // 去掉前后空格
@@ -653,18 +598,82 @@ export default {
             chn_data: JSON.parse(form.chn_data),
             with_addon_flag: form.with_addon_flag
         }
-        if(this.id){
-            MethodName = "/PaperServer/Manager/IssueManager/EditIssue"
-            data.id = this.id
+        if(this.id||this.issueId){
+            this.loading = false
+            this.stepIndex++
+            return false
         }
         getLogin(MethodName, data)
         .then((res) => {
             this.loading = false
             if(res.status===1){
-               window.localStorage.removeItem('newsForm')
-               window.localStorage.removeItem('newsStep')
-               this.issueId = res.data.id
-               this.stepIndex++
+                window.localStorage.removeItem('newsForm')
+                window.localStorage.removeItem('newsStep')
+                this.issueId = res.data.id
+                this.stepIndex++
+                let chn_art_data = JSON.parse(JSON.stringify(res.data.chn_art_data))
+                chn_art_data.forEach((item,index)=>{
+                    if(index===0){
+                        item.show = true
+                    }else{
+                        item.show = false
+                    }
+                })
+                this.issueChannel = {
+                    chn_count: res.data.chn_count,
+                    art_count: res.data.art_count,
+                    chn_art_data: chn_art_data
+                }
+            }
+        })
+        .catch(() => {
+            this.loading = false
+        });
+    },
+    handleEditIssue(){
+        this.loading = true
+        let MethodName = "/PaperServer/Manager/IssueManager/EditIssue";
+        let form = this.newspaperForm
+        let data = {
+            iss_cover_id: form.cover_image_id,
+            iss_name: form.iss_name,
+            vendor_name: form.vendor_name,
+            release_date: form.release_date,
+            comb_flag: form.comb_flag,
+            iss_no:form.comb_flag===0?form.iss_no:form.iss_no_start,
+            study_phase: form.study_phase,
+            vl_id: form.vl_id,
+            iss_price_org: form.iss_price_org,
+            iss_price_sell: this.newspaperForm.has_discount===1?form.iss_price_sell:form.iss_price_org,
+            with_addon_price_org: form.with_addon_price_org,
+            with_addon_price_sell: this.newspaperForm.has_discount_addon===1?form.with_addon_price_sell:form.with_addon_price_org,
+            iss_note: form.iss_note,
+            info_tag_data: form.info_tag_data,
+            chn_data: JSON.parse(form.chn_data),
+            with_addon_flag: form.with_addon_flag,
+            id: this.id?this.id:this.issueId,
+            chn_art_data: this.issueChannel.chn_art_data
+        }
+        getLogin(MethodName, data)
+        .then((res) => {
+            this.loading = false
+            if(res.status===1){
+                window.localStorage.removeItem('newsForm')
+                window.localStorage.removeItem('newsStep')
+                this.stepIndex++
+                let chn_art_data = JSON.parse(JSON.stringify(res.data.chn_art_data))
+                chn_art_data.forEach((item,index)=>{
+                    if(index===0){
+                        item.show = true
+                    }else{
+                        item.show = false
+                    }
+                })
+                this.issueChannel = {
+                    chn_count: res.data.chn_count,
+                    art_count: res.data.art_count,
+                    chn_art_data: chn_art_data
+                }
             }
         })
         .catch(() => {
@@ -674,7 +683,7 @@ export default {
     getInfo(){
         let MethodName = "/PaperServer/Manager/IssueManager/FindIssueById"
         let data = {
-            id: this.id
+            id: this.id?this.id:this.issueId
         }
         getLogin(MethodName, data)
         .then((res) => {
@@ -685,18 +694,26 @@ export default {
                 this.newspaperForm.chn_data_str = JSON.parse(res.data.chn_data).join('\n')
                 this.newspaperForm.cover_image_id = res.data.iss_cover_id
                 this.newspaperForm.iss_no_start = res.data.iss_no
-                getLogin('/FileServer/GetFileInfo', {
-                    file_id: res.data.iss_cover_id
-                })
-                .then((res) => {
-                    if(res.status===1){
-                        this.newspaperForm.cover_image_url = res.file_url
-                        this.$forceUpdate()
+                if(res.data.iss_cover_id){
+                    if(res.data.iss_cover_id.indexOf('http')===-1){
+                        getLogin('/FileServer/GetFileInfo', {
+                            file_id: res.data.iss_cover_id
+                        })
+                        .then((res) => {
+                            if(res.status===1){
+                                this.newspaperForm.cover_image_url = res.file_url
+                                this.$forceUpdate()
+                            }
+                        })
+                    }else{
+                        this.newspaperForm.cover_image_url = res.data.iss_cover_id
                     }
-                })
-                this.newspaperForm.cover_image_list.push[{
-                    id: res.data.iss_cover_id
-                }]
+                    
+                    this.newspaperForm.cover_image_list.push[{
+                        id: res.data.iss_cover_id
+                    }]
+                }
+                
                 if(res.data.iss_price_org===res.data.iss_price_sell){
                     this.$set(this.newspaperForm,'has_discount',0)
                 }else{
@@ -707,21 +724,41 @@ export default {
                 }else{
                     this.$set(this.newspaperForm,'has_discount_addon',1)
                 }
+                let chn_art_data = JSON.parse(JSON.stringify(res.data.chn_art_data))
+                chn_art_data.forEach((item,index)=>{
+                    if(!item.hasOwnProperty('arts')){
+                        this.$set(item,'arts',[])
+                    }
+                    item.editFlag = false
+                    item.edit_name = item.chn_name
+                    if(index===0){
+                        item.show = this.issueChannel&&this.issueChannel.chn_art_data&&this.issueChannel.chn_art_data[index]?this.issueChannel.chn_art_data[index].show:true
+                    }else{
+                        item.show = this.issueChannel&&this.issueChannel.chn_art_data&&this.issueChannel.chn_art_data[index]?this.issueChannel.chn_art_data[index].show:false
+                    }
+                })
+                this.issueChannel = {
+                    chn_count: res.data.chn_count,
+                    art_count: res.data.art_count,
+                    chn_art_data: chn_art_data
+                }
             }
         })
         .catch(() => {
         });
     },
     // 跳转文章
-    handleArticle(id,type){
+    handleArticle(id,type,name){
         window.localStorage.setItem('newsForm',JSON.stringify(this.newspaperForm))
         window.localStorage.setItem('newsStep',1)
         this.$router.push({
             path:'/createArticle',
             query: {
                 id: id,
-                type: type,
-                articleId: this.id
+                en_flag: type?type:0,
+                issueId: this.id?this.id:this.issueId,
+                chn_name: name,
+                isCreate: !this.id?true:''
             }
         })
     },
@@ -732,7 +769,37 @@ export default {
     //拖拽结束事件
     onEnd() {
       this.drag = false;
+      this.issueChannel.chn_art_data.forEach((item)=>{
+        if(item.arts&&item.arts.length>0){
+            item.arts.forEach((items,indexs)=>{
+                items.art_idx = indexs
+            })
+        }
+      })
+      this.handleUpdateChnArtData()
+    },
+    // 更新栏目数据
+    handleUpdateChnArtData(){
+        getLogin('/PaperServer/Manager/IssueManager/EditIssueChnArtData', {
+            chn_art_data: this.issueChannel.chn_art_data,
+            id: this.id?this.id:this.issueId
+        })
+        .then((res) => {
+            if(res.status===1){
+                this.getInfo()
+            }
+        })
     },
+    saveChnDate(value,index){
+        // 判断是否有值并且trim
+        if(value&&value.trim()){
+            this.issueChannel.chn_art_data[index].chn_name = value.trim()
+            this.onEnd()
+        }else{
+            this.$message.warning('栏目名称不能为空')
+        }
+        // if(this.issueChannel.chn_art_data[index].)
+    }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   async created() {
@@ -879,7 +946,8 @@ export default {
         margin: 12px 0;
         .channel-top{
             display: flex;
-            padding: 9px 12px;
+            padding: 0 12px;
+            height: 42px;
             align-items: center;
             .el-icon-caret-bottom,.el-icon-caret-top{
                 color: #4E5969;
@@ -887,15 +955,18 @@ export default {
                 height: 14px;
                 cursor: pointer;
             }
-            span{
+            &-name{
                 margin-left: 6px;
                 flex: 1;
-                cursor: pointer;
                 word-break: break-word;
                 color: #1D2129;
                 font-size: 14px;
                 font-weight: 400;
                 line-height: 22px;
+                .edit-chn-name{
+                    margin-left: 4px;
+                    cursor: pointer;
+                }
             }
             .el-button--text{
                 padding: 2px 12px;
@@ -927,6 +998,9 @@ export default {
                 }
                 .edit-article{
                     cursor: pointer;
+                    padding: 8px;
+                    width: 32px;
+                    height: 32px;
                 }
                 .items{
                     flex: 1;
@@ -951,11 +1025,11 @@ export default {
                     width: 1px;
                     display: block;
                     background: #E5E6EB;
-                    margin: 0 8px;
                 }
                 .el-icon-delete{
                     font-weight: bold;
                     cursor: pointer;
+                    padding: 8px;
                 }
             }
         }

+ 6 - 3
src/views/content_manage/newspaper_manage/index.vue

@@ -283,7 +283,10 @@ export default {
         pageNumber: window.localStorage.getItem('pageNumber')?Number(window.localStorage.getItem('pageNumber')):1,
         tableHeight: "", // 表格高度
         total_count: 0,
-        dataSort: {}
+        dataSort: {
+            prop:'update_time',
+            order: 'descending'
+        }
     }
   },
   //计算属性 类似于data概念
@@ -440,13 +443,13 @@ export default {
                 })
             }else{
                 order_column_list = [{
-                    name: 'create_time',
+                    name: 'update_time',
                     asc: false
                 }]
             }
         }else{
             order_column_list = [{
-                name: 'create_time',
+                name: 'update_time',
                 asc: false
             }]
         }

+ 15 - 8
src/views/organize_manage/PersonList.vue

@@ -471,6 +471,7 @@ export default {
         if(page){
             this.pageNumber = page
         }
+        this.getInfo()
         let MethodName = "/OrgServer/Manager/PageQuery/PageQueryPersonList";
         let order_column_list = []
         if(this.tabsIndex===0){
@@ -565,8 +566,12 @@ export default {
         data.is_enable = "false";
       }
       getLogin(Mname, data).then(res => {
-        this.$message.success("操作成功");
         this.getList()
+        this.$message({
+            message: '操作成功',
+            type: 'success',
+            duration: 3000
+        })
       });
     },
     // 通过 拒绝
@@ -585,8 +590,12 @@ export default {
         data.is_pass = "false";
       }
       getLogin(Mname, data).then(res => {
-        this.$message.success("操作成功");
         this.getList()
+        this.$message({
+            message: '操作成功',
+            type: 'success',
+            duration: 3000
+        })
       });
     },
     handleSizeChange(val,type,page) {
@@ -610,14 +619,14 @@ export default {
     },
     // 删除
     handleDelete(row,arr){
+        if(!row&&arr.length===0){
+            return false
+        }
         this.$confirm('确定删除吗?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
-            if(!row&&arr.length===0){
-                return false
-            }
             let Mname = "/OrgServer/Manager/PersonManager/BatchDeleteOrgPerson";
             let data = {
                 org_id: this.id,
@@ -650,7 +659,6 @@ export default {
     closeDialog(){
         this.importFlag = false
         this.getList()
-        this.getInfo()
     },
     // 获取机构信息
     getInfo(){
@@ -697,10 +705,9 @@ export default {
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
-    this.getList()
     this.getTableHeight();
     if(this.id){
-        this.getInfo()
+        this.getList()
     }
   },
   //生命周期 - 挂载完成(可以访问DOM元素)

+ 1 - 0
src/views/people_manage/index.vue

@@ -323,6 +323,7 @@ export default {
       getLogin(Mname, data).then(res => {
         this.$message.success("操作成功");
         this.$set(this.tableData, index, updataData);
+        this.getList()
       });
     },
     handleSizeChange(val) {