From 560e00ae96b079bd2272308c251118653799027f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=96=B5=E4=BD=A0=E4=B8=AA=E6=B1=AA=E5=91=80?= Date: Mon, 25 Aug 2025 15:52:23 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=89=20build(web):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?`Element`=E5=9B=BE=E6=A0=87=E7=B1=BB=E5=9E=8B=E5=A3=B0=E6=98=8E?= =?UTF-8?q?=E7=94=9F=E6=88=90=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Web/package.json | 1 + Web/script/genEleIconTypes.js | 15 ++ Web/src/types/ele-icons.d.ts | 300 ++++++++++++++++++++++++++++++++++ 3 files changed, 316 insertions(+) create mode 100644 Web/script/genEleIconTypes.js create mode 100644 Web/src/types/ele-icons.d.ts diff --git a/Web/package.json b/Web/package.json index 5b0ee00d..5922a4b5 100644 --- a/Web/package.json +++ b/Web/package.json @@ -15,6 +15,7 @@ "build-approvalFlow-api": "cd api_build/ && build.bat approvalFlow", "build-dingTalk-api": "cd api_build/ && build.bat dingTalk", "build-goView-api": "cd api_build/ && build.bat goView", + "genEleIconTypes": "node script/genEleIconTypes.js", "translate": "node script/translate.cjs" }, "dependencies": { diff --git a/Web/script/genEleIconTypes.js b/Web/script/genEleIconTypes.js new file mode 100644 index 00000000..02174b52 --- /dev/null +++ b/Web/script/genEleIconTypes.js @@ -0,0 +1,15 @@ +// scripts/generate-icon-types.ts +import * as icons from '@element-plus/icons-vue'; +import fs from 'fs'; + +const iconNames = Object.keys(icons); +const dts = `import type * as Icons from '@element-plus/icons-vue'; +import '@vue/runtime-core'; + +declare module 'vue' { + export interface GlobalComponents { +${iconNames.map(name => ` 'ele-${name}': typeof Icons.${name}`).join('\n')} + } +}`; + +fs.writeFileSync('src/types/ele-icons.d.ts', dts); \ No newline at end of file diff --git a/Web/src/types/ele-icons.d.ts b/Web/src/types/ele-icons.d.ts new file mode 100644 index 00000000..ee406830 --- /dev/null +++ b/Web/src/types/ele-icons.d.ts @@ -0,0 +1,300 @@ +import type * as Icons from '@element-plus/icons-vue'; +import '@vue/runtime-core'; + +declare module 'vue' { + export interface GlobalComponents { + 'ele-AddLocation': typeof Icons.AddLocation + 'ele-Aim': typeof Icons.Aim + 'ele-AlarmClock': typeof Icons.AlarmClock + 'ele-Apple': typeof Icons.Apple + 'ele-ArrowDown': typeof Icons.ArrowDown + 'ele-ArrowDownBold': typeof Icons.ArrowDownBold + 'ele-ArrowLeft': typeof Icons.ArrowLeft + 'ele-ArrowLeftBold': typeof Icons.ArrowLeftBold + 'ele-ArrowRight': typeof Icons.ArrowRight + 'ele-ArrowRightBold': typeof Icons.ArrowRightBold + 'ele-ArrowUp': typeof Icons.ArrowUp + 'ele-ArrowUpBold': typeof Icons.ArrowUpBold + 'ele-Avatar': typeof Icons.Avatar + 'ele-Back': typeof Icons.Back + 'ele-Baseball': typeof Icons.Baseball + 'ele-Basketball': typeof Icons.Basketball + 'ele-Bell': typeof Icons.Bell + 'ele-BellFilled': typeof Icons.BellFilled + 'ele-Bicycle': typeof Icons.Bicycle + 'ele-Bottom': typeof Icons.Bottom + 'ele-BottomLeft': typeof Icons.BottomLeft + 'ele-BottomRight': typeof Icons.BottomRight + 'ele-Bowl': typeof Icons.Bowl + 'ele-Box': typeof Icons.Box + 'ele-Briefcase': typeof Icons.Briefcase + 'ele-Brush': typeof Icons.Brush + 'ele-BrushFilled': typeof Icons.BrushFilled + 'ele-Burger': typeof Icons.Burger + 'ele-Calendar': typeof Icons.Calendar + 'ele-Camera': typeof Icons.Camera + 'ele-CameraFilled': typeof Icons.CameraFilled + 'ele-CaretBottom': typeof Icons.CaretBottom + 'ele-CaretLeft': typeof Icons.CaretLeft + 'ele-CaretRight': typeof Icons.CaretRight + 'ele-CaretTop': typeof Icons.CaretTop + 'ele-Cellphone': typeof Icons.Cellphone + 'ele-ChatDotRound': typeof Icons.ChatDotRound + 'ele-ChatDotSquare': typeof Icons.ChatDotSquare + 'ele-ChatLineRound': typeof Icons.ChatLineRound + 'ele-ChatLineSquare': typeof Icons.ChatLineSquare + 'ele-ChatRound': typeof Icons.ChatRound + 'ele-ChatSquare': typeof Icons.ChatSquare + 'ele-Check': typeof Icons.Check + 'ele-Checked': typeof Icons.Checked + 'ele-Cherry': typeof Icons.Cherry + 'ele-Chicken': typeof Icons.Chicken + 'ele-ChromeFilled': typeof Icons.ChromeFilled + 'ele-CircleCheck': typeof Icons.CircleCheck + 'ele-CircleCheckFilled': typeof Icons.CircleCheckFilled + 'ele-CircleClose': typeof Icons.CircleClose + 'ele-CircleCloseFilled': typeof Icons.CircleCloseFilled + 'ele-CirclePlus': typeof Icons.CirclePlus + 'ele-CirclePlusFilled': typeof Icons.CirclePlusFilled + 'ele-Clock': typeof Icons.Clock + 'ele-Close': typeof Icons.Close + 'ele-CloseBold': typeof Icons.CloseBold + 'ele-Cloudy': typeof Icons.Cloudy + 'ele-Coffee': typeof Icons.Coffee + 'ele-CoffeeCup': typeof Icons.CoffeeCup + 'ele-Coin': typeof Icons.Coin + 'ele-ColdDrink': typeof Icons.ColdDrink + 'ele-Collection': typeof Icons.Collection + 'ele-CollectionTag': typeof Icons.CollectionTag + 'ele-Comment': typeof Icons.Comment + 'ele-Compass': typeof Icons.Compass + 'ele-Connection': typeof Icons.Connection + 'ele-Coordinate': typeof Icons.Coordinate + 'ele-CopyDocument': typeof Icons.CopyDocument + 'ele-Cpu': typeof Icons.Cpu + 'ele-CreditCard': typeof Icons.CreditCard + 'ele-Crop': typeof Icons.Crop + 'ele-DArrowLeft': typeof Icons.DArrowLeft + 'ele-DArrowRight': typeof Icons.DArrowRight + 'ele-DCaret': typeof Icons.DCaret + 'ele-DataAnalysis': typeof Icons.DataAnalysis + 'ele-DataBoard': typeof Icons.DataBoard + 'ele-DataLine': typeof Icons.DataLine + 'ele-Delete': typeof Icons.Delete + 'ele-DeleteFilled': typeof Icons.DeleteFilled + 'ele-DeleteLocation': typeof Icons.DeleteLocation + 'ele-Dessert': typeof Icons.Dessert + 'ele-Discount': typeof Icons.Discount + 'ele-Dish': typeof Icons.Dish + 'ele-DishDot': typeof Icons.DishDot + 'ele-Document': typeof Icons.Document + 'ele-DocumentAdd': typeof Icons.DocumentAdd + 'ele-DocumentChecked': typeof Icons.DocumentChecked + 'ele-DocumentCopy': typeof Icons.DocumentCopy + 'ele-DocumentDelete': typeof Icons.DocumentDelete + 'ele-DocumentRemove': typeof Icons.DocumentRemove + 'ele-Download': typeof Icons.Download + 'ele-Drizzling': typeof Icons.Drizzling + 'ele-Edit': typeof Icons.Edit + 'ele-EditPen': typeof Icons.EditPen + 'ele-Eleme': typeof Icons.Eleme + 'ele-ElemeFilled': typeof Icons.ElemeFilled + 'ele-ElementPlus': typeof Icons.ElementPlus + 'ele-Expand': typeof Icons.Expand + 'ele-Failed': typeof Icons.Failed + 'ele-Female': typeof Icons.Female + 'ele-Files': typeof Icons.Files + 'ele-Film': typeof Icons.Film + 'ele-Filter': typeof Icons.Filter + 'ele-Finished': typeof Icons.Finished + 'ele-FirstAidKit': typeof Icons.FirstAidKit + 'ele-Flag': typeof Icons.Flag + 'ele-Fold': typeof Icons.Fold + 'ele-Folder': typeof Icons.Folder + 'ele-FolderAdd': typeof Icons.FolderAdd + 'ele-FolderChecked': typeof Icons.FolderChecked + 'ele-FolderDelete': typeof Icons.FolderDelete + 'ele-FolderOpened': typeof Icons.FolderOpened + 'ele-FolderRemove': typeof Icons.FolderRemove + 'ele-Food': typeof Icons.Food + 'ele-Football': typeof Icons.Football + 'ele-ForkSpoon': typeof Icons.ForkSpoon + 'ele-Fries': typeof Icons.Fries + 'ele-FullScreen': typeof Icons.FullScreen + 'ele-Goblet': typeof Icons.Goblet + 'ele-GobletFull': typeof Icons.GobletFull + 'ele-GobletSquare': typeof Icons.GobletSquare + 'ele-GobletSquareFull': typeof Icons.GobletSquareFull + 'ele-GoldMedal': typeof Icons.GoldMedal + 'ele-Goods': typeof Icons.Goods + 'ele-GoodsFilled': typeof Icons.GoodsFilled + 'ele-Grape': typeof Icons.Grape + 'ele-Grid': typeof Icons.Grid + 'ele-Guide': typeof Icons.Guide + 'ele-Handbag': typeof Icons.Handbag + 'ele-Headset': typeof Icons.Headset + 'ele-Help': typeof Icons.Help + 'ele-HelpFilled': typeof Icons.HelpFilled + 'ele-Hide': typeof Icons.Hide + 'ele-Histogram': typeof Icons.Histogram + 'ele-HomeFilled': typeof Icons.HomeFilled + 'ele-HotWater': typeof Icons.HotWater + 'ele-House': typeof Icons.House + 'ele-IceCream': typeof Icons.IceCream + 'ele-IceCreamRound': typeof Icons.IceCreamRound + 'ele-IceCreamSquare': typeof Icons.IceCreamSquare + 'ele-IceDrink': typeof Icons.IceDrink + 'ele-IceTea': typeof Icons.IceTea + 'ele-InfoFilled': typeof Icons.InfoFilled + 'ele-Iphone': typeof Icons.Iphone + 'ele-Key': typeof Icons.Key + 'ele-KnifeFork': typeof Icons.KnifeFork + 'ele-Lightning': typeof Icons.Lightning + 'ele-Link': typeof Icons.Link + 'ele-List': typeof Icons.List + 'ele-Loading': typeof Icons.Loading + 'ele-Location': typeof Icons.Location + 'ele-LocationFilled': typeof Icons.LocationFilled + 'ele-LocationInformation': typeof Icons.LocationInformation + 'ele-Lock': typeof Icons.Lock + 'ele-Lollipop': typeof Icons.Lollipop + 'ele-MagicStick': typeof Icons.MagicStick + 'ele-Magnet': typeof Icons.Magnet + 'ele-Male': typeof Icons.Male + 'ele-Management': typeof Icons.Management + 'ele-MapLocation': typeof Icons.MapLocation + 'ele-Medal': typeof Icons.Medal + 'ele-Memo': typeof Icons.Memo + 'ele-Menu': typeof Icons.Menu + 'ele-Message': typeof Icons.Message + 'ele-MessageBox': typeof Icons.MessageBox + 'ele-Mic': typeof Icons.Mic + 'ele-Microphone': typeof Icons.Microphone + 'ele-MilkTea': typeof Icons.MilkTea + 'ele-Minus': typeof Icons.Minus + 'ele-Money': typeof Icons.Money + 'ele-Monitor': typeof Icons.Monitor + 'ele-Moon': typeof Icons.Moon + 'ele-MoonNight': typeof Icons.MoonNight + 'ele-More': typeof Icons.More + 'ele-MoreFilled': typeof Icons.MoreFilled + 'ele-MostlyCloudy': typeof Icons.MostlyCloudy + 'ele-Mouse': typeof Icons.Mouse + 'ele-Mug': typeof Icons.Mug + 'ele-Mute': typeof Icons.Mute + 'ele-MuteNotification': typeof Icons.MuteNotification + 'ele-NoSmoking': typeof Icons.NoSmoking + 'ele-Notebook': typeof Icons.Notebook + 'ele-Notification': typeof Icons.Notification + 'ele-Odometer': typeof Icons.Odometer + 'ele-OfficeBuilding': typeof Icons.OfficeBuilding + 'ele-Open': typeof Icons.Open + 'ele-Operation': typeof Icons.Operation + 'ele-Opportunity': typeof Icons.Opportunity + 'ele-Orange': typeof Icons.Orange + 'ele-Paperclip': typeof Icons.Paperclip + 'ele-PartlyCloudy': typeof Icons.PartlyCloudy + 'ele-Pear': typeof Icons.Pear + 'ele-Phone': typeof Icons.Phone + 'ele-PhoneFilled': typeof Icons.PhoneFilled + 'ele-Picture': typeof Icons.Picture + 'ele-PictureFilled': typeof Icons.PictureFilled + 'ele-PictureRounded': typeof Icons.PictureRounded + 'ele-PieChart': typeof Icons.PieChart + 'ele-Place': typeof Icons.Place + 'ele-Platform': typeof Icons.Platform + 'ele-Plus': typeof Icons.Plus + 'ele-Pointer': typeof Icons.Pointer + 'ele-Position': typeof Icons.Position + 'ele-Postcard': typeof Icons.Postcard + 'ele-Pouring': typeof Icons.Pouring + 'ele-Present': typeof Icons.Present + 'ele-PriceTag': typeof Icons.PriceTag + 'ele-Printer': typeof Icons.Printer + 'ele-Promotion': typeof Icons.Promotion + 'ele-QuartzWatch': typeof Icons.QuartzWatch + 'ele-QuestionFilled': typeof Icons.QuestionFilled + 'ele-Rank': typeof Icons.Rank + 'ele-Reading': typeof Icons.Reading + 'ele-ReadingLamp': typeof Icons.ReadingLamp + 'ele-Refresh': typeof Icons.Refresh + 'ele-RefreshLeft': typeof Icons.RefreshLeft + 'ele-RefreshRight': typeof Icons.RefreshRight + 'ele-Refrigerator': typeof Icons.Refrigerator + 'ele-Remove': typeof Icons.Remove + 'ele-RemoveFilled': typeof Icons.RemoveFilled + 'ele-Right': typeof Icons.Right + 'ele-ScaleToOriginal': typeof Icons.ScaleToOriginal + 'ele-School': typeof Icons.School + 'ele-Scissor': typeof Icons.Scissor + 'ele-Search': typeof Icons.Search + 'ele-Select': typeof Icons.Select + 'ele-Sell': typeof Icons.Sell + 'ele-SemiSelect': typeof Icons.SemiSelect + 'ele-Service': typeof Icons.Service + 'ele-SetUp': typeof Icons.SetUp + 'ele-Setting': typeof Icons.Setting + 'ele-Share': typeof Icons.Share + 'ele-Ship': typeof Icons.Ship + 'ele-Shop': typeof Icons.Shop + 'ele-ShoppingBag': typeof Icons.ShoppingBag + 'ele-ShoppingCart': typeof Icons.ShoppingCart + 'ele-ShoppingCartFull': typeof Icons.ShoppingCartFull + 'ele-ShoppingTrolley': typeof Icons.ShoppingTrolley + 'ele-Smoking': typeof Icons.Smoking + 'ele-Soccer': typeof Icons.Soccer + 'ele-SoldOut': typeof Icons.SoldOut + 'ele-Sort': typeof Icons.Sort + 'ele-SortDown': typeof Icons.SortDown + 'ele-SortUp': typeof Icons.SortUp + 'ele-Stamp': typeof Icons.Stamp + 'ele-Star': typeof Icons.Star + 'ele-StarFilled': typeof Icons.StarFilled + 'ele-Stopwatch': typeof Icons.Stopwatch + 'ele-SuccessFilled': typeof Icons.SuccessFilled + 'ele-Sugar': typeof Icons.Sugar + 'ele-Suitcase': typeof Icons.Suitcase + 'ele-SuitcaseLine': typeof Icons.SuitcaseLine + 'ele-Sunny': typeof Icons.Sunny + 'ele-Sunrise': typeof Icons.Sunrise + 'ele-Sunset': typeof Icons.Sunset + 'ele-Switch': typeof Icons.Switch + 'ele-SwitchButton': typeof Icons.SwitchButton + 'ele-SwitchFilled': typeof Icons.SwitchFilled + 'ele-TakeawayBox': typeof Icons.TakeawayBox + 'ele-Ticket': typeof Icons.Ticket + 'ele-Tickets': typeof Icons.Tickets + 'ele-Timer': typeof Icons.Timer + 'ele-ToiletPaper': typeof Icons.ToiletPaper + 'ele-Tools': typeof Icons.Tools + 'ele-Top': typeof Icons.Top + 'ele-TopLeft': typeof Icons.TopLeft + 'ele-TopRight': typeof Icons.TopRight + 'ele-TrendCharts': typeof Icons.TrendCharts + 'ele-Trophy': typeof Icons.Trophy + 'ele-TrophyBase': typeof Icons.TrophyBase + 'ele-TurnOff': typeof Icons.TurnOff + 'ele-Umbrella': typeof Icons.Umbrella + 'ele-Unlock': typeof Icons.Unlock + 'ele-Upload': typeof Icons.Upload + 'ele-UploadFilled': typeof Icons.UploadFilled + 'ele-User': typeof Icons.User + 'ele-UserFilled': typeof Icons.UserFilled + 'ele-Van': typeof Icons.Van + 'ele-VideoCamera': typeof Icons.VideoCamera + 'ele-VideoCameraFilled': typeof Icons.VideoCameraFilled + 'ele-VideoPause': typeof Icons.VideoPause + 'ele-VideoPlay': typeof Icons.VideoPlay + 'ele-View': typeof Icons.View + 'ele-Wallet': typeof Icons.Wallet + 'ele-WalletFilled': typeof Icons.WalletFilled + 'ele-WarnTriangleFilled': typeof Icons.WarnTriangleFilled + 'ele-Warning': typeof Icons.Warning + 'ele-WarningFilled': typeof Icons.WarningFilled + 'ele-Watch': typeof Icons.Watch + 'ele-Watermelon': typeof Icons.Watermelon + 'ele-WindPower': typeof Icons.WindPower + 'ele-ZoomIn': typeof Icons.ZoomIn + 'ele-ZoomOut': typeof Icons.ZoomOut + } +} \ No newline at end of file