Parcourir la source

发布视频模块的开发

xiaoming_global il y a 5 ans
Parent
révision
264485734c

+ 34 - 8
src/api/act/submitinfo.js Voir le fichier

1
 import request from '@/utils/request'
1
 import request from '@/utils/request'
2
 
2
 
3
-export function submitForm (params){
4
-    //console.log("文章列表",params)
3
+export function submitForm (data){
4
+    console.log("文章列表",data)
5
     return request({
5
     return request({
6
         url: '/api/acticle/createacticle',
6
         url: '/api/acticle/createacticle',
7
-        method: 'Get',
8
-        params: params
7
+        method: 'Post',
8
+        data: data
9
     })
9
     })
10
 }
10
 }
11
 
11
 
43
      })
43
      })
44
 }
44
 }
45
 
45
 
46
-export function EditArticleCategory(MenuId,data){
46
+export function EditArticleCategory(id,data){
47
+    console.log("abc",data)
47
     return request({
48
     return request({
48
-        url:'/api/acticle/edit?MenuId='+MenuId,
49
-        method:'put',
50
-        data,data
49
+        url:'/api/acticle/edit?id='+id,
50
+        method:'Post',
51
+        data:data
52
+    })
53
+}
54
+
55
+export function DeleteCategorys(data){
56
+     return request({
57
+         url:'/api/acticle/delete',
58
+         method:'delete',
59
+         data:data
60
+     })
61
+}
62
+
63
+export function addVido(data){
64
+    console.log("发布视频",data)
65
+    return request({
66
+        url:"/api/acticle/addvido",
67
+        method:"post",
68
+        data:data,
69
+    })
70
+}
71
+
72
+export function Savedraft(data){
73
+    return request({
74
+        url:"/api/acticle/savedraft",
75
+        method:"post",
76
+        data:data,
51
     })
77
     })
52
 }
78
 }

+ 83 - 14
src/scrm_pages/article/acticleCategory.vue Voir le fichier

6
       </div>
6
       </div>
7
       <div class="app-container">
7
       <div class="app-container">
8
         <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
8
         <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
9
-          <el-checkbox style="width: 30px">全选</el-checkbox>
10
-          <el-button size="small" icon="el-icon-delete">批量删除</el-button>
9
+          <el-checkbox style="width: 30px" @change="changeCheck" v-model="checkAllStatus">全选</el-checkbox>
10
+          <el-button size="small" icon="el-icon-delete" @click="openDeleteCategorys">批量删除</el-button>
11
 
11
 
12
         </div>
12
         </div>
13
 
13
 
18
             ref="multipleTable"
18
             ref="multipleTable"
19
             :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
19
             :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
20
             :data="articsData"
20
             :data="articsData"
21
+            @selection-change="handleSelectionChange"
21
           >
22
           >
22
             <el-table-column
23
             <el-table-column
23
               type="selection"
24
               type="selection"
26
 
27
 
27
             <el-table-column label="分类名称" align="center">
28
             <el-table-column label="分类名称" align="center">
28
               <template slot-scope="scope">
29
               <template slot-scope="scope">
29
-                {{scope.row.Name}}
30
+                {{scope.row.name}}
30
               </template>
31
               </template>
31
             </el-table-column>
32
             </el-table-column>
32
 
33
 
38
 
39
 
39
             <el-table-column label="分类排序" align="center">
40
             <el-table-column label="分类排序" align="center">
40
               <template slot-scope="scope">
41
               <template slot-scope="scope">
41
-                {{scope.row.Order}}
42
+                {{scope.row.order}}
42
               </template>
43
               </template>
43
             </el-table-column>
44
             </el-table-column>
44
 
45
 
58
                     size="mini"
59
                     size="mini"
59
                     type="danger"
60
                     type="danger"
60
                     icon="el-icon-delete"
61
                     icon="el-icon-delete"
61
-                    @click="handleDelete(scope.$index, scope.row)">
62
+                    @click="openDelete(scope.row,scope.$index)">
62
                   </el-button>
63
                   </el-button>
63
                 </el-tooltip>
64
                 </el-tooltip>
64
 
65
 
92
   import BreadCrumb from '../components/bread-crumb'
93
   import BreadCrumb from '../components/bread-crumb'
93
   import CreateArticleForm from "./components/CreateArticleForm";
94
   import CreateArticleForm from "./components/CreateArticleForm";
94
   import EditArticleForm from "./components/EditArticleForm";
95
   import EditArticleForm from "./components/EditArticleForm";
95
-  import { GetCategorys } from '@/api/act/submitinfo'
96
+  import { GetCategorys,DeleteCategorys } from '@/api/act/submitinfo';
96
   export default {
97
   export default {
97
     name: 'acticleCategory',
98
     name: 'acticleCategory',
98
     components:{
99
     components:{
108
         ],
109
         ],
109
         articsData:[],
110
         articsData:[],
110
         articData:{
111
         articData:{
111
-          Name:'',
112
-          Summary:'',
113
-          Order:'',
114
-          MenuId:0,
112
+          name:'',
113
+          summary:'',
114
+          order:'',
115
+          id:0,
115
         },
116
         },
116
         total:0,
117
         total:0,
117
         listQuery:{
118
         listQuery:{
118
           page:1,
119
           page:1,
119
           limit:10,
120
           limit:10,
120
           name:'',
121
           name:'',
121
-          content:'',
122
-          sort:'',
122
+          summary:'',
123
+          order:'',
123
         },
124
         },
124
-         artilceIndex:-1,
125
+         artilceIndex:0,
126
+         checkAllStatus:false,
125
       }
127
       }
126
     },
128
     },
127
 
129
 
157
             console.log("heh",this.articsData)  
159
             console.log("heh",this.articsData)  
158
              this.artilceIndex = index 
160
              this.artilceIndex = index 
159
              this.$refs.editArticleForm.open();        
161
              this.$refs.editArticleForm.open();        
