feat:【antd】【mp】mp 的代码评审(menu)

pull/260/MERGE
YunaiV 2025-11-20 21:36:36 +08:00
parent 53ef992d1e
commit 5c9a86c0f0
7 changed files with 15 additions and 2 deletions

View File

@ -37,6 +37,7 @@ const menu = computed({
},
});
const showNewsDialog = ref(false);
// TODO @hw reset
const hackResetReplySelect = ref(false);
const isLeave = computed<boolean>(() => !(menu.value.children?.length > 0));

View File

@ -2,3 +2,4 @@ export { default as MenuEditor } from './editor.vue';
export { default as MenuPreviewer } from './previewer.vue';
export type * from './types';
export * from './types';
// TODO @hw这个貌似没用可以考虑删除哈。modules 里,直接用就完事啦!

View File

@ -193,6 +193,8 @@ function onChildDragEnd({ newIndex }: { newIndex: number }) {
</template>
<style lang="scss" scoped>
/** todo @hwantd 和 ele 这里的写法,看看能不能统一; */
.draggable-ghost {
background: #f7fafc;
border: 1px solid #4299e1;

View File

@ -1,6 +1,7 @@
import type { VbenFormSchema } from '#/adapter/form';
import { getSimpleAccountList } from '#/api/mp/account';
/** 菜单未选中标识 */
export const MENU_NOT_SELECTED = '__MENU_NOT_SELECTED__';
@ -10,6 +11,7 @@ export enum Level {
Parent = '1',
Undefined = '0',
}
/** 列表的搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] {
return [

View File

@ -19,7 +19,6 @@ import {
import MenuEditor from '#/views/mp/menu/modules/menu-editor.vue';
import MenuPreviewer from '#/views/mp/menu/modules/menu-previewer.vue';
// Assets for backgrounds
// TODO @hwantd ele ele
import iphoneBackImg from './assets/iphone_backImg.png';
import menuFootImg from './assets/menu_foot.png';
@ -28,12 +27,14 @@ import menuHeadImg from './assets/menu_head.png';
defineOptions({ name: 'MpMenu' });
// ======================== ========================
const loading = ref(false); //
const accountId = ref(-1);
const accountName = ref<string>('');
const menuList = ref<Menu[]>([]);
// ======================== ========================
//
// * 'x'
// * 'x-y'
@ -45,6 +46,7 @@ const activeIndex = ref<string>(MENU_NOT_SELECTED);
const parentIndex = ref(-1);
// ======================== ========================
const showRightPanel = ref(false); //
const isParent = ref<boolean>(true); // MenuEditorname
const activeMenu = ref<Menu>({}); // MenuEditormodelValue
@ -61,7 +63,6 @@ const tempSelfObj = ref<{
});
const dialogNewsVisible = ref(false); //
//
const [AccountForm, accountFormApi] = useVbenForm({
commonConfig: {
componentProps: {
@ -305,6 +306,7 @@ onMounted(async () => {
await nextTick();
await initAccountId();
});
// TODO @hw antd
</script>
<template>

View File

@ -20,6 +20,7 @@ import ReplySelect from '#/views/mp/components/wx-reply/wx-reply.vue';
import menuOptions from './menuOptions';
// TODO @hw menu-
const props = defineProps<{
accountId: number;
isParent: boolean;
@ -40,6 +41,7 @@ const menu = computed({
},
});
const showNewsDialog = ref(false);
// TODO @hw reset
const hackResetWxReplySelect = ref(false);
const isLeave = computed<boolean>(() => !(menu.value.children?.length > 0));
@ -51,6 +53,7 @@ watch(menu, () => {
});
// ======================== ========================
/** 选择素材 */
function selectMaterial(item: any) {
const articleId = item.articleId;

View File

@ -7,6 +7,8 @@ import { IconifyIcon } from '@vben/icons';
import draggable from 'vuedraggable';
// TODO @hw menu-
const props = defineProps<{
accountId: number;
activeIndex: string;