1
1
<template >
2
- <div class =" app-container" >
3
- <doc-alert title =" 公众号素材" url =" https://doc.iocoder.cn/mp/material/" />
4
-
5
- <!-- 搜索工作栏 -->
2
+ <doc-alert title =" 公众号素材" url =" https://doc.iocoder.cn/mp/material/" />
3
+ <!-- 搜索工作栏 -->
4
+ <ContentWrap >
6
5
<el-form
6
+ class =" -mb-15px"
7
7
:model =" queryParams"
8
8
ref =" queryFormRef"
9
- size =" small"
10
9
:inline =" true"
11
- v-show =" showSearch"
12
10
label-width =" 68px"
13
11
>
14
12
<el-form-item label =" 公众号" prop =" accountId" >
15
- <el-select v-model =" queryParams.accountId" placeholder =" 请选择公众号" >
13
+ <el-select v-model =" queryParams.accountId" placeholder =" 请选择公众号" class = " !w-240px " >
16
14
<el-option
17
- v-for =" item in accounts "
18
- :key =" parseInt( item.id) "
15
+ v-for =" item in accountList "
16
+ :key =" item.id"
19
17
:label =" item.name"
20
- :value =" parseInt( item.id) "
18
+ :value =" item.id"
21
19
/>
22
20
</el-select >
23
21
</el-form-item >
24
22
<el-form-item >
25
- <el-button type = " primary " @click =" handleQuery" ><Icon icon =" ep:search" />搜索</el-button >
23
+ <el-button @click =" handleQuery" ><Icon icon =" ep:search" />搜索</el-button >
26
24
<el-button @click =" resetQuery" ><Icon icon =" ep:refresh" />重置</el-button >
27
25
</el-form-item >
28
26
</el-form >
27
+ </ContentWrap >
29
28
29
+ <ContentWrap >
30
30
<el-tabs v-model =" type" @tab-change =" handleTabChange" >
31
31
<!-- tab 1:图片 -->
32
32
<el-tab-pane name =" image" >
44
44
:before-upload =" beforeImageUpload"
45
45
:on-success =" handleUploadSuccess"
46
46
>
47
- <el-button size = " small " type =" primary" >点击上传</el-button >
47
+ <el-button type =" primary" plain >点击上传</el-button >
48
48
<template #tip >
49
- <span class =" el-upload__tip" style =" margin-left : 5px "
50
- > 支持 bmp/png/jpeg/jpg/gif 格式,大小不超过 2M</ span
51
- >
49
+ <span class =" el-upload__tip" style =" margin-left : 5px " >
50
+ 支持 bmp/png/jpeg/jpg/gif 格式,大小不超过 2M
51
+ </ span >
52
52
</template >
53
53
</el-upload >
54
54
</div >
64
64
circle
65
65
@click =" handleDelete(item)"
66
66
v-hasPermi =" ['mp:material:delete']"
67
- ><Icon icon =" ep:delete"
68
- /></el-button >
67
+ >
68
+ <Icon icon =" ep:delete" />
69
+ </el-button >
69
70
</el-row >
70
71
</div >
71
72
</div >
72
73
<!-- 分页组件 -->
73
- <pagination
74
- v-show =" total > 0"
74
+ <Pagination
75
75
:total =" total"
76
76
v-model:page =" queryParams.pageNo"
77
77
v-model:limit =" queryParams.pageSize"
95
95
:on-success =" handleUploadSuccess"
96
96
:before-upload =" beforeVoiceUpload"
97
97
>
98
- <el-button size = " small " type =" primary" >点击上传</el-button >
98
+ <el-button type =" primary" plain >点击上传</el-button >
99
99
<template #tip >
100
- <span class =" el-upload__tip" style =" margin-left : 5px "
101
- > 格式支持 mp3/wma/wav/amr,文件大小不超过 2M,播放长度不超过 60s</ span
102
- >
100
+ <span class =" el-upload__tip" style =" margin-left : 5px " >
101
+ 格式支持 mp3/wma/wav/amr,文件大小不超过 2M,播放长度不超过 60s
102
+ </ span >
103
103
</template >
104
104
</el-upload >
105
105
</div >
118
118
</el-table-column >
119
119
<el-table-column label =" 操作" align =" center" class-name =" small-padding fixed-width" >
120
120
<template #default =" scope " >
121
- <el-button type =" primary" link size = " small " plain @click =" handleDownload(scope.row)"
122
- > <Icon icon =" ep:download" />下载</ el-button
123
- >
121
+ <el-button type =" primary" link plain @click =" handleDownload(scope.row)" >
122
+ <Icon icon =" ep:download" />下载
123
+ </ el-button >
124
124
<el-button
125
125
type =" primary"
126
126
link
127
- size =" small"
128
127
plain
129
128
@click =" handleDelete(scope.row)"
130
129
v-hasPermi =" ['mp:material:delete']"
131
- ><Icon icon =" ep:delete" />删除</el-button
132
130
>
131
+ <Icon icon =" ep:delete" />删除
132
+ </el-button >
133
133
</template >
134
134
</el-table-column >
135
135
</el-table >
136
136
<!-- 分页组件 -->
137
- <pagination
138
- v-show =" total > 0"
137
+ <Pagination
139
138
:total =" total"
140
139
v-model:page =" queryParams.pageNo"
141
140
v-model:limit =" queryParams.pageSize"
149
148
<span ><Icon icon =" ep:video-play" /> 视频</span >
150
149
</template >
151
150
<div class =" add_but" v-hasPermi =" ['mp:material:upload-permanent']" >
152
- <el-button size = " small " type =" primary" @click =" handleAddVideo" >新建视频</el-button >
151
+ <el-button type =" primary" plain @click =" handleAddVideo" >新建视频</el-button >
153
152
</div >
154
153
<!-- 新建视频的弹窗 -->
155
154
<el-dialog
220
219
<span >{{ formatDate(scope.row.createTime) }}</span >
221
220
</template >
222
221
</el-table-column >
223
- <el-table-column
224
- label =" 操作"
225
- align =" center"
226
- fixed =" right"
227
- class-name =" small-padding fixed-width"
228
- >
222
+ <el-table-column label =" 操作" align =" center" fixed =" right" >
229
223
<template #default =" scope " >
230
- <el-button type =" primary" link size = " small " plain @click =" handleDownload(scope.row)"
224
+ <el-button type =" primary" link plain @click =" handleDownload(scope.row)"
231
225
><Icon icon =" ep:download" />下载</el-button
232
226
>
233
227
<el-button
237
231
plain
238
232
@click =" handleDelete(scope.row)"
239
233
v-hasPermi =" ['mp:material:delete']"
240
- ><Icon icon =" ep:delete" />删除</el-button
241
234
>
235
+ <Icon icon =" ep:delete" />删除
236
+ </el-button >
242
237
</template >
243
238
</el-table-column >
244
239
</el-table >
245
240
<!-- 分页组件 -->
246
- <pagination
247
- v-show =" total > 0"
241
+ <Pagination
248
242
:total =" total"
249
243
v-model:page =" queryParams.pageNo"
250
244
v-model:limit =" queryParams.pageSize"
251
245
@pagination =" getList"
252
246
/>
253
247
</el-tab-pane >
254
248
</el-tabs >
255
- </div >
249
+ </ContentWrap >
256
250
</template >
257
-
258
- <script setup>
259
- import { ref } from ' vue'
251
+ <script setup name="MpMaterial">
260
252
import WxVoicePlayer from ' @/views/mp/components/wx-voice-play/main.vue'
261
253
import WxVideoPlayer from ' @/views/mp/components/wx-video-play/main.vue'
262
254
import { getSimpleAccountList } from ' @/api/mp/account'
@@ -275,8 +267,6 @@ const uploadVideoRef = ref()
275
267
const type = ref (' image' )
276
268
// 遮罩层
277
269
const loading = ref (false )
278
- // 显示搜索条件
279
- const showSearch = ref (true )
280
270
// 总条数
281
271
const total = ref (0 )
282
272
// 数据列表
@@ -308,14 +298,14 @@ const uploadRules = reactive({
308
298
})
309
299
310
300
// 公众号账号列表
311
- const accounts = ref ([])
301
+ const accountList = ref ([])
312
302
313
303
onMounted (() => {
314
304
getSimpleAccountList ().then ((data ) => {
315
- accounts .value = data
305
+ accountList .value = data
316
306
// 默认选中第一个
317
- if (accounts .value .length > 0 ) {
318
- setAccountId (accounts .value [0 ].id )
307
+ if (accountList .value .length > 0 ) {
308
+ setAccountId (accountList .value [0 ].id )
319
309
}
320
310
// 加载数据
321
311
getList ()
@@ -365,8 +355,8 @@ const handleQuery = () => {
365
355
const resetQuery = () => {
366
356
queryFormRef .value ? .resetFields ()
367
357
// 默认选中第一个
368
- if (accounts .value .length > 0 ) {
369
- setAccountId (accounts .value [0 ].id )
358
+ if (accountList .value .length > 0 ) {
359
+ setAccountId (accountList .value [0 ].id )
370
360
}
371
361
handleQuery ()
372
362
}
0 commit comments