This commit is contained in:
xingyu4j
2025-11-13 16:12:44 +08:00
parent 62f630fd19
commit 100f0a41b6
14 changed files with 150 additions and 166 deletions

View File

@@ -3,7 +3,7 @@ import type { SelectValue } from 'ant-design-vue/es/select';
import type { MpAccountApi } from '#/api/mp/account';
import { onMounted, reactive, ref } from 'vue';
import { onMounted, ref } from 'vue';
import { useRouter } from 'vue-router';
import { message, Select } from 'ant-design-vue';
@@ -18,7 +18,7 @@ const emit = defineEmits<{
const { push } = useRouter();
const account: MpAccountApi.Account = reactive({
const account = ref<MpAccountApi.Account>({
id: -1,
name: '',
}); // 当前选中的公众号
@@ -36,9 +36,9 @@ async function handleQuery() {
// 默认选中第一个,如无数据则不执行
const first = accountList.value[0];
if (first) {
account.id = first.id;
account.name = first.name;
emit('change', account.id, account.name);
account.value.id = first.id;
account.value.name = first.name;
emit('change', account.value.id, account.value.name);
}
}
@@ -46,8 +46,8 @@ async function handleQuery() {
function onChanged(id: SelectValue) {
const found = accountList.value.find((v) => v.id === id);
if (found) {
account.name = found.name;
emit('change', account.id, account.name);
account.value.name = found.name;
emit('change', account.value.id, account.value.name);
}
}