diff --git a/src/api/mp/account/index.ts b/src/api/mp/account/index.ts index d641ef3c..e973cda3 100644 --- a/src/api/mp/account/index.ts +++ b/src/api/mp/account/index.ts @@ -1,7 +1,7 @@ import request from '@/config/axios' export interface AccountVO { - id?: number + id: number name: string } diff --git a/src/views/mp/autoReply/index.vue b/src/views/mp/autoReply/index.vue index 20a1e683..e2fcd7a0 100644 --- a/src/views/mp/autoReply/index.vue +++ b/src/views/mp/autoReply/index.vue @@ -103,6 +103,7 @@ import ReplyTable from './components/ReplyTable.vue' import { MsgType } from './components/types' const message = useMessage() // 消息 +const accountId = ref(-1) // 公众号ID const msgType = ref(MsgType.Keyword) // 消息类型 const RequestMessageTypes = ['text', 'image', 'voice', 'video', 'shortvideo', 'location', 'link'] // 允许选择的请求消息类型 const loading = ref(true) // 遮罩层 @@ -110,15 +111,10 @@ const total = ref(0) // 总条数 const list = ref([]) // 自动回复列表 const formRef = ref(null) // 表单 ref // 查询参数 -interface QueryParams { - pageNo: number - pageSize: number - accountId: number -} -const queryParams: QueryParams = reactive({ +const queryParams = reactive({ pageNo: 1, pageSize: 10, - accountId: 0 + accountId: accountId }) const dialogTitle = ref('') // 弹出层标题 @@ -127,7 +123,7 @@ const replyForm = ref({}) // 表单参数 // 回复消息 const reply = ref({ type: ReplyType.Text, - accountId: 0 + accountId: -1 }) // 表单校验 const rules = { @@ -137,8 +133,9 @@ const rules = { /** 侦听账号变化 */ const onAccountChanged = (id: number) => { - queryParams.accountId = id + accountId.value = id reply.value.accountId = id + queryParams.pageNo = 1 getList() } diff --git a/src/views/mp/components/wx-account-select/main.vue b/src/views/mp/components/wx-account-select/main.vue index 8dbad499..e2501657 100644 --- a/src/views/mp/components/wx-account-select/main.vue +++ b/src/views/mp/components/wx-account-select/main.vue @@ -8,13 +8,14 @@ import * as MpAccountApi from '@/api/mp/account' const account: MpAccountApi.AccountVO = reactive({ - id: undefined, + id: -1, name: '' }) -const accountList: Ref = ref([]) + +const accountList = ref([]) const emit = defineEmits<{ - (e: 'change', id: number, name: string): void + (e: 'change', id: number, name: string) }>() const handleQuery = async () => { diff --git a/src/views/mp/components/wx-msg/components/MsgEvent.vue b/src/views/mp/components/wx-msg/components/MsgEvent.vue new file mode 100644 index 00000000..e13e3112 --- /dev/null +++ b/src/views/mp/components/wx-msg/components/MsgEvent.vue @@ -0,0 +1,51 @@ + + + + + diff --git a/src/views/mp/components/wx-msg/components/MsgList.vue b/src/views/mp/components/wx-msg/components/MsgList.vue new file mode 100644 index 00000000..39f7203c --- /dev/null +++ b/src/views/mp/components/wx-msg/components/MsgList.vue @@ -0,0 +1,110 @@ + + + + + diff --git a/src/views/mp/components/wx-msg/main.vue b/src/views/mp/components/wx-msg/main.vue index 19763245..079e9740 100644 --- a/src/views/mp/components/wx-msg/main.vue +++ b/src/views/mp/components/wx-msg/main.vue @@ -7,123 +7,22 @@ --> diff --git a/src/views/mp/draft/components/CoverSelect.vue b/src/views/mp/draft/components/CoverSelect.vue index 944b7d96..bbb2b44c 100644 --- a/src/views/mp/draft/components/CoverSelect.vue +++ b/src/views/mp/draft/components/CoverSelect.vue @@ -51,7 +51,7 @@ > @@ -93,11 +93,11 @@ const showImageDialog = ref(false) const fileList = ref([]) interface UploadData { type: UploadType - accountId: number | undefined + accountId: number } const uploadData: UploadData = reactive({ type: UploadType.Image, - accountId: accountId + accountId: accountId! }) /** 素材选择完成事件*/ diff --git a/src/views/mp/draft/components/NewsForm.vue b/src/views/mp/draft/components/NewsForm.vue index a2b88a5b..97166a4b 100644 --- a/src/views/mp/draft/components/NewsForm.vue +++ b/src/views/mp/draft/components/NewsForm.vue @@ -125,7 +125,7 @@ -