|
@@ -8,9 +8,7 @@
|
8
|
8
|
</div>
|
9
|
9
|
<div class="moreFilter"></div>
|
10
|
10
|
</div>
|
11
|
|
- <el-table
|
12
|
|
- :data="dynamics.list || []"
|
13
|
|
- >
|
|
11
|
+ <el-table :data="carouselList.records || []">
|
14
|
12
|
<el-table-column
|
15
|
13
|
type="index">
|
16
|
14
|
<template slot-scope="scope">
|
|
@@ -21,21 +19,24 @@
|
21
|
19
|
label="主图">
|
22
|
20
|
<template slot-scope="scope">
|
23
|
21
|
<div class="header">
|
24
|
|
- <img :src="scope.row.imgUrl" alt="" />
|
|
22
|
+ <img :src="scope.row.image" alt="" />
|
25
|
23
|
</div>
|
26
|
24
|
</template>
|
27
|
25
|
</el-table-column>
|
28
|
26
|
<el-table-column
|
29
|
|
- prop="title"
|
|
27
|
+ prop="showType"
|
30
|
28
|
label="类型">
|
31
|
29
|
</el-table-column>
|
32
|
30
|
<el-table-column
|
33
|
|
- prop="desc"
|
|
31
|
+ prop="showPosition"
|
34
|
32
|
label="发布位置">
|
35
|
33
|
</el-table-column>
|
36
|
34
|
<el-table-column
|
37
|
|
- prop="createDate"
|
38
|
|
- label="发布时间">
|
|
35
|
+ label="发布时间"
|
|
36
|
+ width="180">
|
|
37
|
+ <template slot-scope="scope">
|
|
38
|
+ <span>{{FormatDate(scope.row.createDate)}}</span>
|
|
39
|
+ </template>
|
39
|
40
|
</el-table-column>
|
40
|
41
|
<el-table-column
|
41
|
42
|
label="状态"
|
|
@@ -51,8 +52,7 @@
|
51
|
52
|
<template slot-scope="scope">
|
52
|
53
|
<el-button type="text" @click="handleEdit(scope.row)" v-if="scope.row.status === 0" size="small">编辑</el-button>
|
53
|
54
|
<el-button type="text" @click="handlePulic(scope.row)" size="small" v-if="scope.row.status === 0">启用</el-button>
|
54
|
|
- <el-button type="text" @click="handleUnPulic(scope.row)" size="small" v-if="scope.row.status === 1">禁用</el-button>
|
55
|
|
-
|
|
55
|
+ <el-button type="text" @click="Prohibit(scope.row)" size="small" v-if="scope.row.status === 1">禁用</el-button>
|
56
|
56
|
</template>
|
57
|
57
|
</el-table-column>
|
58
|
58
|
</el-table>
|
|
@@ -62,7 +62,7 @@
|
62
|
62
|
layout="prev, pager, next"
|
63
|
63
|
:current-page.sync="currentPage"
|
64
|
64
|
:pageSize="pageSize"
|
65
|
|
- :total="dynamics.total || 0"
|
|
65
|
+ :total="carouselList.total || 0"
|
66
|
66
|
@current-change="getList"
|
67
|
67
|
>
|
68
|
68
|
</el-pagination>
|
|
@@ -70,151 +70,142 @@
|
70
|
70
|
</template>
|
71
|
71
|
|
72
|
72
|
<script>
|
73
|
|
-import { createNamespacedHelpers } from 'vuex';
|
|
73
|
+import { createNamespacedHelpers } from "vuex";
|
|
74
|
+import dayjs from 'dayjs'
|
74
|
75
|
|
75
|
|
-const {mapState: mapDynamicState, mapActions: mapDynamicActions} = createNamespacedHelpers('dynamic')
|
76
|
|
-const {mapState: mapBuildingState, mapActions: mapBuildingActions} = createNamespacedHelpers('building')
|
|
76
|
+const {
|
|
77
|
+ mapState: mapCarouselFigureState,
|
|
78
|
+ mapActions: mapCarouselFigureActions
|
|
79
|
+} = createNamespacedHelpers("carouselFigure");
|
|
80
|
+
|
|
81
|
+const {
|
|
82
|
+ mapState: mapBuildingState,
|
|
83
|
+ mapActions: mapBuildingActions
|
|
84
|
+} = createNamespacedHelpers("building");
|
77
|
85
|
|
78
|
86
|
export default {
|
79
|
87
|
data() {
|
80
|
88
|
return {
|
81
|
89
|
pageSize: 20,
|
82
|
90
|
currentPage: 1,
|
83
|
|
- name: '',
|
84
|
|
- buildingId: '',
|
85
|
|
- }
|
|
91
|
+ name: "",
|
|
92
|
+ buildingId: ""
|
|
93
|
+ };
|
86
|
94
|
},
|
87
|
95
|
computed: {
|
88
|
|
- ...mapDynamicState({
|
89
|
|
- dynamics: x => x.dynamics
|
|
96
|
+ ...mapCarouselFigureState({
|
|
97
|
+ carouselList: x => x.carouselList
|
90
|
98
|
}),
|
91
|
99
|
...mapBuildingState({
|
92
|
100
|
buildings: x => x.buildings
|
93
|
101
|
})
|
94
|
102
|
},
|
95
|
103
|
methods: {
|
96
|
|
- ...mapDynamicActions([
|
97
|
|
- 'getDynamics',
|
98
|
|
- 'setDetailNull',
|
99
|
|
- 'deleteDynamics',
|
100
|
|
- 'publicDynamic',
|
101
|
|
- 'cancelDynamic'
|
102
|
|
- ]),
|
103
|
|
- ...mapBuildingActions([
|
104
|
|
- 'getBuildings',
|
105
|
|
- ]),
|
106
|
|
- GetIndex (inx) {
|
107
|
|
- return (this.currentPage - 1) * this.pageSize + inx + 1
|
|
104
|
+ ...mapCarouselFigureActions(["getExtendContent","handleExtendContent"]),
|
|
105
|
+ ...mapBuildingActions(["getBuildings"]),
|
|
106
|
+ GetIndex(inx) {
|
|
107
|
+ return (this.currentPage - 1) * this.pageSize + inx + 1;
|
108
|
108
|
},
|
109
|
|
- FormatDate (date) {
|
110
|
|
- if (date) {
|
111
|
|
- return dayjs(date).formate('yyyy-MM-DD HH:mm:ss')
|
112
|
|
- } else {
|
113
|
|
- return ''
|
114
|
|
- }
|
|
109
|
+ FormatDate(date) {
|
|
110
|
+ if (!date || date.indexOf('0001-') > -1) return ''
|
|
111
|
+
|
|
112
|
+ return dayjs(date).format('YYYY-MM-DD HH:mm:ss')
|
115
|
113
|
},
|
116
|
|
- getList () {
|
117
|
|
- this.getDynamics({
|
|
114
|
+
|
|
115
|
+ getList() {
|
|
116
|
+ this.getExtendContent({
|
118
|
117
|
pageNum: this.currentPage,
|
119
|
|
- pageSize: this.pageSize,
|
120
|
|
- name: this.name,
|
121
|
|
- buildingId: this.buildingId
|
122
|
|
- })
|
|
118
|
+ pageSize: this.pageSize
|
|
119
|
+ });
|
123
|
120
|
},
|
124
|
|
- getBuildingName (id) {
|
125
|
|
- return ((this.buildings.list || []).filter(x => x.buildingId === id)[0] || {}).buildingName || ''
|
|
121
|
+ getBuildingName(id) {
|
|
122
|
+ return (
|
|
123
|
+ ((this.buildings.list || []).filter(x => x.buildingId === id)[0] || {})
|
|
124
|
+ .buildingName || ""
|
|
125
|
+ );
|
126
|
126
|
},
|
127
|
|
- search () {
|
128
|
|
- this.currentPage = 1
|
129
|
|
- this.getList()
|
|
127
|
+ search() {
|
|
128
|
+ this.currentPage = 1;
|
|
129
|
+ this.getList();
|
130
|
130
|
},
|
131
|
|
- handleEdit (row) {
|
132
|
|
- this.setDetailNull()
|
133
|
|
- this.$router.push({name: 'editCarousel', query: {id: row.dynamicId}})
|
|
131
|
+ handleEdit(row) {
|
|
132
|
+ this.$router.push({ name: "editCarousel", query: { id: row.dynamicId } });
|
134
|
133
|
},
|
135
|
|
- handlePulic (row) {
|
136
|
|
- this.$confirm('确认发布此数据?', '提示', {
|
137
|
|
- confirmButtonText: '确定',
|
138
|
|
- cancelButtonText: '取消',
|
139
|
|
- type: 'warning'
|
140
|
|
- }).then(() => {
|
141
|
|
- this.publicDynamic({
|
142
|
|
- id: row.dynamicId
|
143
|
|
- }).then(() => {
|
144
|
|
- this.getList()
|
145
|
|
- })
|
146
|
|
- })
|
|
134
|
+ handlePulic(row) {
|
|
135
|
+ this.$confirm("确认发布此数据?", "提示", {
|
|
136
|
+ confirmButtonText: "确定",
|
|
137
|
+ cancelButtonText: "取消",
|
|
138
|
+ type: "warning"
|
|
139
|
+ }).then(() => {});
|
147
|
140
|
},
|
148
|
|
- handleUnPulic (row) {
|
149
|
|
- this.$confirm('确认取消发布此数据?', '提示', {
|
150
|
|
- confirmButtonText: '确定',
|
151
|
|
- cancelButtonText: '取消',
|
152
|
|
- type: 'warning'
|
|
141
|
+ Prohibit(row) {
|
|
142
|
+ this.$confirm("确认停用此轮播图?", "提示", {
|
|
143
|
+ confirmButtonText: "确定",
|
|
144
|
+ cancelButtonText: "取消",
|
|
145
|
+ type: "warning"
|
153
|
146
|
}).then(() => {
|
154
|
|
- this.cancelDynamic({
|
155
|
|
- id: row.dynamicId}).then(() => {
|
156
|
|
- this.getList()
|
|
147
|
+ this.handleExtendContent(row.contentId)
|
|
148
|
+ .then(res => {
|
|
149
|
+
|
|
150
|
+
|
157
|
151
|
})
|
158
|
|
- })
|
|
152
|
+ .catch(err => {
|
|
153
|
+
|
|
154
|
+ });
|
|
155
|
+ });
|
159
|
156
|
},
|
160
|
|
- handleDel (row) {
|
161
|
|
- this.$confirm('确认删除此数据?', '提示', {
|
162
|
|
- confirmButtonText: '确定',
|
163
|
|
- cancelButtonText: '取消',
|
164
|
|
- type: 'warning'
|
|
157
|
+ handleDel(row) {
|
|
158
|
+ this.$confirm("确认删除此数据?", "提示", {
|
|
159
|
+ confirmButtonText: "确定",
|
|
160
|
+ cancelButtonText: "取消",
|
|
161
|
+ type: "warning"
|
165
|
162
|
}).then(() => {
|
166
|
163
|
if (row.status === 1) {
|
167
|
|
- this.$message.error('当前活动处于发布状态,不允许删除!')
|
168
|
|
- return false
|
|
164
|
+ this.$message.error("当前活动处于发布状态,不允许删除!");
|
|
165
|
+ return false;
|
169
|
166
|
}
|
170
|
|
- this.deleteDynamics({
|
171
|
|
- id: row.dynamicId
|
172
|
|
- }).then(() => {
|
173
|
|
- this.getList()
|
174
|
|
- })
|
175
|
|
- })
|
|
167
|
+ });
|
176
|
168
|
},
|
177
|
|
- addDynamic () {
|
178
|
|
- this.setDetailNull()
|
179
|
|
- this.$router.push({name: 'editCarousel'})
|
|
169
|
+ addDynamic() {
|
|
170
|
+ this.$router.push({ name: "editCarousel" });
|
180
|
171
|
}
|
181
|
172
|
},
|
182
|
|
- created () {
|
|
173
|
+ created() {
|
183
|
174
|
this.getBuildings({
|
184
|
175
|
pageNum: 1,
|
185
|
|
- pageSize: 100,
|
|
176
|
+ pageSize: 100
|
186
|
177
|
}).then(() => {
|
187
|
|
- this.getList()
|
188
|
|
- })
|
|
178
|
+ this.getList();
|
|
179
|
+ });
|
189
|
180
|
}
|
190
|
|
-}
|
|
181
|
+};
|
191
|
182
|
</script>
|
192
|
183
|
|
193
|
184
|
<style lang="scss" scoped>
|
194
|
|
-.header{
|
|
185
|
+.header {
|
195
|
186
|
width: 50px;
|
196
|
187
|
height: 50px;
|
197
|
|
- img{
|
|
188
|
+ img {
|
198
|
189
|
width: 100%;
|
199
|
190
|
height: 100%;
|
200
|
191
|
}
|
201
|
192
|
}
|
202
|
193
|
|
203
|
|
-.system-table-search{
|
|
194
|
+.system-table-search {
|
204
|
195
|
width: calc(100% - 40px);
|
205
|
196
|
margin: 20px auto 0;
|
206
|
197
|
}
|
207
|
198
|
|
208
|
|
-.system-table-search li{
|
|
199
|
+.system-table-search li {
|
209
|
200
|
margin-right: 20px;
|
210
|
201
|
}
|
211
|
202
|
|
212
|
|
-.system-table-search ul{
|
|
203
|
+.system-table-search ul {
|
213
|
204
|
font-size: 0;
|
214
|
205
|
white-space: nowrap;
|
215
|
206
|
}
|
216
|
207
|
|
217
|
|
-.system-table-search ul>li{
|
|
208
|
+.system-table-search ul > li {
|
218
|
209
|
display: inline-block;
|
219
|
210
|
}
|
220
|
211
|
|