|
@@ -831,7 +831,16 @@
|
|
|
>
|
|
|
{{ data.pen.icon }}
|
|
|
</i>
|
|
|
- <a class="ml-12 mt-4">选择</a>
|
|
|
+ <a class="ml-12 mt-4" @click="iconsDrawer.show = true">
|
|
|
+ 选择
|
|
|
+ </a>
|
|
|
+ <t-drawer
|
|
|
+ v-model:visible="iconsDrawer.show"
|
|
|
+ header="选择图标"
|
|
|
+ :footer="null"
|
|
|
+ >
|
|
|
+ <Iconfonts :urls="data.iconUrls" @change="onChangeIcon" />
|
|
|
+ </t-drawer>
|
|
|
</div>
|
|
|
</t-space>
|
|
|
</t-collapse-panel>
|
|
@@ -1000,14 +1009,15 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { onBeforeMount, onUnmounted, reactive, ref, watch } from 'vue';
|
|
|
|
|
|
-import CodeEditor from '@/views/components/common/CodeEditor.vue';
|
|
|
+import CodeEditor from './common/CodeEditor.vue';
|
|
|
+import Iconfonts from './common/Iconfonts.vue';
|
|
|
import PenAnimates from './PenAnimates.vue';
|
|
|
import PenDatas from './PenDatas.vue';
|
|
|
import PenEvents from './PenEvents.vue';
|
|
|
|
|
|
import { getCookie } from '@/services/cookie';
|
|
|
import { useSelection } from '@/services/selections';
|
|
|
-import { fonts } from '@/services/common';
|
|
|
+import { autoSave, fonts } from '@/services/common';
|
|
|
import { updatePen } from './pen';
|
|
|
|
|
|
const headers = {
|
|
@@ -1029,11 +1039,16 @@ const tooltipDialog = reactive<any>({
|
|
|
show: false,
|
|
|
});
|
|
|
|
|
|
+const iconsDrawer = reactive<any>({
|
|
|
+ show: false,
|
|
|
+});
|
|
|
+
|
|
|
onBeforeMount(() => {
|
|
|
const d = meta2d.store.data as any;
|
|
|
if (!d.groups) {
|
|
|
d.groups = [];
|
|
|
}
|
|
|
+ data.iconUrls = d.iconUrls;
|
|
|
data.groups = d.groups;
|
|
|
initPenData();
|
|
|
|
|
@@ -1191,6 +1206,16 @@ const onOkTooltip = () => {
|
|
|
tooltipDialog.show = false;
|
|
|
};
|
|
|
|
|
|
+const onChangeIcon = (params: any) => {
|
|
|
+ Object.assign(data.pen, params);
|
|
|
+ meta2d.setValue({
|
|
|
+ id: data.pen.id,
|
|
|
+ icon: params.icon,
|
|
|
+ iconFamily: params.iconFamily,
|
|
|
+ });
|
|
|
+ autoSave(true);
|
|
|
+};
|
|
|
+
|
|
|
onUnmounted(() => {
|
|
|
watcher();
|
|
|
meta2d.off('translatePens', getRect);
|