mirror of
https://gitee.com/yudaocode/yudao-ui-admin-vben.git
synced 2025-12-30 02:22:25 +00:00
feat:【antd/ele】【mp】菜单的 review
This commit is contained in:
@@ -113,4 +113,4 @@ export const menuOptions = [
|
||||
value: 'location_select',
|
||||
label: '选择地理位置',
|
||||
},
|
||||
] as const;
|
||||
];
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/** 菜单类型枚举 */
|
||||
// TODO @hw:这里还有枚举
|
||||
export enum MenuType {
|
||||
CLICK = 'click', // 点击推事件
|
||||
LOCATION_SELECT = 'location_select', // 发送位置
|
||||
|
||||
@@ -291,6 +291,7 @@ function menuToBackend(menu: any) {
|
||||
result.replyHqMusicUrl = menu.reply.hqMusicUrl;
|
||||
return result;
|
||||
}
|
||||
// TODO @hw:antd 和 ele 版本,基本没用自定义组件,他们的 tindwind 需要进一步对齐么?(主要还是考虑维护性哈。)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -300,14 +301,11 @@ function menuToBackend(menu: any) {
|
||||
</template>
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<!-- <ContentWrap> -->
|
||||
<AccountForm class="-mb-15px w-240px" @values-change="onAccountChanged" />
|
||||
|
||||
<!-- </ContentWrap> -->
|
||||
|
||||
<ContentWrap>
|
||||
<div
|
||||
class="public-account-management mx-auto flex w-full max-w-[1200px] flex-wrap items-start gap-[20px]"
|
||||
class="mx-auto flex w-full max-w-[1200px] flex-wrap items-start gap-[20px]"
|
||||
v-loading="loading"
|
||||
>
|
||||
<!--左边配置菜单-->
|
||||
@@ -326,7 +324,7 @@ function menuToBackend(menu: any) {
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="weixin-menu h-[46px] bg-no-repeat pl-[43px] text-[12px]"
|
||||
class="h-[46px] bg-no-repeat pl-[43px] text-[12px]"
|
||||
:style="{ backgroundImage: `url(${menuFootImg})` }"
|
||||
>
|
||||
<Previewer
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, nextTick, ref, watch } from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { IconifyIcon } from '@vben/icons';
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
ElSelect,
|
||||
} from 'element-plus';
|
||||
|
||||
// TODO @hw:import { WxMaterialSelect, WxNews, WxReply } from '#/views/mp/components';
|
||||
import MaterialSelect from '#/views/mp/components/wx-material-select/wx-material-select.vue';
|
||||
import News from '#/views/mp/components/wx-news/wx-news.vue';
|
||||
import ReplySelect from '#/views/mp/components/wx-reply/wx-reply.vue';
|
||||
@@ -40,17 +41,8 @@ const menu = computed({
|
||||
},
|
||||
});
|
||||
const showNewsDialog = ref(false);
|
||||
// TODO @hw:这个 reset 还有用么?
|
||||
const hackResetWxReplySelect = ref(false);
|
||||
const isLeave = computed<boolean>(() => !(menu.value.children?.length > 0));
|
||||
|
||||
watch(menu, () => {
|
||||
hackResetWxReplySelect.value = false; // 销毁组件
|
||||
nextTick(() => {
|
||||
hackResetWxReplySelect.value = true; // 重建组件
|
||||
});
|
||||
});
|
||||
|
||||
// ======================== 菜单编辑(素材选择) ========================
|
||||
|
||||
/** 选择素材 */
|
||||
|
||||
@@ -140,6 +140,7 @@ function onChildDragEnd({ newIndex }: { newIndex: number }) {
|
||||
"
|
||||
@click="menuClicked(parent, x)"
|
||||
>
|
||||
<!-- TODO @hw:尽量用中立的 lucide icon -->
|
||||
<IconifyIcon icon="ep:fold" color="black" />{{ parent.name }}
|
||||
</div>
|
||||
<!-- 以下为二级菜单-->
|
||||
@@ -179,6 +180,7 @@ function onChildDragEnd({ newIndex }: { newIndex: number }) {
|
||||
v-if="!parent.children || parent.children.length < 5"
|
||||
@click="addSubMenu(x, parent)"
|
||||
>
|
||||
<!-- TODO @hw:尽量用中立的 lucide icon -->
|
||||
<IconifyIcon icon="ep:plus" class="" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -192,9 +194,11 @@ function onChildDragEnd({ newIndex }: { newIndex: number }) {
|
||||
v-if="menuList.length < 3"
|
||||
@click="addMenu"
|
||||
>
|
||||
<!-- TODO @hw:尽量用中立的 lucide icon -->
|
||||
<IconifyIcon icon="ep:plus" class="" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.draggable-ghost {
|
||||
background: #f7fafc;
|
||||
|
||||
Reference in New Issue
Block a user