tongshangming 3 miesięcy temu
rodzic
commit
2dfa692789

+ 0 - 93
src/components/VxeTable.ts

@@ -1,93 +0,0 @@
-import type { App } from 'vue'
-import 'xe-utils'
-import {
-  VxeIcon,
-  VxeLoading,
-  // VxeGrid,
-  VxeTooltip,
-  // VxeToolbar,
-  // VxePager,
-  // VxeForm,
-  // VxeFormItem,
-  // VxeFormGather,
-  // VxeCheckbox,
-  // VxeCheckboxGroup,
-  // VxeRadio,
-  // VxeRadioGroup,
-  // VxeRadioButton,
-  // VxeSwitch,
-  // VxeInput,
-  // VxeSelect,
-  // VxeOptgroup,
-  // VxeOption,
-  // VxeTextarea,
-  VxeButton,
-  // VxeButtonGroup,
-  VxeModal
-  // VxeDrawer,
-  // VxeList,
-  // VxePulldown
-} from 'vxe-pc-ui'
-import {
-  VxeUI,
-  VXETable,
-  VxeTable,
-  VxeColumn,
-  VxeColgroup,
-  // VxeGrid,
-  VxeToolbar
-} from 'vxe-table'
-import VxeUIPluginRenderElement from '@vxe-ui/plugin-render-element'
-import '@vxe-ui/plugin-render-element/dist/style.css'
-import 'vxe-table/styles/cssvar.scss'
-import 'vxe-pc-ui/styles/cssvar.scss'
-
-// 导入默认的语言
-import zhCN from 'vxe-pc-ui/lib/language/zh-CN'
-import '@/utils/tableFormat'
-
-VXETable.setI18n('zh-CN', zhCN)
-VXETable.setLanguage('zh-CN')
-VxeUI.use(VxeUIPluginRenderElement)
-
-function LazyVxeUI(app: any) {
-  app.use(VxeIcon)
-  app.use(VxeLoading)
-  // app.use(VxeVxeGrid)
-  app.use(VxeTooltip)
-  // app.use(VxeToolbar)
-  // app.use(VxePager)
-  // app.use(VxeForm)
-  // app.use(VxeFormItem)
-  // app.use(VxeFormGather)
-  // app.use(VxeCheckbox)
-  // app.use(VxeCheckboxGroup)
-  // app.use(VxeRadio)
-  // app.use(VxeRadioGroup)
-  // app.use(VxeRadioButton)
-  // app.use(VxeSwitch)
-  // app.use(VxeInput)
-  // app.use(VxeSelect)
-  // app.use(VxeOptgroup)
-  // app.use(VxeOption)
-  // app.use(VxeTextarea)
-  app.use(VxeButton)
-  // app.use(VxeButtonGroup)
-  app.use(VxeModal)
-  // app.use(VxeDrawer)
-  // app.use(VxeList)
-  // app.use(VxePulldown)
-}
-function LazyVxeTable(app: any) {
-  app.use(VxeTable)
-  app.use(VxeColumn)
-  app.use(VxeColgroup)
-  // app.use(VxeGrid)
-  app.use(VxeToolbar)
-}
-function registerVxeTable(app: App): void {
-  app.use(LazyVxeUI)
-  app.use(LazyVxeTable)
-}
-
-export default registerVxeTable

+ 2 - 2
src/components/core/GlobalHeader.vue

@@ -249,8 +249,8 @@ const handleSelect = (menu: any) => {
   --el-menu-bg-color: #fff;
   --el-menu-text-color: #303133;
 }