160
-        }
162
+        },
163
+          changeCheck(){
164
+          this.$refs.multipleTable.clearSelection();
165
+          if (this.checkAllStatus) {
166
+            this.$refs.multipleTable.toggleAllSelection();
167
+            }
168
+           },
169
+        openDelete(row,index){
170
+          this.$confirm('确认要删除该分类名称吗?<br>删除后,该分类名称信息将无法恢复',{
171
+             dangerouslyUseHTMLString:true,
172
+             confirmButtonText: '确定',
173
+             cancelButtonText: '取消',
174
+             type: 'warning'   
175
+          }).then(()=>{
176
+            var ids = [];
177
+            ids.push(row.id);
178
+            DeleteCategorys({ids:ids}).then(response=>{
179
+                var res = response.data;
180
+                if(res.state === 1){
181
+                    this.articsData.splice(index,1);
182
+                    this.$message.success("删除会员成功");
183
+                }else{
184
+                   this.$message.error(res.msg);
185
+                }
186
+            }).catch(e=>{});
187
+          }).catch(() => {
188
+            return false        
189
+          });
190
+        },
191
+          handleSelectionChange(val){
192
+          this.selectedMembers = val;
193
+        },
194
+        openDeleteCategorys(){
195
+            if (this.selectedMembers.length==0) {
196
+            this.$message.error("请选择要删除的会员");
197
+            return false;
198
+          }   
199
+
200
+          this.$confirm('确认要删除所选的分类名称吗?<br>删除后,分类名称信息将无法恢复', '删除提示',{
201
+             dangerouslyUseHTMLString:true,
202
+             confirmButtonText: '确定',
203
+             cancelButtonText: '取消',
204
+             type: 'warning'
205
+          }).then(()=>{
206
+              var ids = [];
207
+              var idMap = {};
208
+              for (const index in this.selectedMembers) {
209
+                ids.push(this.selectedMembers[index].id);
210
+                idMap[this.selectedMembers[index].id] = this.selectedMembers[index].id;
211
+            }
212
+            DeleteCategorys({ids:ids}).then(response=>{
213
+               var res = response.data;
214
+               if(res.state ===1){
215
+                 var articsDatalength = this.articsData.length;
216
+                  for (let index = articsDatalength-1; index >= 0; index--) {
217
+                  if(this.articsData[index].id in idMap) {
218
+                    this.articsData.splice(index, 1);
219
+                  }                  
220
+                }
221
+                 this.$message.success("删除会员成功");
222
+               }else{
223
+                 this.$message.error(res.msg);
224
+              }
225
+            }).catch(e=>{});
226
+          }).catch(() => {
227
+            return false        
228
+          });
229
+        },
161
     },
230
     },
162
      created(){
231
      created(){
163
          this.GetCategorys()
232
          this.GetCategorys()

+ 92 - 1
src/scrm_pages/article/commentList.vue Voir le fichier

4
           <bread-crumb :crumbs='crumbs'></bread-crumb>
4
           <bread-crumb :crumbs='crumbs'></bread-crumb>
5
         </div>
5
         </div>
6
         <div class="app-container">
6
         <div class="app-container">
7
-         评论列表
7
+           评论列表
8
+           <el-form-item ref="videocontentvideo" style="display:none;">
9
+              <img :src="imgurl">
10
+              <video width="320" height="240" controls id="upvideo">
11
+              </video>
12
+              <img :src="modlevidel" />
13
+            </el-form-item>
14
+
15
+            <el-form-item class="upload-demo-content" v-show="formLabelAlign.type==2">
16
+            <el-upload class="upload-demo" :limit="1" :on-exceed="exceedhandle" drag :file-list="filsListArray" :action="configuploadurl" :on-success="successuploadhandle" accept="video" name="fileList" :before-upload="beforeUploadVideo">
17
+              <i class="el-icon-upload"></i>
18
+              <div class="el-upload__text">将视频文件拖到此处,或
19
+                <em>点击上传</em>
20
+              </div>
21
+              <div class="el-upload__tip" slot="tip"></div>
22
+            </el-upload>
23
+          </el-form-item>
8
         </div>
24
         </div>
9
     </div>
25
     </div>
10
 </template>
26
 </template>
22
           { path: false, name: '文章管理' },
38
           { path: false, name: '文章管理' },
23
           { path: '/articles/commentList', name: '评论列表' }
39
           { path: '/articles/commentList', name: '评论列表' }
24
         ],
40
         ],
41
+        imgurl:'',
42
+        modlevidel:'',
43
+        formLabelAlign:'',
44
+        modlevidel:'',
45
+        filsListArray:[],
46
+        elForm:'',
47
+        configuploadurl:'',
48
+      }
49
+    },
50
+    methods:{
51
+      successuploadhandle(response, file, fileList) {
52
+      this.formLabelAlign.video = this.modlevidel =
53
+        response.data.fileList[0].url;
54
+        this.filsListArray = [];
55
+        this.filsListArray.push({
56
+        name: this.formLabelAlign.video,
57
+        url: this.formLabelAlign.video
58
+       });
59
+        this.findvideocover();
60
+    },
61
+      exceedhandle(files, fileList) {
62
+      this.$message.error("只能上传一个视频额");
63
+      },
64
+      beforeUploadVideo(file) {
65
+      if (
66
+        [
67
+          "video/mp4",
68
+          "video/ogg",
69
+          "video/flv",
70
+          "video/avi",
71
+          "video/wmv",
72
+          "video/rmvb"
73
+        ].indexOf(file.type) == -1
74
+      ) {
75
+        this.$message.error("请上传正确的视频格式");
76
+        return false;
25
       }
77
       }
78
+     },
79
+
80
+     findvideocover() {
81
+      let _this = this;
82
+      this.$nextTick(() => {
83
+        let video = document.getElementById("upvideo");
84
+        let source = document.createElement("source");
85
+        // source.src = require("../../assets/5b086751dbb7af1ea8fa8d05e66fe5c3.mp4");this.formLabelAlign.video
86
+        source.src = this.formLabelAlign.video;
87
+        source.type = "video/mp4";
88
+        video.appendChild(source);
89
+        video.addEventListener("loadeddata", function() {
90
+          var canvas = document.createElement("canvas");
91
+          canvas.width = "320";
92
+          canvas.height = "320";
93
+          canvas
94
+            .getContext("2d")
95
+            .drawImage(video, 0, 0, canvas.width, canvas.width);
96
+          var img = document.createElement("img");
97
+          let imgsrc = canvas.toDataURL("image/png");
98
+          _this.Videoframehandle(imgsrc.split(",")[1]);
99
+        });
100
+      });
101
+      },
102
+
103
+      showvideohandle() {
104
+       this.$alert(
105
+        `<video width="320" height="240" controls>
106
+                      <source src="${
107
+                        this.filsListArray[0].url
108
+                      }"  type="video/mp4">
109
+                      您的浏览器不支持 HTML5 video 标签。
110
+                    </video>`,
111
+        "视频预览",
112
+        {
113
+          dangerouslyUseHTMLString: true
114
+        }
115
+      );
116
+    },
26
     }
