feat:【antd】【mall】diy-editor 代码风格统一 & 逐个测试 70%

pull/252/head
YunaiV 2025-11-12 09:30:46 +08:00
parent 045ccca2a6
commit d4f9bb20dd
3 changed files with 12 additions and 18 deletions

View File

@ -59,7 +59,7 @@ onMounted(async () => {
}"
:multiple="multiple"
:tree-checkable="multiple"
class="w-1/1"
class="w-full"
placeholder="请选择商品分类"
allow-clear
tree-default-expand-all

View File

@ -315,17 +315,17 @@ onMounted(() => {
>
<Tooltip title="重置">
<Button @click="handleReset">
<IconifyIcon class="size-6" icon="lucide:refresh-cw" />
<IconifyIcon class="size-5" icon="lucide:refresh-cw" />
</Button>
</Tooltip>
<Tooltip v-if="previewUrl" title="预览">
<Button @click="handlePreview">
<IconifyIcon class="size-6" icon="lucide:eye" />
<IconifyIcon class="size-5" icon="lucide:eye" />
</Button>
</Tooltip>
<Tooltip title="保存">
<Button @click="handleSave">
<IconifyIcon class="size-6" icon="lucide:check" />
<IconifyIcon class="size-5" icon="lucide:check" />
</Button>
</Tooltip>
</Button.Group>

View File

@ -26,35 +26,28 @@ defineOptions({ name: 'DiyTemplateDecorate' });
const route = useRoute();
const { refreshTab } = useTabs();
/** 特殊:存储 reset 重置时,当前 selectedTemplateItem 值,从而进行恢复 */
const DIY_PAGE_INDEX_KEY = 'diy_page_index';
const DIY_PAGE_INDEX_KEY = 'diy_page_index'; // reset selectedTemplateItem
const selectedTemplateItem = ref(0);
/** 左上角工具栏操作按钮 */
const templateItems = ref([
{ name: '基础设置', icon: 'lucide:settings' },
{ name: '首页', icon: 'lucide:home' },
{ name: '我的', icon: 'lucide:user' },
]);
]); //
const formData = ref<MallDiyTemplateApi.DiyTemplateProperty>();
/** 当前编辑的属性 */
const currentFormData = ref<
MallDiyPageApi.DiyPage | MallDiyTemplateApi.DiyTemplateProperty
>({
property: '',
} as MallDiyPageApi.DiyPage);
/** templateItem 对应的缓存 */
} as MallDiyPageApi.DiyPage); //
const currentFormDataMap = ref<
Map<string, MallDiyPageApi.DiyPage | MallDiyTemplateApi.DiyTemplateProperty>
>(new Map());
>(new Map()); // templateItem
/** 商城 H5 预览地址 */
const previewUrl = ref('');
const previewUrl = ref(''); // H5
/** 模板组件库 */
const templateLibs = [] as DiyComponentLibrary[];
/** 当前组件库 */
const templateLibs = [] as DiyComponentLibrary[]; //
const libs = ref<DiyComponentLibrary[]>(templateLibs); //
/** 获取详情 */
@ -76,6 +69,7 @@ async function getPageDetail(id: any) {
}
/** 模板选项切换 */
// TODO @xingyu
function handleTemplateItemChange(event: any) {
//
const val = event.target?.value ?? event;
@ -227,7 +221,7 @@ onMounted(async () => {
>
<IconifyIcon
:icon="item.icon"
class="mt-2 flex size-6 items-center"
class="mt-2 flex size-5 items-center"
/>
</Radio.Button>
</template>