Bladeren bron

文章列表页面的开发

xiaoming_global 5 jaren geleden
bovenliggende
commit
d41d38d591

+ 9 - 0
src/api/act/submitinfo.js Bestand weergeven

16
          method: 'Get',
16
          method: 'Get',
17
          params: params
17
          params: params
18
      })
18
      })
19
+}
20
+
21
+export function GetAllArticles(params){
22
+     console.log("文章列表")
23
+     return request({
24
+         url:'/api/acticle/getAllArticles',
25
+         method:'Get',
26
+         params:params
27
+     })
19
 }
28
 }

+ 54 - 26
src/scrm_pages/article/articleList.vue Bestand weergeven

8
           <div style="margin-bottom: 10px">
8
           <div style="margin-bottom: 10px">
9
             <el-row :gutter="24">
9
             <el-row :gutter="24">
10
               <el-col :span="8">
10
               <el-col :span="8">
11
-                  <el-input style="width: 300px"  placeholder="请输入您需要搜索的内容"></el-input>
11
+                  <el-input style="width: 300px" v-model="listQuery.search"  placeholder="请输入您需要搜索的内容"></el-input>
12
                   <el-button type="primary"  icon="el-icon-search">搜索</el-button>
12
                   <el-button type="primary"  icon="el-icon-search">搜索</el-button>
13
               </el-col>
13
               </el-col>
14
             </el-row>
14
             </el-row>
17
             <label class="title"><span class="name">标签</span>:</label>
17
             <label class="title"><span class="name">标签</span>:</label>
18
              <div class="time">
18
              <div class="time">
19
                 <ul class="">
19
                 <ul class="">
20
-                  <li :class="item.value==schedulType?'active':''"  v-for="item in schedulArr" :key="item.value">{{item.label}}</li>
20
+                  <li :class="0==schedulType?'active':''" @click="selectsign(0)">全部</li>
21
+                  <li :class="item.MenuId==schedulType?'active':''"  v-for="item in schedulArr" :key="item.MenuId">{{item.Name}}</li>
21
                 </ul>
22
                 </ul>
22
              </div>
23
              </div>
23
           </div>
24
           </div>
25
             <label class="title"><span class="name">状态:</span></label>
26
             <label class="title"><span class="name">状态:</span></label>
26
             <div class="time">
27
             <div class="time">
27
               <ul class="">
28
               <ul class="">
29
+                <!-- <li :class="0==systemType?'active':''" @click="selectStatus(0)">全部</li> -->
28
                 <li :class="item.value==systemType?'active':''" v-for="item in systemArr" :key="item.value">{{item.label}}</li>
30
                 <li :class="item.value==systemType?'active':''" v-for="item in systemArr" :key="item.value">{{item.label}}</li>
29
               </ul>
31
               </ul>
30
             </div>
32
             </div>
31
           </div>
33
           </div>
32
           <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
34
           <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
33
-            <el-checkbox style="width: 30px" v-model="checked" @change="changeAllSelected">全选</el-checkbox>
34
-            <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
35
+            <el-checkbox style="width: 30px">全选</el-checkbox>
36
+            <el-button size="small" icon="el-icon-delete">删除</el-button>
35
           </div>
37
           </div>
36
-          <el-table ref="multipleTable" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :data="tableData" border fit highlight-current-row  style="width: 100%;margin-top: 10px;">
38
+          <el-table ref="multipleTable" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :data="ArticleData" border fit highlight-current-row  style="width: 100%;margin-top: 10px;">
37
               <el-table-column
39
               <el-table-column
38
                 type="selection"
40
                 type="selection"
39
                 width="55">
41
                 width="55">
92
 
94
 
93
 <script>
95
 <script>
94
   import BreadCrumb from '../components/bread-crumb'
96
   import BreadCrumb from '../components/bread-crumb'
