From f15c8fa05e3e4eae8ef093ba6ba827ad74e38fec Mon Sep 17 00:00:00 2001
From: yangyin <1850366751@qq.com>
Date: 星期二, 05 十一月 2024 10:32:27 +0800
Subject: [PATCH] 常用语联调接口

---
 src/components/iconSelector/index.vue |   32 +++++++++++++++++++++++---------
 1 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/src/components/iconSelector/index.vue b/src/components/iconSelector/index.vue
index 0c44d11..089974f 100644
--- a/src/components/iconSelector/index.vue
+++ b/src/components/iconSelector/index.vue
@@ -33,6 +33,9 @@
 				<div class="icon-selector-warp">
 					<div class="icon-selector-warp-title">{{ title }}</div>
 					<el-tabs v-model="state.fontIconTabActive" @tab-click="onIconClick">
+						<el-tab-pane lazy label="yw" name="yw">
+							<IconList :list="fontIconSheetsFilterList" :empty="emptyDescription" :prefix="state.fontIconPrefix" @get-icon="onColClick" />
+						</el-tab-pane>
 						<el-tab-pane lazy label="ali" name="ali">
 							<IconList :list="fontIconSheetsFilterList" :empty="emptyDescription" :prefix="state.fontIconPrefix" @get-icon="onColClick" />
 						</el-tab-pane>
@@ -111,9 +114,11 @@
 	fontIconWidth: 0,
 	fontIconSearch: '',
 	fontIconPlaceholder: '',
-	fontIconTabActive: 'ali',
+	fontIconTabActive: 'yw',
 	fontIconList: {
 		ali: [],
+		yw: [],
+
 		ele: [],
 		awe: [],
 	},
@@ -145,7 +150,8 @@
 // 鏍规嵁 tab name 绫诲瀷璁剧疆鍥炬爣
 const fontIconTabNameList = () => {
 	let iconList: any = [];
-	if (state.fontIconTabActive === 'ali') iconList = state.fontIconList.ali;
+	if (state.fontIconTabActive === 'yw') iconList = state.fontIconList.yw;
+	else if (state.fontIconTabActive === 'ali') iconList = state.fontIconList.ali;
 	else if (state.fontIconTabActive === 'ele') iconList = state.fontIconList.ele;
 	else if (state.fontIconTabActive === 'awe') iconList = state.fontIconList.awe;
 	return iconList;
@@ -158,8 +164,9 @@
 };
 // 澶勭悊 icon 绫诲瀷锛岀敤浜庡洖鏄炬椂锛宼ab 楂樹寒涓庡垵濮嬪寲鏁版嵁
 const initFontIconName = () => {
-	let name = 'ali';
-	if (props.modelValue!.indexOf('iconfont') > -1) name = 'ali';
+	let name = 'yw';
+	if (props.modelValue!.indexOf('ywiconfont') > -1) name = 'yw';
+	else if (props.modelValue!.indexOf('iconfont') > -1) name = 'ali';
 	else if (props.modelValue!.indexOf('ele-') > -1) name = 'ele';
 	else if (props.modelValue!.indexOf('fa') > -1) name = 'awe';
 	// 鍒濆鍖� tab 楂樹寒鍥炴樉
@@ -167,23 +174,30 @@
 	return name;
 };
 // 鍒濆鍖栨暟鎹�
-const initFontIconData = async (name: string) => {
-	if (name === 'ali') {
+const initFontIconData =  (name: string) => {
+	if (name === 'yw') {
+		// 闃块噷瀛椾綋鍥炬爣浣跨敤 `yw xxx`
+		if (state.fontIconList.yw.length > 0) return;
+		 initIconfont.yw().then((res: any) => {
+			state.fontIconList.yw = res.map((i: string) => `ywifont ${i}`);
+		});
+	} 
+	else if (name === 'ali') {
 		// 闃块噷瀛椾綋鍥炬爣浣跨敤 `iconfont xxx`
 		if (state.fontIconList.ali.length > 0) return;
-		await initIconfont.ali().then((res: any) => {
+		 initIconfont.ali().then((res: any) => {
 			state.fontIconList.ali = res.map((i: string) => `iconfont ${i}`);
 		});
 	} else if (name === 'ele') {
 		// element plus 鍥炬爣
 		if (state.fontIconList.ele.length > 0) return;
-		await initIconfont.ele().then((res: any) => {
+		 initIconfont.ele().then((res: any) => {
 			state.fontIconList.ele = res;
 		});
 	} else if (name === 'awe') {
 		// fontawesome瀛椾綋鍥炬爣浣跨敤 `fa xxx`
 		if (state.fontIconList.awe.length > 0) return;
-		await initIconfont.awe().then((res: any) => {
+		 initIconfont.awe().then((res: any) => {
 			state.fontIconList.awe = res.map((i: string) => `fa ${i}`);
 		});
 	}

--
Gitblit v1.9.3