|
@@ -1,118 +1,155 @@
|
|
|
-import Vue from "vue";
|
|
|
-import axios from "./router/axios";
|
|
|
-import VueAxios from "vue-axios";
|
|
|
-import App from "./App";
|
|
|
-import router from "./router/router";
|
|
|
-import "./permission"; // 权限
|
|
|
-import "./error"; // 日志
|
|
|
-import "./cache"; //页面缓存
|
|
|
-import store from "./store";
|
|
|
-import { loadStyle } from "./util/util";
|
|
|
-import * as urls from "@/config/env";
|
|
|
-import Element from "element-ui";
|
|
|
-import { iconfontUrl, iconfontVersion } from "@/config/env";
|
|
|
-import i18n from "./lang"; // Internationalization
|
|
|
-import "./styles/common.scss";
|
|
|
-import basicBlock from "./components/basic-block/main";
|
|
|
-import basicContainer from "./components/basic-container/main";
|
|
|
-import thirdRegister from "./components/third-register/main";
|
|
|
-import avueUeditor from "avue-plugin-ueditor";
|
|
|
-import website from "@/config/website";
|
|
|
-import crudCommon from "@/mixins/crud";
|
|
|
-import Example from "./components/example";
|
|
|
-import Pagination from "./components/Pagination";
|
|
|
+import Vue from 'vue'
|
|
|
+import axios from './router/axios'
|
|
|
+import VueAxios from 'vue-axios'
|
|
|
+import App from './App'
|
|
|
+import router from './router/router'
|
|
|
+import './permission' // 权限
|
|
|
+import './error' // 日志
|
|
|
+import './cache' //页面缓存
|
|
|
+import store from './store'
|
|
|
+import { loadStyle } from './util/util'
|
|
|
+import * as urls from '@/config/env'
|
|
|
+import Element from 'element-ui'
|
|
|
+import { iconfontUrl, iconfontVersion } from '@/config/env'
|
|
|
+import i18n from './lang' // Internationalization
|
|
|
+import './styles/common.scss'
|
|
|
+import basicBlock from './components/basic-block/main'
|
|
|
+import basicContainer from './components/basic-container/main'
|
|
|
+import thirdRegister from './components/third-register/main'
|
|
|
+import avueUeditor from 'avue-plugin-ueditor'
|
|
|
+import website from '@/config/website'
|
|
|
+import crudCommon from '@/mixins/crud'
|
|
|
+import Example from './components/example'
|
|
|
+import Pagination from './components/Pagination'
|
|
|
|
|
|
//cdn迁移进src目录
|
|
|
-import "./assets/cdn/element-ui/2.15.1/theme-chalk/index.css";
|
|
|
-import "./assets/cdn/animate/3.5.2/animate.css";
|
|
|
-import "./assets/cdn/iconfont/avue/iconfont.css";
|
|
|
-import "./assets/cdn/iconfont/saber/iconfont.css";
|
|
|
-import "./assets/cdn/avue/2.8.18/index.css";
|
|
|
-import { set } from "nprogress";
|
|
|
+import './assets/cdn/element-ui/2.15.1/theme-chalk/index.css'
|
|
|
+import './assets/cdn/animate/3.5.2/animate.css'
|
|
|
+import './assets/cdn/iconfont/avue/iconfont.css'
|
|
|
+import './assets/cdn/iconfont/saber/iconfont.css'
|
|
|
+import './assets/cdn/avue/2.8.18/index.css'
|
|
|
+import { set } from 'nprogress'
|
|
|
|
|
|
// 注册全局crud驱动
|
|
|
-window.$crudCommon = crudCommon;
|
|
|
+window.$crudCommon = crudCommon
|
|
|
// 加载Vue拓展
|
|
|
-Vue.use(router);
|
|
|
-Vue.use(VueAxios, axios);
|
|
|
+Vue.use(router)
|
|
|
+Vue.use(VueAxios, axios)
|
|
|
Vue.use(Element, {
|
|
|
i18n: (key, value) => i18n.t(key, value),
|
|
|
-});
|
|
|
+})
|
|
|
Vue.use(window.AVUE, {
|
|
|
- size: "small",
|
|
|
- tableSize: "small",
|
|
|
+ size: 'small',
|
|
|
+ tableSize: 'small',
|
|
|
calcHeight: 65,
|
|
|
i18n: (key, value) => i18n.t(key, value),
|
|
|
-});
|
|
|
-Vue.use(Example);
|
|
|
-Vue.use(Pagination);
|
|
|
+})
|
|
|
+Vue.use(Example)
|
|
|
+Vue.use(Pagination)
|
|
|
+Vue.use(set)
|
|
|
+
|
|
|
+Element.Select.props.filterable = {
|
|
|
+ type: Boolean,
|
|
|
+ default: true,
|
|
|
+}
|
|
|
+Element.Select.props.clearable = {
|
|
|
+ type: Boolean,
|
|
|
+ default: true,
|
|
|
+}
|
|
|
+Element.TimePicker.props.editable = {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+}
|
|
|
+Element.TimeSelect.props.editable = {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+}
|
|
|
+Element.DatePicker.props.editable = {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+}
|
|
|
+Element.Dialog.props.closeOnClickModal.default = false
|
|
|
+Element.Dialog.props.appendToBody.default = true
|
|
|
|
|
|
// 注册全局容器
|
|
|
-Vue.component("basicContainer", basicContainer);
|
|
|
-Vue.component("basicBlock", basicBlock);
|
|
|
-Vue.component("thirdRegister", thirdRegister);
|
|
|
-Vue.component("avueUeditor", avueUeditor);
|
|
|
-Vue.component("Example", Example);
|
|
|
-Vue.component("Pagination", Pagination);
|
|
|
+Vue.component('basicContainer', basicContainer)
|
|
|
+Vue.component('basicBlock', basicBlock)
|
|
|
+Vue.component('thirdRegister', thirdRegister)
|
|
|
+Vue.component('avueUeditor', avueUeditor)
|
|
|
+Vue.component('Example', Example)
|
|
|
+Vue.component('Pagination', Pagination)
|
|
|
+
|
|
|
+Vue.prototype.msgSuccess = function (msg) {
|
|
|
+ this.$message({ showClose: true, message: msg, type: 'success' })
|
|
|
+}
|
|
|
+
|
|
|
+Vue.prototype.msgError = function (msg) {
|
|
|
+ this.$message({ showClose: true, message: msg, type: 'error' })
|
|
|
+}
|
|
|
+
|
|
|
+Vue.prototype.msgWarning = function (msg) {
|
|
|
+ this.$message({ showClose: true, message: msg, type: 'warning' })
|
|
|
+}
|
|
|
+
|
|
|
+Vue.prototype.msgInfo = function (msg) {
|
|
|
+ this.$message.info(msg)
|
|
|
+}
|
|
|
|
|
|
// 加载相关url地址
|
|
|
Object.keys(urls).forEach((key) => {
|
|
|
- Vue.prototype[key] = urls[key];
|
|
|
-});
|
|
|
+ Vue.prototype[key] = urls[key]
|
|
|
+})
|
|
|
// 加载website
|
|
|
-Vue.prototype.website = website;
|
|
|
+Vue.prototype.website = website
|
|
|
// 动态加载阿里云字体库
|
|
|
iconfontVersion.forEach((ele) => {
|
|
|
- loadStyle(iconfontUrl.replace("$key", ele));
|
|
|
-});
|
|
|
+ loadStyle(iconfontUrl.replace('$key', ele))
|
|
|
+})
|
|
|
|
|
|
//乾坤代码
|
|
|
-Vue.config.productionTip = false;
|
|
|
-let instance = null;
|
|
|
+Vue.config.productionTip = false
|
|
|
+let instance = null
|
|
|
function render({ props = {} } = {}) {
|
|
|
- const { container } = props;
|
|
|
+ const { container } = props
|
|
|
instance = new Vue({
|
|
|
router,
|
|
|
store,
|
|
|
i18n,
|
|
|
|
|
|
render: (h) => h(App),
|
|
|
- }).$mount(
|
|
|
- container ? container.querySelector("#fjhxCloudVue") : "#fjhxCloudVue"
|
|
|
- );
|
|
|
- console.log(instance);
|
|
|
+ }).$mount(container ? container.querySelector('#fjhxCloudVue') : '#fjhxCloudVue')
|
|
|
+ console.log(instance)
|
|
|
}
|
|
|
|
|
|
// 独立运行时
|
|
|
-(function () {
|
|
|
- console.log(window.__POWERED_BY_QIANKUN__);
|
|
|
+;(function () {
|
|
|
+ console.log(window.__POWERED_BY_QIANKUN__)
|
|
|
if (window.__POWERED_BY_QIANKUN__) {
|
|
|
- __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
|
|
|
+ __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__
|
|
|
} else {
|
|
|
- render();
|
|
|
+ render()
|
|
|
}
|
|
|
-})();
|
|
|
+})()
|
|
|
|
|
|
export async function bootstrap() {
|
|
|
- console.log("vue app bootstraped");
|
|
|
+ console.log('vue app bootstraped')
|
|
|
}
|
|
|
export async function mount(props) {
|
|
|
-
|
|
|
props.onGlobalStateChange((state, prev) => {
|
|
|
// state: 变更后的状态; prev 变更前的状态
|
|
|
- console.log(state, prev,'子组件监听');
|
|
|
- });
|
|
|
- props.setGlobalState({asd:21312312})
|
|
|
+ console.log(state, prev, '子组件监听')
|
|
|
+ })
|
|
|
+ props.setGlobalState({ asd: 21312312 })
|
|
|
console.log(props)
|
|
|
- render(props);
|
|
|
+ render(props)
|
|
|
}
|
|
|
export async function unmount() {
|
|
|
- instance.$destroy();
|
|
|
- instance.$el.innerHTML = "";
|
|
|
- instance = null;
|
|
|
+ instance.$destroy()
|
|
|
+ instance.$el.innerHTML = ''
|
|
|
+ instance = null
|
|
|
// router = null;
|
|
|
}
|
|
|
-Vue.config.productionTip = false;
|
|
|
+Vue.config.productionTip = false
|
|
|
|
|
|
// new Vue({
|
|
|
// router,
|