97
+  import { GetAllArticles } from '@/api/act/submitinfo'
95
   export default {
98
   export default {
96
     name: 'commentList',
99
     name: 'commentList',
97
     components:{
100
     components:{
106
         time: '',
109
         time: '',
107
         active: true,
110
         active: true,
108
         schedulType: 0,
111
         schedulType: 0,
109
-        schedulArr:[
110
-          {value: 0, label: '全部'},
111
-          {value: 1, label: '食物库'},
112
-          {value: 2, label: '肾病常识'},
113
-          {value: 3, label: '科普教育'},
114
-        ],
112
+        schedulArr:0,
115
         systemType: 0,
113
         systemType: 0,
116
         systemArr: [
114
         systemArr: [
117
-          { value: 0, label: '全部' },
118
-          { value: 1, label: '已发布'},
119
-          { value: 2, label: '草稿箱'},
120
-          { value: 3, label: '未通过'},
115
+          { value: 0, label: "全部" },
116
+          { value: 1, label: "已发布" },
117
+          { value: 2, label: "草稿箱" },
118
+          { value: 2, label: "未通过" }
121
         ],
119
         ],
120
+        listQuery:{
121
+            page:1,
122
+            limit:10,
123
+            search:'',
124
+            classid:'',
125
+        },
126
+        ArticleData:[],
127
+        total:0,
122
       }
128
       }
129
+    },
130
+    methods:{
131
+         GetAllArticles(){
132
+              GetAllArticles(this.listQuery).then(response =>{
133
+                     if(response.data.status === 1){
134
+                       this.ArticleData = response.data.data.articles
135
+                        console.log("文章列表",this.ArticleData)
136
+                        this.total = response.data.data.total
137
+                     }
138
+              })
139
+         },
140
+         selectsign(id){
141
+            this.listQuery.classid = id;
142
+            this.schedulArr = id;
143
+            this.GetAllArticles();
144
+         },
145
+         selectStatus(id){
146
+            this.listQuery.status = id;
147
+            this.systemType = id;
148
+            this.GetAllArticles();
149
+         },
150
+          handleSizeChange(limit) {
151
+            this.listQuery.limit = limit;
152
+            this.GetAllAritcles();
153
+        },
154
+         handleCurrentChange(page) {
155
+            this.listQuery.page = page;
156
+            this.GetAllAritcles();
157
+        }
158
+    },
159
+    created(){
160
+      this.GetAllArticles()
123
     }
161
     }
124
   }
162
   }
125
 </script>
163
 </script>
126
 
164
 
127
 <style scoped>
165
 <style scoped>
128
-  /*.app-container .cell.clearfix .time ul li {*/
129
-    /*float: left;*/
130
-    /*list-style: none;*/
131
-    /*cursor: pointer;*/
132
-    /*padding: 6px 20px;*/
133
-    /*color: #606266;*/
134
-    /*border-radius: 4px;*/
135
-    /*margin: 0 8px 0 0;*/
136
-    /*font-size: 14px;*/
137
-    /*text-align: center;*/
138
-  /*}*/
166
+     
139
 </style>
167
 </style>

+ 29 - 11
src/scrm_pages/article/createArticle.vue Bestand weergeven

79
                 </el-col>
79
                 </el-col>
80
               </el-form-item>
80
               </el-form-item>
81
                <el-form-item label="所属分类:">
81
                <el-form-item label="所属分类:">
82
-                 <el-select v-model="value" placeholder="请先选择文章所属分类" prop="act_type">
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.id"
85
+                     :key="item.MenuId"
86
                      :label="item.Name"
86
                      :label="item.Name"
87
-                     :value="item.id">
87
+                     :value="item.MenuId">
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" :disabled="formsubmit">发布</el-button>
97
+                      <el-button size="small" type="primary" style="width: 100px"  @click="submitForm;centerDialogVisible = true" :disabled="formsubmit">发布</el-button>
98
                       <el-button size="small" style="width: 100px">预览</el-button>
