diff --git a/src/api/mp/account/index.ts b/src/api/mp/account/index.ts index d641ef3c0377eff948f855cdc1277f95e9923f9a..e973cda3a93e680b78892d5c3d176d5e6cf29fdc 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 20a1e683d40de62100b1900a7c5d629b5c99165c..e2fcd7a0a13e75c437b7b861ea900d17e2dd6aef 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 8dbad499ac96758bda6ee7d65ed6615bda63a3fe..e25016572b0260367b15d1b30ac9df14888f2aed 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 0000000000000000000000000000000000000000..e13e311284d2343d76f28e335f2e1b216ea78ac4 --- /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 0000000000000000000000000000000000000000..39f7203c9f01a22015eab68200ad43ec27ada116 --- /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 19763245c5ed9f323982fb635dd2a1aeba7df3d7..079e9740f626efe5eebc72c4bfc5335405091792 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 944b7d968cab731bd9134c23a038554ec2d09700..bbb2b44c5ccdc499223d889e5a09d412bed97738 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 a2b88a5b3ef65dfc51173fd075282696c3384681..97166a4b149b9c942b5745198033bf350e36ba36 100644 --- a/src/views/mp/draft/components/NewsForm.vue +++ b/src/views/mp/draft/components/NewsForm.vue @@ -125,7 +125,7 @@ -