fix: todo修复

This commit is contained in:
hw
2025-11-21 18:19:42 +08:00
parent 0251dc2f3b
commit 8d7d3d5fe1
86 changed files with 963 additions and 1195 deletions

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -16,11 +16,12 @@ import {
MENU_NOT_SELECTED,
useGridFormSchema,
} from '#/views/mp/menu/data';
import { MenuEditor, MenuPreviewer } from '#/views/mp/menu/modules';
import Editor from '#/views/mp/menu/modules/editor.vue';
import Previewer from '#/views/mp/menu/modules/previewer.vue';
import iphoneBackImg from './modules/assets/iphone_backImg.png';
import menuFootImg from './modules/assets/menu_foot.png';
import menuHeadImg from './modules/assets/menu_head.png';
import iphoneBackImg from './assets/iphone_backImg.png';
import menuFootImg from './assets/menu_foot.png';
import menuHeadImg from './assets/menu_head.png';
defineOptions({ name: 'MpMenu' });
@@ -64,8 +65,8 @@ const parentIndex = ref(-1);
// ======================== 菜单编辑 ========================
const showRightPanel = ref(false); // 右边配置显示默认详情还是配置详情
const isParent = ref<boolean>(true); // 是否一级菜单,控制MenuEditor中name字段长度
const activeMenu = ref<Menu>({}); // 选中菜单,MenuEditor的modelValue
const isParent = ref<boolean>(true); // 是否一级菜单控制Editor中name字段长度
const activeMenu = ref<Menu>({}); // 选中菜单Editor的modelValue
// 一些临时值放在这里进行判断,如果放在 activeMenu由于引用关系menu 也会多了多余的参数
const tempSelfObj = ref<{
@@ -327,7 +328,7 @@ function menuToBackend(menu: any) {
class="bg-[position:0_0] bg-no-repeat pl-[43px] text-xs after:clear-both after:table after:content-['']"
:style="{ backgroundImage: `url(${menuFootImg})` }"
>
<MenuPreviewer
<Previewer
v-model="menuList"
:account-id="accountId"
:active-index="activeIndex"
@@ -354,7 +355,7 @@ function menuToBackend(menu: any) {
class="float-left ml-5 box-border w-[63%] bg-[#e8e7e7] p-5"
v-if="showRightPanel"
>
<MenuEditor
<Editor
:account-id="accountId"
:is-parent="isParent"
v-model="activeMenu"

View File

@@ -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';
@@ -37,17 +37,8 @@ const menu = computed({
},
});
const showNewsDialog = ref(false);
// TODO @hw这个 reset 还有用么?
const hackResetReplySelect = ref(false);
const isLeave = computed<boolean>(() => !(menu.value.children?.length > 0));
watch(menu, () => {
hackResetReplySelect.value = false; // 销毁组件
nextTick(() => {
hackResetReplySelect.value = true; // 重建组件
});
});
// ======================== 菜单编辑(素材选择) ========================
/** 选择素材 */

View File

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