117
     }
27
   }
118
   }
28
 </script>
119
 </script>

+ 33 - 30
src/scrm_pages/article/components/CreateArticleForm.vue Voir le fichier

1
 <template>
1
 <template>
2
-
3
     <div id="create-article-form-box">
2
     <div id="create-article-form-box">
4
       <el-dialog
3
       <el-dialog
5
         title="添加分类"
4
         title="添加分类"
15
             </el-form-item>
14
             </el-form-item>
16
           </el-row>
15
           </el-row>
17
           <el-row :span=20>
16
           <el-row :span=20>
18
-            <el-form-item label="分类描述:" required prop="content">
19
-              <keep-alive>
20
-                <neditor ref="neditor"
21
-                         id="editor"
22
-                         v-bind:r_content="form.content">
23
-                </neditor>
24
-              </keep-alive>
17
+            <el-form-item label="分类描述:" required prop="summary">      
18
+                <div style="margin: 10px 0;"></div>
19
+                <el-input
20
+                 type="textarea"
21
+                :autosize="{ minRows: 2, maxRows: 4}"
22
+                 v-model="form.summary">
23
+                </el-input>
25
             </el-form-item>
24
             </el-form-item>
26
           </el-row>
25
           </el-row>
27
           <el-row :span=20>
26
           <el-row :span=20>
28
-            <el-form-item label="排序" required prop="sort">
29
-              <el-input v-model="form.sort">
27
+            <el-form-item label="排序:" required prop="order">
28
+              <el-input v-model="form.order">
30
 
29
 
31
               </el-input>
30
               </el-input>
32
             </el-form-item>
31
             </el-form-item>
42
 </template>
41
 </template>
43
 
42
 
44
 <script>
43
 <script>
45
-    import Neditor from '@/components/Neditor'
46
     import { addCategory } from '@/api/act/submitinfo'
44
     import { addCategory } from '@/api/act/submitinfo'
47
     export default {
45
     export default {
48
-        name: "CreateArticleForm",
49
-         components:{
50
-           Neditor,
51
-        },
46
+        name: "CreateArticleForm",       
47
+           props:{
48
+             articsData:{
49
+             type: Array,
50
+             default: function () {
51
+             return [];
52
+        }
53
+      }
54
+           },
52
             data(){
55
             data(){
53
                 return {
56
                 return {
54
                     centerDialogVisible:false,
57
                     centerDialogVisible:false,
55
                     rules: {
58
                     rules: {
56
                     name: [{required: true, message: "请填写分类名称",},],
59
                     name: [{required: true, message: "请填写分类名称",},],
57
-                    content: [{required: true,message:"请填写分类描述"}],
58
-                    sort: [{required: true,message:"请填写排序"}]
59
-                },
60
-                 form:{
61
-                   name:"",
62
-                   content:"",
63
-                   sort:"",
64
-                },
60
+                    summary: [{required: true,message:"请填写分类描述"}],
61
+                    order: [{required: true,message:"请填写排序"}]
62
+                 },
65
                 acticleform:[],
63
                 acticleform:[],
64
+                 form:{
65
+                    name:"",
66
+                    summary:"",
67
+                    order:"",
68
+                   },
66
              }
69
              }
67
           },   
70
           },   
68
            methods:{
71
            methods:{
74
                      this.$refs[formName].resetFields();
77
                      this.$refs[formName].resetFields();
75
                    }
78
                    }
76
                   },
79
                   },
