优化体验
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -22,3 +22,10 @@ dist-ssr
|
|||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
|
||||||
|
/package-lock.json
|
||||||
|
/lib
|
||||||
|
.prettierrc
|
||||||
|
/oms/dist/
|
||||||
|
/project/*/index.js
|
||||||
|
/project/*/dist
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export default {
|
|||||||
return (this.apps || []).filter(e => !this.search || reg.test(e.name) || reg.test(e.label))
|
return (this.apps || []).filter(e => !this.search || reg.test(e.name) || reg.test(e.label))
|
||||||
},
|
},
|
||||||
selectedApp() {
|
selectedApp() {
|
||||||
return this.$route.name != "产品库"
|
return this.$route?.name != "产品库"
|
||||||
},
|
},
|
||||||
login() {
|
login() {
|
||||||
let url = '/auth/oauth/token';
|
let url = '/auth/oauth/token';
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import App from './examples/App.vue';
|
import App from './App.vue';
|
||||||
import ui from 'element-ui';
|
import ui from 'element-ui';
|
||||||
import createRoute from './examples/router/router';
|
import router from './router/router';
|
||||||
import axios from './examples/router/axios';
|
import axios from './router/axios';
|
||||||
import utils from './examples/utils';
|
import utils from './utils';
|
||||||
import vcUI from 'dvcp-ui';
|
import vcUI from 'dvcp-ui';
|
||||||
import 'dvcp-ui/lib/styles/common.scss';
|
import 'dvcp-ui/lib/styles/common.scss';
|
||||||
import 'dvcp-ui/lib/dvcp-ui.css';
|
import 'dvcp-ui/lib/dvcp-ui.css';
|
||||||
import store from './examples/store';
|
import store from './store';
|
||||||
|
|
||||||
Vue.use(ui);
|
Vue.use(ui);
|
||||||
Vue.use(vcUI);
|
Vue.use(vcUI);
|
||||||
@@ -16,10 +16,8 @@ Vue.config.productionTip = false;
|
|||||||
Vue.prototype.$axios = axios;
|
Vue.prototype.$axios = axios;
|
||||||
Vue.prototype.formatContent = (val) => val.replace(/(\r\n)|(\n)/g, '<br>');
|
Vue.prototype.formatContent = (val) => val.replace(/(\r\n)|(\n)/g, '<br>');
|
||||||
Object.keys(utils).map((e) => (Vue.prototype[e] = utils[e]));
|
Object.keys(utils).map((e) => (Vue.prototype[e] = utils[e]));
|
||||||
createRoute.then(router => {
|
new Vue({
|
||||||
new Vue({
|
router,
|
||||||
router,
|
store,
|
||||||
store,
|
render: (h) => h(App)
|
||||||
render: (h) => h(App)
|
}).$mount('#app');
|
||||||
}).$mount('#app');
|
|
||||||
})
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import store from "../store";
|
import store from "../store";
|
||||||
import appEntry from "../views/appEntry";
|
import appEntry from "../views/appEntry";
|
||||||
import {waiting} from "../utils";
|
import {waiting} from "../utils";
|
||||||
|
import router from "./router";
|
||||||
export default {
|
export default {
|
||||||
routes: [],
|
routes: [],
|
||||||
init() {
|
init() {
|
||||||
@@ -31,6 +31,7 @@ export default {
|
|||||||
}
|
}
|
||||||
//命名规范入口文件必须以App开头
|
//命名规范入口文件必须以App开头
|
||||||
waiting.setContent(`加载${name}...`)
|
waiting.setContent(`加载${name}...`)
|
||||||
|
router.addRoute(addApp)
|
||||||
this.routes.push(addApp)
|
this.routes.push(addApp)
|
||||||
return store.commit("addApp", addApp)
|
return store.commit("addApp", addApp)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,22 +1,18 @@
|
|||||||
import Vue from 'vue'
|
|
||||||
import VueRouter from 'vue-router'
|
import VueRouter from 'vue-router'
|
||||||
import autoRoutes from './autoRoutes'
|
import autoRoutes from './autoRoutes'
|
||||||
|
import Vue from "vue";
|
||||||
|
|
||||||
|
autoRoutes.init()
|
||||||
Vue.use(VueRouter)
|
Vue.use(VueRouter)
|
||||||
|
export default new VueRouter({
|
||||||
export default autoRoutes.init().then(() => new VueRouter({
|
|
||||||
mode: 'history',
|
mode: 'history',
|
||||||
hashbang: false,
|
hashbang: false,
|
||||||
routes: [
|
routes: [{path: "/", name: "产品库",component:import('../App')}],
|
||||||
{path: "/", name: "产品库"},
|
|
||||||
...autoRoutes.routes
|
|
||||||
],
|
|
||||||
scrollBehavior(to) {
|
scrollBehavior(to) {
|
||||||
console.log(to)
|
|
||||||
if (to.hash) {
|
if (to.hash) {
|
||||||
return {
|
return {
|
||||||
selector: to.hash
|
selector: to.hash
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}))
|
})
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ export const waiting = {
|
|||||||
div.style.zIndex = '202204271710'
|
div.style.zIndex = '202204271710'
|
||||||
div.style.textAlign = 'center'
|
div.style.textAlign = 'center'
|
||||||
div.style.lineHeight = '100vh'
|
div.style.lineHeight = '100vh'
|
||||||
|
div.style.color = '#26f'
|
||||||
|
div.style.background = 'rgba(0,0,0,.8)'
|
||||||
document.body.appendChild(div)
|
document.body.appendChild(div)
|
||||||
} else if (count < 10) {
|
} else if (count < 10) {
|
||||||
setTimeout(() => this.init(ops, ++count), 500)
|
setTimeout(() => this.init(ops, ++count), 500)
|
||||||
|
|||||||
@@ -10,6 +10,6 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<script type="module" src="main.js"></script>
|
<script type="module" src="/examples/main.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
3452
package-lock.json
generated
3452
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,7 @@ export default defineConfig({
|
|||||||
server: {
|
server: {
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
port: 8666,
|
port: 8666,
|
||||||
open: true,
|
open: 'index.html',
|
||||||
proxy: {
|
proxy: {
|
||||||
//设置代理,可解决跨5
|
//设置代理,可解决跨5
|
||||||
'/lan': {
|
'/lan': {
|
||||||
@@ -33,8 +33,5 @@ export default defineConfig({
|
|||||||
rewrite: path => path.replace(/^\/xsjr/, '')
|
rewrite: path => path.replace(/^\/xsjr/, '')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
optimizeDeps: {
|
|
||||||
exclude: ['@jiaminghi/data-view', 'vue-ruler-tool', 'vue-json-editor']
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user