123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346 |
- import { App, createApp } from "vue";
- import MainApp from "./App.vue";
- // reset style sheet
- import "@/styles/index.scss";
- // CSS common style sheet
- import "@/styles/common.scss";
- // iconfont css
- import "@/assets/iconfont/iconfont.css";
- // import "@/assets/iconfont/iconfont.js";
- // font css
- import "@/assets/fonts/font.scss";
- // element css
- import "element-plus/dist/index.css";
- // element dark css
- import "element-plus/theme-chalk/dark/css-vars.css";
- // custom element dark css
- import "@/styles/theme/element-dark.scss";
- // custom element css
- import "@/styles/element.scss";
- import "@vue-office/docx/lib/index.css";
- import "@vue-office/excel/lib/index.css";
- // postcss-pxtorem
- // import "@/utils/rem";
- // svg icons
- import "virtual:svg-icons-register";
- // element plus
- // import ElementPlus from "element-plus";
- // element icons
- // import * as Icons from "@element-plus/icons-vue";
- // custom directives
- import directives from "@/directives/index";
- // vue Router
- import router from "@/routers";
- // vue i18n
- import I18n from "@/languages/index";
- // pinia store
- import pinia from "@/stores";
- // errorHandler
- import errorHandler from "@/utils/errorHandler";
- import Toast from "vue-toastification";
- // import "vue-toastification/dist/index.css";
- import "@/styles/var/toastification.scss";
- // vant css
- import "vant/lib/tabs/style";
- import "vant/lib/tab/style";
- import "vant/lib/cell/style";
- import "vant/lib/cell-group/style";
- import "vant/lib/empty/style";
- // 打印模块
- import { hiPrintPlugin } from "vue-plugin-hiprint";
- import {
- ElAutocomplete,
- ElBacktop,
- ElBadge,
- ElImage,
- ElImageViewer,
- ElInput,
- ElInputNumber,
- ElDatePicker,
- ElSelect,
- ElSelectV2,
- ElTreeSelect,
- ElSwitch,
- ElStatistic,
- ElCheckbox,
- ElCheckboxGroup,
- ElCheckboxButton,
- ElNotification,
- ElProgress,
- ElRadio,
- ElRadioButton,
- ElRadioGroup,
- ElResult,
- ElSpace,
- ElSegmented,
- ElText,
- ElTag,
- ElCheckTag,
- ElTimeline,
- ElTimelineItem,
- ElUpload
- } from "element-plus";
- // vxe-table
- // import XEUtils from "xe-utils";
- // import {
- // // 全局对象
- // VXETable,
- // // 表格功能
- // Filter,
- // Edit,
- // Menu,
- // Export,
- // Keyboard,
- // Validator,
- // // 可选组件
- // Icon,
- // Column,
- // Colgroup,
- // Grid,
- // Tooltip,
- // Toolbar,
- // Pager,
- // Form,
- // FormItem,
- // FormGather,
- // Checkbox,
- // CheckboxGroup,
- // Radio,
- // RadioGroup,
- // RadioButton,
- // Switch,
- // Input,
- // Select,
- // Optgroup,
- // Option,
- // Textarea,
- // Button,
- // Modal,
- // List,
- // Pulldown,
- // // 表格
- // Table
- // } from "vxe-table";
- import {
- VxeUI,
- VxeButton,
- VxeButtonGroup,
- VxeDrawer,
- VxeForm,
- VxeFormGroup,
- VxeFormItem,
- VxeIcon,
- VxeInput,
- VxeLoading,
- VxeModal,
- VxePager,
- VxePrint,
- VxeSelect,
- VxeTooltip,
- VxeUpload
- } from "vxe-pc-ui";
- import { VxeTable, VxeColumn, VxeColgroup, VxeGrid, VxeToolbar } from "vxe-table";
- // 导入主题变量,也可以重写主题变量
- import "vxe-table/styles/cssvar.scss";
- import "vxe-pc-ui/styles/cssvar.scss";
- // import "vxe-table/styles/variable.scss";
- // import "vxe-table/styles/cssvar.scss";
- // import "vxe-table/lib/style.css";
- import "@/styles/var/vxe-variable.scss";
- import "@/styles/var/vant-variable.scss";
- import { Tab as VanTab, Tabs as VanTabs, Cell, CellGroup, Empty as VanEmpty } from "vant";
- import VxeUIPluginRenderElement from "@vxe-ui/plugin-render-element";
- import "@vxe-ui/plugin-render-element/dist/style.css";
- VxeUI.use(VxeUIPluginRenderElement);
- // 按需加载的方式默认是不带国际化的,自定义国际化需要自行解析占位符 '{0}',例如:
- // VXETable.setup({
- // // @ts-ignore
- // i18n: (key, args) => I18n.global.t(key, args),
- // // 重置vxetable的图标
- // icon: {
- // TABLE_FILTER_NONE: "iconfont iconfilter-funnel-01",
- // TABLE_FILTER_MATCH: "iconfont iconfilter-funnel-01-fill"
- // }
- // });
- import "@/components/LjVxeTable/interface/plugins.tsx";
- function useTable(app: App) {
- app.use(lazyVxeUI).use(lazyVxeTable);
- // // 表格功能
- // app.use(Filter).use(Edit).use(Menu).use(Export).use(Keyboard).use(Validator);
- // // 可选组件
- // app
- // .use(Icon)
- // .use(Column)
- // .use(Colgroup)
- // .use(Grid)
- // .use(Tooltip)
- // .use(Toolbar)
- // .use(Pager)
- // .use(Form)
- // .use(FormItem)
- // .use(FormGather)
- // .use(Checkbox)
- // .use(CheckboxGroup)
- // .use(Radio)
- // .use(RadioGroup)
- // .use(RadioButton)
- // .use(Switch)
- // .use(Input)
- // .use(Select)
- // .use(Optgroup)
- // .use(Option)
- // .use(Textarea)
- // .use(Button)
- // .use(Modal)
- // .use(List)
- // .use(Pulldown)
- // // 安装表格
- // .use(Table);
- }
- // import VXETable from "vxe-table";
- // import "vxe-table/lib/style.css";
- // // 按需加载的方式默认是不带国际化的,自定义国际化需要自行解析占位符 '{0}',例如:
- // VXETable.setup({
- // i18n: (key, args) => I18n.global.t(key, args)
- // });
- // function useTable(app: App) {
- // app.use(VXETable);
- // }
- // 可选组件
- function lazyVxeUI(app: App) {
- app.use(VxeButton);
- app.use(VxeButtonGroup);
- app.use(VxeDrawer);
- app.use(VxeForm);
- app.use(VxeFormGroup);
- app.use(VxeFormItem);
- app.use(VxeIcon);
- app.use(VxeInput);
- app.use(VxeLoading);
- app.use(VxeModal);
- app.use(VxePager);
- app.use(VxePrint);
- app.use(VxeSelect);
- app.use(VxeTooltip);
- app.use(VxeUpload);
- }
- function lazyVxeTable(app: App) {
- app.use(VxeTable);
- app.use(VxeColumn);
- app.use(VxeColgroup);
- app.use(VxeGrid);
- app.use(VxeToolbar);
- }
- VxeUI.setConfig({
- zIndex: 3000,
- // 对组件内置的提示语进行国际化翻译
- i18n: (key: any, args: any) => I18n.global.t(key, args)
- });
- // 重置vxetable的图标
- VxeUI.setIcon({
- TABLE_FILTER_NONE: "iconfont iconfilter-funnel-01",
- TABLE_FILTER_MATCH: "iconfont iconfilter-funnel-01-fill"
- });
- const app = createApp(MainApp);
- app.config.errorHandler = errorHandler;
- // app.config.globalProperties.$toast = Toast;
- app.use(Toast, {
- transition: "Vue-Toastification__fade",
- maxToasts: 20,
- newestOnTop: true,
- position: "top-right",
- timeout: 5000,
- closeOnClick: false,
- pauseOnFocusLoss: true,
- pauseOnHover: true,
- draggable: true,
- // draggablePercent: 0.6,
- showCloseButtonOnHover: false,
- hideProgressBar: false,
- closeButton: "button",
- icon: true,
- rtl: false
- });
- // register the element Icons component
- // Object.keys(Icons).forEach(key => {
- // app.component(key, Icons[key as keyof typeof Icons]);
- // });
- app.use(directives).use(router).use(I18n).use(pinia).mount("#app");
- app.use(useTable);
- app.use(hiPrintPlugin);
- hiPrintPlugin.install(app);
- // hiPrintPlugin.disAutoConnect();
- app.use(ElAutocomplete);
- app.use(ElBacktop);
- app.use(ElBadge);
- app.use(ElDatePicker);
- app.use(ElImage);
- app.use(ElImageViewer);
- app.use(ElInput);
- app.use(ElInputNumber);
- app.use(ElSelect);
- app.use(ElSelectV2);
- app.use(ElTreeSelect);
- app.use(ElSwitch);
- app.use(ElStatistic);
- app.use(ElCheckbox);
- app.use(ElCheckboxGroup);
- app.use(ElCheckboxButton);
- app.use(ElNotification);
- app.use(ElProgress);
- app.use(ElRadio);
- app.use(ElRadioButton);
- app.use(ElRadioGroup);
- app.use(ElResult);
- app.use(ElSpace);
- app.use(ElSegmented);
- app.use(ElText);
- app.use(ElTag);
- app.use(ElCheckTag);
- app.use(ElTimeline);
- app.use(ElTimelineItem);
- app.use(ElUpload);
- // vant init
- app.use(VanTabs);
- app.use(VanTab);
- app.use(Cell);
- app.use(CellGroup);
- app.use(VanEmpty);
- // 引入函数式弹窗
- import Dialog from "@/utils/dialog";
- // 挂载到app
- app.config.globalProperties.$dialog = Dialog;
|