File tree Expand file tree Collapse file tree 5 files changed +15
-14
lines changed
components/wx-account-select Expand file tree Collapse file tree 5 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,6 @@ const emit = defineEmits<{
17
17
(e : ' change' , id ? : number , name ? : string ): void
18
18
}>()
19
19
20
- onMounted (() => {
21
- handleQuery ()
22
- })
23
-
24
20
const handleQuery = async () => {
25
21
accountList .value = await MpAccountApi .getSimpleAccountList ()
26
22
// 默认选中第一个
@@ -33,4 +29,9 @@ const handleQuery = async () => {
33
29
const onChanged = () => {
34
30
emit (' change' , account .id , account .name )
35
31
}
32
+
33
+ /** 初始化 */
34
+ onMounted (() => {
35
+ handleQuery ()
36
+ })
36
37
</script >
Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ export const createEditorConfig = (
21
21
allowedFileTypes : [ 'image/*' ] ,
22
22
23
23
// 自定义上传参数,例如传递验证的 token 等。参数会被添加到 formData 中,一起上传到服务端。
24
- meta : { accountId : accountId } ,
24
+ meta : {
25
+ accountId : accountId ,
26
+ type : 'image'
27
+ } ,
25
28
// 将 meta 拼接到 url 参数中,默认 false
26
29
metaWithUrl : true ,
27
30
@@ -64,7 +67,7 @@ export const createEditorConfig = (
64
67
} ,
65
68
// 自定义插入图片
66
69
customInsert ( res : any , insertFn : InsertFnType ) {
67
- insertFn ( res . data , 'image' , res . data )
70
+ insertFn ( res . data . url , 'image' , res . data . url )
68
71
}
69
72
}
70
73
}
Original file line number Diff line number Diff line change @@ -265,8 +265,7 @@ import * as MpDraftApi from '@/api/mp/draft'
265
265
import * as MpFreePublishApi from ' @/api/mp/freePublish'
266
266
import type { UploadFiles , UploadProps , UploadRawFile } from ' element-plus'
267
267
import { createEditorConfig } from ' ./editor-config'
268
- // 可以用改本地数据模拟,避免API调用超限
269
- import drafts from ' ./mock'
268
+ // import drafts from './mock' // 可以用改本地数据模拟,避免API调用超限
270
269
import { IEditorConfig } from ' @wangeditor/editor'
271
270
272
271
const message = useMessage () // 消息
@@ -342,7 +341,7 @@ const editorConfig = ref<Partial<IEditorConfig>>({})
342
341
const getList = async () => {
343
342
loading .value = true
344
343
try {
345
- // const drafts = await MpDraftApi.getDraftPage(queryParams)
344
+ const drafts = await MpDraftApi .getDraftPage (queryParams )
346
345
drafts .list .forEach ((item ) => {
347
346
const newsItem = item .content .newsItem
348
347
// 将 thumbUrl 转成 picUrl,保证 wx-news 组件可以预览封面
Original file line number Diff line number Diff line change @@ -143,5 +143,3 @@ const props = defineProps({
143
143
144
144
const emit = defineEmits <{ (e : ' send' , v : number ) }>()
145
145
</script >
146
-
147
- <style scoped></style >
Original file line number Diff line number Diff line change 58
58
59
59
<!-- 列表 -->
60
60
<ContentWrap >
61
- <DataGrid :list =" list" :loading =" loading" @send =" handleSend" />
61
+ <MessageTable :list =" list" :loading =" loading" @send =" handleSend" />
62
62
<Pagination
63
63
v-show =" total > 0"
64
64
:total =" total"
83
83
import * as MpMessageApi from ' @/api/mp/message'
84
84
import WxMsg from ' @/views/mp/components/wx-msg/main.vue'
85
85
import WxAccountSelect from ' @/views/mp/components/wx-account-select/main.vue'
86
- import DataGrid from ' ./DataGrid .vue'
86
+ import MessageTable from ' ./MessageTable .vue'
87
87
import { DICT_TYPE , getStrDictOptions } from ' @/utils/dict'
88
88
import { MsgType } from ' @/views/mp/components/wx-msg/types'
89
89
import type { FormInstance } from ' element-plus'
@@ -142,7 +142,7 @@ const getList = async () => {
142
142
143
143
/** 重置按钮操作 */
144
144
const resetQuery = async () => {
145
- // 暂存accountId,并在reset后恢复
145
+ // 暂存 accountId,并在 reset 后恢复
146
146
const accountId = queryParams .accountId
147
147
queryFormRef .value ?.resetFields ()
148
148
queryParams .accountId = accountId
You can’t perform that action at this time.
0 commit comments