77
-               addCategory(formName){
78
-                  this.form.content = this.$refs.neditor.content
80
+               addCategory(formName){                 
79
                    this.$refs[formName].validate((valid)=>{
81
                    this.$refs[formName].validate((valid)=>{
80
-                       if(valid){
82
+                       if(valid){                         
81
                             addCategory(this.form).then(response =>{
83
                             addCategory(this.form).then(response =>{
82
-                                  console.log(response.data.state)
84
+                                  console.log("添加分类响应",response.data.state)
83
                                   if(response.data.state==1){
85
                                   if(response.data.state==1){
84
                                     var category = response.data.data.category
86
                                     var category = response.data.data.category
85
-                                    this.centerDialogVisible=false
87
+                                    console.log("category是什么",category)
88
+                                    this.centerDialogVisible=false;
89
+                                    this.articsData.unshift(category);
86
                                     this.resetForm("acticleform");
90
                                     this.resetForm("acticleform");
87
-                                    this.$message.success("添加分类成功");
88
-                                    console.log("coo",category)
91
+                                    this.$message.success("添加分类成功");                           
89
                                   }
92
                                   }
90
                             });
93
                             });
91
                        }   
94
                        }   

+ 33 - 32
src/scrm_pages/article/components/EditArticleForm.vue Voir le fichier

7
         center>
7
         center>
8
         <el-form label-width="90px" class="clearfix" :model="form" ref="acticleform" :rules="rules">
8
         <el-form label-width="90px" class="clearfix" :model="form" ref="acticleform" :rules="rules">
9
           <el-row :span=20>
9
           <el-row :span=20>
10
-            <el-form-item label="分类名称:" required prop="Name">
11
-              <el-input v-model="form.Name"></el-input>
10
+            <el-form-item label="分类名称:" required prop="name">
11
+              <el-input v-model="form.name"></el-input>
12
             </el-form-item>
12
             </el-form-item>
13
           </el-row>
13
           </el-row>
14
           <el-row :span=20>
14
           <el-row :span=20>
15
-            <el-form-item label="分类描述:" required prop="Summary">
16
-              <keep-alive>
17
-                <neditor ref="neditor"
18
-                         id="editor"
19
-                         v-bind:r_content="form.Summary">
20
-                </neditor>
21
-              </keep-alive>
15
+            <el-form-item label="分类描述:" required prop="summary">
16
+              <div style="margin: 10px 0;"></div>
17
+              <el-input
18
+                 type="textarea"
19
+                :autosize="{minRows: 2, maxRows: 4}"
20
+                 v-model="form.summary">
21
+                </el-input>
22
             </el-form-item>
22
             </el-form-item>
23
           </el-row>
23
           </el-row>
24
           <el-row :span=20>
24
           <el-row :span=20>
25
-            <el-form-item label="排序" required prop="Order">
26
-              <el-input v-model="form.Order"></el-input>
25
+            <el-form-item label="排序" required prop="order">
26
+              <el-input v-model="form.order"></el-input>
27
             </el-form-item>
27
             </el-form-item>
28
           </el-row>
28
           </el-row>
29
         </el-form>
29
         </el-form>
30
         <span slot="footer" class="dialog-footer">
30
         <span slot="footer" class="dialog-footer">
31
-               <el-button type="primary" @click="submitForm('acticleform')">保存</el-button>
31
+               <el-button 
32
+               type="primary" 
33
+               @click="submitForm('acticleform')">保存
34
+               </el-button>
32
               <el-button  @click="centerDialogVisible = false">取消</el-button>
35
               <el-button  @click="centerDialogVisible = false">取消</el-button>
33
              </span>
36
              </span>
34
       </el-dialog>   
37
       </el-dialog>   
35
     </div>
38
     </div>
36
 </template>
39
 </template>
37
 <script>
40
 <script>
38
-import Neditor from '@/components/Neditor'
39
  import { EditArticleCategory } from '@/api/act/submitinfo'
41
  import { EditArticleCategory } from '@/api/act/submitinfo'
40
 export default {
42
 export default {
41
     name: "EditArticleForm",
43
     name: "EditArticleForm",
42
-     components:{
43
-        Neditor,
44
-      },
45
       props:{
44
       props:{
46
         form:{
45
         form:{
47
-           Name:'',
48
-          Summary:'',
49
-          Order:'',
50
-          MenuId:0,
46
+           name:'',
47
+           summary:'',
48
+           order:'',
49
+           id:0,
51
         },
50
         },
52
       artilceIndex:{
51
       artilceIndex:{
53
           type:Number,
52
           type:Number,
64
           return {
63
           return {
65
           centerDialogVisible:false,
64
           centerDialogVisible:false,
66
            rules: {
65
            rules: {
67
-             Name: [{required: true, message: "请填写分类名称",},],
68
-             Summary: [{required: true,message:"请填写分类描述"}],
69
-             Order: [{required: true,message:"请填写排序"}]
66
+             name: [{required: true, message: "请填写分类名称",},],
67
+             summary: [{required: true,message:"请填写分类描述"}],
68
+             order: [{required: true,message:"请填写排序"}]
70
               },
69
               },
71
              }
70
              }
72
           }, 
71
           }, 
80
                    }
79
                    }
81
                 },  
80
                 },  
82
               submitForm(forname){ 
81
               submitForm(forname){ 
83
-                alert("aaa")
84
                 this.$refs[forname].validate((valid)=>{
82
                 this.$refs[forname].validate((valid)=>{
85
                    if(valid){
83
                    if(valid){
86
-                      EditArticleCategory(this.form.MenuId,this.form).then(response=>{
87
-                            console.log("id是谁",this.form.MenuId)
88
-                            console.log(this.form)
84
+                       var order = this.form.order
85
+                       var ord = parseInt(order)
86
+                       this.form.order = ord
87
+                      EditArticleCategory(this.form.id,this.form).then(response=>{                        
89
                            var res =  response.data;
88
                            var res =  response.data;
90
-                           console.log(res.state)
89
+                           console.log("返回响应",res.state)
91
                            if(res.state ===1 ){
90
                            if(res.state ===1 ){
92
-                              var categorys = res.data.categorys; 
91
+                              var categorys = res.data.category; 
93
                               console.log("categorys是什么",categorys)
92
                               console.log("categorys是什么",categorys)
94
-                              this.articsData[this.artilceIndex].name = categorys.Name;
95
-                              this.articsData[this.artilceIndex].content = categorys.Summary;
96
-                              this.articsData[this.artilceIndex].sort = categorys.Order;
93
+                              this.articsData[this.artilceIndex].name = categorys.name;
94
+                              this.articsData[this.artilceIndex].summary = categorys.summary;
95
+                              this.articsData[this.artilceIndex].order = categorys.order;
96
+                              //this.articsData.unshift(categorys);
97
+                              // this.resetForm("acticleform");
97
                               this.centerDialogVisible = false;
98
                               this.centerDialogVisible = false;
98
                               this.$message.success("编辑文章分类成功");
99
                               this.$message.success("编辑文章分类成功");
99
                            }
100
                            }

+ 253 - 127
src/scrm_pages/article/createArticle.vue Voir le fichier

7
     <div class="app-container">
7
     <div class="app-container">
8
     <el-tabs type="border-card">
8
     <el-tabs type="border-card">
9
       <el-tab-pane label="文章">
9
       <el-tab-pane label="文章">
10
-        <el-form label-width="80px" class="clearfix" :model="form" ref="form"  :element-loading-text="loadingText">
10
+        <el-form label-width="100px" class="clearfix" :model="form" ref="arctileform"  :element-loading-text="loadingText" :rules="artilcrules">
11
           <el-row>
11
           <el-row>
12
             <el-col :span="23">
12
             <el-col :span="23">
13
-                <el-form-item label="文章标题:">
14
-                    <el-input v-model="form.act_name"  placeholder="文章标题"></el-input>
13
+                <el-form-item label="文章标题:" required prop="act_name">
14
+                    <el-input v-model="form.act_name"></el-input>
15
                 </el-form-item>
15
                 </el-form-item>
16
-              <el-form-item label="文章内容:">
16
+              <el-form-item label="文章内容:" required prop="act_content">
17
                 <keep-alive>
17
                 <keep-alive>
18
                   <neditor ref="neditor"
18
                   <neditor ref="neditor"
19
                            id="editor"
19
                            id="editor"
25
                   <el-radio v-model="radio" label="1" @click.native.prevent="select()" >单图</el-radio>
25
                   <el-radio v-model="radio" label="1" @click.native.prevent="select()" >单图</el-radio>
26
                   <el-radio v-model="radio" label="2" @click.native.prevent="clickitem()" >三图</el-radio>
26
                   <el-radio v-model="radio" label="2" @click.native.prevent="clickitem()" >三图</el-radio>
27
               </el-form-item>
27
               </el-form-item>
28
-              <el-form-item prop="org_log">
28
+              <el-form-item>
29
                 <el-col :span="3">
29
                 <el-col :span="3">
30
                   <div>
30
                   <div>
31
                     <el-upload
31
                     <el-upload
38
                       :on-error="handleAvatarError"
38
                       :on-error="handleAvatarError"
39
                       :on-success="handleAvatarSuccess"
39
                       :on-success="handleAvatarSuccess"
40
                       :before-upload="beforeAvatarUpload">
40
                       :before-upload="beforeAvatarUpload">
41
-                      <img v-if="imageUrl" :src="imageUrl" class="avatar">
41
+                      <img v-if="form.org_logo" :src="form.org_logo" class="avatar">
42
                       <i v-else class="el-icon-plus avatar-uploader-icon"></i>
42
                       <i v-else class="el-icon-plus avatar-uploader-icon"></i>
43
                     </el-upload>
43
                     </el-upload>
44
                   </div>
44
                   </div>
46
                 <el-col :span="3">
46
                 <el-col :span="3">
47
                   <div v-if="show">
47
                   <div v-if="show">
48
                     <el-upload
48
                     <el-upload
49
-                      v-loading="guploading"
49
+                      v-loading="uploading"
50
                       :element-loading-text="loadingText"
50
                       :element-loading-text="loadingText"
51
                       class="avatar-uploader"
51
                       class="avatar-uploader"
52
                       :data="uploadData"
52
                       :data="uploadData"
78
                   </div>
78
                   </div>
79
                 </el-col>
79
                 </el-col>
80
               </el-form-item>
80
               </el-form-item>
81
-               <el-form-item label="所属分类:">
81
+               <el-form-item label="所属分类:" prop="act_type">
82
                  <el-select v-model="form.act_type" placeholder="请先选择文章所属分类"  @change="changeActtype()">
82
                  <el-select v-model="form.act_type" placeholder="请先选择文章所属分类"  @change="changeActtype()">
83
                    <el-option
83
                    <el-option
84
                      v-for="item in options"
84
                      v-for="item in options"
85
-                     :key="item.MenuId"
86
-                     :label="item.Name"
87
-                     :value="item.MenuId">
85
+                     :key="item.id"
86
+                     :label="item.name"
87
+                     :value="item.id">
88
                    </el-option>
88
                    </el-option>
89
                  </el-select>
89
                  </el-select>
90
                </el-form-item>
90
                </el-form-item>
94
           <el-row :span="24">
94
           <el-row :span="24">
95
             <el-col :span="24">
95
             <el-col :span="24">
96
                 <el-form-item>
96
                 <el-form-item>
97
-                      <el-button size="small" type="primary" style="width: 100px"  @click="submitForm();centerDialogVisible = true">发布</el-button>
98
-                      <el-button size="small" style="width: 100px">预览</el-button>
97
+                      <el-button size="small" type="primary" style="width: 100px"  @click="submitForm('arctileform');centerDialogVisible=false">发布</el-button>
98
+                      <el-button size="small" style="width: 100px" @click="preview('arctileform')">预览</el-button>
99
                       <el-button size="small" style="width: 100px">保存草稿</el-button>
99
                       <el-button size="small" style="width: 100px">保存草稿</el-button>
100
                   <el-button size="small" style="width: 100px">取消</el-button>
100
                   <el-button size="small" style="width: 100px">取消</el-button>
101
                 </el-form-item>
101
                 </el-form-item>
104
         </el-form>
104
         </el-form>
105
       </el-tab-pane>
105
       </el-tab-pane>
106
       <el-tab-pane label="视频">
106
       <el-tab-pane label="视频">
107
-        <el-form label-width="80px" class="clearfix">
107
+        <el-form label-width="100px" class="clearfix"  :rules="rules" :model="form" ref="vidoform">
108
            <el-row>
108
            <el-row>
109
              <el-col :span="24">
109
              <el-col :span="24">
110
                  <div style="margin-bottom: 100px">
110
                  <div style="margin-bottom: 100px">
111
-                 <el-form-item>
112
-                 <div class="video-select">
113
-                   <el-upload
114
-                   class="upload-demo"
115
-                   action="https://upload.qiniup.com"
116
-                   :on-preview="handlePreview"
117
-                   :on-remove="handleRemove"
118
-                   :before-remove="beforeRemove"
119
-                   multiple
120
-                   :limit="3"
121
-                   :on-exceed="handleExceed"
122
-                   :file-list="fileList"
123
-                   :before-upload="beforeUpload">
124
-                   <el-button size="small" type="primary">点击上传</el-button>
125
-                   <div slot="tip" class="el-upload__tip">只能上传jpg/exe文件,且不超过2G</div>
126
-                   </el-upload>
127
-                   </div>
128
-                   <div class="progressbar probar" style="text-align: center">
129
-                   <span class="videotitle"></span>
130
-                   <input type="hidden" name="videoUrl" id="videopath">
131
-                   <div class="barpic"></div>
132
-                   <span class="chaimg"></span>
133
-                   <span class="videoupload"></span>
134
-                   </div>
135
-                 </el-form-item>
111
+                   <el-form-item  required prop="vio_upload">
112
+                       <div class="video-select" v-if="show">
113
+                        <el-upload
114
+                            class="upload-demo"
115
+                            :data="uploadFileData"
116
+                            action="https://upload.qiniup.com"
117
+                            :on-change="handleChange"
118
+                            :on-success="handleSuccess"
119
+                            :on-error="handleError"
120
+                            :before-upload="beforeUploadFile"
121
+                             accept="video/x-flv,video/mpeg,video/avi,video/x-ms-wmv,video/quicktime,.asf,.rm,.rmvb,video/x-matroska,video/x-m4v,video/mp4">                         
122
+                             <el-button size="small" type="primary" v-if="show">点击上传</el-button>
123
+                             <div slot="tip" class="el-upload__tip" v-if="show">支持大多视频文件格式,大小不超过2G</div>
124
+                        </el-upload>
125
+                       </div>
126
+                         <div class="video" v-if="shows">
127
+                         <img v-if="form.vio_upload" :src="form.vio_upload+'?vframe/jpg/offset/1/w/300/h/200'" class="avatar" id="upvideo">
128
+                       </div>
129
+                        <div id="upvideo"></div>                  
130
+                    </el-form-item>
136
                   </div>
131
                   </div>
137
-                 <el-form-item label="视频标题:">
138
-                   <el-input placeholder="视频标题"></el-input>
132
+
133
+                 <el-form-item label="视频标题:" required prop="vid_name">
134
+                   <el-input v-model="form.vid_name"></el-input>
139
                  </el-form-item>
135
                  </el-form-item>
140
-                 <el-form-item label="视频封面:"></el-form-item>
141
-                 <el-form-item>
142
-                   <el-upload  class="avatar-uploader" :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
143
-                     <img v-if="imageUrl" :src="imageUrl" class="avatar">
136
+
137
+                 <el-form-item label="视频封面:">
138
+                   <el-upload  class="avatar-uploader" :show-file-list="false" 
139
+                   :on-success="handlevioSuccess" 
140
+                   :before-upload="beforevidoFile" 
141
+                   :on-change="handleChange"
142
+                   action="https://upload.qiniup.com"
143
+                   :data="uploadvidoData">
144
+                     <img v-if="form.vid_pic" :src="form.vid_pic" class="avatar">                  
145
+                     <img v-if="form.vio_upload" :src="form.vio_upload+'?vframe/jpg/offset/1/w/300/h/200'" class="avatar">
144
                      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
146
                      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
145
                    </el-upload>
147
                    </el-upload>
146
                  </el-form-item>
148
                  </el-form-item>
147
-                  <el-form-item label="所属分类:">
148
-                    <el-select v-model="form.act_type" placeholder="请选择">
149
+                 <div class="eltip">
150
+                   视频封面若不上传,系统会根据视频内容进行自动截取<br>
151
+                   目前支持PNG和JPG格式,图片大小不能超过1MB
152
+                   </div>
153
+                  <el-form-item label="所属分类:" required prop="vid_type">
154
+                    <el-select v-model="form.vid_type">
149
                       <el-option
155
                       <el-option
150
-                         v-for="item in options"
151
-                         :key="item.value"
152
-                        :label="item.label"
153
-                         :value="item.value">
156
+                          v-for="item in options"
157
+                          :key="item.id"
158
+                          :label="item.name"
159
+                          :value="item.id"> 
154
                       </el-option>
160
                       </el-option>
155
                       </el-select>
161
                       </el-select>
156
                   </el-form-item>
162
                   </el-form-item>
157
                    <el-row :span="24">
163
                    <el-row :span="24">
158
                      <el-col :span="24">
164
                      <el-col :span="24">
159
                        <el-form-item>
165
                        <el-form-item>
160
-                         <el-button size="small" type="primary" style="width: 100px">发布</el-button>
161
-                         <el-button size="small" style="width: 100px">保存草稿</el-button>
162
-                         <el-button size="small" style="width: 100px">取消</el-button>
166
+                         <el-button size="small" type="primary" style="width: 100px" @click="SumitVido('vidoform');centerDialogVisible = false">发布</el-button>
167
+                         <el-button size="small" style="width: 100px" @click="Savedraft('vidoform');centerdraftVisible = false">保存草稿</el-button>
168
+                         <el-button size="small" style="width: 100px" @click="centercancelVisible = true">取消</el-button>
163
                        </el-form-item>
169
                        </el-form-item>
164
                      </el-col>
170
                      </el-col>
165
-                   </el-row>
171
+                   </el-row>                   
166
              </el-col>
172
              </el-col>
167
            </el-row>
173
            </el-row>
168
         </el-form>
174
         </el-form>
175
         :visible.sync="centerDialogVisible"
181
         :visible.sync="centerDialogVisible"
176
          width="30%"
182
          width="30%"
177
          center>
183
          center>
178
-         <!-- <span>需要注意的是内容是默认不居中的</span> -->
179
          <span slot="footer" class="dialog-footer">
184
          <span slot="footer" class="dialog-footer">
180
-        <el-button @click="gotolink;centerDialogVisible = false">再发一条</el-button>
185
+        <el-button @click="gotolink()">再发一条</el-button>
181
         <el-button type="primary" @click="gobacklist">返回文章列表</el-button>
186
         <el-button type="primary" @click="gobacklist">返回文章列表</el-button>
182
        </span>
187
        </span>
183
       </el-dialog>
188
       </el-dialog>
189
+
190
+      <el-dialog
191
+       title="保存草稿成功"
192
+       :visible.sync = "centerdraftVisible"
193
+        width="30%"
194
+        center>
195
+        <span slot="footer" class="dialog-footer">
196
+        <el-button type="primary" @click="gobacklist">返回文章列表</el-button>  
197
+         </span>
198
+      </el-dialog>
199
+
200
+      <el-dialog
201
+       title="提示"
202
+       :visible.sync = "centercancelVisible"
203
+       width="30%"
204
+       center>
205
+       <span style="center">是否确定取消编辑此文章/视频</span>
206
+       <span slot="footer" class="dialog-footer">
207
+       <el-button type="primary" @click="centercancelVisible = false" >确认</el-button>
208
+       <el-button @click="centercancelVisible = false">取消</el-button>   
209
+        </span>   
210
+      </el-dialog>
184
   </div>
211
   </div>
185
 </template>
212
 </template>
186
 
213
 
191
   import 'quill/dist/quill.snow.css'
218
   import 'quill/dist/quill.snow.css'
192
   import 'quill/dist/quill.bubble.css'
219
   import 'quill/dist/quill.bubble.css'
193
   import Neditor from '@/components/Neditor'
220
   import Neditor from '@/components/Neditor'
194
-  import {submitForm,getArticleType} from '@/api/act/submitinfo'
221
+  import {submitForm,getArticleType,addVido,Savedraft} from '@/api/act/submitinfo'
195
   import { getToken } from '@/api/qiniu'
222
   import { getToken } from '@/api/qiniu'
196
   import { getFileExtension} from '@/utils/tools'
223
   import { getFileExtension} from '@/utils/tools'
197
   export default {
224
   export default {
212
         show:false,
239
         show:false,
213
         content: '',
240
         content: '',
214
         editorOption: {},
241
         editorOption: {},
215
-        uploadUrl:"",//你要上传视频到你后台的地址
216
-        videoFlag:false , //是否显示进度条
217
-        videoUploadPercent:"", //进度条的进度,
218
-        isShowUploadVideo:false, //显示上传按钮
219
         company:"",
242
         company:"",
220
-        fileList: [{name: '123', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}],
243
+        fileList: [],
221
         form:{
244
         form:{
222
           act_name:'',
245
           act_name:'',
223
           act_content:'',
246
           act_content:'',
225
           act_category:'',
248
           act_category:'',
226
           org_logo:'',
249
           org_logo:'',
227
           act_type:'',
250
           act_type:'',
251
+          file:'',
252
+          vid_pic:'',
253
+          vio_upload:'',
254
+          vid_name:'',
255
+          vid_type:'',
228
         },
256
         },
229
          acttypes:[],
257
          acttypes:[],
230
          imageUrl:'',
258
          imageUrl:'',
236
          uploading:false,
264
          uploading:false,
237
          loadingText:'',
265
          loadingText:'',
238
          uploadData: { token: '', key: '' },
266
          uploadData: { token: '', key: '' },
239
-         myConfig: {
240
-                // 如果需要上传功能,找后端小伙伴要服务器接口地址
241
-                serverUrl: '/api/web/upload/ueditor',
242
-                // 你的UEditor资源存放的路径,相对于打包后的index.html
243
-                UEDITOR_HOME_URL: '/NEditor/',
244
-                // 编辑器不自动被内容撑高
245
-                autoHeightEnabled: false,
246
-                // 初始容器高度
247
-                initialFrameHeight: 240,
248
-                // 初始容器宽度
249
-                initialFrameWidth: '100%',
250
-                // 关闭自动保存
251
-                enableAutoSave: false
252
-            },
267
+         uploadFileData:{token:'',key:''},
268
+         uploadvidoData:{token:'',key:''},
253
          centerDialogVisible: false,
269
          centerDialogVisible: false,
270
+         centerdraftVisible:false,
271
+         centercancelVisible:false,
272
+         formLabelAlign:true,
273
+         modlevidel:'',
274
+         filsListArray:[],
275
+         show:true,
276
+         shows:false,
277
+         rules: {
278
+            vid_name: [{required: true, message: "视频标题不能为空"},],
279
+            vio_upload: [{required: true,message:"请上传视频"}],
280
+            vid_type: [{required: true,message:"所属分类不能为空"}]
281
+          },
282
+        artilcrules:{
283
+            act_name: [{required: true, message: "文章标题不能为空"},],
284
+            act_content: [{required: true,message:"文章内容不能为空"}],
285
+            act_type: [{required: true,message:"所属分类不能为空"}]
286
+        },
287
+        vidoform:[],
288
+        ue:'',
254
       }
289
       }
255
     },
290
     },
256
     created(){
291
     created(){
257
-        this.getArticleType()
292
+        this.getArticleType();
258
     },
293
     },
259
     methods: {
294
     methods: {
260
       //第一个图片
295
       //第一个图片
261
       handleAvatarSuccess(res, file) {
296
       handleAvatarSuccess(res, file) {
262
-        this.imageUrl = URL.createObjectURL(file.raw);
263
-        this.form.org_logo = this.qiniuDomain + res.url;
297
+       this.form.org_logo = this.qiniuDomain + res.url;
264
         this.uploading = false
298
         this.uploading = false
265
       },
299
       },
266
        handleAvatarError(err, file, fileList) {
300
        handleAvatarError(err, file, fileList) {
298
                     this.uploading = false;
332
                     this.uploading = false;
299
                 })
333
                 })
300
             })
334
             })
301
-
302
-          //return isJPG && isLt2M;
303
       },
335
       },
304
       //第二个图片
336
       //第二个图片
305
       handleAvatartwoSuccess(res, file) {
337
       handleAvatartwoSuccess(res, file) {
347
       },
379
       },
348
 
380
 
349
       //第三张图片
381
       //第三张图片
350
-      //第二个图片
351
       handleAvatarlastSuccess(res, file) {
382
       handleAvatarlastSuccess(res, file) {
352
         this.imageUrlLast = URL.createObjectURL(file.raw);
383
         this.imageUrlLast = URL.createObjectURL(file.raw);
353
         this.form.org_logo = this.qiniuDomain + res.url;
384
         this.form.org_logo = this.qiniuDomain + res.url;
372
             var date = new Date()
403
             var date = new Date()
373
             var ext = getFileExtension(file.name)
404
             var ext = getFileExtension(file.name)
374
             var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_o_' + file.uid + '.' + ext;
405
             var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_o_' + file.uid + '.' + ext;
375
-            this.uploading = true;
376
             this.loadingText = '封面图片上传中'
406
             this.loadingText = '封面图片上传中'
377
 
407
 
378
             const _self = this
408
             const _self = this
385
                     resolve(true)
415
                     resolve(true)
386
                 }).catch(err => {
416
                 }).catch(err => {
387
                     reject(false)
417
                     reject(false)
388
-                    this.uploading = false;
389
                 })
418
                 })
390
-            })
419
+            }) 
420
+        }, 
421
+        //视频上传
422
+        handleChange(file, fileList) {
423
+          this.form.file =  file.raw
424
+        }, 
425
+        handleSuccess(res,file,fileList){  
426
+            this.$message.success("视频上传成功")               
427
+             this.form.vio_upload = this.qiniuDomain + res.url;           
428
+             console.log("是什么",this.form.vio_upload)
391
 
429
 
392
-          //return isJPG && isLt2M;
430
+             this.show=false;
431
+             this.shows = true;
432
+        },
433
+        handlevioSuccess(res,file,fileList){
434
+           this.form.vid_pic = this.qiniuDomain + res.url;  
435
+        },
436
+        changeImg(url){
437
+          console.log("路径是多少?",url)
438
+        },
439
+         handleError(err, file, fileList) {
440
+             this.$message.error("视频上传失败")
441
+         },
442
+        beforeUploadFile(file) {
443
+        const isLt2M = file.size / 1024 / 1024 < 2048;
444
+        if (!isLt2M) {
445
+          this.$message.error('上传视频大小不能超过 2G!');
446
+        }
447
+            var date = new Date()
448
+            var ext = getFileExtension(file.name)
449
+            var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_o_' + file.uid + '.' + ext;
450
+            const _self = this
451
+            return new Promise((resolve, reject) => {
452
+                getToken().then(response => {
453
+                    const token = response.data.data.uptoken
454
+                    //console.log("token2是什么?",token)
455
+                    _self._data.uploadFileData.token = token
456
+                    _self._data.uploadFileData.key = key
457
+                    resolve(true)
458
+                }).catch(err => {
459
+                    reject(false)                  
460
+                })
461
+            })
393
       },
462
       },
394
-
395
-      beforeUpload(file) {
396
-        var testmsg=file.name.substring(file.name.lastIndexOf('.')+1)
397
-        const extension = testmsg === 'mp4'
398
-        const extension2 = testmsg === 'exe'
399
-        const isLt2M = file.size / 1024 / 1024 < 2048     //这里做文件大小限制
400
-        if(!extension && !extension2) {
401
-          this.$message({
402
-            message: '上传文件只能是 mp4、exe格式!',
403
-            type: 'warning'
404
-          });
463
+      beforevidoFile(file){
464
+          const isJPG = file.type === 'png/jpg';
465
+          if (!isJPG) {
466
+          this.$message.error('上传头像图片只能是 png或者jpg格式!');
405
         }
467
         }
406
-        if(!isLt2M) {
407
-          this.$message({
408
-            message: '上传文件大小不能超过 2G!',
409
-            type: 'warning'
410
-          });
468
+          const isLt2M = file.size / 1024 / 1024 < 1;
469
+        if (!isLt2M) {
470
+          this.$message.error('上传视频大小不能超过 1M!');
411
         }
471
         }
412
-        return extension || extension2 && isLt2M
413
-      },
472
+            var date = new Date()
473
+            var ext = getFileExtension(file.name)
474
+            var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_o_' + file.uid + '.' + ext;
475
+            const _self = this
476
+            return new Promise((resolve, reject) => {
477
+                getToken().then(response => {
478
+                    const token = response.data.data.uptoken
479
+                    //console.log("token2是什么?",token)
480
+                    _self._data.uploadvidoData.token = token
481
+                    _self._data.uploadvidoData.key = key
482
+                    resolve(true)
483
+                }).catch(err => {
484
+                    reject(false)                  
485
+                })
486
+            })
487
+       },
414
       select(){
488
       select(){
415
         this.show = false
489
         this.show = false
416
       },
490
       },
432
       changeActtype(){
506
       changeActtype(){
433
          console.log("所属分类",this.form.act_type)
507
          console.log("所属分类",this.form.act_type)
434
       },
508
       },
435
-      submitForm(){
436
-        console.log("提交文章")
437
-        var params  = new Object()
438
-        params.act_name = this.form.act_name
439
-        params.act_content = this.$refs.neditor.content
440
-        params.org_logo = this.form.org_logo
441
-        params.act_type = this.form.act_type
442
-        this.formloading=true
443
-        this.submitForm =true
444
-        console.log("文章标题",params.act_name)
445
-        console.log("文章内容",params.act_content)
446
-        console.log("富文本编辑器的内容",params.act_content)
447
-        console.log("图片",params.org_logo)  
448
-        console.log("所属分类",params.act_type)    
449
-        submitForm(params).then(response => {
450
-         
451
-        })
509
+      submitForm(formName){
510
+        this.form.act_content = this.$refs.neditor.content;
511
+        console.log("文章内容",this.$refs.neditor.content)
512
+        this.$refs[formName].validate((valid)=>{
513
+            if(valid){
514
+              submitForm(this.form).then(response => {
515
+                   if(response.data.state == 1){
516
+                     this.centerDialogVisible = true;
517
+                     var articles = response.data.data.articles;
518
+                     console.log("返回的数据是啥?",articles);
519
+                   }
520
+              })
521
+            }
522
+        });
452
       },
523
       },
453
       getArticleType(){
524
       getArticleType(){
454
         getArticleType().then(response =>{
525
         getArticleType().then(response =>{
455
-            //console.log("好嗨我")
526
+            console.log(response.data.state)
456
             if(response.data.state === 1){
527
             if(response.data.state === 1){
457
             var category = response.data.data.category
528
             var category = response.data.data.category
458
             this.options = response.data.data.category
529
             this.options = response.data.data.category
459
-            // console.log("文章内容:",category)
460
-            // console.log("文章",this.options)
530
+             //console.log("文章内容:",category)
531
+             //console.log("文章",this.options)
461
             }
532
             }
462
         })
533
         })
463
       },
534
       },
464
       gotolink(){
535
       gotolink(){
465
-        this.$router.push({path:"/articles/createArticle"})
536
+         this.$router.go(0);
466
       },
537
       },
467
       gobacklist(){
538
       gobacklist(){
468
         this.$router.push({path:'/articles/articleList'})
539
         this.$router.push({path:'/articles/articleList'})
540
+      },
541
+      SumitVido(formName){
542
+         this.$refs[formName].validate((valid)=>{
543
+           if(valid){
544
+               addVido(this.form).then(response=>{
545
+                   if(response.data.state == 1){
546
+                     this.centerDialogVisible = true;
547
+                     var vido = response.data.data.vido;
548
+                     console.log("返回数据",vido)
549
+                   }
550
+               });
551
+           }
552
+         });
553
+      },
554
+      Savedraft(formName){
555
+        this.$refs[formName].validate((valid)=>{
556
+           if(valid){
557
+               Savedraft(this.form).then(response=>{
558
+                   if(response.data.state==1){
559
+                     this.centerdraftVisible = true;
560
+                     var savedraft = response.data.data.savedraft;
561
+                     console.log("保存草稿数据",savedraft)
562
+                   }
563
+               });
564
+           }
565
+        });
566
+      },
567
+      preview(formName){
568
+         this.form.act_content = this.$refs.neditor.content;
569
+         console.log("文章内容",this.$refs.neditor.content)
570
+         this.$refs[formName].validate((valid)=>{
571
+            if(valid){
572
+               preview(this.form).then(response=>{
573
+                    this.$router.go(0);
574
+               });
575
+            }
576
+         });
469
       }
577
       }
470
     },
578
     },
471
   }
579
   }
507
     height: 200px;
615
     height: 200px;
508
     position: relative;
616
     position: relative;
509
     left: 500px;
617
     left: 500px;
618
+    margin-bottom: 1px;
619
+  }
620
+  .video{
621
+    padding: 150px 0 30px;
622
+    background-position: center 0;
623
+    background-size: 192px 132px;
624
+    text-align: center;
625
+    width: 200px;
626
+    height: 200px;
627
+    position: relative;
628
+    left: 500px;
629
+    margin-bottom: 60px;
630
+    margin-top: -140px;
631
+  }
632
+  .eltip{
633
+    font-size: 12px;
634
+    position: relative;
635
+    left: 80px;
636
+    margin-bottom: 20px;
510
   }
637
   }
511
-
512
 </style>
638
 </style>