/*
 * @Author: donghao donghao@supervision.ltd
 * @Date: 2025-07-15 09:49:13
 * @LastEditors: donghao donghao@supervision.ltd
 * @LastEditTime: 2025-07-28 16:58:20
 * @FilePath: \Robot-Al-Platform-Web\src\renderer\src\plugins\elementPlus.ts
 * @Description: element-plus相关插件
 */
import ElementPlus from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import TuiPlus from '@wocwin/t-ui-plus'
import  * as formComps from '@/components/Form'
export default function setupElementPlus(app: App) {
  // 自定义分页器文案
  zhCn.el.pagination = {
    goto: '前往',
    pageClassifier: '',
    pagesize: '条/页',
    total: '共 {total} 条'
  }
  // 全局注册所有图标
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }
    // 全局注册自定义表单组件
  for (const [key, component] of Object.entries(formComps)) {
    app.component(key, component)
  }
  app.use(ElementPlus, {
    locale: zhCn,
    size: 'large', // 全局组件尺寸
    zIndex: 3000 // 全局z-index
  })
  app.use(TuiPlus)
}
