review:【antd】【mp】material、message 的迁移 v1
This commit is contained in:
@@ -1 +1,2 @@
|
||||
// TODO @dylan:yudao-ui-admin-vben-v5/apps/web-antd/src/views/mp/components 要不加个 index.ts,统一 export 所有的组件
|
||||
export { default as WxAccountSelect } from './main.vue';
|
||||
|
||||
@@ -12,23 +12,19 @@ import { getSimpleAccountList } from '#/api/mp/account';
|
||||
|
||||
defineOptions({ name: 'WxAccountSelect' });
|
||||
|
||||
// 定义事件
|
||||
const emit = defineEmits<{
|
||||
(e: 'change', id: number, name: string): void;
|
||||
}>();
|
||||
// 消息弹窗
|
||||
|
||||
const { push } = useRouter();
|
||||
|
||||
// 当前选中的公众号
|
||||
const account: MpAccountApi.Account = reactive({
|
||||
id: -1,
|
||||
name: '',
|
||||
});
|
||||
}); // 当前选中的公众号
|
||||
const accountList = ref<MpAccountApi.Account[]>([]); // 公众号列表
|
||||
|
||||
// 公众号列表
|
||||
const accountList = ref<MpAccountApi.Account[]>([]);
|
||||
|
||||
// 查询公众号列表
|
||||
/** 查询公众号列表 */
|
||||
async function handleQuery() {
|
||||
accountList.value = await getSimpleAccountList();
|
||||
if (accountList.value.length === 0) {
|
||||
@@ -46,7 +42,7 @@ async function handleQuery() {
|
||||
}
|
||||
}
|
||||
|
||||
// 切换选中公众号
|
||||
/** 切换选中公众号 */
|
||||
function onChanged(id: SelectValue) {
|
||||
const found = accountList.value.find((v) => v.id === id);
|
||||
if (found) {
|
||||
@@ -55,7 +51,7 @@ function onChanged(id: SelectValue) {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化
|
||||
/** 初始化 */
|
||||
onMounted(handleQuery);
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user