-.el-menu--horizontal {
-  border-bottom: none;
+:deep(.el-menu--horizontal) {
+  border-bottom: none !important;
 }
 .hidden {
   display: none;

+ 1 - 1
src/components/core/GlobalMenu.vue

@@ -49,7 +49,7 @@ watch(
   </el-menu>
 </template>
 
-<style lang="scss">
+<style lang="scss" scoped>
 .menu-normal {
   width: var(--menu-width);
 }

+ 128 - 7
src/components/index.ts

@@ -1,21 +1,142 @@
 import type { App } from 'vue'
+// import { install } from '@icon-park/vue-next/es/all'
+import { System, Check, MenuFoldOne, MenuUnfoldOne, Logout, SettingTwo } from '@icon-park/vue-next'
+
+import ElementPlus from 'element-plus'
+import 'element-plus/dist/index.css'
+import * as ElementPlusIconsVue from '@element-plus/icons-vue'
+
+import 'xe-utils'
+import {
+  VxeIcon,
+  VxeLoading,
+  // VxeGrid,
+  VxeTooltip,
+  // VxeToolbar,
+  // VxePager,
+  // VxeForm,
+  // VxeFormItem,
+  // VxeFormGather,
+  // VxeCheckbox,
+  // VxeCheckboxGroup,
+  // VxeRadio,
+  // VxeRadioGroup,
+  // VxeRadioButton,
+  // VxeSwitch,
+  // VxeInput,
+  // VxeSelect,
+  // VxeOptgroup,
+  // VxeOption,
+  // VxeTextarea,
+  VxeButton,
+  // VxeButtonGroup,
+  VxeModal
+  // VxeDrawer,
+  // VxeList,
+  // VxePulldown
+} from 'vxe-pc-ui'
+import {
+  VxeUI,
+  VXETable,
+  VxeTable,
+  VxeColumn,
+  VxeColgroup,
+  // VxeGrid,
+  VxeToolbar
+} from 'vxe-table'
+import VxeUIPluginRenderElement from '@vxe-ui/plugin-render-element'
+import '@vxe-ui/plugin-render-element/dist/style.css'
+import 'vxe-table/styles/cssvar.scss'
+import 'vxe-pc-ui/styles/cssvar.scss'
+// 导入默认的语言
+import zhCN from 'vxe-pc-ui/lib/language/zh-CN'
+import '@/utils/tableFormat'
+
+// import WujieVue from 'wujie-vue3'
+// import * as Sentry from '@sentry/vue'
 
 const modules = import.meta.glob('./form/*.vue', { eager: true })
-import { System, Check, MenuFoldOne, MenuUnfoldOne, Logout, SettingTwo } from '@icon-park/vue-next'
 
-function registerComponent(app: App): void {
-  for (const key in modules) {
-    const name = key.replace(/^\.\/form\/|\.vue/g, '')
-    const component = (modules[key] as any).default
-    app.component('El' + name, component)
-  }
+function LazyVxeUI(app: any) {
+  app.use(VxeIcon)
+  app.use(VxeLoading)
+  // app.use(VxeVxeGrid)
+  app.use(VxeTooltip)
+  // app.use(VxeToolbar)
+  // app.use(VxePager)
+  // app.use(VxeForm)
+  // app.use(VxeFormItem)
+  // app.use(VxeFormGather)
+  // app.use(VxeCheckbox)
+  // app.use(VxeCheckboxGroup)
+  // app.use(VxeRadio)
+  // app.use(VxeRadioGroup)
+  // app.use(VxeRadioButton)
+  // app.use(VxeSwitch)
+  // app.use(VxeInput)
+  // app.use(VxeSelect)
+  // app.use(VxeOptgroup)
+  // app.use(VxeOption)
+  // app.use(VxeTextarea)
+  app.use(VxeButton)
+  // app.use(VxeButtonGroup)
+  app.use(VxeModal)
+  // app.use(VxeDrawer)
+  // app.use(VxeList)
+  // app.use(VxePulldown)
+}
+function LazyVxeTable(app: any) {
+  app.use(VxeTable)
+  app.use(VxeColumn)
+  app.use(VxeColgroup)
+  // app.use(VxeGrid)
+  app.use(VxeToolbar)
+}
 
+function registerComponent(app: App): void {
+  // icon-park
   app.component('icon-system', System)
   app.component('icon-check', Check)
   app.component('icon-menu-fold-one', MenuFoldOne)
   app.component('icon-menu-unfold-one', MenuUnfoldOne)
   app.component('icon-logout', Logout)
   app.component('icon-setting-two', SettingTwo)
+  // install(app)
+
+  // element-plus
+  app.use(ElementPlus)
+  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
+    app.component(key, component)
+  }
+
+  // vxe-table
+  VXETable.setI18n('zh-CN', zhCN)
+  VXETable.setLanguage('zh-CN')
+  VxeUI.use(VxeUIPluginRenderElement)
+  app.use(LazyVxeUI)
+  app.use(LazyVxeTable)
+
+  // 动态注册form文件夹下的组件
+  for (const key in modules) {
+    const name = key.replace(/^\.\/form\/|\.vue/g, '')
+    const component = (modules[key] as any).default
+    app.component('El' + name, component)
+  }
+
+  // 微服务 wujie
+  // app.use(WujieVue)
+
+  // 监控 sentry
+  // import.meta.env.VITE_SENTRY_DSN &&
+  // Sentry.init({
+  //   app,
+  //   dsn: import.meta.env.VITE_SENTRY_DSN,
+  //   integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
+  //   tracesSampleRate: 1.0,
+  //   tracePropagationTargets: [],
+  //   replaysSessionSampleRate: 0.1,
+  //   replaysOnErrorSampleRate: 1.0
+  // })
 }
 
 export default registerComponent

+ 2 - 33
src/main.ts

@@ -1,16 +1,7 @@
 import { createApp } from 'vue'
 import { createPinia } from 'pinia'
-import * as Sentry from '@sentry/vue'
-
-import 'uno.css'
-
-import ElementPlus from 'element-plus'
-import 'element-plus/dist/index.css'
-import * as ElementPlusIconsVue from '@element-plus/icons-vue'
-// import { install } from '@icon-park/vue-next/es/all'
 
 import registerComponent from '@/components/index'
-import registerVxeTable from '@/components/VxeTable'
 import directives from '@/directive'
 
 import FsAdminCore from '@fskj-admin/core'
@@ -20,40 +11,18 @@ import uploadConfig from './config/uploadConfig'
 import App from './App.vue'
 import router from './router'
 
+import 'uno.css'
 import './assets/main.css'
 import 'virtual:svg-icons-register'
 
-// import WujieVue from 'wujie-vue3'
-
 const app = createApp(App)
 
 app.use(createPinia())
 app.use(router)
-app.use(ElementPlus)
-
 app.use(FsAdminCore, {
   upload: uploadConfig
 })
-// app.use(WujieVue)
+app.use(registerComponent)
 app.use(directives)
-registerComponent(app)
-registerVxeTable(app)
-
-for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
-  app.component(key, component)
-}
-
-// install(app)
-
-import.meta.env.VITE_SENTRY_DSN &&
-  Sentry.init({
-    app,
-    dsn: import.meta.env.VITE_SENTRY_DSN,
-    integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
-    tracesSampleRate: 1.0,
-    tracePropagationTargets: [],
-    replaysSessionSampleRate: 0.1,
-    replaysOnErrorSampleRate: 1.0
-  })
 
 app.mount('#app')