🍉 build(web): 添加Element图标类型声明生成脚本

This commit is contained in:
喵你个汪呀 2025-08-25 15:52:23 +08:00
parent c33e1d2742
commit 560e00ae96
3 changed files with 316 additions and 0 deletions

View File

@ -15,6 +15,7 @@
"build-approvalFlow-api": "cd api_build/ && build.bat approvalFlow", "build-approvalFlow-api": "cd api_build/ && build.bat approvalFlow",
"build-dingTalk-api": "cd api_build/ && build.bat dingTalk", "build-dingTalk-api": "cd api_build/ && build.bat dingTalk",
"build-goView-api": "cd api_build/ && build.bat goView", "build-goView-api": "cd api_build/ && build.bat goView",
"genEleIconTypes": "node script/genEleIconTypes.js",
"translate": "node script/translate.cjs" "translate": "node script/translate.cjs"
}, },
"dependencies": { "dependencies": {

View File

@ -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);

300
Web/src/types/ele-icons.d.ts vendored Normal file
View File

@ -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
}
}