|
@@ -1,53 +1,70 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="main-contain">
|
3
|
3
|
<div class="position">
|
4
|
|
- <bread-crumb :crumbs='crumbs'></bread-crumb>
|
5
|
|
- <el-button style="float:right;" type="primary" size="small" icon="el-icon-circle-plus-outline" @click="AddArticle()">添加文章</el-button>
|
|
4
|
+ <bread-crumb :crumbs="crumbs"></bread-crumb>
|
|
5
|
+ <el-button
|
|
6
|
+ style="float:right;"
|
|
7
|
+ type="primary"
|
|
8
|
+ size="small"
|
|
9
|
+ icon="el-icon-circle-plus-outline"
|
|
10
|
+ @click="AddArticle()"
|
|
11
|
+ >添加文章</el-button>
|
6
|
12
|
</div>
|
7
|
13
|
<div class="app-container">
|
8
|
|
- <div style="margin-bottom: 10px">
|
9
|
|
- <el-row :gutter="24">
|
10
|
|
- <el-col :span="8">
|
11
|
|
- <el-input style="width: 300px" v-model="listQuery.keyword" placeholder="请输入您需要搜索的内容"></el-input>
|
12
|
|
- <el-button type="primary" icon="el-icon-search" @click="changeKey()">搜索</el-button>
|
13
|
|
- </el-col>
|
14
|
|
- </el-row>
|
15
|
|
- </div>
|
16
|
|
- <div class="cell clearfix">
|
17
|
|
- <label class="title"><span class="name">标签</span>:</label>
|
18
|
|
- <div class="time">
|
19
|
|
- <ul class="">
|
20
|
|
- <li :class="0==tagType?'active':''" @click="selectsign(0)">全部</li>
|
21
|
|
- <li :class="item.id==tagType?'active':''" v-for="item in tagOptions" :key="item.id" @click="selectsign(item.id)">{{item.name}}</li>
|
22
|
|
- </ul>
|
23
|
|
- </div>
|
24
|
|
- </div>
|
25
|
|
- <div class="cell clearfix">
|
26
|
|
- <label class="title"><span class="name">状态:</span></label>
|
27
|
|
- <div class="time">
|
28
|
|
- <ul class="">
|
29
|
|
- <li :class="{ active: selecting_status == 0 }" @click="changeSelectingStatus(0)">全部</li>
|
30
|
|
- <li :class="{ active: selecting_status == 1 }" @click="changeSelectingStatus(1)">已发布</li>
|
31
|
|
- <li :class="{ active: selecting_status == 2 }" @click="changeSelectingStatus(2)">草稿箱</li>
|
32
|
|
- <li :class="{ active: selecting_status == 3 }" @click="changeSelectingStatus(3)">未通过</li>
|
33
|
|
- </ul>
|
34
|
|
- </div>
|
35
|
|
- </div>
|
|
14
|
+ <div style="margin-bottom: 10px">
|
|
15
|
+ <el-row :gutter="24">
|
|
16
|
+ <el-col :span="24">
|
|
17
|
+ <el-input style="width: 300px" v-model="listQuery.keyword" placeholder="请输入您需要搜索的内容"></el-input>
|
|
18
|
+ <el-button type="primary" icon="el-icon-search" @click="changeKey()">搜索</el-button>
|
|
19
|
+ </el-col>
|
|
20
|
+ </el-row>
|
|
21
|
+ </div>
|
|
22
|
+ <div class="cell clearfix">
|
|
23
|
+ <label class="title">
|
|
24
|
+ <span class="name">标签</span>:
|
|
25
|
+ </label>
|
|
26
|
+ <div class="time">
|
|
27
|
+ <ul class>
|
|
28
|
+ <li :class="0==tagType?'active':''" @click="selectsign(0)">全部</li>
|
|
29
|
+ <li
|
|
30
|
+ :class="item.id==tagType?'active':''"
|
|
31
|
+ v-for="item in tagOptions"
|
|
32
|
+ :key="item.id"
|
|
33
|
+ @click="selectsign(item.id)"
|
|
34
|
+ >{{item.name}}</li>
|
|
35
|
+ </ul>
|
|
36
|
+ </div>
|
|
37
|
+ </div>
|
|
38
|
+ <div class="cell clearfix">
|
|
39
|
+ <label class="title">
|
|
40
|
+ <span class="name">状态:</span>
|
|
41
|
+ </label>
|
|
42
|
+ <div class="time">
|
|
43
|
+ <ul class>
|
|
44
|
+ <li :class="{ active: selecting_status == 0 }" @click="changeSelectingStatus(0)">全部</li>
|
|
45
|
+ <li :class="{ active: selecting_status == 1 }" @click="changeSelectingStatus(1)">已发布</li>
|
|
46
|
+ <li :class="{ active: selecting_status == 2 }" @click="changeSelectingStatus(2)">草稿箱</li>
|
|
47
|
+ <li :class="{ active: selecting_status == 3 }" @click="changeSelectingStatus(3)">未通过</li>
|
|
48
|
+ </ul>
|
|
49
|
+ </div>
|
|
50
|
+ </div>
|
36
|
51
|
|
37
|
|
- <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
|
38
|
|
- <el-checkbox style="width: 30px" @change="selectAllFunc" v-model="selectAll">全选</el-checkbox>
|
39
|
|
- <el-button size="small" icon="el-icon-delete" @click="deleteAllArticles()">批量删除</el-button>
|
40
|
|
- </div>
|
|
52
|
+ <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
|
|
53
|
+ <el-checkbox style="width: 30px" @change="selectAllFunc" v-model="selectAll">全选</el-checkbox>
|
|
54
|
+ <el-button size="small" icon="el-icon-delete" @click="deleteAllArticles()">批量删除</el-button>
|
|
55
|
+ </div>
|
41
|
56
|
|
42
|
57
|
<div class="clearfix">
|
43
|
58
|
<div class="published-cell" v-for="(article,index) in articsData" :key="article.id">
|
44
|
|
- <div class="checkbox" >
|
45
|
|
- <el-checkbox v-model='article.checked' @change="selectProduct"></el-checkbox>
|
|
59
|
+ <div class="checkbox">
|
|
60
|
+ <el-checkbox v-model="article.checked" @change="selectProduct"></el-checkbox>
|
46
|
61
|
</div>
|
47
|
62
|
|
48
|
63
|
<div class="activity-image-panel">
|
49
|
|
- <span class="status-text">{{article.article_status ==1 ? '已发布':'' || article.article_status ==2 ? '草稿':'' || article.article_status ==3 ? '未通过':''}}</span>
|
50
|
|
- <img :src="article.imgs"/>
|
|
64
|
+ <span
|
|
65
|
+ class="status-text"
|
|
66
|
+ >{{article.article_status ==1 ? '已发布':'' || article.article_status ==2 ? '草稿':'' || article.article_status ==3 ? '未通过':''}}</span>
|
|
67
|
+ <img :src="article.imgs" />
|
51
|
68
|
</div>
|
52
|
69
|
<div class="activity-info-panel">
|
53
|
70
|
<h3 class="title">
|
|
@@ -55,23 +72,23 @@
|
55
|
72
|
</h3>
|
56
|
73
|
<!-- <div class="statistics">
|
57
|
74
|
阅读:{{article.real_read_num}} 丨 评论:{{article.comment_num}} 丨 点赞:{{article.star_num}}
|
58
|
|
- </div> -->
|
|
75
|
+ </div>-->
|
59
|
76
|
<div>
|
60
|
77
|
<el-tooltip class="item" effect="dark" content="编辑" placement="top">
|
61
|
78
|
<el-button
|
62
|
79
|
size="mini"
|
63
|
80
|
type="primary"
|
64
|
81
|
icon="el-icon-edit-outline"
|
65
|
|
- @click="editArticles(article.id,article.type)">
|
66
|
|
- </el-button>
|
|
82
|
+ @click="editArticles(article.id,article.type)"
|
|
83
|
+ ></el-button>
|
67
|
84
|
</el-tooltip>
|
68
|
85
|
<el-tooltip class="item" effect="dark" content="删除" placement="top">
|
69
|
86
|
<el-button
|
70
|
87
|
size="mini"
|
71
|
88
|
type="danger"
|
72
|
89
|
icon="el-icon-delete"
|
73
|
|
- @click="deleteArticle(article.id,index)">
|
74
|
|
- </el-button>
|
|
90
|
+ @click="deleteArticle(article.id,index)"
|
|
91
|
+ ></el-button>
|
75
|
92
|
</el-tooltip>
|
76
|
93
|
</div>
|
77
|
94
|
</div>
|
|
@@ -82,380 +99,398 @@
|
82
|
99
|
</div>
|
83
|
100
|
</div>
|
84
|
101
|
|
85
|
|
- <el-pagination
|
86
|
|
- @size-change="handleSizeChange"
|
87
|
|
- @current-change="handleCurrentChange"
|
88
|
|
- :page-sizes="[10,20,50,100]"
|
89
|
|
- :page-size="10"
|
90
|
|
- background
|
91
|
|
- style="margin-top:20px;float: right"
|
92
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
93
|
|
- :total="total">
|
94
|
|
- </el-pagination>
|
|
102
|
+ <el-pagination
|
|
103
|
+ @size-change="handleSizeChange"
|
|
104
|
+ @current-change="handleCurrentChange"
|
|
105
|
+ :page-sizes="[10,20,50,100]"
|
|
106
|
+ :page-size="10"
|
|
107
|
+ background
|
|
108
|
+ style="margin-top:20px;float: right"
|
|
109
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
110
|
+ :total="total"
|
|
111
|
+ ></el-pagination>
|
95
|
112
|
</div>
|
96
|
113
|
</div>
|
97
|
114
|
</template>
|
98
|
115
|
|
99
|
116
|
<script>
|
100
|
|
- import BreadCrumb from '../components/bread-crumb'
|
101
|
|
- import { GetAllArticles,deleteArticle,deleteAllArticles,GetAllCategory} from '@/api/act/submitinfo'
|
102
|
|
- import PublishedCell from "@/scrm_pages/article/components/published_cell"
|
103
|
|
- import {uParseTime} from "@/utils/tools";
|
104
|
|
- export default {
|
105
|
|
- name: 'commentList',
|
106
|
|
- components:{
|
107
|
|
- BreadCrumb,
|
108
|
|
- PublishedCell,
|
|
117
|
+import BreadCrumb from "../components/bread-crumb";
|
|
118
|
+import {
|
|
119
|
+ GetAllArticles,
|
|
120
|
+ deleteArticle,
|
|
121
|
+ deleteAllArticles,
|
|
122
|
+ GetAllCategory
|
|
123
|
+} from "@/api/act/submitinfo";
|
|
124
|
+import PublishedCell from "@/scrm_pages/article/components/published_cell";
|
|
125
|
+import { uParseTime } from "@/utils/tools";
|
|
126
|
+export default {
|
|
127
|
+ name: "commentList",
|
|
128
|
+ components: {
|
|
129
|
+ BreadCrumb,
|
|
130
|
+ PublishedCell
|
|
131
|
+ },
|
|
132
|
+ inject: ["reload"],
|
|
133
|
+ data() {
|
|
134
|
+ return {
|
|
135
|
+ crumbs: [
|
|
136
|
+ { path: false, name: "文章管理" },
|
|
137
|
+ { path: "/articles/articleList", name: "文章列表" }
|
|
138
|
+ ],
|
|
139
|
+ time: "",
|
|
140
|
+ active: true,
|
|
141
|
+ tagType: 0,
|
|
142
|
+ tagOptions: [],
|
|
143
|
+ listQuery: {
|
|
144
|
+ page: 1,
|
|
145
|
+ limit: 10,
|
|
146
|
+ classid: "",
|
|
147
|
+ name: "",
|
|
148
|
+ keyword: ""
|
|
149
|
+ },
|
|
150
|
+ articsData: [],
|
|
151
|
+ total: 0,
|
|
152
|
+ dialogVisible: false,
|
|
153
|
+ checkAllStatus: false,
|
|
154
|
+ selecting_status: "",
|
|
155
|
+ orgName: "",
|
|
156
|
+ statustext: "",
|
|
157
|
+ checked: false,
|
|
158
|
+ selectAll: false,
|
|
159
|
+ selectReply: [],
|
|
160
|
+ startPointX: 0,
|
|
161
|
+ changePointX: 0,
|
|
162
|
+ showIndex: 0
|
|
163
|
+ };
|
|
164
|
+ },
|
|
165
|
+ methods: {
|
|
166
|
+ GetAllArticles() {
|
|
167
|
+ GetAllArticles(
|
|
168
|
+ this.selecting_status,
|
|
169
|
+ this.listQuery.classid,
|
|
170
|
+ this.listQuery.keyword,
|
|
171
|
+ this.listQuery.limit,
|
|
172
|
+ this.listQuery.page
|
|
173
|
+ ).then(response => {
|
|
174
|
+ if (response.data.state === 1) {
|
|
175
|
+ this.articsData = response.data.data.articles;
|
|
176
|
+ this.total = response.data.data.total;
|
|
177
|
+ console.log("文章列表", this.articsData);
|
|
178
|
+ console.log("total", this.total);
|
|
179
|
+ // this.orgName = response.data.data.OrgName;
|
|
180
|
+ // console.log("机构姓名",this.orgName)
|
|
181
|
+ }
|
|
182
|
+ // if(typeof(response.data.data.category != 'undefined')){
|
|
183
|
+ // this.tagOptions = response.data.data.category
|
|
184
|
+ // console.log("分类列表",this.tagOptions)
|
|
185
|
+ // }
|
|
186
|
+ });
|
109
|
187
|
},
|
110
|
|
- inject:['reload'],
|
111
|
|
- data(){
|
112
|
|
- return{
|
113
|
|
- crumbs: [
|
114
|
|
- { path: false, name: '文章管理' },
|
115
|
|
- { path: '/articles/articleList', name: '文章列表' }
|
116
|
|
- ],
|
117
|
|
- time: '',
|
118
|
|
- active: true,
|
119
|
|
- tagType: 0,
|
120
|
|
- tagOptions:[],
|
121
|
|
- listQuery:{
|
122
|
|
- page:1,
|
123
|
|
- limit:10,
|
124
|
|
- classid:'',
|
125
|
|
- name:'',
|
126
|
|
- keyword:'',
|
127
|
|
- },
|
128
|
|
- articsData:[],
|
129
|
|
- total:0,
|
130
|
|
- dialogVisible: false,
|
131
|
|
- checkAllStatus:false,
|
132
|
|
- selecting_status:'',
|
133
|
|
- orgName:'',
|
134
|
|
- statustext:'',
|
135
|
|
- checked: false,
|
136
|
|
- selectAll:false,
|
137
|
|
- selectReply:[],
|
138
|
|
- startPointX: 0,
|
139
|
|
- changePointX: 0,
|
140
|
|
- showIndex: 0,
|
141
|
|
- }
|
|
188
|
+ articlecreatetime(time) {
|
|
189
|
+ return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}");
|
|
190
|
+ },
|
|
191
|
+ selectsign(id) {
|
|
192
|
+ console.log("id", id);
|
|
193
|
+ this.listQuery.classid = id;
|
|
194
|
+ this.listQuery.name = name;
|
|
195
|
+ this.tagType = id;
|
|
196
|
+ this.GetAllArticles();
|
|
197
|
+ },
|
|
198
|
+ handleSizeChange(limit) {
|
|
199
|
+ this.listQuery.limit = limit;
|
|
200
|
+ this.GetAllArticles();
|
|
201
|
+ },
|
|
202
|
+ handleCurrentChange(page) {
|
|
203
|
+ this.listQuery.page = page;
|
|
204
|
+ this.GetAllArticles();
|
|
205
|
+ },
|
|
206
|
+ changeKey() {
|
|
207
|
+ this.GetAllArticles();
|
|
208
|
+ },
|
|
209
|
+ memberAvatar(row) {
|
|
210
|
+ return row.imgs;
|
|
211
|
+ },
|
|
212
|
+ AddArticle() {
|
|
213
|
+ this.$router.push({ path: "/articles/createArticle/:id" });
|
|
214
|
+ },
|
|
215
|
+ changeSelectingStatus(status) {
|
|
216
|
+ console.log("status是多少?", status);
|
|
217
|
+ this.selecting_status = status;
|
|
218
|
+ this.GetAllArticles();
|
|
219
|
+ },
|
|
220
|
+ openDelete(row, index) {
|
|
221
|
+ var id = row.id;
|
|
222
|
+ this.$confirm("确认要删除该信息吗?删除后将无法恢复!", {
|
|
223
|
+ dangerouslyUseHTMLString: true,
|
|
224
|
+ confirmButtonText: "确定",
|
|
225
|
+ cancelButtonText: "取消",
|
|
226
|
+ type: "warning"
|
|
227
|
+ })
|
|
228
|
+ .then(() => {
|
|
229
|
+ var ids = [];
|
|
230
|
+ ids.push(row.id);
|
|
231
|
+ openDelete({ ids: ids })
|
|
232
|
+ .then(response => {
|
|
233
|
+ this.articsData.splice(index, 1);
|
|
234
|
+ this.$message.success("删除成功");
|
|
235
|
+ })
|
|
236
|
+ .catch(e => {});
|
|
237
|
+ })
|
|
238
|
+ .catch(e => {});
|
142
|
239
|
},
|
143
|
|
- methods:{
|
144
|
|
- GetAllArticles(){
|
145
|
|
- GetAllArticles(this.selecting_status,this.listQuery.classid,this.listQuery.keyword,this.listQuery.limit,this.listQuery.page).then(response=>{
|
146
|
|
- if(response.data.state === 1){
|
147
|
|
- this.articsData = response.data.data.articles;
|
148
|
|
- this.total = response.data.data.total;
|
149
|
|
- console.log("文章列表",this.articsData)
|
150
|
|
- console.log("total",this.total)
|
151
|
|
- // this.orgName = response.data.data.OrgName;
|
152
|
|
- // console.log("机构姓名",this.orgName)
|
153
|
|
- }
|
154
|
|
- // if(typeof(response.data.data.category != 'undefined')){
|
155
|
|
- // this.tagOptions = response.data.data.category
|
156
|
|
- // console.log("分类列表",this.tagOptions)
|
157
|
|
- // }
|
158
|
|
- })
|
159
|
|
- },
|
160
|
|
- articlecreatetime(time){
|
161
|
|
- return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}");
|
162
|
|
- },
|
163
|
|
- selectsign(id){
|
164
|
|
- console.log("id",id)
|
165
|
|
- this.listQuery.classid = id;
|
166
|
|
- this.listQuery.name = name;
|
167
|
|
- this.tagType = id;
|
168
|
|
- this.GetAllArticles();
|
169
|
|
- },
|
170
|
|
- handleSizeChange(limit) {
|
171
|
|
- this.listQuery.limit = limit;
|
172
|
|
- this.GetAllArticles();
|
173
|
|
- },
|
174
|
|
- handleCurrentChange(page) {
|
175
|
|
- this.listQuery.page = page;
|
176
|
|
- this.GetAllArticles();
|
177
|
|
- },
|
178
|
|
- changeKey(){
|
179
|
|
- this.GetAllArticles();
|
180
|
|
- },
|
181
|
|
- memberAvatar(row){
|
182
|
|
- return row.imgs
|
183
|
|
- },
|
184
|
|
- AddArticle(){
|
185
|
|
- this.$router.push({path:'/articles/createArticle/:id'})
|
186
|
|
- },
|
187
|
|
- changeSelectingStatus(status){
|
188
|
|
- console.log("status是多少?",status)
|
189
|
|
- this.selecting_status = status;
|
190
|
|
- this.GetAllArticles();
|
191
|
|
- },
|
192
|
|
- openDelete(row,index){
|
193
|
|
- var id = row.id;
|
194
|
|
- this.$confirm('确认要删除该信息吗?删除后将无法恢复!',{
|
195
|
|
- dangerouslyUseHTMLString:true,
|
196
|
|
- confirmButtonText: '确定',
|
197
|
|
- cancelButtonText: '取消',
|
198
|
|
- type: 'warning'
|
199
|
|
- }).then(()=>{
|
200
|
|
- var ids = [];
|
201
|
|
- ids.push(row.id);
|
202
|
|
- openDelete({ids:ids}).then(response=>{
|
203
|
|
- this.articsData.splice(index,1);
|
204
|
|
- this.$message.success("删除成功");
|
205
|
|
- }).catch(e=>{});
|
206
|
|
- }).catch(e=>{});
|
207
|
|
- },
|
208
|
240
|
|
209
|
|
- handleSelectionChange(val){
|
210
|
|
- this.selectedArticles = val;
|
211
|
|
- },
|
212
|
|
- deleteArticle(id,index){
|
|
241
|
+ handleSelectionChange(val) {
|
|
242
|
+ this.selectedArticles = val;
|
|
243
|
+ },
|
|
244
|
+ deleteArticle(id, index) {
|
|
245
|
+ this.$confirm("确定要删除吗?删除后信息将无法恢复!", "删除提示", {
|
|
246
|
+ dangerouslyUseHTMLString: true,
|
|
247
|
+ confirmButtonText: "确定",
|
|
248
|
+ cancelButtonText: "取消",
|
|
249
|
+ type: "warning"
|
|
250
|
+ })
|
|
251
|
+ .then(() => {
|
|
252
|
+ deleteArticle(id)
|
|
253
|
+ .then(response => {
|
|
254
|
+ if (response.data.state == 1) {
|
|
255
|
+ this.articsData.splice(index, 1);
|
|
256
|
+ this.$message.success("删除成功");
|
|
257
|
+ } else {
|
|
258
|
+ this.$message.error(response.msg);
|
|
259
|
+ }
|
|
260
|
+ })
|
|
261
|
+ .catch(e => {});
|
|
262
|
+ })
|
|
263
|
+ .catch(() => {
|
|
264
|
+ return false;
|
|
265
|
+ });
|
|
266
|
+ },
|
|
267
|
+ editArticles(id, articletype) {
|
|
268
|
+ if (articletype == 1) {
|
|
269
|
+ this.$router.push("/articles/editArticle/" + id);
|
|
270
|
+ }
|
|
271
|
+ if (articletype == 2) {
|
|
272
|
+ this.$router.push("/articles/editVido/" + id);
|
|
273
|
+ }
|
|
274
|
+ },
|
213
|
275
|
|
214
|
|
- this.$confirm('确定要删除吗?删除后信息将无法恢复!','删除提示',{
|
215
|
|
- dangerouslyUseHTMLString:true,
|
216
|
|
- confirmButtonText: '确定',
|
217
|
|
- cancelButtonText: '取消',
|
218
|
|
- type: 'warning'
|
219
|
|
- }).then(()=>{
|
220
|
|
- deleteArticle(id).then(response=>{
|
221
|
|
- if(response.data.state==1){
|
222
|
|
- this.articsData.splice(index,1)
|
223
|
|
- this.$message.success("删除成功")
|
224
|
|
- }else{
|
225
|
|
- this.$message.error(response.msg)
|
226
|
|
- }
|
227
|
|
- }).catch(e=>{});
|
228
|
|
- }).catch(() => {
|
229
|
|
- return false
|
230
|
|
- });
|
231
|
|
- },
|
232
|
|
- editArticles(id,articletype){
|
233
|
|
- if(articletype == 1){
|
234
|
|
- this.$router.push("/articles/editArticle/"+id);
|
235
|
|
- }
|
236
|
|
- if(articletype == 2){
|
237
|
|
- this.$router.push("/articles/editVido/"+id);
|
238
|
|
- }
|
239
|
|
- },
|
|
276
|
+ selectProduct(val) {
|
|
277
|
+ var ids = [];
|
|
278
|
+ for (let i = 0, len = this.articsData.length; i < len; i++) {
|
|
279
|
+ if (!this.articsData[i].checked) {
|
|
280
|
+ this.selectAll = false;
|
|
281
|
+ } else {
|
|
282
|
+ this.selectAll = true;
|
|
283
|
+ this.selectReply = val;
|
|
284
|
+ ids.push(this.articsData[i].id);
|
|
285
|
+ this.selectReply = ids;
|
|
286
|
+ }
|
|
287
|
+ }
|
|
288
|
+ console.log("ids是什么", ids);
|
|
289
|
+ },
|
|
290
|
+ selectAllFunc(val) {
|
|
291
|
+ var ids = [];
|
|
292
|
+ this.articsData.map((item, i) => {
|
|
293
|
+ item.checked = val;
|
|
294
|
+ });
|
240
|
295
|
|
241
|
|
- selectProduct(val){
|
242
|
|
- var ids =[];
|
243
|
|
- for(let i=0,len=this.articsData.length;i<len;i++){
|
244
|
|
- if(!this.articsData[i].checked){
|
245
|
|
- this.selectAll = false;
|
246
|
|
- }else{
|
247
|
|
- this.selectAll = true;
|
248
|
|
- this.selectReply = val;
|
249
|
|
- ids.push(this.articsData[i].id);
|
250
|
|
- this.selectReply = ids;
|
251
|
|
- }
|
252
|
|
- }
|
253
|
|
- console.log("ids是什么",ids);
|
254
|
|
- },
|
255
|
|
- selectAllFunc(val){
|
256
|
|
- var ids = [];
|
257
|
|
- this.articsData.map((item,i)=>{
|
258
|
|
- item.checked = val;
|
259
|
|
- })
|
|
296
|
+ for (let i = 0, len = this.articsData.length; i < len; i++) {
|
|
297
|
+ if (!this.articsData[i].checked) {
|
|
298
|
+ this.selectAll = false;
|
|
299
|
+ } else {
|
|
300
|
+ this.selectAll = true;
|
|
301
|
+ this.selectReply = val;
|
|
302
|
+ ids.push(this.articsData[i].id);
|
|
303
|
+ this.selectReply = ids;
|
|
304
|
+ }
|
|
305
|
+ }
|
|
306
|
+ console.log("ids是什么", ids);
|
|
307
|
+ },
|
260
|
308
|
|
261
|
|
- for(let i=0,len=this.articsData.length;i<len;i++){
|
262
|
|
- if(!this.articsData[i].checked){
|
263
|
|
- this.selectAll = false;
|
264
|
|
- }else{
|
265
|
|
- this.selectAll = true;
|
266
|
|
- this.selectReply = val;
|
267
|
|
- ids.push(this.articsData[i].id);
|
268
|
|
- this.selectReply = ids;
|
269
|
|
- }
|
270
|
|
- }
|
271
|
|
- console.log("ids是什么",ids);
|
272
|
|
- },
|
|
309
|
+ deleteAllArticles() {
|
|
310
|
+ if (this.selectReply.length == 0) {
|
|
311
|
+ this.$message.error("请选择要删除的信息");
|
|
312
|
+ return false;
|
|
313
|
+ }
|
273
|
314
|
|
274
|
|
- deleteAllArticles(){
|
275
|
|
- if (this.selectReply.length==0) {
|
276
|
|
- this.$message.error("请选择要删除的信息");
|
277
|
|
- return false;
|
|
315
|
+ this.$confirm("确认要删除所选的文章吗?", "删除提示", {
|
|
316
|
+ dangerouslyUseHTMLString: true,
|
|
317
|
+ confirmButtonText: "确定",
|
|
318
|
+ cancelButtonText: "取消",
|
|
319
|
+ type: "warning"
|
|
320
|
+ }).then(() => {
|
|
321
|
+ deleteAllArticles().then(response => {
|
|
322
|
+ var ids = [];
|
|
323
|
+ var idMap = {};
|
|
324
|
+ for (let index = 0; index < this.selectReply.length; index++) {
|
|
325
|
+ ids.push(this.selectReply[index]);
|
|
326
|
+ idMap[this.selectReply[index]] = this.selectReply[index];
|
278
|
327
|
}
|
279
|
|
-
|
280
|
|
- this.$confirm('确认要删除所选的文章吗?','删除提示',{
|
281
|
|
- dangerouslyUseHTMLString:true,
|
282
|
|
- confirmButtonText: '确定',
|
283
|
|
- cancelButtonText: '取消',
|
284
|
|
- type: 'warning'
|
285
|
|
- }).then(()=>{
|
286
|
|
- deleteAllArticles().then(response=>{
|
287
|
|
- var ids = [];
|
288
|
|
- var idMap = {};
|
289
|
|
- for (let index = 0; index < this.selectReply.length; index++) {
|
290
|
|
- ids.push(this.selectReply[index]);
|
291
|
|
- idMap[this.selectReply[index]] = this.selectReply[index];
|
292
|
|
- }
|
293
|
|
- console.log("第二个ids是什么?",ids);
|
294
|
|
- deleteAllArticles({ids:ids}).then(response=>{
|
295
|
|
- if(response.data.state ==1){
|
296
|
|
- for (let index = this.articsData.length-1; index >= 0; index--) {
|
297
|
|
- if(this.articsData[index].id in idMap){
|
298
|
|
- this.articsData.splice(index,1)
|
299
|
|
- }
|
300
|
|
- }
|
301
|
|
- this.$message.success("删除成功");
|
302
|
|
- }
|
303
|
|
- })
|
304
|
|
- });
|
305
|
|
- })
|
306
|
|
- },
|
307
|
|
- GetAllCategory(){
|
308
|
|
- GetAllCategory().then(response=>{
|
309
|
|
- if(response.data.state == 1){
|
310
|
|
- var categorys = response.data.data.categorys;
|
311
|
|
- this.tagOptions = response.data.data.categorys;
|
312
|
|
- console.log("标签是什么",categorys)
|
|
328
|
+ console.log("第二个ids是什么?", ids);
|
|
329
|
+ deleteAllArticles({ ids: ids }).then(response => {
|
|
330
|
+ if (response.data.state == 1) {
|
|
331
|
+ for (
|
|
332
|
+ let index = this.articsData.length - 1;
|
|
333
|
+ index >= 0;
|
|
334
|
+ index--
|
|
335
|
+ ) {
|
|
336
|
+ if (this.articsData[index].id in idMap) {
|
|
337
|
+ this.articsData.splice(index, 1);
|
|
338
|
+ }
|
|
339
|
+ }
|
|
340
|
+ this.$message.success("删除成功");
|
313
|
341
|
}
|
314
|
|
- })
|
315
|
|
- },
|
316
|
|
- articleDetail(id,articletype){
|
317
|
|
-
|
318
|
|
- if(articletype == 1){
|
319
|
|
- this.$router.push("/articles/articleDetail/"+id);
|
320
|
|
- }
|
321
|
|
- if(articletype == 2){
|
322
|
|
- this.$router.push("/articles/vidoDetail/"+id);
|
323
|
|
- }
|
324
|
|
- }
|
|
342
|
+ });
|
|
343
|
+ });
|
|
344
|
+ });
|
325
|
345
|
},
|
326
|
|
- created(){
|
327
|
|
- this.GetAllArticles();
|
328
|
|
- this.GetAllCategory();
|
|
346
|
+ GetAllCategory() {
|
|
347
|
+ GetAllCategory().then(response => {
|
|
348
|
+ if (response.data.state == 1) {
|
|
349
|
+ var categorys = response.data.data.categorys;
|
|
350
|
+ this.tagOptions = response.data.data.categorys;
|
|
351
|
+ console.log("标签是什么", categorys);
|
|
352
|
+ }
|
|
353
|
+ });
|
329
|
354
|
},
|
330
|
|
-
|
331
|
|
-
|
|
355
|
+ articleDetail(id, articletype) {
|
|
356
|
+ if (articletype == 1) {
|
|
357
|
+ this.$router.push("/articles/articleDetail/" + id);
|
|
358
|
+ }
|
|
359
|
+ if (articletype == 2) {
|
|
360
|
+ this.$router.push("/articles/vidoDetail/" + id);
|
|
361
|
+ }
|
|
362
|
+ }
|
|
363
|
+ },
|
|
364
|
+ created() {
|
|
365
|
+ this.GetAllArticles();
|
|
366
|
+ this.GetAllCategory();
|
332
|
367
|
}
|
|
368
|
+};
|
333
|
369
|
</script>
|
334
|
370
|
|
335
|
371
|
<style scoped rel="stylesheet/scss" lang="scss">
|
336
|
|
- .parent{
|
337
|
|
- position: relative;
|
338
|
|
- width: 160px;
|
339
|
|
- height: 120px;
|
340
|
|
- left: 20px;
|
341
|
|
- }
|
342
|
|
- .parent .text{
|
343
|
|
- display: inline-block;
|
344
|
|
- transform: rotate(-45deg);
|
345
|
|
- padding: 20px;
|
346
|
|
- color:red;
|
347
|
|
- position: relative;
|
348
|
|
- left: -60px;
|
349
|
|
- }
|
350
|
|
- .triangle-topleft{
|
351
|
|
- width: 0;
|
352
|
|
- height: 0;
|
353
|
|
- border-top: 70px solid yellow;
|
354
|
|
- border-right: 70px solid transparent;
|
355
|
|
- position: relative;
|
356
|
|
- margin-top: -140px;
|
357
|
|
- }
|
358
|
|
-
|
359
|
|
- .published-cell {
|
360
|
|
- padding: 20px 15px;
|
361
|
|
- border: none;
|
362
|
|
- border-bottom: 1px solid #e5e8ea;
|
363
|
|
- float: left;
|
364
|
|
- margin: 0;
|
365
|
|
- width: 100%;
|
366
|
|
- border-radius: 0;
|
367
|
|
- position: relative;
|
|
372
|
+.parent {
|
|
373
|
+ position: relative;
|
|
374
|
+ width: 160px;
|
|
375
|
+ height: 120px;
|
|
376
|
+ left: 20px;
|
|
377
|
+}
|
|
378
|
+.parent .text {
|
|
379
|
+ display: inline-block;
|
|
380
|
+ transform: rotate(-45deg);
|
|
381
|
+ padding: 20px;
|
|
382
|
+ color: red;
|
|
383
|
+ position: relative;
|
|
384
|
+ left: -60px;
|
|
385
|
+}
|
|
386
|
+.triangle-topleft {
|
|
387
|
+ width: 0;
|
|
388
|
+ height: 0;
|
|
389
|
+ border-top: 70px solid yellow;
|
|
390
|
+ border-right: 70px solid transparent;
|
|
391
|
+ position: relative;
|
|
392
|
+ margin-top: -140px;
|
|
393
|
+}
|
368
|
394
|
|
369
|
|
- .activity-image-panel {
|
370
|
|
- width: 155px;
|
371
|
|
- height: 122px;
|
372
|
|
- border: 1px #dee2e5 solid;
|
373
|
|
- display: flex;
|
374
|
|
- justify-content: center;
|
375
|
|
- position: relative;
|
376
|
|
- -webkit-border-radius: 4px;
|
377
|
|
- -moz-border-radius: 4px;
|
378
|
|
- border-radius: 4px;
|
379
|
|
- overflow: hidden;
|
380
|
|
- float: left;
|
|
395
|
+.published-cell {
|
|
396
|
+ padding: 20px 15px;
|
|
397
|
+ border: none;
|
|
398
|
+ border-bottom: 1px solid #e5e8ea;
|
|
399
|
+ float: left;
|
|
400
|
+ margin: 0;
|
|
401
|
+ width: 100%;
|
|
402
|
+ border-radius: 0;
|
|
403
|
+ position: relative;
|
381
|
404
|
|
382
|
|
- .status-text {
|
383
|
|
- position: absolute;
|
384
|
|
- font-size: 12px;
|
385
|
|
- color: #fff;
|
386
|
|
- top: 14px;
|
387
|
|
- left: 3px;
|
388
|
|
- -webkit-transform: rotate(316deg);
|
389
|
|
- transform: rotate(316deg);
|
390
|
|
- }
|
|
405
|
+ .activity-image-panel {
|
|
406
|
+ width: 155px;
|
|
407
|
+ height: 122px;
|
|
408
|
+ border: 1px #dee2e5 solid;
|
|
409
|
+ display: flex;
|
|
410
|
+ justify-content: center;
|
|
411
|
+ position: relative;
|
|
412
|
+ -webkit-border-radius: 4px;
|
|
413
|
+ -moz-border-radius: 4px;
|
|
414
|
+ border-radius: 4px;
|
|
415
|
+ overflow: hidden;
|
|
416
|
+ float: left;
|
391
|
417
|
|
392
|
|
- img {
|
393
|
|
- width: 100%;
|
394
|
|
- height: 100%;
|
395
|
|
- object-fit: cover;
|
396
|
|
- object-position: center;
|
397
|
|
- }
|
|
418
|
+ .status-text {
|
|
419
|
+ position: absolute;
|
|
420
|
+ font-size: 12px;
|
|
421
|
+ color: #fff;
|
|
422
|
+ top: 14px;
|
|
423
|
+ left: 3px;
|
|
424
|
+ -webkit-transform: rotate(316deg);
|
|
425
|
+ transform: rotate(316deg);
|
398
|
426
|
}
|
399
|
|
- .activity-image-panel::before {
|
400
|
|
- border-top: 28px solid #5bd18b;
|
401
|
|
- border-right: 28px solid transparent;
|
402
|
|
- border-bottom: 28px solid transparent;
|
403
|
|
- border-left: 28px solid #5bd18b;
|
404
|
|
- position: absolute;
|
405
|
|
- top: 0;
|
406
|
|
- left: 0;
|
407
|
|
- width: 0;
|
408
|
|
- height: 0;
|
409
|
|
- display: block;
|
410
|
|
- content: "";
|
|
427
|
+
|
|
428
|
+ img {
|
|
429
|
+ width: 100%;
|
|
430
|
+ height: 100%;
|
|
431
|
+ object-fit: cover;
|
|
432
|
+ object-position: center;
|
411
|
433
|
}
|
|
434
|
+ }
|
|
435
|
+ .activity-image-panel::before {
|
|
436
|
+ border-top: 28px solid #5bd18b;
|
|
437
|
+ border-right: 28px solid transparent;
|
|
438
|
+ border-bottom: 28px solid transparent;
|
|
439
|
+ border-left: 28px solid #5bd18b;
|
|
440
|
+ position: absolute;
|
|
441
|
+ top: 0;
|
|
442
|
+ left: 0;
|
|
443
|
+ width: 0;
|
|
444
|
+ height: 0;
|
|
445
|
+ display: block;
|
|
446
|
+ content: "";
|
|
447
|
+ }
|
412
|
448
|
|
413
|
|
- .activity-info-panel {
|
414
|
|
- padding: 7px 20px;
|
415
|
|
- width: 60%;
|
416
|
|
- float: left;
|
|
449
|
+ .activity-info-panel {
|
|
450
|
+ padding: 7px 20px;
|
|
451
|
+ width: 60%;
|
|
452
|
+ float: left;
|
417
|
453
|
|
418
|
|
- .title {
|
419
|
|
- padding-bottom: 5px;
|
420
|
|
- margin-bottom: 15px;
|
421
|
|
- a {
|
422
|
|
- color: #495060;
|
423
|
|
- font-size: 20px;
|
424
|
|
- max-width: 100%;
|
425
|
|
- font-weight: 500;
|
426
|
|
- overflow: hidden;
|
427
|
|
- white-space: nowrap;
|
428
|
|
- text-overflow: ellipsis;
|
429
|
|
- display: inline-block;
|
430
|
|
- }
|
431
|
|
- }
|
|
454
|
+ .title {
|
|
455
|
+ padding-bottom: 5px;
|
|
456
|
+ margin-bottom: 15px;
|
|
457
|
+ a {
|
|
458
|
+ color: #495060;
|
|
459
|
+ font-size: 20px;
|
|
460
|
+ max-width: 100%;
|
|
461
|
+ font-weight: 500;
|
|
462
|
+ overflow: hidden;
|
|
463
|
+ white-space: nowrap;
|
|
464
|
+ text-overflow: ellipsis;
|
|
465
|
+ display: inline-block;
|
|
466
|
+ }
|
|
467
|
+ }
|
432
|
468
|
|
433
|
|
- .statistics {
|
434
|
|
- color: #a8b3ba;
|
435
|
|
- font-size: 15px;
|
436
|
|
- justify-content: space-between;
|
437
|
|
- line-height: 30px;
|
438
|
|
- }
|
|
469
|
+ .statistics {
|
|
470
|
+ color: #a8b3ba;
|
|
471
|
+ font-size: 15px;
|
|
472
|
+ justify-content: space-between;
|
|
473
|
+ line-height: 30px;
|
439
|
474
|
}
|
|
475
|
+ }
|
440
|
476
|
|
441
|
|
- .activity-time-panel {
|
442
|
|
- float: right;
|
443
|
|
- padding: 7px 0;
|
|
477
|
+ .activity-time-panel {
|
|
478
|
+ float: right;
|
|
479
|
+ padding: 7px 0;
|
444
|
480
|
|
445
|
|
- .time {
|
446
|
|
- font-size: 15px;
|
447
|
|
- color: #a8b3ba;
|
448
|
|
- }
|
449
|
|
- }
|
450
|
|
- .center{
|
451
|
|
- font-size:15px;
|
452
|
|
- color: #a8b3ba;
|
453
|
|
- }
|
454
|
|
- .checkbox{
|
455
|
|
- float:left;
|
456
|
|
- position: relative;
|
457
|
|
- left:-10px;
|
|
481
|
+ .time {
|
|
482
|
+ font-size: 15px;
|
|
483
|
+ color: #a8b3ba;
|
458
|
484
|
}
|
|
485
|
+ }
|
|
486
|
+ .center {
|
|
487
|
+ font-size: 15px;
|
|
488
|
+ color: #a8b3ba;
|
|
489
|
+ }
|
|
490
|
+ .checkbox {
|
|
491
|
+ float: left;
|
|
492
|
+ position: relative;
|
|
493
|
+ left: -10px;
|
|
494
|
+ }
|
459
|
495
|
}
|
460
|
|
-
|
461
|
496
|
</style>
|