2023-04-02 01:01:56 +08:00
import { createApp } from 'vue' ;
// global css
2023-12-14 08:17:12 +00:00
import 'virtual:uno.css' ;
2023-04-02 01:01:56 +08:00
import '@/assets/styles/index.scss' ;
import 'element-plus/theme-chalk/dark/css-vars.css' ;
// App、router、store
import App from './App.vue' ;
import store from './store' ;
import router from './router' ;
2025-05-30 17:56:05 +08:00
import { TUIComponents , TUIChatKit } from './TUIKit' ;
import { TUIStore , StoreName , TUITranslateService } from '@tencentcloud/chat-uikit-engine' ;
import TUINotification from './TUIKit/components/TUINotification/index' ;
2023-04-02 01:01:56 +08:00
// 自定义指令
import directive from './directive' ;
// 注册插件
import plugins from './plugins/index' ; // plugins
2024-03-05 14:57:51 +00:00
// 高亮组件
// import 'highlight.js/styles/a11y-light.css';
import 'highlight.js/styles/atom-one-dark.css' ;
import 'highlight.js/lib/common' ;
import HighLight from '@highlightjs/vue-plugin' ;
2023-04-02 01:01:56 +08:00
// svg图标
import 'virtual:svg-icons-register' ;
2025-02-07 09:27:59 +00:00
import ElementIcons from '@/plugins/svgicon' ;
2023-04-02 01:01:56 +08:00
// permission control
import './permission' ;
2023-04-18 23:36:26 +08:00
// 国际化
import i18n from '@/lang/index' ;
2024-01-26 09:58:00 +08:00
// vxeTable
import VXETable from 'vxe-table' ;
import 'vxe-table/lib/style.css' ;
2025-04-22 15:23:36 +08:00
VXETable . setConfig ( {
2024-01-26 09:58:00 +08:00
zIndex : 999999
} ) ;
2024-02-23 07:23:20 +00:00
// 修改 el-dialog 默认点击遮照为不关闭
import { ElDialog } from 'element-plus' ;
ElDialog . props . closeOnClickModal . default = false ;
2023-04-02 01:01:56 +08:00
const app = createApp ( App ) ;
2025-06-05 15:55:52 +08:00
/*app.component('MyComponent', MyComponent)*/
2024-03-05 14:57:51 +00:00
app . use ( HighLight ) ;
2025-02-07 09:27:59 +00:00
app . use ( ElementIcons ) ;
2023-04-02 01:01:56 +08:00
app . use ( router ) ;
app . use ( store ) ;
2023-04-18 23:36:26 +08:00
app . use ( i18n ) ;
2024-01-26 09:58:00 +08:00
app . use ( VXETable ) ;
2023-04-02 01:01:56 +08:00
app . use ( plugins ) ;
// 自定义指令
directive ( app ) ;
app . mount ( '#app' ) ;
2025-05-30 17:56:05 +08:00
const SDKAppID = 1600089570 ; // Your SDKAppID
const secretKey = 'b84abcf1d5c41a702b1c63fe50adaa1bc77cc51233d0073f044e25c6f21fcb58' ;
const userSig =
'eJyrVgrxCdYrSy1SslIy0jNQ0gHzM1NS80oy0zLBwpX5pUCUk5mYl16ckZgPVVKckp1YUJCZomRlaGZgYGBhaWpuAJFJrSjILEoFipuamhoBpSCiJZm5IDFzEwtTSwsTY2OoKZnpQBtcPYq8XMvLkiKjTC1yDPLcM53zI7yS3POLLfyyDSNzK0ucjMOT-Q1Lgn09bZVqAf37Nfg_' ; // Your secretKey
TUIChatKit . components ( TUIComponents , app ) ;
TUIChatKit . init ( ) ;
/ * *
* Init TUINotification configuration .
* /
TUINotification . setNotificationConfiguration ( {
showPreviews : true ,
allowNotifications : true ,
notificationTitle : 'Tencent Cloud Chat' ,
notificationIcon : 'https://web.sdk.qcloud.com/im/demo/latest/faviconnew.png'
} ) ;
/ * *
* Listen for new messages and use notification components .
* This capability is only available in the web environment .
* /
TUIStore . watch ( StoreName . CHAT , {
newMessageList : ( newMessageList : unknown ) = > {
if ( Array . isArray ( newMessageList ) ) {
newMessageList . forEach ( ( message ) = > TUINotification . notify ( message ) ) ;
}
}
} ) ;
export { SDKAppID , secretKey , userSig } ;