|
@@ -89,7 +89,7 @@
|
89
|
89
|
</el-table-column>
|
90
|
90
|
<el-table-column label="所属分类" align="center" prop="cmsCategory.name" width="200"/>
|
91
|
91
|
<el-table-column label="浏览量" align="center" prop="viewCount" width="140"/>
|
92
|
|
- <el-table-column label="是否置顶" align="center" prop="isTop" width="140">
|
|
92
|
+ <el-table-column label="置顶" align="center" prop="isTop" width="140">
|
93
|
93
|
<template slot-scope="scope">
|
94
|
94
|
<el-switch
|
95
|
95
|
v-model="scope.row.isTop"
|
|
@@ -97,6 +97,14 @@
|
97
|
97
|
></el-switch>
|
98
|
98
|
</template>
|
99
|
99
|
</el-table-column>
|
|
100
|
+ <el-table-column label="轮播" align="center" prop="carousel" width="140">
|
|
101
|
+ <template slot-scope="scope">
|
|
102
|
+ <el-switch
|
|
103
|
+ v-model="scope.row.carousel"
|
|
104
|
+ @change="handleCarouselStatusChange(scope.row)"
|
|
105
|
+ ></el-switch>
|
|
106
|
+ </template>
|
|
107
|
+ </el-table-column>
|
100
|
108
|
<el-table-column label="创建人" align="center" prop="createBy" width="150"/>
|
101
|
109
|
<el-table-column label="创建时间" align="center" prop="createTime" width="150">
|
102
|
110
|
<template slot-scope="scope">
|
|
@@ -142,7 +150,7 @@
|
142
|
150
|
|
143
|
151
|
|
144
|
152
|
<!-- 添加或修改信息管理对话框 -->
|
145
|
|
- <el-dialog :title="title" :visible.sync="open" width="800px" style="height: 600px; margin-top: 100px" append-to-body>
|
|
153
|
+ <el-dialog :title="title" :visible.sync="open" width="800px" style="height: 600px; margin-top: 100px" append-to-body append-to-body :close-on-click-modal="false">
|
146
|
154
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
147
|
155
|
<el-form-item label="所属分类" prop="categoryId">
|
148
|
156
|
<el-select v-model="form.categoryId" placeholder="请选择">
|
|
@@ -172,6 +180,9 @@
|
172
|
180
|
<el-form-item label="是否置顶">
|
173
|
181
|
<el-switch v-model="form.isTop"></el-switch>
|
174
|
182
|
</el-form-item>
|
|
183
|
+ <el-form-item label="是否轮播">
|
|
184
|
+ <el-switch v-model="form.carousel"></el-switch>
|
|
185
|
+ </el-form-item>
|
175
|
186
|
<el-form-item label="缩略图">
|
176
|
187
|
<image-upload :limit="1" :file-size="10" :file-type="['.png', '.jpg', '.jpeg', '.gif']" v-model="form.thumbnail"></image-upload>
|
177
|
188
|
</el-form-item>
|
|
@@ -188,7 +199,7 @@
|
188
|
199
|
</div>
|
189
|
200
|
</el-dialog>
|
190
|
201
|
<!-- 知识库详情 -->
|
191
|
|
- <el-dialog title="预览详情" :visible.sync="viewOpen" width="1000px" append-to-body>
|
|
202
|
+ <el-dialog title="预览详情" :visible.sync="viewOpen" width="1000px" append-to-body :close-on-click-modal="false">
|
192
|
203
|
<el-row>
|
193
|
204
|
<el-col :span="24" align="center">
|
194
|
205
|
<h2>{{ cmsNewsInfo.title }}</h2>
|
|
@@ -221,7 +232,7 @@
|
221
|
232
|
</template>
|
222
|
233
|
|
223
|
234
|
<script>
|
224
|
|
-import { listCmsNews, getCmsNews, delCmsNews, addCmsNews, updateCmsNews, exportCmsNews, updateTopStatus ,getCmsNewsByCategoryId, frontView} from "@/api/business/cmsNews";
|
|
235
|
+import { listCmsNews, getCmsNews, delCmsNews, addCmsNews, updateCmsNews, exportCmsNews, updateTopStatus ,getCmsNewsByCategoryId, frontView, updateCarouselStatus} from "@/api/business/cmsNews";
|
225
|
236
|
import { treeselect } from "@/api/business/cmsCategory";
|
226
|
237
|
import Treeselect from "@riophae/vue-treeselect";
|
227
|
238
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
@@ -305,6 +316,9 @@ export default {
|
305
|
316
|
isTop: [
|
306
|
317
|
{ required: true, message: "是否置顶不能为空", trigger: "blur" }
|
307
|
318
|
],
|
|
319
|
+ carousel: [
|
|
320
|
+ { required: true, message: "是否轮播不能为空", trigger: "blur" }
|
|
321
|
+ ],
|
308
|
322
|
}
|
309
|
323
|
};
|
310
|
324
|
},
|
|
@@ -392,6 +406,7 @@ export default {
|
392
|
406
|
content: null,
|
393
|
407
|
viewCount: null,
|
394
|
408
|
isTop: false,
|
|
409
|
+ carousel: false,
|
395
|
410
|
thumbnail: null,
|
396
|
411
|
focusImgs:[],
|
397
|
412
|
focusImgsStr: '',
|
|
@@ -426,6 +441,21 @@ export default {
|
426
|
441
|
this.open = true;
|
427
|
442
|
this.title = "添加信息";
|
428
|
443
|
},
|
|
444
|
+ /** 修改轮播状态*/
|
|
445
|
+ handleCarouselStatusChange(row){
|
|
446
|
+ let text = row.carousel ? "轮播" : "取消轮播";
|
|
447
|
+ this.$modal.confirm('确认要' + text + '吗?').then(function() {
|
|
448
|
+ return updateCarouselStatus({
|
|
449
|
+ 'newsId': row.newsId,
|
|
450
|
+ 'carousel': row.carousel
|
|
451
|
+ });
|
|
452
|
+ }).then(() => {
|
|
453
|
+ this.$modal.msgSuccess(text + "成功");
|
|
454
|
+ }).catch(function() {
|
|
455
|
+ row.carousel = row.carousel ? false : true;
|
|
456
|
+ });
|
|
457
|
+ },
|
|
458
|
+ /**修改置顶状态**/
|
429
|
459
|
handleStatusChange(row){
|
430
|
460
|
let text = row.isTop ? "置顶" : "取消置顶";
|
431
|
461
|
this.$modal.confirm('确认要' + text + '吗?').then(function() {
|
|
@@ -500,7 +530,7 @@ export default {
|
500
|
530
|
/** 删除按钮操作 */
|
501
|
531
|
handleDelete(row) {
|
502
|
532
|
const newsIds = row.newsId || this.ids;
|
503
|
|
- this.$modal.confirm('是否确认删除信息管理编号为"' + newsIds + '"的数据项?').then(function() {
|
|
533
|
+ this.$modal.confirm('是否确认删除?').then(function() {
|
504
|
534
|
return delCmsNews(newsIds);
|
505
|
535
|
}).then(() => {
|
506
|
536
|
this.getList();
|
|
@@ -510,7 +540,7 @@ export default {
|
510
|
540
|
/** 导出按钮操作 */
|
511
|
541
|
handleExport() {
|
512
|
542
|
const queryParams = this.queryParams;
|
513
|
|
- this.$modal.confirm('是否确认导出所有信息管理数据项?').then(() => {
|
|
543
|
+ this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
514
|
544
|
this.exportLoading = true;
|
515
|
545
|
return exportCmsNews(queryParams);
|
516
|
546
|
}).then(response => {
|