98
                       <el-button size="small" style="width: 100px">预览</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>
170
     </el-tabs>
170
     </el-tabs>
171
      </div>
171
      </div>
172
     </div>
172
     </div>
173
+      <el-dialog
174
+        title="发布成功"
175
+        :visible.sync="centerDialogVisible"
176
+         width="30%"
177
+         center>
178
+         <!-- <span>需要注意的是内容是默认不居中的</span> -->
179
+         <span slot="footer" class="dialog-footer">
180
+        <el-button @click="gotolink;centerDialogVisible = false">再发一条</el-button>
181
+        <el-button type="primary" @click="gobacklist">返回文章列表</el-button>
182
+       </span>
183
+      </el-dialog>
173
   </div>
184
   </div>
174
 </template>
185
 </template>
175
 
186
 
239
                 // 关闭自动保存
250
                 // 关闭自动保存
240
                 enableAutoSave: false
251
                 enableAutoSave: false
241
             },
252
             },
253
+         centerDialogVisible: false,
242
       }
254
       }
243
     },
255
     },
244
     created(){
256
     created(){
417
       beforeRemove(file, fileList) {
429
       beforeRemove(file, fileList) {
418
         return this.$confirm(`确定移除 ${ file.name }?`);
430
         return this.$confirm(`确定移除 ${ file.name }?`);
419
       },
431
       },
432
+      changeActtype(){
433
+         console.log("所属分类",this.form.act_type)
434
+      },
420
       submitForm(){
435
       submitForm(){
421
         var params  = new Object()
436
         var params  = new Object()
422
         params.act_name = this.form.act_name
437
         params.act_name = this.form.act_name
423
         params.act_content = this.$refs.neditor.content
438
         params.act_content = this.$refs.neditor.content
424
         params.org_logo = this.form.org_logo
439
         params.org_logo = this.form.org_logo
440
+        params.act_type = this.form.act_type
425
         this.formloading=true
441
         this.formloading=true
426
         this.submitForm =true
442
         this.submitForm =true
427
         console.log("文章标题",params.act_name)
443
         console.log("文章标题",params.act_name)
428
         console.log("文章内容",params.act_content)
444
         console.log("文章内容",params.act_content)
429
         console.log("富文本编辑器的内容",params.act_content)
445
         console.log("富文本编辑器的内容",params.act_content)
430
-        console.log("图片",params.org_logo)
446
+        console.log("图片",params.org_logo)  
447
+        console.log("所属分类",params.act_type)    
431
         submitForm(params).then(response => {
448
         submitForm(params).then(response => {
432
-           if(response.data.state === 1){
433
-             this.$message({
434
-               type: 'success',
435
-               message: '成功!'
436
-             })
437
-           }
449
+         
438
         })
450
         })
439
       },
451
       },
440
       getArticleType(){
452
       getArticleType(){
447
              console.log("文章",this.options)
459
              console.log("文章",this.options)
448
             }
460
             }
449
         })
461
         })
462
+      },
463
+      gotolink(){
464
+        this.$router.push({path:"/articles/createArticle"})
465
+      },
466
+      gobacklist(){
467
+        this.$router.push({path:'/articles/articleList'})
450
       }
468
       }
451
     },
469
     },
452
   }
470
   }

+ 1 - 0
src/scrm_pages/members/members.vue Bestand weergeven

153
         GetMembers(){
153
         GetMembers(){
154
             GetMembers(this.listQuery).then(response=>{
154
             GetMembers(this.listQuery).then(response=>{
155
                 var res = response.data;
155
                 var res = response.data;
156
+                console.log("res是谁?",res)
156
                 if(res.state == 1) {
157
                 if(res.state == 1) {
157
                     this.membersData = res.data.members;
158
                     this.membersData = res.data.members;
158
                     this.total = res.data.total;
159
                     this.total = res.data.total;