feat: harden ai agent admin workflow experience
This commit is contained in:
@@ -1,68 +1,35 @@
|
||||
import { createApp, watchEffect } from 'vue';
|
||||
|
||||
import { registerAccessDirective } from '@vben/access';
|
||||
import { registerLoadingDirective } from '@vben/common-ui';
|
||||
import { preferences } from '@vben/preferences';
|
||||
import { initStores } from '@vben/stores';
|
||||
import '@vben/styles';
|
||||
import '@vben/styles/ele';
|
||||
|
||||
import { useTitle } from '@vueuse/core';
|
||||
import ElementPlus from 'element-plus';
|
||||
|
||||
import { $t, setupI18n } from '#/locales';
|
||||
import { useAppContextStore } from '#/store/app-context';
|
||||
|
||||
import { initComponentAdapter } from './adapter/component';
|
||||
import { initSetupVbenForm, useVbenForm } from './adapter/form';
|
||||
import App from './app.vue';
|
||||
import { initMessageAdapter } from './adapter/message';
|
||||
import { setupElementPlus } from './plugins/element-plus';
|
||||
import { setupZqTable } from './components/zq-table';
|
||||
import { router } from './router';
|
||||
|
||||
import 'element-plus/theme-chalk/base.css';
|
||||
import 'element-plus/theme-chalk/dark/css-vars.css';
|
||||
import 'element-plus/theme-chalk/el-overlay.css';
|
||||
import 'element-plus/theme-chalk/el-popper.css';
|
||||
import 'element-plus/theme-chalk/el-icon.css';
|
||||
import 'element-plus/theme-chalk/el-button.css';
|
||||
import 'element-plus/theme-chalk/el-button-group.css';
|
||||
import 'element-plus/theme-chalk/el-checkbox.css';
|
||||
import 'element-plus/theme-chalk/el-checkbox-button.css';
|
||||
import 'element-plus/theme-chalk/el-checkbox-group.css';
|
||||
import 'element-plus/theme-chalk/el-radio.css';
|
||||
import 'element-plus/theme-chalk/el-radio-button.css';
|
||||
import 'element-plus/theme-chalk/el-radio-group.css';
|
||||
import 'element-plus/theme-chalk/el-input.css';
|
||||
import 'element-plus/theme-chalk/el-input-number.css';
|
||||
import 'element-plus/theme-chalk/el-select.css';
|
||||
import 'element-plus/theme-chalk/el-select-v2.css';
|
||||
import 'element-plus/theme-chalk/el-select-dropdown.css';
|
||||
import 'element-plus/theme-chalk/el-select-dropdown-v2.css';
|
||||
import 'element-plus/theme-chalk/el-option.css';
|
||||
import 'element-plus/theme-chalk/el-option-group.css';
|
||||
import 'element-plus/theme-chalk/el-tree.css';
|
||||
import 'element-plus/theme-chalk/el-tree-select.css';
|
||||
import 'element-plus/theme-chalk/el-form.css';
|
||||
import 'element-plus/theme-chalk/el-form-item.css';
|
||||
import 'element-plus/theme-chalk/el-table.css';
|
||||
import 'element-plus/theme-chalk/el-table-column.css';
|
||||
import 'element-plus/theme-chalk/el-card.css';
|
||||
import 'element-plus/theme-chalk/el-dialog.css';
|
||||
import 'element-plus/theme-chalk/el-message.css';
|
||||
import 'element-plus/theme-chalk/el-message-box.css';
|
||||
import 'element-plus/theme-chalk/el-notification.css';
|
||||
import 'element-plus/theme-chalk/el-popover.css';
|
||||
import 'element-plus/theme-chalk/el-tooltip.css';
|
||||
import 'element-plus/theme-chalk/el-scrollbar.css';
|
||||
import 'element-plus/theme-chalk/el-empty.css';
|
||||
import 'element-plus/theme-chalk/el-tag.css';
|
||||
import 'element-plus/theme-chalk/el-pagination.css';
|
||||
import 'element-plus/theme-chalk/el-loading.css';
|
||||
import 'element-plus/theme-chalk/el-divider.css';
|
||||
import 'element-plus/theme-chalk/el-skeleton.css';
|
||||
import 'element-plus/theme-chalk/el-skeleton-item.css';
|
||||
import 'element-plus/theme-chalk/el-cascader.css';
|
||||
import 'element-plus/theme-chalk/el-cascader-panel.css';
|
||||
import 'element-plus/theme-chalk/el-date-picker.css';
|
||||
|
||||
async function bootstrap(namespace: string) {
|
||||
// 初始化组件适配器
|
||||
await initComponentAdapter();
|
||||
|
||||
// 初始化表单组件
|
||||
await initSetupVbenForm();
|
||||
|
||||
// 初始化 ZqTable (注入 form)
|
||||
setupZqTable({
|
||||
useVbenForm,
|
||||
});
|
||||
|
||||
// // 设置弹窗的默认配置
|
||||
// setDefaultModalProps({
|
||||
// fullscreenButton: false,
|
||||
@@ -73,8 +40,15 @@ async function bootstrap(namespace: string) {
|
||||
// });
|
||||
const app = createApp(App);
|
||||
|
||||
setupElementPlus(app);
|
||||
initMessageAdapter();
|
||||
app.use(ElementPlus);
|
||||
|
||||
// 注册Element Plus提供的v-loading指令
|
||||
|
||||
// 注册Vben提供的v-loading和v-spinning指令
|
||||
registerLoadingDirective(app, {
|
||||
loading: false, // Vben提供的v-loading指令和Element Plus提供的v-loading指令二选一即可,此处false表示不注册Vben提供的v-loading指令
|
||||
spinning: 'spinning',
|
||||
});
|
||||
|
||||
// 国际化 i18n 配置
|
||||
await setupI18n(app);
|
||||
@@ -153,6 +127,7 @@ async function bootstrap(namespace: string) {
|
||||
});
|
||||
|
||||
// 初始化应用上下文(从 URL 参数中获取 appCode)
|
||||
const { useAppContextStore } = await import('#/store/app-context');
|
||||
const appContextStore = useAppContextStore();
|
||||
await appContextStore.initFromUrl();
|
||||
|
||||
@@ -166,6 +141,10 @@ async function bootstrap(namespace: string) {
|
||||
// 配置路由及路由守卫
|
||||
app.use(router);
|
||||
|
||||
// 配置Motion插件
|
||||
const { MotionPlugin } = await import('@vben/plugins/motion');
|
||||
app.use(MotionPlugin);
|
||||
|
||||
// 动态更新标题
|
||||
watchEffect(() => {
|
||||
if (preferences.app.dynamicTitle) {
|
||||
|
||||
Reference in New Issue
Block a user