feat:【antd】【mall】diy-editor 代码风格统一 & 逐个测试 70%
This commit is contained in:
@@ -59,7 +59,7 @@ onMounted(async () => {
|
|||||||
}"
|
}"
|
||||||
:multiple="multiple"
|
:multiple="multiple"
|
||||||
:tree-checkable="multiple"
|
:tree-checkable="multiple"
|
||||||
class="w-1/1"
|
class="w-full"
|
||||||
placeholder="请选择商品分类"
|
placeholder="请选择商品分类"
|
||||||
allow-clear
|
allow-clear
|
||||||
tree-default-expand-all
|
tree-default-expand-all
|
||||||
|
|||||||
@@ -315,17 +315,17 @@ onMounted(() => {
|
|||||||
>
|
>
|
||||||
<Tooltip title="重置">
|
<Tooltip title="重置">
|
||||||
<Button @click="handleReset">
|
<Button @click="handleReset">
|
||||||
<IconifyIcon class="size-6" icon="lucide:refresh-cw" />
|
<IconifyIcon class="size-5" icon="lucide:refresh-cw" />
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip v-if="previewUrl" title="预览">
|
<Tooltip v-if="previewUrl" title="预览">
|
||||||
<Button @click="handlePreview">
|
<Button @click="handlePreview">
|
||||||
<IconifyIcon class="size-6" icon="lucide:eye" />
|
<IconifyIcon class="size-5" icon="lucide:eye" />
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip title="保存">
|
<Tooltip title="保存">
|
||||||
<Button @click="handleSave">
|
<Button @click="handleSave">
|
||||||
<IconifyIcon class="size-6" icon="lucide:check" />
|
<IconifyIcon class="size-5" icon="lucide:check" />
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Button.Group>
|
</Button.Group>
|
||||||
|
|||||||
@@ -26,35 +26,28 @@ defineOptions({ name: 'DiyTemplateDecorate' });
|
|||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { refreshTab } = useTabs();
|
const { refreshTab } = useTabs();
|
||||||
|
|
||||||
/** 特殊:存储 reset 重置时,当前 selectedTemplateItem 值,从而进行恢复 */
|
const DIY_PAGE_INDEX_KEY = 'diy_page_index'; // 特殊:存储 reset 重置时,当前 selectedTemplateItem 值,从而进行恢复
|
||||||
const DIY_PAGE_INDEX_KEY = 'diy_page_index';
|
|
||||||
|
|
||||||
const selectedTemplateItem = ref(0);
|
const selectedTemplateItem = ref(0);
|
||||||
/** 左上角工具栏操作按钮 */
|
|
||||||
const templateItems = ref([
|
const templateItems = ref([
|
||||||
{ name: '基础设置', icon: 'lucide:settings' },
|
{ name: '基础设置', icon: 'lucide:settings' },
|
||||||
{ name: '首页', icon: 'lucide:home' },
|
{ name: '首页', icon: 'lucide:home' },
|
||||||
{ name: '我的', icon: 'lucide:user' },
|
{ name: '我的', icon: 'lucide:user' },
|
||||||
]);
|
]); // 左上角工具栏操作按钮
|
||||||
|
|
||||||
const formData = ref<MallDiyTemplateApi.DiyTemplateProperty>();
|
const formData = ref<MallDiyTemplateApi.DiyTemplateProperty>();
|
||||||
/** 当前编辑的属性 */
|
|
||||||
const currentFormData = ref<
|
const currentFormData = ref<
|
||||||
MallDiyPageApi.DiyPage | MallDiyTemplateApi.DiyTemplateProperty
|
MallDiyPageApi.DiyPage | MallDiyTemplateApi.DiyTemplateProperty
|
||||||
>({
|
>({
|
||||||
property: '',
|
property: '',
|
||||||
} as MallDiyPageApi.DiyPage);
|
} as MallDiyPageApi.DiyPage); // 当前编辑的属性
|
||||||
/** templateItem 对应的缓存 */
|
|
||||||
const currentFormDataMap = ref<
|
const currentFormDataMap = ref<
|
||||||
Map<string, MallDiyPageApi.DiyPage | MallDiyTemplateApi.DiyTemplateProperty>
|
Map<string, MallDiyPageApi.DiyPage | MallDiyTemplateApi.DiyTemplateProperty>
|
||||||
>(new Map());
|
>(new Map()); // templateItem 对应的缓存
|
||||||
|
|
||||||
/** 商城 H5 预览地址 */
|
const previewUrl = ref(''); // 商城 H5 预览地址
|
||||||
const previewUrl = ref('');
|
|
||||||
|
|
||||||
/** 模板组件库 */
|
const templateLibs = [] as DiyComponentLibrary[]; // 模板组件库
|
||||||
const templateLibs = [] as DiyComponentLibrary[];
|
|
||||||
/** 当前组件库 */
|
|
||||||
const libs = ref<DiyComponentLibrary[]>(templateLibs); // 当前组件库
|
const libs = ref<DiyComponentLibrary[]>(templateLibs); // 当前组件库
|
||||||
|
|
||||||
/** 获取详情 */
|
/** 获取详情 */
|
||||||
@@ -76,6 +69,7 @@ async function getPageDetail(id: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 模板选项切换 */
|
/** 模板选项切换 */
|
||||||
|
// TODO @xingyu:貌似切换不对;“个人中心”切换不过去;
|
||||||
function handleTemplateItemChange(event: any) {
|
function handleTemplateItemChange(event: any) {
|
||||||
// 从事件对象中获取值
|
// 从事件对象中获取值
|
||||||
const val = event.target?.value ?? event;
|
const val = event.target?.value ?? event;
|
||||||
@@ -227,7 +221,7 @@ onMounted(async () => {
|
|||||||
>
|
>
|
||||||
<IconifyIcon
|
<IconifyIcon
|
||||||
:icon="item.icon"
|
:icon="item.icon"
|
||||||
class="mt-2 flex size-6 items-center"
|
class="mt-2 flex size-5 items-center"
|
||||||
/>
|
/>
|
||||||
</Radio.Button>
|
</Radio.Button>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user